Logo ROOT  
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 #include <list>
25 
26 class RooRealVar;
27 class RooAbsReal;
28 class RooDataHist ;
29 
30 class RooHistFunc : public RooAbsReal {
31 public:
32  RooHistFunc() ;
33  RooHistFunc(const char *name, const char *title, const RooArgSet& vars, const RooDataHist& dhist, Int_t intOrder=0);
34  RooHistFunc(const char *name, const char *title, const RooArgList& funcObs, const RooArgList& histObs, const RooDataHist& dhist, Int_t intOrder=0);
35  RooHistFunc(const RooHistFunc& other, const char* name=0);
36  virtual TObject* clone(const char* newname) const { return new RooHistFunc(*this,newname); }
37  virtual ~RooHistFunc() ;
38 
39  /// Return RooDataHist that is represented.
41  return *_dataHist ;
42  }
43 
44  /// Return RooDataHist that is represented.
45  const RooDataHist& dataHist() const {
46  return *_dataHist ;
47  }
48 
49  /// Set histogram interpolation order.
51 
52  _intOrder = order ;
53  }
54 
55  /// Return histogram interpolation order.
57 
58  return _intOrder ;
59  }
60 
61  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;
62  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;
63 
64  /// Set use of special boundary conditions for c.d.f.s
65  void setCdfBoundaries(Bool_t flag) {
66  _cdfBoundaries = flag ;
67  }
68 
69  /// If true, special boundary conditions for c.d.f.s are used
71 
72  return _cdfBoundaries ;
73  }
74 
75  virtual Int_t getMaxVal(const RooArgSet& vars) const;
76  virtual Double_t maxVal(Int_t code) const;
77 
78  virtual std::list<Double_t>* binBoundaries(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
79  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const ;
80  virtual Bool_t isBinnedDistribution(const RooArgSet&) const { return _intOrder==0 ; }
81 
82 protected:
83 
85  Bool_t areIdentical(const RooDataHist& dh1, const RooDataHist& dh2) ;
86 
87  Double_t evaluate() const;
89  friend class RooAbsCachedReal ;
90  Double_t totVolume() const ;
91 
92  virtual void ioStreamerPass2() ;
93 
94  RooArgSet _histObsList ; // List of observables defining dimensions of histogram
95  RooSetProxy _depList ; // List of observables mapped onto histogram observables
96  RooDataHist* _dataHist ; // Unowned pointer to underlying histogram
97  mutable RooAICRegistry _codeReg ; //! Auxiliary class keeping tracking of analytical integration code
98  Int_t _intOrder ; // Interpolation order
99  Bool_t _cdfBoundaries ; // Use boundary conditions for CDFs.
100  mutable Double_t _totVolume ; //! Total volume of space (product of ranges of observables)
101  Bool_t _unitNorm ; //! Assume contents is unit normalized (for use as pdf cache)
102 
103  ClassDef(RooHistFunc,2) // Histogram based function
104 };
105 
106 #endif
RooHistFunc::_totVolume
Double_t _totVolume
Definition: RooHistFunc.h:100
RooHistFunc::areIdentical
Bool_t areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
Definition: RooHistFunc.cxx:567
RooHistFunc::setInterpolationOrder
void setInterpolationOrder(Int_t order)
Set histogram interpolation order.
Definition: RooHistFunc.h:50
RooHistFunc::getInterpolationOrder
Int_t getInterpolationOrder() const
Return histogram interpolation order.
Definition: RooHistFunc.h:56
RooAbsReal.h
RooAICRegistry
RooAICRegistry is a utility class for operator p.d.f classes that keeps track of analytical integrati...
Definition: RooAICRegistry.h:26
RooSetProxy
RooSetProxy is the concrete proxy for RooArgSet objects.
Definition: RooSetProxy.h:23
RooHistFunc::_intOrder
Int_t _intOrder
Auxiliary class keeping tracking of analytical integration code.
Definition: RooHistFunc.h:98
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooHistFunc::_unitNorm
Bool_t _unitNorm
Total volume of space (product of ranges of observables)
Definition: RooHistFunc.h:101
RooHistFunc::clone
virtual TObject * clone(const char *newname) const
Definition: RooHistFunc.h:36
RooHistFunc::totalVolume
Double_t totalVolume() const
RooHistFunc::getAnalyticalIntegral
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Determine integration scenario.
Definition: RooHistFunc.cxx:266
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooHistFunc::_dataHist
RooDataHist * _dataHist
Definition: RooHistFunc.h:96
RooSetProxy.h
bool
RooHistFunc::_histObsList
RooArgSet _histObsList
Definition: RooHistFunc.h:94
RooTrace.h
RooHistFunc::setCdfBoundaries
void setCdfBoundaries(Bool_t flag)
Set use of special boundary conditions for c.d.f.s.
Definition: RooHistFunc.h:65
RooHistFunc::dataHist
RooDataHist & dataHist()
Return RooDataHist that is represented.
Definition: RooHistFunc.h:40
RooDataHist
The RooDataHist is a container class to hold N-dimensional binned data.
Definition: RooDataHist.h:39
ws
void ws()
Definition: ws.C:66
RooAICRegistry.h
RooHistFunc::_cdfBoundaries
Bool_t _cdfBoundaries
Definition: RooHistFunc.h:99
RooHistFunc::RooHistFunc
RooHistFunc()
Default constructor.
Definition: RooHistFunc.cxx:50
RooRealProxy.h
RooHistFunc::maxVal
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
Definition: RooHistFunc.cxx:218
RooHistFunc::_codeReg
RooAICRegistry _codeReg
Definition: RooHistFunc.h:97
RooHistFunc::getMaxVal
virtual Int_t getMaxVal(const RooArgSet &vars) const
Only handle case of maximum in all variables.
Definition: RooHistFunc.cxx:205
RooHistFunc::_depList
RooSetProxy _depList
Definition: RooHistFunc.h:95
RooHistFunc
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
Definition: RooHistFunc.h:30
RooHistFunc::totVolume
Double_t totVolume() const
Return the total volume spanned by the observables of the RooDataHist.
Definition: RooHistFunc.cxx:235
RooHistFunc::plotSamplingHint
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...
Definition: RooHistFunc.cxx:360
RooHistFunc::~RooHistFunc
virtual ~RooHistFunc()
Definition: RooHistFunc.cxx:167
RooWorkspace
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
RooHistFunc::binBoundaries
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...
Definition: RooHistFunc.cxx:417
Double_t
double Double_t
Definition: RtypesCore.h:59
RooHistFunc::getCdfBoundaries
Bool_t getCdfBoundaries() const
If true, special boundary conditions for c.d.f.s are used.
Definition: RooHistFunc.h:70
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
RooHistFunc::evaluate
Double_t evaluate() const
Return the current value: The value of the bin enclosing the current coordinates of the dependents,...
Definition: RooHistFunc.cxx:180
RooHistFunc::importWorkspaceHook
Bool_t importWorkspaceHook(RooWorkspace &ws)
Check if our datahist is already in the workspace.
Definition: RooHistFunc.cxx:511
RooRealVar
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:37
RooHistFunc::isBinnedDistribution
virtual Bool_t isBinnedDistribution(const RooArgSet &) const
Tests if the distribution is binned. Unless overridden by derived classes, this always returns false.
Definition: RooHistFunc.h:80
RooHistFunc::ioStreamerPass2
virtual void ioStreamerPass2()
Schema evolution: if histObsList wasn't filled from persistence (v1) then fill it here.
Definition: RooHistFunc.cxx:603
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooHistFunc::dataHist
const RooDataHist & dataHist() const
Return RooDataHist that is represented.
Definition: RooHistFunc.h:45
RooAbsCachedReal
RooAbsCachedReal is the abstract base class for functions that need or want to cache their evaluate()...
Definition: RooAbsCachedReal.h:24
RooHistFunc::analyticalIntegral
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return integral identified by 'code'.
Definition: RooHistFunc.cxx:315
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
int