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 
25 class RooRealSumFunc : public RooAbsReal {
26 public:
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; }
55  static Bool_t getFloorGlobal() { return _doFloorGlobal; }
56 
57  virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised; };
58  virtual void setCacheAndTrackHints(RooArgSet &);
59 
60 protected:
61  class CacheElem : public RooAbsCacheElement {
62  public:
63  CacheElem(){};
64  virtual ~CacheElem(){};
66  {
68  ret.add(_funcNormList);
69  return ret;
70  }
73  };
74  mutable RooObjCacheManager _normIntMgr; // The integration cache manager
75 
77 
78  RooListProxy _funcList; // List of component FUNCs
79  RooListProxy _coefList; // List of coefficients
80  TIterator *_funcIter; //! Iterator over FUNC list
81  TIterator *_coefIter; //! Iterator over coefficient list
82 
83  Bool_t _doFloor; // Introduce floor at zero in pdf
84  static Bool_t _doFloorGlobal; // Global flag for introducing floor at zero in pdf
85 
86 private:
87  ClassDef(RooRealSumFunc, 3) // PDF constructed from a sum of (non-pdf) functions
88 };
89 
90 #endif
RooRealSumFunc::printMetaArgs
void printMetaArgs(std::ostream &os) const
Definition: RooRealSumFunc.cxx:553
RooRealSumFunc::_doFloor
Bool_t _doFloor
Iterator over coefficient list.
Definition: RooRealSumFunc.h:83
RooRealSumFunc::CacheElem::~CacheElem
virtual ~CacheElem()
Definition: RooRealSumFunc.h:64
RooRealSumFunc::_normIntMgr
RooObjCacheManager _normIntMgr
Definition: RooRealSumFunc.h:74
RooRealSumFunc::binBoundaries
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Retrieve bin boundaries if this distribution is binned in obs.
Definition: RooRealSumFunc.cxx:435
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooRealSumFunc::_doFloorGlobal
static Bool_t _doFloorGlobal
Definition: RooRealSumFunc.h:84
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooAbsArg::CacheMode
CacheMode
Definition: RooAbsArg.h:387
RooAbsCacheElement
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Definition: RooAbsCacheElement.h:26
RooRealSumFunc::CacheElem
Definition: RooRealSumFunc.h:61
bool
TIterator
Iterator abstract base class.
Definition: TIterator.h:30
RooRealSumFunc::setFloorGlobal
static void setFloorGlobal(Bool_t flag)
Definition: RooRealSumFunc.h:54
RooRealSumFunc::getFloorGlobal
static Bool_t getFloorGlobal()
Definition: RooRealSumFunc.h:55
RooRealSumFunc
Definition: RooRealSumFunc.h:25
RooRealSumFunc::~RooRealSumFunc
virtual ~RooRealSumFunc()
Definition: RooRealSumFunc.cxx:183
RooAICRegistry.h
RooAbsPdf.h
RooRealSumFunc::getFloor
Bool_t getFloor() const
Definition: RooRealSumFunc.h:53
RooRealSumFunc::isBinnedDistribution
Bool_t isBinnedDistribution(const RooArgSet &obs) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooRealSumFunc.cxx:478
RooRealSumFunc::_funcList
RooListProxy _funcList
Definition: RooRealSumFunc.h:78
RooRealSumFunc::_coefList
RooListProxy _coefList
Definition: RooRealSumFunc.h:79
RooRealSumFunc::checkObservables
virtual Bool_t checkObservables(const RooArgSet *nset) const
Overloadable function in which derived classes can implement consistency checks of the variables.
Definition: RooRealSumFunc.cxx:247
RooAbsCollection::add
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Definition: RooAbsCollection.cxx:437
RooRealSumFunc::canNodeBeCached
virtual CacheMode canNodeBeCached() const
Definition: RooRealSumFunc.h:57
RooRealSumFunc::forceAnalyticalInt
virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const
Definition: RooRealSumFunc.h:38
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooRealSumFunc::CacheElem::_funcNormList
RooArgList _funcNormList
Definition: RooRealSumFunc.h:72
RooObjCacheManager.h
RooAbsArg::isFundamental
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:243
RooRealSumFunc::clone
virtual TObject * clone(const char *newname) const
Definition: RooRealSumFunc.h:32
RooRealSumFunc::evaluate
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Definition: RooRealSumFunc.cxx:193
RooListProxy.h
RooRealSumFunc::CacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Definition: RooRealSumFunc.h:65
RooRealSumFunc::setCacheAndTrackHints
virtual void setCacheAndTrackHints(RooArgSet &)
Definition: RooRealSumFunc.cxx:538
Double_t
double Double_t
Definition: RtypesCore.h:59
RooRealSumFunc::RooRealSumFunc
RooRealSumFunc()
Definition: RooRealSumFunc.cxx:63
RooRealSumFunc::_haveLastCoef
Bool_t _haveLastCoef
Definition: RooRealSumFunc.h:76
RooObjCacheManager
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Definition: RooObjCacheManager.h:32
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
RooRealSumFunc::plotSamplingHint
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...
Definition: RooRealSumFunc.cxx:494
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooRealSumFunc::getAnalyticalIntegralWN
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 ...
Definition: RooRealSumFunc.cxx:282
RooAbsArg::NotAdvised
@ NotAdvised
Definition: RooAbsArg.h:387
name
char name[80]
Definition: TGX11.cxx:110
RooAbsArg
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition: RooAbsArg.h:72
RooRealSumFunc::_coefIter
TIterator * _coefIter
Iterator over FUNC list.
Definition: RooRealSumFunc.h:81
RooRealSumFunc::CacheElem::_funcIntList
RooArgList _funcIntList
Definition: RooRealSumFunc.h:71
RooRealSumFunc::CacheElem::CacheElem
CacheElem()
Definition: RooRealSumFunc.h:63
RooRealSumFunc::_funcIter
TIterator * _funcIter
Definition: RooRealSumFunc.h:80
RooRealSumFunc::funcList
const RooArgList & funcList() const
Definition: RooRealSumFunc.h:43
RooRealSumFunc::setFloor
void setFloor(Bool_t flag)
Definition: RooRealSumFunc.h:52
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooRealSumFunc::coefList
const RooArgList & coefList() const
Definition: RooRealSumFunc.h:44
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
int
RooRealSumFunc::analyticalIntegralWN
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
Definition: RooRealSumFunc.cxx:340