58 std::cout<<
"read tofC"<<std::endl;
59 std::string tofdata_mom_file =
path +
"/share/pidparatof/tofpdata.txt";
60 ifstream inputmomdata(tofdata_mom_file.c_str(),std::ios_base::in);
61 if ( !inputmomdata ) {
62 cout <<
" can not open: " << tofdata_mom_file << endl;
66 std::string tofdata_theta_file =
path +
"/share/pidparatof/tofthetadata.txt";
67 ifstream inputthetadata(tofdata_theta_file.c_str(),std::ios_base::in);
68 if ( !inputthetadata ) {
69 cout <<
" can not open: " << tofdata_theta_file << endl;
73 std::string tofdata_endcap_file =
path +
"/share/pidparatof/tofendcapdata.txt";
74 ifstream inputendcapdata(tofdata_endcap_file.c_str(),std::ios_base::in);
75 if ( !inputendcapdata ) {
76 cout <<
" can not open: " << tofdata_endcap_file << endl;
81 std::string tofmc_mom_file =
path +
"/share/pidparatof/tofpmc.txt";
82 ifstream inputmommc(tofmc_mom_file.c_str(),std::ios_base::in);
84 cout <<
" can not open: " << tofmc_mom_file << endl;
88 std::string tofmc_theta_file =
path +
"/share/pidparatof/tofthetamc.txt";
89 ifstream inputthetamc(tofmc_theta_file.c_str(),std::ios_base::in);
90 if ( !inputthetamc ) {
91 cout <<
" can not open: " << tofmc_theta_file << endl;
95 std::string tofmc_endcap_file =
path +
"/share/pidparatof/tofendcapmc.txt";
96 ifstream inputendcapmc(tofmc_endcap_file.c_str(),std::ios_base::in);
97 if ( !inputendcapmc ) {
98 cout <<
" can not open: " << tofmc_endcap_file << endl;
105 for(
int i=0; i<5; i++)
107 for(
int j=0; j<8; j++)
109 inputthetadata>>m_thetapara[i][j];
113 for(
int i=0; i<5; i++)
115 for(
int j=0; j<12; j++)
117 inputmomdata>>m_momentpara[i][j];
121 for(
int i=0; i<5; i++)
123 for(
int j=0; j<4; j++)
125 inputendcapdata>>m_endcappara[i][j];
131 for(
int i=0; i<5; i++)
133 for(
int j=0; j<8; j++)
135 inputthetamc>>m_thetapara[i][j];
139 for(
int i=0; i<5; i++)
141 for(
int j=0; j<12; j++)
143 inputmommc>>m_momentpara[i][j];
147 for(
int i=0; i<5; i++)
149 for(
int j=0; j<4; j++)
151 inputendcapmc>>m_endcappara[i][j];
265 double offsetp = 0.0;
266 double offsetc = 0.0;
277 {
if(ptrk < 0.3) ptemp = 0.3;
278 if(ptrk > 1.3) ptemp = 1.3;
281 {
if(ptrk < 0.3) ptemp = 0.3;
282 if(ptrk > 1.3) ptemp = 1.3;
285 double plog = log(ptemp);
286 double costcos =
cos(costm);
287 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]);
288 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]);
291 offsetc=m_endcappara[0][0];
292 sigcos=m_endcappara[0][2];
295 offsetc=m_endcappara[0][1];
296 sigcos=m_endcappara[0][3];
298 if(fabs(costm)<=0.83)
300 offsetc=
mypol3(costcos,m_thetapara[0][0],m_thetapara[0][1],m_thetapara[0][2],m_thetapara[0][3]);
301 sigcos=
mypol3(costcos,m_thetapara[0][4],m_thetapara[0][5],m_thetapara[0][6],m_thetapara[0][7]);
305 offset=offsetc+sigcos*offsetp;
307 offset=offsetp+sigp*offsetc;
315 {
if(ptrk < 0.3) ptemp = 0.3;
316 if(ptrk > 1.3) ptemp = 1.3;
319 {
if(ptrk < 0.3) ptemp = 0.3;
320 if(ptrk > 1.3) ptemp = 1.3;
323 double plog = log(ptemp);
324 double costcos =
cos(costm);
325 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]);
326 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]);
329 offsetc=m_endcappara[1][0];
330 sigcos=m_endcappara[1][2];
333 offsetc=m_endcappara[1][1];
334 sigcos=m_endcappara[1][3];
336 if(fabs(costm)<=0.83)
338 offsetc=
mypol3(costcos,m_thetapara[1][0],m_thetapara[1][1],m_thetapara[1][2],m_thetapara[1][3]);
339 sigcos=
mypol3(costcos,m_thetapara[1][4],m_thetapara[1][5],m_thetapara[1][6],m_thetapara[1][7]);
343 offset=offsetc+sigcos*offsetp;
345 offset=offsetp+sigp*offsetc;
353 {
if(ptrk < 0.3) ptemp = 0.3;
354 if(ptrk > 1.6) ptemp = 1.6;
357 {
if(ptrk < 0.3) ptemp = 0.3;
358 if(ptrk > 1.6) ptemp = 1.6;
361 double plog = log(ptemp);
362 double costcos =
cos(costm);
363 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]);
364 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]);
367 offsetc=m_endcappara[2][0];
368 sigcos=m_endcappara[2][2];
371 offsetc=m_endcappara[2][1];
372 sigcos=m_endcappara[2][3];
374 if(fabs(costm)<=0.83)
376 offsetc=
mypol3(costcos,m_thetapara[2][0],m_thetapara[2][1],m_thetapara[2][2],m_thetapara[2][3]);
377 sigcos=
mypol3(costcos,m_thetapara[2][4],m_thetapara[2][5],m_thetapara[2][6],m_thetapara[2][7]);
381 offset=offsetc+sigcos*offsetp;
383 offset=offsetp+sigp*offsetc;
391 {
if(ptrk < 0.4) ptemp = 0.4;
392 if(ptrk > 1.3) ptemp = 1.3;
395 {
if(ptrk < 0.4) ptemp = 0.4;
396 if(ptrk > 1.3) ptemp = 1.3;
398 double plog = log(ptemp);
399 double costcos =
cos(costm);
400 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]);
401 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]);
404 offsetc=m_endcappara[3][0];
405 sigcos=m_endcappara[3][2];
408 offsetc=m_endcappara[3][1];
409 sigcos=m_endcappara[3][3];
411 if(fabs(costm)<=0.83)
413 offsetc=
mypol3(costcos,m_thetapara[3][0],m_thetapara[3][1],m_thetapara[3][2],m_thetapara[3][3]);
414 sigcos=
mypol3(costcos,m_thetapara[3][4],m_thetapara[3][5],m_thetapara[3][6],m_thetapara[3][7]);
418 offset=offsetc+sigcos*offsetp;
420 offset=offsetp+sigp*offsetc;
428 {
if(ptrk < 0.5) ptemp = 0.5;
429 if(ptrk > 1.3) ptemp = 1.3;
432 {
if(ptrk < 0.5) ptemp = 0.5;
433 if(ptrk > 1.3) ptemp = 1.3;
435 double plog = log(ptemp);
436 double costcos =
cos(costm);
437 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]);
438 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]);
441 offsetc=m_endcappara[4][0];
442 sigcos=m_endcappara[4][2];
445 offsetc=m_endcappara[4][1];
446 sigcos=m_endcappara[4][3];
448 if(fabs(costm)<=0.83)
450 offsetc=
mypol3(costcos,m_thetapara[4][0],m_thetapara[4][1],m_thetapara[4][2],m_thetapara[4][3]);
451 sigcos=
mypol3(costcos,m_thetapara[4][4],m_thetapara[4][5],m_thetapara[4][6],m_thetapara[4][7]);
454 offset=offsetc+sigcos*offsetp;
456 offset=offsetp+sigp*offsetc;
482 {
if(ptrk < 0.3) ptemp = 0.3;
483 if(ptrk > 1.3) ptemp = 1.3;
486 {
if(ptrk < 0.3) ptemp = 0.3;
487 if(ptrk > 1.3) ptemp = 1.3;
490 double plog = log(ptemp);
491 double costcos =
cos(costm);
493 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]);
496 sigmac=m_endcappara[0][2];
499 sigmac=m_endcappara[0][3];
503 sigmac=
mypol3(costcos,m_thetapara[0][4],m_thetapara[0][5],m_thetapara[0][6],m_thetapara[0][7]);
515 {
if(ptrk < 0.3) ptemp = 0.3;
516 if(ptrk > 1.3) ptemp = 1.3;
519 {
if(ptrk < 0.3) ptemp = 0.3;
520 if(ptrk > 1.3) ptemp = 1.3;
523 double plog = log(ptemp);
524 double costcos =
cos(costm);
526 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]);
529 sigmac=m_endcappara[1][2];
532 sigmac=m_endcappara[1][3];
536 sigmac=
mypol3(costcos,m_thetapara[1][4],m_thetapara[1][5],m_thetapara[1][6],m_thetapara[1][7]);
549 {
if(ptrk < 0.3) ptemp = 0.3;
550 if(ptrk > 1.6) ptemp = 1.6;
553 {
if(ptrk < 0.3) ptemp = 0.3;
554 if(ptrk > 1.6) ptemp = 1.6;
557 double plog = log(ptemp);
558 double costcos =
cos(costm);
559 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]);
562 sigmac=m_endcappara[2][2];
565 sigmac=m_endcappara[2][3];
569 sigmac=
mypol3(costcos,m_thetapara[2][4],m_thetapara[2][5],m_thetapara[2][6],m_thetapara[2][7]);
583 {
if(ptrk < 0.4) ptemp = 0.4;
584 if(ptrk > 1.3) ptemp = 1.3;
587 {
if(ptrk < 0.4) ptemp = 0.4;
588 if(ptrk > 1.3) ptemp = 1.3;
590 double plog = log(ptemp);
591 double costcos =
cos(costm);
592 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]);
595 sigmac=m_endcappara[3][2];
598 sigmac=m_endcappara[3][3];
602 sigmac=
mypol3(costcos,m_thetapara[3][4],m_thetapara[3][5],m_thetapara[3][6],m_thetapara[3][7]);
615 {
if(ptrk < 0.5) ptemp = 0.5;
616 if(ptrk > 1.3) ptemp = 1.3;
619 {
if(ptrk < 0.5) ptemp = 0.5;
620 if(ptrk > 1.3) ptemp = 1.3;
622 double plog = log(ptemp);
623 double costcos =
cos(costm);
624 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]);
627 sigmac=m_endcappara[4][2];
630 sigmac=m_endcappara[4][3];
634 sigmac=
mypol3(costcos,m_thetapara[4][4],m_thetapara[4][5],m_thetapara[4][6],m_thetapara[4][7]);