Logo ROOT  
Reference Guide
RooProduct.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * GR, Gerhard Raven, VU Amsterdan, graven@nikhef.nl *
8 * *
9 * Copyright (c) 2000-2007, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooProduct.cxx
19\class RooProduct
20\ingroup Roofitcore
21
22A RooProduct represents the product of a given set of RooAbsReal objects.
23
24**/
25
26#include "RooProduct.h"
27
28#include "RooNameReg.h"
29#include "RooAbsReal.h"
30#include "RooAbsCategory.h"
31#include "RooMsgService.h"
32#include "RooTrace.h"
33
34#include <cmath>
35#include <memory>
36
37using namespace std ;
38
40;
41
42class RooProduct::ProdMap : public std::vector<std::pair<RooArgSet*,RooArgList*> > {} ;
43
44// Namespace with helper functions that have STL stuff that we don't want to expose to CINT
45namespace {
46 typedef RooProduct::ProdMap::iterator RPPMIter ;
47 std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end) ;
48 void dump_map(ostream& os, RPPMIter i, RPPMIter end) ;
49}
50
51
52
53////////////////////////////////////////////////////////////////////////////////
54/// Default constructor
55
56RooProduct::RooProduct() : _cacheMgr(this,10)
57{
59}
60
61
62
63////////////////////////////////////////////////////////////////////////////////
64/// Destructor
65
67{
69}
70
71
72
73////////////////////////////////////////////////////////////////////////////////
74/// Construct function representing the product of functions in prodSet
75
76RooProduct::RooProduct(const char* name, const char* title, const RooArgList& prodSet) :
77 RooAbsReal(name, title),
78 _compRSet("!compRSet","Set of real product components",this),
79 _compCSet("!compCSet","Set of category product components",this),
80 _cacheMgr(this,10)
81{
82 for (auto comp : prodSet) {
83 addTerm(comp);
84 }
86}
87
88
89RooProduct::RooProduct(const char *name, const char *title, RooAbsReal& real1, RooAbsReal& real2) :
90 RooProduct{name, title, {real1, real2}} {}
91
92
93////////////////////////////////////////////////////////////////////////////////
94/// Copy constructor
95
96RooProduct::RooProduct(const RooProduct& other, const char* name) :
97 RooAbsReal(other, name),
98 _compRSet("!compRSet",this,other._compRSet),
99 _compCSet("!compCSet",this,other._compCSet),
100 _cacheMgr(other._cacheMgr,this)
101{
103}
104
105
106////////////////////////////////////////////////////////////////////////////////
107/// Add a term to this product.
109 if (dynamic_cast<RooAbsReal*>(term)) {
110 _compRSet.add(*term) ;
111 } else if (dynamic_cast<RooAbsCategory*>(term)) {
112 _compCSet.add(*term) ;
113 } else {
114 coutE(InputArguments) << "RooProduct::addTerm(" << GetName() << ") ERROR: component " << term->GetName()
115 << " is not of type RooAbsReal or RooAbsCategory" << endl ;
116 throw std::invalid_argument("RooProduct can only handle terms deriving from RooAbsReal or RooAbsCategory.");
117 }
118}
119
120////////////////////////////////////////////////////////////////////////////////
121/// Force internal handling of integration of given observable if any
122/// of the product terms depend on it.
123
125{
126 // Force internal handling of integration of given observable if any
127 // of the product terms depend on it.
128
129 bool depends(false);
130 for (auto const* rcomp : static_range_cast<RooAbsReal*>(_compRSet)) {
131 if (depends) break;
132 depends = rcomp->dependsOn(dep);
133 }
134 return depends ;
135}
136
137
138
139////////////////////////////////////////////////////////////////////////////////
140/// Group observables into subsets in which the product factorizes
141/// and that can thus be integrated separately
142
144{
145 ProdMap* map = new ProdMap ;
146
147 // Do we have any terms which do not depend on the
148 // on the variables we integrate over?
149 RooArgList *indep = new RooArgList();
150 for (auto const* rcomp : static_range_cast<RooAbsReal*>(_compRSet)) {
151 if( !rcomp->dependsOn(allVars) ) indep->add(*rcomp);
152 }
153 if (indep->getSize()!=0) {
154 map->push_back( std::make_pair(new RooArgSet(),indep) );
155 } else {
156 delete indep;
157 }
158
159 // Map observables -> functions ; start with individual observables
160 for (auto const* var : static_range_cast<RooAbsReal*>(allVars)) {
161 RooArgSet *vars = new RooArgSet(); vars->add(*var);
162 RooArgList *comps = new RooArgList();
163
164 for (auto const* rcomp2 : static_range_cast<RooAbsReal*>(_compRSet)) {
165 if( rcomp2->dependsOn(*var) ) comps->add(*rcomp2);
166 }
167 map->push_back( std::make_pair(vars,comps) );
168 }
169
170 // Merge groups with overlapping dependents
171 bool overlap;
172 do {
173 std::pair<ProdMap::iterator,ProdMap::iterator> i = findOverlap2nd(map->begin(),map->end());
174 overlap = (i.first!=i.second);
175 if (overlap) {
176 i.first->first->add(*i.second->first);
177
178 // In the merging step, make sure not to duplicate
179 for (auto const* targ : *(i.second->second)) {
180 if (!i.first->second->find(*targ)) {
181 i.first->second->add(*targ) ;
182 }
183 }
184 //i.first->second->add(*i.second->second);
185
186 delete i.second->first;
187 delete i.second->second;
188 map->erase(i.second);
189 }
190 } while (overlap);
191
192#ifndef NDEBUG
193 // check that we have all variables to be integrated over on the LHS
194 // of the map, and all terms in the product do appear on the RHS
195 int nVar=0; int nFunc=0;
196 for (ProdMap::iterator i = map->begin();i!=map->end();++i) {
197 nVar+=i->first->getSize();
198 nFunc+=i->second->getSize();
199 }
200 assert(nVar==allVars.getSize());
201 assert(nFunc==_compRSet.getSize());
202#endif
203 return map;
204}
205
206
207
208////////////////////////////////////////////////////////////////////////////////
209/// Return list of (partial) integrals whose product defines the integral of this
210/// RooProduct over the observables in iset in range isetRange. If no such list
211/// exists, create it now and store it in the cache for future use.
212
213Int_t RooProduct::getPartIntList(const RooArgSet* iset, const char *isetRange) const
214{
215
216 // check if we already have integrals for this combination of factors
217 Int_t sterileIndex(-1);
218 CacheElem* cache = (CacheElem*) _cacheMgr.getObj(iset,iset,&sterileIndex,RooNameReg::ptr(isetRange));
219 if (cache!=0) {
220 Int_t code = _cacheMgr.lastIndex();
221 return code;
222 }
223
224 ProdMap* map = groupProductTerms(*iset);
225
226 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") groupProductTerms returned map" ;
227 if (dologD(Integration)) {
228 dump_map(ccoutD(Integration),map->begin(),map->end());
229 ccoutD(Integration) << endl;
230 }
231
232 // did we find any factorizable terms?
233 if (map->size()<2) {
234
235 for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
236 delete iter->first ;
237 delete iter->second ;
238 }
239
240 delete map ;
241 return -1; // RRI caller will zero analVars if return code = 0....
242 }
243 cache = new CacheElem();
244
245 for (ProdMap::const_iterator i = map->begin();i!=map->end();++i) {
246 RooAbsReal *term(0);
247 if (i->second->getSize()>1) { // create a RooProd for this subexpression
248 const char *name = makeFPName("SUBPROD_",*i->second);
249 term = new RooProduct(name,name,*i->second);
250 cache->_ownedList.addOwned(*term);
251 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created subexpression " << term->GetName() << endl;
252 } else {
253 assert(i->second->getSize()==1);
254 term = static_cast<RooAbsReal*>(i->second->at(0));
255 }
256 assert(term!=0);
257 if (i->first->empty()) { // check whether we need to integrate over this term or not...
258 cache->_prodList.add(*term);
259 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding simple factor " << term->GetName() << endl;
260 } else {
261 RooAbsReal *integral = term->createIntegral(*i->first,isetRange);
262 cache->_prodList.add(*integral);
263 cache->_ownedList.addOwned(*integral);
264 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding integral for " << term->GetName() << " : " << integral->GetName() << endl;
265 }
266 }
267 // add current set-up to cache, and return index..
268 Int_t code = _cacheMgr.setObj(iset,iset,(RooAbsCacheElement*)cache,RooNameReg::ptr(isetRange));
269
270 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created list " << cache->_prodList << " with code " << code+1 << endl
271 << " for iset=" << *iset << " @" << iset << " range: " << (isetRange?isetRange:"<none>") << endl ;
272
273 for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
274 delete iter->first ;
275 delete iter->second ;
276 }
277 delete map ;
278 return code;
279}
280
281
282////////////////////////////////////////////////////////////////////////////////
283/// Declare that we handle all integrations internally
284
286 const RooArgSet* /*normSet*/,
287 const char* rangeName) const
288{
289 if (_forceNumInt) return 0 ;
290
291 // Declare that we can analytically integrate all requested observables
292 // (basically, we will take care of the problem, and delegate where required)
293 //assert(normSet==0);
294 assert(analVars.empty());
295 analVars.add(allVars) ;
296 Int_t code = getPartIntList(&analVars,rangeName)+1;
297 return code ;
298}
299
300
301////////////////////////////////////////////////////////////////////////////////
302/// Calculate integral internally from appropriate partial integral cache
303
304double RooProduct::analyticalIntegral(Int_t code, const char* rangeName) const
305{
306 // note: rangeName implicit encoded in code: see _cacheMgr.setObj in getPartIntList...
307 CacheElem *cache = (CacheElem*) _cacheMgr.getObjByIndex(code-1);
308 if (cache==0) {
309 // cache got sterilized, trigger repopulation of this slot, then try again...
310 std::unique_ptr<RooArgSet> vars( getParameters(RooArgSet()) );
311 RooArgSet iset = _cacheMgr.selectFromSet2(*vars, code-1);
312 Int_t code2 = getPartIntList(&iset,rangeName)+1;
313 assert(code==code2); // must have revived the right (sterilized) slot...
314 return analyticalIntegral(code2,rangeName);
315 }
316 assert(cache!=0);
317
318 return calculate(cache->_prodList);
319}
320
321
322////////////////////////////////////////////////////////////////////////////////
323/// Calculate and return product of partial terms in partIntList
324
325double RooProduct::calculate(const RooArgList& partIntList) const
326{
327 double val=1;
328 for (const auto arg : partIntList) {
329 const auto term = static_cast<const RooAbsReal*>(arg);
330 double x = term->getVal();
331 val*= x;
332 }
333 return val;
334}
335
336
337////////////////////////////////////////////////////////////////////////////////
338/// Construct automatic name for internal product terms
339
340const char* RooProduct::makeFPName(const char *pfx,const RooArgSet& terms) const
341{
342 static TString pname;
343 pname = pfx;
344 bool first(true);
345 for (auto const* arg : terms) {
346 if (first) { first=false;}
347 else pname.Append("_X_");
348 pname.Append(arg->GetName());
349 }
350 return pname.Data();
351}
352
353
354
355////////////////////////////////////////////////////////////////////////////////
356/// Evaluate product of input functions
357
359{
360 double prod(1) ;
361
362 const RooArgSet* nset = _compRSet.nset() ;
363 for (const auto item : _compRSet) {
364 auto rcomp = static_cast<const RooAbsReal*>(item);
365
366 prod *= rcomp->getVal(nset) ;
367 }
368
369 for (const auto item : _compCSet) {
370 auto ccomp = static_cast<const RooAbsCategory*>(item);
371
372 prod *= ccomp->getCurrentIndex() ;
373 }
374
375 return prod ;
376}
377
378
379void RooProduct::computeBatch(cudaStream_t* /*stream*/, double* output, size_t nEvents, RooFit::Detail::DataMap const& dataMap) const
380{
381 for (unsigned int i = 0; i < nEvents; ++i) {
382 output[i] = 1.;
383 }
384
385 for (const auto item : _compRSet) {
386 auto rcomp = static_cast<const RooAbsReal*>(item);
387 auto componentValues = dataMap.at(rcomp);
388
389 for (unsigned int i = 0; i < nEvents; ++i) {
390 output[i] *= componentValues.size() == 1 ? componentValues[0] : componentValues[i];
391 }
392 }
393
394 for (const auto item : _compCSet) {
395 auto ccomp = static_cast<const RooAbsCategory*>(item);
396 const int catIndex = ccomp->getCurrentIndex();
397
398 for (unsigned int i = 0; i < nEvents; ++i) {
399 output[i] *= catIndex;
400 }
401 }
402}
403
404
405////////////////////////////////////////////////////////////////////////////////
406/// Forward the plot sampling hint from the p.d.f. that defines the observable obs
407
408std::list<double>* RooProduct::binBoundaries(RooAbsRealLValue& obs, double xlo, double xhi) const
409{
410 for (const auto item : _compRSet) {
411 auto func = static_cast<const RooAbsReal*>(item);
412
413 list<double>* binb = func->binBoundaries(obs,xlo,xhi) ;
414 if (binb) {
415 return binb ;
416 }
417 }
418
419 return 0 ;
420}
421
422
423//_____________________________________________________________________________B
425{
426 // If all components that depend on obs are binned that so is the product
427
428 for (const auto item : _compRSet) {
429 auto func = static_cast<const RooAbsReal*>(item);
430
431 if (func->dependsOn(obs) && !func->isBinnedDistribution(obs)) {
432 return false ;
433 }
434 }
435
436 return true ;
437}
438
439
440
441////////////////////////////////////////////////////////////////////////////////
442/// Forward the plot sampling hint from the p.d.f. that defines the observable obs
443
444std::list<double>* RooProduct::plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const
445{
446 for (const auto item : _compRSet) {
447 auto func = static_cast<const RooAbsReal*>(item);
448
449 list<double>* hint = func->plotSamplingHint(obs,xlo,xhi) ;
450 if (hint) {
451 return hint ;
452 }
453 }
454
455 return 0 ;
456}
457
458
459
460////////////////////////////////////////////////////////////////////////////////
461/// Destructor
462
464{
465}
466
467
468////////////////////////////////////////////////////////////////////////////////
469/// Return list of all RooAbsArgs in cache element
470
472{
473 RooArgList ret(_ownedList) ;
474 return ret ;
475}
476
477
478
479
480////////////////////////////////////////////////////////////////////////////////
481/// Label OK'ed components of a RooProduct with cache-and-track
482
484{
485 RooArgSet comp(components()) ;
486 for (const auto parg : comp) {
487 if (parg->isDerived()) {
488 if (parg->canNodeBeCached()==Always) {
489 trackNodes.add(*parg) ;
490 //cout << "tracking node RooProduct component " << parg->ClassName() << "::" << parg->GetName() << endl ;
491 }
492 }
493 }
494}
495
496
497
498
499
500////////////////////////////////////////////////////////////////////////////////
501/// Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the
502/// product operator construction
503
504void RooProduct::printMetaArgs(ostream& os) const
505{
506 bool first(true) ;
507
508 for (const auto rcomp : _compRSet) {
509 if (!first) { os << " * " ; } else { first = false ; }
510 os << rcomp->GetName() ;
511 }
512
513 for (const auto item : _compCSet) {
514 auto ccomp = static_cast<const RooAbsCategory*>(item);
515
516 if (!first) { os << " * " ; } else { first = false ; }
517 os << ccomp->GetName() ;
518 }
519
520 os << " " ;
521}
522
523
525 RooAbsReal::ioStreamerPass2(); // call the baseclass method
526
527 if(numProxies() < 2) {
528 throw std::runtime_error("RooProduct::ioStreamerPass2(): the number of proxies in the proxy list should be at leat 2!");
529 }
530
531 // If the proxy data members are evolved by schema evolution, the proxy list
532 // that references them will contain null pointers because the evolved
533 // members are only created after the proxy list. That's why we have to set
534 // them manually in that case.
535 RooAbsProxy * p0 = getProxy(0);
536 if(p0 == nullptr) {
538 p0 = &_compRSet;
539 }
540 RooAbsProxy * p1 = getProxy(1);
541 if(p1 == nullptr) {
543 p1 = &_compCSet;
544 }
545
546 // If the proxies in the proxy list still don't correspond to _compRSet and
547 // _compCSet, it's time to print errors. And try to recover.
548 auto expectProxyIs = [this](std::size_t idx, RooAbsProxy * proxyInArg, RooListProxy * ourProxy, const char* memberName) {
549 if(proxyInArg != ourProxy) {
550 // From experience, it's rather the members of the RooProduct that is
551 // still correct in these inconsistent cases. That's why we try to
552 // recover by setting the proxy in the _proxyList to be equal to the
553 // member proxy. But that might be wrong, so it's important to warn the
554 // user anyway.
555 _proxyList.RemoveAt(idx);
556 _proxyList.AddAt(ourProxy, idx);
557 std::stringstream ss;
558 ss << "Problem when reading RooProduct instance \"" << GetName() << "\"!\n"
559 << " _proxyList[" << idx << "] was expected to be equal to " << memberName << ", but it's not.\n"
560 << " - proxyList[" << idx << "] : ";
561 proxyInArg->print(ss, true);
562 ss << "\n - " << memberName << " : " ;
563 ourProxy->print(ss, true);
564 ss << "\n RooFit will resolve this inconsistency by making _proxyList[" << idx << "] point to " << memberName
565 << ".";
566 coutW(LinkStateMgmt) << ss.str() << std::endl;
567 }
568 };
569
570 expectProxyIs(0, p0, &_compRSet, "_compRSet");
571 expectProxyIs(1, p1, &_compCSet, "_compCSet");
572}
573
574
575namespace {
576
577std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end)
578{
579 // Utility function finding pairs of overlapping input functions
580 for (; i!=end; ++i) for ( RPPMIter j(i+1); j!=end; ++j) {
581 if (i->second->overlaps(*j->second)) {
582 return std::make_pair(i,j);
583 }
584 }
585 return std::make_pair(end,end);
586}
587
588
589void dump_map(ostream& os, RPPMIter i, RPPMIter end)
590{
591 // Utility dump function for debugging
592 bool first(true);
593 os << " [ " ;
594 for(; i!=end;++i) {
595 if (first) { first=false; }
596 else { os << " , " ; }
597 os << *(i->first) << " -> " << *(i->second) ;
598 }
599 os << " ] " ;
600}
601
602}
#define cxcoutD(a)
Definition: RooMsgService.h:85
#define coutW(a)
Definition: RooMsgService.h:36
#define dologD(a)
Definition: RooMsgService.h:69
#define coutE(a)
Definition: RooMsgService.h:37
#define ccoutD(a)
Definition: RooMsgService.h:41
#define TRACE_DESTROY
Definition: RooTrace.h:24
#define TRACE_CREATE
Definition: RooTrace.h:23
#define ClassImp(name)
Definition: Rtypes.h:375
char name[80]
Definition: TGX11.cxx:110
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooRefArray _proxyList
Definition: RooAbsArg.h:640
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2391
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1387
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1374
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
Definition: RooAbsArg.cxx:563
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
A space to attach TBranches.
virtual value_type getCurrentIndex() const
Return index number of current state.
bool empty() const
Int_t getSize() const
Return the number of elements in the collection.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
RooAbsArg * first() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:33
const RooArgSet * nset() const
Definition: RooAbsProxy.h:48
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
virtual std::list< double > * binBoundaries(RooAbsRealLValue &obs, double xlo, double xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
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 std::liste...
Definition: RooAbsReal.cxx:523
bool _forceNumInt
Force numerical integration if flag set.
Definition: RooAbsReal.h:499
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=nullptr)
Setter function without integration set.
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
RooArgSet selectFromSet2(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 2.
Int_t lastIndex() const
Return index of slot used in last get or set operation.
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=nullptr, const TNamed *isetRangeName=nullptr)
Getter function without integration set.
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
auto & at(RooAbsArg const *arg, RooAbsArg const *=nullptr)
Definition: DataMap.h:88
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:81
RooArgList containedArgs(Action) override
Return list of all RooAbsArgs in cache element.
Definition: RooProduct.cxx:471
RooArgList _prodList
Definition: RooProduct.h:77
RooArgList _ownedList
Definition: RooProduct.h:78
~CacheElem() override
Destructor.
Definition: RooProduct.cxx:463
A RooProduct represents the product of a given set of RooAbsReal objects.
Definition: RooProduct.h:29
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
Definition: RooProduct.cxx:408
RooListProxy _compRSet
Definition: RooProduct.h:70
double evaluate() const override
Evaluate product of input functions.
Definition: RooProduct.cxx:358
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Calculate integral internally from appropriate partial integral cache.
Definition: RooProduct.cxx:304
void addTerm(RooAbsArg *term)
Add a term to this product.
Definition: RooProduct.cxx:108
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Forward the plot sampling hint from the p.d.f. that defines the observable obs.
Definition: RooProduct.cxx:444
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
Definition: RooProduct.cxx:143
double calculate(const RooArgList &partIntList) const
The cache manager.
Definition: RooProduct.cxx:325
bool forceAnalyticalInt(const RooAbsArg &dep) const override
Force internal handling of integration of given observable if any of the product terms depend on it.
Definition: RooProduct.cxx:124
void setCacheAndTrackHints(RooArgSet &) override
Label OK'ed components of a RooProduct with cache-and-track.
Definition: RooProduct.cxx:483
~RooProduct() override
Destructor.
Definition: RooProduct.cxx:66
bool isBinnedDistribution(const RooArgSet &obs) const override
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooProduct.cxx:424
void ioStreamerPass2() override
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooProduct.cxx:524
Int_t getPartIntList(const RooArgSet *iset, const char *rangeName=nullptr) const
Return list of (partial) integrals whose product defines the integral of this RooProduct over the obs...
Definition: RooProduct.cxx:213
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Declare that we handle all integrations internally.
Definition: RooProduct.cxx:285
void printMetaArgs(std::ostream &os) const override
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
Definition: RooProduct.cxx:504
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
Definition: RooProduct.cxx:340
RooProduct()
Default constructor.
Definition: RooProduct.cxx:56
RooObjCacheManager _cacheMgr
Definition: RooProduct.h:81
RooListProxy _compCSet
Definition: RooProduct.h:71
void computeBatch(cudaStream_t *, double *output, size_t nEvents, RooFit::Detail::DataMap const &) const override
Base function for computing multiple values of a RooAbsReal.
Definition: RooProduct.cxx:379
RooArgList components()
Definition: RooProduct.h:48
const char * GetName() const override
Returns name of object.
Definition: TNamed.h:47
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
Definition: TObjArray.cxx:254
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
Definition: TObjArray.cxx:694
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
TString & Append(const char *cs)
Definition: TString.h:565
Double_t x[n]
Definition: legend1.C:17
@ InputArguments
Definition: RooGlobalFunc.h:63
@ Integration
Definition: RooGlobalFunc.h:62
@ LinkStateMgmt
Definition: RooGlobalFunc.h:62
Definition: first.py:1
static void output()