CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Analysis/ParticleID/ParticleID-00-04-55/ParticleID/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
16#include "EvtRecEvent/EvtRecTrack.h"
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 int useMrpc() const {return USE_MRPC;}
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 int MrpcValid() const {return MRPC_VALID;}
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;
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 static const int USE_MRPC;
130
131 static const int IDENTIFY_ELECTRON;
132 static const int IDENTIFY_MUON;
133 static const int IDENTIFY_PION;
134 static const int IDENTIFY_KAON;
135 static const int IDENTIFY_PROTON;
136
137 static const int PROBABILITY_PID;
138 static const int LIKELIHOOD_PID;
139 static const int NEURONNETWORK_PID;
140
141 static const int DEDX_VALID;
142 static const int TOF_VALID;
143 static const int TOF1_VALID;
144 static const int TOF2_VALID;
145 static const int TOFE_VALID;
146 static const int TOFQ_VALID;
147 static const int TOFC_VALID;
148 static const int TOFCorr_VALID;
149 static const int EMC_VALID;
150 static const int MUC_VALID;
151 static const int MRPC_VALID;
152};
153
154#endif
const Int_t n
const double xmass[5]
Definition: Gam4pikp.cxx:50
double pol2(double x, double *par)
virtual int ndof() const =0
double interpolation(double *x, double *y, double x1)
virtual void init()=0
double probCalculate(double chi2, int n)
virtual double chi(int n) const =0
double pol4(double x, double *par)
double pol3(double x, double *par)
double pdfCalculate(double offset, double sigma)
virtual int LikelihoodCalculation()=0
virtual int particleIDCalculation()=0
virtual void calculate()=0
virtual bool IsPidInfoValid() const =0
virtual double prob(int n) const =0
void set_path(const char *s_path=0)