67 _respectCompSelect(true),
73 _restartNumIntEngine(
kFALSE),
97 const char* rangeName) :
100 _respectCompSelect(true),
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 _function(
"!func",
"Function to be integrated",this,
109 _sumCat(
"!sumCat",
"SuperCategory for summation",this,
kFALSE,
kFALSE),
113 _restartNumIntEngine(
kFALSE),
142 <<
function.GetName() <<
" over observables" << depList <<
" with normalization "
143 << (funcNormSet?*funcNormSet:
RooArgSet()) <<
" with range identifier "
144 << (rangeName?rangeName:
"<none>") << endl ;
157 for (
const auto nArg : *funcNormSet) {
176 for (
auto arg : intDepList) {
177 if(!arg->isLValue()) {
202 RooArgSet exclLVBranches(
"exclLVBranches") ;
204 function.branchNodeServerList(&branchList) ;
206 for (
auto branch: branchList) {
209 if ((realArgLV && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
210 exclLVBranches.
add(*branch) ;
215 branchListVD.
add(*branch) ;
224 RooArgSet exclLVServers(
"exclLVServers") ;
225 exclLVServers.
add(intDepList) ;
235 std::vector<RooAbsArg*> toBeRemoved;
236 for (
auto server : exclLVServers) {
238 toBeRemoved.push_back(server);
242 exclLVServers.remove(toBeRemoved.begin(), toBeRemoved.end());
246 for (
auto branch : exclLVBranches) {
247 RooArgSet* brDepList = branch->getObservables(&intDepList) ;
260 for (
auto branch : exclLVBranches) {
261 if (!branch->dependsOnValue(exclLVServers)) {
271 if (exclLVServers.
getSize()>0 && !
function.isBinnedDistribution(exclLVBranches)) {
273 intDepList.
remove(exclLVServers) ;
274 intDepList.
add(exclLVBranches) ;
288 for (
auto arg : intDepList) {
289 if (
function.forceAnalyticalInt(*arg)) {
290 anIntOKDepList.
add(*arg) ;
294 if (anIntOKDepList.
getSize()>0) {
304 for (
const auto arg :
function.servers()) {
309 if (!arg->dependsOnValue(intDepList)) {
313 if (
function.dependsOnValue(*arg)) {
323 arg->leafNodeServerList(&argLeafServers,0,
kFALSE) ;
334 for (
const auto leaf : argLeafServers) {
338 if (depList.
find(leaf->GetName()) &&
function.dependsOnValue(*leaf)) {
342 oocxcoutD(&
function,
Integration) <<
function.GetName() <<
" : Observable " << leaf->GetName() <<
" has parameterized binning, add value dependence of boundary objects rather than shape of leaf" << endl ;
351 << arg->GetName() <<
" as shape dependent" << endl ;
354 }
else if (!depList.
find(leaf->GetName())) {
356 if (
function.dependsOnValue(*leaf)) {
375 if (arg->isDerived()) {
379 if ((realArgLV && intDepList.
find(realArgLV->
GetName()) && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
388 for (
const auto otherArg :
function.servers()) {
390 if (arg==otherArg) continue ;
392 if (arg->overlaps(*otherArg,
kTRUE)) {
398 if (!overlapOK) depOK=
kFALSE ;
459 auto argDepList = std::unique_ptr<RooArgSet>(arg->getObservables(&intDepList));
460 for (
const auto argDep : *argDepList) {
471 if (exclLVServers.
getSize()>0) {
473 intDepList.
remove(exclLVBranches) ;
474 intDepList.
add(exclLVServers) ;
480 for (
const auto arg :
function.servers()) {
494 auto argDeps = std::unique_ptr<RooArgSet>(arg->getObservables(&intDepList));
496 if (argDeps->getSize()>0) {
500 for (
const auto dep : *argDeps) {
515 for (
const auto arg : numIntDepList) {
535 if (numIntDepList.
getSize()>0) {
573 if (server->isValueServer(*
this)) {
575 server->leafNodeServerList(&leafSet) ;
576 for (
const auto leaf : leafSet) {
577 if (leaf->operMode()==
ADirty && leaf->isValueServer(*
this)) {
581 if (leaf->getAttribute(
"projectedDependent")) {
614 if (!(exclLVBranches.
find(client->GetName())==client)) {
615 if (allBranches.
find(client->GetName())==client) {
627 return (numLVServ==1) ;
680 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 ;
694 _valid(other._valid),
695 _respectCompSelect(other._respectCompSelect),
696 _sumList(
"!sumList",this,other._sumList),
697 _intList(
"!intList",this,other._intList),
698 _anaList(
"!anaList",this,other._anaList),
699 _jacList(
"!jacList",this,other._jacList),
700 _facList(
"!facList",
"Variables independent of function",this,
kFALSE,
kTRUE),
701 _function(
"!func",this,other._function),
702 _iconfig(other._iconfig),
703 _sumCat(
"!sumCat",this,other._sumCat),
706 _intOperMode(other._intOperMode),
707 _restartNumIntEngine(
kFALSE),
710 _rangeName(other._rangeName),
716 for (
const auto arg : other.
_facList) {
848 <<
":evaluate: cannot initialize numerical integrator" << endl;
948 return fabs(jacProd) ;
1033 if (server->isValueServer(*
this))
_params->
add(*server) ;
1123 os <<
indent <<
"--- RooRealIntegral ---" << endl;
1124 os <<
indent <<
" Integrates ";
1128 os <<
indent <<
" operating mode is "
1130 os <<
indent <<
" Summed discrete args are " <<
_sumList << endl ;
1131 os <<
indent <<
" Numerically integrated args are " <<
_intList << endl;
1132 os <<
indent <<
" Analytically integrated args using mode " <<
_mode <<
" are " <<
_anaList << endl ;
1133 os <<
indent <<
" Arguments included in Jacobian are " <<
_jacList << endl ;
1134 os <<
indent <<
" Factorized arguments are " <<
_facList << endl ;
1135 os <<
indent <<
" Function normalization set " ;
static void indent(ostringstream &buf, int indent_level)
static unsigned int total
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
RooExpensiveObjectCache & expensiveObjectCache() const
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.
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
static void setDirtyInhibit(Bool_t flag)
Control global dirty inhibit mode.
Bool_t inhibitDirty() const
Delete watch flag.
const RefCountList_t & valueClients() const
List of all value clients of this object. Value clients receive value updates.
virtual void setExpensiveObjectCache(RooExpensiveObjectCache &cache)
void addServer(RooAbsArg &server, Bool_t valueProp=kTRUE, Bool_t shapeProp=kFALSE, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
Bool_t isValueOrShapeDirtyAndClear() const
void setOperMode(OperMode mode, Bool_t recurseADirty=kTRUE)
Change cache operation mode to given mode.
Bool_t dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0) const
RefCountList_t _clientList
RefCountList_t _serverList
virtual Bool_t isParameterized() const
virtual RooAbsReal * highBoundFunc() const
virtual RooAbsReal * lowBoundFunc() const
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
TIterator * typeIterator() const
Return iterator over all defined states.
Int_t numTypes(const char *=0) const
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
Bool_t contains(const RooAbsArg &var) const
RooAbsArg * first() const
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
const char * GetName() const
Returns name of object.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
Double_t calculate(const Double_t *yvec=0)
Calculate integral value with given array of parameter values.
virtual Bool_t checkLimits() const
Abstract base class for objects that are lvalues, i.e.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
Retrive binning configuration with given name or default binning.
virtual Bool_t isJacobianOK(const RooArgSet &depList) const
virtual Double_t jacobian() const
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
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 ...
friend class RooRealBinding
Double_t traceEval(const RooArgSet *set) const
Calculate current value of object, with error tracing wrapper.
virtual Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Structure printing.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
static Bool_t _globalSelectComp
Component selection flag for RooAbsPdf::plotCompOn.
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 isBinnedDistribution(const RooArgSet &) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
virtual Bool_t addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
RooCatType is an auxilary class for RooAbsCategory and defines a a single category state.
RooDouble is a minimal implementation of a TObject holding a Double_t value.
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...
const TObject * retrieveObject(const char *name, TClass *tclass, const RooArgSet ¶ms)
Retrieve object from cache that was registered under given name with given parameters,...
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::addOwned()
RooNameReg is a registry for const char* names.
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
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...
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,...
Lightweight RooAbsFunc interface adaptor that binds an analytic integral of a RooAbsReal object (spec...
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
RooNumIntConfig * _iconfig
do not persist
virtual void operModeHook()
Cache all integrals with given numeric dimension.
Bool_t getAllowComponentSelection() const
Check if component selection is allowed.
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...
RooArgSet intVars() const
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.
TIterator * _sumCatIter
do not persist
RooAbsFunc * _numIntegrand
do not persist
static void setCacheAllNumeric(Int_t ndim)
Global switch to cache all integral values that integrate at least ndim dimensions numerically.
RooAbsIntegrator * _numIntEngine
do not persist
virtual ~RooRealIntegral()
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooRealIntegral to more intuitively reflect the contents of the...
const RooArgSet & parameters() const
virtual Bool_t isValidReal(Double_t value, Bool_t printError=kFALSE) const
Check if current value is valid.
TNamed * _rangeName
do not persist
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 ...
virtual Double_t sum() const
Perform summation of list of category dependents to be integrated.
Bool_t _restartNumIntEngine
Bool_t initNumIntegrator() const
(Re)Initialize numerical integration engine if necessary.
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 Double_t getValV(const RooArgSet *set=0) const
Return value of object.
virtual Double_t jacobianProduct() const
Return product of jacobian terms originating from analytical integration.
Bool_t _cacheNum
cache for set of parameters
static Int_t getCacheAllNumeric()
Return minimum dimensions of numeric integration for which values are cached.
RooArgSet _saveSum
do not persist
static Int_t _cacheAllNDim
void setAllowComponentSelection(Bool_t allow)
Set component selection to be allowed/forbidden.
Double_t evaluate() const
Perform the integration and return the result.
virtual Double_t integrate() const
Perform hybrid numerical/analytical integration over all real-valued dependents.
void autoSelectDirtyMode()
Set appropriate cache operation mode for integral depending on cache operation mode of server objects...
Bool_t _respectCompSelect
const RooAbsReal & arg() const
bool empty() const
Check if empty.
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...
virtual void removeAll()
Remove all argument inset using remove(const RooAbsArg&).
RooSuperCategory can join several RooAbsCategoryLValue objects into a single category.
virtual Bool_t inRange(const char *rangeName) const
Return true of all of the input category states are in the given range.
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...
virtual TObject * Next()=0
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
TString & Append(const char *cs)
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)