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 
22 A 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 "RunContext.h"
33 #include "RooTrace.h"
34 
35 #include <cmath>
36 #include <memory>
37 
38 using namespace std ;
39 
41 ;
42 
43 class RooProduct::ProdMap : public std::vector<std::pair<RooArgSet*,RooArgList*> > {} ;
44 
45 // Namespace with helper functions that have STL stuff that we don't want to expose to CINT
46 namespace {
47  typedef RooProduct::ProdMap::iterator RPPMIter ;
48  std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end) ;
49  void dump_map(ostream& os, RPPMIter i, RPPMIter end) ;
50 }
51 
52 
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Default constructor
56 
58 {
60 }
61 
62 
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// Destructor
66 
68 {
70 }
71 
72 
73 
74 ////////////////////////////////////////////////////////////////////////////////
75 /// Construct function representing the product of functions in prodSet
76 
77 RooProduct::RooProduct(const char* name, const char* title, const RooArgList& prodSet) :
78  RooAbsReal(name, title),
79  _compRSet("!compRSet","Set of real product components",this),
80  _compCSet("!compCSet","Set of category product components",this),
81  _cacheMgr(this,10)
82 {
83  for (auto comp : prodSet) {
84  addTerm(comp);
85  }
87 }
88 
89 
90 
91 ////////////////////////////////////////////////////////////////////////////////
92 /// Copy constructor
93 
94 RooProduct::RooProduct(const RooProduct& other, const char* name) :
95  RooAbsReal(other, name),
96  _compRSet("!compRSet",this,other._compRSet),
97  _compCSet("!compCSet",this,other._compCSet),
98  _cacheMgr(other._cacheMgr,this)
99 {
101 }
102 
103 
104 ////////////////////////////////////////////////////////////////////////////////
105 /// Add a term to this product.
107  if (dynamic_cast<RooAbsReal*>(term)) {
108  _compRSet.add(*term) ;
109  } else if (dynamic_cast<RooAbsCategory*>(term)) {
110  _compCSet.add(*term) ;
111  } else {
112  coutE(InputArguments) << "RooProduct::addTerm(" << GetName() << ") ERROR: component " << term->GetName()
113  << " is not of type RooAbsReal or RooAbsCategory" << endl ;
114  throw std::invalid_argument("RooProduct can only handle terms deriving from RooAbsReal or RooAbsCategory.");
115  }
116 }
117 
118 ////////////////////////////////////////////////////////////////////////////////
119 /// Force internal handling of integration of given observable if any
120 /// of the product terms depend on it.
121 
123 {
124  // Force internal handling of integration of given observable if any
125  // of the product terms depend on it.
126 
127  RooFIter compRIter = _compRSet.fwdIterator() ;
128  RooAbsReal* rcomp ;
129  Bool_t depends(kFALSE);
130  while((rcomp=(RooAbsReal*)compRIter.next())&&!depends) {
131  depends = rcomp->dependsOn(dep);
132  }
133  return depends ;
134 }
135 
136 
137 
138 ////////////////////////////////////////////////////////////////////////////////
139 /// Group observables into subsets in which the product factorizes
140 /// and that can thus be integrated separately
141 
143 {
144  ProdMap* map = new ProdMap ;
145 
146  // Do we have any terms which do not depend on the
147  // on the variables we integrate over?
148  RooAbsReal* rcomp ;
149  RooFIter compRIter = _compRSet.fwdIterator() ;
150  RooArgList *indep = new RooArgList();
151  while((rcomp=(RooAbsReal*) compRIter.next())) {
152  if( !rcomp->dependsOn(allVars) ) indep->add(*rcomp);
153  }
154  if (indep->getSize()!=0) {
155  map->push_back( std::make_pair(new RooArgSet(),indep) );
156  } else {
157  delete indep;
158  }
159 
160  // Map observables -> functions ; start with individual observables
161  RooFIter allVarsIter = allVars.fwdIterator() ;
162  RooAbsReal* var ;
163  while((var=(RooAbsReal*)allVarsIter.next())) {
164  RooArgSet *vars = new RooArgSet(); vars->add(*var);
165  RooArgList *comps = new RooArgList();
166  RooAbsReal* rcomp2 ;
167 
168  compRIter = _compRSet.fwdIterator() ;
169  while((rcomp2=(RooAbsReal*) compRIter.next())) {
170  if( rcomp2->dependsOn(*var) ) comps->add(*rcomp2);
171  }
172  map->push_back( std::make_pair(vars,comps) );
173  }
174 
175  // Merge groups with overlapping dependents
176  Bool_t overlap;
177  do {
178  std::pair<ProdMap::iterator,ProdMap::iterator> i = findOverlap2nd(map->begin(),map->end());
179  overlap = (i.first!=i.second);
180  if (overlap) {
181  i.first->first->add(*i.second->first);
182 
183  // In the merging step, make sure not to duplicate
184  RooFIter it = i.second->second->fwdIterator() ;
185  RooAbsArg* targ ;
186  while ((targ = it.next())) {
187  if (!i.first->second->find(*targ)) {
188  i.first->second->add(*targ) ;
189  }
190  }
191  //i.first->second->add(*i.second->second);
192 
193  delete i.second->first;
194  delete i.second->second;
195  map->erase(i.second);
196  }
197  } while (overlap);
198 
199  // check that we have all variables to be integrated over on the LHS
200  // of the map, and all terms in the product do appear on the RHS
201  int nVar=0; int nFunc=0;
202  for (ProdMap::iterator i = map->begin();i!=map->end();++i) {
203  nVar+=i->first->getSize();
204  nFunc+=i->second->getSize();
205  }
206  assert(nVar==allVars.getSize());
207  assert(nFunc==_compRSet.getSize());
208  return map;
209 }
210 
211 
212 
213 ////////////////////////////////////////////////////////////////////////////////
214 /// Return list of (partial) integrals whose product defines the integral of this
215 /// RooProduct over the observables in iset in range isetRange. If no such list
216 /// exists, create it now and store it in the cache for future use.
217 
218 Int_t RooProduct::getPartIntList(const RooArgSet* iset, const char *isetRange) const
219 {
220 
221  // check if we already have integrals for this combination of factors
222  Int_t sterileIndex(-1);
223  CacheElem* cache = (CacheElem*) _cacheMgr.getObj(iset,iset,&sterileIndex,RooNameReg::ptr(isetRange));
224  if (cache!=0) {
225  Int_t code = _cacheMgr.lastIndex();
226  return code;
227  }
228 
229  ProdMap* map = groupProductTerms(*iset);
230 
231  cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") groupProductTerms returned map" ;
232  if (dologD(Integration)) {
233  dump_map(ccoutD(Integration),map->begin(),map->end());
234  ccoutD(Integration) << endl;
235  }
236 
237  // did we find any factorizable terms?
238  if (map->size()<2) {
239 
240  for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
241  delete iter->first ;
242  delete iter->second ;
243  }
244 
245  delete map ;
246  return -1; // RRI caller will zero analVars if return code = 0....
247  }
248  cache = new CacheElem();
249 
250  for (ProdMap::const_iterator i = map->begin();i!=map->end();++i) {
251  RooAbsReal *term(0);
252  if (i->second->getSize()>1) { // create a RooProd for this subexpression
253  const char *name = makeFPName("SUBPROD_",*i->second);
254  term = new RooProduct(name,name,*i->second);
255  cache->_ownedList.addOwned(*term);
256  cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created subexpression " << term->GetName() << endl;
257  } else {
258  assert(i->second->getSize()==1);
259  RooFIter j = i->second->fwdIterator();
260  term = (RooAbsReal*)j.next();
261  }
262  assert(term!=0);
263  if (i->first->getSize()==0) { // check whether we need to integrate over this term or not...
264  cache->_prodList.add(*term);
265  cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding simple factor " << term->GetName() << endl;
266  } else {
267  RooAbsReal *integral = term->createIntegral(*i->first,isetRange);
268  cache->_prodList.add(*integral);
269  cache->_ownedList.addOwned(*integral);
270  cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") adding integral for " << term->GetName() << " : " << integral->GetName() << endl;
271  }
272  }
273  // add current set-up to cache, and return index..
274  Int_t code = _cacheMgr.setObj(iset,iset,(RooAbsCacheElement*)cache,RooNameReg::ptr(isetRange));
275 
276  cxcoutD(Integration) << "RooProduct::getPartIntList(" << GetName() << ") created list " << cache->_prodList << " with code " << code+1 << endl
277  << " for iset=" << *iset << " @" << iset << " range: " << (isetRange?isetRange:"<none>") << endl ;
278 
279  for (ProdMap::iterator iter = map->begin() ; iter != map->end() ; ++iter) {
280  delete iter->first ;
281  delete iter->second ;
282  }
283  delete map ;
284  return code;
285 }
286 
287 
288 ////////////////////////////////////////////////////////////////////////////////
289 /// Declare that we handle all integrations internally
290 
292  const RooArgSet* /*normSet*/,
293  const char* rangeName) const
294 {
295  if (_forceNumInt) return 0 ;
296 
297  // Declare that we can analytically integrate all requested observables
298  // (basically, we will take care of the problem, and delegate where required)
299  //assert(normSet==0);
300  assert(analVars.getSize()==0);
301  analVars.add(allVars) ;
302  Int_t code = getPartIntList(&analVars,rangeName)+1;
303  return code ;
304 }
305 
306 
307 ////////////////////////////////////////////////////////////////////////////////
308 /// Calculate integral internally from appropriate partial integral cache
309 
310 Double_t RooProduct::analyticalIntegral(Int_t code, const char* rangeName) const
311 {
312  // note: rangeName implicit encoded in code: see _cacheMgr.setObj in getPartIntList...
313  CacheElem *cache = (CacheElem*) _cacheMgr.getObjByIndex(code-1);
314  if (cache==0) {
315  // cache got sterilized, trigger repopulation of this slot, then try again...
316  std::unique_ptr<RooArgSet> vars( getParameters(RooArgSet()) );
317  RooArgSet iset = _cacheMgr.selectFromSet2(*vars, code-1);
318  Int_t code2 = getPartIntList(&iset,rangeName)+1;
319  assert(code==code2); // must have revived the right (sterilized) slot...
320  return analyticalIntegral(code2,rangeName);
321  }
322  assert(cache!=0);
323 
324  return calculate(cache->_prodList);
325 }
326 
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Calculate and return product of partial terms in partIntList
330 
331 Double_t RooProduct::calculate(const RooArgList& partIntList) const
332 {
333  Double_t val=1;
334  for (const auto arg : partIntList) {
335  const auto term = static_cast<const RooAbsReal*>(arg);
336  double x = term->getVal();
337  val*= x;
338  }
339  return val;
340 }
341 
342 
343 ////////////////////////////////////////////////////////////////////////////////
344 /// Construct automatic name for internal product terms
345 
346 const char* RooProduct::makeFPName(const char *pfx,const RooArgSet& terms) const
347 {
348  static TString pname;
349  pname = pfx;
350  RooFIter i = terms.fwdIterator();
351  RooAbsArg *arg;
352  Bool_t first(kTRUE);
353  while((arg=(RooAbsArg*)i.next())) {
354  if (first) { first=kFALSE;}
355  else pname.Append("_X_");
356  pname.Append(arg->GetName());
357  }
358  return pname.Data();
359 }
360 
361 
362 
363 ////////////////////////////////////////////////////////////////////////////////
364 /// Evaluate product of input functions
365 
367 {
368  Double_t prod(1) ;
369 
370  const RooArgSet* nset = _compRSet.nset() ;
371  for (const auto item : _compRSet) {
372  auto rcomp = static_cast<const RooAbsReal*>(item);
373 
374  prod *= rcomp->getVal(nset) ;
375  }
376 
377  for (const auto item : _compCSet) {
378  auto ccomp = static_cast<const RooAbsCategory*>(item);
379 
380  prod *= ccomp->getCurrentIndex() ;
381  }
382 
383  return prod ;
384 }
385 
386 
387 ////////////////////////////////////////////////////////////////////////////////
388 /// Evaluate product of input functions for all points found in `evalData`.
390  RooSpan<double> prod;
391 
392  assert(_compRSet.nset() == normSet);
393 
394  for (const auto item : _compRSet) {
395  auto rcomp = static_cast<const RooAbsReal*>(item);
396  auto componentValues = rcomp->getValues(evalData, normSet);
397 
398  if (prod.empty()) {
399  prod = evalData.makeBatch(this, componentValues.size());
400  for (auto& val : prod) val = 1.;
401  } else if (prod.size() == 1 && componentValues.size() > 1) {
402  const double val = prod[0];
403  prod = evalData.makeBatch(this, componentValues.size());
404  std::fill(prod.begin(), prod.end(), val);
405  }
406  assert(prod.size() == componentValues.size() || componentValues.size() == 1);
407 
408  for (unsigned int i = 0; i < prod.size(); ++i) {
409  prod[i] *= componentValues.size() == 1 ? componentValues[0] : componentValues[i];
410  }
411  }
412 
413  for (const auto item : _compCSet) {
414  auto ccomp = static_cast<const RooAbsCategory*>(item);
415  const int catIndex = ccomp->getCurrentIndex();
416 
417  for (unsigned int i = 0; i < prod.size(); ++i) {
418  prod[i] *= catIndex;
419  }
420  }
421 
422  return prod;
423 }
424 
425 
426 
427 ////////////////////////////////////////////////////////////////////////////////
428 /// Forward the plot sampling hint from the p.d.f. that defines the observable obs
429 
430 std::list<Double_t>* RooProduct::binBoundaries(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const
431 {
432  for (const auto item : _compRSet) {
433  auto func = static_cast<const RooAbsReal*>(item);
434 
435  list<Double_t>* binb = func->binBoundaries(obs,xlo,xhi) ;
436  if (binb) {
437  return binb ;
438  }
439  }
440 
441  return 0 ;
442 }
443 
444 
445 //_____________________________________________________________________________B
447 {
448  // If all components that depend on obs are binned that so is the product
449 
450  for (const auto item : _compRSet) {
451  auto func = static_cast<const RooAbsReal*>(item);
452 
453  if (func->dependsOn(obs) && !func->isBinnedDistribution(obs)) {
454  return kFALSE ;
455  }
456  }
457 
458  return kTRUE ;
459 }
460 
461 
462 
463 ////////////////////////////////////////////////////////////////////////////////
464 /// Forward the plot sampling hint from the p.d.f. that defines the observable obs
465 
466 std::list<Double_t>* RooProduct::plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const
467 {
468  for (const auto item : _compRSet) {
469  auto func = static_cast<const RooAbsReal*>(item);
470 
471  list<Double_t>* hint = func->plotSamplingHint(obs,xlo,xhi) ;
472  if (hint) {
473  return hint ;
474  }
475  }
476 
477  return 0 ;
478 }
479 
480 
481 
482 ////////////////////////////////////////////////////////////////////////////////
483 /// Destructor
484 
486 {
487 }
488 
489 
490 ////////////////////////////////////////////////////////////////////////////////
491 /// Return list of all RooAbsArgs in cache element
492 
494 {
495  RooArgList ret(_ownedList) ;
496  return ret ;
497 }
498 
499 
500 
501 
502 ////////////////////////////////////////////////////////////////////////////////
503 /// Label OK'ed components of a RooProduct with cache-and-track
504 
506 {
507  RooArgSet comp(components()) ;
508  for (const auto parg : comp) {
509  if (parg->isDerived()) {
510  if (parg->canNodeBeCached()==Always) {
511  trackNodes.add(*parg) ;
512  //cout << "tracking node RooProduct component " << parg->IsA()->GetName() << "::" << parg->GetName() << endl ;
513  }
514  }
515  }
516 }
517 
518 
519 
520 
521 
522 ////////////////////////////////////////////////////////////////////////////////
523 /// Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the
524 /// product operator construction
525 
526 void RooProduct::printMetaArgs(ostream& os) const
527 {
528  Bool_t first(kTRUE) ;
529 
530  for (const auto rcomp : _compRSet) {
531  if (!first) { os << " * " ; } else { first = kFALSE ; }
532  os << rcomp->GetName() ;
533  }
534 
535  for (const auto item : _compCSet) {
536  auto ccomp = static_cast<const RooAbsCategory*>(item);
537 
538  if (!first) { os << " * " ; } else { first = kFALSE ; }
539  os << ccomp->GetName() ;
540  }
541 
542  os << " " ;
543 }
544 
545 
546 
547 
548 
549 namespace {
550 
551 std::pair<RPPMIter,RPPMIter> findOverlap2nd(RPPMIter i, RPPMIter end)
552 {
553  // Utility function finding pairs of overlapping input functions
554  for (; i!=end; ++i) for ( RPPMIter j(i+1); j!=end; ++j) {
555  if (i->second->overlaps(*j->second)) {
556  return std::make_pair(i,j);
557  }
558  }
559  return std::make_pair(end,end);
560 }
561 
562 
563 void dump_map(ostream& os, RPPMIter i, RPPMIter end)
564 {
565  // Utility dump function for debugging
566  Bool_t first(kTRUE);
567  os << " [ " ;
568  for(; i!=end;++i) {
569  if (first) { first=kFALSE; }
570  else { os << " , " ; }
571  os << *(i->first) << " -> " << *(i->second) ;
572  }
573  os << " ] " ;
574 }
575 
576 }
577 
578 
579 
580 
RooCacheManager::setObj
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
Definition: RooCacheManager.h:50
RooProduct::CacheElem::_ownedList
RooArgList _ownedList
Definition: RooProduct.h:72
fit1_py.fill
fill
Definition: fit1_py.py:6
first
Definition: first.py:1
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
RooAbsReal.h
RooBatchCompute::RunContext::makeBatch
RooSpan< double > makeBatch(const RooAbsReal *owner, std::size_t size)
Create a writable batch.
Definition: RunContext.cxx:87
RooMsgService.h
ccoutD
#define ccoutD(a)
Definition: RooMsgService.h:37
RooAbsCollection::first
RooAbsArg * first() const
Definition: RooAbsCollection.h:236
RooAbsReal::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
Definition: RooAbsReal.cxx:3824
RooProduct::CacheElem::~CacheElem
virtual ~CacheElem()
Destructor.
Definition: RooProduct.cxx:485
RooNameReg::ptr
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:93
RooAbsCategory::getCurrentIndex
virtual value_type getCurrentIndex() const
Return index number of current state.
Definition: RooAbsCategory.cxx:114
RooFit::InputArguments
@ InputArguments
Definition: RooGlobalFunc.h:61
RooAbsArg::Always
@ Always
Definition: RooAbsArg.h:389
RooAbsArg::getParameters
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:578
RooCacheManager::getObj
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
Definition: RooCacheManager.h:45
TString::Data
const char * Data() const
Definition: TString.h:369
RooAbsReal::createIntegral
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:548
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
RooProduct::ProdMap
Definition: RooProduct.cxx:43
RooAbsCollection::fwdIterator
RooFIter fwdIterator() const
One-time forward iterator.
Definition: RooAbsCollection.h:193
coutE
#define coutE(a)
Definition: RooMsgService.h:33
RooAbsReal::binBoundaries
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
Definition: RooAbsReal.cxx:3813
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooProduct::_cacheMgr
RooObjCacheManager _cacheMgr
Definition: RooProduct.h:75
RooProduct::CacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Return list of all RooAbsArgs in cache element.
Definition: RooProduct.cxx:493
RooProduct::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Calculate integral internally from appropriate partial integral cache.
Definition: RooProduct.cxx:310
RooProduct::calculate
Double_t calculate(const RooArgList &partIntList) const
Calculate and return product of partial terms in partIntList.
Definition: RooProduct.cxx:331
x
Double_t x[n]
Definition: legend1.C:17
RooAbsReal::_forceNumInt
Bool_t _forceNumInt
Definition: RooAbsReal.h:480
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooProduct::evaluateSpan
RooSpan< double > evaluateSpan(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet) const
Evaluate product of input functions for all points found in evalData.
Definition: RooProduct.cxx:389
RooProduct::getAnalyticalIntegralWN
virtual Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &analVars, const RooArgSet *normSet, const char *rangeName=0) const
Declare that we handle all integrations internally.
Definition: RooProduct.cxx:291
RooCacheManager::selectFromSet2
RooArgSet selectFromSet2(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 2.
Definition: RooCacheManager.h:333
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
TString
Basic string class.
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
RooProduct::_compRSet
RooListProxy _compRSet
Definition: RooProduct.h:64
bool
RooProduct::printMetaArgs
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooProduct to more intuitively reflect the contents of the prod...
Definition: RooProduct.cxx:526
RooSpan::size
constexpr std::span< T >::index_type size() const noexcept
Definition: RooSpan.h:121
RooProduct::addTerm
void addTerm(RooAbsArg *term)
Add a term to this product.
Definition: RooProduct.cxx:106
RooAbsCategory
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
Definition: RooAbsCategory.h:37
RooTrace.h
RooProduct
A RooProduct represents the product of a given set of RooAbsReal objects.
Definition: RooProduct.h:29
RooSpan::end
constexpr std::span< T >::iterator end() const
Definition: RooSpan.h:102
RooCacheManager::getObjByIndex
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
Definition: RooCacheManager.h:310
RooProduct::components
RooArgList components()
Definition: RooProduct.h:47
TRACE_DESTROY
#define TRACE_DESTROY
Definition: RooTrace.h:24
RooProduct::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs
Definition: RooProduct.cxx:466
RooProduct::setCacheAndTrackHints
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK'ed components of a RooProduct with cache-and-track.
Definition: RooProduct.cxx:505
Double_t
RooSpan::empty
constexpr bool empty() const noexcept
Definition: RooSpan.h:125
RooProduct::binBoundaries
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Forward the plot sampling hint from the p.d.f. that defines the observable obs
Definition: RooProduct.cxx:430
RooFIter
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
Definition: RooLinkedListIter.h:40
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
RooProduct::getPartIntList
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:218
RooProduct::CacheElem
Definition: RooProduct.h:67
RooFIter::next
RooAbsArg * next()
Return next element or nullptr if at end.
Definition: RooLinkedListIter.h:49
RooProduct::makeFPName
const char * makeFPName(const char *pfx, const RooArgSet &terms) const
Construct automatic name for internal product terms.
Definition: RooProduct.cxx:346
RooAbsArg::RooArgSet
friend class RooArgSet
Definition: RooAbsArg.h:599
TRACE_CREATE
#define TRACE_CREATE
Definition: RooTrace.h:23
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:455
RooAbsProxy::nset
const RooArgSet * nset() const
Definition: RooAbsProxy.h:45
RooProduct::groupProductTerms
ProdMap * groupProductTerms(const RooArgSet &) const
Group observables into subsets in which the product factorizes and that can thus be integrated separa...
Definition: RooProduct.cxx:142
RooSpan::begin
constexpr std::span< T >::iterator begin() const
Definition: RooSpan.h:98
RooProduct.h
RooAbsCollection::addOwned
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:403
RooProduct::CacheElem::_prodList
RooArgList _prodList
Definition: RooProduct.h:71
RooAbsCategory.h
RooProduct::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &dep) const
Force internal handling of integration of given observable if any of the product terms depend on it.
Definition: RooProduct.cxx:122
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
name
char name[80]
Definition: TGX11.cxx:110
RooAbsArg::dependsOn
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.
Definition: RooAbsArg.cxx:799
RunContext.h
RooCacheManager::lastIndex
Int_t lastIndex() const
Definition: RooCacheManager.h:66
dologD
#define dologD(a)
Definition: RooMsgService.h:65
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooAbsReal::getValues
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this trans...
Definition: RooAbsReal.cxx:312
RooListProxy::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
Definition: RooListProxy.cxx:104
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
RooProduct::evaluate
Double_t evaluate() const
Evaluate product of input functions.
Definition: RooProduct.cxx:366
RooFit::Integration
@ Integration
Definition: RooGlobalFunc.h:60
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooProduct::isBinnedDistribution
virtual Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooProduct.cxx:446
RooNameReg.h
RooBatchCompute::RunContext
This struct enables passing computation data around between elements of a computation graph.
Definition: RunContext.h:31
RooProduct::RooProduct
RooProduct()
Default constructor.
Definition: RooProduct.cxx:57
RooAbsCollection::getSize
Int_t getSize() const
Definition: RooAbsCollection.h:231
RooSpan
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:33
RooProduct::_compCSet
RooListProxy _compCSet
Definition: RooProduct.h:65
cxcoutD
#define cxcoutD(a)
Definition: RooMsgService.h:81
RooProduct::~RooProduct
virtual ~RooProduct()
Destructor.
Definition: RooProduct.cxx:67
int