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 "RooArgSet.h"
20#include "RooArgList.h"
21
22class RooAbsReal;
23class RooRealVar;
24class RooDataSet;
25class RooRealBinding;
26class RooNumGenConfig ;
27
29public:
30 RooAbsNumGenerator() : _funcClone(nullptr), _funcMaxVal(nullptr), _verbose(false), _isValid(false), _funcValStore(nullptr), _funcValPtr(nullptr), _cache(nullptr) {}
31 RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr);
32 virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars,
33 const RooNumGenConfig& config, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr) const = 0 ;
34
35 bool isValid() const {
36 // If true, generator is in a valid state
37 return _isValid;
38 }
39 virtual ~RooAbsNumGenerator() ;
40
41 inline void setVerbose(bool verbose= true) {
42 // If flag is true, verbose messaging will be active during generation
44 }
45 inline bool isVerbose() const {
46 // Return status of verbose messaging flag
47 return _verbose;
48 }
49
50 virtual const RooArgSet *generateEvent(UInt_t remaining, double& resampleRatio) = 0;
51 virtual double getFuncMax() { return 0 ; }
52
53 void attachParameters(const RooArgSet& vars) ;
54
55 // Advertisement of capabilities
56 virtual bool canSampleCategories() const { return false ; }
57 virtual bool canSampleConditional() const { return false ; } // Must implement getFuncMax()
58
59 /// Return unique name of generator implementation
60 virtual std::string const& generatorName() const = 0;
61
62protected:
63
64 RooArgSet _cloneSet; ///< Set owning clone of input function
65 RooAbsReal *_funcClone; ///< Pointer to top level node of cloned function
66 const RooAbsReal *_funcMaxVal ; ///< Container for maximum function value
67 RooArgSet _catVars,_realVars ; ///< Sets of discrete and real valued observabeles
68 bool _verbose, _isValid; ///< Verbose and valid flag
69 RooRealVar *_funcValStore,*_funcValPtr; ///< RRVs storing function value in context and in output dataset
70
71 RooDataSet *_cache; ///< Dataset holding generared values of observables
72};
73
74#endif
Class RooAbsNumGenerator is the abstract base class for MC event generator implementations like RooAc...
RooArgSet _realVars
Sets of discrete and real valued observabeles.
RooDataSet * _cache
Dataset holding generared values of observables.
bool _isValid
Verbose and valid flag.
virtual std::string const & generatorName() const =0
Return unique name of generator implementation.
const RooAbsReal * _funcMaxVal
Container for maximum function value.
RooRealVar * _funcValPtr
RRVs storing function value in context and in output dataset.
RooArgSet _cloneSet
Set owning clone of input function.
virtual double getFuncMax()
virtual bool canSampleCategories() const
RooAbsReal * _funcClone
Pointer to top level node of cloned function.
void setVerbose(bool verbose=true)
virtual ~RooAbsNumGenerator()
Destructor.
virtual bool canSampleConditional() const
void attachParameters(const RooArgSet &vars)
Reattach original parameters to function clone.
virtual RooAbsNumGenerator * clone(const RooAbsReal &, const RooArgSet &genVars, const RooArgSet &condVars, const RooNumGenConfig &config, bool verbose=false, const RooAbsReal *maxFuncVal=nullptr) const =0
virtual const RooArgSet * generateEvent(UInt_t remaining, double &resampleRatio)=0
RooRealVar * _funcValStore
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
RooDataSet is a container class to hold unbinned data.
Definition: RooDataSet.h:55
RooNumGenConfig holds the configuration parameters of the various numeric integrators used by RooReal...
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:40