11#include "DstEvtRecTracks.h"
14DedxPID * DedxPID::m_pointer = 0;
17 if(!m_pointer) m_pointer =
new DedxPID();
26 for(
int i = 0; i < 5; i++) {
58 double ptrk = mdcTrk->
p();
60 if(ptrk>5)
return irc;
67 if((dedxTrk->
normPH()>30)||(dedxTrk->
normPH()<0))
return irc;
70 m_normPH = dedxTrk->
normPH();
71 m_probPH = dedxTrk->
probPH();
78 for(
int i = 0; i < 5; i++) {
79 double sep = dedxTrk->
chi(i);
82 string sftver = getenv(
"BES_RELEASE");
84 sft.assign(sftver,0,5);
85 if(sft==
"6.6.0"||sft==
"6.5.5") {
97 if(fabs(m_chi[i]) < chitemp) chitemp = fabs(m_chi[i]);
99 if(fabs(ppp) > pdftemp) pdftemp = fabs(ppp);
110 for(
int i = 0; i < 5; i++)
131 double offsetp = 0.0;
132 double offsetc = 0.0;
150 if(ptrk<0.1||ptrk>1)
break;
151 int index = int((ptrk-0.1)/0.05);
152 if(index<=0) index=1;
153 if(index>=17) index=16;
155 if(fabs(costm)>=0.8)
break;
156 int index1 = int((costm+0.8)/0.1);
157 if(index1<=0) index1=1;
158 if(index1>=15) index1=14;
161 if(rundedx2>=11414&&rundedx2<=14604) {
162 offsetp =
cal_par(index,m_psipp_pi_ptrk_offset,ptrk,0.125,0.05);
163 sigp =
cal_par(index,m_psipp_pi_ptrk_sigma,ptrk,0.125,0.05);
164 offsetc =
cal_par(index1,m_psipp_pi_theta_offset,costm,-0.75,0.1);
165 sigcos =
cal_par(index1,m_psipp_pi_theta_sigma,costm,-0.75,0.1);
168 if(rundedx2<=-11414&&rundedx2>=-14604) {
169 offsetp =
cal_par(index,m_psipp_mc_pi_ptrk_offset,ptrk,0.125,0.05);
170 sigp =
cal_par(index,m_psipp_mc_pi_ptrk_sigma,ptrk,0.125,0.05);
171 offsetc =
cal_par(index1,m_psipp_mc_pi_theta_offset,costm,-0.75,0.1);
172 sigcos =
cal_par(index1,m_psipp_mc_pi_theta_sigma,costm,-0.75,0.1);
175 offset=offsetp+sigp*offsetc;
176 chicor=(chicor-
offset)/(sigcos*sigp);
183 if(ptrk<0.3||ptrk>0.8)
break;
185 int index = int((ptrk-0.3)/0.1);
186 if(index<=0) index=1;
187 if(index>=4) index=3;
189 int index1 = int((costm+0.9)/0.1);
190 if(index1<=0) index1=1;
191 if(index1>=17) index1=16;
193 if(rundedx2>=9947&&rundedx2<=10878) {
195 offsetp =
cal_par(index,m_jpsi_kap_ptrk_offset,ptrk,0.35,0.1);
196 sigp =
cal_par(index,m_jpsi_kap_ptrk_sigma,ptrk,0.35,0.1);
197 if(fabs(costm)<=0.83) {
198 offsetc =
cal_par(index1,m_jpsi_kap_theta_offset,costm,-0.85,0.1);
199 sigcos =
cal_par(index1,m_jpsi_kap_theta_sigma,costm,-0.85,0.1);
203 offsetp =
cal_par(index,m_jpsi_kam_ptrk_offset,ptrk,0.35,0.1);
204 sigp =
cal_par(index,m_jpsi_kam_ptrk_sigma,ptrk,0.35,0.1);
205 if(fabs(costm)<=0.83) {
206 offsetc =
cal_par(index1,m_jpsi_kam_theta_offset,costm,-0.85,0.1);
207 sigcos =
cal_par(index1,m_jpsi_kam_theta_sigma,costm,-0.85,0.1);
213 if(rundedx2<=-9947&&rundedx2>=-10878) {
215 offsetp =
cal_par(index,m_jpsi_mc_kap_ptrk_offset,ptrk,0.35,0.1);
216 sigp =
cal_par(index,m_jpsi_mc_kap_ptrk_sigma,ptrk,0.35,0.1);
217 if(fabs(costm)<=0.83) {
218 offsetc =
cal_par(index1,m_jpsi_mc_kap_theta_offset,costm,-0.85,0.1);
219 sigcos =
cal_par(index1,m_jpsi_mc_kap_theta_sigma,costm,-0.85,0.1);
223 offsetp =
cal_par(index,m_jpsi_mc_kam_ptrk_offset,ptrk,0.35,0.1);
224 sigp =
cal_par(index,m_jpsi_mc_kam_ptrk_sigma,ptrk,0.35,0.1);
225 if(fabs(costm)<=0.83) {
226 offsetc =
cal_par(index1,m_jpsi_mc_kam_theta_offset,costm,-0.85,0.1);
227 sigcos =
cal_par(index1,m_jpsi_mc_kam_theta_sigma,costm,-0.85,0.1);
233 if(rundedx2>=8093&&rundedx2<=9025) {
234 if(ptrk<0.3||ptrk>1.2)
break;
235 index = int((ptrk-0.3)/0.1);
236 if(index<=0) index=1;
237 if(index>=8) index=7;
239 offsetp =
cal_par(index,m_psip_kap_ptrk_offset,ptrk,0.35,0.1);
240 sigp =
cal_par(index,m_psip_kap_ptrk_sigma,ptrk,0.35,0.1);
243 offsetp =
cal_par(index,m_psip_kam_ptrk_offset,ptrk,0.35,0.1);
244 sigp =
cal_par(index,m_psip_kam_ptrk_sigma,ptrk,0.35,0.1);
249 if(rundedx2<=-8093&&rundedx2>=-9025) {
251 if(ptrk<0.3||ptrk>1.2)
break;
252 index = int((ptrk-0.3)/0.1);
253 if(index<=0) index=1;
254 if(index>=8) index=7;
256 offsetp =
cal_par(index,m_psip_mc_kap_ptrk_offset,ptrk,0.35,0.1);
257 sigp =
cal_par(index,m_psip_mc_kap_ptrk_sigma,ptrk,0.35,0.1);
260 offsetp =
cal_par(index,m_psip_mc_kam_ptrk_offset,ptrk,0.35,0.1);
261 sigp =
cal_par(index,m_psip_mc_kam_ptrk_sigma,ptrk,0.35,0.1);
267 if(rundedx2>=11414&&rundedx2<=14604) {
268 if(ptrk<0.15||ptrk>1)
break;
269 index = int((ptrk-0.15)/0.05);
270 if(index<=0) index=1;
271 if(index>=16) index=15;
272 if(fabs(costm)>=0.8)
break;
273 index1 = int((costm+0.8)/0.1);
274 if(index1<=0) index1=1;
275 if(index1>=15) index1=14;
277 offsetp =
cal_par(index,m_psipp_ka_ptrk_offset,ptrk,0.175,0.05);
278 sigp =
cal_par(index,m_psipp_ka_ptrk_sigma,ptrk,0.175,0.05);
279 offsetc =
cal_par(index1,m_psipp_ka_theta_offset,costm,-0.75,0.1);
280 sigcos =
cal_par(index1,m_psipp_ka_theta_sigma,costm,-0.75,0.1);
283 if(rundedx2<=-11414&&rundedx2>=-14604) {
284 if(ptrk<0.15||ptrk>1)
break;
285 index = int((ptrk-0.15)/0.05);
286 if(index<=0) index=1;
287 if(index>=16) index=15;
288 if(fabs(costm)>=0.8)
break;
289 index1 = int((costm+0.8)/0.1);
290 if(index1<=0) index1=1;
291 if(index1>=15) index1=14;
292 offsetp =
cal_par(index,m_psipp_mc_ka_ptrk_offset,ptrk,0.175,0.05);
293 sigp =
cal_par(index,m_psipp_mc_ka_ptrk_sigma,ptrk,0.175,0.05);
294 offsetc =
cal_par(index1,m_psipp_mc_ka_theta_offset,costm,-0.75,0.1);
295 sigcos =
cal_par(index1,m_psipp_mc_ka_theta_sigma,costm,-0.75,0.1);
298 offset=offsetp+sigp*offsetc;
299 chicor=(chicor-
offset)/(sigcos*sigp);
306 if(ptrk<0.3||ptrk>1.1)
break;
307 int index = int((ptrk-0.3)/0.1);
308 if(index<=0) index=1;
309 if(index>=7) index=6;
311 int index1 = int((costm+0.9)/0.1);
312 if(index1<=0) index1=1;
313 if(index1>=17) index1=16;
317 if(rundedx2>=9947&&rundedx2<=10878) {
319 offsetp =
cal_par(index,m_jpsi_protonp_ptrk_offset,ptrk,0.35,0.1);
320 sigp =
cal_par(index,m_jpsi_protonp_ptrk_sigma,ptrk,0.35,0.1);
321 if(fabs(costm)<=0.83) {
322 offsetc =
cal_par(index1,m_jpsi_protonp_theta_offset,costm,-0.85,0.1);
323 sigcos =
cal_par(index1,m_jpsi_protonp_theta_sigma,costm,-0.85,0.1);
327 offsetp =
cal_par(index,m_jpsi_protonm_ptrk_offset,ptrk,0.35,0.1);
328 sigp =
cal_par(index,m_jpsi_protonm_ptrk_sigma,ptrk,0.35,0.1);
329 if(fabs(costm)<=0.83) {
330 offsetc =
cal_par(index1,m_jpsi_protonm_theta_offset,costm,-0.85,0.1);
331 sigcos =
cal_par(index1,m_jpsi_protonm_theta_sigma,costm,-0.85,0.1);
337 if(rundedx2<=-9947&&rundedx2>=-10878) {
339 offsetp =
cal_par(index,m_jpsi_mc_protonp_ptrk_offset,ptrk,0.35,0.1);
340 sigp =
cal_par(index,m_jpsi_mc_protonp_ptrk_sigma,ptrk,0.35,0.1);
341 if(fabs(costm)<=0.83) {
342 offsetc =
cal_par(index1,m_jpsi_mc_protonp_theta_offset,costm,-0.85,0.1);
343 sigcos =
cal_par(index1,m_jpsi_mc_protonp_theta_sigma,costm,-0.85,0.1);
347 offsetp =
cal_par(index,m_jpsi_mc_protonm_ptrk_offset,ptrk,0.35,0.1);
348 sigp =
cal_par(index,m_jpsi_mc_protonm_ptrk_sigma,ptrk,0.35,0.1);
349 if(fabs(costm)<=0.83) {
350 offsetc =
cal_par(index1,m_jpsi_mc_protonm_theta_offset,costm,-0.85,0.1);
351 sigcos =
cal_par(index1,m_jpsi_mc_protonm_theta_sigma,costm,-0.85,0.1);
357 if(rundedx2>=8093&&rundedx2<=9025) {
359 offsetp =
cal_par(index,m_psip_protonp_ptrk_offset,ptrk,0.35,0.1);
360 sigp =
cal_par(index,m_psip_protonp_ptrk_sigma,ptrk,0.35,0.1);
363 offsetp =
cal_par(index,m_psip_protonm_ptrk_offset,ptrk,0.35,0.1);
364 sigp =
cal_par(index,m_psip_protonm_ptrk_sigma,ptrk,0.35,0.1);
369 if(rundedx2<=-8093&&rundedx2>=-9025) {
371 offsetp =
cal_par(index,m_psip_mc_protonp_ptrk_offset,ptrk,0.35,0.1);
372 sigp =
cal_par(index,m_psip_mc_protonp_ptrk_sigma,ptrk,0.35,0.1);
375 offsetp =
cal_par(index,m_psip_mc_protonm_ptrk_offset,ptrk,0.35,0.1);
376 sigp =
cal_par(index,m_psip_mc_protonm_ptrk_sigma,ptrk,0.35,0.1);
381 if(rundedx2>=11414&&rundedx2<=14604) {
382 if(ptrk<0.2||ptrk>1.1)
break;
383 index = int((ptrk-0.2)/0.05);
384 if(index<=0) index=1;
385 if(index>=17) index=16;
386 if(fabs(costm)>=0.83)
break;
387 index1 = int((costm+0.9)/0.1);
388 if(index1<=0) index1=1;
389 if(index1>=17) index1=16;
391 offsetp =
cal_par(index,m_psipp_proton_ptrk_offset,ptrk,0.225,0.05);
392 sigp =
cal_par(index,m_psipp_proton_ptrk_sigma,ptrk,0.225,0.05);
393 offsetc =
cal_par(index1,m_psipp_proton_theta_offset,costm,-0.85,0.1);
394 sigcos =
cal_par(index1,m_psipp_proton_theta_sigma,costm,-0.85,0.1);
397 if(rundedx2<=-11414&&rundedx2>=-14604) {
398 if(ptrk<0.2||ptrk>1.1)
break;
399 index = int((ptrk-0.2)/0.1);
400 if(index<=0) index=1;
401 if(index>=8) index=7;
402 if(fabs(costm)>=0.83)
break;
403 index1 = int((costm+0.9)/0.1);
404 if(index1<=0) index1=1;
405 if(index1>=17) index1=16;
406 offsetp =
cal_par(index,m_psipp_mc_proton_ptrk_offset,ptrk,0.25,0.1);
407 sigp =
cal_par(index,m_psipp_mc_proton_ptrk_sigma,ptrk,0.25,0.1);
408 offsetc =
cal_par(index1,m_psipp_mc_proton_theta_offset,costm,-0.85,0.1);
409 sigcos =
cal_par(index1,m_psipp_mc_proton_theta_sigma,costm,-0.85,0.1);
411 offset=offsetp+sigp*offsetc;
412 chicor=(chicor-
offset)/(sigcos*sigp);
478 return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y);
482double DedxPID::mypol5(
double x,
double par0,
double par1,
double par2,
double par3,
double par4,
double par5)
485 return par0 + (par1 * y) +(par2 * y * y) + (par3 * y * y * y) + (par4 * y * y * y *y)+ (par5 * y * y * y * y * y);
492 std::string jpsi_kap_mom =
path +
"/share/JPsi/kaon/dedx_kap.txt";
493 std::string jpsi_kap_mom_mc =
path +
"/share/JPsi/kaon/dedx_kap_mc.txt";
494 ifstream inputmomdata6(jpsi_kap_mom.c_str(),std::ios_base::in);
495 if ( !inputmomdata6 ) {
496 cout <<
" can not open: " << jpsi_kap_mom << endl;
499 ifstream inputmomdata6mc(jpsi_kap_mom_mc.c_str(),std::ios_base::in);
500 if ( !inputmomdata6mc ) {
501 cout <<
" can not open: " << jpsi_kap_mom_mc << endl;
504 for(
int i=0; i<12; i++) {
505 inputmomdata6>>m_jpsi_kap_ptrk_offset[i];
506 inputmomdata6>>m_jpsi_kap_ptrk_sigma[i];
507 inputmomdata6mc>>m_jpsi_mc_kap_ptrk_offset[i];
508 inputmomdata6mc>>m_jpsi_mc_kap_ptrk_sigma[i];
512 std::string jpsi_kam_mom =
path +
"/share/JPsi/kaon/dedx_kam.txt";
513 std::string jpsi_kam_mom_mc =
path +
"/share/JPsi/kaon/dedx_kam_mc.txt";
514 ifstream inputmomdata7(jpsi_kam_mom.c_str(),std::ios_base::in);
515 if ( !inputmomdata7 ) {
516 cout <<
" can not open: " << jpsi_kam_mom << endl;
519 ifstream inputmomdata7mc(jpsi_kam_mom_mc.c_str(),std::ios_base::in);
520 if ( !inputmomdata7mc ) {
521 cout <<
" can not open: " << jpsi_kam_mom_mc << endl;
524 for(
int i=0; i<12; i++) {
525 inputmomdata7>>m_jpsi_kam_ptrk_offset[i];
526 inputmomdata7>>m_jpsi_kam_ptrk_sigma[i];
527 inputmomdata7mc>>m_jpsi_mc_kam_ptrk_offset[i];
528 inputmomdata7mc>>m_jpsi_mc_kam_ptrk_sigma[i];
534 std::string jpsi_kap_the =
path +
"/share/JPsi/kaon/dedx_kap_theta.txt";
535 std::string jpsi_kap_the_mc =
path +
"/share/JPsi/kaon/dedx_kap_theta_mc.txt";
536 ifstream inputmomdata8(jpsi_kap_the.c_str(),std::ios_base::in);
537 if ( !inputmomdata8 ) {
538 cout <<
" can not open: " << jpsi_kap_the << endl;
541 ifstream inputmomdata8mc(jpsi_kap_the_mc.c_str(),std::ios_base::in);
542 if ( !inputmomdata8mc ) {
543 cout <<
" can not open: " << jpsi_kap_the_mc << endl;
546 for(
int i=0; i<18; i++) {
547 inputmomdata8>>m_jpsi_kap_theta_offset[i];
548 inputmomdata8>>m_jpsi_kap_theta_sigma[i];
549 inputmomdata8mc>>m_jpsi_mc_kap_theta_offset[i];
550 inputmomdata8mc>>m_jpsi_mc_kap_theta_sigma[i];
554 std::string jpsi_kam_the =
path +
"/share/JPsi/kaon/dedx_kam_theta.txt";
555 std::string jpsi_kam_the_mc =
path +
"/share/JPsi/kaon/dedx_kam_theta_mc.txt";
556 ifstream inputmomdata9(jpsi_kam_the.c_str(),std::ios_base::in);
557 if ( !inputmomdata9 ) {
558 cout <<
" can not open: " << jpsi_kam_the << endl;
561 ifstream inputmomdata9mc(jpsi_kam_the_mc.c_str(),std::ios_base::in);
562 if ( !inputmomdata9mc ) {
563 cout <<
" can not open: " << jpsi_kam_the_mc << endl;
566 for(
int i=0; i<18; i++) {
567 inputmomdata9>>m_jpsi_kam_theta_offset[i];
568 inputmomdata9>>m_jpsi_kam_theta_sigma[i];
569 inputmomdata9mc>>m_jpsi_mc_kam_theta_offset[i];
570 inputmomdata9mc>>m_jpsi_mc_kam_theta_sigma[i];
574 std::string jpsi_protonp_mom =
path +
"/share/JPsi/proton/dedx_protonp.txt";
575 std::string jpsi_protonp_mom_mc =
path +
"/share/JPsi/proton/dedx_protonp_mc.txt";
576 ifstream inputmomdata12(jpsi_protonp_mom.c_str(),std::ios_base::in);
577 if ( !inputmomdata12 ) {
578 cout <<
" can not open: " << jpsi_protonp_mom << endl;
581 ifstream inputmomdata12mc(jpsi_protonp_mom_mc.c_str(),std::ios_base::in);
582 if ( !inputmomdata12mc ) {
583 cout <<
" can not open: " << jpsi_protonp_mom_mc << endl;
586 for(
int i=0; i<8; i++) {
587 inputmomdata12>>m_jpsi_protonp_ptrk_offset[i];
588 inputmomdata12>>m_jpsi_protonp_ptrk_sigma[i];
589 inputmomdata12mc>>m_jpsi_mc_protonp_ptrk_offset[i];
590 inputmomdata12mc>>m_jpsi_mc_protonp_ptrk_sigma[i];
594 std::string jpsi_protonm_mom =
path +
"/share/JPsi/proton/dedx_protonm.txt";
595 std::string jpsi_protonm_mom_mc =
path +
"/share/JPsi/proton/dedx_protonm_mc.txt";
596 ifstream inputmomdata13(jpsi_protonm_mom.c_str(),std::ios_base::in);
597 if ( !inputmomdata13 ) {
598 cout <<
" can not open: " << jpsi_protonm_mom << endl;
601 ifstream inputmomdata13mc(jpsi_protonm_mom_mc.c_str(),std::ios_base::in);
602 if ( !inputmomdata13mc ) {
603 cout <<
" can not open: " << jpsi_protonm_mom_mc << endl;
606 for(
int i=0; i<8; i++) {
607 inputmomdata13>>m_jpsi_protonm_ptrk_offset[i];
608 inputmomdata13>>m_jpsi_protonm_ptrk_sigma[i];
609 inputmomdata13mc>>m_jpsi_mc_protonm_ptrk_offset[i];
610 inputmomdata13mc>>m_jpsi_mc_protonm_ptrk_sigma[i];
614 std::string jpsi_protonp_the =
path +
"/share/JPsi/proton/dedx_protonp_theta.txt";
615 std::string jpsi_protonp_the_mc =
path +
"/share/JPsi/proton/dedx_protonp_theta_mc.txt";
617 ifstream inputmomdata14(jpsi_protonp_the.c_str(),std::ios_base::in);
618 if ( !inputmomdata14 ) {
619 cout <<
" can not open: " << jpsi_protonp_the << endl;
622 ifstream inputmomdata14mc(jpsi_protonp_the_mc.c_str(),std::ios_base::in);
623 if ( !inputmomdata14mc ) {
624 cout <<
" can not open: " << jpsi_protonp_the_mc << endl;
627 for(
int i=0; i<18; i++) {
628 inputmomdata14>>m_jpsi_protonp_theta_offset[i];
629 inputmomdata14>>m_jpsi_protonp_theta_sigma[i];
630 inputmomdata14mc>>m_jpsi_mc_protonp_theta_offset[i];
631 inputmomdata14mc>>m_jpsi_mc_protonp_theta_sigma[i];
635 std::string jpsi_protonm_the =
path +
"/share/JPsi/proton/dedx_protonm_theta.txt";
636 std::string jpsi_protonm_the_mc =
path +
"/share/JPsi/proton/dedx_protonm_theta_mc.txt";
637 ifstream inputmomdata15(jpsi_protonm_the.c_str(),std::ios_base::in);
638 if ( !inputmomdata15 ) {
639 cout <<
" can not open: " << jpsi_protonm_the << endl;
642 ifstream inputmomdata15mc(jpsi_protonm_the_mc.c_str(),std::ios_base::in);
643 if ( !inputmomdata15mc ) {
644 cout <<
" can not open: " << jpsi_protonm_the_mc << endl;
647 for(
int i=0; i<18; i++) {
648 inputmomdata15>>m_jpsi_protonm_theta_offset[i];
649 inputmomdata15>>m_jpsi_protonm_theta_sigma[i];
650 inputmomdata15mc>>m_jpsi_mc_protonm_theta_offset[i];
651 inputmomdata15mc>>m_jpsi_mc_protonm_theta_sigma[i];
658 std::string psip_kap_mom =
path +
"/share/Psip/kaon/dedx_kap.txt";
659 std::string psip_kap_mom_mc =
path +
"/share/Psip/kaon/dedx_kap_mc.txt";
660 ifstream inputmomdata24(psip_kap_mom.c_str(),std::ios_base::in);
661 if ( !inputmomdata24 ) {
662 cout <<
" can not open: " << psip_kap_mom << endl;
665 ifstream inputmomdata24mc(psip_kap_mom_mc.c_str(),std::ios_base::in);
666 if ( !inputmomdata24mc ) {
667 cout <<
" can not open: " << psip_kap_mom_mc << endl;
670 for(
int i=0; i<9; i++) {
671 inputmomdata24>>m_psip_kap_ptrk_offset[i];
672 inputmomdata24>>m_psip_kap_ptrk_sigma[i];
673 inputmomdata24mc>>m_psip_mc_kap_ptrk_offset[i];
674 inputmomdata24mc>>m_psip_mc_kap_ptrk_sigma[i];
678 std::string psip_kam_mom =
path +
"/share/Psip/kaon/dedx_kam.txt";
679 std::string psip_kam_mom_mc =
path +
"/share/Psip/kaon/dedx_kam_mc.txt";
680 ifstream inputmomdata25(psip_kam_mom.c_str(),std::ios_base::in);
681 if ( !inputmomdata25 ) {
682 cout <<
" can not open: " << psip_kam_mom << endl;
685 ifstream inputmomdata25mc(psip_kam_mom_mc.c_str(),std::ios_base::in);
686 if ( !inputmomdata25mc ) {
687 cout <<
" can not open: " << psip_kam_mom_mc << endl;
690 for(
int i=0; i<9; i++) {
691 inputmomdata25>>m_psip_kam_ptrk_offset[i];
692 inputmomdata25>>m_psip_kam_ptrk_sigma[i];
693 inputmomdata25mc>>m_psip_mc_kam_ptrk_offset[i];
694 inputmomdata25mc>>m_psip_mc_kam_ptrk_sigma[i];
699 std::string psip_protonp_mom =
path +
"/share/Psip/proton/dedx_protonp.txt";
700 std::string psip_protonp_mom_mc =
path +
"/share/Psip/proton/dedx_protonp_mc.txt";
701 ifstream inputmomdata26(psip_protonp_mom.c_str(),std::ios_base::in);
702 if ( !inputmomdata26 ) {
703 cout <<
" can not open: " << psip_protonp_mom << endl;
706 ifstream inputmomdata26mc(psip_protonp_mom_mc.c_str(),std::ios_base::in);
707 if ( !inputmomdata26mc ) {
708 cout <<
" can not open: " << psip_protonp_mom_mc << endl;
711 for(
int i=0; i<9; i++) {
712 inputmomdata26>>m_psip_protonp_ptrk_offset[i];
713 inputmomdata26>>m_psip_protonp_ptrk_sigma[i];
714 inputmomdata26mc>>m_psip_mc_protonp_ptrk_offset[i];
715 inputmomdata26mc>>m_psip_mc_protonp_ptrk_sigma[i];
719 std::string psip_protonm_mom =
path +
"/share/Psip/proton/dedx_protonm.txt";
720 std::string psip_protonm_mom_mc =
path +
"/share/Psip/proton/dedx_protonm_mc.txt";
721 ifstream inputmomdata27(psip_protonm_mom.c_str(),std::ios_base::in);
722 if ( !inputmomdata27 ) {
723 cout <<
" can not open: " << psip_protonm_mom << endl;
726 ifstream inputmomdata27mc(psip_protonm_mom_mc.c_str(),std::ios_base::in);
727 if ( !inputmomdata27mc ) {
728 cout <<
" can not open: " << psip_protonm_mom_mc << endl;
731 for(
int i=0; i<9; i++) {
732 inputmomdata27>>m_psip_protonm_ptrk_offset[i];
733 inputmomdata27>>m_psip_protonm_ptrk_sigma[i];
734 inputmomdata27mc>>m_psip_mc_protonm_ptrk_offset[i];
735 inputmomdata27mc>>m_psip_mc_protonm_ptrk_sigma[i];
739 std::string psipp_pi_mom =
path +
"/share/Psipp/pion/dedx_pi.txt";
740 std::string psipp_pi_mom_mc =
path +
"/share/Psipp/pion/dedx_pi_mc.txt";
741 ifstream inputmomdata28(psipp_pi_mom.c_str(),std::ios_base::in);
742 if ( !inputmomdata28 ) {
743 cout <<
" can not open: " << psipp_pi_mom << endl;
746 ifstream inputmomdata28mc(psipp_pi_mom_mc.c_str(),std::ios_base::in);
747 if ( !inputmomdata28mc ) {
748 cout <<
" can not open: " << psipp_pi_mom_mc << endl;
751 for(
int i=0; i<18; i++) {
752 inputmomdata28>>m_psipp_pi_ptrk_offset[i];
753 inputmomdata28>>m_psipp_pi_ptrk_sigma[i];
754 inputmomdata28mc>>m_psipp_mc_pi_ptrk_offset[i];
755 inputmomdata28mc>>m_psipp_mc_pi_ptrk_sigma[i];
759 std::string psipp_pi_the =
path +
"/share/Psipp/pion/dedx_pi_theta.txt";
760 std::string psipp_pi_the_mc =
path +
"/share/Psipp/pion/dedx_pi_theta_mc.txt";
761 ifstream inputmomdata29(psipp_pi_the.c_str(),std::ios_base::in);
762 if ( !inputmomdata29 ) {
763 cout <<
" can not open: " << psipp_pi_the << endl;
766 ifstream inputmomdata29mc(psipp_pi_the_mc.c_str(),std::ios_base::in);
767 if ( !inputmomdata29mc ) {
768 cout <<
" can not open: " << psipp_pi_the_mc << endl;
771 for(
int i=0; i<16; i++) {
772 inputmomdata29>>m_psipp_pi_theta_offset[i];
773 inputmomdata29>>m_psipp_pi_theta_sigma[i];
774 inputmomdata29mc>>m_psipp_mc_pi_theta_offset[i];
775 inputmomdata29mc>>m_psipp_mc_pi_theta_sigma[i];
779 std::string psipp_ka_mom =
path +
"/share/Psipp/kaon/dedx_ka.txt";
780 std::string psipp_ka_mom_mc =
path +
"/share/Psipp/kaon/dedx_ka_mc.txt";
781 ifstream inputmomdata30(psipp_ka_mom.c_str(),std::ios_base::in);
782 if ( !inputmomdata30 ) {
783 cout <<
" can not open: " << psipp_ka_mom << endl;
786 ifstream inputmomdata30mc(psipp_ka_mom_mc.c_str(),std::ios_base::in);
787 if ( !inputmomdata30mc ) {
788 cout <<
" can not open: " << psipp_ka_mom_mc << endl;
791 for(
int i=0; i<17; i++) {
792 inputmomdata30>>m_psipp_ka_ptrk_offset[i];
793 inputmomdata30>>m_psipp_ka_ptrk_sigma[i];
794 inputmomdata30mc>>m_psipp_mc_ka_ptrk_offset[i];
795 inputmomdata30mc>>m_psipp_mc_ka_ptrk_sigma[i];
799 std::string psipp_ka_the =
path +
"/share/Psipp/kaon/dedx_ka_theta.txt";
800 std::string psipp_ka_the_mc =
path +
"/share/Psipp/kaon/dedx_ka_theta_mc.txt";
801 ifstream inputmomdata31(psipp_ka_the.c_str(),std::ios_base::in);
802 if ( !inputmomdata31 ) {
803 cout <<
" can not open: " << psipp_ka_the << endl;
806 ifstream inputmomdata31mc(psipp_ka_the_mc.c_str(),std::ios_base::in);
807 if ( !inputmomdata31mc ) {
808 cout <<
" can not open: " << psipp_ka_the_mc << endl;
811 for(
int i=0; i<16; i++) {
812 inputmomdata31>>m_psipp_ka_theta_offset[i];
813 inputmomdata31>>m_psipp_ka_theta_sigma[i];
814 inputmomdata31mc>>m_psipp_mc_ka_theta_offset[i];
815 inputmomdata31mc>>m_psipp_mc_ka_theta_sigma[i];
820 std::string psipp_proton_mom =
path +
"/share/Psipp/proton/dedx_proton.txt";
821 std::string psipp_proton_mom_mc =
path +
"/share/Psipp/proton/dedx_proton_mc.txt";
822 ifstream inputmomdata32(psipp_proton_mom.c_str(),std::ios_base::in);
823 if ( !inputmomdata32 ) {
824 cout <<
" can not open: " << psipp_proton_mom << endl;
827 ifstream inputmomdata32mc(psipp_proton_mom_mc.c_str(),std::ios_base::in);
828 if ( !inputmomdata32mc ) {
829 cout <<
" can not open: " << psipp_proton_mom_mc << endl;
832 for(
int i=0; i<18; i++) {
833 inputmomdata32>>m_psipp_proton_ptrk_offset[i];
834 inputmomdata32>>m_psipp_proton_ptrk_sigma[i];
836 for(
int i=0; i<9; i++) {
837 inputmomdata32mc>>m_psipp_mc_proton_ptrk_offset[i];
838 inputmomdata32mc>>m_psipp_mc_proton_ptrk_sigma[i];
842 std::string psipp_proton_the =
path +
"/share/Psipp/proton/dedx_proton_theta.txt";
843 std::string psipp_proton_the_mc =
path +
"/share/Psipp/proton/dedx_proton_theta_mc.txt";
844 ifstream inputmomdata33(psipp_proton_the.c_str(),std::ios_base::in);
845 if ( !inputmomdata33 ) {
846 cout <<
" can not open: " << psipp_proton_the << endl;
849 ifstream inputmomdata33mc(psipp_proton_the_mc.c_str(),std::ios_base::in);
850 if ( !inputmomdata33mc ) {
851 cout <<
" can not open: " << psipp_proton_the_mc << endl;
854 for(
int i=0; i<18; i++) {
855 inputmomdata33>>m_psipp_proton_theta_offset[i];
856 inputmomdata33>>m_psipp_proton_theta_sigma[i];
857 inputmomdata33mc>>m_psipp_mc_proton_theta_offset[i];
858 inputmomdata33mc>>m_psipp_mc_proton_theta_sigma[i];
865 p2=((mean[0]-mean[1])*(
p[1]*
p[1]-
p[2]*
p[2])-(mean[1]-mean[2])*(
p[0]*
p[0]-
p[1]*
p[1]))/((
p[0]-
p[1])*(
p[1]*
p[1]-
p[2]*
p[2])-(
p[1]-
p[2])*(
p[0]*
p[0]-
p[1]*
p[1]));
866 p3=((
p[0]-
p[1])*(mean[1]-mean[2])-(
p[1]-
p[2])*(mean[0]-mean[1]))/((
p[0]-
p[1])*(
p[1]*
p[1]-
p[2]*
p[2])-(
p[1]-
p[2])*(
p[0]*
p[0]-
p[1]*
p[1]));
867 p1=mean[0]-p2*
p[0]-p3*
p[0]*
p[0];
868 double mean1 = p1+p2*ptrk+p3*ptrk*ptrk;
873 double mean1[3],
p[3];
874 p[0]=begin+(index1-1)*
bin;
875 p[1]=begin+index1*
bin;
876 p[2]=begin+(index1+1)*
bin;
877 mean1[0]=m_jpsi_pip_ptrk_offset[index1-1];
878 mean1[1]=m_jpsi_pip_ptrk_offset[index1];
879 mean1[2]=m_jpsi_pip_ptrk_offset[index1+1];
double cos(const BesAngle a)
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
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)
int particleIDCalculation()
double CorrDedx(int n, double ptrk, double cost, double chi, int charge)
double sigmaDedx(int n, double ptrk, double cost)
double iterate(double ptrk, double *mean, double *p)
double offsetDedx(int n, double ptrk, double cost)
double offset(int n) const
double cal_par(int index1, double *m_jpsi_pip_ptrk_offset, double ptrk, double begin, double bin)
static DedxPID * instance()
const double theta() const
EvtRecTrack * PidTrk() const
double probCalculate(double chi2, int n)
double pdfCalculate(double offset, double sigma)
double pdfMinSigmaCut() const