BOSS 6.6.4.p03
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 pdfMinSigmaCut() const {return m_pdfsigmamin_cut;}
41 void setPdfMinSigmaCut(const double pdf =4) {m_pdfsigmamin_cut= pdf;}
42 double getRunNo() const {return m_runno;}
43 void setRunNo(const double runh = 8093) {m_runno = runh;}
44
45
46 double p();
47 double pt();
48 double charge();
49
50 public: // utilities
51
52 double xmass(int n);
53 double velc();
54 double probCalculate(double chi2, int n);
55 double pdfCalculate(double offset,double sigma);
56 double interpolation(double* x, double* y,double x1);
57 double pol2(double x,double* par);
58 double pol3(double x,double* par);
59 double pol4(double x,double* par);
60
61 public: // specific sub pid sys
62
63 int useDedx() const {return USE_DEDX;}
64 int useTof() const {return USE_TOF;}
65 int useTof1() const {return USE_TOF1;}
66 int useTof2() const {return USE_TOF2;}
67 int useTofE() const {return USE_TOFE;}
68 int useTofQ() const {return USE_TOFQ;}
69 int useTofC() const {return USE_TOFC;}
70 int useTofCorr() const {return USE_TOFCorr;}
71 int useEmc() const {return USE_EMC;}
72 int useMuc() const {return USE_MUC;}
73
74 public: // identify which kind of particles
75 int onlyPionKaon() const {return (IDENTIFY_PION | IDENTIFY_KAON);}
76 int onlyPionKaonProton() const {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
77 int onlyPionKaonElectron() const {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
78 int all() const {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
79 int onlyElectron() const {return IDENTIFY_ELECTRON;}
80 int onlyMuon() const {return IDENTIFY_MUON;}
81 int onlyPion() const {return IDENTIFY_PION;}
82 int onlyKaon() const {return IDENTIFY_KAON;}
83 int onlyProton() const {return IDENTIFY_PROTON;}
84
85 public: // Particle ID method
86 int methodLikelihood() const {return LIKELIHOOD_PID;}
87 int methodProbability() const {return PROBABILITY_PID;}
88 int methodNeuronNetwork() const {return NEURONNETWORK_PID;}
89 public: //
90 int dedxValid() const {return DEDX_VALID;}
91 int tofValid() const {return TOF_VALID;}
92 int tofeValid() const {return TOFE_VALID;}
93 int tofqValid() const {return TOFQ_VALID;}
94 int tofcValid() const {return TOFC_VALID;}
95 int tofcorrValid() const {return TOFCorr_VALID;}
96 int emcValid() const {return EMC_VALID;}
97 int mucValid() const {return MUC_VALID;}
98
99 protected:
100 // path to dir with calibration/configuration/etc data
101 static std::string path;
102 public:
103 void set_path(const char* s_path = 0);
104
105 protected:
106 // PID calculation routines(include PID correction)
107 virtual int particleIDCalculation() = 0;
108// virtual int neuronPIDCalculation() = 0;
109 //huangb add
110 virtual int LikelihoodCalculation() =0;
111
112 private:
113 EvtRecTrack* m_trk;
114 double m_runno;
115 double m_chimin_cut;
116 double m_pdfsigmamin_cut; //the cut is multiple of the sigma. ie. if(m_pdfsigmamin_cut ==3), the cut is 3sigma
117 static const int USE_DEDX;
118 static const int USE_TOF1;
119 static const int USE_TOF2;
120 static const int USE_TOF;
121 static const int USE_TOFE;
122 static const int USE_TOFQ;
123 static const int USE_TOFC;
124 static const int USE_TOFCorr;
125 static const int USE_EMC;
126 static const int USE_MUC;
127
128 static const int IDENTIFY_ELECTRON;
129 static const int IDENTIFY_MUON;
130 static const int IDENTIFY_PION;
131 static const int IDENTIFY_KAON;
132 static const int IDENTIFY_PROTON;
133
134 static const int PROBABILITY_PID;
135 static const int LIKELIHOOD_PID;
136 static const int NEURONNETWORK_PID;
137
138 static const int DEDX_VALID;
139 static const int TOF_VALID;
140 static const int TOF1_VALID;
141 static const int TOF2_VALID;
142 static const int TOFE_VALID;
143 static const int TOFQ_VALID;
144 static const int TOFC_VALID;
145 static const int TOFCorr_VALID;
146 static const int EMC_VALID;
147 static const int MUC_VALID;
148};
149
150#endif
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 getRunNo() const
virtual double chi(int n) const =0
int useTof() const
int useTofQ() const
double pol4(double x, double *par)
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
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)