16 #ifndef ROO_REAL_INTEGRAL
17 #define ROO_REAL_INTEGRAL
28 class RooAbsCategory ;
30 class RooAbsIntegrator ;
31 class RooNumIntConfig ;
33 class RooRealIntegral :
public RooAbsReal {
38 RooRealIntegral(
const char *name,
const char *title,
const RooAbsReal&
function,
const RooArgSet& depList,
39 const RooArgSet* funcNormSet=0,
const RooNumIntConfig* config=0,
const char* rangeName=0) ;
40 RooRealIntegral(
const RooRealIntegral& other,
const char* name=0);
41 virtual TObject* clone(
const char* newname)
const {
return new RooRealIntegral(*
this,newname); }
42 virtual ~RooRealIntegral();
44 virtual Double_t getValV(
const RooArgSet* set=0)
const ;
46 Bool_t isValid()
const {
return _valid; }
48 void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent=
"")
const ;
49 void printMetaArgs(std::ostream& os)
const ;
51 const RooArgSet& numIntCatVars()
const {
return _sumList ; }
52 const RooArgSet& numIntRealVars()
const {
return _intList ; }
53 const RooArgSet& anaIntVars()
const {
return _anaList ; }
55 RooArgSet intVars()
const { RooArgSet tmp(_sumList) ; tmp.add(_intList) ; tmp.add(_anaList) ; tmp.add(_facList) ;
return tmp ; }
56 const char* intRange() {
return _rangeName ? _rangeName->GetName() : 0 ; }
57 const RooAbsReal& integrand()
const {
return _function.arg() ; }
59 void setCacheNumeric(Bool_t flag) {
64 Bool_t getCacheNumeric() {
69 static void setCacheAllNumeric(Int_t ndim) ;
71 static Int_t getCacheAllNumeric() ;
73 virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi)
const {
75 return _function.arg().plotSamplingHint(obs,xlo,xhi) ;
78 virtual RooAbsReal* createIntegral(
const RooArgSet& iset,
const RooArgSet* nset=0,
const RooNumIntConfig* cfg=0,
const char* rangeName=0)
const ;
80 void setAllowComponentSelection(Bool_t allow);
81 Bool_t getAllowComponentSelection()
const;
85 mutable Bool_t _valid;
86 Bool_t _respectCompSelect;
88 const RooArgSet& parameters()
const ;
90 enum IntOperMode { Hybrid, Analytic, PassThrough } ;
93 Bool_t initNumIntegrator()
const;
94 void autoSelectDirtyMode() ;
96 virtual Double_t sum()
const ;
97 virtual Double_t integrate()
const ;
98 virtual Double_t jacobianProduct()
const ;
101 Double_t evaluate()
const ;
102 virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE)
const ;
103 Bool_t servesExclusively(
const RooAbsArg* server,
const RooArgSet& exclLVBranches,
const RooArgSet& allBranches)
const ;
106 virtual Bool_t redirectServersHook(
const RooAbsCollection& newServerList,
107 Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive) ;
110 mutable RooSetProxy _sumList ;
111 mutable RooSetProxy _intList ;
112 mutable RooSetProxy _anaList ;
113 mutable RooSetProxy _jacList ;
114 mutable RooSetProxy _facList ;
116 mutable RooArgSet _facListOwned ;
117 RooRealProxy _function ;
118 RooArgSet* _funcNormSet ;
120 mutable RooArgSet _saveInt ;
121 mutable RooArgSet _saveSum ;
123 RooNumIntConfig* _iconfig ;
125 mutable RooListProxy _sumCat ;
126 TIterator* _sumCatIter ;
129 IntOperMode _intOperMode ;
131 mutable Bool_t _restartNumIntEngine ;
132 mutable RooAbsIntegrator* _numIntEngine ;
133 mutable RooAbsFunc *_numIntegrand;
137 mutable RooArgSet* _params ;
140 static Int_t _cacheAllNDim ;
143 virtual void operModeHook() ;
145 ClassDef(RooRealIntegral,3)