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