00001 /***************************************************************************** 00002 * Project: RooFit * 00003 * Package: RooFitCore * 00004 * File: $Id: RooNumGenFactory.h 28259 2009-04-16 16:21:16Z wouter $ 00005 * Authors: * 00006 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu * 00007 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu * 00008 * * 00009 * Copyright (c) 2000-2005, Regents of the University of California * 00010 * and Stanford University. All rights reserved. * 00011 * * 00012 * Redistribution and use in source and binary forms, * 00013 * with or without modification, are permitted according to the terms * 00014 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) * 00015 *****************************************************************************/ 00016 #ifndef ROO_NUM_GEN_FACTORY 00017 #define ROO_NUM_GEN_FACTORY 00018 00019 #include <map> 00020 #include <string> 00021 #include "TObject.h" 00022 #include "RooLinkedList.h" 00023 #include "RooAbsNumGenerator.h" 00024 class RooNumGenConfig ; 00025 class RooAbsReal ; 00026 00027 class RooNumGenFactory ; 00028 typedef void (*RooNumGenInitializerFunc)(RooNumGenFactory&) ; 00029 00030 class RooNumGenFactory : public TObject { 00031 public: 00032 00033 static RooNumGenFactory& instance() ; 00034 virtual ~RooNumGenFactory(); 00035 00036 Bool_t storeProtoSampler(RooAbsNumGenerator* proto, const RooArgSet& defConfig) ; 00037 const RooAbsNumGenerator* getProtoSampler(const char* name) ; 00038 00039 RooAbsNumGenerator* createSampler(RooAbsReal& func, const RooArgSet& genVars, const RooArgSet& condVars, 00040 const RooNumGenConfig& config, Bool_t verbose=kFALSE, RooAbsReal* maxFuncVal=0) ; 00041 00042 static void cleanup() ; 00043 00044 00045 protected: 00046 00047 friend class RooNumGenConfig ; 00048 00049 std::map<std::string,RooAbsNumGenerator*> _map ; 00050 00051 RooNumGenFactory(); 00052 RooNumGenFactory(const RooNumGenFactory& other) ; 00053 00054 static RooNumGenFactory* _instance ; 00055 00056 00057 ClassDef(RooNumGenFactory,1) // Numeric Generator factory 00058 }; 00059 00060 #endif 00061 00062