JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELALinearInterpFunc.h
Go to the documentation of this file.
1 #ifndef MELALINEARINTERPFUNC
2 #define MELALINEARINTERPFUNC
3 
4 #include <vector>
5 #include "MELAAccumulators.h"
6 #include "RooRealVar.h"
7 #include "RooListProxy.h"
8 #include "RooRealProxy.h"
9 #include "RooArgList.h"
10 #include "RooMsgService.h"
11 
12 
13 class MELALinearInterpFunc : public RooAbsReal{
14 public:
15  typedef Float_t T;
16 
21  };
22 
23 public:
26  const char* name,
27  const char* title
28  );
30  const char* name,
31  const char* title,
32  RooAbsReal& inXVar,
33  const std::vector<T>& inXList,
34  const RooArgList& inFcnList,
35  Bool_t inUseFloor=true,
36  T inFloorEval=1e-15,
37  T inFloorInt=1e-10
38  );
39  MELALinearInterpFunc(const MELALinearInterpFunc& other, const char* name=0);
40  virtual TObject* clone(const char* newname)const { return new MELALinearInterpFunc(*this, newname); }
41  inline virtual ~MELALinearInterpFunc(){}
42 
43  void setVerbosity(VerbosityLevel flag);
44  void setEvalFloor(T val);
45  void setIntFloor(T val);
46  void doFloor(Bool_t flag);
47 
48  void setRangeValidity(const T valmin, const T valmax);
49 
50  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0)const;
51  Double_t analyticalIntegral(Int_t code, const char* rangeName=0)const;
52 
53 protected:
55  Bool_t useFloor;
58 
61 
62  std::vector<T> XList;
63  RooRealProxy theXVar;
64  RooListProxy FcnList; // List of function values
65  RooListProxy leafDepsList; // List of all leaf dependents
66 
67  unsigned int npoints()const{ return XList.size(); }
68 
69  Int_t getWhichBin(const T& val)const;
70  T getKappa(const Int_t& bin)const;
71  T getTVar(const T& val)const;
72 
73  Bool_t testRangeValidity(const T& val)const;
74  void cropValueForRange(T& val)const;
75 
76  T interpolateFcn(Int_t code, const char* rangeName=0)const;
77  Double_t evaluate()const;
78 
79 
80  ClassDef(MELALinearInterpFunc, 0)
81 
82 };
83 
84 #endif
MELALinearInterpFunc::kVerbose
@ kVerbose
Definition: MELALinearInterpFunc.h:20
MELALinearInterpFunc::FcnList
RooListProxy FcnList
Definition: MELALinearInterpFunc.h:64
MELALinearInterpFunc::verbosity
VerbosityLevel verbosity
Definition: MELALinearInterpFunc.h:54
MELALinearInterpFunc::setVerbosity
void setVerbosity(VerbosityLevel flag)
Definition: MELALinearInterpFunc.cc:104
MELALinearInterpFunc::getAnalyticalIntegral
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Definition: MELALinearInterpFunc.cc:231
MELALinearInterpFunc::evaluate
Double_t evaluate() const
Definition: MELALinearInterpFunc.cc:222
MELALinearInterpFunc::leafDepsList
RooListProxy leafDepsList
Definition: MELALinearInterpFunc.h:65
MELALinearInterpFunc::setRangeValidity
void setRangeValidity(const T valmin, const T valmax)
Definition: MELALinearInterpFunc.cc:306
MELALinearInterpFunc::setIntFloor
void setIntFloor(T val)
Definition: MELALinearInterpFunc.cc:106
MELALinearInterpFunc::getWhichBin
Int_t getWhichBin(const T &val) const
Definition: MELALinearInterpFunc.cc:109
MELALinearInterpFunc::cropValueForRange
void cropValueForRange(T &val) const
Definition: MELALinearInterpFunc.cc:313
MELALinearInterpFunc::rangeXmax
T rangeXmax
Definition: MELALinearInterpFunc.h:60
MELALinearInterpFunc::MELALinearInterpFunc
MELALinearInterpFunc()
MELALinearInterpFunc::kSilent
@ kSilent
Definition: MELALinearInterpFunc.h:18
MELALinearInterpFunc::getTVar
T getTVar(const T &val) const
Definition: MELALinearInterpFunc.cc:140
MELALinearInterpFunc::theXVar
RooRealProxy theXVar
Definition: MELALinearInterpFunc.h:63
MELALinearInterpFunc::doFloor
void doFloor(Bool_t flag)
Definition: MELALinearInterpFunc.cc:107
MELALinearInterpFunc::npoints
unsigned int npoints() const
Definition: MELALinearInterpFunc.h:67
MELALinearInterpFunc::floorEval
T floorEval
Definition: MELALinearInterpFunc.h:56
MELALinearInterpFunc::rangeXmin
T rangeXmin
Definition: MELALinearInterpFunc.h:59
MELALinearInterpFunc::VerbosityLevel
VerbosityLevel
Definition: MELALinearInterpFunc.h:17
MELALinearInterpFunc::T
Float_t T
Definition: MELALinearInterpFunc.h:15
MELALinearInterpFunc::setEvalFloor
void setEvalFloor(T val)
Definition: MELALinearInterpFunc.cc:105
MELALinearInterpFunc::floorInt
T floorInt
Definition: MELALinearInterpFunc.h:57
MELALinearInterpFunc::XList
std::vector< T > XList
Definition: MELALinearInterpFunc.h:62
MELALinearInterpFunc::analyticalIntegral
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Definition: MELALinearInterpFunc.cc:290
MELALinearInterpFunc::useFloor
Bool_t useFloor
Definition: MELALinearInterpFunc.h:55
MELALinearInterpFunc::kError
@ kError
Definition: MELALinearInterpFunc.h:19
MELALinearInterpFunc::getKappa
T getKappa(const Int_t &bin) const
Definition: MELALinearInterpFunc.cc:130
MELALinearInterpFunc::clone
virtual TObject * clone(const char *newname) const
Definition: MELALinearInterpFunc.h:40
MELALinearInterpFunc::interpolateFcn
T interpolateFcn(Int_t code, const char *rangeName=0) const
Definition: MELALinearInterpFunc.cc:147
MELALinearInterpFunc::~MELALinearInterpFunc
virtual ~MELALinearInterpFunc()
Definition: MELALinearInterpFunc.h:41
MELALinearInterpFunc::testRangeValidity
Bool_t testRangeValidity(const T &val) const
Definition: MELALinearInterpFunc.cc:300
MELALinearInterpFunc
Definition: MELALinearInterpFunc.h:13
MELAAccumulators.h