Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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
19#include <string>
20#include <vector>
21
23public:
24 RooNumRunningInt(const char *name, const char *title, RooAbsReal& _func, RooRealVar& _x, const char* binningName="cache");
25 RooNumRunningInt(const RooNumRunningInt& other, const char* name=nullptr) ;
26 TObject *clone(const char *newname = nullptr) const override { return new RooNumRunningInt(*this, newname); }
27
28 protected:
29 class RICacheElem: public FuncCacheElem {
30 public:
31 RICacheElem(const RooNumRunningInt& ri, const RooArgSet* nset) ;
33 void calculate(bool cdfmode) ;
34 void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins) ;
35 void addPoint(Int_t ix) ;
36
38 std::vector<double> _ax ;
39 std::vector<double> _ay ;
41 } ;
42
43 friend class RICacheElem ;
44 const char* binningName() const override { return _binningName.c_str() ; }
45 FuncCacheElem* createCache(const RooArgSet* nset) const override ;
46 const char* inputBaseName() const override ;
47 RooFit::OwningPtr<RooArgSet> actualObservables(const RooArgSet& nset) const override ;
48 RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
49 void fillCacheObject(FuncCacheElem& cacheFunc) const override ;
50 double evaluate() const override ;
51
52 const char* payloadUniqueSuffix() const override { return func.arg().aggregateCacheUniqueSuffix() ; }
53
54 RooRealProxy func ; ///< Proxy to functions whose running integral is calculated
55 RooRealProxy x ; ///< Integrated observable
56 std::string _binningName ; ///< Name of binning to be used for cache histogram
57
58private:
59
60 ClassDefOverride(RooNumRunningInt,1) // Numeric calculator for running integral of a given function
61
62};
63
64#endif
RooTemplateProxy< RooAbsReal > RooRealProxy
Compatibility typedef replacing the old RooRealProxy class.
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
FuncCacheElem(const RooAbsCachedReal &self, const RooArgSet *nset)
Constructor of cache storage unit class.
friend class FuncCacheElem
RooAbsReal()
coverity[UNINIT_CTOR] Default constructor
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
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...
RooArgList containedArgs(Action) override
Return all RooAbsArg components contained in cache element.
void addPoint(Int_t ix)
Sample function at bin ix.
void calculate(bool 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.
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...
const char * binningName() const override
std::string _binningName
Name of binning to be used for cache histogram.
double evaluate() const override
Dummy function that is never called.
const char * inputBaseName() const override
Return unique name for RooAbsCachedPdf cache components constructed from input function name.
RooFit::OwningPtr< RooArgSet > actualParameters(const RooArgSet &nset) const override
Return the parameters of the cache created by RooAbsCachedPdf.
RooRealProxy func
Proxy to functions whose running integral is calculated.
FuncCacheElem * createCache(const RooArgSet *nset) const override
Create custom cache element for running integral calculations.
RooFit::OwningPtr< RooArgSet > actualObservables(const RooArgSet &nset) const override
Return observable in nset to be cached by RooAbsCachedPdf this is always the x observable that is int...
TObject * clone(const char *newname=nullptr) const override
const char * payloadUniqueSuffix() const override
friend class RICacheElem
RooRealProxy x
Integrated observable.
void fillCacheObject(FuncCacheElem &cacheFunc) const override
Fill the cache object by calling its calculate() method.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Mother of all ROOT objects.
Definition TObject.h:42
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:35