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