All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
LikelihoodPID.hh
Go to the documentation of this file.
1 #ifndef LIKELIHOODPID_hh
2 #define LIKELIHOODPID_hh 1
3 
4 #include <string>
5 #include <sstream>
6 #include "TLorentzVector.h"
7 #include "EVENT/Cluster.h"
8 #include "EVENT/Track.h"
9 #include "TFile.h"
10 #include "TH1.h"
11 
13 public:
14 
15  LikelihoodPID(const LikelihoodPID&) = delete;
16  LikelihoodPID& operator=(const LikelihoodPID&) = delete;
17 
19  LikelihoodPID(std::string fname, double *pars, std::vector<float> cost);
20  LikelihoodPID(double *pars);
22 
23  //bool Class_electron(int trkid, jetdata data);
24  //bool Class_muon(int trkid, jetdata data);
25  int Classification(TLorentzVector pp, EVENT::Track* trk, EVENT::ClusterVec& cluvec);
26  double *GetPosterior();
27  double *GetLikelihood();
28  double getCorrEnergy(TLorentzVector pp, EVENT::Track* trk, EVENT::ClusterVec& cluvec);
29  double getCorrEnergy(TLorentzVector pp, int parttype);
30 
31  //for leptonIDlikelihood
32  double get_dEdxDist(int parttype);
33 
34  //for each kind of PID flg
35  void setBasicFlg(bool flg) {_basicFlg = flg;}
36  void setdEdxFlg(bool flg) {_dEdxFlg = flg;}
37  void setShowerShapesFlg(bool flg) {_showerShapesFlg = flg;}
38 
39  double get_dEdxChi2(int parttype, TVector3 p, float hit, double dEdx);
40  double get_dEdxFactor(int parttype, TVector3 p, float hit, double dEdx);
41 
42  void CalculateDeltaPosition(float charge, TVector3 p, const float* calpos);
43 
44 private:
45  double get_Norm( double dedx);
46  double BetheBloch( double x, double mass, double *pars);
47 
48  int Class_electron(TLorentzVector pp, EVENT::Track* trk, EVENT::ClusterVec& cluvec);
49  int Class_muon(TLorentzVector pp, EVENT::Track* trk, EVENT::ClusterVec& cluvec);
50  int Class_hadron(TLorentzVector pp, EVENT::Track* trk, EVENT::ClusterVec& cluvec);
51  double getValue(int type, int valtype, double value);
52  double getPenalty(int ptype, int hypothesis, double p);
53 
54  double par[5][5]{};
55  TFile* fpdf{};
56  TH1F* pdf[6][20]{};
57 
58  //define masses
59  double emass{};
60  double mmass{};
61  double pimass{};
62  double kmass{};
63  double pmass{};
64 
65  //threshold
66  double threshold[5]{};
67  //penality
68  double penalty[5][5]{};
69  double prior[5]{};
70 
71  double fact[5][5]{};
72 
73  //weights for hadron likelihood calculation
74  double _weights[6][20]{};
75 
76  //posterior
77  double _posterior[6]{}; //add ahdron type
78  double _likelihood[6]{}; //add hadron type
79 
80  //distance from bethe bloch line with each particle hypothesis
81  double _dEdxDist[5]{};
82 
83  //for shower profile
84  EVENT::FloatVec shapes{};
85 
87  int _usebayes{}, _usecorr{};
89  double _delpos[3]{};
90 };
91 
92 #endif
double _delpos[3]
int Class_hadron(TLorentzVector pp, EVENT::Track *trk, EVENT::ClusterVec &cluvec)
EVENT::FloatVec shapes
double get_dEdxDist(int parttype)
double prior[5]
void CalculateDeltaPosition(float charge, TVector3 p, const float *calpos)
int Class_muon(TLorentzVector pp, EVENT::Track *trk, EVENT::ClusterVec &cluvec)
int Class_electron(TLorentzVector pp, EVENT::Track *trk, EVENT::ClusterVec &cluvec)
double * GetLikelihood()
double get_dEdxChi2(int parttype, TVector3 p, float hit, double dEdx)
double get_dEdxFactor(int parttype, TVector3 p, float hit, double dEdx)
double threshold[5]
double * GetPosterior()
double _posterior[6]
void setBasicFlg(bool flg)
double fact[5][5]
double penalty[5][5]
double _likelihood[6]
double getValue(int type, int valtype, double value)
void setdEdxFlg(bool flg)
void setShowerShapesFlg(bool flg)
double _dEdxDist[5]
double get_Norm(double dedx)
double getCorrEnergy(TLorentzVector pp, EVENT::Track *trk, EVENT::ClusterVec &cluvec)
int Classification(TLorentzVector pp, EVENT::Track *trk, EVENT::ClusterVec &cluvec)
double par[5][5]
double _weights[6][20]
double getPenalty(int ptype, int hypothesis, double p)
double BetheBloch(double x, double mass, double *pars)
TH1F * pdf[6][20]
LikelihoodPID & operator=(const LikelihoodPID &)=delete