JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MELANCSplineFactory_1D.h
Go to the documentation of this file.
1 #ifndef MELANCSPLINEFACTORY_1D
2 #define MELANCSPLINEFACTORY_1D
3 
4 #include <vector>
5 #include <utility>
6 #include <algorithm>
7 #include "TGraph.h"
8 #include "TTree.h"
9 #include "MELANCSpline_1D_fast.h"
10 #include "MELAFuncPdf.h"
11 
13 protected:
14  TString appendName;
15 
18 
19  RooAbsReal* splineVar;
22 
23  const std::vector<std::pair<MELANCSplineCore::T, MELANCSplineCore::T>> getPoints(const std::vector<MELANCSplineCore::T>& XList, const std::vector<MELANCSplineCore::T>& FcnList);
24 
25  void destroyPDF();
26  void initPDF(const std::vector<std::pair<MELANCSplineCore::T, MELANCSplineCore::T>>& pList);
27 
28 public:
30  RooAbsReal& splineVar_, TString appendName_="",
33  );
35 
37  MELAFuncPdf* getPDF(){ return PDF; }
38 
39  void setEndConditions(
42  const unsigned int direction=0
43  );
44 
45  void setPoints(TTree* tree);
46  void setPoints(TGraph* tg);
47  void setPoints(const std::vector<std::pair<MELANCSplineCore::T, MELANCSplineCore::T>>& pList){ initPDF(pList); }
48  template<typename inType> void setPoints(const std::vector<inType>& XList, const std::vector<inType>& FcnList){
49  std::vector<MELANCSplineCore::T> transXList;
50  std::vector<MELANCSplineCore::T> transFcnList;
51  for (unsigned int ip=0; ip<XList.size(); ip++) transXList.push_back((MELANCSplineCore::T)XList.at(ip));
52  for (unsigned int ip=0; ip<FcnList.size(); ip++) transFcnList.push_back((MELANCSplineCore::T)FcnList.at(ip));
53  const std::vector<std::pair<MELANCSplineCore::T, MELANCSplineCore::T>> pList = getPoints(transXList, transFcnList);
54  initPDF(pList);
55  }
56 
57 };
58 
59 template void MELANCSplineFactory_1D::setPoints<Float_t>(const std::vector<Float_t>& XList, const std::vector<Float_t>& FcnList);
60 template void MELANCSplineFactory_1D::setPoints<Double_t>(const std::vector<Double_t>& XList, const std::vector<Double_t>& FcnList);
61 
62 #endif
63 
64 
65 
MELANCSplineFactory_1D::MELANCSplineFactory_1D
MELANCSplineFactory_1D(RooAbsReal &splineVar_, TString appendName_="", MELANCSplineCore::BoundaryCondition const bcBeginX_=MELANCSplineCore::bcNaturalSpline, MELANCSplineCore::BoundaryCondition const bcEndX_=MELANCSplineCore::bcNaturalSpline)
Definition: MELANCSplineFactory_1D.cc:7
MELANCSplineFactory_1D::setEndConditions
void setEndConditions(MELANCSplineCore::BoundaryCondition const bcBegin, MELANCSplineCore::BoundaryCondition const bcEnd, const unsigned int direction=0)
Definition: MELANCSplineFactory_1D.cc:81
MELANCSplineCore::T
Float_t T
Definition: MELANCSplineCore.h:18
MELANCSplineFactory_1D::initPDF
void initPDF(const std::vector< std::pair< MELANCSplineCore::T, MELANCSplineCore::T >> &pList)
Definition: MELANCSplineFactory_1D.cc:51
MELANCSplineFactory_1D::splineVar
RooAbsReal * splineVar
Definition: MELANCSplineFactory_1D.h:19
MELANCSplineFactory_1D::bcEndX
MELANCSplineCore::BoundaryCondition bcEndX
Definition: MELANCSplineFactory_1D.h:17
MELANCSplineCore::BoundaryCondition
BoundaryCondition
Definition: MELANCSplineCore.h:28
MELANCSplineFactory_1D
Definition: MELANCSplineFactory_1D.h:12
MELANCSplineFactory_1D::setPoints
void setPoints(const std::vector< std::pair< MELANCSplineCore::T, MELANCSplineCore::T >> &pList)
Definition: MELANCSplineFactory_1D.h:47
MELANCSplineFactory_1D::bcBeginX
MELANCSplineCore::BoundaryCondition bcBeginX
Definition: MELANCSplineFactory_1D.h:16
MELANCSplineFactory_1D::fcn
MELANCSpline_1D_fast * fcn
Definition: MELANCSplineFactory_1D.h:20
MELANCSpline_1D_fast
Definition: MELANCSpline_1D_fast.h:12
MELANCSplineFactory_1D::setPoints
void setPoints(const std::vector< inType > &XList, const std::vector< inType > &FcnList)
Definition: MELANCSplineFactory_1D.h:48
MELAFuncPdf.h
MELANCSplineFactory_1D::getPoints
const std::vector< std::pair< MELANCSplineCore::T, MELANCSplineCore::T > > getPoints(const std::vector< MELANCSplineCore::T > &XList, const std::vector< MELANCSplineCore::T > &FcnList)
Definition: MELANCSplineFactory_1D.cc:38
MELANCSpline_1D_fast.h
MELANCSplineCore::bcNaturalSpline
@ bcNaturalSpline
Definition: MELANCSplineCore.h:32
MELAFuncPdf
Definition: MELAFuncPdf.h:7
MELANCSplineFactory_1D::PDF
MELAFuncPdf * PDF
Definition: MELANCSplineFactory_1D.h:21
MELANCSplineFactory_1D::setPoints
void setPoints(TTree *tree)
Definition: MELANCSplineFactory_1D.cc:21
MELANCSplineFactory_1D::destroyPDF
void destroyPDF()
Definition: MELANCSplineFactory_1D.cc:50
MELANCSplineFactory_1D::getFunc
MELANCSpline_1D_fast * getFunc()
Definition: MELANCSplineFactory_1D.h:36
MELANCSplineFactory_1D::~MELANCSplineFactory_1D
~MELANCSplineFactory_1D()
Definition: MELANCSplineFactory_1D.cc:18
MELANCSplineFactory_1D::appendName
TString appendName
Definition: MELANCSplineFactory_1D.h:14
MELANCSplineFactory_1D::getPDF
MELAFuncPdf * getPDF()
Definition: MELANCSplineFactory_1D.h:37