Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRealSumFunc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooRealSumFunc.h,v 1.10 2007/05/11 09:11:30 verkerke Exp $
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#ifndef ROO_REAL_SUM_FUNC
17#define ROO_REAL_SUM_FUNC
18
19#include "RooAbsPdf.h"
20#include "RooListProxy.h"
21#include "RooAICRegistry.h"
22#include "RooObjCacheManager.h"
23
24#include <list>
25
26class RooRealSumFunc : public RooAbsReal {
27public:
29 RooRealSumFunc(const char *name, const char *title);
30 RooRealSumFunc(const char *name, const char *title, const RooArgList &funcList, const RooArgList &coefList);
31 RooRealSumFunc(const char *name, const char *title, RooAbsReal &func1, RooAbsReal &func2, RooAbsReal &coef1);
32 RooRealSumFunc(const RooRealSumFunc &other, const char *name = nullptr);
33 TObject *clone(const char *newname) const override { return new RooRealSumFunc(*this, newname); }
34 ~RooRealSumFunc() override;
35
36 double evaluate() const override;
37 bool checkObservables(const RooArgSet *nset) const override;
38
39 bool forceAnalyticalInt(const RooAbsArg &arg) const override { return arg.isFundamental(); }
40 Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet,
41 const char *rangeName = nullptr) const override;
42 double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName = nullptr) const override;
43
44 const RooArgList &funcList() const { return _funcList; }
45 const RooArgList &coefList() const { return _coefList; }
46
47 void printMetaArgs(std::ostream &os) const override;
48
49 std::list<double> *binBoundaries(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
50 std::list<double> *plotSamplingHint(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
51 bool isBinnedDistribution(const RooArgSet &obs) const override;
52
53 void setFloor(bool flag) { _doFloor = flag; }
54 bool getFloor() const { return _doFloor; }
55 static void setFloorGlobal(bool flag) { _doFloorGlobal = flag; }
56 static bool getFloorGlobal() { return _doFloorGlobal; }
57
58 CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised; };
59 void setCacheAndTrackHints(RooArgSet &) override;
60
61 std::unique_ptr<RooAbsArg> compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext & ctx) const override;
62
63protected:
64 mutable RooObjCacheManager _normIntMgr; //! The integration cache manager
65
67
68 RooListProxy _funcList; ///< List of component FUNCs
69 RooListProxy _coefList; ///< List of coefficients
70
71 bool _doFloor = false; ///< Introduce floor at zero in pdf
72 mutable bool _haveWarned{false}; ///<!
73 static bool _doFloorGlobal; ///< Global flag for introducing floor at zero in pdf
74
75private:
76 ClassDefOverride(RooRealSumFunc, 4) // PDF constructed from a sum of (non-pdf) functions
77};
78
79#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
char name[80]
Definition TGX11.cxx:110
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition RooAbsArg.h:192
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
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:24
Implementation of a RooCacheManager<RooAbsCacheElement> that specializes in the storage of cache elem...
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
Customized printing of arguments of a RooRealSumFunc to more intuitively reflect the contents of the ...
const RooArgList & coefList() const
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Variant of getAnalyticalIntegral that is also passed the normalization set that should be applied to ...
CacheMode canNodeBeCached() const override
double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=nullptr) const override
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
bool _doFloor
Introduce floor at zero in pdf.
bool getFloor() const
~RooRealSumFunc() override
void setFloor(bool flag)
const RooArgList & funcList() const
RooListProxy _funcList
List of component FUNCs.
RooObjCacheManager _normIntMgr
static bool _doFloorGlobal
Global flag for introducing floor at zero in pdf.
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
static bool getFloorGlobal()
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.
TObject * clone(const char *newname) const override
bool _haveLastCoef
The integration cache manager.
static void setFloorGlobal(bool flag)
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...
bool forceAnalyticalInt(const RooAbsArg &arg) const override
Mother of all ROOT objects.
Definition TObject.h:41