Logo ROOT  
Reference Guide
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//_____________________________________________________________________________
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 = (RooAbsReal *)funcIter->Next();
153 if (func) {
154 if (!dynamic_cast<RooAbsReal *>(func)) {
155 coutE(InputArguments) << "RooRealSumFunc::RooRealSumFunc(" << GetName() << ") last func " << coef->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//_____________________________________________________________________________
248{
249 // Check if FUNC is valid for given normalization set.
250 // Coeffient and FUNC must be non-overlapping, but func-coefficient
251 // pairs may overlap each other
252 //
253 // In the present implementation, coefficients may not be observables or derive
254 // from observables
255
256 Bool_t ret(kFALSE);
257
258 _funcIter->Reset();
259 _coefIter->Reset();
260 RooAbsReal *coef;
261 RooAbsReal *func;
262 while ((coef = (RooAbsReal *)_coefIter->Next())) {
263 func = (RooAbsReal *)_funcIter->Next();
264 if (func->observableOverlaps(nset, *coef)) {
265 coutE(InputArguments) << "RooRealSumFunc::checkObservables(" << GetName() << "): ERROR: coefficient "
266 << coef->GetName() << " and FUNC " << func->GetName()
267 << " have one or more observables in common" << endl;
268 ret = kTRUE;
269 }
270 if (coef->dependsOn(*nset)) {
271 coutE(InputArguments) << "RooRealPdf::checkObservables(" << GetName() << "): ERROR coefficient "
272 << coef->GetName() << " depends on one or more of the following observables";
273 nset->Print("1");
274 ret = kTRUE;
275 }
276 }
277
278 return ret;
279}
280
281//_____________________________________________________________________________
283 const char *rangeName) const
284{
285 // cout <<
286 // "RooRealSumFunc::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<",analVars,"<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
287 // << endl;
288 // Advertise that all integrals can be handled internally.
289
290 // Handle trivial no-integration scenario
291 if (allVars.getSize() == 0)
292 return 0;
293 if (_forceNumInt)
294 return 0;
295
296 // Select subset of allVars that are actual dependents
297 analVars.add(allVars);
298 RooArgSet *normSet = normSet2 ? getObservables(normSet2) : 0;
299
300 // Check if this configuration was created before
301 Int_t sterileIdx(-1);
302 CacheElem *cache = (CacheElem *)_normIntMgr.getObj(normSet, &analVars, &sterileIdx, RooNameReg::ptr(rangeName));
303 if (cache) {
304 // cout <<
305 // "RooRealSumFunc("<<this<<")::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<","<<analVars<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
306 // << " -> " << _normIntMgr.lastIndex()+1 << " (cached)" << endl;
307 return _normIntMgr.lastIndex() + 1;
308 }
309
310 // Create new cache element
311 cache = new CacheElem;
312
313 // Make list of function projection and normalization integrals
314 _funcIter->Reset();
315 RooAbsReal *func;
316 while ((func = (RooAbsReal *)_funcIter->Next())) {
317 RooAbsReal *funcInt = func->createIntegral(analVars, rangeName);
318 if(funcInt->InheritsFrom(RooRealIntegral::Class())) ((RooRealIntegral*)funcInt)->setAllowComponentSelection(true);
319 cache->_funcIntList.addOwned(*funcInt);
320 if (normSet && normSet->getSize() > 0) {
321 RooAbsReal *funcNorm = func->createIntegral(*normSet);
322 cache->_funcNormList.addOwned(*funcNorm);
323 }
324 }
325
326 // Store cache element
327 Int_t code = _normIntMgr.setObj(normSet, &analVars, (RooAbsCacheElement *)cache, RooNameReg::ptr(rangeName));
328
329 if (normSet) {
330 delete normSet;
331 }
332
333 // cout <<
334 // "RooRealSumFunc("<<this<<")::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<","<<analVars<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
335 // << " -> " << code+1 << endl;
336 return code + 1;
337}
338
339//_____________________________________________________________________________
340Double_t RooRealSumFunc::analyticalIntegralWN(Int_t code, const RooArgSet *normSet2, const char *rangeName) const
341{
342 // cout <<
343 // "RooRealSumFunc::analyticalIntegralWN:"<<GetName()<<"("<<code<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
344 // << endl;
345 // Implement analytical integrations by deferring integration of component
346 // functions to integrators of components
347
348 // Handle trivial passthrough scenario
349 if (code == 0)
350 return getVal(normSet2);
351
352 // WVE needs adaptation for rangeName feature
353 CacheElem *cache = (CacheElem *)_normIntMgr.getObjByIndex(code - 1);
354 if (cache == 0) { // revive the (sterilized) cache
355 // cout <<
356 // "RooRealSumFunc("<<this<<")::analyticalIntegralWN:"<<GetName()<<"("<<code<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>")
357 // << ": reviving cache "<< endl;
358 std::unique_ptr<RooArgSet> vars(getParameters(RooArgSet()));
359 std::unique_ptr<RooArgSet> iset(_normIntMgr.nameSet2ByIndex(code - 1)->select(*vars));
360 std::unique_ptr<RooArgSet> nset(_normIntMgr.nameSet1ByIndex(code - 1)->select(*vars));
362 Int_t code2 = getAnalyticalIntegralWN(*iset, dummy, nset.get(), rangeName);
363 assert(code == code2); // must have revived the right (sterilized) slot...
364 (void)code2;
365 cache = (CacheElem *)_normIntMgr.getObjByIndex(code - 1);
366 assert(cache != 0);
367 }
368
369 RooFIter funcIntIter = cache->_funcIntList.fwdIterator();
370 RooFIter coefIter = _coefList.fwdIterator();
371 RooFIter funcIter = _funcList.fwdIterator();
372 RooAbsReal *coef(0), *funcInt(0), *func(0);
373 Double_t value(0);
374
375 // N funcs, N-1 coefficients
376 Double_t lastCoef(1);
377 while ((coef = (RooAbsReal *)coefIter.next())) {
378 funcInt = (RooAbsReal *)funcIntIter.next();
379 func = (RooAbsReal *)funcIter.next();
380 Double_t coefVal = coef->getVal(normSet2);
381 if (coefVal) {
382 assert(func);
383 if (normSet2 == 0 || func->isSelectedComp()) {
384 assert(funcInt);
385 value += funcInt->getVal() * coefVal;
386 }
387 lastCoef -= coef->getVal(normSet2);
388 }
389 }
390
391 if (!_haveLastCoef) {
392 // Add last func with correct coefficient
393 funcInt = (RooAbsReal *)funcIntIter.next();
394 if (normSet2 == 0 || func->isSelectedComp()) {
395 assert(funcInt);
396 value += funcInt->getVal() * lastCoef;
397 }
398
399 // Warn about coefficient degeneration
400 if (lastCoef < 0 || lastCoef > 1) {
401 coutW(Eval) << "RooRealSumFunc::evaluate(" << GetName()
402 << " WARNING: sum of FUNC coefficients not in range [0-1], value=" << 1 - lastCoef << endl;
403 }
404 }
405
406 Double_t normVal(1);
407 if (normSet2 && normSet2->getSize() > 0) {
408 normVal = 0;
409
410 // N funcs, N-1 coefficients
411 RooAbsReal *funcNorm;
412 RooFIter funcNormIter = cache->_funcNormList.fwdIterator();
413 RooFIter coefIter2 = _coefList.fwdIterator();
414 while ((coef = (RooAbsReal *)coefIter2.next())) {
415 funcNorm = (RooAbsReal *)funcNormIter.next();
416 Double_t coefVal = coef->getVal(normSet2);
417 if (coefVal) {
418 assert(funcNorm);
419 normVal += funcNorm->getVal() * coefVal;
420 }
421 }
422
423 // Add last func with correct coefficient
424 if (!_haveLastCoef) {
425 funcNorm = (RooAbsReal *)funcNormIter.next();
426 assert(funcNorm);
427 normVal += funcNorm->getVal() * lastCoef;
428 }
429 }
430
431 return value / normVal;
432}
433
434//_____________________________________________________________________________
435std::list<Double_t> *RooRealSumFunc::binBoundaries(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
436{
437 list<Double_t> *sumBinB = 0;
438 Bool_t needClean(kFALSE);
439
441 RooAbsReal *func;
442 // Loop over components pdf
443 while ((func = (RooAbsReal *)iter.next())) {
444
445 list<Double_t> *funcBinB = func->binBoundaries(obs, xlo, xhi);
446
447 // Process hint
448 if (funcBinB) {
449 if (!sumBinB) {
450 // If this is the first hint, then just save it
451 sumBinB = funcBinB;
452 } else {
453
454 list<Double_t> *newSumBinB = new list<Double_t>(sumBinB->size() + funcBinB->size());
455
456 // Merge hints into temporary array
457 merge(funcBinB->begin(), funcBinB->end(), sumBinB->begin(), sumBinB->end(), newSumBinB->begin());
458
459 // Copy merged array without duplicates to new sumBinBArrau
460 delete sumBinB;
461 delete funcBinB;
462 sumBinB = newSumBinB;
463 needClean = kTRUE;
464 }
465 }
466 }
467
468 // Remove consecutive duplicates
469 if (needClean) {
470 list<Double_t>::iterator new_end = unique(sumBinB->begin(), sumBinB->end());
471 sumBinB->erase(new_end, sumBinB->end());
472 }
473
474 return sumBinB;
475}
476
477//_____________________________________________________________________________B
479{
480 // If all components that depend on obs are binned that so is the product
481
483 RooAbsReal *func;
484 while ((func = (RooAbsReal *)iter.next())) {
485 if (func->dependsOn(obs) && !func->isBinnedDistribution(obs)) {
486 return kFALSE;
487 }
488 }
489
490 return kTRUE;
491}
492
493//_____________________________________________________________________________
494std::list<Double_t> *RooRealSumFunc::plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
495{
496 list<Double_t> *sumHint = 0;
497 Bool_t needClean(kFALSE);
498
500 RooAbsReal *func;
501 // Loop over components pdf
502 while ((func = (RooAbsReal *)iter.next())) {
503
504 list<Double_t> *funcHint = func->plotSamplingHint(obs, xlo, xhi);
505
506 // Process hint
507 if (funcHint) {
508 if (!sumHint) {
509
510 // If this is the first hint, then just save it
511 sumHint = funcHint;
512
513 } else {
514
515 list<Double_t> *newSumHint = new list<Double_t>(sumHint->size() + funcHint->size());
516
517 // Merge hints into temporary array
518 merge(funcHint->begin(), funcHint->end(), sumHint->begin(), sumHint->end(), newSumHint->begin());
519
520 // Copy merged array without duplicates to new sumHintArrau
521 delete sumHint;
522 sumHint = newSumHint;
523 needClean = kTRUE;
524 }
525 }
526 }
527
528 // Remove consecutive duplicates
529 if (needClean) {
530 list<Double_t>::iterator new_end = unique(sumHint->begin(), sumHint->end());
531 sumHint->erase(new_end, sumHint->end());
532 }
533
534 return sumHint;
535}
536
537//_____________________________________________________________________________
539{
540 // Label OK'ed components of a RooRealSumFunc with cache-and-track
541 RooFIter siter = funcList().fwdIterator();
542 RooAbsArg *sarg;
543 while ((sarg = siter.next())) {
544 if (sarg->canNodeBeCached() == Always) {
545 trackNodes.add(*sarg);
546 // cout << "tracking node RealSumFunc component " << sarg->IsA()->GetName() << "::" << sarg->GetName() << endl
547 // ;
548 }
549 }
550}
551
552//_____________________________________________________________________________
553void RooRealSumFunc::printMetaArgs(ostream &os) const
554{
555 // Customized printing of arguments of a RooRealSumFuncy to more intuitively reflect the contents of the
556 // product operator construction
557
558 _funcIter->Reset();
559 _coefIter->Reset();
560
562
563 RooAbsArg *coef, *func;
564 if (_coefList.getSize() != 0) {
565 while ((coef = (RooAbsArg *)_coefIter->Next())) {
566 if (!first) {
567 os << " + ";
568 } else {
569 first = kFALSE;
570 }
571 func = (RooAbsArg *)_funcIter->Next();
572 os << coef->GetName() << " * " << func->GetName();
573 }
574 func = (RooAbsArg *)_funcIter->Next();
575 if (func) {
576 os << " + [%] * " << func->GetName();
577 }
578 } else {
579
580 while ((func = (RooAbsArg *)_funcIter->Next())) {
581 if (!first) {
582 os << " + ";
583 } else {
584 first = kFALSE;
585 }
586 os << func->GetName();
587 }
588 }
589
590 os << " ";
591}
void Class()
Definition: Class.C:29
static RooMathCoreReg dummy
#define cxcoutD(a)
Definition: RooMsgService.h:81
#define coutW(a)
Definition: RooMsgService.h:32
#define coutE(a)
Definition: RooMsgService.h:33
#define TRACE_DESTROY
Definition: RooTrace.h:23
#define TRACE_CREATE
Definition: RooTrace.h:22
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
char name[80]
Definition: TGX11.cxx:109
typedef void((*Func_t)())
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Return the observables of this pdf given a set of observables.
Definition: RooAbsArg.h:276
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:730
virtual CacheMode canNodeBeCached() const
Definition: RooAbsArg.h:392
friend class RooArgSet
Definition: RooAbsArg.h:572
RooArgSet * getParameters(const RooAbsData *data, Bool_t stripDisconnected=kTRUE) 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:544
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...
Definition: RooAbsArg.cxx:799
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Int_t getSize() const
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
RooFIter fwdIterator() const
One-time forward iterator.
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:60
Bool_t _forceNumInt
Definition: RooAbsReal.h:453
Bool_t isSelectedComp() const
If true, the current pdf is a selected component (for use in plotting)
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsReal.h:314
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsReal.h:313
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:90
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:560
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
Definition: RooAbsReal.h:312
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
T * getObj(const RooArgSet *nset, Int_t *sterileIndex=0, const TNamed *isetRangeName=0)
const RooNameSet * nameSet2ByIndex(Int_t index) const
Retrieve RooNameSet associated with slot at given index.
T * getObjByIndex(Int_t index) const
Retrieve payload object by slot index.
Int_t lastIndex() const
const RooNameSet * nameSet1ByIndex(Int_t index) const
Retrieve RooNameSet associated with slot at given index.
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)
Reimplementation of standard RooArgList::add()
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:93
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
Definition: RooNameSet.cxx:185
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
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Bool_t isBinnedDistribution(const RooArgSet &obs) const
static Bool_t _doFloorGlobal
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
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
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:443
@ InputArguments
Definition: RooGlobalFunc.h:68
Definition: first.py:1