Logo ROOT  
Reference Guide
RooAbsNumGenerator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_ABS_NUM_GENERATOR
17 #define ROO_ABS_NUM_GENERATOR
18 
19 #include "TNamed.h"
20 #include "RooPrintable.h"
21 #include "RooArgSet.h"
22 #include "RooArgList.h"
23 
24 class RooAbsReal;
25 class RooRealVar;
26 class RooDataSet;
27 class RooRealBinding;
28 class RooNumGenConfig ;
29 
30 class RooAbsNumGenerator : public TNamed, public RooPrintable {
31 public:
33  RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0);
34  virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars,
35  const RooNumGenConfig& config, Bool_t verbose=kFALSE, const RooAbsReal* maxFuncVal=0) const = 0 ;
36 
37  Bool_t isValid() const {
38  // If true, generator is in a valid state
39  return _isValid;
40  }
41  virtual ~RooAbsNumGenerator();
42 
43  inline void setVerbose(Bool_t verbose= kTRUE) {
44  // If flag is true, verbose messaging will be active during generation
45  _verbose= verbose;
46  }
47  inline Bool_t isVerbose() const {
48  // Return status of verbose messaging flag
49  return _verbose;
50  }
51 
52  virtual const RooArgSet *generateEvent(UInt_t remaining, Double_t& resampleRatio) = 0;
53  virtual Double_t getFuncMax() { return 0 ; }
54 
55  inline virtual void Print(Option_t *options= 0) const {
56  // ascii printing interface
58  }
59 
60  virtual void printName(std::ostream& os) const ;
61  virtual void printTitle(std::ostream& os) const ;
62  virtual void printClassName(std::ostream& os) const ;
63  virtual void printArgs(std::ostream& os) const ;
64 
65  void attachParameters(const RooArgSet& vars) ;
66 
67  // Advertisement of capabilities
68  virtual Bool_t canSampleCategories() const { return kFALSE ; }
69  virtual Bool_t canSampleConditional() const { return kFALSE ; } // Must implement getFuncMax()
70 
71 protected:
72 
73  RooArgSet *_cloneSet; // Set owning clone of input function
74  RooAbsReal *_funcClone; // Pointer to top level node of cloned function
75  const RooAbsReal *_funcMaxVal ; // Container for maximum function value
76  RooArgSet _catVars,_realVars ; // Sets of discrete and real valued observabeles
77  Bool_t _verbose, _isValid; // Verbose and valid flag
78  RooRealVar *_funcValStore,*_funcValPtr; // RRVs storing function value in context and in output dataset
79 
80  RooDataSet *_cache; // Dataset holding generared values of observables
81 
82  ClassDef(RooAbsNumGenerator,0) // Abstract base class for numeric event generator algorithms
83 };
84 
85 #endif
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsNumGenerator::printArgs
virtual void printArgs(std::ostream &os) const
Print the arguments of the generator.
Definition: RooAbsNumGenerator.cxx:212
RooAbsNumGenerator::Print
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
Definition: RooAbsNumGenerator.h:55
RooArgSet.h
RooAbsNumGenerator::_verbose
Bool_t _verbose
Definition: RooAbsNumGenerator.h:77
RooAbsNumGenerator::RooAbsNumGenerator
RooAbsNumGenerator()
Definition: RooAbsNumGenerator.h:32
TNamed.h
RooAbsNumGenerator::printTitle
virtual void printTitle(std::ostream &os) const
Print the title of the generator.
Definition: RooAbsNumGenerator.cxx:192
RooAbsNumGenerator::printName
virtual void printName(std::ostream &os) const
Print name of the generator.
Definition: RooAbsNumGenerator.cxx:182
RooPrintable.h
RooAbsNumGenerator::_cache
RooDataSet * _cache
Definition: RooAbsNumGenerator.h:80
RooAbsReal
Definition: RooAbsReal.h:61
RooAbsNumGenerator::_catVars
RooArgSet _catVars
Definition: RooAbsNumGenerator.h:76
RooPrintable
Definition: RooPrintable.h:25
RooAbsNumGenerator::_funcValStore
RooRealVar * _funcValStore
Definition: RooAbsNumGenerator.h:78
RooAbsNumGenerator::canSampleConditional
virtual Bool_t canSampleConditional() const
Definition: RooAbsNumGenerator.h:69
bool
RooAbsNumGenerator::generateEvent
virtual const RooArgSet * generateEvent(UInt_t remaining, Double_t &resampleRatio)=0
RooAbsNumGenerator::_funcClone
RooAbsReal * _funcClone
Definition: RooAbsNumGenerator.h:74
RooAbsNumGenerator::_funcValPtr
RooRealVar * _funcValPtr
Definition: RooAbsNumGenerator.h:78
RooAbsNumGenerator::printClassName
virtual void printClassName(std::ostream &os) const
Print the class name of the generator.
Definition: RooAbsNumGenerator.cxx:202
RooPrintable::defaultPrintContents
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
Definition: RooPrintable.cxx:233
RooRealBinding
Definition: RooRealBinding.h:26
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
RooAbsNumGenerator::isVerbose
Bool_t isVerbose() const
Definition: RooAbsNumGenerator.h:47
RooPrintable::defaultPrintStream
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
Definition: RooPrintable.cxx:272
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooAbsNumGenerator::_cloneSet
RooArgSet * _cloneSet
Definition: RooAbsNumGenerator.h:73
RooAbsNumGenerator::clone
virtual RooAbsNumGenerator * clone(const RooAbsReal &, const RooArgSet &genVars, const RooArgSet &condVars, const RooNumGenConfig &config, Bool_t verbose=kFALSE, const RooAbsReal *maxFuncVal=0) const =0
RooAbsNumGenerator
Definition: RooAbsNumGenerator.h:30
unsigned int
RooAbsNumGenerator::setVerbose
void setVerbose(Bool_t verbose=kTRUE)
Definition: RooAbsNumGenerator.h:43
RooAbsNumGenerator::_isValid
Bool_t _isValid
Definition: RooAbsNumGenerator.h:77
RooAbsNumGenerator::getFuncMax
virtual Double_t getFuncMax()
Definition: RooAbsNumGenerator.h:53
Double_t
double Double_t
Definition: RtypesCore.h:59
RooNumGenConfig
Definition: RooNumGenConfig.h:25
RooAbsNumGenerator::_realVars
RooArgSet _realVars
Definition: RooAbsNumGenerator.h:76
RooAbsNumGenerator::_funcMaxVal
const RooAbsReal * _funcMaxVal
Definition: RooAbsNumGenerator.h:75
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooPrintable::printStream
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Definition: RooPrintable.cxx:75
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooDataSet
Definition: RooDataSet.h:33
RooAbsNumGenerator::~RooAbsNumGenerator
virtual ~RooAbsNumGenerator()
Destructor.
Definition: RooAbsNumGenerator.cxx:156
RooPrintable::defaultPrintStyle
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Definition: RooPrintable.cxx:241
RooRealVar
Definition: RooRealVar.h:36
RooArgList.h
RooAbsNumGenerator::isValid
Bool_t isValid() const
Definition: RooAbsNumGenerator.h:37
RooAbsNumGenerator::attachParameters
void attachParameters(const RooArgSet &vars)
Reattach original parameters to function clone.
Definition: RooAbsNumGenerator.cxx:168
RooAbsNumGenerator::canSampleCategories
virtual Bool_t canSampleCategories() const
Definition: RooAbsNumGenerator.h:68
RooArgSet
Definition: RooArgSet.h:28