187{
188
189
190
191
192 string data_dir = (gSystem->Getenv("GINUKEHADRONDATA")) ?
193 string(gSystem->Getenv("GINUKEHADRONDATA")) :
194 string(gSystem->Getenv("GENIE")) + string("/data/evgen/intranuke");
195
197 << "Loading INTRANUKE hadron data from: " << data_dir;
198
199
200
201 string datafile_NN = data_dir + "/tot_xsec/intranuke-xsections-NN2014.dat";
202 string datafile_pipN = data_dir + "/tot_xsec/intranuke-xsections-pi+N.dat";
203 string datafile_pi0N = data_dir + "/tot_xsec/intranuke-xsections-pi0N.dat";
204 string datafile_NA = data_dir + "/tot_xsec/intranuke-fractions-NA2016.dat";
205 string datafile_KA = data_dir + "/tot_xsec/intranuke-fractions-KA.dat";
206 string datafile_gamN = data_dir + "/tot_xsec/intranuke-xsections-gamN.dat";
207 string datafile_kN = data_dir + "/tot_xsec/intranuke-xsections-kaonN2018.dat";
208
209
210
211 assert( ! gSystem->AccessPathName(datafile_NN. c_str()) );
212 assert( ! gSystem->AccessPathName(datafile_pipN.c_str()) );
213 assert( ! gSystem->AccessPathName(datafile_pi0N.c_str()) );
214 assert( ! gSystem->AccessPathName(datafile_NA. c_str()) );
215 assert( ! gSystem->AccessPathName(datafile_KA. c_str()) );
216 assert( ! gSystem->AccessPathName(datafile_gamN.c_str()) );
217 assert( ! gSystem->AccessPathName(datafile_kN. c_str()) );
218
219 LOG(
"INukeData",
pINFO) <<
"Found all necessary data files...";
220
221
222
223 TTree data_NN;
224 TTree data_pipN;
225 TTree data_pi0N;
226 TTree data_NA;
227 TTree data_KA;
228 TTree data_gamN;
229 TTree data_kN;
230
231 data_NN.ReadFile(datafile_NN.c_str(),"ke/D:pp_tot/D:pp_elas/D:pp_reac/D:pn_tot/D:pn_elas/D:pn_reac/D:nn_tot/D:nn_elas/D:nn_reac/D:pp_cmp/D:pn_cmp/D:nn_cmp/D");
232 data_pipN.ReadFile(datafile_pipN.c_str(),
233 "ke/D:pipn_tot/D:pipn_cex/D:pipn_elas/D:pipn_reac/D:pipp_tot/D:pipp_cex/D:pipp_elas/D:pipp_reac/D:pipd_abs");
234 data_pi0N.ReadFile(datafile_pi0N.c_str(),
235 "ke/D:pi0n_tot/D:pi0n_cex/D:pi0n_elas/D:pi0n_reac/D:pi0p_tot/D:pi0p_cex/D:pi0p_elas/D:pi0p_reac/D:pi0d_abs");
236
237
238 data_NA.ReadFile(datafile_NA.c_str(),
239 "ke/D:pA_tot/D:pA_inel/D:pA_cex/D:pA_abs/D:pA_pipro/D:pA_cmp/D");
240 data_gamN.ReadFile(datafile_gamN.c_str(),
241 "ke/D:pi0p_tot/D:pipn_tot/D:pimp_tot/D:pi0n_tot/D:gamp_fs/D:gamn_fs/D:gamN_tot/D");
242 data_kN.ReadFile(datafile_kN.c_str(),
243 "ke/D:kpp_elas/D:kpn_elas/D:kpn_cex/D:kp_abs/D:kpN_tot/D");
244 data_KA.ReadFile(datafile_KA.c_str(),
245 "ke/D:KA_tot/D:KA_elas/D:KA_inel/D:KA_abs/D");
246
247 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NN : " << data_NN.GetEntries();
248 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pipN : " << data_pipN.GetEntries();
249 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pi0N : " << data_pi0N.GetEntries();
250 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NA : " << data_NA.GetEntries();
251 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in KA : " << data_KA.GetEntries();
252 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in gamN : " << data_gamN.GetEntries();
253 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in kN : " << data_kN.GetEntries();
254
255 LOG(
"INukeData",
pINFO) <<
"Done loading all x-section files...";
256
257
258
259
272
273
283
284
294
295
301
302
306
307
309
315
320
323
324
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355 {
356 const int hN_ppelas_nfiles = 20;
357 const int hN_ppelas_points_per_file = 21;
358 const int hN_ppelas_npoints = hN_ppelas_points_per_file * hN_ppelas_nfiles;
359
360 double hN_ppelas_energies[hN_ppelas_nfiles] = {
361 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
362 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
363 };
364
365 double hN_ppelas_costh [hN_ppelas_points_per_file];
366 double hN_ppelas_xsec [hN_ppelas_npoints];
367
368 int ipoint=0;
369
370 for(int ifile = 0; ifile < hN_ppelas_nfiles; ifile++) {
371
372 ostringstream hN_datafile;
373 double ke = hN_ppelas_energies[ifile];
374 hN_datafile << data_dir << "/diff_ang/pp/pp" << ke << ".txt";
375
377 hN_datafile.str(), ke, hN_ppelas_points_per_file,
378 ipoint, hN_ppelas_costh, hN_ppelas_xsec,2);
379 }
380
381 fhN2dXSecPP_Elas =
new BLI2DNonUnifGrid(hN_ppelas_nfiles,hN_ppelas_points_per_file,
382 hN_ppelas_energies,hN_ppelas_costh,hN_ppelas_xsec);
383 }
384
385
386 {
387 const int hN_npelas_nfiles = 20;
388 const int hN_npelas_points_per_file = 21;
389 const int hN_npelas_npoints = hN_npelas_points_per_file * hN_npelas_nfiles;
390
391 double hN_npelas_energies[hN_npelas_nfiles] = {
392 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
393 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
394 };
395
396 double hN_npelas_costh [hN_npelas_points_per_file];
397 double hN_npelas_xsec [hN_npelas_npoints];
398
399 int ipoint=0;
400
401 for(int ifile = 0; ifile < hN_npelas_nfiles; ifile++) {
402
403 ostringstream hN_datafile;
404 double ke = hN_npelas_energies[ifile];
405 hN_datafile << data_dir << "/diff_ang/pn/pn" << ke << ".txt";
406
408 hN_datafile.str(), ke, hN_npelas_points_per_file,
409 ipoint, hN_npelas_costh, hN_npelas_xsec,2);
410 }
411
412 fhN2dXSecNP_Elas =
new BLI2DNonUnifGrid(hN_npelas_nfiles,hN_npelas_points_per_file,
413 hN_npelas_energies,hN_npelas_costh,hN_npelas_xsec);
414 }
415
416
417 {
418 const int hN_pipNelas_nfiles = 60;
419 const int hN_pipNelas_points_per_file = 21;
420 const int hN_pipNelas_npoints = hN_pipNelas_points_per_file * hN_pipNelas_nfiles;
421
422 double hN_pipNelas_energies[hN_pipNelas_nfiles] = {
423 10, 20, 30, 40, 50, 60, 70, 80, 90,
424 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
425 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
426 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
427 700, 740, 780, 820, 860, 900, 940, 980,
428 1020, 1060, 1100, 1140, 1180, 1220, 1260,
429 1300, 1340, 1380, 1420, 1460, 1500
430 };
431
432 double hN_pipNelas_costh [hN_pipNelas_points_per_file];
433 double hN_pipNelas_xsec [hN_pipNelas_npoints];
434
435 int ipoint=0;
436
437 for(int ifile = 0; ifile < hN_pipNelas_nfiles; ifile++) {
438
439 ostringstream hN_datafile;
440 double ke = hN_pipNelas_energies[ifile];
441 hN_datafile << data_dir << "/diff_ang/pip/pip" << ke << ".txt";
442
444 hN_datafile.str(), ke, hN_pipNelas_points_per_file,
445 ipoint, hN_pipNelas_costh, hN_pipNelas_xsec,2);
446 }
447
448 fhN2dXSecPipN_Elas =
new BLI2DNonUnifGrid(hN_pipNelas_nfiles,hN_pipNelas_points_per_file,
449 hN_pipNelas_energies,hN_pipNelas_costh,hN_pipNelas_xsec);
450 }
451
452
453 {
454 const int hN_pi0Nelas_nfiles = 60;
455 const int hN_pi0Nelas_points_per_file = 21;
456 const int hN_pi0Nelas_npoints = hN_pi0Nelas_points_per_file * hN_pi0Nelas_nfiles;
457
458 double hN_pi0Nelas_energies[hN_pi0Nelas_nfiles] = {
459 10, 20, 30, 40, 50, 60, 70, 80, 90,
460 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
461 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
462 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
463 700, 740, 780, 820, 860, 900, 940, 980,
464 1020, 1060, 1100, 1140, 1180, 1220, 1260,
465 1300, 1340, 1380, 1420, 1460, 1500
466 };
467
468 double hN_pi0Nelas_costh [hN_pi0Nelas_points_per_file];
469 double hN_pi0Nelas_xsec [hN_pi0Nelas_npoints];
470
471 int ipoint=0;
472
473 for(int ifile = 0; ifile < hN_pi0Nelas_nfiles; ifile++) {
474
475 ostringstream hN_datafile;
476 double ke = hN_pi0Nelas_energies[ifile];
477 hN_datafile << data_dir << "/diff_ang/pip/pip" << ke << ".txt";
478
480 hN_datafile.str(), ke, hN_pi0Nelas_points_per_file,
481 ipoint, hN_pi0Nelas_costh, hN_pi0Nelas_xsec,2);
482 }
483
484 fhN2dXSecPi0N_Elas =
new BLI2DNonUnifGrid(hN_pi0Nelas_nfiles,hN_pi0Nelas_points_per_file,
485 hN_pi0Nelas_energies,hN_pi0Nelas_costh,hN_pi0Nelas_xsec);
486 }
487
488
489 {
490 const int hN_pimNelas_nfiles = 60;
491 const int hN_pimNelas_points_per_file = 21;
492 const int hN_pimNelas_npoints = hN_pimNelas_points_per_file * hN_pimNelas_nfiles;
493
494 double hN_pimNelas_energies[hN_pimNelas_nfiles] = {
495 10, 20, 30, 40, 50, 60, 70, 80, 90,
496 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
497 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
498 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
499 700, 740, 780, 820, 860, 900, 940, 980,
500 1020, 1060, 1100, 1140, 1180, 1220, 1260,
501 1300, 1340, 1380, 1420, 1460, 1500
502 };
503
504 double hN_pimNelas_costh [hN_pimNelas_points_per_file];
505 double hN_pimNelas_xsec [hN_pimNelas_npoints];
506
507 int ipoint=0;
508
509 for(int ifile = 0; ifile < hN_pimNelas_nfiles; ifile++) {
510
511 ostringstream hN_datafile;
512 double ke = hN_pimNelas_energies[ifile];
513 hN_datafile << data_dir << "/diff_ang/pim/pim" << ke << ".txt";
514
516 hN_datafile.str(), ke, hN_pimNelas_points_per_file,
517 ipoint, hN_pimNelas_costh, hN_pimNelas_xsec,2);
518 }
519
520 fhN2dXSecPimN_Elas =
new BLI2DNonUnifGrid(hN_pimNelas_nfiles,hN_pimNelas_points_per_file,
521 hN_pimNelas_energies,hN_pimNelas_costh,hN_pimNelas_xsec);
522 }
523
524
525 {
526 const int hN_kpNelas_nfiles = 18;
527 const int hN_kpNelas_points_per_file = 37;
528 const int hN_kpNelas_npoints = hN_kpNelas_points_per_file * hN_kpNelas_nfiles;
529
530 double hN_kpNelas_energies[hN_kpNelas_nfiles] = {
531 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
532 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
533 };
534
535 double hN_kpNelas_costh [hN_kpNelas_points_per_file];
536 double hN_kpNelas_xsec [hN_kpNelas_npoints];
537
538 int ipoint=0;
539
540 for(int ifile = 0; ifile < hN_kpNelas_nfiles; ifile++) {
541
542 ostringstream hN_datafile;
543 double ke = hN_kpNelas_energies[ifile];
544 hN_datafile << data_dir << "/diff_ang/kpn/kpn" << ke << ".txt";
545
547 hN_datafile.str(), ke, hN_kpNelas_points_per_file,
548 ipoint, hN_kpNelas_costh, hN_kpNelas_xsec,2);
549 }
550
551 fhN2dXSecKpN_Elas =
new BLI2DNonUnifGrid(hN_kpNelas_nfiles,hN_kpNelas_points_per_file,
552 hN_kpNelas_energies,hN_kpNelas_costh,hN_kpNelas_xsec);
553 }
554
555 {
556 const int hN_kpNcex_nfiles = 18;
557 const int hN_kpNcex_points_per_file = 37;
558 const int hN_kpNcex_npoints = hN_kpNcex_points_per_file * hN_kpNcex_nfiles;
559
560 double hN_kpNcex_energies[hN_kpNcex_nfiles] = {
561 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
562 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
563 };
564
565 double hN_kpNcex_costh [hN_kpNcex_points_per_file];
566 double hN_kpNcex_xsec [hN_kpNcex_npoints];
567
568 int ipoint=0;
569
570 for(int ifile = 0; ifile < hN_kpNcex_nfiles; ifile++) {
571
572 ostringstream hN_datafile;
573 double ke = hN_kpNcex_energies[ifile];
574 hN_datafile << data_dir << "/diff_ang/kpncex/kpcex" << ke << ".txt";
575
577 hN_datafile.str(), ke, hN_kpNcex_points_per_file,
578 ipoint, hN_kpNcex_costh, hN_kpNcex_xsec,2);
579 }
580
581
582
583
584
585
586 fhN2dXSecKpN_CEx =
new BLI2DNonUnifGrid(hN_kpNcex_nfiles,hN_kpNcex_points_per_file,
587 hN_kpNcex_energies,hN_kpNcex_costh,hN_kpNcex_xsec);
588 }
589
590
591
592
593 {
594 const int hN_kpPelas_nfiles = 18;
595 const int hN_kpPelas_points_per_file = 37;
596 const int hN_kpPelas_npoints = hN_kpPelas_points_per_file * hN_kpPelas_nfiles;
597
598 double hN_kpPelas_energies[hN_kpPelas_nfiles] = {
599 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
600 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
601 };
602
603 double hN_kpPelas_costh [hN_kpPelas_points_per_file];
604 double hN_kpPelas_xsec [hN_kpPelas_npoints];
605
606 int ipoint=0;
607
608 for(int ifile = 0; ifile < hN_kpPelas_nfiles; ifile++) {
609
610 ostringstream hN_datafile;
611 double ke = hN_kpPelas_energies[ifile];
612 hN_datafile << data_dir << "/diff_ang/kpp/kpp" << ke << ".txt";
613
615 hN_datafile.str(), ke, hN_kpPelas_points_per_file,
616 ipoint, hN_kpPelas_costh, hN_kpPelas_xsec,2);
617 }
618
619 fhN2dXSecKpP_Elas =
new BLI2DNonUnifGrid(hN_kpPelas_nfiles,hN_kpPelas_points_per_file,
620 hN_kpPelas_energies,hN_kpPelas_costh,hN_kpPelas_xsec);
621 }
622
623
624 {
625 const int hN_piNcex_nfiles = 60;
626 const int hN_piNcex_points_per_file = 21;
627 const int hN_piNcex_npoints = hN_piNcex_points_per_file * hN_piNcex_nfiles;
628
629 double hN_piNcex_energies[hN_piNcex_nfiles] = {
630 10, 20, 30, 40, 50, 60, 70, 80, 90,
631 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
632 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
633 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
634 700, 740, 780, 820, 860, 900, 940, 980,
635 1020, 1060, 1100, 1140, 1180, 1220, 1260,
636 1300, 1340, 1380, 1420, 1460, 1500
637 };
638
639 double hN_piNcex_costh [hN_piNcex_points_per_file];
640 double hN_piNcex_xsec [hN_piNcex_npoints];
641
642 int ipoint=0;
643
644 for(int ifile = 0; ifile < hN_piNcex_nfiles; ifile++) {
645
646 ostringstream hN_datafile;
647 double ke = hN_piNcex_energies[ifile];
648 hN_datafile << data_dir << "/diff_ang/pie/pie" << ke << ".txt";
649
651 hN_datafile.str(), ke, hN_piNcex_points_per_file,
652 ipoint, hN_piNcex_costh, hN_piNcex_xsec,2);
653 }
654
655 fhN2dXSecPiN_CEx =
new BLI2DNonUnifGrid(hN_piNcex_nfiles,hN_piNcex_points_per_file,
656 hN_piNcex_energies,hN_piNcex_costh,hN_piNcex_xsec);
657 }
658
659
660 {
661 const int hN_piNabs_nfiles = 19;
662 const int hN_piNabs_points_per_file = 21;
663 const int hN_piNabs_npoints = hN_piNabs_points_per_file * hN_piNabs_nfiles;
664
665 double hN_piNabs_energies[hN_piNabs_nfiles] = {
666 50, 75, 100, 125, 150, 175, 200, 225, 250, 275,
667 300, 325, 350, 375, 400, 425, 450, 475, 500
668 };
669
670 double hN_piNabs_costh [hN_piNabs_points_per_file];
671 double hN_piNabs_xsec [hN_piNabs_npoints];
672
673 int ipoint=0;
674
675 for(int ifile = 0; ifile < hN_piNabs_nfiles; ifile++) {
676
677 ostringstream hN_datafile;
678 double ke = hN_piNabs_energies[ifile];
679 hN_datafile << data_dir << "/diff_ang/pid2p/pid2p" << ke << ".txt";
680
682 hN_datafile.str(), ke, hN_piNabs_points_per_file,
683 ipoint, hN_piNabs_costh, hN_piNabs_xsec,2);
684 }
685
686 fhN2dXSecPiN_Abs =
new BLI2DNonUnifGrid(hN_piNabs_nfiles,hN_piNabs_points_per_file,
687 hN_piNabs_energies,hN_piNabs_costh,hN_piNabs_xsec);
688 }
689
690
691 {
692 const int hN_gampi0pInelas_nfiles = 29;
693 const int hN_gampi0pInelas_points_per_file = 37;
694 const int hN_gampi0pInelas_npoints = hN_gampi0pInelas_points_per_file * hN_gampi0pInelas_nfiles;
695
696 double hN_gampi0pInelas_energies[hN_gampi0pInelas_nfiles] = {
697 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
698 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
699 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
700 };
701
702 double hN_gampi0pInelas_costh [hN_gampi0pInelas_points_per_file];
703 double hN_gampi0pInelas_xsec [hN_gampi0pInelas_npoints];
704
705 int ipoint=0;
706
707 for(int ifile = 0; ifile < hN_gampi0pInelas_nfiles; ifile++) {
708
709 ostringstream hN_datafile;
710 double ke = hN_gampi0pInelas_energies[ifile];
711 hN_datafile << data_dir << "/diff_ang/gampi0p/" << ke << "-pi0p.txt";
712
714 hN_datafile.str(), ke, hN_gampi0pInelas_points_per_file,
715 ipoint, hN_gampi0pInelas_costh, hN_gampi0pInelas_xsec,3);
716 }
717
719 hN_gampi0pInelas_energies,hN_gampi0pInelas_costh,hN_gampi0pInelas_xsec);
720 }
721
722
723 {
724 const int hN_gampi0nInelas_nfiles = 29;
725 const int hN_gampi0nInelas_points_per_file = 37;
726 const int hN_gampi0nInelas_npoints = hN_gampi0nInelas_points_per_file * hN_gampi0nInelas_nfiles;
727
728 double hN_gampi0nInelas_energies[hN_gampi0nInelas_nfiles] = {
729 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
730 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
731 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
732 };
733
734 double hN_gampi0nInelas_costh [hN_gampi0nInelas_points_per_file];
735 double hN_gampi0nInelas_xsec [hN_gampi0nInelas_npoints];
736 int ipoint=0;
737
738 for(int ifile = 0; ifile < hN_gampi0nInelas_nfiles; ifile++) {
739
740 ostringstream hN_datafile;
741 double ke = hN_gampi0nInelas_energies[ifile];
742 hN_datafile << data_dir << "/diff_ang/gampi0n/" << ke << "-pi0n.txt";
743
745 hN_datafile.str(), ke, hN_gampi0nInelas_points_per_file,
746 ipoint, hN_gampi0nInelas_costh, hN_gampi0nInelas_xsec,3);
747 }
748
750 hN_gampi0nInelas_energies,hN_gampi0nInelas_costh,hN_gampi0nInelas_xsec);
751 }
752
753
754 {
755 const int hN_gampipnInelas_nfiles = 29;
756 const int hN_gampipnInelas_points_per_file = 37;
757 const int hN_gampipnInelas_npoints = hN_gampipnInelas_points_per_file * hN_gampipnInelas_nfiles;
758
759 double hN_gampipnInelas_energies[hN_gampipnInelas_nfiles] = {
760 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
761 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
762 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
763 };
764
765 double hN_gampipnInelas_costh [hN_gampipnInelas_points_per_file];
766 double hN_gampipnInelas_xsec [hN_gampipnInelas_npoints];
767
768 int ipoint=0;
769
770 for(int ifile = 0; ifile < hN_gampipnInelas_nfiles; ifile++) {
771
772 ostringstream hN_datafile;
773 double ke = hN_gampipnInelas_energies[ifile];
774 hN_datafile << data_dir << "/diff_ang/gampi+n/" << ke << "-pi+n.txt";
775
777 hN_datafile.str(), ke, hN_gampipnInelas_points_per_file,
778 ipoint, hN_gampipnInelas_costh, hN_gampipnInelas_xsec,3);
779 }
780
782 hN_gampipnInelas_energies,hN_gampipnInelas_costh,hN_gampipnInelas_xsec);
783 }
784
785
786 {
787 const int hN_gampimpInelas_nfiles = 29;
788 const int hN_gampimpInelas_points_per_file = 37;
789 const int hN_gampimpInelas_npoints = hN_gampimpInelas_points_per_file * hN_gampimpInelas_nfiles;
790
791 double hN_gampimpInelas_energies[hN_gampimpInelas_nfiles] = {
792 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
793 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
794 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
795 };
796
797 double hN_gampimpInelas_costh [hN_gampimpInelas_points_per_file];
798 double hN_gampimpInelas_xsec [hN_gampimpInelas_npoints];
799
800 int ipoint=0;
801
802 for(int ifile = 0; ifile < hN_gampimpInelas_nfiles; ifile++) {
803
804 ostringstream hN_datafile;
805 double ke = hN_gampimpInelas_energies[ifile];
806 hN_datafile << data_dir << "/diff_ang/gampi-p/" << ke << "-pi-p.txt";
807
809 hN_datafile.str(), ke, hN_gampimpInelas_points_per_file,
810 ipoint, hN_gampimpInelas_costh, hN_gampimpInelas_xsec,3);
811 }
812
814 hN_gampimpInelas_energies,hN_gampimpInelas_costh,hN_gampimpInelas_xsec);
815 }
816
817
818
819
820 TFile TGraphs_file;
821 bool saveTGraphsToFile = false;
822
823 if (saveTGraphsToFile) {
824 string filename = "TGraphs.root";
825 LOG(
"INukeHadroData2018",
pNOTICE) <<
"Saving INTRANUKE hadron x-section data to ROOT file: " << filename;
826 TGraphs_file.Open(filename.c_str(), "RECREATE");
827 }
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864 {
865 const int pipAAbs_f_nfiles = 18;
866 const int pipAAbs_f_nuclei[pipAAbs_f_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
867 const int pipAAbs_f_npoints = 111;
868
870 TfracPipA_Abs->SetNameTitle(
"TfracPipA_Abs",
"TfracPipA_Abs");
872
873 int ipoint=0;
874 double x, y;
875 for(int ifile=0; ifile < pipAAbs_f_nfiles; ifile++) {
876 ostringstream ADep_datafile;
877 int nucleus = pipAAbs_f_nuclei[ifile];
878 ADep_datafile << data_dir << "/tot_xsec/pipA_abs_frac/pip" << nucleus << "_abs_frac.txt";
879 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
880 buff->SetNameTitle("buff","buff");
881 for(int i=0; i < buff->GetN(); i++) {
882 buff -> GetPoint(i,x,y);
884 ipoint++;
885 }
886 delete buff;
887 }
888 if (saveTGraphsToFile) {
890 }
891
892 }
893
894
895
896 {
897 const int pipACEx_f_nfiles = 18;
898 const int pipACEx_f_nuclei[pipACEx_f_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
899 const int pipACEx_f_npoints = 129;
900
902 TfracPipA_CEx->SetNameTitle(
"TfracPipA_CEx",
"TfracPipA_CEx");
904
905 int ipoint=0;
906 double x, y;
907
908 for(int ifile=0; ifile < pipACEx_f_nfiles; ifile++) {
909 ostringstream ADep_datafile;
910 int nucleus = pipACEx_f_nuclei[ifile];
911 ADep_datafile << data_dir << "/tot_xsec/pipA_cex_frac/pip" << nucleus << "_cex_frac.txt";
912 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
913 buff->SetNameTitle("buff","buff");
914 for(int i=0; i < buff->GetN(); i++) {
915 buff -> GetPoint(i,x,y);
917 ipoint++;
918 }
919 delete buff;
920 }
921
922 if (saveTGraphsToFile) {
924 }
925
926 }
927
928
929
930
931 {
932 TGraph2D * TPipA_CEx;
933
934 const int pipACEx_nfiles = 18;
935 const int pipACEx_nuclei[pipACEx_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
936 const int pipACEx_npoints = 129;
937
938 TPipA_CEx = new TGraph2D(pipACEx_npoints);
939 TPipA_CEx->SetNameTitle("TPipA_CEx","TPipA_CEx");
940 TPipA_CEx->SetDirectory(0);
941
942 int ipoint=0;
943 double x, y;
944
945 for(int ifile=0; ifile < pipACEx_nfiles; ifile++) {
946 ostringstream ADep_datafile;
947 int nucleus = pipACEx_nuclei[ifile];
948 ADep_datafile << data_dir << "/tot_xsec/pipA_cex/pip" << nucleus << "_cex.txt";
949 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
950 buff->SetNameTitle("buff","buff");
951 for(int i=0; i < buff->GetN(); i++) {
952 buff -> GetPoint(i,x,y);
953 TPipA_CEx -> SetPoint(ipoint,(double)nucleus,x,y);
954 ipoint++;
955 }
956 delete buff;
957 }
958
959 if (saveTGraphsToFile) {
960 TPipA_CEx ->
Write(
"TPipA_CEx");
961 }
962 delete TPipA_CEx;
963
964 }
965
966
967 {
968 TGraph2D * TPipA_Abs;
969
970 const int pipAAbs_nfiles = 18;
971 const int pipAAbs_nuclei[pipAAbs_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
972 const int pipAAbs_npoints = 111;
973
974 TPipA_Abs = new TGraph2D(pipAAbs_npoints);
975 TPipA_Abs->SetNameTitle("TPipA_Abs","TPipA_Abs");
976 TPipA_Abs->SetDirectory(0);
977
978 int ipoint=0;
979 double x, y;
980
981 for(int ifile=0; ifile < pipAAbs_nfiles; ifile++) {
982 ostringstream ADep_datafile;
983 int nucleus = pipAAbs_nuclei[ifile];
984 ADep_datafile << data_dir << "/tot_xsec/pipA_abs/pip" << nucleus << "_abs.txt";
985 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
986 buff->SetNameTitle("buff","buff");
987 for(int i=0; i < buff->GetN(); i++) {
988 buff -> GetPoint(i,x,y);
989 TPipA_Abs -> SetPoint(ipoint,(double)nucleus,x,y);
990 ipoint++;
991 }
992 delete buff;
993 }
994
995 if (saveTGraphsToFile) {
996 TPipA_Abs ->
Write(
"TPipA_Abs");
997 }
998 delete TPipA_Abs;
999
1000 }
1001
1002
1003 {
1004 TGraph2D * TPipA_Elas;
1005
1006 const int pipAElas_nfiles = 18;
1007 const int pipAElas_nuclei[pipAElas_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
1008 const int pipAElas_npoints = 125;
1009
1010 TPipA_Elas = new TGraph2D(pipAElas_npoints);
1011 TPipA_Elas->SetNameTitle("TPipA_Elas","TPipA_Elas");
1012 TPipA_Elas->SetDirectory(0);
1013
1014 int ipoint=0;
1015 double x, y;
1016
1017 for(int ifile=0; ifile < pipAElas_nfiles; ifile++) {
1018 ostringstream ADep_datafile;
1019 int nucleus = pipAElas_nuclei[ifile];
1020 ADep_datafile << data_dir << "/tot_xsec/pipA_elas/pip" << nucleus << "_elas.txt";
1021 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
1022 buff->SetNameTitle("buff","buff");
1023 for(int i=0; i < buff->GetN(); i++) {
1024 buff -> GetPoint(i,x,y);
1025 TPipA_Elas -> SetPoint(ipoint,(double)nucleus,x,y);
1026 ipoint++;
1027 }
1028 delete buff;
1029 }
1030
1031 if (saveTGraphsToFile) {
1032 TPipA_Elas ->
Write(
"TPipA_Elas");
1033 }
1034 delete TPipA_Elas;
1035 }
1036
1037
1038 {
1039 TGraph2D * TPipA_Inelas;
1040
1041 const int pipAInelas_nfiles = 20;
1042 const int pipAInelas_nuclei[pipAInelas_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 40, 48, 56, 58, 63, 93, 120, 165, 181, 208, 209};
1043 const int pipAInelas_npoints = 118;
1044
1045 TPipA_Inelas = new TGraph2D(pipAInelas_npoints);
1046 TPipA_Inelas->SetNameTitle("TPipA_Inelas","TPipA_Inelas");
1047 TPipA_Inelas->SetDirectory(0);
1048
1049 int ipoint=0;
1050 double x, y;
1051
1052 for(int ifile=0; ifile < pipAInelas_nfiles; ifile++) {
1053 ostringstream ADep_datafile;
1054 int nucleus = pipAInelas_nuclei[ifile];
1055 ADep_datafile << data_dir << "/tot_xsec/pipA_inelas/pip" << nucleus << "_inelas.txt";
1056 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
1057 buff->SetNameTitle("buff","buff");
1058 for(int i=0; i < buff->GetN(); i++) {
1059 buff -> GetPoint(i,x,y);
1060 TPipA_Inelas -> SetPoint(ipoint,(double)nucleus,x,y);
1061 ipoint++;
1062 }
1063 delete buff;
1064 }
1065
1066 if (saveTGraphsToFile) {
1067 TPipA_Inelas ->
Write(
"TPipA_Inelas");
1068 }
1069 delete TPipA_Inelas;
1070 }
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109 {
1110 const int pipAInelas_f_nfiles = 20;
1111 const int pipAInelas_f_nuclei[pipAInelas_f_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 40, 48, 56, 58, 63, 93, 120, 165, 181, 208, 209};
1112 const int pipAInelas_f_npoints = 118;
1113
1117
1118 int ipoint=0;
1119 double x, y;
1120
1121 for(int ifile=0; ifile < pipAInelas_f_nfiles; ifile++) {
1122 ostringstream ADep_datafile;
1123 int nucleus = pipAInelas_f_nuclei[ifile];
1124 ADep_datafile << data_dir << "/tot_xsec/pipA_inelas_frac/pip" << nucleus << "_inelas_frac.txt";
1125 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
1126 buff->SetNameTitle("buff","buff");
1127 for(int i=0; i < buff->GetN(); i++) {
1128 buff -> GetPoint(i,x,y);
1130 ipoint++;
1131 }
1132 delete buff;
1133 }
1134
1135 if (saveTGraphsToFile) {
1137 }
1138
1139 }
1140
1141
1142
1143 {
1144 const int pipAPiPro_f_nfiles = 17;
1145 const int pipAPiPro_f_nuclei[pipAPiPro_f_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 48, 56, 58, 63, 93, 120, 165, 181, 209};
1146 const int pipAPiPro_f_npoints = 76;
1147
1151
1152 int ipoint=0;
1153 double x, y;
1154
1155 for(int ifile=0; ifile < pipAPiPro_f_nfiles; ifile++) {
1156 ostringstream ADep_datafile;
1157 int nucleus = pipAPiPro_f_nuclei[ifile];
1158 ADep_datafile << data_dir << "/tot_xsec/pipA_pipro_frac/pip" << nucleus << "_pipro_frac.txt";
1159 TGraph * buff = new TGraph(ADep_datafile.str().c_str());
1160 buff->SetNameTitle("buff","buff");
1161 for(int i=0; i < buff->GetN(); i++) {
1162 buff -> GetPoint(i,x,y);
1164 ipoint++;
1165 }
1166 delete buff;
1167 }
1168
1169 if (saveTGraphsToFile) {
1171 }
1172 }
1173
1174 TGraphs_file.Close();
1175
1176 LOG(
"INukeData",
pINFO) <<
"Done building x-section splines...";
1177
1178}
void ReadhNFile(string filename, double ke, int npoints, int &curr_point, double *costh_array, double *xsec_array, int cols)