JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELANCSpline_3D_fast.h
Go to the documentation of this file.
1 #ifndef MELANCSPLINE_3D_FAST
2 #define MELANCSPLINE_3D_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:
17 
24 
25  RooRealProxy theYVar;
26  RooRealProxy theZVar;
27  std::vector<T> YList;
28  std::vector<T> ZList;
29 
30  std::vector<std::vector<std::vector<T>>> FcnList;
31 
32  std::vector<T> kappaX;
33  std::vector<T> kappaY;
34  std::vector<T> kappaZ;
35  std::vector<std::vector<
36  std::vector<std::vector<
37  std::vector<std::vector<T>>
38  >>
39  >> coefficients; // [ix][A_x,B_x,C_x,D_x][iy][A_x_y,B_x_y,C_x_y,D_x_y][iz][A_x_y_z,B_x_y_z,C_x_y_z,D_x_y_z]
40 
41 public:
44  const char* name,
45  const char* title
46  );
48  const char* name,
49  const char* title,
50  RooAbsReal& inXVar,
51  RooAbsReal& inYVar,
52  RooAbsReal& inZVar,
53  const std::vector<T>& inXList,
54  const std::vector<T>& inYList,
55  const std::vector<T>& inZList,
56  const std::vector<std::vector<std::vector<T>>>& inFcnList,
63  Bool_t inUseFloor=true,
64  T inFloorEval=0,
65  T inFloorInt=0
66  );
67  MELANCSpline_3D_fast(const MELANCSpline_3D_fast& other, const char* name=0);
68  virtual TObject* clone(const char* newname)const { return new MELANCSpline_3D_fast(*this, newname); }
69  inline virtual ~MELANCSpline_3D_fast(){}
70 
71  void setRangeValidity(const T valmin, const T valmax, const Int_t whichDirection);
72 
73  virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const;
74  virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0)const;
75 
76 protected:
77  virtual void emptyFcnList(){ std::vector<std::vector<std::vector<T>>> tmp; FcnList.swap(tmp); }
78 
79  unsigned int npointsY()const{ return YList.size(); }
80  unsigned int npointsZ()const{ return ZList.size(); }
81 
82  virtual Int_t getWhichBin(const T& val, const Int_t whichDirection)const;
83  virtual T getTVar(const std::vector<T>& kappas, const T& val, const Int_t& bin, const Int_t whichDirection)const;
84  virtual void getKappas(std::vector<T>& kappas, const Int_t whichDirection);
85 
86  Bool_t testRangeValidity(const T& val, const Int_t whichDirection)const;
87  void cropValueForRange(T& val, const Int_t whichDirection)const;
88 
89  virtual std::vector<std::vector<T>> getCoefficientsPerYPerZ(
90  const std::vector<T>& kappaX, const TMatrix_t& xAinv,
91  const Int_t& ybin, const Int_t& zbin,
93  const Int_t xbin
94  )const; // xbin can be -1, which means push all of them
95 
96  virtual T interpolateFcn(Int_t code, const char* rangeName=0)const;
97 
98  virtual Double_t evaluate()const;
99 
100 
101  ClassDef(MELANCSpline_3D_fast, 2)
102 
103 };
104 
105 #endif
MELANCSpline_3D_fast::bcEndY
const BoundaryCondition bcEndY
Definition: MELANCSpline_3D_fast.h:21
MELANCSpline_3D_fast::bcBeginZ
const BoundaryCondition bcBeginZ
Definition: MELANCSpline_3D_fast.h:22
MELANCSpline_3D_fast::interpolateFcn
virtual T interpolateFcn(Int_t code, const char *rangeName=0) const
Definition: MELANCSpline_3D_fast.cc:250
MELANCSplineCore::T
Float_t T
Definition: MELANCSplineCore.h:18
MELANCSpline_3D_fast::kappaY
std::vector< T > kappaY
Definition: MELANCSpline_3D_fast.h:33
MELANCSpline_3D_fast::theZVar
RooRealProxy theZVar
Definition: MELANCSpline_3D_fast.h:26
MELANCSpline_3D_fast::FcnList
std::vector< std::vector< std::vector< T > > > FcnList
Definition: MELANCSpline_3D_fast.h:30
MELANCSpline_3D_fast::getKappas
virtual void getKappas(std::vector< T > &kappas, const Int_t whichDirection)
Definition: MELANCSpline_3D_fast.cc:356
MELANCSpline_3D_fast::bcBeginY
const BoundaryCondition bcBeginY
Definition: MELANCSpline_3D_fast.h:20
MELANCSpline_3D_fast::cropValueForRange
void cropValueForRange(T &val, const Int_t whichDirection) const
Definition: MELANCSpline_3D_fast.cc:534
MELANCSpline_3D_fast::testRangeValidity
Bool_t testRangeValidity(const T &val, const Int_t whichDirection) const
Definition: MELANCSpline_3D_fast.cc:501
MELANCSpline_3D_fast::theYVar
RooRealProxy theYVar
Definition: MELANCSpline_3D_fast.h:25
MELANCSpline_3D_fast::bcBeginX
const BoundaryCondition bcBeginX
Definition: MELANCSpline_3D_fast.h:18
MELANCSplineCore::BoundaryCondition
BoundaryCondition
Definition: MELANCSplineCore.h:28
MELANCSpline_3D_fast::getCoefficientsPerYPerZ
virtual std::vector< std::vector< T > > getCoefficientsPerYPerZ(const std::vector< T > &kappaX, const TMatrix_t &xAinv, const Int_t &ybin, const Int_t &zbin, MELANCSplineCore::BoundaryCondition const &bcBegin, MELANCSplineCore::BoundaryCondition const &bcEnd, const Int_t xbin) const
Definition: MELANCSpline_3D_fast.cc:426
MELANCSpline_3D_fast
Definition: MELANCSpline_3D_fast.h:11
MELANCSpline_3D_fast::ZList
std::vector< T > ZList
Definition: MELANCSpline_3D_fast.h:28
MELANCSpline_3D_fast::evaluate
virtual Double_t evaluate() const
Definition: MELANCSpline_3D_fast.cc:438
MELANCSpline_3D_fast::emptyFcnList
virtual void emptyFcnList()
Definition: MELANCSpline_3D_fast.h:77
MELANCSpline_3D_fast::npointsZ
unsigned int npointsZ() const
Definition: MELANCSpline_3D_fast.h:80
MELANCSpline_3D_fast::MELANCSpline_3D_fast
MELANCSpline_3D_fast()
MELANCSpline_3D_fast::rangeYmin
T rangeYmin
Definition: MELANCSpline_3D_fast.h:13
MELANCSpline_3D_fast::kappaX
std::vector< T > kappaX
Definition: MELANCSpline_3D_fast.h:32
MELANCSpline_3D_fast::bcEndZ
const BoundaryCondition bcEndZ
Definition: MELANCSpline_3D_fast.h:23
MELANCSplineCore::TMatrix_t
TMatrixT< T > TMatrix_t
Definition: MELANCSplineCore.h:19
MELANCSpline_3D_fast::rangeZmin
T rangeZmin
Definition: MELANCSpline_3D_fast.h:15
MELANCSpline_3D_fast::getAnalyticalIntegral
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Definition: MELANCSpline_3D_fast.cc:447
MELANCSpline_3D_fast::getTVar
virtual T getTVar(const std::vector< T > &kappas, const T &val, const Int_t &bin, const Int_t whichDirection) const
Definition: MELANCSpline_3D_fast.cc:417
MELANCSpline_3D_fast::rangeZmax
T rangeZmax
Definition: MELANCSpline_3D_fast.h:16
MELANCSplineCore
Definition: MELANCSplineCore.h:16
MELANCSpline_3D_fast::~MELANCSpline_3D_fast
virtual ~MELANCSpline_3D_fast()
Definition: MELANCSpline_3D_fast.h:69
MELANCSpline_3D_fast::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Definition: MELANCSpline_3D_fast.cc:491
MELANCSpline_3D_fast::coefficients
std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > coefficients
Definition: MELANCSpline_3D_fast.h:39
MELANCSpline_3D_fast::npointsY
unsigned int npointsY() const
Definition: MELANCSpline_3D_fast.h:79
MELANCSplineCore.h
MELANCSplineCore::bcNaturalSpline
@ bcNaturalSpline
Definition: MELANCSplineCore.h:32
MELANCSpline_3D_fast::kappaZ
std::vector< T > kappaZ
Definition: MELANCSpline_3D_fast.h:34
MELANCSpline_3D_fast::rangeYmax
T rangeYmax
Definition: MELANCSpline_3D_fast.h:14
MELANCSpline_3D_fast::bcEndX
const BoundaryCondition bcEndX
Definition: MELANCSpline_3D_fast.h:19
MELANCSpline_3D_fast::getWhichBin
virtual Int_t getWhichBin(const T &val, const Int_t whichDirection) const
Definition: MELANCSpline_3D_fast.cc:385
MELANCSpline_3D_fast::clone
virtual TObject * clone(const char *newname) const
Definition: MELANCSpline_3D_fast.h:68
MELANCSpline_3D_fast::YList
std::vector< T > YList
Definition: MELANCSpline_3D_fast.h:27
MELANCSpline_3D_fast::setRangeValidity
void setRangeValidity(const T valmin, const T valmax, const Int_t whichDirection)
Definition: MELANCSpline_3D_fast.cc:517