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) const override { return new RooNumRunningInt(*this,newname); }
27 ~RooNumRunningInt() override ;
28
29protected:
30
31 class RICacheElem: public FuncCacheElem {
32 public:
33 RICacheElem(const RooNumRunningInt& ri, const RooArgSet* nset) ;
35 void calculate(bool cdfmode) ;
36 void addRange(Int_t ixlo, Int_t ixhi, Int_t nbins) ;
37 void addPoint(Int_t ix) ;
38
40 std::vector<double> _ax ;
41 std::vector<double> _ay ;
43
44 } ;
45
46 friend class RICacheElem ;
47 const char* binningName() const override { return _binningName.c_str() ; }
48 FuncCacheElem* createCache(const RooArgSet* nset) const override ;
49 const char* inputBaseName() const override ;
50 RooFit::OwningPtr<RooArgSet> actualObservables(const RooArgSet& nset) const override ;
51 RooFit::OwningPtr<RooArgSet> actualParameters(const RooArgSet& nset) const override ;
52 void fillCacheObject(FuncCacheElem& cacheFunc) const override ;
53 double evaluate() const override ;
54
55 const char* payloadUniqueSuffix() const override { return func.arg().aggregateCacheUniqueSuffix() ; }
56
57 RooRealProxy func ; ///< Proxy to functions whose running integral is calculated
58 RooRealProxy x ; ///< Intergrated observable
59 std::string _binningName ; ///< Name of binning to be used for cache histogram
60
61private:
62
63 ClassDefOverride(RooNumRunningInt,1) // Numeric calculator for running integral of a given function
64
65};
66
67#endif
RooAbsReal * _func
Definition RooMinuit.h:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
const char * aggregateCacheUniqueSuffix() const
RooAbsCachedReal is the abstract base class for functions that need or want to cache their evaluate()...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
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:55
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...
Class RooNumRunningInt is an implementation of RooAbsCachedReal that represents a running integral.
TObject * clone(const char *newname) const override
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...
~RooNumRunningInt() override
Destructor.
const char * payloadUniqueSuffix() const override
RooRealProxy x
Intergrated observable.
void fillCacheObject(FuncCacheElem &cacheFunc) const override
Fill the cache object by calling its calculate() method.
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
const T & arg() const
Return reference to object held in proxy.
Mother of all ROOT objects.
Definition TObject.h:41
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
Definition Config.h:43