#include <TofCPID.h>
Inheritance diagram for TofCPID:
Public Member Functions | |
int | all () const |
int | all () const |
void | calculate () |
void | calculate () |
double | charge () |
double | charge () |
double | chi (int n) const |
double | chi (int n) const |
double | chiMinCut () const |
double | chiMinCut () const |
int | dedxValid () const |
int | dedxValid () const |
int | emcValid () const |
int | emcValid () const |
double | getRunNo () const |
double | getRunNo () const |
void | init () |
void | init () |
double | interpolation (double *x, double *y, double x1) |
double | interpolation (double *x, double *y, double x1) |
bool | IsPidInfoValid () const |
bool | IsPidInfoValid () const |
double | mass2 () const |
double | mass2 () const |
int | methodLikelihood () const |
int | methodLikelihood () const |
int | methodNeuronNetwork () const |
int | methodNeuronNetwork () const |
int | methodProbability () const |
int | methodProbability () const |
int | mucValid () const |
int | mucValid () const |
int | ndof () const |
int | ndof () const |
int | neuronPID () const |
int | neuronPID () const |
double | offset (int n) const |
double | offset (int n) const |
int | onlyElectron () const |
int | onlyElectron () const |
int | onlyKaon () const |
int | onlyKaon () const |
int | onlyMuon () const |
int | onlyMuon () const |
int | onlyPion () const |
int | onlyPion () const |
int | onlyPionKaon () const |
int | onlyPionKaon () const |
int | onlyPionKaonElectron () const |
int | onlyPionKaonElectron () const |
int | onlyPionKaonProton () const |
int | onlyPionKaonProton () const |
int | onlyProton () const |
int | onlyProton () const |
double | p () |
double | p () |
double | pathc () const |
double | pathc () const |
double | pdfCalculate (double offset, double sigma) |
double | pdfCalculate (double offset, double sigma) |
double | pdfMinSigmaCut () const |
double | pdfMinSigmaCut () const |
double | phc () const |
double | phc () const |
EvtRecTrack * | PidTrk () const |
EvtRecTrack * | PidTrk () const |
double | pol2 (double x, double *par) |
double | pol2 (double x, double *par) |
double | pol3 (double x, double *par) |
double | pol3 (double x, double *par) |
double | pol4 (double x, double *par) |
double | pol4 (double x, double *par) |
double | prob (int n) const |
double | prob (int n) const |
double | probCalculate (double chi2, int n) |
double | probCalculate (double chi2, int n) |
double | pt () |
double | pt () |
void | setChiMinCut (const double chi=4) |
void | setChiMinCut (const double chi=4) |
void | setPdfMinSigmaCut (const double pdf=4) |
void | setPdfMinSigmaCut (const double pdf=4) |
void | setRecTrack (EvtRecTrack *trk) |
void | setRecTrack (EvtRecTrack *trk) |
void | setRunNo (const double runh=8093) |
void | setRunNo (const double runh=8093) |
double | sigma (int n) const |
double | sigma (int n) const |
double | tofc () const |
double | tofc () const |
int | tofcValid () const |
int | tofcValid () const |
int | tofeValid () const |
int | tofeValid () const |
int | tofqValid () const |
int | tofqValid () const |
int | tofValid () const |
int | tofValid () const |
int | useDedx () const |
int | useDedx () const |
int | useEmc () const |
int | useEmc () const |
int | useMuc () const |
int | useMuc () const |
int | useTof () const |
int | useTof () const |
int | useTof1 () const |
int | useTof1 () const |
int | useTof2 () const |
int | useTof2 () const |
int | useTofC () const |
int | useTofC () const |
int | useTofE () const |
int | useTofE () const |
int | useTofQ () const |
int | useTofQ () const |
double | velc () |
double | velc () |
double | xmass (int n) |
double | xmass (int n) |
double | zhitc () const |
double | zhitc () const |
~TofCPID () | |
~TofCPID () | |
Static Public Member Functions | |
TofCPID * | instance () |
TofCPID * | instance () |
Protected Member Functions | |
int | LikelihoodCalculation () |
int | LikelihoodCalculation () |
double | mypol3 (double x, double par0, double par1, double par2, double par3) |
double | mypol3 (double x, double par0, double par1, double par2, double par3) |
double | mypol5 (double x, double par0, double par1, double par2, double par3, double par4, double par5) |
double | mypol5 (double x, double par0, double par1, double par2, double par3, double par4, double par5) |
int | neuronPIDCalculation () |
int | neuronPIDCalculation () |
double | offsetTofC (int n, double ptrk, double cost) |
double | offsetTofC (int n, double ptrk, double cost) |
int | particleIDCalculation () |
int | particleIDCalculation () |
double | sampleQ0 (double betagamma, double beta) |
double | sampleQ0 (double betagamma, double beta) |
double | sigmaTofC (int n, double ptrk, double cost) |
double | sigmaTofC (int n, double ptrk, double cost) |
Private Member Functions | |
TofCPID () | |
TofCPID () | |
Private Attributes | |
double | m_chi [5] |
double | m_chimin |
double | m_endcappara [5][4] |
double | m_mass2 |
double | m_momentpara [5][12] |
int | m_ndof |
double | m_offset [5] |
double | m_pars [15] |
double | m_pathc |
double | m_pdfmin |
double | m_phc |
double | m_prob [5] |
int | m_readstate |
double | m_sigma [5] |
double | m_thetapara [5][8] |
double | m_tofc |
double | m_zhitc |
Static Private Attributes | |
TofCPID * | m_pointer |
TofCPID * | m_pointer = 0 |
|
00018 {;}
|
|
00015 :ParticleIDBase(){ 00016 m_pars[0]= -0.208289; 00017 m_pars[1]= 1.63092; 00018 m_pars[2]= -0.0733139; 00019 m_pars[3]= 1.02385; 00020 m_pars[4]= 0.00145052; 00021 m_pars[5]= -1.72471e-06; 00022 m_pars[6]= 5.92726e-10; 00023 m_pars[7]= -0.0645428; 00024 m_pars[8]= -0.00143637; 00025 m_pars[9]= -0.133817; 00026 m_pars[10]= 0.0101188; 00027 m_pars[11]= -5.07622; 00028 m_pars[12]= 5.31472; 00029 m_pars[13]= -0.443142; 00030 m_pars[14]= -12.1083; 00031 m_readstate=0; 00032 }
|
|
00018 {;}
|
|
|
|
00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00091 {return (IDENTIFY_ELECTRON | IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00046 { 00047 int runtof = getRunNo(); 00048 if(!m_readstate){ 00049 std::cout<<"read tofC"<<std::endl; 00050 std::string tofdata_mom_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofpdata.txt"; 00051 ifstream inputmomdata(tofdata_mom_file.c_str(),std::ios_base::in); 00052 00053 std::string tofdata_theta_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofthetadata.txt"; 00054 ifstream inputthetadata(tofdata_theta_file.c_str(),std::ios_base::in); 00055 00056 std::string tofdata_endcap_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofendcapdata.txt"; 00057 ifstream inputendcapdata(tofdata_endcap_file.c_str(),std::ios_base::in); 00058 00059 00060 std::string tofmc_mom_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofpmc.txt"; 00061 ifstream inputmommc(tofmc_mom_file.c_str(),std::ios_base::in); 00062 00063 std::string tofmc_theta_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofthetamc.txt"; 00064 ifstream inputthetamc(tofmc_theta_file.c_str(),std::ios_base::in); 00065 00066 std::string tofmc_endcap_file =string(getenv("PARTICLEIDROOT"))+ "/share/pidparatof/tofendcapmc.txt"; 00067 ifstream inputendcapmc(tofmc_endcap_file.c_str(),std::ios_base::in); 00068 00069 00070 if(runtof>0) 00071 { 00072 for(int i=0; i<5; i++) 00073 { 00074 for(int j=0; j<8; j++) 00075 { 00076 inputthetadata>>m_thetapara[i][j]; 00077 } 00078 } 00079 00080 for(int i=0; i<5; i++) 00081 { 00082 for(int j=0; j<12; j++) 00083 { 00084 inputmomdata>>m_momentpara[i][j]; 00085 } 00086 } 00087 00088 for(int i=0; i<5; i++) 00089 { 00090 for(int j=0; j<4; j++) 00091 { 00092 inputendcapdata>>m_endcappara[i][j]; 00093 } 00094 } 00095 00096 }else 00097 { 00098 for(int i=0; i<5; i++) 00099 { 00100 for(int j=0; j<8; j++) 00101 { 00102 inputthetamc>>m_thetapara[i][j]; 00103 } 00104 } 00105 00106 for(int i=0; i<5; i++) 00107 { 00108 for(int j=0; j<12; j++) 00109 { 00110 inputmommc>>m_momentpara[i][j]; 00111 } 00112 } 00113 00114 for(int i=0; i<5; i++) 00115 { 00116 for(int j=0; j<4; j++) 00117 { 00118 inputendcapmc>>m_endcappara[i][j]; 00119 } 00120 } 00121 00122 } 00123 m_readstate=1; 00124 } 00125 if(particleIDCalculation() == 0) m_ndof=1; 00126 }
|
|
|
|
00077 { 00078 double val = 999; 00079 if(!m_trk) return val; 00080 if(!m_trk->isMdcTrackValid()) return val; 00081 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00082 val = mdcTrk->charge() + 0.0; 00083 }
|
|
Implements ParticleIDBase. 00023 {return m_chi[n];}
|
|
Implements ParticleIDBase. 00023 {return m_chi[n];}
|
|
00052 {return m_chimin_cut;}
|
|
00052 {return m_chimin_cut;}
|
|
00103 {return DEDX_VALID;}
|
|
00103 {return DEDX_VALID;}
|
|
00108 {return EMC_VALID;}
|
|
00108 {return EMC_VALID;}
|
|
00056 {return m_runno;}
|
|
00056 {return m_runno;}
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00034 { 00035 for(int i = 0; i < 5; i++) { 00036 m_chi[i] = 99.0; 00037 m_prob[i] = -1.0; 00038 m_offset[i] = 99.0; 00039 m_sigma[i] = 1.0; 00040 } 00041 m_chimin = 99.; 00042 m_pdfmin =99; 00043 m_ndof = 0; 00044 }
|
|
|
|
|
|
|
|
00085 { 00086 double c1 = (y[0]-y[1])*(x[1]-x[2])-(x[0]-x[1])*(y[1]-y[2]); 00087 double c2 = (x[0]*x[0]-x[1]*x[1])*(x[1]-x[2])-(x[1]*x[1]-x[2]*x[2])*(x[0]-x[1]); 00088 double c = c1/c2; 00089 double b1 = (y[0]-y[1])*(x[1]*x[1]-x[2]*x[2])-(x[0]*x[0]-x[1]*x[1])*(y[1]-y[2]); 00090 double b2 = (x[0]-x[1])*(x[1]*x[1]-x[2]*x[2])-(x[1]-x[2])*(x[0]*x[0]-x[1]*x[1]); 00091 double b = b1/b2; 00092 double a = y[0] - b*x[0]-c*x[0]*x[0]; 00093 double y1 = a + b*x1 +c*x1*x1; 00094 return y1; 00095 }
|
|
Implements ParticleIDBase. 00022 {return (m_ndof > 0); }
|
|
Implements ParticleIDBase. 00022 {return (m_ndof > 0); }
|
|
Implements ParticleIDBase. 00040 {return -1;}
|
|
Implements ParticleIDBase. 00040 {return -1;}
|
|
00028 {return m_mass2;}
|
|
00028 {return m_mass2;}
|
|
00099 {return LIKELIHOOD_PID;}
|
|
00099 {return LIKELIHOOD_PID;}
|
|
00101 {return NEURONNETWORK_PID;}
|
|
00101 {return NEURONNETWORK_PID;}
|
|
00100 {return PROBABILITY_PID;}
|
|
00100 {return PROBABILITY_PID;}
|
|
00109 {return MUC_VALID;}
|
|
00109 {return MUC_VALID;}
|
|
|
|
00562 { 00563 double y = x; 00564 return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y); 00565 00566 }
|
|
|
|
00569 { 00570 double y = x; 00571 return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y) + (par4 * y * y * y *y)+ (par5 * y * y * y * y * y); 00572 00573 }
|
|
Implements ParticleIDBase. 00027 {return m_ndof;}
|
|
Implements ParticleIDBase. 00027 {return m_ndof;}
|
|
00033 {return -1;}
|
|
00033 {return -1;}
|
|
00038 { return -1;}
|
|
00038 { return -1;}
|
|
00026 {return m_offset[n];}
|
|
00026 {return m_offset[n];}
|
|
|
|
00222 { 00223 int rundedx2 = getRunNo(); 00224 double offset = 0.0; 00225 double offsetp = 0.0; 00226 double offsetc = 0.0; 00227 double sigcos = 0.0; 00228 double sigp = 0.0; 00229 double gb = ptrk/xmass(n); 00230 00231 switch(n) { 00232 case 0: { // Electron 00233 double ptemp = ptrk; 00234 double costm = cost; 00235 00236 if(rundedx2>0) 00237 { if(ptrk < 0.3) ptemp = 0.3; 00238 if(ptrk > 1.3) ptemp = 1.3; 00239 } 00240 else 00241 { if(ptrk < 0.3) ptemp = 0.3; 00242 if(ptrk > 1.3) ptemp = 1.3; 00243 } 00244 00245 double plog = log(ptemp); 00246 double costcos = cos(costm); 00247 offsetp= mypol5(plog,m_momentpara[0][0],m_momentpara[0][1],m_momentpara[0][2],m_momentpara[0][3],m_momentpara[0][4],m_momentpara[0][5]); 00248 sigp=mypol5(plog,m_momentpara[0][6],m_momentpara[0][7],m_momentpara[0][8],m_momentpara[0][9],m_momentpara[0][10],m_momentpara[0][11]); 00249 00250 if(costm<-0.83) {offsetc=m_endcappara[0][0]; sigcos=m_endcappara[0][2];} 00251 if(costm>0.83) {offsetc=m_endcappara[0][1]; sigcos=m_endcappara[0][3];} 00252 if(fabs(costm)<=0.83) 00253 { 00254 offsetc=mypol3(costcos,m_thetapara[0][0],m_thetapara[0][1],m_thetapara[0][2],m_thetapara[0][3]); 00255 sigcos=mypol3(costcos,m_thetapara[0][4],m_thetapara[0][5],m_thetapara[0][6],m_thetapara[0][7]); 00256 } 00257 00258 00259 offset=offsetc+sigcos*offsetp; 00260 //offset=offsetc; 00261 offset=offsetp+sigp*offsetc; 00262 break; 00263 } 00264 00265 case 1: {// Muon 00266 double ptemp = ptrk; 00267 double costm = cost; 00268 if(rundedx2>0) 00269 { if(ptrk < 0.3) ptemp = 0.3; 00270 if(ptrk > 1.3) ptemp = 1.3; 00271 } 00272 else 00273 { if(ptrk < 0.3) ptemp = 0.3; 00274 if(ptrk > 1.3) ptemp = 1.3; 00275 } 00276 00277 double plog = log(ptemp); 00278 double costcos = cos(costm); 00279 offsetp= mypol5(plog,m_momentpara[1][0],m_momentpara[1][1],m_momentpara[1][2],m_momentpara[1][3],m_momentpara[1][4],m_momentpara[1][5]); 00280 sigp=mypol5(plog,m_momentpara[1][6],m_momentpara[1][7],m_momentpara[1][8],m_momentpara[1][9],m_momentpara[1][10],m_momentpara[1][11]); 00281 00282 if(costm<-0.83) {offsetc=m_endcappara[1][0]; sigcos=m_endcappara[1][2];} 00283 if(costm>0.83) {offsetc=m_endcappara[1][1]; sigcos=m_endcappara[1][3];} 00284 if(fabs(costm)<=0.83) 00285 { 00286 offsetc=mypol3(costcos,m_thetapara[1][0],m_thetapara[1][1],m_thetapara[1][2],m_thetapara[1][3]); 00287 sigcos=mypol3(costcos,m_thetapara[1][4],m_thetapara[1][5],m_thetapara[1][6],m_thetapara[1][7]); 00288 } 00289 00290 00291 offset=offsetc+sigcos*offsetp; 00292 //offset=offsetc; 00293 offset=offsetp+sigp*offsetc; 00294 break; 00295 } 00296 00297 case 2: {// Pion 00298 double ptemp = ptrk; 00299 double costm = cost; 00300 if(rundedx2>0) 00301 { if(ptrk < 0.3) ptemp = 0.3; 00302 if(ptrk > 1.6) ptemp = 1.6; 00303 } 00304 else 00305 { if(ptrk < 0.3) ptemp = 0.3; 00306 if(ptrk > 1.6) ptemp = 1.6; 00307 } 00308 00309 double plog = log(ptemp); 00310 double costcos = cos(costm); 00311 offsetp= mypol5(plog,m_momentpara[2][0],m_momentpara[2][1],m_momentpara[2][2],m_momentpara[2][3],m_momentpara[2][4],m_momentpara[2][5]); 00312 sigp=mypol5(plog,m_momentpara[2][6],m_momentpara[2][7],m_momentpara[2][8],m_momentpara[2][9],m_momentpara[2][10],m_momentpara[2][11]); 00313 00314 if(costm<-0.83) {offsetc=m_endcappara[2][0]; sigcos=m_endcappara[2][2];} 00315 if(costm>0.83) {offsetc=m_endcappara[2][1]; sigcos=m_endcappara[2][3];} 00316 if(fabs(costm)<=0.83) 00317 { 00318 offsetc=mypol3(costcos,m_thetapara[2][0],m_thetapara[2][1],m_thetapara[2][2],m_thetapara[2][3]); 00319 sigcos=mypol3(costcos,m_thetapara[2][4],m_thetapara[2][5],m_thetapara[2][6],m_thetapara[2][7]); 00320 } 00321 00322 00323 offset=offsetc+sigcos*offsetp; 00324 //offset=offsetc; 00325 offset=offsetp+sigp*offsetc; 00326 break; 00327 } 00328 00329 case 3: {// Kaon 00330 double ptemp = ptrk; 00331 double costm = cost; 00332 if(rundedx2>0) 00333 { if(ptrk < 0.4) ptemp = 0.4; 00334 if(ptrk > 1.3) ptemp = 1.3; 00335 } 00336 else 00337 { if(ptrk < 0.4) ptemp = 0.4; 00338 if(ptrk > 1.3) ptemp = 1.3; 00339 } 00340 double plog = log(ptemp); 00341 double costcos = cos(costm); 00342 offsetp= mypol5(plog,m_momentpara[3][0],m_momentpara[3][1],m_momentpara[3][2],m_momentpara[3][3],m_momentpara[3][4],m_momentpara[3][5]); 00343 sigp=mypol5(plog,m_momentpara[3][6],m_momentpara[3][7],m_momentpara[3][8],m_momentpara[3][9],m_momentpara[3][10],m_momentpara[3][11]); 00344 00345 if(costm<-0.83) {offsetc=m_endcappara[3][0]; sigcos=m_endcappara[3][2];} 00346 if(costm>0.83) {offsetc=m_endcappara[3][1]; sigcos=m_endcappara[3][3];} 00347 if(fabs(costm)<=0.83) 00348 { 00349 offsetc=mypol3(costcos,m_thetapara[3][0],m_thetapara[3][1],m_thetapara[3][2],m_thetapara[3][3]); 00350 sigcos=mypol3(costcos,m_thetapara[3][4],m_thetapara[3][5],m_thetapara[3][6],m_thetapara[3][7]); 00351 } 00352 00353 00354 offset=offsetc+sigcos*offsetp; 00355 //offset=offsetc; 00356 offset=offsetp+sigp*offsetc; 00357 break; 00358 } 00359 00360 case 4 : { // Proton 00361 double ptemp = ptrk; 00362 double costm = cost; 00363 if(rundedx2>0) 00364 { if(ptrk < 0.5) ptemp = 0.5; 00365 if(ptrk > 1.3) ptemp = 1.3; 00366 } 00367 else 00368 { if(ptrk < 0.5) ptemp = 0.5; 00369 if(ptrk > 1.3) ptemp = 1.3; 00370 } 00371 double plog = log(ptemp); 00372 double costcos = cos(costm); 00373 offsetp= mypol5(plog,m_momentpara[4][0],m_momentpara[4][1],m_momentpara[4][2],m_momentpara[4][3],m_momentpara[4][4],m_momentpara[4][5]); 00374 sigp=mypol5(plog,m_momentpara[4][6],m_momentpara[4][7],m_momentpara[4][8],m_momentpara[4][9],m_momentpara[4][10],m_momentpara[4][11]); 00375 00376 if(costm<-0.83) {offsetc=m_endcappara[4][0]; sigcos=m_endcappara[4][2];} 00377 if(costm>0.83) {offsetc=m_endcappara[4][1]; sigcos=m_endcappara[4][3];} 00378 if(fabs(costm)<=0.83) 00379 { 00380 offsetc=mypol3(costcos,m_thetapara[4][0],m_thetapara[4][1],m_thetapara[4][2],m_thetapara[4][3]); 00381 sigcos=mypol3(costcos,m_thetapara[4][4],m_thetapara[4][5],m_thetapara[4][6],m_thetapara[4][7]); 00382 } 00383 00384 offset=offsetc+sigcos*offsetp; 00385 //offset=offsetc; 00386 offset=offsetp+sigp*offsetc; 00387 break; 00388 } 00389 00390 default: 00391 offset = 0.0; 00392 break; 00393 } 00394 // offset = 0.0; 00395 return offset; 00396 }
|
|
00092 {return IDENTIFY_ELECTRON;}
|
|
00092 {return IDENTIFY_ELECTRON;}
|
|
00095 {return IDENTIFY_KAON;}
|
|
00095 {return IDENTIFY_KAON;}
|
|
00093 {return IDENTIFY_MUON;}
|
|
00093 {return IDENTIFY_MUON;}
|
|
00094 {return IDENTIFY_PION;}
|
|
00094 {return IDENTIFY_PION;}
|
|
00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}
|
|
00088 {return (IDENTIFY_PION | IDENTIFY_KAON);}
|
|
00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
|
|
00090 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_ELECTRON);}
|
|
00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00089 {return (IDENTIFY_PION | IDENTIFY_KAON | IDENTIFY_PROTON);}
|
|
00096 {return IDENTIFY_PROTON;}
|
|
00096 {return IDENTIFY_PROTON;}
|
|
|
|
00063 { 00064 double val = 999; 00065 if(!m_trk) return val; 00066 if(!m_trk->isMdcTrackValid()) return val; 00067 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00068 val = mdcTrk->p(); 00069 }
|
|
Implements ParticleIDBase. |
|
Implements ParticleIDBase. 00128 { 00129 /* 00130 cout<<"m_momentpara[2][2]="<<m_momentpara[2][2]<<endl; 00131 cout<<"m_momentpara[2][3]="<<m_momentpara[2][3]<<endl; 00132 cout<<"m_momentpara[3][2]="<<m_momentpara[3][2]<<endl; 00133 cout<<"m_momentpara[3][3]="<<m_momentpara[3][3]<<endl; 00134 cout<<"m_thetapara[2][2]="<<m_thetapara[2][2]<<endl; 00135 cout<<"m_thetapara[2][3]="<<m_thetapara[2][3]<<endl; 00136 cout<<"m_thetapara[3][2]="<<m_thetapara[3][2]<<endl; 00137 cout<<"m_thetapara[3][3]="<<m_thetapara[3][3]<<endl; 00138 cout<<"m_endcappara[2][2]="<<m_endcappara[2][2]<<endl; 00139 cout<<"m_endcappara[2][3]="<<m_endcappara[2][3]<<endl; 00140 cout<<"m_endcappara[3][2]="<<m_endcappara[3][2]<<endl; 00141 cout<<"m_endcappara[3][3]="<<m_endcappara[3][3]<<endl; 00142 */ 00143 int irc = -1; 00144 00145 EvtRecTrack* recTrk = PidTrk(); 00146 if(!(recTrk->isMdcTrackValid())) return irc; 00147 RecMdcTrack* mdcTrk = recTrk->mdcTrack(); 00148 double ptrk = mdcTrk->p(); 00149 double charge = mdcTrk->charge(); 00150 double cost = cos(mdcTrk->theta()); 00151 if(!(recTrk->isTofTrackValid())) return irc; 00152 SmartRefVector<RecTofTrack> tofTrk = recTrk->tofTrack(); 00153 SmartRefVector<RecTofTrack>::iterator it;//=tofTrk.begin(); 00154 TofHitStatus *hitst = new TofHitStatus; 00155 std::vector<int> tofccount; 00156 int goodtofctrk=0; 00157 for(it = tofTrk.begin();it!=tofTrk.end();it++,goodtofctrk++){ 00158 unsigned int st = (*it)->status(); 00159 hitst->setStatus(st); 00160 // if( !(hitst->is_barrel()) ) continue; 00161 // if( !(hitst->is_counter()) ) continue; 00162 // if( hitst->layer()==1 ) tofccount.push_back(goodtofctrk); 00163 if(hitst->is_cluster()) tofccount.push_back(goodtofctrk); 00164 } 00165 delete hitst; 00166 if(tofccount.size()!=1) return irc;//not tof2 track or more than 1 tracks 00167 it = tofTrk.begin()+tofccount[0]; 00168 double tof = (*it)->tof(); 00169 m_tofc = tof; 00170 int qual = (*it)->quality(); 00171 int cntr = (*it)->tofID(); 00172 double path = ((*it)->path())*10.0;//the unit from mm to cm 00173 m_pathc = path; 00174 m_phc = (*it)->ph(); //no change 00175 m_zhitc = ((*it)->zrhit())*10;//the unit from mm to cm 00176 double beta2 = path*path/velc()/velc()/tof/tof; 00177 m_mass2 = ptrk * ptrk * (1/beta2 -1); 00178 if ((m_mass2>20)||(m_mass2<-1)) return irc; 00179 if(tof <=0 ) return irc; 00180 double chitemp = 99.; 00181 double pdftemp = 0; 00182 double sigma_tmp= (*it)->sigma(0); 00183 double testchi[5]; 00184 double testpdf[5]; 00185 for(int i = 0; i < 5; i++) { 00186 /* 00187 m_offset[i] = tof - (*it)->texp(i);//- offsetTofC(i, cntr, ptrk, m_zhit1, m_ph1,charge); 00188 if(sigma_tmp!=0) m_sigma[i] = 1.1*sigma_tmp/1000.; 00189 else 00190 m_sigma[i]=sigmaTofC(i, cntr,ptrk,m_zhitc, m_phc,charge); 00191 m_chi[i] = m_offset[i]/m_sigma[i]; 00192 */ 00193 double sep = tof - (*it)->texp(i)-(*it)->toffset(i); 00194 m_chi[i] = (sep - offsetTofC(i, ptrk, cost))/sigmaTofC(i, ptrk, cost); 00195 m_offset[i] = offsetTofC(i, ptrk, cost); 00196 m_sigma[i] = sigmaTofC(i, ptrk, cost); 00197 testchi[i]=sep; 00198 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]); 00199 double ppp = pdfCalculate(m_chi[i],1); 00200 testpdf[i]=ppp; 00201 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp); 00202 } 00203 m_chimin = chitemp; 00204 m_pdfmin = pdftemp; 00205 if(pdftemp < pdfCalculate(pdfMinSigmaCut(),1)) return irc; 00206 if(fabs(m_chimin) > chiMinCut()) return irc; 00207 for(int i = 0; i < 5; i++){ 00208 m_prob[i] = probCalculate(m_chi[i]*m_chi[i], 1); 00209 } 00210 00211 irc = 0; 00212 return irc; 00213 00214 00215 00216 }
|
|
00031 {return m_pathc;}
|
|
00031 {return m_pathc;}
|
|
|
|
00055 { 00056 const double pi = 3.141592653589793238; 00057 const double twoPi = 2*pi; 00058 double chi2 = -0.5*offset*offset/(sigma*sigma); 00059 double pdf = exp(chi2)/(sigma*sqrt(twoPi)); 00060 return pdf; 00061 }
|
|
00054 {return m_pdfsigmamin_cut;}
|
|
00054 {return m_pdfsigmamin_cut;}
|
|
00029 {return m_phc;}
|
|
00029 {return m_phc;}
|
|
00050 {return m_trk;}
|
|
00050 {return m_trk;}
|
|
|
|
00097 { 00098 double y=x; 00099 return par[0] + (par[1] * y) +(par[2] * y * y); 00100 }
|
|
|
|
00102 { 00103 double y=x; 00104 return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y); 00105 }
|
|
|
|
00107 { 00108 double y=x; 00109 return par[0] + (par[1] * y) +(par[2] * y * y)+(par[3] * y * y*y) + (par[4] * y * y*y*y); 00110 }
|
|
Implements ParticleIDBase. 00024 {return m_prob[n];}
|
|
Implements ParticleIDBase. 00024 {return m_prob[n];}
|
|
|
|
00047 { 00048 double p = -1.0; 00049 if(chi2 < 0) return p; 00050 p = TMath::Prob(chi2, ndof); 00051 return p; 00052 }
|
|
|
|
00070 { 00071 double val = 999; 00072 if(!m_trk) return val; 00073 if(!m_trk->isMdcTrackValid()) return val; 00074 RecMdcTrack *mdcTrk = m_trk->mdcTrack(); 00075 val = mdcTrk->pxy(); 00076 }
|
|
|
|
|
|
00053 {m_chimin_cut = chi;}
|
|
00053 {m_chimin_cut = chi;}
|
|
00055 {m_pdfsigmamin_cut= pdf;}
|
|
00055 {m_pdfsigmamin_cut= pdf;}
|
|
00051 {m_trk = trk;}
|
|
00051 {m_trk = trk;}
|
|
00057 {m_runno = runh;}
|
|
00057 {m_runno = runh;}
|
|
00025 {return m_sigma[n];}
|
|
00025 {return m_sigma[n];}
|
|
|
|
00400 { 00401 int rundedx3 = getRunNo(); 00402 double sigma = 1.0; 00403 double sigmap = 1.0; 00404 double sigmac = 1.0; 00405 double gb = ptrk/xmass(n); 00406 switch(n) { 00407 00408 case 0: {// Electron 00409 double ptemp = ptrk; 00410 double costm = cost; 00411 if(rundedx3>0) 00412 { if(ptrk < 0.3) ptemp = 0.3; 00413 if(ptrk > 1.3) ptemp = 1.3; 00414 } 00415 else 00416 { if(ptrk < 0.3) ptemp = 0.3; 00417 if(ptrk > 1.3) ptemp = 1.3; 00418 } 00419 00420 double plog = log(ptemp); 00421 double costcos = cos(costm); 00422 00423 sigmap=mypol5(plog,m_momentpara[0][6],m_momentpara[0][7],m_momentpara[0][8],m_momentpara[0][9],m_momentpara[0][10],m_momentpara[0][11]); 00424 00425 if(costm<-0.83) {sigmac=m_endcappara[0][2];} 00426 if(costm>0.83) {sigmac=m_endcappara[0][3];} 00427 if(fabs(costm)<0.83) 00428 { 00429 sigmac=mypol3(costcos,m_thetapara[0][4],m_thetapara[0][5],m_thetapara[0][6],m_thetapara[0][7]); 00430 } 00431 00432 sigma=sigmap*sigmac; 00433 //sigma=sigmac; 00434 break; 00435 } 00436 00437 case 1: {// Muon 00438 double ptemp = ptrk; 00439 double costm = cost; 00440 if(rundedx3>0) 00441 { if(ptrk < 0.3) ptemp = 0.3; 00442 if(ptrk > 1.3) ptemp = 1.3; 00443 } 00444 else 00445 { if(ptrk < 0.3) ptemp = 0.3; 00446 if(ptrk > 1.3) ptemp = 1.3; 00447 } 00448 00449 double plog = log(ptemp); 00450 double costcos = cos(costm); 00451 00452 sigmap=mypol5(plog,m_momentpara[1][6],m_momentpara[1][7],m_momentpara[1][8],m_momentpara[1][9],m_momentpara[1][10],m_momentpara[1][11]); 00453 00454 if(costm<-0.83) {sigmac=m_endcappara[1][2];} 00455 if(costm>0.83) {sigmac=m_endcappara[1][3];} 00456 if(fabs(costm)<0.83) 00457 { 00458 sigmac=mypol3(costcos,m_thetapara[1][4],m_thetapara[1][5],m_thetapara[1][6],m_thetapara[1][7]); 00459 } 00460 00461 00462 sigma=sigmap*sigmac; 00463 //sigma=sigmac; 00464 break; 00465 } 00466 00467 case 2: {// Pion 00468 double ptemp = ptrk; 00469 double costm = cost; 00470 if(rundedx3>0) 00471 { if(ptrk < 0.3) ptemp = 0.3; 00472 if(ptrk > 1.6) ptemp = 1.6; 00473 } 00474 else 00475 { if(ptrk < 0.3) ptemp = 0.3; 00476 if(ptrk > 1.6) ptemp = 1.6; 00477 } 00478 00479 double plog = log(ptemp); 00480 double costcos = cos(costm); 00481 sigmap=mypol5(plog,m_momentpara[2][6],m_momentpara[2][7],m_momentpara[2][8],m_momentpara[2][9],m_momentpara[2][10],m_momentpara[2][11]); 00482 00483 if(costm<-0.83) {sigmac=m_endcappara[2][2];} 00484 if(costm>0.83) {sigmac=m_endcappara[2][3];} 00485 if(fabs(costm)<0.83) 00486 { 00487 sigmac=mypol3(costcos,m_thetapara[2][4],m_thetapara[2][5],m_thetapara[2][6],m_thetapara[2][7]); 00488 } 00489 00490 sigma=sigmap*sigmac; 00491 //sigma=sigmac; 00492 00493 break; 00494 } 00495 00496 case 3: { // Kaon 00497 double ptemp = ptrk; 00498 double costm = cost; 00499 00500 if(rundedx3>0) 00501 { if(ptrk < 0.4) ptemp = 0.4; 00502 if(ptrk > 1.3) ptemp = 1.3; 00503 } 00504 else 00505 { if(ptrk < 0.4) ptemp = 0.4; 00506 if(ptrk > 1.3) ptemp = 1.3; 00507 } 00508 double plog = log(ptemp); 00509 double costcos = cos(costm); 00510 sigmap=mypol5(plog,m_momentpara[3][6],m_momentpara[3][7],m_momentpara[3][8],m_momentpara[3][9],m_momentpara[3][10],m_momentpara[3][11]); 00511 00512 if(costm<-0.83) {sigmac=m_endcappara[3][2];} 00513 if(costm>0.83) {sigmac=m_endcappara[3][3];} 00514 if(fabs(costm)<0.83) 00515 { 00516 sigmac=mypol3(costcos,m_thetapara[3][4],m_thetapara[3][5],m_thetapara[3][6],m_thetapara[3][7]); 00517 } 00518 00519 sigma=sigmap*sigmac; 00520 //sigma=sigmac; 00521 break; 00522 } 00523 00524 00525 case 4: {// Proton 00526 double ptemp = ptrk; 00527 double costm = cost; 00528 if(rundedx3>0) 00529 { if(ptrk < 0.5) ptemp = 0.5; 00530 if(ptrk > 1.3) ptemp = 1.3; 00531 } 00532 else 00533 { if(ptrk < 0.5) ptemp = 0.5; 00534 if(ptrk > 1.3) ptemp = 1.3; 00535 } 00536 double plog = log(ptemp); 00537 double costcos = cos(costm); 00538 sigmap=mypol5(plog,m_momentpara[4][6],m_momentpara[4][7],m_momentpara[4][8],m_momentpara[4][9],m_momentpara[4][10],m_momentpara[4][11]); 00539 00540 if(costm<-0.83) {sigmac=m_endcappara[4][2];} 00541 if(costm>0.83) {sigmac=m_endcappara[4][3];} 00542 if(fabs(costm)<0.83) 00543 { 00544 sigmac=mypol3(costcos,m_thetapara[4][4],m_thetapara[4][5],m_thetapara[4][6],m_thetapara[4][7]); 00545 } 00546 00547 sigma=sigmap*sigmac; 00548 //sigma=sigmac; 00549 break; 00550 } 00551 00552 default: 00553 sigma = 1.0; 00554 break; 00555 } 00556 00557 // sigma =1.0; 00558 return sigma; 00559 }
|
|
00032 {return m_tofc;}
|
|
00032 {return m_tofc;}
|
|
00107 {return TOFC_VALID;}
|
|
00107 {return TOFC_VALID;}
|
|
00105 {return TOFE_VALID;}
|
|
00105 {return TOFE_VALID;}
|
|
00106 {return TOFQ_VALID;}
|
|
00106 {return TOFQ_VALID;}
|
|
00104 {return TOF_VALID;}
|
|
00104 {return TOF_VALID;}
|
|
00077 {return USE_DEDX;}
|
|
00077 {return USE_DEDX;}
|
|
00084 {return USE_EMC;}
|
|
00084 {return USE_EMC;}
|
|
00085 {return USE_MUC;}
|
|
00085 {return USE_MUC;}
|
|
00078 {return USE_TOF;}
|
|
00078 {return USE_TOF;}
|
|
00079 {return USE_TOF1;}
|
|
00079 {return USE_TOF1;}
|
|
00080 {return USE_TOF2;}
|
|
00080 {return USE_TOF2;}
|
|
00083 {return USE_TOFC;}
|
|
00083 {return USE_TOFC;}
|
|
00081 {return USE_TOFE;}
|
|
00081 {return USE_TOFE;}
|
|
00082 {return USE_TOFQ;}
|
|
00082 {return USE_TOFQ;}
|
|
|
|
00041 { 00042 // double vel = 29.9792458; // tof_path unit in cm. 00043 double vel = 299.792458; // tof path unit in mm 00044 return vel; 00045 }
|
|
|
|
00035 { 00036 double mass[5] = {0.000511, 0.105658, 0.139570,0.493677, 0.938272}; 00037 if(n < 0 || n >=5) return 0.0; 00038 return mass[n]; 00039 }
|
|
00030 {return m_zhitc;}
|
|
00030 {return m_zhitc;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|