67 _respectCompSelect(true),
72 _restartNumIntEngine(
kFALSE),
96 const char* rangeName) :
99 _respectCompSelect(true),
100 _sumList(
"!sumList",
"Categories to be summed numerically",this,
kFALSE,
kFALSE),
101 _intList(
"!intList",
"Variables to be integrated numerically",this,
kFALSE,
kFALSE),
102 _anaList(
"!anaList",
"Variables to be integrated analytically",this,
kFALSE,
kFALSE),
103 _jacList(
"!jacList",
"Jacobian product term",this,
kFALSE,
kFALSE),
104 _facList(
"!facList",
"Variables independent of function",this,
kFALSE,
kTRUE),
105 _function(
"!func",
"Function to be integrated",this,
108 _sumCat(
"!sumCat",
"SuperCategory for summation",this,
kFALSE,
kFALSE),
111 _restartNumIntEngine(
kFALSE),
140 <<
function.GetName() <<
" over observables" << depList <<
" with normalization "
141 << (funcNormSet?*funcNormSet:
RooArgSet()) <<
" with range identifier "
142 << (rangeName?rangeName:
"<none>") << endl ;
155 for (
const auto nArg : *funcNormSet) {
174 for (
auto arg : intDepList) {
175 if(!arg->isLValue()) {
200 RooArgSet exclLVBranches(
"exclLVBranches") ;
202 function.branchNodeServerList(&branchList) ;
204 for (
auto branch: branchList) {
207 if ((realArgLV && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
208 exclLVBranches.
add(*branch) ;
213 branchListVD.
add(*branch) ;
221 RooArgSet exclLVServers(
"exclLVServers") ;
222 exclLVServers.
add(intDepList) ;
230 std::vector<RooAbsArg*> toBeRemoved;
231 for (
auto server : exclLVServers) {
233 toBeRemoved.push_back(server);
237 exclLVServers.remove(toBeRemoved.begin(), toBeRemoved.end());
241 for (std::size_t i=0; i < exclLVBranches.
size(); ++i) {
242 const RooAbsArg* branch = exclLVBranches[i];
257 for (std::size_t i=0; i < exclLVBranches.
size(); ++i) {
258 const RooAbsArg* branch = exclLVBranches[i];
267 if (exclLVServers.
getSize()>0 && !
function.isBinnedDistribution(exclLVBranches)) {
269 intDepList.
remove(exclLVServers) ;
270 intDepList.
add(exclLVBranches) ;
284 for (
auto arg : intDepList) {
285 if (
function.forceAnalyticalInt(*arg)) {
286 anIntOKDepList.
add(*arg) ;
290 if (anIntOKDepList.
getSize()>0) {
300 for (
const auto arg :
function.servers()) {
305 if (!arg->dependsOnValue(intDepList)) {
309 if (
function.dependsOnValue(*arg)) {
319 arg->leafNodeServerList(&argLeafServers,0,
kFALSE) ;
330 for (
const auto leaf : argLeafServers) {
334 if (depList.
find(leaf->GetName()) &&
function.dependsOnValue(*leaf)) {
338 oocxcoutD(&
function,
Integration) <<
function.GetName() <<
" : Observable " << leaf->GetName() <<
" has parameterized binning, add value dependence of boundary objects rather than shape of leaf" << endl ;
347 << arg->GetName() <<
" as shape dependent" << endl ;
350 }
else if (!depList.
find(leaf->GetName())) {
352 if (
function.dependsOnValue(*leaf)) {
371 if (arg->isDerived()) {
375 if ((realArgLV && intDepList.
find(realArgLV->
GetName()) && (realArgLV->
isJacobianOK(intDepList)!=0)) || catArgLV) {
384 for (
const auto otherArg :
function.servers()) {
386 if (arg==otherArg) continue ;
388 if (arg->overlaps(*otherArg,
kTRUE)) {
394 if (!overlapOK) depOK=
kFALSE ;
455 auto argDepList = std::unique_ptr<RooArgSet>(arg->getObservables(&intDepList));
456 for (
const auto argDep : *argDepList) {
467 if (exclLVServers.
getSize()>0) {
469 intDepList.
remove(exclLVBranches) ;
470 intDepList.
add(exclLVServers) ;
476 for (
const auto arg :
function.servers()) {
490 auto argDeps = std::unique_ptr<RooArgSet>(arg->getObservables(&intDepList));
492 if (argDeps->getSize()>0) {
496 for (
const auto dep : *argDeps) {
511 for (
const auto arg : numIntDepList) {
531 if (numIntDepList.
getSize()>0) {
568 if (server->isValueServer(*
this)) {
570 server->leafNodeServerList(&leafSet) ;
571 for (
const auto leaf : leafSet) {
572 if (leaf->operMode()==
ADirty && leaf->isValueServer(*
this)) {
576 if (leaf->getAttribute(
"projectedDependent")) {
609 if (!(exclLVBranches.
find(client->GetName())==client)) {
610 if (allBranches.
find(client->GetName())==client) {
622 return (numLVServ==1) ;
675 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 ;
689 _valid(other._valid),
690 _respectCompSelect(other._respectCompSelect),
691 _sumList(
"!sumList",this,other._sumList),
692 _intList(
"!intList",this,other._intList),
693 _anaList(
"!anaList",this,other._anaList),
694 _jacList(
"!jacList",this,other._jacList),
695 _facList(
"!facList",
"Variables independent of function",this,
kFALSE,
kTRUE),
696 _function(
"!func",this,other._function),
697 _iconfig(other._iconfig),
698 _sumCat(
"!sumCat",this,other._sumCat),
700 _intOperMode(other._intOperMode),
701 _restartNumIntEngine(
kFALSE),
704 _rangeName(other._rangeName),
710 for (
const auto arg : other.
_facList) {
841 <<
":evaluate: cannot initialize numerical integrator" << endl;
936 jacProd *= arg->jacobian() ;
941 return fabs(jacProd) ;
956 for (
const auto& nameIdx : *sumCat) {
1024 if (server->isValueServer(*
this))
_params->
add(*server) ;
1114 os <<
indent <<
"--- RooRealIntegral ---" << endl;
1115 os <<
indent <<
" Integrates ";
1119 os <<
indent <<
" operating mode is "
1121 os <<
indent <<
" Summed discrete args are " <<
_sumList << endl ;
1122 os <<
indent <<
" Numerically integrated args are " <<
_intList << endl;
1123 os <<
indent <<
" Analytically integrated args using mode " <<
_mode <<
" are " <<
_anaList << endl ;
1124 os <<
indent <<
" Arguments included in Jacobian are " <<
_jacList << endl ;
1125 os <<
indent <<
" Factorized arguments are " <<
_facList << endl ;
1126 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
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
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.
OperMode _operMode
Mark batches as dirty (only meaningful for RooAbsReal).
Bool_t dependsOnValue(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0) const
Check whether this object depends on values from an element in the serverList.
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...
Int_t numTypes(const char *=0) const
Return number of types defined (in range named rangeName if rangeName!=0)
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
Check if collection contains an argument with the same name as var.
Storage_t::size_type size() 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 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...
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) const
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...
Int_t _mode
do not persist
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.
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
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&).
The RooSuperCategory can join several RooAbsCategoryLValue objects into a single category.
virtual bool setIndex(value_type index, bool printError=true) override
Set the value of the super category to the specified index.
virtual Bool_t inRange(const char *rangeName) const override
Check that all input category states are in the given range.
const T & arg() const
Return reference to object held in proxy.
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)