54 {
55 int irc=-1;
71 double chitemp = 99.;
72 double pdftemp = 0;
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);
78
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];
85 }
86 if(val_tof1==1&&val_tof2==0) {
87 weight1=1;
88 weight2=0;
89 m_sigma[i] = m_tof1pid->
sigma(i);
90 m_offset[i] = t_tof1;
91 m_chi[i] = m_tof1pid->
chi(i);
92 }
93
94 if(val_tof1==0&&val_tof2==1) {
95 weight1=0;
96 weight2=1;
97 m_sigma[i] = m_tof2pid->
sigma(i);
98 m_offset[i] = t_tof2;
99 m_chi[i] = m_tof2pid->
chi(i);
100 }
101
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);
106 }
107
108 m_chimin = chitemp;
109 m_pdfmin = pdftemp;
112 for(int i = 0; i < 5; i++)
114 irc = 0;
115 return irc;
116}
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