Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRealSumFunc.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 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, 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///
19/// Class RooRealSumFunc implements a PDF constructed from a sum of
20/// functions:
21/// ```
22/// Sum(i=1,n-1) coef_i * func_i(x) + [ 1 - (Sum(i=1,n-1) coef_i ] * func_n(x)
23/// pdf(x) = ------------------------------------------------------------------------------
24/// Sum(i=1,n-1) coef_i * Int(func_i)dx + [ 1 - (Sum(i=1,n-1) coef_i ] * Int(func_n)dx
25///
26/// ```
27/// where coef_i and func_i are RooAbsReal objects, and x is the collection of dependents.
28/// In the present version coef_i may not depend on x, but this limitation may be removed in the future
29///
30/// ### Difference between RooAddPdf / RooRealSum{Func|Pdf}
31/// - RooAddPdf is a PDF of PDFs, *i.e.* its components need to be normalised and non-negative.
32/// - RooRealSumPdf is a PDF of functions, *i.e.*, its components can be negative, but their sum cannot be. The normalisation
33/// is computed automatically, unless the PDF is extended (see above).
34/// - RooRealSumFunc is a sum of functions. It is neither normalised, nor need it be positive.
35
36#include "RooFit.h"
37#include "Riostream.h"
38
39#include "TIterator.h"
40#include "TList.h"
41#include "TClass.h"
42#include "RooRealSumFunc.h"
43#include "RooRealProxy.h"
44#include "RooPlot.h"
45#include "RooRealVar.h"
46#include "RooAddGenContext.h"
47#include "RooRealConstant.h"
48#include "RooRealIntegral.h"
49#include "RooMsgService.h"
50#include "RooNameReg.h"
51#include "RooTrace.h"
52
53#include <algorithm>
54#include <memory>
55
56using namespace std;
57
59
61
62//_____________________________________________________________________________
63RooRealSumFunc::RooRealSumFunc() : _normIntMgr(this, 10)
64{
65 // Default constructor
66 // coverity[UNINIT_CTOR]
71}
72
73//_____________________________________________________________________________
74RooRealSumFunc::RooRealSumFunc(const char *name, const char *title)
75 : RooAbsReal(name, title), _normIntMgr(this, 10), _haveLastCoef(kFALSE),
76 _funcList("!funcList", "List of functions", this), _coefList("!coefList", "List of coefficients", this),
77 _doFloor(kFALSE)
78{
79 // Constructor with name and title
83}
84
85//_____________________________________________________________________________
86RooRealSumFunc::RooRealSumFunc(const char *name, const char *title, RooAbsReal &func1, RooAbsReal &func2,
87 RooAbsReal &coef1)
88 : RooAbsReal(name, title), _normIntMgr(this, 10), _haveLastCoef(kFALSE),
89 _funcList("!funcList", "List of functions", this), _coefList("!coefList", "List of coefficients", this),
90 _doFloor(kFALSE)
91{
92 // Construct p.d.f consisting of coef1*func1 + (1-coef1)*func2
93 // The input coefficients and functions are allowed to be negative
94 // but the resulting sum is not, which is enforced at runtime
95
96 // Special constructor with two functions and one coefficient
99
100 _funcList.add(func1);
101 _funcList.add(func2);
102 _coefList.add(coef1);
104}
105
106//_____________________________________________________________________________
107RooRealSumFunc::RooRealSumFunc(const char *name, const char *title, const RooArgList &inFuncList,
108 const RooArgList &inCoefList)
109 : RooAbsReal(name, title), _normIntMgr(this, 10), _haveLastCoef(kFALSE),
110 _funcList("!funcList", "List of functions", this), _coefList("!coefList", "List of coefficients", this),
111 _doFloor(kFALSE)
112{
113 // Constructor p.d.f implementing sum_i [ coef_i * func_i ], if N_coef==N_func
114 // or sum_i [ coef_i * func_i ] + (1 - sum_i [ coef_i ] )* func_N if Ncoef==N_func-1
115 //
116 // All coefficients and functions are allowed to be negative
117 // but the sum is not, which is enforced at runtime.
118
119 if (!(inFuncList.getSize() == inCoefList.getSize() + 1 || inFuncList.getSize() == inCoefList.getSize())) {
120 coutE(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName()
121 << ") number of pdfs and coefficients inconsistent, must have Nfunc=Ncoef or Nfunc=Ncoef+1"
122 << endl;
123 assert(0);
124 }
125
128
129 // Constructor with N functions and N or N-1 coefs
130 TIterator *funcIter = inFuncList.createIterator();
131 TIterator *coefIter = inCoefList.createIterator();
132 RooAbsArg *func;
133 RooAbsArg *coef;
134
135 while ((coef = (RooAbsArg *)coefIter->Next())) {
136 func = (RooAbsArg *)funcIter->Next();
137
138 if (!dynamic_cast<RooAbsReal *>(coef)) {
139 coutW(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") coefficient " << coef->GetName()
140 << " is not of type RooAbsReal, ignored" << endl;
141 continue;
142 }
143 if (!dynamic_cast<RooAbsReal *>(func)) {
144 coutW(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") func " << func->GetName()
145 << " is not of type RooAbsReal, ignored" << endl;
146 continue;
147 }
148 _funcList.add(*func);
149 _coefList.add(*coef);
150 }
151
152 func = (RooAbsArg *)funcIter->Next();
153 if (func) {
154 if (!dynamic_cast<RooAbsReal *>(func)) {
155 coutE(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") last func " << func->GetName()
156 << " is not of type RooAbsReal, fatal error" << endl;
157 assert(0);
158 }
159 _funcList.add(*func);
160 } else {
162 }
163
164 delete funcIter;
165 delete coefIter;
167}
168
169//_____________________________________________________________________________
171 : RooAbsReal(other, name), _normIntMgr(other._normIntMgr, this), _haveLastCoef(other._haveLastCoef),
172 _funcList("!funcList", this, other._funcList), _coefList("!coefList", this, other._coefList),
173 _doFloor(other._doFloor)
174{
175 // Copy constructor
176
180}
181
182//_____________________________________________________________________________
184{
185 // Destructor
186 delete _funcIter;
187 delete _coefIter;
188
190}
191
192//_____________________________________________________________________________
194{
195 // Calculate the current value
196
197 Double_t value(0);
198
199 // Do running sum of coef/func pairs, calculate lastCoef.
200 RooFIter funcIter = _funcList.fwdIterator();
201 RooFIter coefIter = _coefList.fwdIterator();
202 RooAbsReal *coef;
203 RooAbsReal *func;
204
205 // N funcs, N-1 coefficients
206 Double_t lastCoef(1);
207 while ((coef = (RooAbsReal *)coefIter.next())) {
208 func = (RooAbsReal *)funcIter.next();
209 Double_t coefVal = coef->getVal();
210 if (coefVal) {
211 cxcoutD(Eval) << "RooRealSumFunc::eval(" << GetName() << ") coefVal = " << coefVal
212 << " funcVal = " << func->IsA()->GetName() << "::" << func->GetName() << " = " << func->getVal()
213 << endl;
214 if (func->isSelectedComp()) {
215 value += func->getVal() * coefVal;
216 }
217 lastCoef -= coef->getVal();
218 }
219 }
220
221 if (!_haveLastCoef) {
222 // Add last func with correct coefficient
223 func = (RooAbsReal *)funcIter.next();
224 if (func->isSelectedComp()) {
225 value += func->getVal() * lastCoef;
226 }
227
228 cxcoutD(Eval) << "RooRealSumFunc::eval(" << GetName() << ") lastCoef = " << lastCoef
229 << " funcVal = " << func->getVal() << endl;
230
231 // Warn about coefficient degeneration
232 if (lastCoef < 0 || lastCoef > 1) {
233 coutW(Eval) << "RooRealSumFunc::evaluate(" << GetName()
234 << " WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
235 }
236 }
237
238 // Introduce floor if so requested
239 if (value < 0 && (_doFloor || _doFloorGlobal)) {
240 value = 0;
241 }
242
243 return value;
244}
245
246
247//_____________________________________________________________________________
249{
250 // Check if FUNC is valid for given normalization set.
251 // Coeffient and FUNC must be non-overlapping, but func-coefficient
252 // pairs may overlap each other
253 //
254 // In the present implementation, coefficients may not be observables or derive
255 // from observables
256
257 Bool_t ret(kFALSE);
258
259 _funcIter->Reset();
260 _coefIter->Reset();
261 RooAbsReal *coef;
262 RooAbsReal *func;
263 while ((coef = (RooAbsReal *)_coefIter->Next())) {
264 func = (RooAbsReal *)_funcIter->Next();
265 if (func->observableOverlaps(nset, *coef)) {
266 coutE(InputArguments) << "RooRealSumFunc::checkObservables(" << GetName() << "): ERROR: coefficient "
267 << coef->GetName() << " and FUNC " << func->GetName()
268 << " have one or more observables in common" << endl;
269 ret = kTRUE;
270 }
271 if (coef->dependsOn(*nset)) {
272 coutE(InputArguments) << "RooRealPdf::checkObservables(" << GetName() << "): ERROR coefficient "
273 << coef->GetName() << " depends on one or more of the following observables";
274 nset->Print("1");
275 ret = kTRUE;
276 }
277 }
278
279 return ret;
280}
281
282//_____________________________________________________________________________
284 const char *rangeName) const
285{
286 // cout <<
287 // "RooRealSumFunc::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<",analVars,"<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
288 // << endl;
289 // Advertise that all integrals can be handled internally.
290
291 // Handle trivial no-integration scenario
292 if (allVars.getSize() == 0)
293 return 0;
294 if (_forceNumInt)
295 return 0;
296
297 // Select subset of allVars that are actual dependents
298 analVars.add(allVars);
299 RooArgSet *normSet = normSet2 ? getObservables(normSet2) : 0;
300
301 // Check if this configuration was created before
302 Int_t sterileIdx(-1);
303 CacheElem *cache = (CacheElem *)_normIntMgr.getObj(normSet, &analVars, &sterileIdx, RooNameReg::ptr(rangeName));
304 if (cache) {
305 // cout <<
306 // "RooRealSumFunc("<<this<<")::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<","<<analVars<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
307 // << " -> " << _normIntMgr.lastIndex()+1 << " (cached)" << endl;
308 return _normIntMgr.lastIndex() + 1;
309 }
310
311 // Create new cache element
312 cache = new CacheElem;
313
314 // Make list of function projection and normalization integrals
315 _funcIter->Reset();
316 RooAbsReal *func;
317 while ((func = (RooAbsReal *)_funcIter->Next())) {
318 RooAbsReal *funcInt = func->createIntegral(analVars, rangeName);
319 if(funcInt->InheritsFrom(RooRealIntegral::Class())) ((RooRealIntegral*)funcInt)->setAllowComponentSelection(true);
320 cache->_funcIntList.addOwned(*funcInt);
321 if (normSet && normSet->getSize() > 0) {
322 RooAbsReal *funcNorm = func->createIntegral(*normSet);
323 cache->_funcNormList.addOwned(*funcNorm);
324 }
325 }
326
327 // Store cache element
328 Int_t code = _normIntMgr.setObj(normSet, &analVars, (RooAbsCacheElement *)cache, RooNameReg::ptr(rangeName));
329
330 if (normSet) {
331 delete normSet;
332 }
333
334 // cout <<
335 // "RooRealSumFunc("<<this<<")::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<","<<analVars<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
336 // << " -> " << code+1 << endl;
337 return code + 1;
338}
339
340//_____________________________________________________________________________
341Double_t RooRealSumFunc::analyticalIntegralWN(Int_t code, const RooArgSet *normSet2, const char *rangeName) const
342{
343 // cout <<
344 // "RooRealSumFunc::analyticalIntegralWN:"<<GetName()<<"("<<code<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
345 // << endl;
346 // Implement analytical integrations by deferring integration of component
347 // functions to integrators of components
348
349 // Handle trivial passthrough scenario
350 if (code == 0)
351 return getVal(normSet2);
352
353 // WVE needs adaptation for rangeName feature
354 CacheElem *cache = (CacheElem *)_normIntMgr.getObjByIndex(code - 1);
355 if (cache == 0) { // revive the (sterilized) cache
356 // cout <<
357 // "RooRealSumFunc("<<this<<")::analyticalIntegralWN:"<<GetName()<<"("<<code<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
358 // << ": reviving cache "<< endl;
359 std::unique_ptr<RooArgSet> vars(getParameters(RooArgSet()));
360 RooArgSet iset = _normIntMgr.selectFromSet2(*vars, code - 1);
361 RooArgSet nset = _normIntMgr.selectFromSet1(*vars, code - 1);
362 RooArgSet dummy;
363 Int_t code2 = getAnalyticalIntegralWN(iset, dummy, &nset, rangeName);
364 assert(code == code2); // must have revived the right (sterilized) slot...
365 (void)code2;
366 cache = (CacheElem *)_normIntMgr.getObjByIndex(code - 1);
367 assert(cache != 0);
368 }
369
370 RooFIter funcIntIter = cache->_funcIntList.fwdIterator();
371 RooFIter coefIter = _coefList.fwdIterator();
372 RooFIter funcIter = _funcList.fwdIterator();
373 RooAbsReal *coef(0), *funcInt(0), *func(0);
374 Double_t value(0);
375
376 // N funcs, N-1 coefficients
377 Double_t lastCoef(1);
378 while ((coef = (RooAbsReal *)coefIter.next())) {
379 funcInt = (RooAbsReal *)funcIntIter.next();
380 func = (RooAbsReal *)funcIter.next();
381 Double_t coefVal = coef->getVal(normSet2);
382 if (coefVal) {
383 assert(func);
384 if (normSet2 == 0 || func->isSelectedComp()) {
385 assert(funcInt);
386 value += funcInt->getVal() * coefVal;
387 }
388 lastCoef -= coef->getVal(normSet2);
389 }
390 }
391
392 if (!_haveLastCoef) {
393 // Add last func with correct coefficient
394 funcInt = (RooAbsReal *)funcIntIter.next();
395 if (normSet2 == 0 || func->isSelectedComp()) {
396 assert(funcInt);
397 value += funcInt->getVal() * lastCoef;
398 }
399
400 // Warn about coefficient degeneration
401 if (lastCoef < 0 || lastCoef > 1) {
402 coutW(Eval) << "RooRealSumFunc::evaluate(" << GetName()
403 << " WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
404 }
405 }
406
407 Double_t normVal(1);
408 if (normSet2 && normSet2->getSize() > 0) {
409 normVal = 0;
410
411 // N funcs, N-1 coefficients
412 RooAbsReal *funcNorm;
413 RooFIter funcNormIter = cache->_funcNormList.fwdIterator();
414 RooFIter coefIter2 = _coefList.fwdIterator();
415 while ((coef = (RooAbsReal *)coefIter2.next())) {
416 funcNorm = (RooAbsReal *)funcNormIter.next();
417 Double_t coefVal = coef->getVal(normSet2);
418 if (coefVal) {
419 assert(funcNorm);
420 normVal += funcNorm->getVal() * coefVal;
421 }
422 }
423
424 // Add last func with correct coefficient
425 if (!_haveLastCoef) {
426 funcNorm = (RooAbsReal *)funcNormIter.next();
427 assert(funcNorm);
428 normVal += funcNorm->getVal() * lastCoef;
429 }
430 }
431
432 return value / normVal;
433}
434
435//_____________________________________________________________________________
436std::list<Double_t> *RooRealSumFunc::binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
437{
438 list<Double_t> *sumBinB = 0;
439 Bool_t needClean(kFALSE);
440
442 RooAbsReal *func;
443 // Loop over components pdf
444 while ((func = (RooAbsReal *)iter.next())) {
445
446 list<Double_t> *funcBinB = func->binBoundaries(obs, xlo, xhi);
447
448 // Process hint
449 if (funcBinB) {
450 if (!sumBinB) {
451 // If this is the first hint, then just save it
452 sumBinB = funcBinB;
453 } else {
454
455 list<Double_t> *newSumBinB = new list<Double_t>(sumBinB->size() + funcBinB->size());
456
457 // Merge hints into temporary array
458 merge(funcBinB->begin(), funcBinB->end(), sumBinB->begin(), sumBinB->end(), newSumBinB->begin());
459
460 // Copy merged array without duplicates to new sumBinBArrau
461 delete sumBinB;
462 delete funcBinB;
463 sumBinB = newSumBinB;
464 needClean = kTRUE;
465 }
466 }
467 }
468
469 // Remove consecutive duplicates
470 if (needClean) {
471 list<Double_t>::iterator new_end = unique(sumBinB->begin(), sumBinB->end());
472 sumBinB->erase(new_end, sumBinB->end());
473 }
474
475 return sumBinB;
476}
477
478//_____________________________________________________________________________B
480{
481 // If all components that depend on obs are binned that so is the product
482
484 RooAbsReal *func;
485 while ((func = (RooAbsReal *)iter.next())) {
486 if (func->dependsOn(obs) && !func->isBinnedDistribution(obs)) {
487 return kFALSE;
488 }
489 }
490
491 return kTRUE;
492}
493
494//_____________________________________________________________________________
495std::list<Double_t> *RooRealSumFunc::plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
496{
497 list<Double_t> *sumHint = 0;
498 Bool_t needClean(kFALSE);
499
501 RooAbsReal *func;
502 // Loop over components pdf
503 while ((func = (RooAbsReal *)iter.next())) {
504
505 list<Double_t> *funcHint = func->plotSamplingHint(obs, xlo, xhi);
506
507 // Process hint
508 if (funcHint) {
509 if (!sumHint) {
510
511 // If this is the first hint, then just save it
512 sumHint = funcHint;
513
514 } else {
515
516 list<Double_t> *newSumHint = new list<Double_t>(sumHint->size() + funcHint->size());
517
518 // Merge hints into temporary array
519 merge(funcHint->begin(), funcHint->end(), sumHint->begin(), sumHint->end(), newSumHint->begin());
520
521 // Copy merged array without duplicates to new sumHintArrau
522 delete sumHint;
523 sumHint = newSumHint;
524 needClean = kTRUE;
525 }
526 }
527 }
528
529 // Remove consecutive duplicates
530 if (needClean) {
531 list<Double_t>::iterator new_end = unique(sumHint->begin(), sumHint->end());
532 sumHint->erase(new_end, sumHint->end());
533 }
534
535 return sumHint;
536}
537
538//_____________________________________________________________________________
540{
541 // Label OK'ed components of a RooRealSumFunc with cache-and-track
542 RooFIter siter = funcList().fwdIterator();
543 RooAbsArg *sarg;
544 while ((sarg = siter.next())) {
545 if (sarg->canNodeBeCached() == Always) {
546 trackNodes.add(*sarg);
547 // cout << "tracking node RealSumFunc component " << sarg->IsA()->GetName() << "::" << sarg->GetName() << endl
548 // ;
549 }
550 }
551}
552
553//_____________________________________________________________________________
554void RooRealSumFunc::printMetaArgs(ostream &os) const
555{
556 // Customized printing of arguments of a RooRealSumFuncy to more intuitively reflect the contents of the
557 // product operator construction
558
559 _funcIter->Reset();
560 _coefIter->Reset();
561
563
564 RooAbsArg *coef, *func;
565 if (_coefList.getSize() != 0) {
566 while ((coef = (RooAbsArg *)_coefIter->Next())) {
567 if (!first) {
568 os << " + ";
569 } else {
570 first = kFALSE;
571 }
572 func = (RooAbsArg *)_funcIter->Next();
573 os << coef->GetName() << " * " << func->GetName();
574 }
575 func = (RooAbsArg *)_funcIter->Next();
576 if (func) {
577 os << " + [%] * " << func->GetName();
578 }
579 } else {
580
581 while ((func = (RooAbsArg *)_funcIter->Next())) {
582 if (!first) {
583 os << " + ";
584 } else {
585 first = kFALSE;
586 }
587 os << func->GetName();
588 }
589 }
590
591 os << " ";
592}
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
#define cxcoutD(a)
#define coutW(a)
#define coutE(a)
#define TRACE_DESTROY
Definition RooTrace.h:24
#define TRACE_CREATE
Definition RooTrace.h:23
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
#define ClassImp(name)
Definition Rtypes.h:364
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:69
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
Definition RooAbsArg.h:309
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 CacheMode canNodeBeCached() const
Definition RooAbsArg.h:427
friend class RooArgSet
Definition RooAbsArg.h:642
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...
Bool_t observableOverlaps(const RooAbsData *dset, const RooAbsArg &testArg) const
Test if any of the dependents of the arg tree (as determined by getObservables) overlaps with those o...
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Int_t getSize() const
RooFIter fwdIterator() const
One-time forward iterator.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add an argument and transfer the ownership to the collection.
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
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
Bool_t _forceNumInt
Definition RooAbsReal.h:487
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
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 std::list< Double_t > * binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Retrieve bin boundaries if this distribution is binned in obs.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:94
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...
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition RooAbsReal.h:345
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:35
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
RooArgSet selectFromSet1(RooArgSet const &argSet, int index) const
Create RooArgSet contatining the objects that are both in the cached set 1.
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
Int_t setObj(const RooArgSet *nset, T *obj, const TNamed *isetRangeName=0)
A one-time forward iterator working on RooLinkedList or RooAbsCollection.
RooAbsArg * next()
Return next element or nullptr if at end.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
RooRealIntegral performs hybrid numerical/analytical integrals of RooAbsReal objects.
TIterator * _funcIter
Bool_t _doFloor
Iterator over coefficient list.
TIterator * _coefIter
Iterator over FUNC list.
Bool_t _haveLastCoef
The integration cache manager.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
static Bool_t _doFloorGlobal
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
const RooArgList & funcList() const
RooListProxy _funcList
RooObjCacheManager _normIntMgr
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual ~RooRealSumFunc()
RooListProxy _coefList
virtual void setCacheAndTrackHints(RooArgSet &)
void printMetaArgs(std::ostream &os) const
Iterator abstract base class.
Definition TIterator.h:30
virtual void Reset()=0
virtual TObject * Next()=0
virtual const char * GetName() const
Returns name of object.
Definition TNamed.h:47
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:515
Definition first.py:1