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 RooFIter compRIter = _compRSet.fwdIterator() ;
130 RooAbsReal* rcomp ;
131 bool depends(false);
132 while((rcomp=(RooAbsReal*)compRIter.next())&&!depends) {
133 depends = rcomp->dependsOn(dep);
134 }
135 return depends ;
136}
137
138
139
140////////////////////////////////////////////////////////////////////////////////
141/// Group observables into subsets in which the product factorizes
142/// and that can thus be integrated separately
143
145{
146 ProdMap* map = new ProdMap ;
147
148 // Do we have any terms which do not depend on the
149 // on the variables we integrate over?
150 RooAbsReal* rcomp ;
151 RooFIter compRIter = _compRSet.fwdIterator() ;
152 RooArgList *indep = new RooArgList();
153 while((rcomp=(RooAbsReal*) compRIter.next())) {
154 if( !rcomp->dependsOn(allVars) ) indep->add(*rcomp);
155 }
156 if (indep->getSize()!=0) {
157 map->push_back( std::make_pair(new RooArgSet(),indep) );
158 } else {
159 delete indep;
160 }
161
162 // Map observables -> functions ; start with individual observables
163 RooFIter allVarsIter = allVars.fwdIterator() ;
164 RooAbsReal* var ;
165 while((var=(RooAbsReal*)allVarsIter.next())) {
166 RooArgSet *vars = new RooArgSet(); vars->add(*var);
167 RooArgList *comps = new RooArgList();
168 RooAbsReal* rcomp2 ;
169
170 compRIter = _compRSet.fwdIterator() ;
171 while((rcomp2=(RooAbsReal*) compRIter.next())) {
172 if( rcomp2->dependsOn(*var) ) comps->add(*rcomp2);
173 }
174 map->push_back( std::make_pair(vars,comps) );
175 }
176
177 // Merge groups with overlapping dependents
178 bool overlap;
179 do {
180 std::pair<ProdMap::iterator,ProdMap::iterator> i = findOverlap2nd(map->begin(),map->end());
181 overlap = (i.first!=i.second);
182 if (overlap) {
183 i.first->first->add(*i.second->first);
184
185 // In the merging step, make sure not to duplicate
186 RooFIter it = i.second->second->fwdIterator() ;
187 RooAbsArg* targ ;
188 while ((targ = it.next())) {
189 if (!i.first->second->find(*targ)) {
190 i.first->second->add(*targ) ;
191 }
192 }
193 //i.first->second->add(*i.second->second);
194
195 delete i.second->first;
196 delete i.second->second;
197 map->erase(i.second);
198 }
199 } while (overlap);
200
201#ifndef NDEBUG
202 // check that we have all variables to be integrated over on the LHS
203 // of the map, and all terms in the product do appear on the RHS
204 int nVar=0; int nFunc=0;
205 for (ProdMap::iterator i = map->begin();i!=map->end();++i) {
206 nVar+=i->first->getSize();
207 nFunc+=i->second->getSize();
208 }
209 assert(nVar==allVars.getSize());
210 assert(nFunc==_compRSet.getSize());
211#endif
212 return map;
213}
214
215
216
217////////////////////////////////////////////////////////////////////////////////
218/// Return list of (partial) integrals whose product defines the integral of this
219/// RooProduct over the observables in iset in range isetRange. If no such list
220/// exists, create it now and store it in the cache for future use.
221
222Int_t RooProduct::getPartIntList(const RooArgSet* iset, const char *isetRange) const
223{
224
225 // check if we already have integrals for this combination of factors
226 Int_t sterileIndex(-1);
227 CacheElem* cache = (CacheElem*) _cacheMgr.getObj(iset,iset,&sterileIndex,RooNameReg::ptr(isetRange));
228 if (cache!=0) {
229 Int_t code = _cacheMgr.lastIndex();
230 return code;
231 }
232
233 ProdMap* map = groupProductTerms(*iset);
234
235 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") groupProductTerms returned map" ;
236 if (dologD(Integration)) {
237 dump_map(ccoutD(Integration),map->begin(),map->end());
238 ccoutD(Integration) << endl;
239 }
240
241 // did we find any factorizable terms?
242 if (map->size()<2) {
243
244 for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
245 delete iter->first ;
246 delete iter->second ;
247 }
248
249 delete map ;
250 return -1; // RRI caller will zero analVars if return code = 0....
251 }
252 cache = new CacheElem();
253
254 for (ProdMap::const_iterator i = map->begin();i!=map->end();++i) {
255 RooAbsReal *term(0);
256 if (i->second->getSize()>1) { // create a RooProd for this subexpression
257 const char *name = makeFPName("SUBPROD_",*i->second);
258 term = new RooProduct(name,name,*i->second);
259 cache->_ownedList.addOwned(*term);
260 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created subexpression " << term->GetName() << endl;
261 } else {
262 assert(i->second->getSize()==1);
263 RooFIter j = i->second->fwdIterator();
264 term = (RooAbsReal*)j.next();
265 }
266 assert(term!=0);
267 if (i->first->empty()) { // check whether we need to integrate over this term or not...
268 cache->_prodList.add(*term);
269 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding simple factor " << term->GetName() << endl;
270 } else {
271 RooAbsReal *integral = term->createIntegral(*i->first,isetRange);
272 cache->_prodList.add(*integral);
273 cache->_ownedList.addOwned(*integral);
274 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding integral for " << term->GetName() << " : " << integral->GetName() << endl;
275 }
276 }
277 // add current set-up to cache, and return index..
278 Int_t code = _cacheMgr.setObj(iset,iset,(RooAbsCacheElement*)cache,RooNameReg::ptr(isetRange));
279
280 cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created list " << cache->_prodList << " with code " << code+1 << endl
281 << " for iset=" << *iset << " @" << iset << " range: " << (isetRange?isetRange:"<none>") << endl ;
282
283 for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
284 delete iter->first ;
285 delete iter->second ;
286 }
287 delete map ;
288 return code;
289}
290
291
292////////////////////////////////////////////////////////////////////////////////
293/// Declare that we handle all integrations internally
294
296 const RooArgSet* /*normSet*/,
297 const char* rangeName) const
298{
299 if (_forceNumInt) return 0 ;
300
301 // Declare that we can analytically integrate all requested observables
302 // (basically, we will take care of the problem, and delegate where required)
303 //assert(normSet==0);
304 assert(analVars.empty());
305 analVars.add(allVars) ;
306 Int_t code = getPartIntList(&analVars,rangeName)+1;
307 return code ;
308}
309
310
311////////////////////////////////////////////////////////////////////////////////
312/// Calculate integral internally from appropriate partial integral cache
313
314double RooProduct::analyticalIntegral(Int_t code, const char* rangeName) const
315{
316 // note: rangeName implicit encoded in code: see _cacheMgr.setObj in getPartIntList...
317 CacheElem *cache = (CacheElem*) _cacheMgr.getObjByIndex(code-1);
318 if (cache==0) {
319 // cache got sterilized, trigger repopulation of this slot, then try again...
320 std::unique_ptr<RooArgSet> vars( getParameters(RooArgSet()) );
321 RooArgSet iset = _cacheMgr.selectFromSet2(*vars, code-1);
322 Int_t code2 = getPartIntList(&iset,rangeName)+1;
323 assert(code==code2); // must have revived the right (sterilized) slot...
324 return analyticalIntegral(code2,rangeName);
325 }
326 assert(cache!=0);
327
328 return calculate(cache->_prodList);
329}
330
331
332////////////////////////////////////////////////////////////////////////////////
333/// Calculate and return product of partial terms in partIntList
334
335double RooProduct::calculate(const RooArgList& partIntList) const
336{
337 double val=1;
338 for (const auto arg : partIntList) {
339 const auto term = static_cast<const RooAbsReal*>(arg);
340 double x = term->getVal();
341 val*= x;
342 }
343 return val;
344}
345
346
347////////////////////////////////////////////////////////////////////////////////
348/// Construct automatic name for internal product terms
349
350const char* RooProduct::makeFPName(const char *pfx,const RooArgSet& terms) const
351{
352 static TString pname;
353 pname = pfx;
354 RooFIter i = terms.fwdIterator();
355 RooAbsArg *arg;
356 bool first(true);
357 while((arg=(RooAbsArg*)i.next())) {
358 if (first) { first=false;}
359 else pname.Append("_X_");
360 pname.Append(arg->GetName());
361 }
362 return pname.Data();
363}
364
365
366
367////////////////////////////////////////////////////////////////////////////////
368/// Evaluate product of input functions
369
371{
372 double prod(1) ;
373
374 const RooArgSet* nset = _compRSet.nset() ;
375 for (const auto item : _compRSet) {
376 auto rcomp = static_cast<const RooAbsReal*>(item);
377
378 prod *= rcomp->getVal(nset) ;
379 }
380
381 for (const auto item : _compCSet) {
382 auto ccomp = static_cast<const RooAbsCategory*>(item);
383
384 prod *= ccomp->getCurrentIndex() ;
385 }
386
387 return prod ;
388}
389
390
391void RooProduct::computeBatch(cudaStream_t* /*stream*/, double* output, size_t nEvents, RooFit::Detail::DataMap const& dataMap) const
392{
393 for (unsigned int i = 0; i < nEvents; ++i) {
394 output[i] = 1.;
395 }
396
397 for (const auto item : _compRSet) {
398 auto rcomp = static_cast<const RooAbsReal*>(item);
399 auto componentValues = dataMap.at(rcomp);
400
401 for (unsigned int i = 0; i < nEvents; ++i) {
402 output[i] *= componentValues.size() == 1 ? componentValues[0] : componentValues[i];
403 }
404 }
405
406 for (const auto item : _compCSet) {
407 auto ccomp = static_cast<const RooAbsCategory*>(item);
408 const int catIndex = ccomp->getCurrentIndex();
409
410 for (unsigned int i = 0; i < nEvents; ++i) {
411 output[i] *= catIndex;
412 }
413 }
414}
415
416
417////////////////////////////////////////////////////////////////////////////////
418/// Forward the plot sampling hint from the p.d.f. that defines the observable obs
419
420std::list<double>* RooProduct::binBoundaries(RooAbsRealLValue& obs, double xlo, double xhi) const
421{
422 for (const auto item : _compRSet) {
423 auto func = static_cast<const RooAbsReal*>(item);
424
425 list<double>* binb = func->binBoundaries(obs,xlo,xhi) ;
426 if (binb) {
427 return binb ;
428 }
429 }
430
431 return 0 ;
432}
433
434
435//_____________________________________________________________________________B
437{
438 // If all components that depend on obs are binned that so is the product
439
440 for (const auto item : _compRSet) {
441 auto func = static_cast<const RooAbsReal*>(item);
442
443 if (func->dependsOn(obs) && !func->isBinnedDistribution(obs)) {
444 return false ;
445 }
446 }
447
448 return true ;
449}
450
451
452
453////////////////////////////////////////////////////////////////////////////////
454/// Forward the plot sampling hint from the p.d.f. that defines the observable obs
455
456std::list<double>* RooProduct::plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const
457{
458 for (const auto item : _compRSet) {
459 auto func = static_cast<const RooAbsReal*>(item);
460
461 list<double>* hint = func->plotSamplingHint(obs,xlo,xhi) ;
462 if (hint) {
463 return hint ;
464 }
465 }
466
467 return 0 ;
468}
469
470
471
472////////////////////////////////////////////////////////////////////////////////
473/// Destructor
474
476{
477}
478
479
480////////////////////////////////////////////////////////////////////////////////
481/// Return list of all RooAbsArgs in cache element
482
484{
485 RooArgList ret(_ownedList) ;
486 return ret ;
487}
488
489
490
491
492////////////////////////////////////////////////////////////////////////////////
493/// Label OK'ed components of a RooProduct with cache-and-track
494
496{
497 RooArgSet comp(components()) ;
498 for (const auto parg : comp) {
499 if (parg->isDerived()) {
500 if (parg->canNodeBeCached()==Always) {
501 trackNodes.add(*parg) ;
502 //cout << "tracking node RooProduct component " << parg->ClassName() << "::" << parg->GetName() << endl ;
503 }
504 }
505 }
506}
507
508
509
510
511
512////////////////////////////////////////////////////////////////////////////////
513/// Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the
514/// product operator construction
515
516void RooProduct::printMetaArgs(ostream& os) const
517{
518 bool first(true) ;
519
520 for (const auto rcomp : _compRSet) {
521 if (!first) { os << " * " ; } else { first = false ; }
522 os << rcomp->GetName() ;
523 }
524
525 for (const auto item : _compCSet) {
526 auto ccomp = static_cast<const RooAbsCategory*>(item);
527
528 if (!first) { os << " * " ; } else { first = false ; }
529 os << ccomp->GetName() ;
530 }
531
532 os << " " ;
533}
534
535
537 RooAbsReal::ioStreamerPass2(); // call the baseclass method
538
539 if(numProxies() < 2) {
540 throw std::runtime_error("RooProduct::ioStreamerPass2(): the number of proxies in the proxy list should be at leat 2!");
541 }
542
543 // If the proxy data members are evolved by schema evolution, the proxy list
544 // that references them will contain null pointers because the evolved
545 // members are only created after the proxy list. That's why we have to set
546 // them manually in that case. But to make sure we don't overwrite valid
547 // proxies, an exception will be thrown if the proxy list constains
548 // unexpected values.
549 RooAbsProxy * p0 = getProxy(0);
550 if(p0 != &_compRSet) {
551 if(p0) {
552 throw std::runtime_error("RooProduct::ioStreamerPass2(): the first proxy unexpectedly wasn't the compRSet!");
553 }
555 }
556 RooAbsProxy * p1 = getProxy(1);
557 if(p1 != &_compCSet) {
558 if(p1) {
559 throw std::runtime_error("RooProduct::ioStreamerPass2(): the second proxy unexpectedly wasn't the compCSet!");
560 }
562 }
563}
564
565
566namespace {
567
568std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end)
569{
570 // Utility function finding pairs of overlapping input functions
571 for (; i!=end; ++i) for ( RPPMIter j(i+1); j!=end; ++j) {
572 if (i->second->overlaps(*j->second)) {
573 return std::make_pair(i,j);
574 }
575 }
576 return std::make_pair(end,end);
577}
578
579
580void dump_map(ostream& os, RPPMIter i, RPPMIter end)
581{
582 // Utility dump function for debugging
583 bool first(true);
584 os << " [ " ;
585 for(; i!=end;++i) {
586 if (first) { first=false; }
587 else { os << " , " ; }
588 os << *(i->first) << " -> " << *(i->second) ;
589 }
590 os << " ] " ;
591}
592
593}
#define cxcoutD(a)
Definition: RooMsgService.h:85
#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:658
friend class RooArgSet
Definition: RooAbsArg.h:645
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooAbsArg.cxx:2362
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Definition: RooAbsArg.cxx:829
Int_t numProxies() const
Return the number of registered proxies.
Definition: RooAbsArg.cxx:1365
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
Definition: RooAbsArg.cxx:1352
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:565
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.
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
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.
RooFIter fwdIterator() const
One-time forward iterator.
RooAbsArg * first() const
RooAbsProxy is the abstact interface for proxy classes.
Definition: RooAbsProxy.h:30
const RooArgSet * nset() const
Definition: RooAbsProxy.h:45
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:64
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 listed in ...
Definition: RooAbsReal.cxx:553
bool _forceNumInt
Force numerical integration if flag set.
Definition: RooAbsReal.h:487
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:57
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
Getter 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.
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Setter 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...
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
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:483
RooArgList _prodList
Definition: RooProduct.h:74
RooArgList _ownedList
Definition: RooProduct.h:75
~CacheElem() override
Destructor.
Definition: RooProduct.cxx:475
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:420
RooListProxy _compRSet
Definition: RooProduct.h:67
double evaluate() const override
Evaluate product of input functions.
Definition: RooProduct.cxx:370
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:456
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
Definition: RooProduct.cxx:144
double calculate(const RooArgList &partIntList) const
The cache manager.
Definition: RooProduct.cxx:335
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:495
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const override
Declare that we handle all integrations internally.
Definition: RooProduct.cxx:295
~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:436
void ioStreamerPass2() override
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Definition: RooProduct.cxx:536
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:516
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
Definition: RooProduct.cxx:350
double analyticalIntegral(Int_t code, const char *rangeName=0) const override
Calculate integral internally from appropriate partial integral cache.
Definition: RooProduct.cxx:314
RooProduct()
Default constructor.
Definition: RooProduct.cxx:56
RooObjCacheManager _cacheMgr
Definition: RooProduct.h:78
Int_t getPartIntList(const RooArgSet *iset, const char *rangeName=0) const
Return list of (partial) integrals whose product defines the integral of this RooProduct over the obs...
Definition: RooProduct.cxx:222
RooListProxy _compCSet
Definition: RooProduct.h:68
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:391
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
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
TString & Append(const char *cs)
Definition: TString.h:564
Double_t x[n]
Definition: legend1.C:17
@ InputArguments
Definition: RooGlobalFunc.h:64
@ Integration
Definition: RooGlobalFunc.h:63
Definition: first.py:1
static void output()