ROOT  6.06/09
Reference Guide
RooHistFunc.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id$
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_HIST_FUNC
17 #define ROO_HIST_FUNC
18 
19 #include "RooAbsReal.h"
20 #include "RooRealProxy.h"
21 #include "RooSetProxy.h"
22 #include "RooAICRegistry.h"
23 #include "RooTrace.h"
24 
25 class RooRealVar;
26 class RooAbsReal;
27 class RooDataHist ;
28 
29 class RooHistFunc : public RooAbsReal {
30 public:
31  RooHistFunc() ;
32  RooHistFunc(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
33  RooHistFunc(const char *name, const char *title, const RooArgList& funcObs, const RooArgList& histObs, const RooDataHist& dhist, Int_t intOrder=0);
34  RooHistFunc(const RooHistFunc& other, const char* name=0);
35  virtual TObject* clone(const char* newname) const { return new RooHistFunc(*this,newname); }
36  virtual ~RooHistFunc() ;
37 
39  // Return RooDataHist that is represented
40  return *_dataHist ;
41  }
42  const RooDataHist& dataHist() const {
43  // Return RooDataHist that is represented
44  return *_dataHist ;
45  }
46 
48  // Set histogram interpolation order
49  _intOrder = order ;
50  }
51 
53  // Return histogram interpolation order
54  return _intOrder ;
55  }
56 
57  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
58  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
59 
60  void setCdfBoundaries(Bool_t flag) {
61  // Set use of special boundary conditions for c.d.f.s
62  _cdfBoundaries = flag ;
63  }
64 
66  // If true, special boundary conditions for c.d.f.s are used
67  return _cdfBoundaries ;
68  }
69 
70  virtual Int_t getMaxVal(const RooArgSet& vars) const;
71  virtual Double_t maxVal(Int_t code) const;
72 
73  virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
74  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ;
75  virtual Bool_t isBinnedDistribution(const RooArgSet&) const { return _intOrder==0 ; }
76 
77 protected:
78 
80  Bool_t areIdentical(const RooDataHist& dh1, const RooDataHist& dh2) ;
81 
82  Double_t evaluate() const;
83  Double_t totalVolume() const ;
84  friend class RooAbsCachedReal ;
85  Double_t totVolume() const ;
86 
87  virtual void ioStreamerPass2() ;
88 
89  RooArgSet _histObsList ; // List of observables defining dimensions of histogram
90  RooSetProxy _depList ; // List of observables mapped onto histogram observables
93  RooDataHist* _dataHist ; // Unowned pointer to underlying histogram
94  mutable RooAICRegistry _codeReg ; //! Auxiliary class keeping tracking of analytical integration code
95  Int_t _intOrder ; // Interpolation order
96  Bool_t _cdfBoundaries ; // Use boundary conditions for CDFs.
97  mutable Double_t _totVolume ; //! Total volume of space (product of ranges of observables)
98  Bool_t _unitNorm ; //! Assume contents is unit normalized (for use as pdf cache)
99 
100  ClassDef(RooHistFunc,2) // Histogram based function
101 };
102 
103 #endif
Double_t _totVolume
Definition: RooHistFunc.h:97
virtual void ioStreamerPass2()
Schema evolution: if histObsList wasn't filled from persistence (v1) then fill it here...
virtual TObject * clone(const char *newname) const
Definition: RooHistFunc.h:35
void setInterpolationOrder(Int_t order)
Definition: RooHistFunc.h:47
TIterator * _pdfObsIter
Definition: RooHistFunc.h:92
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Determine integration scenario.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t _intOrder
Auxiliary class keeping tracking of analytical integration code.
Definition: RooHistFunc.h:95
Int_t getInterpolationOrder() const
Definition: RooHistFunc.h:52
Iterator abstract base class.
Definition: TIterator.h:32
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Return sampling hint for making curves of (projections) of this function as the recursive division st...
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return integral identified by 'code'.
#define ClassDef(name, id)
Definition: Rtypes.h:254
RooDataHist * _dataHist
Definition: RooHistFunc.h:93
Bool_t _unitNorm
Total volume of space (product of ranges of observables)
Definition: RooHistFunc.h:98
Bool_t _cdfBoundaries
Definition: RooHistFunc.h:96
RooHistFunc()
Default constructor.
Definition: RooHistFunc.cxx:48
Double_t totalVolume() const
RooAICRegistry _codeReg
Definition: RooHistFunc.h:94
const RooDataHist & dataHist() const
Definition: RooHistFunc.h:42
RooDataHist & dataHist()
Definition: RooHistFunc.h:38
RooSetProxy _depList
Definition: RooHistFunc.h:90
RooArgSet _histObsList
Definition: RooHistFunc.h:89
virtual Int_t getMaxVal(const RooArgSet &vars) const
Only handle case of maximum in all variables.
Double_t totVolume() const
Return the total volume spanned by the observables of the RooDataHist.
void setCdfBoundaries(Bool_t flag)
Definition: RooHistFunc.h:60
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Return sampling hint for making curves of (projections) of this function as the recursive division st...
virtual ~RooHistFunc()
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
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 isBinnedDistribution(const RooArgSet &) const
Definition: RooHistFunc.h:75
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
Bool_t areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
Bool_t importWorkspaceHook(RooWorkspace &ws)
Check if our datahist is already in the workspace.
TIterator * _histObsIter
Definition: RooHistFunc.h:91
Double_t evaluate() const
Return the current value: The value of the bin enclosing the current coordinates of the dependents...
Bool_t getCdfBoundaries() const
Definition: RooHistFunc.h:65