BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
ParticleIDBase.h
Go to the documentation of this file.
1#ifndef ParticleID_ParticleIDBase_H
2#define ParticleID_ParticleIDBase_H
3//
4// define the standard interface of ParticleID package
5// PID-sys includes: dE/dx, TOF endcap, TOF barrel inner, TOF barrel outer,
6// TOF Q, EMC energy deposition and Maybe Muon counter
7// the development of particle ID package should follow the rule defined
8// in this class.
9//
10// Author: K.L. He 11/11/2005, created
11//
12//
13#include <string>
14
15#ifndef BEAN
17#else
18#include "DstEvtRecTracks.h"
19#endif
20
22
23 public:
24
26 virtual ~ParticleIDBase(){;}
27
28 virtual void init() = 0;
29 virtual void calculate() = 0;
30 virtual bool IsPidInfoValid() const = 0;
31 virtual double chi(int n) const = 0;
32 virtual double prob(int n) const = 0;
33 virtual int ndof() const = 0;
34// virtual int neuronPID() const = 0; //neuron pid
35
36 EvtRecTrack* PidTrk() const {return m_trk;}
37 void setRecTrack(EvtRecTrack* trk) {m_trk = trk;}
38 double chiMinCut() const {return m_chimin_cut;}
39 void setChiMinCut(const double chi = 4) {m_chimin_cut = chi;}
40 double chiMaxCut() const {return m_chimax_cut;}
41 void setChiMaxCut(const double chi = 6) {m_chimax_cut = chi;}
42 double pdfMinSigmaCut() const {return m_pdfsigmamin_cut;}
43 void setPdfMinSigmaCut(const double pdf =4) {m_pdfsigmamin_cut= pdf;}
44 double getRunNo() const {return m_runno;}
45 void setRunNo(const double runh = 8093) {m_runno = runh;}
46
47 double p();
48 double pt();
49 double charge();
50
51 public: // utilities
52
53 double xmass(int n);
54 double velc();
55 double probCalculate(double chi2, int n);
56 double pdfCalculate(double offset,double sigma);
57 double interpolation(double* x, double* y,double x1);
58 double pol2(double x,double* par);
59 double pol3(double x,double* par);
60 double pol4(double x,double* par);
61
62 public: // specific sub pid sys
63
64 int useDedx() const {return USE_DEDX;}
65 int useTof() const {return USE_TOF;}
66 int useTof1() const {return USE_TOF1;}
67 int useTof2() const {return USE_TOF2;}
68 int useTofE() const {return USE_TOFE;}
69 int useTofQ() const {return USE_TOFQ;}
70 int useTofC() const {return USE_TOFC;}
71 int useTofCorr() const {return USE_TOFCorr;}
72 int useEmc() const {return USE_EMC;}
73 int useMuc() const {return USE_MUC;}
74
75 public: // identify which kind of particles
76 int onlyPionKaon() const {return (IDENTIFY_PION | IDENTIFY_KAON);}
77 int onlyPionKaonProton() const {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
78 int onlyPionKaonElectron() const {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
79 int all() const {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
80 int onlyElectron() const {return IDENTIFY_ELECTRON;}
81 int onlyMuon() const {return IDENTIFY_MUON;}
82 int onlyPion() const {return IDENTIFY_PION;}
83 int onlyKaon() const {return IDENTIFY_KAON;}
84 int onlyProton() const {return IDENTIFY_PROTON;}
85
86 public: // Particle ID method
87 int methodLikelihood() const {return LIKELIHOOD_PID;}
88 int methodProbability() const {return PROBABILITY_PID;}
89 int methodNeuronNetwork() const {return NEURONNETWORK_PID;}
90 public: //
91 int dedxValid() const {return DEDX_VALID;}
92 int tofValid() const {return TOF_VALID;}
93 int tofeValid() const {return TOFE_VALID;}
94 int tofqValid() const {return TOFQ_VALID;}
95 int tofcValid() const {return TOFC_VALID;}
96 int tofcorrValid() const {return TOFCorr_VALID;}
97 int emcValid() const {return EMC_VALID;}
98 int mucValid() const {return MUC_VALID;}
99
100 protected:
101 // path to dir with calibration/configuration/etc data
102 static std::string path;
103 public:
104 void set_path(const char* s_path = 0);
105 void set_path(std::string s_path) {path = s_path;}
106
107 protected:
108 // PID calculation routines(include PID correction)
109 virtual int particleIDCalculation() = 0;
110// virtual int neuronPIDCalculation() = 0;
111 //huangb add
112 virtual int LikelihoodCalculation() =0;
113
114 private:
115 EvtRecTrack* m_trk;
116 double m_runno;
117 double m_chimin_cut, m_chimax_cut;
118 double m_pdfsigmamin_cut; //the cut is multiple of the sigma. ie. if(m_pdfsigmamin_cut ==3), the cut is 3sigma
119 static const int USE_DEDX;
120 static const int USE_TOF1;
121 static const int USE_TOF2;
122 static const int USE_TOF;
123 static const int USE_TOFE;
124 static const int USE_TOFQ;
125 static const int USE_TOFC;
126 static const int USE_TOFCorr;
127 static const int USE_EMC;
128 static const int USE_MUC;
129
130 static const int IDENTIFY_ELECTRON;
131 static const int IDENTIFY_MUON;
132 static const int IDENTIFY_PION;
133 static const int IDENTIFY_KAON;
134 static const int IDENTIFY_PROTON;
135
136 static const int PROBABILITY_PID;
137 static const int LIKELIHOOD_PID;
138 static const int NEURONNETWORK_PID;
139
140 static const int DEDX_VALID;
141 static const int TOF_VALID;
142 static const int TOF1_VALID;
143 static const int TOF2_VALID;
144 static const int TOFE_VALID;
145 static const int TOFQ_VALID;
146 static const int TOFC_VALID;
147 static const int TOFCorr_VALID;
148 static const int EMC_VALID;
149 static const int MUC_VALID;
150};
151
152#endif
TTree * sigma
const Int_t n
const double xmass[5]
Definition: Gam4pikp.cxx:50
double chiMinCut() const
double pol2(double x, double *par)
int tofcValid() const
int tofValid() const
virtual int ndof() const =0
double interpolation(double *x, double *y, double x1)
int useTofCorr() const
int useTof2() const
virtual void init()=0
void setPdfMinSigmaCut(const double pdf=4)
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
int useTofE() const
int onlyPionKaonElectron() const
int onlyProton() const
double chiMaxCut() const
double getRunNo() const
virtual double chi(int n) const =0
int useTof() const
int useTofQ() const
double pol4(double x, double *par)
void set_path(std::string s_path)
int methodProbability() const
int useDedx() const
int emcValid() const
int useTofC() const
double pol3(double x, double *par)
double pdfCalculate(double offset, double sigma)
virtual int LikelihoodCalculation()=0
void setRunNo(const double runh=8093)
int onlyMuon() const
double pdfMinSigmaCut() const
int onlyKaon() const
int onlyPionKaon() const
int onlyPionKaonProton() const
virtual int particleIDCalculation()=0
int onlyElectron() const
static std::string path
int dedxValid() const
int tofcorrValid() const
virtual void calculate()=0
int tofqValid() const
int mucValid() const
int onlyPion() const
int methodNeuronNetwork() const
void setChiMaxCut(const double chi=6)
int useTof1() const
int useEmc() const
void setChiMinCut(const double chi=4)
virtual bool IsPidInfoValid() const =0
int all() const
int tofeValid() const
int useMuc() const
int methodLikelihood() const
virtual double prob(int n) const =0
void setRecTrack(EvtRecTrack *trk)
virtual ~ParticleIDBase()
void set_path(const char *s_path=0)
double y[1000]