JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELANCSpline_2D_fast.h
Go to the documentation of this file.
1 #ifndef MELANCSPLINE_2D_FAST
2 #define MELANCSPLINE_2D_FAST
3 
4 #include <vector>
5 #include "RooAbsPdf.h"
6 #include "RooRealProxy.h"
7 #include "RooRealVar.h"
8 #include "RooAbsReal.h"
9 #include "MELANCSplineCore.h"
10 
12 protected:
15 
20 
21  RooRealProxy theYVar;
22  std::vector<T> YList;
23 
24  std::vector<std::vector<T>> FcnList;
25 
26  std::vector<T> kappaX;
27  std::vector<T> kappaY;
28  std::vector<std::vector<std::vector<std::vector<T>>>> coefficients; // [ix][A_x,B_x,C_x,D_x][iy][A_x_y,B_x_y,C_x_y,D_x_y]
29 
30 public:
33  const char* name,
34  const char* title
35  );
37  const char* name,
38  const char* title,
39  RooAbsReal& inXVar,
40  RooAbsReal& inYVar,
41  const std::vector<T>& inXList,
42  const std::vector<T>& inYList,
43  const std::vector<std::vector<T>>& inFcnList,
48  Bool_t inUseFloor=true,
49  T inFloorEval=0,
50  T inFloorInt=0
51  );
52  MELANCSpline_2D_fast(const MELANCSpline_2D_fast& other, const char* name=0);
53  virtual TObject* clone(const char* newname)const { return new MELANCSpline_2D_fast(*this, newname); }
54  inline virtual ~MELANCSpline_2D_fast(){}
55 
56  void setRangeValidity(const T valmin, const T valmax, const Int_t whichDirection);
57 
58  virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const;
59  virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0)const;
60 
61 protected:
62  virtual void emptyFcnList(){ std::vector<std::vector<T>> tmp; FcnList.swap(tmp); }
63 
64  unsigned int npointsY()const{ return YList.size(); }
65 
66  virtual Int_t getWhichBin(const T& val, const Int_t whichDirection)const;
67  virtual T getTVar(const std::vector<T>& kappas, const T& val, const Int_t& bin, const Int_t whichDirection)const;
68  virtual void getKappas(std::vector<T>& kappas, const Int_t whichDirection);
69 
70  Bool_t testRangeValidity(const T& val, const Int_t whichDirection)const;
71  void cropValueForRange(T& val, const Int_t whichDirection)const;
72 
73  virtual std::vector<std::vector<T>> getCoefficientsPerY(const std::vector<T>& kappaX, const TMatrix_t& xAinv, const Int_t& ybin, MELANCSplineCore::BoundaryCondition const& bcBegin, MELANCSplineCore::BoundaryCondition const& bcEnd, const Int_t xbin)const; // xbin can be -1, which means push all of them
74 
75  virtual T interpolateFcn(Int_t code, const char* rangeName=0)const;
76 
77  virtual Double_t evaluate()const;
78 
79 
80  ClassDef(MELANCSpline_2D_fast, 2)
81 
82 };
83 
84 #endif
MELANCSplineCore::T
Float_t T
Definition: MELANCSplineCore.h:18
MELANCSpline_2D_fast::kappaY
std::vector< T > kappaY
Definition: MELANCSpline_2D_fast.h:27
MELANCSpline_2D_fast::theYVar
RooRealProxy theYVar
Definition: MELANCSpline_2D_fast.h:21
MELANCSpline_2D_fast::rangeYmin
T rangeYmin
Definition: MELANCSpline_2D_fast.h:13
MELANCSpline_2D_fast::coefficients
std::vector< std::vector< std::vector< std::vector< T > > > > coefficients
Definition: MELANCSpline_2D_fast.h:28
MELANCSpline_2D_fast::getTVar
virtual T getTVar(const std::vector< T > &kappas, const T &val, const Int_t &bin, const Int_t whichDirection) const
Definition: MELANCSpline_2D_fast.cc:298
MELANCSpline_2D_fast::getKappas
virtual void getKappas(std::vector< T > &kappas, const Int_t whichDirection)
Definition: MELANCSpline_2D_fast.cc:245
MELANCSpline_2D_fast::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Definition: MELANCSpline_2D_fast.cc:347
MELANCSpline_2D_fast::npointsY
unsigned int npointsY() const
Definition: MELANCSpline_2D_fast.h:64
MELANCSpline_2D_fast::kappaX
std::vector< T > kappaX
Definition: MELANCSpline_2D_fast.h:26
MELANCSpline_2D_fast::getWhichBin
virtual Int_t getWhichBin(const T &val, const Int_t whichDirection) const
Definition: MELANCSpline_2D_fast.cc:270
MELANCSplineCore::BoundaryCondition
BoundaryCondition
Definition: MELANCSplineCore.h:28
MELANCSpline_2D_fast::MELANCSpline_2D_fast
MELANCSpline_2D_fast()
MELANCSpline_2D_fast::testRangeValidity
Bool_t testRangeValidity(const T &val, const Int_t whichDirection) const
Definition: MELANCSpline_2D_fast.cc:357
MELANCSpline_2D_fast::clone
virtual TObject * clone(const char *newname) const
Definition: MELANCSpline_2D_fast.h:53
MELANCSpline_2D_fast::setRangeValidity
void setRangeValidity(const T valmin, const T valmax, const Int_t whichDirection)
Definition: MELANCSpline_2D_fast.cc:369
MELANCSpline_2D_fast::emptyFcnList
virtual void emptyFcnList()
Definition: MELANCSpline_2D_fast.h:62
MELANCSpline_2D_fast::getCoefficientsPerY
virtual std::vector< std::vector< T > > getCoefficientsPerY(const std::vector< T > &kappaX, const TMatrix_t &xAinv, const Int_t &ybin, MELANCSplineCore::BoundaryCondition const &bcBegin, MELANCSplineCore::BoundaryCondition const &bcEnd, const Int_t xbin) const
Definition: MELANCSpline_2D_fast.cc:306
MELANCSplineCore::TMatrix_t
TMatrixT< T > TMatrix_t
Definition: MELANCSplineCore.h:19
MELANCSpline_2D_fast::evaluate
virtual Double_t evaluate() const
Definition: MELANCSpline_2D_fast.cc:313
MELANCSpline_2D_fast::YList
std::vector< T > YList
Definition: MELANCSpline_2D_fast.h:22
MELANCSpline_2D_fast::~MELANCSpline_2D_fast
virtual ~MELANCSpline_2D_fast()
Definition: MELANCSpline_2D_fast.h:54
MELANCSpline_2D_fast::rangeYmax
T rangeYmax
Definition: MELANCSpline_2D_fast.h:14
MELANCSpline_2D_fast::bcEndX
const BoundaryCondition bcEndX
Definition: MELANCSpline_2D_fast.h:17
MELANCSplineCore
Definition: MELANCSplineCore.h:16
MELANCSplineCore.h
MELANCSplineCore::bcNaturalSpline
@ bcNaturalSpline
Definition: MELANCSplineCore.h:32
MELANCSpline_2D_fast
Definition: MELANCSpline_2D_fast.h:11
MELANCSpline_2D_fast::bcBeginY
const BoundaryCondition bcBeginY
Definition: MELANCSpline_2D_fast.h:18
MELANCSpline_2D_fast::getAnalyticalIntegral
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Definition: MELANCSpline_2D_fast.cc:322
MELANCSpline_2D_fast::cropValueForRange
void cropValueForRange(T &val, const Int_t whichDirection) const
Definition: MELANCSpline_2D_fast.cc:382
MELANCSpline_2D_fast::FcnList
std::vector< std::vector< T > > FcnList
Definition: MELANCSpline_2D_fast.h:24
MELANCSpline_2D_fast::bcBeginX
const BoundaryCondition bcBeginX
Definition: MELANCSpline_2D_fast.h:16
MELANCSpline_2D_fast::bcEndY
const BoundaryCondition bcEndY
Definition: MELANCSpline_2D_fast.h:19
MELANCSpline_2D_fast::interpolateFcn
virtual T interpolateFcn(Int_t code, const char *rangeName=0) const
Definition: MELANCSpline_2D_fast.cc:149