RooAbsNumGenerator.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooAbsNumGenerator.h 36209 2010-10-08 21:37:36Z 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_ABS_NUM_GENERATOR
00017 #define ROO_ABS_NUM_GENERATOR
00018 
00019 #include "TNamed.h"
00020 #include "RooPrintable.h"
00021 #include "RooArgSet.h"
00022 #include "RooArgList.h"
00023 
00024 class RooAbsReal;
00025 class RooRealVar;
00026 class RooDataSet;
00027 class RooRealBinding;
00028 class RooNumGenConfig ;
00029 
00030 class RooAbsNumGenerator : public TNamed, public RooPrintable {
00031 public:
00032   RooAbsNumGenerator() : _cloneSet(0), _funcClone(0), _funcMaxVal(0), _verbose(kFALSE), _isValid(kFALSE), _funcValStore(0), _funcValPtr(0), _cache(0) {} ;
00033   RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
00034   virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars, 
00035                                     const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const = 0 ;
00036 
00037   Bool_t isValid() const { 
00038     // If true, generator is in a valid state
00039     return _isValid; 
00040   }
00041   virtual ~RooAbsNumGenerator();
00042 
00043   inline void setVerbose(Bool_t verbose= kTRUE) {
00044     // If flag is true, verbose messaging will be active during generation
00045     _verbose= verbose; 
00046   }
00047   inline Bool_t isVerbose() const { 
00048     // Return status of verbose messaging flag
00049     return _verbose; 
00050   }
00051 
00052   virtual const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio) = 0;
00053   virtual Double_t getFuncMax() { return 0 ; }
00054 
00055    inline virtual void Print(Option_t *options= 0) const {
00056      // ascii printing interface     
00057     printStream(defaultPrintStream(),defaultPrintContents(options),defaultPrintStyle(options));
00058   }
00059 
00060   virtual void printName(ostream& os) const ;
00061   virtual void printTitle(ostream& os) const ;
00062   virtual void printClassName(ostream& os) const ;
00063   virtual void printArgs(ostream& os) const ;
00064   
00065   void attachParameters(const RooArgSet& vars) ;
00066 
00067   // Advertisement of capabilities
00068   virtual Bool_t canSampleCategories() const { return kFALSE ; }
00069   virtual Bool_t canSampleConditional() const { return kFALSE ; } // Must implement getFuncMax() 
00070 
00071 protected:
00072 
00073   RooArgSet *_cloneSet;                // Set owning clone of input function
00074   RooAbsReal *_funcClone;              // Pointer to top level node of cloned function
00075   const RooAbsReal *_funcMaxVal ;      // Container for maximum function value
00076   RooArgSet _catVars,_realVars ;       // Sets of discrete and real valued observabeles
00077   Bool_t _verbose, _isValid;           // Verbose and valid flag
00078   RooRealVar *_funcValStore,*_funcValPtr; // RRVs storing function value in context and in output dataset
00079 
00080   RooDataSet *_cache;                  // Dataset holding generared values of observables
00081 
00082   ClassDef(RooAbsNumGenerator,0) // Abstract base class for numeric event generator algorithms
00083 };
00084 
00085 #endif

Generated on Tue Jul 5 14:25:59 2011 for ROOT_528-00b_version by  doxygen 1.5.1