Logo ROOT  
Reference Guide
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#include <list>
24
25class RooRealSumFunc : public RooAbsReal {
26public:
28 RooRealSumFunc(const char *name, const char *title);
29 RooRealSumFunc(const char *name, const char *title, const RooArgList &funcList, const RooArgList &coefList);
30 RooRealSumFunc(const char *name, const char *title, RooAbsReal &func1, RooAbsReal &func2, RooAbsReal &coef1);
31 RooRealSumFunc(const RooRealSumFunc &other, const char *name = 0);
32 TObject *clone(const char *newname) const override { return new RooRealSumFunc(*this, newname); }
33 ~RooRealSumFunc() override;
34
35 double evaluate() const override;
36 bool checkObservables(const RooArgSet *nset) const override;
37
38 bool forceAnalyticalInt(const RooAbsArg &arg) const override { return arg.isFundamental(); }
39 Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet,
40 const char *rangeName = 0) const override;
41 double analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName = 0) const override;
42
43 const RooArgList &funcList() const { return _funcList; }
44 const RooArgList &coefList() const { return _coefList; }
45
46 void printMetaArgs(std::ostream &os) const override;
47
48 std::list<double> *binBoundaries(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
49 std::list<double> *plotSamplingHint(RooAbsRealLValue & /*obs*/, double /*xlo*/, double /*xhi*/) const override;
50 bool isBinnedDistribution(const RooArgSet &obs) const override;
51
52 void setFloor(bool flag) { _doFloor = flag; }
53 bool getFloor() const { return _doFloor; }
54 static void setFloorGlobal(bool flag) { _doFloorGlobal = flag; }
55 static bool getFloorGlobal() { return _doFloorGlobal; }
56
57 CacheMode canNodeBeCached() const override { return RooAbsArg::NotAdvised; };
58 void setCacheAndTrackHints(RooArgSet &) override;
59
60 void fillNormSetForServer(RooArgSet const& /*normSet*/, RooAbsArg const& /*server*/, RooArgSet& /*serverNormSet*/) const override {}
61
62protected:
64 public:
66 ~CacheElem() override{};
68 {
70 ret.add(_funcNormList);
71 return ret;
72 }
75 };
76 mutable RooObjCacheManager _normIntMgr; //! The integration cache manager
77
79
80 RooListProxy _funcList; ///< List of component FUNCs
81 RooListProxy _coefList; ///< List of coefficients
82 TIterator *_funcIter; ///<! Iterator over FUNC list
83 TIterator *_coefIter; ///<! Iterator over coefficient list
84
85 bool _doFloor; ///< Introduce floor at zero in pdf
86 static bool _doFloorGlobal; ///< Global flag for introducing floor at zero in pdf
87
88private:
89 ClassDefOverride(RooRealSumFunc, 4) // PDF constructed from a sum of (non-pdf) functions
90};
91
92#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
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:77
@ NotAdvised
Definition: RooAbsArg.h:412
virtual bool isFundamental() const
Is this object a fundamental type that can be added to a dataset? Fundamental-type subclasses overrid...
Definition: RooAbsArg.h:247
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
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
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
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
RooArgList containedArgs(Action) override
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
const RooArgList & coefList() const
TIterator * _funcIter
! Iterator over FUNC list
CacheMode canNodeBeCached() const override
bool _doFloor
Introduce floor at zero in pdf.
TIterator * _coefIter
! Iterator over coefficient list
bool getFloor() const
~RooRealSumFunc() override
void setFloor(bool flag)
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 ...
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
void fillNormSetForServer(RooArgSet const &, RooAbsArg const &, RooArgSet &) const override
Fills a RooArgSet to be used as the normalization set for a server, given a normalization set for thi...
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
Iterator abstract base class.
Definition: TIterator.h:30
Mother of all ROOT objects.
Definition: TObject.h:37