57 using std::ostringstream;
60 using namespace genie;
61 using namespace genie::constants;
72 this->LoadCrossSections();
82 delete fXSecPipn_Elas;
83 delete fXSecPipn_Reac;
86 delete fXSecPipp_Elas;
87 delete fXSecPipp_Reac;
104 delete fXSecPi0n_Tot;
105 delete fXSecPi0n_CEx;
106 delete fXSecPi0n_Elas;
107 delete fXSecPi0n_Reac;
108 delete fXSecPi0p_Tot;
109 delete fXSecPi0p_CEx;
110 delete fXSecPi0p_Elas;
111 delete fXSecPi0p_Reac;
112 delete fXSecPi0d_Abs;
115 delete fXSecKpn_Elas;
116 delete fXSecKpp_Elas;
124 delete fXSecGamN_Tot;
132 delete fFracPA_PiPro;
138 delete fFracNA_PiPro;
144 delete fhN2dXSecPP_Elas;
145 delete fhN2dXSecNP_Elas;
146 delete fhN2dXSecPipN_Elas;
147 delete fhN2dXSecPi0N_Elas;
148 delete fhN2dXSecPimN_Elas;
149 delete fhN2dXSecKpN_Elas;
150 delete fhN2dXSecKpP_Elas;
151 delete fhN2dXSecPiN_CEx;
152 delete fhN2dXSecPiN_Abs;
153 delete fhN2dXSecGamPi0P_Inelas;
154 delete fhN2dXSecGamPi0N_Inelas;
155 delete fhN2dXSecGamPipN_Inelas;
156 delete fhN2dXSecGamPimP_Inelas;
157 delete fhN2dXSecKpN_CEx;
160 delete TfracPipA_Abs;
161 delete TfracPipA_CEx;
163 delete TfracPipA_Inelas;
164 delete TfracPipA_PiPro;
178 LOG(
"INukeData",
pINFO) <<
"INukeHadroData2018 late initialization";
192 string data_dir = (gSystem->Getenv(
"GINUKEHADRONDATA")) ?
193 string(gSystem->Getenv(
"GINUKEHADRONDATA")) :
194 string(gSystem->Getenv(
"GENIE")) +
string(
"/data/evgen/intranuke");
197 <<
"Loading INTRANUKE hadron data from: " << data_dir;
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";
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()) );
219 LOG(
"INukeData",
pINFO) <<
"Found all necessary data files...";
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");
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");
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();
255 LOG(
"INukeData",
pINFO) <<
"Done loading all x-section files...";
260 fXSecPp_Tot =
new Spline(&data_NN,
"ke:pp_tot");
261 fXSecPp_Elas =
new Spline(&data_NN,
"ke:pp_elas");
262 fXSecPp_Reac =
new Spline(&data_NN,
"ke:pp_reac");
263 fXSecPn_Tot =
new Spline(&data_NN,
"ke:pn_tot");
264 fXSecPn_Elas =
new Spline(&data_NN,
"ke:pn_elas");
265 fXSecPn_Reac =
new Spline(&data_NN,
"ke:pn_reac");
266 fXSecNn_Tot =
new Spline(&data_NN,
"ke:nn_tot");
267 fXSecNn_Elas =
new Spline(&data_NN,
"ke:nn_elas");
268 fXSecNn_Reac =
new Spline(&data_NN,
"ke:nn_reac");
269 fXSecPp_Cmp =
new Spline(&data_NN,
"ke:pp_cmp");
270 fXSecPn_Cmp =
new Spline(&data_NN,
"ke:pn_cmp");
271 fXSecNn_Cmp =
new Spline(&data_NN,
"ke:nn_cmp");
274 fXSecPipn_Tot =
new Spline(&data_pipN,
"ke:pipn_tot");
275 fXSecPipn_CEx =
new Spline(&data_pipN,
"ke:pipn_cex");
276 fXSecPipn_Elas =
new Spline(&data_pipN,
"ke:pipn_elas");
277 fXSecPipn_Reac =
new Spline(&data_pipN,
"ke:pipn_reac");
278 fXSecPipp_Tot =
new Spline(&data_pipN,
"ke:pipp_tot");
279 fXSecPipp_CEx =
new Spline(&data_pipN,
"ke:pipp_cex");
280 fXSecPipp_Elas =
new Spline(&data_pipN,
"ke:pipp_elas");
281 fXSecPipp_Reac =
new Spline(&data_pipN,
"ke:pipp_reac");
282 fXSecPipd_Abs =
new Spline(&data_pipN,
"ke:pipd_abs");
285 fXSecPi0n_Tot =
new Spline(&data_pi0N,
"ke:pi0n_tot");
286 fXSecPi0n_CEx =
new Spline(&data_pi0N,
"ke:pi0n_cex");
287 fXSecPi0n_Elas =
new Spline(&data_pi0N,
"ke:pi0n_elas");
288 fXSecPi0n_Reac =
new Spline(&data_pi0N,
"ke:pi0n_reac");
289 fXSecPi0p_Tot =
new Spline(&data_pi0N,
"ke:pi0p_tot");
290 fXSecPi0p_CEx =
new Spline(&data_pi0N,
"ke:pi0p_cex");
291 fXSecPi0p_Elas =
new Spline(&data_pi0N,
"ke:pi0p_elas");
292 fXSecPi0p_Reac =
new Spline(&data_pi0N,
"ke:pi0p_reac");
293 fXSecPi0d_Abs =
new Spline(&data_pi0N,
"ke:pi0d_abs");
296 fXSecKpn_Elas =
new Spline(&data_kN,
"ke:kpn_elas");
297 fXSecKpp_Elas =
new Spline(&data_kN,
"ke:kpp_elas");
298 fXSecKpn_CEx =
new Spline(&data_kN,
"ke:kpn_cex");
300 fXSecKpN_Tot =
new Spline(&data_kN,
"ke:kpN_tot");
303 fXSecGamp_fs =
new Spline(&data_gamN,
"ke:gamp_fs");
304 fXSecGamn_fs =
new Spline(&data_gamN,
"ke:gamn_fs");
305 fXSecGamN_Tot =
new Spline(&data_gamN,
"ke:gamN_tot");
308 fFracPA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
310 fFracPA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
311 fFracPA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
312 fFracPA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
313 fFracPA_PiPro =
new Spline(&data_NA,
"ke:pA_pipro");
314 fFracNA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
316 fFracNA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
317 fFracNA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
318 fFracNA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
319 fFracNA_PiPro =
new Spline(&data_NA,
"ke:pA_pipro");
321 fFracPA_Cmp =
new Spline(&data_NA,
"ke:pA_cmp");
322 fFracNA_Cmp =
new Spline(&data_NA,
"ke:pA_cmp");
325 fFracKA_Tot =
new Spline(&data_KA,
"ke:KA_tot");
326 fFracKA_Elas =
new Spline(&data_KA,
"ke:KA_elas");
328 fFracKA_Inel =
new Spline(&data_KA,
"ke:KA_inel");
329 fFracKA_Abs =
new Spline(&data_KA,
"ke:KA_abs");
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;
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
365 double hN_ppelas_costh [hN_ppelas_points_per_file];
366 double hN_ppelas_xsec [hN_ppelas_npoints];
370 for(
int ifile = 0; ifile < hN_ppelas_nfiles; ifile++) {
372 ostringstream hN_datafile;
373 double ke = hN_ppelas_energies[ifile];
374 hN_datafile << data_dir <<
"/diff_ang/pp/pp" << ke <<
".txt";
377 hN_datafile.str(), ke, hN_ppelas_points_per_file,
378 ipoint, hN_ppelas_costh, hN_ppelas_xsec,2);
381 fhN2dXSecPP_Elas =
new BLI2DNonUnifGrid(hN_ppelas_nfiles,hN_ppelas_points_per_file,
382 hN_ppelas_energies,hN_ppelas_costh,hN_ppelas_xsec);
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;
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
396 double hN_npelas_costh [hN_npelas_points_per_file];
397 double hN_npelas_xsec [hN_npelas_npoints];
401 for(
int ifile = 0; ifile < hN_npelas_nfiles; ifile++) {
403 ostringstream hN_datafile;
404 double ke = hN_npelas_energies[ifile];
405 hN_datafile << data_dir <<
"/diff_ang/pn/pn" << ke <<
".txt";
408 hN_datafile.str(), ke, hN_npelas_points_per_file,
409 ipoint, hN_npelas_costh, hN_npelas_xsec,2);
412 fhN2dXSecNP_Elas =
new BLI2DNonUnifGrid(hN_npelas_nfiles,hN_npelas_points_per_file,
413 hN_npelas_energies,hN_npelas_costh,hN_npelas_xsec);
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;
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
432 double hN_pipNelas_costh [hN_pipNelas_points_per_file];
433 double hN_pipNelas_xsec [hN_pipNelas_npoints];
437 for(
int ifile = 0; ifile < hN_pipNelas_nfiles; ifile++) {
439 ostringstream hN_datafile;
440 double ke = hN_pipNelas_energies[ifile];
441 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
444 hN_datafile.str(), ke, hN_pipNelas_points_per_file,
445 ipoint, hN_pipNelas_costh, hN_pipNelas_xsec,2);
448 fhN2dXSecPipN_Elas =
new BLI2DNonUnifGrid(hN_pipNelas_nfiles,hN_pipNelas_points_per_file,
449 hN_pipNelas_energies,hN_pipNelas_costh,hN_pipNelas_xsec);
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;
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
468 double hN_pi0Nelas_costh [hN_pi0Nelas_points_per_file];
469 double hN_pi0Nelas_xsec [hN_pi0Nelas_npoints];
473 for(
int ifile = 0; ifile < hN_pi0Nelas_nfiles; ifile++) {
475 ostringstream hN_datafile;
476 double ke = hN_pi0Nelas_energies[ifile];
477 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
480 hN_datafile.str(), ke, hN_pi0Nelas_points_per_file,
481 ipoint, hN_pi0Nelas_costh, hN_pi0Nelas_xsec,2);
484 fhN2dXSecPi0N_Elas =
new BLI2DNonUnifGrid(hN_pi0Nelas_nfiles,hN_pi0Nelas_points_per_file,
485 hN_pi0Nelas_energies,hN_pi0Nelas_costh,hN_pi0Nelas_xsec);
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;
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
504 double hN_pimNelas_costh [hN_pimNelas_points_per_file];
505 double hN_pimNelas_xsec [hN_pimNelas_npoints];
509 for(
int ifile = 0; ifile < hN_pimNelas_nfiles; ifile++) {
511 ostringstream hN_datafile;
512 double ke = hN_pimNelas_energies[ifile];
513 hN_datafile << data_dir <<
"/diff_ang/pim/pim" << ke <<
".txt";
516 hN_datafile.str(), ke, hN_pimNelas_points_per_file,
517 ipoint, hN_pimNelas_costh, hN_pimNelas_xsec,2);
520 fhN2dXSecPimN_Elas =
new BLI2DNonUnifGrid(hN_pimNelas_nfiles,hN_pimNelas_points_per_file,
521 hN_pimNelas_energies,hN_pimNelas_costh,hN_pimNelas_xsec);
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;
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
535 double hN_kpNelas_costh [hN_kpNelas_points_per_file];
536 double hN_kpNelas_xsec [hN_kpNelas_npoints];
540 for(
int ifile = 0; ifile < hN_kpNelas_nfiles; ifile++) {
542 ostringstream hN_datafile;
543 double ke = hN_kpNelas_energies[ifile];
544 hN_datafile << data_dir <<
"/diff_ang/kpn/kpn" << ke <<
".txt";
547 hN_datafile.str(), ke, hN_kpNelas_points_per_file,
548 ipoint, hN_kpNelas_costh, hN_kpNelas_xsec,2);
551 fhN2dXSecKpN_Elas =
new BLI2DNonUnifGrid(hN_kpNelas_nfiles,hN_kpNelas_points_per_file,
552 hN_kpNelas_energies,hN_kpNelas_costh,hN_kpNelas_xsec);
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;
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
565 double hN_kpNcex_costh [hN_kpNcex_points_per_file];
566 double hN_kpNcex_xsec [hN_kpNcex_npoints];
570 for(
int ifile = 0; ifile < hN_kpNcex_nfiles; ifile++) {
572 ostringstream hN_datafile;
573 double ke = hN_kpNcex_energies[ifile];
574 hN_datafile << data_dir <<
"/diff_ang/kpncex/kpcex" << ke <<
".txt";
577 hN_datafile.str(), ke, hN_kpNcex_points_per_file,
578 ipoint, hN_kpNcex_costh, hN_kpNcex_xsec,2);
586 fhN2dXSecKpN_CEx =
new BLI2DNonUnifGrid(hN_kpNcex_nfiles,hN_kpNcex_points_per_file,
587 hN_kpNcex_energies,hN_kpNcex_costh,hN_kpNcex_xsec);
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;
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
603 double hN_kpPelas_costh [hN_kpPelas_points_per_file];
604 double hN_kpPelas_xsec [hN_kpPelas_npoints];
608 for(
int ifile = 0; ifile < hN_kpPelas_nfiles; ifile++) {
610 ostringstream hN_datafile;
611 double ke = hN_kpPelas_energies[ifile];
612 hN_datafile << data_dir <<
"/diff_ang/kpp/kpp" << ke <<
".txt";
615 hN_datafile.str(), ke, hN_kpPelas_points_per_file,
616 ipoint, hN_kpPelas_costh, hN_kpPelas_xsec,2);
619 fhN2dXSecKpP_Elas =
new BLI2DNonUnifGrid(hN_kpPelas_nfiles,hN_kpPelas_points_per_file,
620 hN_kpPelas_energies,hN_kpPelas_costh,hN_kpPelas_xsec);
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;
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
639 double hN_piNcex_costh [hN_piNcex_points_per_file];
640 double hN_piNcex_xsec [hN_piNcex_npoints];
644 for(
int ifile = 0; ifile < hN_piNcex_nfiles; ifile++) {
646 ostringstream hN_datafile;
647 double ke = hN_piNcex_energies[ifile];
648 hN_datafile << data_dir <<
"/diff_ang/pie/pie" << ke <<
".txt";
651 hN_datafile.str(), ke, hN_piNcex_points_per_file,
652 ipoint, hN_piNcex_costh, hN_piNcex_xsec,2);
655 fhN2dXSecPiN_CEx =
new BLI2DNonUnifGrid(hN_piNcex_nfiles,hN_piNcex_points_per_file,
656 hN_piNcex_energies,hN_piNcex_costh,hN_piNcex_xsec);
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;
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
670 double hN_piNabs_costh [hN_piNabs_points_per_file];
671 double hN_piNabs_xsec [hN_piNabs_npoints];
675 for(
int ifile = 0; ifile < hN_piNabs_nfiles; ifile++) {
677 ostringstream hN_datafile;
678 double ke = hN_piNabs_energies[ifile];
679 hN_datafile << data_dir <<
"/diff_ang/pid2p/pid2p" << ke <<
".txt";
682 hN_datafile.str(), ke, hN_piNabs_points_per_file,
683 ipoint, hN_piNabs_costh, hN_piNabs_xsec,2);
686 fhN2dXSecPiN_Abs =
new BLI2DNonUnifGrid(hN_piNabs_nfiles,hN_piNabs_points_per_file,
687 hN_piNabs_energies,hN_piNabs_costh,hN_piNabs_xsec);
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;
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
702 double hN_gampi0pInelas_costh [hN_gampi0pInelas_points_per_file];
703 double hN_gampi0pInelas_xsec [hN_gampi0pInelas_npoints];
707 for(
int ifile = 0; ifile < hN_gampi0pInelas_nfiles; ifile++) {
709 ostringstream hN_datafile;
710 double ke = hN_gampi0pInelas_energies[ifile];
711 hN_datafile << data_dir <<
"/diff_ang/gampi0p/" << ke <<
"-pi0p.txt";
714 hN_datafile.str(), ke, hN_gampi0pInelas_points_per_file,
715 ipoint, hN_gampi0pInelas_costh, hN_gampi0pInelas_xsec,3);
718 fhN2dXSecGamPi0P_Inelas =
new BLI2DNonUnifGrid(hN_gampi0pInelas_nfiles,hN_gampi0pInelas_points_per_file,
719 hN_gampi0pInelas_energies,hN_gampi0pInelas_costh,hN_gampi0pInelas_xsec);
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;
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
734 double hN_gampi0nInelas_costh [hN_gampi0nInelas_points_per_file];
735 double hN_gampi0nInelas_xsec [hN_gampi0nInelas_npoints];
738 for(
int ifile = 0; ifile < hN_gampi0nInelas_nfiles; ifile++) {
740 ostringstream hN_datafile;
741 double ke = hN_gampi0nInelas_energies[ifile];
742 hN_datafile << data_dir <<
"/diff_ang/gampi0n/" << ke <<
"-pi0n.txt";
745 hN_datafile.str(), ke, hN_gampi0nInelas_points_per_file,
746 ipoint, hN_gampi0nInelas_costh, hN_gampi0nInelas_xsec,3);
749 fhN2dXSecGamPi0N_Inelas =
new BLI2DNonUnifGrid(hN_gampi0nInelas_nfiles,hN_gampi0nInelas_points_per_file,
750 hN_gampi0nInelas_energies,hN_gampi0nInelas_costh,hN_gampi0nInelas_xsec);
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;
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
765 double hN_gampipnInelas_costh [hN_gampipnInelas_points_per_file];
766 double hN_gampipnInelas_xsec [hN_gampipnInelas_npoints];
770 for(
int ifile = 0; ifile < hN_gampipnInelas_nfiles; ifile++) {
772 ostringstream hN_datafile;
773 double ke = hN_gampipnInelas_energies[ifile];
774 hN_datafile << data_dir <<
"/diff_ang/gampi+n/" << ke <<
"-pi+n.txt";
777 hN_datafile.str(), ke, hN_gampipnInelas_points_per_file,
778 ipoint, hN_gampipnInelas_costh, hN_gampipnInelas_xsec,3);
781 fhN2dXSecGamPipN_Inelas =
new BLI2DNonUnifGrid(hN_gampipnInelas_nfiles,hN_gampipnInelas_points_per_file,
782 hN_gampipnInelas_energies,hN_gampipnInelas_costh,hN_gampipnInelas_xsec);
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;
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
797 double hN_gampimpInelas_costh [hN_gampimpInelas_points_per_file];
798 double hN_gampimpInelas_xsec [hN_gampimpInelas_npoints];
802 for(
int ifile = 0; ifile < hN_gampimpInelas_nfiles; ifile++) {
804 ostringstream hN_datafile;
805 double ke = hN_gampimpInelas_energies[ifile];
806 hN_datafile << data_dir <<
"/diff_ang/gampi-p/" << ke <<
"-pi-p.txt";
809 hN_datafile.str(), ke, hN_gampimpInelas_points_per_file,
810 ipoint, hN_gampimpInelas_costh, hN_gampimpInelas_xsec,3);
813 fhN2dXSecGamPimP_Inelas =
new BLI2DNonUnifGrid(hN_gampimpInelas_nfiles,hN_gampimpInelas_points_per_file,
814 hN_gampimpInelas_energies,hN_gampimpInelas_costh,hN_gampimpInelas_xsec);
821 bool saveTGraphsToFile =
false;
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");
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;
869 TfracPipA_Abs =
new TGraph2D(pipAAbs_f_npoints);
870 TfracPipA_Abs->SetNameTitle(
"TfracPipA_Abs",
"TfracPipA_Abs");
871 TfracPipA_Abs->SetDirectory(0);
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);
883 TfracPipA_Abs -> SetPoint(ipoint,(
double)nucleus,x,y);
888 if (saveTGraphsToFile) {
889 TfracPipA_Abs ->
Write(
"TfracPipA_Abs");
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;
901 TfracPipA_CEx =
new TGraph2D(pipACEx_f_npoints);
902 TfracPipA_CEx->SetNameTitle(
"TfracPipA_CEx",
"TfracPipA_CEx");
903 TfracPipA_CEx->SetDirectory(0);
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);
916 TfracPipA_CEx -> SetPoint(ipoint,(
double)nucleus,x,y);
922 if (saveTGraphsToFile) {
923 TfracPipA_CEx ->
Write(
"TfracPipA_CEx");
932 TGraph2D * TPipA_CEx;
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;
938 TPipA_CEx =
new TGraph2D(pipACEx_npoints);
939 TPipA_CEx->SetNameTitle(
"TPipA_CEx",
"TPipA_CEx");
940 TPipA_CEx->SetDirectory(0);
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);
959 if (saveTGraphsToFile) {
960 TPipA_CEx ->
Write(
"TPipA_CEx");
968 TGraph2D * TPipA_Abs;
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;
974 TPipA_Abs =
new TGraph2D(pipAAbs_npoints);
975 TPipA_Abs->SetNameTitle(
"TPipA_Abs",
"TPipA_Abs");
976 TPipA_Abs->SetDirectory(0);
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);
995 if (saveTGraphsToFile) {
996 TPipA_Abs ->
Write(
"TPipA_Abs");
1004 TGraph2D * TPipA_Elas;
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;
1010 TPipA_Elas =
new TGraph2D(pipAElas_npoints);
1011 TPipA_Elas->SetNameTitle(
"TPipA_Elas",
"TPipA_Elas");
1012 TPipA_Elas->SetDirectory(0);
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);
1031 if (saveTGraphsToFile) {
1032 TPipA_Elas ->
Write(
"TPipA_Elas");
1039 TGraph2D * TPipA_Inelas;
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;
1045 TPipA_Inelas =
new TGraph2D(pipAInelas_npoints);
1046 TPipA_Inelas->SetNameTitle(
"TPipA_Inelas",
"TPipA_Inelas");
1047 TPipA_Inelas->SetDirectory(0);
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);
1066 if (saveTGraphsToFile) {
1067 TPipA_Inelas ->
Write(
"TPipA_Inelas");
1069 delete TPipA_Inelas;
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;
1114 TfracPipA_Inelas =
new TGraph2D(pipAInelas_f_npoints);
1115 TfracPipA_Inelas->SetNameTitle(
"TfracPipA_Inelas",
"TfracPipA_Inelas");
1116 TfracPipA_Inelas->SetDirectory(0);
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);
1129 TfracPipA_Inelas -> SetPoint(ipoint,(
double)nucleus,x,y);
1135 if (saveTGraphsToFile) {
1136 TfracPipA_Inelas ->
Write(
"TfracPipA_Inelas");
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;
1148 TfracPipA_PiPro =
new TGraph2D(pipAPiPro_f_npoints);
1149 TfracPipA_PiPro->SetNameTitle(
"TfracPipA_PiPro",
"TfracPipA_PiPro");
1150 TfracPipA_PiPro->SetDirectory(0);
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);
1163 TfracPipA_PiPro -> SetPoint(ipoint,(
double)nucleus,x,y);
1169 if (saveTGraphsToFile) {
1170 TfracPipA_PiPro ->
Write(
"TfracPipA_PiPro");
1174 TGraphs_file.Close();
1176 LOG(
"INukeData",
pINFO) <<
"Done building x-section splines...";
1181 string filename,
double ke,
int npoints,
int & curr_point,
1182 double * costh_array,
double * xsec_array,
int cols)
1185 std::ifstream hN_stream(filename.c_str(), ios::in);
1186 if(!hN_stream.good()) {
1188 <<
"Error reading INTRANUKE/hN data from: " << filename;
1194 <<
"Error reading INTRANUKE/hN data from: " << filename;
1196 <<
"Too few columns: " << cols;
1201 <<
"Reading INTRANUKE/hN data from: " << filename;
1205 hN_stream.getline(cbuf,400);
1206 hN_stream.getline(cbuf,400);
1207 hN_stream.getline(cbuf,400);
1214 for(
int ip = 0; ip < npoints; ip++) {
1215 hN_stream >> angle >> xsec;
1217 for(
int ic = 0; ic < (cols-2); ic++) {
1222 <<
"Adding data point: (KE = " << ke <<
" MeV, angle = "
1223 << angle <<
", sigma = " << xsec <<
" mbarn)";
1224 costh_array[ip] = TMath::Cos(angle*
kPi/180.);
1225 xsec_array [curr_point] = xsec;
1231 int hpdgc,
int tgtpdgc,
int nppdgc,
INukeFateHN_t fate,
double ke,
double costh)
const
1243 double ke_eval = ke;
1244 double costh_eval = costh;
1246 costh_eval = TMath::Min(costh, 1.);
1247 costh_eval = TMath::Max(costh_eval, -1.);
1254 ke_eval = TMath::Min(ke_eval, 999.);
1255 ke_eval = TMath::Max(ke_eval, 50.);
1256 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
1262 ke_eval = TMath::Min(ke_eval, 999.);
1263 ke_eval = TMath::Max(ke_eval, 50.);
1264 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
1269 ke_eval = TMath::Min(ke_eval, 1499.);
1270 ke_eval = TMath::Max(ke_eval, 10.);
1271 return fhN2dXSecPipN_Elas->Evaluate(ke_eval, costh_eval);
1276 ke_eval = TMath::Min(ke_eval, 1499.);
1277 ke_eval = TMath::Max(ke_eval, 10.);
1278 return fhN2dXSecPi0N_Elas->Evaluate(ke_eval, costh_eval);
1283 ke_eval = TMath::Min(ke_eval, 1499.);
1284 ke_eval = TMath::Max(ke_eval, 10.);
1285 return fhN2dXSecPimN_Elas->Evaluate(ke_eval, costh_eval);
1290 ke_eval = TMath::Min(ke_eval, 1799.);
1291 ke_eval = TMath::Max(ke_eval, 100.);
1292 return fhN2dXSecKpN_Elas->Evaluate(ke_eval, costh_eval);
1297 ke_eval = TMath::Min(ke_eval, 1799.);
1298 ke_eval = TMath::Max(ke_eval, 100.);
1299 return fhN2dXSecKpP_Elas->Evaluate(ke_eval, costh_eval);
1307 ke_eval = TMath::Min(ke_eval, 1499.);
1308 ke_eval = TMath::Max(ke_eval, 10.);
1309 return fhN2dXSecPiN_CEx->Evaluate(ke_eval, costh_eval);
1314 LOG(
"INukeData",
pWARN) <<
"Inelastic pp does not exist!";
1315 ke_eval = TMath::Min(ke_eval, 999.);
1316 ke_eval = TMath::Max(ke_eval, 50.);
1317 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
1322 ke_eval = TMath::Min(ke_eval, 999.);
1323 ke_eval = TMath::Max(ke_eval, 50.);
1324 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
1327 ke_eval = TMath::Min(ke_eval, 1799.);
1328 ke_eval = TMath::Max(ke_eval, 100.);
1329 return fhN2dXSecKpN_CEx->Evaluate(ke_eval, costh_eval);
1337 ke_eval = TMath::Min(ke_eval, 499.);
1338 ke_eval = TMath::Max(ke_eval, 50.);
1339 return fhN2dXSecPiN_Abs->Evaluate(ke_eval, costh_eval);
1341 if(hpdgc==
kPdgKP)
return 1.;
1347 ke_eval = TMath::Min(ke_eval, 1199.);
1348 ke_eval = TMath::Max(ke_eval, 160.);
1349 return fhN2dXSecGamPi0P_Inelas->Evaluate(ke_eval, costh_eval);
1354 ke_eval = TMath::Min(ke_eval, 1199.);
1355 ke_eval = TMath::Max(ke_eval, 160.);
1356 return fhN2dXSecGamPipN_Inelas->Evaluate(ke_eval, costh_eval);
1361 ke_eval = TMath::Min(ke_eval, 1199.);
1362 ke_eval = TMath::Max(ke_eval, 160.);
1363 return fhN2dXSecGamPimP_Inelas->Evaluate(ke_eval, costh_eval);
1368 ke_eval = TMath::Min(ke_eval, 1199.);
1369 ke_eval = TMath::Max(ke_eval, 160.);
1370 return fhN2dXSecGamPi0N_Inelas->Evaluate(ke_eval, costh_eval);
1382 ke = TMath::Max(fMinKinEnergy, ke);
1383 ke = TMath::Min(fMaxKinEnergyHA, ke);
1385 targA = TMath::Min(208, targA);
1387 LOG(
"INukeData",
pDEBUG) <<
"Querying hA cross section at ke = " << ke <<
" and target " << targA;
1392 double frac_cex = TfracPipA_CEx->Interpolate(targA, ke);
1394 double frac_inelas = TfracPipA_Inelas->Interpolate(targA, ke);
1395 double frac_abs = TfracPipA_Abs->Interpolate(targA, ke);
1396 double frac_pipro = TfracPipA_PiPro->Interpolate(targA, ke);
1400 double total = frac_cex + frac_inelas + frac_abs + frac_pipro;
1402 if ( fate ==
kIHAFtCEx )
return frac_cex / total;
1404 else if ( fate ==
kIHAFtInelas )
return frac_inelas / total;
1405 else if ( fate ==
kIHAFtAbs )
return frac_abs / total;
1406 else if ( fate ==
kIHAFtPiProd )
return frac_pipro / total;
1408 std::string sign(
"+");
1409 if ( hpdgc ==
kPdgPiM ) sign =
"-";
1410 else if ( hpdgc ==
kPdgPi0 ) sign =
"0";
1416 LOG(
"INukeData",
pWARN) <<
"Can't handle particles with pdg code = " << hpdgc;
1424 ke = TMath::Max(fMinKinEnergy, ke);
1425 ke = TMath::Min(fMaxKinEnergyHA, ke);
1427 LOG(
"INukeData",
pDEBUG) <<
"Querying hA cross section at ke = " << ke;
1432 double frac_cex = fFracPA_CEx->Evaluate(ke);
1433 double frac_inelas = fFracPA_Inel->Evaluate(ke);
1434 double frac_abs = fFracPA_Abs->Evaluate(ke);
1435 double frac_pipro = fFracPA_PiPro->Evaluate(ke);
1436 double frac_comp = fFracPA_Cmp->Evaluate(ke);
1440 double total = frac_cex + frac_inelas + frac_abs + frac_pipro + frac_comp;
1442 if ( fate ==
kIHAFtCEx )
return frac_cex / total;
1444 else if ( fate ==
kIHAFtInelas )
return frac_inelas / total;
1445 else if ( fate ==
kIHAFtAbs )
return frac_abs / total;
1446 else if ( fate ==
kIHAFtPiProd )
return frac_pipro / total;
1447 else if ( fate ==
kIHAFtCmp )
return frac_comp / total;
1456 double frac_cex = fFracNA_CEx->Evaluate(ke);
1457 double frac_inelas = fFracNA_Inel->Evaluate(ke);
1458 double frac_abs = fFracNA_Abs->Evaluate(ke);
1459 double frac_pipro = fFracNA_PiPro->Evaluate(ke);
1460 double frac_comp = fFracNA_Cmp->Evaluate(ke);
1464 double total = frac_cex + frac_inelas + frac_abs + frac_pipro + frac_comp;
1466 if ( fate ==
kIHAFtCEx )
return frac_cex / total;
1468 else if ( fate ==
kIHAFtInelas )
return frac_inelas / total;
1469 else if ( fate ==
kIHAFtAbs )
return frac_abs / total;
1470 else if ( fate ==
kIHAFtPiProd )
return frac_pipro / total;
1471 else if ( fate ==
kIHAFtCmp )
return frac_comp / total;
1478 else if (hpdgc ==
kPdgKP) {
1480 double frac_inelas = fFracKA_Inel->Evaluate(ke);
1482 double frac_abs = fFracKA_Abs->Evaluate(ke);
1486 double total = frac_inelas + frac_abs;
1488 if ( fate ==
kIHAFtInelas )
return frac_inelas / total;
1489 else if ( fate ==
kIHAFtAbs )
return frac_abs / total;
1496 LOG(
"INukeData",
pWARN) <<
"Can't handle particles with pdg code = " << hpdgc;
1505 ke = TMath::Max(fMinKinEnergy, ke);
1506 ke = TMath::Min(fMaxKinEnergyHN, ke);
1508 LOG(
"INukeData",
pDEBUG) <<
"Querying hN cross section at ke = " << ke;
1514 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * targZ;
1515 xsec+= TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * (targA-targZ);
1517 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * targZ;
1518 xsec+= TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * (targA-targZ);
1520 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * targZ;
1521 xsec+= TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * (targA-targZ);
1523 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1531 }
else if (hpdgc ==
kPdgPiM) {
1533 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * targZ;
1534 xsec+= TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * (targA-targZ);
1536 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * targZ;
1537 xsec+= TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * (targA-targZ);
1539 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * targZ;
1540 xsec+= TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * (targA-targZ);
1542 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1550 }
else if (hpdgc ==
kPdgPi0) {
1552 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPi0p_CEx -> Evaluate(ke)) * targZ;
1553 xsec+= TMath::Max(0., fXSecPi0n_CEx -> Evaluate(ke)) * (targA-targZ);
1555 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPi0p_Elas -> Evaluate(ke)) * targZ;
1556 xsec+= TMath::Max(0., fXSecPi0n_Elas -> Evaluate(ke)) * (targA-targZ);
1558 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPi0p_Reac -> Evaluate(ke)) * targZ;
1559 xsec+= TMath::Max(0., fXSecPi0n_Reac -> Evaluate(ke)) * (targA-targZ);
1561 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPi0d_Abs -> Evaluate(ke)) * targA;
1571 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPp_Elas -> Evaluate(ke)) * targZ;
1572 xsec+= TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * (targA-targZ);
1574 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPp_Reac -> Evaluate(ke)) * targZ;
1575 xsec+= TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * (targA-targZ);
1577 else if (fate ==
kIHNFtCmp) {xsec = TMath::Max(0., fXSecPp_Cmp -> Evaluate(ke)) * targZ;
1578 xsec+= TMath::Max(0., fXSecPn_Cmp -> Evaluate(ke)) * (targA-targZ);
1588 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * targZ;
1589 xsec+= TMath::Max(0., fXSecNn_Elas -> Evaluate(ke)) * (targA-targZ);
1591 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * targZ;
1592 xsec+= TMath::Max(0., fXSecNn_Reac -> Evaluate(ke)) * (targA-targZ);
1594 else if (fate ==
kIHNFtCmp) {xsec = TMath::Max(0., fXSecPp_Cmp -> Evaluate(ke)) * targZ;
1595 xsec+= TMath::Max(0., fXSecPn_Cmp -> Evaluate(ke)) * (targA-targZ);
1603 }
else if (hpdgc ==
kPdgKP) {
1605 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecKpn_CEx -> Evaluate(ke)) * targZ;
1606 xsec+= TMath::Max(0., fXSecKpn_CEx -> Evaluate(ke)) * (targA-targZ);
1608 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecKpn_Elas -> Evaluate(ke)) * targZ;
1609 xsec+= TMath::Max(0., fXSecKpn_Elas -> Evaluate(ke)) * (targA-targZ);
1631 <<
"Can't handle particles with pdg code = " << hpdgc;
1641 ke = TMath::Max(fMinKinEnergy, ke);
1642 ke = TMath::Min(fMaxKinEnergyHN, ke);
1645 double xsec = this->XSec(hpdgc,fate,ke,targA,targZ);
1648 double xsec_tot = 0;
1649 if (hpdgc ==
kPdgPiP ){xsec_tot = TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * targZ;
1650 xsec_tot+= TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * (targA-targZ);}
1651 else if (hpdgc ==
kPdgPiM ){xsec_tot = TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * targZ;
1652 xsec_tot+= TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * (targA-targZ);}
1653 else if (hpdgc ==
kPdgPi0 ){xsec_tot = TMath::Max(0., fXSecPi0p_Tot -> Evaluate(ke)) * targZ;
1654 xsec_tot+= TMath::Max(0., fXSecPi0n_Tot -> Evaluate(ke)) * (targA-targZ);}
1655 else if (hpdgc ==
kPdgProton ){xsec_tot = TMath::Max(0., fXSecPp_Tot -> Evaluate(ke)) * targZ;
1656 xsec_tot+= TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * (targA-targZ);}
1657 else if (hpdgc ==
kPdgNeutron){xsec_tot = TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * targZ;
1658 xsec_tot+= TMath::Max(0., fXSecNn_Tot -> Evaluate(ke)) * (targA-targZ);}
1659 else if (hpdgc ==
kPdgGamma ) xsec_tot = TMath::Max(0., fXSecGamN_Tot -> Evaluate(ke));
1660 else if (hpdgc ==
kPdgKP ) xsec_tot = TMath::Max(0., fXSecKpN_Tot -> Evaluate(ke));
1663 double frac = (xsec_tot>0) ? xsec/xsec_tot : 0.;
1688 int numPoints = 1000;
1691 assert((numPoints%numEnv)==0);
1692 double sr = 2.0 / numEnv;
1693 double cstep = 2.0 / (numPoints);
1695 double ke = (p->
E() - p->
Mass()) * 1000.0;
1696 if (TMath::Abs((
int)ke-ke)<.01) ke+=.3;
1707 double * buff =
new double[numPoints/numEnv + 1];
1708 double ** dist =
new double*[numEnv];
1709 for(
int ih=0;ih<numEnv;ih++)
1711 dist[ih] =
new double[3];
1723 double totxsec = 0.0;
1724 for(
int i=0;i<numEnv;i++)
1726 double lbound = -1 + i*
sr;
1728 for(
int j=0;j<=numPoints / numEnv; j++)
1730 buff[j] = this->XSec(p->
Pdg(),target,scode,fate,ke,lbound+j*cstep);
1735 avg/= (double(numPoints)/double(numEnv));
1736 dist[i][0] = TMath::MaxElement(numPoints/numEnv+1,buff);
1738 dist[i][2] = dist[i][1] + ((i==0)?0.0:dist[i-1][2]);
1753 rval = rnd->
RndFsi().Rndm()*dist[numEnv-1][2];
1760 if(rval<=dist[env][2])
break;
1763 if(env==numEnv) env=numEnv - 1;
1771 rval = rnd->
RndFsi().Rndm()*dist[env][0];
1774 if(rval < this->XSec(p->
Pdg(),target,scode,fate,ke,val))
break;
1780 int NUM_POINTS=2000;
1782 double points[200]={0};
1783 for(
int k=0;k<NUM_POINTS;k++)
1785 points[int(k/10)]=this->XSec(p->
Pdg(),target,scode,fate,ke,-1+(2.0/NUM_POINTS)*k);
1786 if(points[
int(k/10)]>0) pvalues++;
1788 if(pvalues<(.05*NUM_POINTS))
1792 if(p->
P4()->P()<.005)
1794 val = 2*rnd->
RndFsi().Rndm()-1;
1799 LOG(
"Intranuke",
pWARN) <<
"Hung-up in IntBounce method - Exiting";
1802 for(
int ie=0;ie<200;ie+=10) {
1803 LOG(
"Intranuke",
pWARN) << points[ie+0] <<
", " << points[ie+1] <<
", " << points[ie+2] <<
", "
1804 << points[ie+3] <<
", " << points[ie+4] <<
", " << points[ie+5] <<
", " << points[ie+6] <<
", "
1805 << points[ie+7] <<
", " << points[ie+8] <<
", " << points[ie+9];
1807 for(
int ih=0;ih<numEnv;ih++)
1820 for(
int ih=0;ih<numEnv;ih++)
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
double Frac(int hpdgc, INukeFateHN_t fate, double ke, int targA=0, int targZ=0) const
double E(void) const
Get energy.
static RandomGen * Instance()
Access instance.
const TLorentzVector * P4(void) const
A numeric analysis tool class for interpolating 1-D functions.
double Mass(void) const
Mass that corresponds to the PDG code.
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double FracADep(int hpdgc, INukeFateHA_t fate, double ke, int targA) const
void ReadhNFile(string filename, double ke, int npoints, int &curr_point, double *costh_array, double *xsec_array, int cols)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
enum genie::EINukeFateHN_t INukeFateHN_t
void DummyMethodAndSilentCompiler()
double FracAIndep(int hpdgc, INukeFateHA_t fate, double ke) const
static INukeHadroData2018 * fInstance
static double fMinKinEnergy
static INukeHadroData2018 * Instance(void)
static string AsString(INukeFateHN_t fate)
void LoadCrossSections(void)
static double fMaxKinEnergyHA
static double fMaxKinEnergyHN
static constexpr double sr
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
enum genie::EINukeFateHA_t INukeFateHA_t
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
double XSec(int hpdgc, int tgt, int nprod, INukeFateHN_t rxnType, double ke, double costh) const