72 _restartNumIntEngine(
kFALSE),
98 const char* rangeName) :
101 _sumList(
"!sumList",
"Categories to be summed numerically",this,
kFALSE,
kFALSE),
102 _intList(
"!intList",
"Variables to be integrated numerically",this,
kFALSE,
kFALSE),
103 _anaList(
"!anaList",
"Variables to be integrated analytically",this,
kFALSE,
kFALSE),
104 _jacList(
"!jacList",
"Jacobian product term",this,
kFALSE,
kFALSE),
105 _facList(
"!facList",
"Variables independent of function",this,
kFALSE,
kTRUE),
106 _facListIter(_facList.createIterator()),
107 _jacListIter(_jacList.createIterator()),
108 _function(
"!func",
"Function to be integrated",this,
111 _sumCat(
"!sumCat",
"SuperCategory for summation",this,
kFALSE,
kFALSE),
115 _restartNumIntEngine(
kFALSE),
144 <<
function.GetName() <<
" over observables" << depList <<
" with normalization "
145 << (funcNormSet?*funcNormSet:
RooArgSet()) <<
" with range identifier "
146 << (rangeName?rangeName:
"<none>") << endl ;
210 RooArgSet exclLVBranches(
"exclLVBranches") ;
212 function.branchNodeServerList(&branchList) ;
219 if ((realArgLV && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
220 exclLVBranches.
add(*branch) ;
225 branchListVD.
add(*branch) ;
235 RooArgSet exclLVServers(
"exclLVServers") ;
236 exclLVServers.
add(intDepList) ;
252 exclLVServers.
remove(*server) ;
289 if (exclLVServers.
getSize()>0 && !
function.isBinnedDistribution(exclLVBranches)) {
291 intDepList.
remove(exclLVServers) ;
292 intDepList.
add(exclLVBranches) ;
309 anIntOKDepList.
add(*arg) ;
314 if (anIntOKDepList.
getSize()>0) {
315 oocxcoutI(&
function,
Integration) <<
function.GetName() <<
": Observables that function forcibly requires to be integrated internally " << anIntOKDepList << endl ;
324 sIter =
function.serverIterator() ;
365 oocxcoutD(&
function,
Integration) <<
function.GetName() <<
" : Observable " << leaf->
GetName() <<
" has parameterized binning, add value dependence of boundary objects rather than shape of leaf" << endl ;
374 << arg->
GetName() <<
" as shape dependent" << endl ;
380 oocxcoutD(&
function,
Integration) <<
function.GetName() <<
": Adding parameter " << leaf->
GetName() <<
" of server " << arg->
GetName() <<
" as value dependent" << endl ;
383 oocxcoutD(&
function,
Integration) <<
function.GetName() <<
": Adding parameter " << leaf->
GetName() <<
" of server " << arg->
GetName() <<
" as shape dependent" << endl ;
403 if ((realArgLV && intDepList.
find(realArgLV->
GetName()) && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
413 TIterator* sIter2 =
function.serverIterator() ;
424 if (!overlapOK) depOK=
kFALSE ;
438 oocxcoutI(&
function,
Integration) <<
function.GetName() <<
": Observable " << arg->
GetName() <<
" is suitable for analytical integration (if supported by p.d.f)" << endl ;
504 if (exclLVServers.
getSize()>0) {
506 intDepList.
remove(exclLVBranches) ;
507 intDepList.
add(exclLVServers) ;
522 if (dynamic_cast<RooAbsLValue*>(arg) && arg->
isDerived() && intDepList.
contains(*arg)) {
579 if (numIntDepList.
getSize()>0) {
670 if (!(exclLVBranches.
find(client->
GetName())==client)) {
690 return (numLVServ==1) ;
743 cxcoutI(
NumIntegration) <<
"RooRealIntegral::init(" <<
GetName() <<
") evaluation requires " <<
_intList.
getSize() <<
"-D numeric integration step. Evaluation may be slow, sufficient numeric precision for fitting & minimization is not guaranteed" << endl ;
757 _valid(other._valid),
758 _sumList(
"!sumList",this,other._sumList),
759 _intList(
"!intList",this,other._intList),
760 _anaList(
"!anaList",this,other._anaList),
761 _jacList(
"!jacList",this,other._jacList),
762 _facList(
"!facList",
"Variables independent of function",this,
kFALSE,
kTRUE),
763 _facListIter(_facList.createIterator()),
764 _jacListIter(_jacList.createIterator()),
765 _function(
"!func",this,other._function),
766 _iconfig(other._iconfig),
767 _sumCat(
"!sumCat",this,other._sumCat),
770 _intOperMode(other._intOperMode),
771 _restartNumIntEngine(
kFALSE),
774 _rangeName(other._rangeName),
914 <<
":evaluate: cannot initialize numerical integrator" << endl;
1017 return fabs(jacProd) ;
1188 os << indent <<
"--- RooRealIntegral ---" << endl;
1189 os << indent <<
" Integrates ";
1193 os << indent <<
" operating mode is "
1195 os << indent <<
" Summed discrete args are " <<
_sumList << endl ;
1196 os << indent <<
" Numerically integrated args are " <<
_intList << endl;
1197 os << indent <<
" Analytically integrated args using mode " <<
_mode <<
" are " <<
_anaList << endl ;
1198 os << indent <<
" Arguments included in Jacobian are " <<
_jacList << endl ;
1199 os << indent <<
" Factorized arguments are " <<
_facList << endl ;
1200 os << indent <<
" Function normalization set " ;
ClassImp(RooRealIntegral)
virtual Bool_t checkLimits() const
virtual Bool_t inRange(const char *rangeName) const
Return true of all of the input category states are in the given range.
RooAbsCollection * snapshot(Bool_t deepCopy=kTRUE) const
Take a snap shot of current collection contents: An owning collection is returned containing clones o...
TIterator * valueClientIterator() const
virtual ~RooRealIntegral()
virtual Bool_t isDerived() const
RooRealProxy _function
Iterator over lvalue observables with Jacobian.
virtual Double_t sum() const
Perform summation of list of category dependents to be integrated.
TIterator * serverIterator() const
virtual RooAbsReal * lowBoundFunc() const
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
static RooNumIntFactory & instance()
Static method returning reference to singleton instance of factory.
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, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
virtual RooAbsReal * highBoundFunc() const
Bool_t isValueOrShapeDirtyAndClear() const
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooRealIntegral to more intuitively reflect the contents of the...
virtual Bool_t isFundamental() const
Bool_t contains(const RooAbsArg &var) const
Bool_t _restartNumIntEngine
virtual Double_t jacobian() const
Bool_t servesExclusively(const RooAbsArg *server, const RooArgSet &exclLVBranches, const RooArgSet &allBranches) const
Utility function that returns true if 'object server' is a server to exactly one of the RooAbsArgs in...
virtual Double_t getMin(const char *name=0) const
Double_t calculate(const Double_t *yvec=0)
Calculate integral value with given array of parameter values.
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node...
TIterator * _jacListIter
Iterator over factorizing observables.
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Print the state of this object to the specified output stream.
RooExpensiveObjectCache & expensiveObjectCache() const
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters, if current parameter values match those that were stored in the registry for this object.
Iterator abstract base class.
const RooAbsReal & arg() const
virtual RooAbsReal * createIntegral(const RooArgSet &iset, const RooArgSet *nset=0, const RooNumIntConfig *cfg=0, const char *rangeName=0) const
Create an object that represents the integral of the function over one or more observables listed in ...
Double_t traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
RooAbsArg * first() const
friend class RooRealBinding
RooAbsIntegrator * createIntegrator(RooAbsFunc &func, const RooNumIntConfig &config, Int_t ndim=0, Bool_t isBinned=kFALSE)
Construct a numeric integrator instance that operates on function 'func' and is configured with 'conf...
RooAbsIntegrator * _numIntEngine
do not persist
virtual void Print(Option_t *options=0) const
Print TNamed name and title.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooNumIntConfig * _iconfig
do not persist
The TNamed class is the base class for all named ROOT classes.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add element to an owning set.
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral. ...
Int_t numTypes(const char *=0) const
std::map< std::string, std::string >::const_iterator iter
TIterator * createIterator(Bool_t dir=kIterForward) const
if on multiple lines(like in C++).**The" * configuration fragment. * * The "import myobject continue
Parses the configuration file.
TString & Append(const char *cs)
Bool_t dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0) const
virtual Bool_t forceAnalyticalInt(const RooAbsArg &) const
Double_t getVal(const RooArgSet *set=0) const
Bool_t initNumIntegrator() const
(Re)Initialize numerical integration engine if necessary.
static Int_t getCacheAllNumeric()
Return minimum dimensions of numeric integration for which values are cached.
virtual Double_t getValV(const RooArgSet *set=0) const
Return value of object.
virtual Double_t integrate() const
Perform hybrid numerical/analytical integration over all real-valued dependents.
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
RooArgSet _saveSum
do not persist
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void function(const char *name_, T fun, const char *docstring=0)
RooArgSet intVars() const
Bool_t isShapeServer(const RooAbsArg &arg) const
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void operModeHook()
Cache all integrals with given numeric dimension.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
const RooNumIntConfig * getIntegratorConfig() const
Return the numeric integration configuration used for this object.
char * Form(const char *fmt,...)
RooRefCountList _clientList
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
virtual const char * GetName() const
Returns name of object.
TIterator * _sumCatIter
do not persist
virtual Bool_t setIndex(Int_t index, Bool_t printError=kTRUE)
Set the value of the super category by specifying the state index code by setting the states of the c...
static void indent(ostringstream &buf, int indent_level)
static void setDirtyInhibit(Bool_t flag)
Control global dirty inhibit mode.
static Int_t _cacheAllNDim
static unsigned int total
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
void autoSelectDirtyMode()
Set appropriate cache operation mode for integral depending on cache operation mode of server objects...
virtual Bool_t isParameterized() const
Bool_t overlaps(const RooAbsArg &testArg, Bool_t valueOnly=kFALSE) const
Test if any of the nodes of tree are shared with that of the given tree.
virtual const char * GetName() const
Returns name of object.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual Double_t jacobianProduct() const
Return product of jacobian terms originating from analytical integration.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Double_t evaluate() const
Perform the integration and return the result.
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Check if current value is valid.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::addOwned()
Bool_t _cacheNum
cache for set of parameters
Bool_t isValueServer(const RooAbsArg &arg) const
static void setCacheAllNumeric(Int_t ndim)
Global switch to cache all integral values that integrate at least ndim dimensions numerically...
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
virtual Double_t getMax(const char *name=0) const
virtual Bool_t redirectServersHook(const RooAbsCollection &newServerList, Bool_t mustReplaceAll, Bool_t nameChange, Bool_t isRecursive)
Intercept server redirects and reconfigure internal object accordingly.
virtual TObject * Next()=0
OperMode operMode() const
virtual Bool_t isJacobianOK(const RooArgSet &depList) const
RooAbsFunc * _numIntegrand
do not persist
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Bool_t inhibitDirty() const
Delete watch flag.
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
const RooArgSet & parameters() const
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add clone of specified element to an owning set.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void addServer(RooAbsArg &server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
TNamed * _rangeName
do not persist
Bool_t registerObject(const char *ownerName, const char *objectName, TObject &cacheObject, TIterator *paramIter)
Register object associated with given name and given associated parameters with given values in cache...
TIterator * typeIterator() const
Return iterator over all defined states.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add element to non-owning set.
virtual Bool_t isLValue() const
const char * GetName() const
Returns name of object.
RooAbsReal * createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables listed in ...
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...