JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELANCSplineFactory_2D.h
Go to the documentation of this file.
1 #ifndef MELANCSPLINEFACTORY_2D
2 #define MELANCSPLINEFACTORY_2D
3 
4 #include <vector>
5 #include <utility>
6 #include <algorithm>
7 #include "TTree.h"
8 #include "TNumericUtil.hh"
9 #include "MELANCSpline_2D_fast.h"
10 #include "MELAFuncPdf.h"
11 
13 
15 protected:
16  TString appendName;
17 
22 
23  RooAbsReal* XVar;
24  RooAbsReal* YVar;
27 
28  const std::vector<splineTriplet_t> getPoints(const std::vector<MELANCSplineCore::T>& XList, const std::vector<MELANCSplineCore::T>& YList, const std::vector<MELANCSplineCore::T>& FcnList);
29 
30  void destroyPDF();
31  void initPDF(const std::vector<splineTriplet_t>& pList);
32 
33  void addUnique(std::vector<MELANCSplineCore::T>& list, MELANCSplineCore::T val);
34 
35 public:
37  RooAbsReal& XVar_, RooAbsReal& YVar_, TString appendName_="",
42  );
44 
46  MELAFuncPdf* getPDF(){ return PDF; }
47 
48  void setEndConditions(
51  const unsigned int direction
52  );
53 
54  void setPoints(TTree* tree);
55  void setPoints(const std::vector<splineTriplet_t>& pList){ initPDF(pList); }
56  template<typename inType> void setPoints(const std::vector<inType>& XList, const std::vector<inType>& YList, const std::vector<inType>& FcnList){
57  std::vector<MELANCSplineCore::T> transXList;
58  std::vector<MELANCSplineCore::T> transYList;
59  std::vector<MELANCSplineCore::T> transFcnList;
60  for (unsigned int ip=0; ip<XList.size(); ip++) transXList.push_back((MELANCSplineCore::T)XList.at(ip));
61  for (unsigned int ip=0; ip<YList.size(); ip++) transYList.push_back((MELANCSplineCore::T)YList.at(ip));
62  for (unsigned int ip=0; ip<FcnList.size(); ip++) transFcnList.push_back((MELANCSplineCore::T)FcnList.at(ip));
63  const std::vector<splineTriplet_t> pList = getPoints(transXList, transYList, transFcnList);
64  setPoints(pList);
65  }
66 
67 };
68 
69 template void MELANCSplineFactory_2D::setPoints<Float_t>(const std::vector<Float_t>& XList, const std::vector<Float_t>& YList, const std::vector<Float_t>& FcnList);
70 template void MELANCSplineFactory_2D::setPoints<Double_t>(const std::vector<Double_t>& XList, const std::vector<Double_t>& YList, const std::vector<Double_t>& FcnList);
71 
72 #endif
73 
74 
75 
MELANCSplineCore::T
Float_t T
Definition: MELANCSplineCore.h:18
MELANCSplineFactory_2D::initPDF
void initPDF(const std::vector< splineTriplet_t > &pList)
Definition: MELANCSplineFactory_2D.cc:54
MELANCSplineFactory_2D::destroyPDF
void destroyPDF()
Definition: MELANCSplineFactory_2D.cc:53
MELANCSplineFactory_2D::bcEndX
MELANCSplineCore::BoundaryCondition bcEndX
Definition: MELANCSplineFactory_2D.h:19
MELANCSplineFactory_2D::setEndConditions
void setEndConditions(MELANCSplineCore::BoundaryCondition const bcBegin, MELANCSplineCore::BoundaryCondition const bcEnd, const unsigned int direction)
Definition: MELANCSplineFactory_2D.cc:106
TNumericUtil.hh
MELANCSplineCore::BoundaryCondition
BoundaryCondition
Definition: MELANCSplineCore.h:28
MELANCSplineFactory_2D::bcBeginX
MELANCSplineCore::BoundaryCondition bcBeginX
Definition: MELANCSplineFactory_2D.h:18
MELANCSpline_2D_fast.h
MELANCSplineFactory_2D::appendName
TString appendName
Definition: MELANCSplineFactory_2D.h:16
TNumericUtil::triplet
Definition: TNumericUtil.hh:9
MELAFuncPdf.h
MELANCSplineFactory_2D::fcn
MELANCSpline_2D_fast * fcn
Definition: MELANCSplineFactory_2D.h:25
MELANCSplineFactory_2D::bcBeginY
MELANCSplineCore::BoundaryCondition bcBeginY
Definition: MELANCSplineFactory_2D.h:20
MELANCSplineFactory_2D::getFunc
MELANCSpline_2D_fast * getFunc()
Definition: MELANCSplineFactory_2D.h:45
MELANCSplineFactory_2D::setPoints
void setPoints(TTree *tree)
Definition: MELANCSplineFactory_2D.cc:95
MELANCSplineFactory_2D::getPDF
MELAFuncPdf * getPDF()
Definition: MELANCSplineFactory_2D.h:46
MELANCSplineFactory_2D::XVar
RooAbsReal * XVar
Definition: MELANCSplineFactory_2D.h:23
MELANCSplineFactory_2D::~MELANCSplineFactory_2D
~MELANCSplineFactory_2D()
Definition: MELANCSplineFactory_2D.cc:20
MELANCSplineFactory_2D::PDF
MELAFuncPdf * PDF
Definition: MELANCSplineFactory_2D.h:26
MELANCSplineFactory_2D::getPoints
const std::vector< splineTriplet_t > getPoints(const std::vector< MELANCSplineCore::T > &XList, const std::vector< MELANCSplineCore::T > &YList, const std::vector< MELANCSplineCore::T > &FcnList)
Definition: MELANCSplineFactory_2D.cc:28
MELANCSplineCore::bcNaturalSpline
@ bcNaturalSpline
Definition: MELANCSplineCore.h:32
MELAFuncPdf
Definition: MELAFuncPdf.h:7
MELANCSpline_2D_fast
Definition: MELANCSpline_2D_fast.h:11
MELANCSplineFactory_2D::setPoints
void setPoints(const std::vector< inType > &XList, const std::vector< inType > &YList, const std::vector< inType > &FcnList)
Definition: MELANCSplineFactory_2D.h:56
MELANCSplineFactory_2D::MELANCSplineFactory_2D
MELANCSplineFactory_2D(RooAbsReal &XVar_, RooAbsReal &YVar_, TString appendName_="", MELANCSplineCore::BoundaryCondition const bcBeginX_=MELANCSplineCore::bcNaturalSpline, MELANCSplineCore::BoundaryCondition const bcEndX_=MELANCSplineCore::bcNaturalSpline, MELANCSplineCore::BoundaryCondition const bcBeginY_=MELANCSplineCore::bcNaturalSpline, MELANCSplineCore::BoundaryCondition const bcEndY_=MELANCSplineCore::bcNaturalSpline)
Definition: MELANCSplineFactory_2D.cc:6
MELANCSplineFactory_2D
Definition: MELANCSplineFactory_2D.h:14
MELANCSplineFactory_2D::setPoints
void setPoints(const std::vector< splineTriplet_t > &pList)
Definition: MELANCSplineFactory_2D.h:55
MELANCSplineFactory_2D::YVar
RooAbsReal * YVar
Definition: MELANCSplineFactory_2D.h:24
splineTriplet_t
TNumericUtil::triplet< MELANCSplineCore::T > splineTriplet_t
Definition: MELANCSplineFactory_2D.h:12
MELANCSplineFactory_2D::bcEndY
MELANCSplineCore::BoundaryCondition bcEndY
Definition: MELANCSplineFactory_2D.h:21
MELANCSplineFactory_2D::addUnique
void addUnique(std::vector< MELANCSplineCore::T > &list, MELANCSplineCore::T val)
Definition: MELANCSplineFactory_2D.cc:24