LCFIPlus  0.6.5
Pi0VertexFinder.h
Go to the documentation of this file.
1 #ifndef PI0FINDER_H
2 #define PI0FINDER_H
3 
4 #include <vector>
5 #include <string>
6 
7 //ROOT includes
8 #include "TMatrix.h"
9 #include "TFile.h"
10 #include "TH1.h"
11 #include "TH2.h"
12 #include "TLorentzVector.h"
13 #include "TVector3.h"
14 #include "TMVA/Reader.h"
15 
16 #include "lcfiplus.h"
17 
18 namespace lcfiplus {
19 class Pi0Finder{
20 public:
21  Pi0Finder(string pi0pdfname, string pi0pdfname2d);
22  ~Pi0Finder();
23 
24  void Initialize() { prior=0.5; } //set prior 0.5
25  double Get_Prob(double *var);
26  double Get_g1Prob(double *var);
27  double Get_g2Prob(double *var);
28  double Get_PairProb(double *var);
29 
30 private:
31  TFile *fpdf,*fpdf2;
32  TH2F *pdfs2D[2][2];
33  TH1F *pdfs[2][19];
34 
35  double getValue(int valtype, int type, double value);
36  double getValue2D(int valtype, int type, double valuex, double valuey);
37  double *threshold;
38  double prior;
39 };
40 
42 public:
44  Pi0VertexFinder(vector<string> weightfiles, vector<string> booknames, vector<double> opp, string pi0pdfname, string pi0pdfname2d);
46 
47  void Initialize();
48  void Make_GammaVector(const lcfiplus::Neutral* ntrl);
49  void Reco_Pi0s(TVector3 vtx, TVector3 vtxdir);
50  TLorentzVector Corr_VtxVect(int vtxtype, TLorentzVector vtx1vect, int *npart, TVector3 vtx, TVector3 vtxdir);
51  int Get_nPi0();
52 
53 private:
54  void Make_Pi0Vector(TVector3 vtx, TVector3 vtxdir);
55  double Get_GlobalMinimum();
56 
57  TMVA::Reader *vtxpi0;
58  float var[20]; //for MVA variables
59 
60  int ng,counter,npi0;
61 
62  TMatrixD dm;
63  vector< vector<double> > gv;
64  vector< vector<double> > pi0vec;
65 
66  Pi0Finder *pi0ID;
67 
68  vector<string> _booknames;
69  vector<double> _opp;
70 };
71 }
72 #endif
~Pi0Finder()
Definition: Pi0VertexFinder.cc:186
TLorentzVector Corr_VtxVect(int vtxtype, TLorentzVector vtx1vect, int *npart, TVector3 vtx, TVector3 vtxdir)
Definition: Pi0VertexFinder.cc:912
void Initialize()
Definition: Pi0VertexFinder.cc:519
int Get_nPi0()
Definition: Pi0VertexFinder.cc:1027
double Get_g2Prob(double *var)
Definition: Pi0VertexFinder.cc:281
Definition: Pi0VertexFinder.h:19
void Reco_Pi0s(TVector3 vtx, TVector3 vtxdir)
Definition: Pi0VertexFinder.cc:709
double Get_g1Prob(double *var)
Definition: Pi0VertexFinder.cc:246
Definition: Pi0VertexFinder.h:41
Pi0Finder(string pi0pdfname, string pi0pdfname2d)
Definition: Pi0VertexFinder.cc:15
double Get_Prob(double *var)
Definition: Pi0VertexFinder.cc:317
~Pi0VertexFinder()
Definition: Pi0VertexFinder.cc:510
double Get_PairProb(double *var)
Definition: Pi0VertexFinder.cc:195
Definition: lcfiplus.h:589
void Initialize()
Definition: Pi0VertexFinder.h:24
void Make_GammaVector(const lcfiplus::Neutral *ntrl)
Definition: Pi0VertexFinder.cc:529