54 func(
"func",
"func",this,_func),
56 _binningName(bname?bname:
"cache")
69 func(
"func",this,other.func),
71 _binningName(other._binningName)
137 ret.
add(FuncCacheElem::containedArgs(action)) ;
153 Int_t nbins = hist()->numEntries() ;
158 Int_t nInitRange=32 ;
159 for (
int i=1 ; i<=nInitRange ; i++) {
160 Int_t hi = (i*nbins)/nInitRange -1 ;
162 addRange(lo,
hi,nbins) ;
167 for (
int i=1 ; i<nbins ; i++) {
172 Double_t binv = (_self->x.max()-_self->x.min())/nbins ;
173 for (
int i=0 ; i<nbins ; i++) {
176 hist()->set(i, _ay[i]/_ay[nbins-1], 0.);
178 hist()->set(i, _ay[i]*binv, 0.);
220 Int_t ixmid = (ixlo+ixhi)/2 ;
224 Double_t yInt = _ay[ixlo] + (_ay[ixhi]-_ay[ixlo])*(ixmid-ixlo)/(ixhi-ixlo) ;
227 if (fabs(yInt-_ay[ixmid])*(_ax[nbins-1]-_ax[0])>1
e-6) {
228 addRange(ixlo,ixmid,nbins) ;
229 addRange(ixmid,ixhi,nbins) ;
231 for (
Int_t j=ixlo+1 ; j<ixmid ; j++) {
232 _ay[j] = _ay[ixlo] + (_ay[ixmid]-_ay[ixlo])*(j-ixlo)/(ixmid-ixlo) ;
234 for (
Int_t j=ixmid+1 ; j<ixhi ; j++) {
235 _ay[j] = _ay[ixmid] + (_ay[ixhi]-_ay[ixmid])*(j-ixmid)/(ixhi-ixmid) ;
248 _self->x = _xx->getVal() ;
249 _ay[ix] = _self->func.arg().getVal(*_xx) ;
306 cout <<
"RooNumRunningInt::evaluate(" <<
GetName() <<
")" << endl ;
RooArgSet * getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
RooAbsCachedReal is the abstract base class for functions that need or want to cache their evaluate()...
void setInterpolationOrder(Int_t order)
Set interpolation order of RooHistFunct representing cache histogram.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
Int_t numEntries() const override
Return the number of bins.
const RooArgSet * get() const override
Get bin centre of current bin.
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...
~RICacheElem()
Destructor.
virtual RooArgList containedArgs(Action)
Return all RooAbsArg components contained in cache element.
void addPoint(Int_t ix)
Sample function at bin ix.
void calculate(Bool_t cdfmode)
Calculate the numeric running integral and store the result in the cache histogram provided by RooAbs...
RICacheElem(const RooNumRunningInt &ri, const RooArgSet *nset)
Construct RunningIntegral CacheElement.
Class RooNumRunningInt is an implementation of RooAbsCachedReal that represents a running integral.
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...
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...
virtual FuncCacheElem * createCache(const RooArgSet *nset) const
Create custom cache element for running integral calculations.
virtual Double_t evaluate() const
Dummy function that is never called.
virtual RooArgSet * actualParameters(const RooArgSet &nset) const
Return the parameters of the cache created by RooAbsCachedPdf.
virtual void fillCacheObject(FuncCacheElem &cacheFunc) const
Fill the cache object by calling its calculate() method.
virtual ~RooNumRunningInt()
Destructor.
virtual const char * inputBaseName() const
Return unique name for RooAbsCachedPdf cache components constructed from input function name.
RooRealVar represents a variable that can be changed from the outside.
const T & arg() const
Return reference to object held in proxy.
virtual const char * GetName() const
Returns name of object.