Logo ROOT  
Reference Guide
RooNumRunningInt.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * *
4  * Copyright (c) 2000-2005, Regents of the University of California *
5  * and Stanford University. All rights reserved. *
6  * *
7  * Redistribution and use in source and binary forms, *
8  * with or without modification, are permitted according to the terms *
9  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
10  *****************************************************************************/
11 
12 #ifndef ROONUMRUNNINGINT
13 #define ROONUMRUNNINGINT
14 
15 #include "RooAbsCachedReal.h"
16 #include "RooRealProxy.h"
17 #include "RooAbsReal.h"
18 #include <string>
19 
21 public:
22  RooNumRunningInt(const char *name, const char *title, RooAbsReal& _func, RooRealVar& _x, const char* binningName="cache");
23  RooNumRunningInt(const RooNumRunningInt& other, const char* name=0) ;
24  virtual TObject* clone(const char* newname) const { return new RooNumRunningInt(*this,newname); }
25  virtual ~RooNumRunningInt() ;
26 
27 protected:
28 
29  class RICacheElem: public FuncCacheElem {
30  public:
31  RICacheElem(const RooNumRunningInt& ri, const RooArgSet* nset) ;
32  ~RICacheElem() ;
34  void calculate(Bool_t cdfmode) ;
35  void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins) ;
36  void addPoint(Int_t ix) ;
37 
39  Double_t* _ax ;
40  Double_t* _ay ;
41  RooRealVar* _xx ;
42 
43  } ;
44 
45  friend class RICacheElem ;
46  virtual const char* binningName() const { return _binningName.c_str() ; }
47  virtual FuncCacheElem* createCache(const RooArgSet* nset) const ;
48  virtual const char* inputBaseName() const ;
49  virtual RooArgSet* actualObservables(const RooArgSet& nset) const ;
50  virtual RooArgSet* actualParameters(const RooArgSet& nset) const ;
51  virtual void fillCacheObject(FuncCacheElem& cacheFunc) const ;
52  virtual Double_t evaluate() const ;
53 
54  virtual const char* payloadUniqueSuffix() const { return func.arg().aggregateCacheUniqueSuffix() ; }
55 
56  RooRealProxy func ; // Proxy to functions whose running integral is calculated
57  RooRealProxy x ; // Intergrated observable
58  std::string _binningName ; // Name of binning to be used for cache histogram
59 
60 private:
61 
62  ClassDef(RooNumRunningInt,1) // Numeric calculator for running integral of a given function
63 
64 };
65 
66 #endif
RooNumRunningInt::fillCacheObject
virtual void fillCacheObject(FuncCacheElem &cacheFunc) const
Fill the cache object by calling its calculate() method.
Definition: RooNumRunningInt.cxx:258
RooNumRunningInt::RICacheElem::calculate
void calculate(Bool_t cdfmode)
Calculate the numeric running integral and store the result in the cache histogram provided by RooAbs...
Definition: RooNumRunningInt.cxx:150
RooNumRunningInt::_binningName
std::string _binningName
Definition: RooNumRunningInt.h:67
RooNumRunningInt::~RooNumRunningInt
virtual ~RooNumRunningInt()
Destructor.
Definition: RooNumRunningInt.cxx:80
RooNumRunningInt::RICacheElem::addRange
void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins)
Fill all empty histogram bins in the range [ixlo,ixhi] where nbins is the total number of histogram b...
Definition: RooNumRunningInt.cxx:198
RooAbsReal.h
RooNumRunningInt::RICacheElem::_ax
Double_t * _ax
Definition: RooNumRunningInt.h:48
RooNumRunningInt::x
RooRealProxy x
Definition: RooNumRunningInt.h:66
RooNumRunningInt::actualParameters
virtual RooArgSet * actualParameters(const RooArgSet &nset) const
Return the parameters of the cache created by RooAbsCachedPdf.
Definition: RooNumRunningInt.cxx:284
RooTemplateProxy::arg
const T & arg() const
Return reference to object held in proxy.
Definition: RooTemplateProxy.h:271
RooArgList
Definition: RooArgList.h:21
RooAbsReal
Definition: RooAbsReal.h:61
RooNumRunningInt::RICacheElem::~RICacheElem
~RICacheElem()
Destructor.
Definition: RooNumRunningInt.cxx:123
bool
RooNumRunningInt::evaluate
virtual Double_t evaluate() const
Dummy function that is never called.
Definition: RooNumRunningInt.cxx:304
RooNumRunningInt::RICacheElem::_xx
RooRealVar * _xx
Definition: RooNumRunningInt.h:50
RooNumRunningInt::actualObservables
virtual RooArgSet * actualObservables(const RooArgSet &nset) const
Return observable in nset to be cached by RooAbsCachedPdf this is always the x observable that is int...
Definition: RooNumRunningInt.cxx:270
RooNumRunningInt::RICacheElem::containedArgs
virtual RooArgList containedArgs(Action)
Return all RooAbsArg components contained in cache element.
Definition: RooNumRunningInt.cxx:134
RooRealProxy.h
RooNumRunningInt::binningName
virtual const char * binningName() const
Definition: RooNumRunningInt.h:55
RooNumRunningInt::RICacheElem
Definition: RooNumRunningInt.h:38
RooNumRunningInt
Definition: RooNumRunningInt.h:20
RooNumRunningInt::RooNumRunningInt
RooNumRunningInt(const char *name, const char *title, RooAbsReal &_func, RooRealVar &_x, const char *binningName="cache")
Construct running integral of function '_func' over x_print from the lower bound on _x to the present...
Definition: RooNumRunningInt.cxx:52
RooAbsArg::aggregateCacheUniqueSuffix
const char * aggregateCacheUniqueSuffix() const
Definition: RooAbsArg.cxx:2182
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooAbsCachedReal.h
RooNumRunningInt::RICacheElem::_ay
Double_t * _ay
Definition: RooNumRunningInt.h:49
RooAbsCacheElement::Action
Action
Definition: RooAbsCacheElement.h:39
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooNumRunningInt::createCache
virtual FuncCacheElem * createCache(const RooArgSet *nset) const
Create custom cache element for running integral calculations.
Definition: RooNumRunningInt.cxx:295
name
char name[80]
Definition: TGX11.cxx:110
RooNumRunningInt::RICacheElem::_self
RooNumRunningInt * _self
Definition: RooNumRunningInt.h:47
RooNumRunningInt::RICacheElem::RICacheElem
RICacheElem(const RooNumRunningInt &ri, const RooArgSet *nset)
Construct RunningIntegral CacheElement.
Definition: RooNumRunningInt.cxx:102
RooNumRunningInt::inputBaseName
virtual const char * inputBaseName() const
Return unique name for RooAbsCachedPdf cache components constructed from input function name.
Definition: RooNumRunningInt.cxx:89
RooRealVar
Definition: RooRealVar.h:36
RooNumRunningInt::payloadUniqueSuffix
virtual const char * payloadUniqueSuffix() const
Definition: RooNumRunningInt.h:63
RooAbsCachedReal::FuncCacheElem
Definition: RooAbsCachedReal.h:59
RooAbsCachedReal
Definition: RooAbsCachedReal.h:24
RooNumRunningInt::RICacheElem::addPoint
void addPoint(Int_t ix)
Sample function at bin ix.
Definition: RooNumRunningInt.cxx:245
RooArgSet
Definition: RooArgSet.h:28
RooNumRunningInt::func
RooRealProxy func
Definition: RooNumRunningInt.h:65
int
RooNumRunningInt::clone
virtual TObject * clone(const char *newname) const
Definition: RooNumRunningInt.h:33