Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsNumGenerator.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * File: $Id$
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18#ifndef ROO_ABS_NUM_GENERATOR
19#define ROO_ABS_NUM_GENERATOR
20
21#include "RooArgSet.h"
22#include "RooArgList.h"
23
24class RooAbsReal;
25class RooRealVar;
26class RooDataSet;
27class RooRealBinding;
28class RooNumGenConfig ;
29
31public:
33 RooAbsNumGenerator(const RooAbsReal &func, const RooArgSet &genVars, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr);
34 virtual RooAbsNumGenerator* clone(const RooAbsReal&, const RooArgSet& genVars, const RooArgSet& condVars,
35 const RooNumGenConfig& config, bool verbose=false, const RooAbsReal* maxFuncVal=nullptr) const = 0 ;
36
37 bool isValid() const {
38 // If true, generator is in a valid state
39 return _isValid;
40 }
41 virtual ~RooAbsNumGenerator() ;
42
43 inline void setVerbose(bool verbose= true) {
44 // If flag is true, verbose messaging will be active during generation
45 _verbose= verbose;
46 }
47 inline bool isVerbose() const {
48 // Return status of verbose messaging flag
49 return _verbose;
50 }
51
52 virtual const RooArgSet *generateEvent(UInt_t remaining, double& resampleRatio) = 0;
53 virtual double getFuncMax() { return 0 ; }
54
55 void attachParameters(const RooArgSet& vars) ;
56
57 // Advertisement of capabilities
58 virtual bool canSampleCategories() const { return false ; }
59 virtual bool canSampleConditional() const { return false ; } // Must implement getFuncMax()
60
61 /// Return unique name of generator implementation
62 virtual std::string const& generatorName() const = 0;
63
64protected:
65
66 RooArgSet _cloneSet; ///< Set owning clone of input function
67 RooAbsReal *_funcClone = nullptr; ///< Pointer to top level node of cloned function
68 const RooAbsReal *_funcMaxVal = nullptr; ///< Container for maximum function value
69 RooArgSet _catVars; ///< Set of discrete observabeles
70 RooArgSet _realVars; ///< Set of real valued observabeles
71 bool _verbose = false; ///< Verbose flag
72 bool _isValid = false; ///< Valid flag
73 std::unique_ptr<RooAbsArg> _funcValStore; ///< RRV storing function value in context
74 RooRealVar *_funcValPtr = nullptr; ///< RRV storing function value in output dataset
75 std::unique_ptr<RooDataSet> _cache; ///< Dataset holding generared values of observables
76};
77
78#endif
79
80/// \endcond
unsigned int UInt_t
Definition RtypesCore.h:46
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold unbinned data.
Definition RooDataSet.h:34
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
Variable that can be changed from the outside.
Definition RooRealVar.h:37