BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/ParticleID/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
21class ParticleIDBase {
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
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
double xmass(int n)
double charge()
virtual void calculate()=0
virtual bool IsPidInfoValid() const =0
virtual double prob(int n) const =0
void set_path(const char *s_path=0)
double y[1000]