14TofPID * TofPID::m_pointer = 0;
16 if(!m_pointer) m_pointer =
new TofPID();
25 for(
int i = 0; i < 5; i++) {
36double TofPID :: chilayer1(
int n)
const {
38 if(val_tof1) chi = m_tof1pid->chi(n);
42double TofPID :: chilayer2(
int n)
const {
44 if(val_tof2) chi = m_tof2pid->chi(n);
73 for(
int i=0; i<5; i++) {
74 double t_tof1 = m_tof1pid->
offset(i);
75 double t_tof2 = m_tof2pid->
offset(i);
76 double m_sigma1 = m_tof1pid->
sigma(i);
77 double m_sigma2 = m_tof2pid->
sigma(i);
79 if(val_tof1==1&&val_tof2==1) {
80 weight1 = (m_sigma2*m_sigma2-0.041*0.041)/(m_sigma1*m_sigma1+m_sigma2*m_sigma2-2*0.041*0.041);
81 weight2 = (m_sigma1*m_sigma1-0.041*0.041)/(m_sigma1*m_sigma1+m_sigma2*m_sigma2-2*0.041*0.041);
82 m_sigma[i] = sqrt((m_sigma1*m_sigma1*m_sigma2*m_sigma2 - 0.041*0.041*0.041*0.041)/(m_sigma1*m_sigma1+m_sigma2*m_sigma2-2*0.041*0.041));
83 m_offset[i] = weight1*t_tof1+weight2*t_tof2;
84 m_chi[i] = m_offset[i]/m_sigma[i];
86 if(val_tof1==1&&val_tof2==0) {
89 m_sigma[i] = m_tof1pid->
sigma(i);
91 m_chi[i] = m_tof1pid->
chi(i);
94 if(val_tof1==0&&val_tof2==1) {
97 m_sigma[i] = m_tof2pid->
sigma(i);
99 m_chi[i] = m_tof2pid->
chi(i);
102 if(val_tof1==0&&val_tof2==0)
return irc;
103 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
105 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
112 for(
int i = 0; i < 5; i++)
void setPdfMinSigmaCut(const double pdf=4)
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
double pdfMinSigmaCut() const
void setChiMinCut(const double chi=4)
void setRecTrack(EvtRecTrack *trk)
double sigma(int n) const
bool IsPidInfoValid() const
static Tof1PID * instance()
double offset(int n) const
double offset(int n) const
static Tof2PID * instance()
double sigma(int n) const
bool IsPidInfoValid() const
int particleIDCalculation()
static TofPID * instance()