Logo ROOT   6.14/05
Reference Guide
RooRealSumPdf.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooRealSumPdf.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_PDF
17 #define ROO_REAL_SUM_PDF
18 
19 #include "RooAbsPdf.h"
20 #include "RooListProxy.h"
21 #include "RooAICRegistry.h"
22 #include "RooObjCacheManager.h"
23 
24 class RooRealSumPdf : public RooAbsPdf {
25 public:
26 
27  RooRealSumPdf() ;
28  RooRealSumPdf(const char *name, const char *title);
29  RooRealSumPdf(const char *name, const char *title, const RooArgList& funcList, const RooArgList& coefList, Bool_t extended=kFALSE) ;
30  RooRealSumPdf(const char *name, const char *title,
31  RooAbsReal& func1, RooAbsReal& func2, RooAbsReal& coef1) ;
32  RooRealSumPdf(const RooRealSumPdf& other, const char* name=0) ;
33  virtual TObject* clone(const char* newname) const { return new RooRealSumPdf(*this,newname) ; }
34  virtual ~RooRealSumPdf() ;
35 
36  Double_t evaluate() const ;
37  virtual Bool_t checkObservables(const RooArgSet* nset) const ;
38 
39  virtual Bool_t forceAnalyticalInt(const RooAbsArg& arg) const { return arg.isFundamental() ; }
40  Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, const RooArgSet* normSet, 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  virtual ExtendMode extendMode() const ;
47 
48  virtual Double_t expectedEvents(const RooArgSet* nset) const ;
49  virtual Double_t expectedEvents(const RooArgSet& nset) const {
50  // Return expected number of events for extended likelihood calculation
51  // which is the sum of all coefficients
52  return expectedEvents(&nset) ;
53  }
54 
55  virtual Bool_t selfNormalized() const { return getAttribute("BinnedLikelihoodActive") ; }
56 
57  void printMetaArgs(std::ostream& os) const ;
58 
59 
60  virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
61  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
62  Bool_t isBinnedDistribution(const RooArgSet& obs) const ;
63 
64  void setFloor(Bool_t flag) { _doFloor = flag ; }
65  Bool_t getFloor() const { return _doFloor ; }
66  static void setFloorGlobal(Bool_t flag) { _doFloorGlobal = flag ; }
67  static Bool_t getFloorGlobal() { return _doFloorGlobal ; }
68 
69  virtual CacheMode canNodeBeCached() const { return RooAbsArg::NotAdvised ; } ;
70  virtual void setCacheAndTrackHints(RooArgSet&) ;
71 
72 protected:
73 
74  class CacheElem : public RooAbsCacheElement {
75  public:
76  CacheElem() {} ;
77  virtual ~CacheElem() {} ;
78  virtual RooArgList containedArgs(Action) { RooArgList ret(_funcIntList) ; ret.add(_funcNormList) ; return ret ; }
81  } ;
82  mutable RooObjCacheManager _normIntMgr ; // The integration cache manager
83 
84 
86 
87  RooListProxy _funcList ; // List of component FUNCs
88  RooListProxy _coefList ; // List of coefficients
89  TIterator* _funcIter ; //! Iterator over FUNC list
90  TIterator* _coefIter ; //! Iterator over coefficient list
91  Bool_t _extended ; // Allow use as extended p.d.f.
92 
93  Bool_t _doFloor ; // Introduce floor at zero in pdf
94  static Bool_t _doFloorGlobal ; // Global flag for introducing floor at zero in pdf
95 
96 private:
97 
98  ClassDef(RooRealSumPdf,3) // PDF constructed from a sum of (non-pdf) functions
99 };
100 
101 #endif
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Double_t expectedEvents(const RooArgSet &nset) const
Definition: RooRealSumPdf.h:49
Bool_t getFloor() const
Definition: RooRealSumPdf.h:65
virtual ExtendMode extendMode() const
virtual TObject * clone(const char *newname) const
Definition: RooRealSumPdf.h:33
int Int_t
Definition: RtypesCore.h:41
static Bool_t _doFloorGlobal
Definition: RooRealSumPdf.h:94
bool Bool_t
Definition: RtypesCore.h:59
TIterator * _coefIter
Iterator over FUNC list.
Definition: RooRealSumPdf.h:90
const RooArgList & funcList() const
Definition: RooRealSumPdf.h:43
Class RooRealSumPdf implements a PDF constructed from a sum of functions:
Definition: RooRealSumPdf.h:24
static void setFloorGlobal(Bool_t flag)
Definition: RooRealSumPdf.h:66
RooObjCacheManager _normIntMgr
Definition: RooRealSumPdf.h:82
Iterator abstract base class.
Definition: TIterator.h:30
void printMetaArgs(std::ostream &os) const
Customized printing of arguments of a RooRealSumPdf to more intuitively reflect the contents of the p...
virtual RooArgList containedArgs(Action)
Definition: RooRealSumPdf.h:78
virtual Double_t expectedEvents(const RooArgSet *nset) const
Return expected number of events from this p.d.f for use in extended likelihood calculations.
#define ClassDef(name, id)
Definition: Rtypes.h:320
virtual void setCacheAndTrackHints(RooArgSet &)
Label OK&#39;ed components of a RooRealSumPdf with cache-and-track.
Bool_t _extended
Iterator over coefficient list.
Definition: RooRealSumPdf.h:91
virtual Bool_t isFundamental() const
Definition: RooAbsArg.h:157
TIterator * _funcIter
Definition: RooRealSumPdf.h:89
Bool_t getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
Definition: RooAbsArg.cxx:263
virtual CacheMode canNodeBeCached() const
Definition: RooRealSumPdf.h:69
RooListProxy _coefList
Definition: RooRealSumPdf.h:88
RooListProxy _funcList
Definition: RooRealSumPdf.h:87
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
virtual Bool_t forceAnalyticalInt(const RooAbsArg &arg) const
Definition: RooRealSumPdf.h:39
RooAbsCacheElement is the abstract base class for objects to be stored in RooAbsCache cache manager o...
Double_t analyticalIntegralWN(Int_t code, const RooArgSet *normSet, const char *rangeName=0) const
cout << "RooRealSumPdf::analyticalIntegralWN:"<<GetName()<<"("<<code<<","<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>") << endl; Implement analytical integrations by deferring integration of component functions to integrators of components
Bool_t isBinnedDistribution(const RooArgSet &obs) const
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:25
const Bool_t kFALSE
Definition: RtypesCore.h:88
const RooArgList & coefList() const
Definition: RooRealSumPdf.h:44
RooRealSumPdf()
Default constructor coverity[UNINIT_CTOR].
double Double_t
Definition: RtypesCore.h:55
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:53
virtual Bool_t selfNormalized() const
Definition: RooRealSumPdf.h:55
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Class RooObjCacheManager is an implementation of class RooCacheManager<RooAbsCacheElement> and specia...
Int_t getAnalyticalIntegralWN(RooArgSet &allVars, RooArgSet &numVars, const RooArgSet *normSet, const char *rangeName=0) const
cout << "RooRealSumPdf::getAnalyticalIntegralWN:"<<GetName()<<"("<<allVars<<",analVars,"<<(normSet2?*normSet2:RooArgSet())<<","<<(rangeName?rangeName:"<none>") << endl; Advertise that all integrals can be handled internally.
Mother of all ROOT objects.
Definition: TObject.h:37
virtual ~RooRealSumPdf()
Destructor.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Definition: RooAbsPdf.h:41
Bool_t _haveLastCoef
Definition: RooRealSumPdf.h:85
void setFloor(Bool_t flag)
Definition: RooRealSumPdf.h:64
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
static Bool_t getFloorGlobal()
Definition: RooRealSumPdf.h:67
char name[80]
Definition: TGX11.cxx:109
virtual Bool_t checkObservables(const RooArgSet *nset) const
Check if FUNC is valid for given normalization set.
Double_t evaluate() const
Calculate the current value.