52 using std::ostringstream;
55 using namespace genie;
67 this->LoadCrossSections();
76 delete fXSecPipn_Elas;
77 delete fXSecPipn_Reac;
80 delete fXSecPipp_Elas;
81 delete fXSecPipp_Reac;
100 delete fXSecPi0n_Elas;
101 delete fXSecPi0n_Reac;
102 delete fXSecPi0p_Tot;
103 delete fXSecPi0p_CEx;
104 delete fXSecPi0p_Elas;
105 delete fXSecPi0p_Reac;
106 delete fXSecPi0d_Abs;
109 delete fXSecKpn_Elas;
110 delete fXSecKpp_Elas;
117 delete fXSecGamN_Tot;
125 delete fFracPA_PiPro;
131 delete fFracNA_PiPro;
134 delete fhN2dXSecPP_Elas;
135 delete fhN2dXSecNP_Elas;
136 delete fhN2dXSecPipN_Elas;
137 delete fhN2dXSecPi0N_Elas;
138 delete fhN2dXSecPimN_Elas;
139 delete fhN2dXSecKpN_Elas;
140 delete fhN2dXSecKpP_Elas;
141 delete fhN2dXSecPiN_CEx;
142 delete fhN2dXSecPiN_Abs;
143 delete fhN2dXSecGamPi0P_Inelas;
144 delete fhN2dXSecGamPi0N_Inelas;
145 delete fhN2dXSecGamPipN_Inelas;
146 delete fhN2dXSecGamPimP_Inelas;
152 LOG(
"INukeData",
pINFO) <<
"INukeHadroData2014 late initialization";
166 string data_dir = (gSystem->Getenv(
"GINUKEHADRONDATA")) ?
167 string(gSystem->Getenv(
"GINUKEHADRONDATA")) :
168 string(gSystem->Getenv(
"GENIE")) +
string(
"/data/evgen/intranuke");
171 <<
"Loading INTRANUKE hadron data from: " <<
data_dir;
175 string datafile_NN = data_dir +
"/tot_xsec/intranuke-xsections-NN2014.dat";
176 string datafile_pipN = data_dir +
"/tot_xsec/intranuke-xsections-pi+N.dat";
177 string datafile_pi0N = data_dir +
"/tot_xsec/intranuke-xsections-pi0N.dat";
178 string datafile_NA = data_dir +
"/tot_xsec/intranuke-fractions-NA.dat";
179 string datafile_KA = data_dir +
"/tot_xsec/intranuke-fractions-KA.dat";
180 string datafile_gamN = data_dir +
"/tot_xsec/intranuke-xsections-gamN.dat";
181 string datafile_kN = data_dir +
"/tot_xsec/intranuke-xsections-kaonN.dat";
185 assert( ! gSystem->AccessPathName(datafile_NN. c_str()) );
186 assert( ! gSystem->AccessPathName(datafile_pipN.c_str()) );
187 assert( ! gSystem->AccessPathName(datafile_pi0N.c_str()) );
188 assert( ! gSystem->AccessPathName(datafile_KA. c_str()) );
189 assert( ! gSystem->AccessPathName(datafile_gamN.c_str()) );
190 assert( ! gSystem->AccessPathName(datafile_kN. c_str()) );
192 LOG(
"INukeData",
pINFO) <<
"Found all necessary data files...";
204 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");
205 data_pipN.ReadFile(datafile_pipN.c_str(),
206 "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");
207 data_pi0N.ReadFile(datafile_pi0N.c_str(),
208 "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");
209 data_NA.ReadFile(datafile_NA.c_str(),
210 "ke/D:pA_tot/D:pA_elas/D:pA_inel/D:pA_cex/D:pA_abs/D:pA_pipro/D");
211 data_gamN.ReadFile(datafile_gamN.c_str(),
212 "ke/D:pi0p_tot/D:pipn_tot/D:pimp_tot/D:pi0n_tot/D:gamp_fs/D:gamn_fs/D:gamN_tot/D");
213 data_kN.ReadFile(datafile_kN.c_str(),
214 "ke/D:kpn_elas/D:kpp_elas/D:kp_abs/D:kpN_tot/D");
215 data_KA.ReadFile(datafile_KA.c_str(),
216 "ke/D:KA_tot/D:KA_elas/D:KA_inel/D:KA_abs/D");
218 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NN : " << data_NN.GetEntries();
219 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pipN : " << data_pipN.GetEntries();
220 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pi0N : " << data_pi0N.GetEntries();
221 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NA : " << data_NA.GetEntries();
222 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in KA : " << data_KA.GetEntries();
223 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in gamN : " << data_gamN.GetEntries();
224 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in kN : " << data_kN.GetEntries();
226 LOG(
"INukeData",
pINFO) <<
"Done loading all x-section files...";
231 fXSecPp_Tot =
new Spline(&data_NN,
"ke:pp_tot");
232 fXSecPp_Elas =
new Spline(&data_NN,
"ke:pp_elas");
233 fXSecPp_Reac =
new Spline(&data_NN,
"ke:pp_reac");
234 fXSecPn_Tot =
new Spline(&data_NN,
"ke:pn_tot");
235 fXSecPn_Elas =
new Spline(&data_NN,
"ke:pn_elas");
236 fXSecPn_Reac =
new Spline(&data_NN,
"ke:pn_reac");
237 fXSecNn_Tot =
new Spline(&data_NN,
"ke:nn_tot");
238 fXSecNn_Elas =
new Spline(&data_NN,
"ke:nn_elas");
239 fXSecNn_Reac =
new Spline(&data_NN,
"ke:nn_reac");
240 fXSecPp_Cmp =
new Spline(&data_NN,
"ke:pp_cmp");
241 fXSecPn_Cmp =
new Spline(&data_NN,
"ke:pn_cmp");
242 fXSecNn_Cmp =
new Spline(&data_NN,
"ke:nn_cmp");
245 fXSecPipn_Tot =
new Spline(&data_pipN,
"ke:pipn_tot");
246 fXSecPipn_CEx =
new Spline(&data_pipN,
"ke:pipn_cex");
247 fXSecPipn_Elas =
new Spline(&data_pipN,
"ke:pipn_elas");
248 fXSecPipn_Reac =
new Spline(&data_pipN,
"ke:pipn_reac");
249 fXSecPipp_Tot =
new Spline(&data_pipN,
"ke:pipp_tot");
250 fXSecPipp_CEx =
new Spline(&data_pipN,
"ke:pipp_cex");
251 fXSecPipp_Elas =
new Spline(&data_pipN,
"ke:pipp_elas");
252 fXSecPipp_Reac =
new Spline(&data_pipN,
"ke:pipp_reac");
253 fXSecPipd_Abs =
new Spline(&data_pipN,
"ke:pipd_abs");
256 fXSecPi0n_Tot =
new Spline(&data_pi0N,
"ke:pi0n_tot");
257 fXSecPi0n_CEx =
new Spline(&data_pi0N,
"ke:pi0n_cex");
258 fXSecPi0n_Elas =
new Spline(&data_pi0N,
"ke:pi0n_elas");
259 fXSecPi0n_Reac =
new Spline(&data_pi0N,
"ke:pi0n_reac");
260 fXSecPi0p_Tot =
new Spline(&data_pi0N,
"ke:pi0p_tot");
261 fXSecPi0p_CEx =
new Spline(&data_pi0N,
"ke:pi0p_cex");
262 fXSecPi0p_Elas =
new Spline(&data_pi0N,
"ke:pi0p_elas");
263 fXSecPi0p_Reac =
new Spline(&data_pi0N,
"ke:pi0p_reac");
264 fXSecPi0d_Abs =
new Spline(&data_pi0N,
"ke:pi0d_abs");
267 fXSecKpn_Elas =
new Spline(&data_kN,
"ke:kpn_elas");
268 fXSecKpp_Elas =
new Spline(&data_kN,
"ke:kpp_elas");
269 fXSecKpN_Abs =
new Spline(&data_kN,
"ke:kp_abs");
270 fXSecKpN_Tot =
new Spline(&data_kN,
"ke:kpN_tot");
273 fXSecGamp_fs =
new Spline(&data_gamN,
"ke:gamp_fs");
274 fXSecGamn_fs =
new Spline(&data_gamN,
"ke:gamn_fs");
275 fXSecGamN_Tot =
new Spline(&data_gamN,
"ke:gamN_tot");
278 fFracPA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
279 fFracPA_Elas =
new Spline(&data_NA,
"ke:pA_elas");
280 fFracPA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
281 fFracPA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
282 fFracPA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
283 fFracPA_PiPro =
new Spline(&data_NA,
"ke:pA_pipro");
284 fFracNA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
285 fFracNA_Elas =
new Spline(&data_NA,
"ke:pA_elas");
286 fFracNA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
287 fFracNA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
288 fFracNA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
289 fFracNA_PiPro =
new Spline(&data_NA,
"ke:pA_pipro");
292 fFracKA_Tot =
new Spline(&data_KA,
"ke:KA_tot");
293 fFracKA_Elas =
new Spline(&data_KA,
"ke:KA_elas");
294 fFracKA_Inel =
new Spline(&data_KA,
"ke:KA_inel");
295 fFracKA_Abs =
new Spline(&data_KA,
"ke:KA_abs");
322 const int hN_ppelas_nfiles = 20;
323 const int hN_ppelas_points_per_file = 21;
324 const int hN_ppelas_npoints = hN_ppelas_points_per_file * hN_ppelas_nfiles;
326 double hN_ppelas_energies[hN_ppelas_nfiles] = {
327 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
328 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
331 double hN_ppelas_costh [hN_ppelas_points_per_file];
332 double hN_ppelas_xsec [hN_ppelas_npoints];
336 for(
int ifile = 0; ifile < hN_ppelas_nfiles; ifile++) {
338 ostringstream hN_datafile;
339 double ke = hN_ppelas_energies[ifile];
340 hN_datafile << data_dir <<
"/diff_ang/pp/pp" << ke <<
".txt";
343 hN_datafile.str(), ke, hN_ppelas_points_per_file,
344 ipoint, hN_ppelas_costh, hN_ppelas_xsec,2);
347 fhN2dXSecPP_Elas =
new BLI2DNonUnifGrid(hN_ppelas_nfiles,hN_ppelas_points_per_file,
348 hN_ppelas_energies,hN_ppelas_costh,hN_ppelas_xsec);
353 const int hN_npelas_nfiles = 20;
354 const int hN_npelas_points_per_file = 21;
355 const int hN_npelas_npoints = hN_npelas_points_per_file * hN_npelas_nfiles;
357 double hN_npelas_energies[hN_npelas_nfiles] = {
358 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
359 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
362 double hN_npelas_costh [hN_npelas_points_per_file];
363 double hN_npelas_xsec [hN_npelas_npoints];
367 for(
int ifile = 0; ifile < hN_npelas_nfiles; ifile++) {
369 ostringstream hN_datafile;
370 double ke = hN_npelas_energies[ifile];
371 hN_datafile << data_dir <<
"/diff_ang/pn/pn" << ke <<
".txt";
374 hN_datafile.str(), ke, hN_npelas_points_per_file,
375 ipoint, hN_npelas_costh, hN_npelas_xsec,2);
378 fhN2dXSecNP_Elas =
new BLI2DNonUnifGrid(hN_npelas_nfiles,hN_npelas_points_per_file,
379 hN_npelas_energies,hN_npelas_costh,hN_npelas_xsec);
384 const int hN_pipNelas_nfiles = 60;
385 const int hN_pipNelas_points_per_file = 21;
386 const int hN_pipNelas_npoints = hN_pipNelas_points_per_file * hN_pipNelas_nfiles;
388 double hN_pipNelas_energies[hN_pipNelas_nfiles] = {
389 10, 20, 30, 40, 50, 60, 70, 80, 90,
390 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
391 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
392 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
393 700, 740, 780, 820, 860, 900, 940, 980,
394 1020, 1060, 1100, 1140, 1180, 1220, 1260,
395 1300, 1340, 1380, 1420, 1460, 1500
398 double hN_pipNelas_costh [hN_pipNelas_points_per_file];
399 double hN_pipNelas_xsec [hN_pipNelas_npoints];
403 for(
int ifile = 0; ifile < hN_pipNelas_nfiles; ifile++) {
405 ostringstream hN_datafile;
406 double ke = hN_pipNelas_energies[ifile];
407 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
410 hN_datafile.str(), ke, hN_pipNelas_points_per_file,
411 ipoint, hN_pipNelas_costh, hN_pipNelas_xsec,2);
414 fhN2dXSecPipN_Elas =
new BLI2DNonUnifGrid(hN_pipNelas_nfiles,hN_pipNelas_points_per_file,
415 hN_pipNelas_energies,hN_pipNelas_costh,hN_pipNelas_xsec);
420 const int hN_pi0Nelas_nfiles = 60;
421 const int hN_pi0Nelas_points_per_file = 21;
422 const int hN_pi0Nelas_npoints = hN_pi0Nelas_points_per_file * hN_pi0Nelas_nfiles;
424 double hN_pi0Nelas_energies[hN_pi0Nelas_nfiles] = {
425 10, 20, 30, 40, 50, 60, 70, 80, 90,
426 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
427 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
428 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
429 700, 740, 780, 820, 860, 900, 940, 980,
430 1020, 1060, 1100, 1140, 1180, 1220, 1260,
431 1300, 1340, 1380, 1420, 1460, 1500
434 double hN_pi0Nelas_costh [hN_pi0Nelas_points_per_file];
435 double hN_pi0Nelas_xsec [hN_pi0Nelas_npoints];
439 for(
int ifile = 0; ifile < hN_pi0Nelas_nfiles; ifile++) {
441 ostringstream hN_datafile;
442 double ke = hN_pi0Nelas_energies[ifile];
443 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
446 hN_datafile.str(), ke, hN_pi0Nelas_points_per_file,
447 ipoint, hN_pi0Nelas_costh, hN_pi0Nelas_xsec,2);
450 fhN2dXSecPi0N_Elas =
new BLI2DNonUnifGrid(hN_pi0Nelas_nfiles,hN_pi0Nelas_points_per_file,
451 hN_pi0Nelas_energies,hN_pi0Nelas_costh,hN_pi0Nelas_xsec);
456 const int hN_pimNelas_nfiles = 60;
457 const int hN_pimNelas_points_per_file = 21;
458 const int hN_pimNelas_npoints = hN_pimNelas_points_per_file * hN_pimNelas_nfiles;
460 double hN_pimNelas_energies[hN_pimNelas_nfiles] = {
461 10, 20, 30, 40, 50, 60, 70, 80, 90,
462 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
463 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
464 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
465 700, 740, 780, 820, 860, 900, 940, 980,
466 1020, 1060, 1100, 1140, 1180, 1220, 1260,
467 1300, 1340, 1380, 1420, 1460, 1500
470 double hN_pimNelas_costh [hN_pimNelas_points_per_file];
471 double hN_pimNelas_xsec [hN_pimNelas_npoints];
475 for(
int ifile = 0; ifile < hN_pimNelas_nfiles; ifile++) {
477 ostringstream hN_datafile;
478 double ke = hN_pimNelas_energies[ifile];
479 hN_datafile << data_dir <<
"/diff_ang/pim/pim" << ke <<
".txt";
482 hN_datafile.str(), ke, hN_pimNelas_points_per_file,
483 ipoint, hN_pimNelas_costh, hN_pimNelas_xsec,2);
486 fhN2dXSecPimN_Elas =
new BLI2DNonUnifGrid(hN_pimNelas_nfiles,hN_pimNelas_points_per_file,
487 hN_pimNelas_energies,hN_pimNelas_costh,hN_pimNelas_xsec);
492 const int hN_kpNelas_nfiles = 18;
493 const int hN_kpNelas_points_per_file = 37;
494 const int hN_kpNelas_npoints = hN_kpNelas_points_per_file * hN_kpNelas_nfiles;
496 double hN_kpNelas_energies[hN_kpNelas_nfiles] = {
497 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
498 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
501 double hN_kpNelas_costh [hN_kpNelas_points_per_file];
502 double hN_kpNelas_xsec [hN_kpNelas_npoints];
506 for(
int ifile = 0; ifile < hN_kpNelas_nfiles; ifile++) {
508 ostringstream hN_datafile;
509 double ke = hN_kpNelas_energies[ifile];
510 hN_datafile << data_dir <<
"/diff_ang/kpn/kpn" << ke <<
".txt";
513 hN_datafile.str(), ke, hN_kpNelas_points_per_file,
514 ipoint, hN_kpNelas_costh, hN_kpNelas_xsec,2);
517 fhN2dXSecKpN_Elas =
new BLI2DNonUnifGrid(hN_kpNelas_nfiles,hN_kpNelas_points_per_file,
518 hN_kpNelas_energies,hN_kpNelas_costh,hN_kpNelas_xsec);
523 const int hN_kpPelas_nfiles = 18;
524 const int hN_kpPelas_points_per_file = 37;
525 const int hN_kpPelas_npoints = hN_kpPelas_points_per_file * hN_kpPelas_nfiles;
527 double hN_kpPelas_energies[hN_kpPelas_nfiles] = {
528 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
529 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
532 double hN_kpPelas_costh [hN_kpPelas_points_per_file];
533 double hN_kpPelas_xsec [hN_kpPelas_npoints];
537 for(
int ifile = 0; ifile < hN_kpPelas_nfiles; ifile++) {
539 ostringstream hN_datafile;
540 double ke = hN_kpPelas_energies[ifile];
541 hN_datafile << data_dir <<
"/diff_ang/kpp/kpp" << ke <<
".txt";
544 hN_datafile.str(), ke, hN_kpPelas_points_per_file,
545 ipoint, hN_kpPelas_costh, hN_kpPelas_xsec,2);
548 fhN2dXSecKpP_Elas =
new BLI2DNonUnifGrid(hN_kpPelas_nfiles,hN_kpPelas_points_per_file,
549 hN_kpPelas_energies,hN_kpPelas_costh,hN_kpPelas_xsec);
554 const int hN_piNcex_nfiles = 60;
555 const int hN_piNcex_points_per_file = 21;
556 const int hN_piNcex_npoints = hN_piNcex_points_per_file * hN_piNcex_nfiles;
558 double hN_piNcex_energies[hN_piNcex_nfiles] = {
559 10, 20, 30, 40, 50, 60, 70, 80, 90,
560 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
561 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
562 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
563 700, 740, 780, 820, 860, 900, 940, 980,
564 1020, 1060, 1100, 1140, 1180, 1220, 1260,
565 1300, 1340, 1380, 1420, 1460, 1500
568 double hN_piNcex_costh [hN_piNcex_points_per_file];
569 double hN_piNcex_xsec [hN_piNcex_npoints];
573 for(
int ifile = 0; ifile < hN_piNcex_nfiles; ifile++) {
575 ostringstream hN_datafile;
576 double ke = hN_piNcex_energies[ifile];
577 hN_datafile << data_dir <<
"/diff_ang/pie/pie" << ke <<
".txt";
580 hN_datafile.str(), ke, hN_piNcex_points_per_file,
581 ipoint, hN_piNcex_costh, hN_piNcex_xsec,2);
584 fhN2dXSecPiN_CEx =
new BLI2DNonUnifGrid(hN_piNcex_nfiles,hN_piNcex_points_per_file,
585 hN_piNcex_energies,hN_piNcex_costh,hN_piNcex_xsec);
590 const int hN_piNabs_nfiles = 19;
591 const int hN_piNabs_points_per_file = 21;
592 const int hN_piNabs_npoints = hN_piNabs_points_per_file * hN_piNabs_nfiles;
594 double hN_piNabs_energies[hN_piNabs_nfiles] = {
595 50, 75, 100, 125, 150, 175, 200, 225, 250, 275,
596 300, 325, 350, 375, 400, 425, 450, 475, 500
599 double hN_piNabs_costh [hN_piNabs_points_per_file];
600 double hN_piNabs_xsec [hN_piNabs_npoints];
604 for(
int ifile = 0; ifile < hN_piNabs_nfiles; ifile++) {
606 ostringstream hN_datafile;
607 double ke = hN_piNabs_energies[ifile];
608 hN_datafile << data_dir <<
"/diff_ang/pid2p/pid2p" << ke <<
".txt";
611 hN_datafile.str(), ke, hN_piNabs_points_per_file,
612 ipoint, hN_piNabs_costh, hN_piNabs_xsec,2);
615 fhN2dXSecPiN_Abs =
new BLI2DNonUnifGrid(hN_piNabs_nfiles,hN_piNabs_points_per_file,
616 hN_piNabs_energies,hN_piNabs_costh,hN_piNabs_xsec);
621 const int hN_gampi0pInelas_nfiles = 29;
622 const int hN_gampi0pInelas_points_per_file = 37;
623 const int hN_gampi0pInelas_npoints = hN_gampi0pInelas_points_per_file * hN_gampi0pInelas_nfiles;
625 double hN_gampi0pInelas_energies[hN_gampi0pInelas_nfiles] = {
626 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
627 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
628 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
631 double hN_gampi0pInelas_costh [hN_gampi0pInelas_points_per_file];
632 double hN_gampi0pInelas_xsec [hN_gampi0pInelas_npoints];
636 for(
int ifile = 0; ifile < hN_gampi0pInelas_nfiles; ifile++) {
638 ostringstream hN_datafile;
639 double ke = hN_gampi0pInelas_energies[ifile];
640 hN_datafile << data_dir <<
"/diff_ang/gampi0p/" << ke <<
"-pi0p.txt";
643 hN_datafile.str(), ke, hN_gampi0pInelas_points_per_file,
644 ipoint, hN_gampi0pInelas_costh, hN_gampi0pInelas_xsec,3);
647 fhN2dXSecGamPi0P_Inelas =
new BLI2DNonUnifGrid(hN_gampi0pInelas_nfiles,hN_gampi0pInelas_points_per_file,
648 hN_gampi0pInelas_energies,hN_gampi0pInelas_costh,hN_gampi0pInelas_xsec);
653 const int hN_gampi0nInelas_nfiles = 29;
654 const int hN_gampi0nInelas_points_per_file = 37;
655 const int hN_gampi0nInelas_npoints = hN_gampi0nInelas_points_per_file * hN_gampi0nInelas_nfiles;
657 double hN_gampi0nInelas_energies[hN_gampi0nInelas_nfiles] = {
658 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
659 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
660 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
663 double hN_gampi0nInelas_costh [hN_gampi0nInelas_points_per_file];
664 double hN_gampi0nInelas_xsec [hN_gampi0nInelas_npoints];
667 for(
int ifile = 0; ifile < hN_gampi0nInelas_nfiles; ifile++) {
669 ostringstream hN_datafile;
670 double ke = hN_gampi0nInelas_energies[ifile];
671 hN_datafile << data_dir <<
"/diff_ang/gampi0n/" << ke <<
"-pi0n.txt";
674 hN_datafile.str(), ke, hN_gampi0nInelas_points_per_file,
675 ipoint, hN_gampi0nInelas_costh, hN_gampi0nInelas_xsec,3);
678 fhN2dXSecGamPi0N_Inelas =
new BLI2DNonUnifGrid(hN_gampi0nInelas_nfiles,hN_gampi0nInelas_points_per_file,
679 hN_gampi0nInelas_energies,hN_gampi0nInelas_costh,hN_gampi0nInelas_xsec);
684 const int hN_gampipnInelas_nfiles = 29;
685 const int hN_gampipnInelas_points_per_file = 37;
686 const int hN_gampipnInelas_npoints = hN_gampipnInelas_points_per_file * hN_gampipnInelas_nfiles;
688 double hN_gampipnInelas_energies[hN_gampipnInelas_nfiles] = {
689 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
690 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
691 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
694 double hN_gampipnInelas_costh [hN_gampipnInelas_points_per_file];
695 double hN_gampipnInelas_xsec [hN_gampipnInelas_npoints];
699 for(
int ifile = 0; ifile < hN_gampipnInelas_nfiles; ifile++) {
701 ostringstream hN_datafile;
702 double ke = hN_gampipnInelas_energies[ifile];
703 hN_datafile << data_dir <<
"/diff_ang/gampi+n/" << ke <<
"-pi+n.txt";
706 hN_datafile.str(), ke, hN_gampipnInelas_points_per_file,
707 ipoint, hN_gampipnInelas_costh, hN_gampipnInelas_xsec,3);
710 fhN2dXSecGamPipN_Inelas =
new BLI2DNonUnifGrid(hN_gampipnInelas_nfiles,hN_gampipnInelas_points_per_file,
711 hN_gampipnInelas_energies,hN_gampipnInelas_costh,hN_gampipnInelas_xsec);
716 const int hN_gampimpInelas_nfiles = 29;
717 const int hN_gampimpInelas_points_per_file = 37;
718 const int hN_gampimpInelas_npoints = hN_gampimpInelas_points_per_file * hN_gampimpInelas_nfiles;
720 double hN_gampimpInelas_energies[hN_gampimpInelas_nfiles] = {
721 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
722 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
723 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
726 double hN_gampimpInelas_costh [hN_gampimpInelas_points_per_file];
727 double hN_gampimpInelas_xsec [hN_gampimpInelas_npoints];
731 for(
int ifile = 0; ifile < hN_gampimpInelas_nfiles; ifile++) {
733 ostringstream hN_datafile;
734 double ke = hN_gampimpInelas_energies[ifile];
735 hN_datafile << data_dir <<
"/diff_ang/gampi-p/" << ke <<
"-pi-p.txt";
738 hN_datafile.str(), ke, hN_gampimpInelas_points_per_file,
739 ipoint, hN_gampimpInelas_costh, hN_gampimpInelas_xsec,3);
742 fhN2dXSecGamPimP_Inelas =
new BLI2DNonUnifGrid(hN_gampimpInelas_nfiles,hN_gampimpInelas_points_per_file,
743 hN_gampimpInelas_energies,hN_gampimpInelas_costh,hN_gampimpInelas_xsec);
750 bool saveTGraphsToFile =
true;
752 if (saveTGraphsToFile) {
754 LOG(
"INukeHadroData2014",
pNOTICE) <<
"Saving INTRANUKE hadron x-section data to ROOT file: " <<
filename;
755 TGraphs_file.Open(filename.c_str(),
"RECREATE");
760 const int pipATot_nfiles = 22;
761 const int pipATot_nuclei[pipATot_nfiles] = {1, 2, 3, 4, 6, 7, 9, 12, 16, 27, 28, 32, 40, 48, 56, 58, 63, 93, 120, 165, 181, 209};
762 const int pipATot_npoints = 203;
764 TPipA_Tot =
new TGraph2D(pipATot_npoints);
769 for(
int ifile=0; ifile < pipATot_nfiles; ifile++) {
770 ostringstream ADep_datafile;
771 int nucleus = pipATot_nuclei[ifile];
772 ADep_datafile << data_dir <<
"/tot_xsec/pipA_tot/pip" << nucleus <<
"_tot.txt";
773 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
774 for(
int i=0;
i < buff->GetN();
i++) {
775 buff -> GetPoint(
i,x,y);
776 TPipA_Tot -> SetPoint(ipoint,(
double)nucleus,x,y);
782 if (saveTGraphsToFile) {
783 TPipA_Tot -> Write(
"TPipA_Tot");
791 const int pipAAbs_f_nfiles = 18;
792 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};
793 const int pipAAbs_f_npoints = 111;
795 TfracPipA_Abs =
new TGraph2D(pipAAbs_f_npoints);
799 for(
int ifile=0; ifile < pipAAbs_f_nfiles; ifile++) {
800 ostringstream ADep_datafile;
801 int nucleus = pipAAbs_f_nuclei[ifile];
802 ADep_datafile << data_dir <<
"/tot_xsec/pipA_abs_frac/pip" << nucleus <<
"_abs_frac.txt";
803 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
804 for(
int i=0;
i < buff->GetN();
i++) {
805 buff -> GetPoint(
i,x,y);
806 TfracPipA_Abs -> SetPoint(ipoint,(
double)nucleus,x,y);
811 if (saveTGraphsToFile) {
812 TfracPipA_Abs -> Write(
"TfracPipA_Abs");
820 const int pipACEx_f_nfiles = 18;
821 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};
822 const int pipACEx_f_npoints = 129;
824 TfracPipA_CEx =
new TGraph2D(pipACEx_f_npoints);
829 for(
int ifile=0; ifile < pipACEx_f_nfiles; ifile++) {
830 ostringstream ADep_datafile;
831 int nucleus = pipACEx_f_nuclei[ifile];
832 ADep_datafile << data_dir <<
"/tot_xsec/pipA_cex_frac/pip" << nucleus <<
"_cex_frac.txt";
833 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
834 for(
int i=0;
i < buff->GetN();
i++) {
835 buff -> GetPoint(
i,x,y);
836 TfracPipA_CEx -> SetPoint(ipoint,(
double)nucleus,x,y);
842 if (saveTGraphsToFile) {
843 TfracPipA_CEx -> Write(
"TfracPipA_CEx");
852 TGraph2D * TPipA_CEx;
854 const int pipACEx_nfiles = 18;
855 const int pipACEx_nuclei[pipACEx_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
856 const int pipACEx_npoints = 129;
858 TPipA_CEx =
new TGraph2D(pipACEx_npoints);
863 for(
int ifile=0; ifile < pipACEx_nfiles; ifile++) {
864 ostringstream ADep_datafile;
865 int nucleus = pipACEx_nuclei[ifile];
866 ADep_datafile << data_dir <<
"/tot_xsec/pipA_cex/pip" << nucleus <<
"_cex.txt";
867 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
868 for(
int i=0;
i < buff->GetN();
i++) {
869 buff -> GetPoint(
i,x,y);
870 TPipA_CEx -> SetPoint(ipoint,(
double)nucleus,x,y);
876 if (saveTGraphsToFile) {
877 TPipA_CEx -> Write(
"TPipA_CEx");
884 TGraph2D * TPipA_Abs;
886 const int pipAAbs_nfiles = 18;
887 const int pipAAbs_nuclei[pipAAbs_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
888 const int pipAAbs_npoints = 111;
890 TPipA_Abs =
new TGraph2D(pipAAbs_npoints);
895 for(
int ifile=0; ifile < pipAAbs_nfiles; ifile++) {
896 ostringstream ADep_datafile;
897 int nucleus = pipAAbs_nuclei[ifile];
898 ADep_datafile << data_dir <<
"/tot_xsec/pipA_abs/pip" << nucleus <<
"_abs.txt";
899 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
900 for(
int i=0;
i < buff->GetN();
i++) {
901 buff -> GetPoint(
i,x,y);
902 TPipA_Abs -> SetPoint(ipoint,(
double)nucleus,x,y);
908 if (saveTGraphsToFile) {
909 TPipA_Abs -> Write(
"TPipA_Abs");
916 TGraph2D * TPipA_Elas;
918 const int pipAElas_nfiles = 18;
919 const int pipAElas_nuclei[pipAElas_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
920 const int pipAElas_npoints = 125;
922 TPipA_Elas =
new TGraph2D(pipAElas_npoints);
927 for(
int ifile=0; ifile < pipAElas_nfiles; ifile++) {
928 ostringstream ADep_datafile;
929 int nucleus = pipAElas_nuclei[ifile];
930 ADep_datafile << data_dir <<
"/tot_xsec/pipA_elas/pip" << nucleus <<
"_elas.txt";
931 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
932 for(
int i=0;
i < buff->GetN();
i++) {
933 buff -> GetPoint(
i,x,y);
934 TPipA_Elas -> SetPoint(ipoint,(
double)nucleus,x,y);
940 if (saveTGraphsToFile) {
941 TPipA_Elas -> Write(
"TPipA_Elas");
948 TGraph2D * TPipA_Inelas;
950 const int pipAInelas_nfiles = 20;
951 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};
952 const int pipAInelas_npoints = 118;
954 TPipA_Inelas =
new TGraph2D(pipAInelas_npoints);
959 for(
int ifile=0; ifile < pipAInelas_nfiles; ifile++) {
960 ostringstream ADep_datafile;
961 int nucleus = pipAInelas_nuclei[ifile];
962 ADep_datafile << data_dir <<
"/tot_xsec/pipA_inelas/pip" << nucleus <<
"_inelas.txt";
963 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
964 for(
int i=0;
i < buff->GetN();
i++) {
965 buff -> GetPoint(
i,x,y);
966 TPipA_Inelas -> SetPoint(ipoint,(
double)nucleus,x,y);
972 if (saveTGraphsToFile) {
973 TPipA_Inelas -> Write(
"TPipA_Inelas");
982 const int pipAElas_f_nfiles = 18;
983 const int pipAElas_f_nuclei[pipAElas_f_nfiles] = {1, 2, 3, 4, 7, 9, 12, 16, 27, 48, 56, 58, 63, 93, 120, 165, 181, 209};
984 const int pipAElas_f_npoints = 125;
986 TfracPipA_Elas =
new TGraph2D(pipAElas_f_npoints);
991 for(
int ifile=0; ifile < pipAElas_f_nfiles; ifile++) {
992 ostringstream ADep_datafile;
993 int nucleus = pipAElas_f_nuclei[ifile];
994 ADep_datafile << data_dir <<
"/tot_xsec/pipA_elas_frac/pip" << nucleus <<
"_elas_frac.txt";
995 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
996 for(
int i=0;
i < buff->GetN();
i++) {
997 buff -> GetPoint(
i,x,y);
998 TfracPipA_Elas -> SetPoint(ipoint,(
double)nucleus,x,y);
1004 if (saveTGraphsToFile) {
1005 TfracPipA_Elas -> Write(
"TfracPipA_Elas");
1013 const int pipAInelas_f_nfiles = 20;
1014 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};
1015 const int pipAInelas_f_npoints = 118;
1017 TfracPipA_Inelas =
new TGraph2D(pipAInelas_f_npoints);
1022 for(
int ifile=0; ifile < pipAInelas_f_nfiles; ifile++) {
1023 ostringstream ADep_datafile;
1024 int nucleus = pipAInelas_f_nuclei[ifile];
1025 ADep_datafile << data_dir <<
"/tot_xsec/pipA_inelas_frac/pip" << nucleus <<
"_inelas_frac.txt";
1026 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
1027 for(
int i=0;
i < buff->GetN();
i++) {
1028 buff -> GetPoint(
i,x,y);
1029 TfracPipA_Inelas -> SetPoint(ipoint,(
double)nucleus,x,y);
1035 if (saveTGraphsToFile) {
1036 TfracPipA_Inelas -> Write(
"TfracPipA_Inelas");
1044 const int pipAPiPro_f_nfiles = 17;
1045 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};
1046 const int pipAPiPro_f_npoints = 76;
1048 TfracPipA_PiPro =
new TGraph2D(pipAPiPro_f_npoints);
1053 for(
int ifile=0; ifile < pipAPiPro_f_nfiles; ifile++) {
1054 ostringstream ADep_datafile;
1055 int nucleus = pipAPiPro_f_nuclei[ifile];
1056 ADep_datafile << data_dir <<
"/tot_xsec/pipA_pipro_frac/pip" << nucleus <<
"_pipro_frac.txt";
1057 TGraph * buff =
new TGraph(ADep_datafile.str().c_str());
1058 for(
int i=0;
i < buff->GetN();
i++) {
1059 buff -> GetPoint(
i,x,y);
1060 TfracPipA_PiPro -> SetPoint(ipoint,(
double)nucleus,x,y);
1066 if (saveTGraphsToFile) {
1067 TfracPipA_PiPro -> Write(
"TfracPipA_PiPro");
1071 TGraphs_file.Close();
1073 LOG(
"INukeData",
pINFO) <<
"Done building x-section splines...";
1078 string filename,
double ke,
int npoints,
int & curr_point,
1079 double * costh_array,
double * xsec_array,
int cols)
1082 std::ifstream hN_stream(filename.c_str(), ios::in);
1083 if(!hN_stream.good()) {
1085 <<
"Error reading INTRANUKE/hN data from: " <<
filename;
1091 <<
"Error reading INTRANUKE/hN data from: " <<
filename;
1093 <<
"Too few columns: " << cols;
1098 <<
"Reading INTRANUKE/hN data from: " <<
filename;
1102 hN_stream.getline(cbuf,400);
1103 hN_stream.getline(cbuf,400);
1104 hN_stream.getline(cbuf,400);
1111 for(
int ip = 0; ip < npoints; ip++) {
1112 hN_stream >> angle >> xsec;
1114 for(
int ic = 0; ic < (cols-2); ic++) {
1119 <<
"Adding data point: (KE = " << ke <<
" MeV, angle = " 1120 << angle <<
", sigma = " << xsec <<
" mbarn)";
1121 costh_array[ip] = TMath::Cos(angle*
kPi/180.);
1122 xsec_array [curr_point] = xsec;
1128 int hpdgc,
int tgtpdgc,
int nppdgc,
INukeFateHN_t fate,
double ke,
double costh)
const 1140 double ke_eval = ke;
1141 double costh_eval = costh;
1143 costh_eval = TMath::Min(costh, 1.);
1144 costh_eval = TMath::Max(costh_eval, -1.);
1151 ke_eval = TMath::Min(ke_eval, 999.);
1152 ke_eval = TMath::Max(ke_eval, 50.);
1153 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
1159 ke_eval = TMath::Min(ke_eval, 999.);
1160 ke_eval = TMath::Max(ke_eval, 50.);
1161 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
1166 ke_eval = TMath::Min(ke_eval, 1499.);
1167 ke_eval = TMath::Max(ke_eval, 10.);
1168 return fhN2dXSecPipN_Elas->Evaluate(ke_eval, costh_eval);
1173 ke_eval = TMath::Min(ke_eval, 1499.);
1174 ke_eval = TMath::Max(ke_eval, 10.);
1175 return fhN2dXSecPi0N_Elas->Evaluate(ke_eval, costh_eval);
1180 ke_eval = TMath::Min(ke_eval, 1499.);
1181 ke_eval = TMath::Max(ke_eval, 10.);
1182 return fhN2dXSecPimN_Elas->Evaluate(ke_eval, costh_eval);
1187 ke_eval = TMath::Min(ke_eval, 1799.);
1188 ke_eval = TMath::Max(ke_eval, 100.);
1189 return fhN2dXSecKpN_Elas->Evaluate(ke_eval, costh_eval);
1194 ke_eval = TMath::Min(ke_eval, 1799.);
1195 ke_eval = TMath::Max(ke_eval, 100.);
1196 return fhN2dXSecKpP_Elas->Evaluate(ke_eval, costh_eval);
1204 ke_eval = TMath::Min(ke_eval, 1499.);
1205 ke_eval = TMath::Max(ke_eval, 10.);
1206 return fhN2dXSecPiN_CEx->Evaluate(ke_eval, costh_eval);
1211 LOG(
"INukeData",
pWARN) <<
"Inelastic pp does not exist!";
1212 ke_eval = TMath::Min(ke_eval, 999.);
1213 ke_eval = TMath::Max(ke_eval, 50.);
1214 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
1219 ke_eval = TMath::Min(ke_eval, 999.);
1220 ke_eval = TMath::Max(ke_eval, 50.);
1221 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
1229 ke_eval = TMath::Min(ke_eval, 499.);
1230 ke_eval = TMath::Max(ke_eval, 50.);
1231 return fhN2dXSecPiN_Abs->Evaluate(ke_eval, costh_eval);
1233 if(hpdgc==
kPdgKP)
return 1.;
1239 ke_eval = TMath::Min(ke_eval, 1199.);
1240 ke_eval = TMath::Max(ke_eval, 160.);
1241 return fhN2dXSecGamPi0P_Inelas->Evaluate(ke_eval, costh_eval);
1246 ke_eval = TMath::Min(ke_eval, 1199.);
1247 ke_eval = TMath::Max(ke_eval, 160.);
1248 return fhN2dXSecGamPipN_Inelas->Evaluate(ke_eval, costh_eval);
1253 ke_eval = TMath::Min(ke_eval, 1199.);
1254 ke_eval = TMath::Max(ke_eval, 160.);
1255 return fhN2dXSecGamPimP_Inelas->Evaluate(ke_eval, costh_eval);
1260 ke_eval = TMath::Min(ke_eval, 1199.);
1261 ke_eval = TMath::Max(ke_eval, 160.);
1262 return fhN2dXSecGamPi0N_Inelas->Evaluate(ke_eval, costh_eval);
1274 ke = TMath::Max(fMinKinEnergy, ke);
1275 ke = TMath::Min(fMaxKinEnergyHA, ke);
1276 targA = TMath::Min(208, targA);
1278 LOG(
"INukeData",
pDEBUG) <<
"Querying hA cross section at ke = " << ke <<
" and target " << targA;
1293 }
else if (hpdgc ==
kPdgPiM) {
1306 }
else if (hpdgc ==
kPdgPi0) {
1321 <<
"Can't handle particles with pdg code = " << hpdgc;
1330 ke = TMath::Max(fMinKinEnergy, ke);
1331 ke = TMath::Min(fMaxKinEnergyHA, ke);
1333 LOG(
"INukeData",
pDEBUG) <<
"Querying hA cross section at ke = " << ke;
1337 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracPA_CEx -> Evaluate (ke));
1338 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracPA_Elas -> Evaluate (ke));
1339 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracPA_Inel -> Evaluate (ke));
1340 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracPA_Abs -> Evaluate (ke));
1341 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracPA_PiPro -> Evaluate (ke));
1350 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracNA_CEx -> Evaluate (ke));
1351 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracNA_Elas -> Evaluate (ke));
1352 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracNA_Inel -> Evaluate (ke));
1353 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracNA_Abs -> Evaluate (ke));
1354 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracNA_PiPro -> Evaluate (ke));
1361 }
else if (hpdgc ==
kPdgKP) {
1363 if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracKA_Inel -> Evaluate (ke));
1364 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracKA_Abs -> Evaluate (ke));
1373 <<
"Can't handle particles with pdg code = " << hpdgc;
1382 ke = TMath::Max(fMinKinEnergy, ke);
1383 ke = TMath::Min(fMaxKinEnergyHN, ke);
1385 LOG(
"INukeData",
pDEBUG) <<
"Querying hN cross section at ke = " << ke;
1391 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * targZ;
1392 xsec+= TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * (targA-targZ);
1394 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * targZ;
1395 xsec+= TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * (targA-targZ);
1397 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * targZ;
1398 xsec+= TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * (targA-targZ);
1400 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1408 }
else if (hpdgc ==
kPdgPiM) {
1410 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * targZ;
1411 xsec+= TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * (targA-targZ);
1413 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * targZ;
1414 xsec+= TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * (targA-targZ);
1416 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * targZ;
1417 xsec+= TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * (targA-targZ);
1419 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1427 }
else if (hpdgc ==
kPdgPi0) {
1429 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPi0p_CEx -> Evaluate(ke)) * targZ;
1430 xsec+= TMath::Max(0., fXSecPi0n_CEx -> Evaluate(ke)) * (targA-targZ);
1432 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPi0p_Elas -> Evaluate(ke)) * targZ;
1433 xsec+= TMath::Max(0., fXSecPi0n_Elas -> Evaluate(ke)) * (targA-targZ);
1435 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPi0p_Reac -> Evaluate(ke)) * targZ;
1436 xsec+= TMath::Max(0., fXSecPi0n_Reac -> Evaluate(ke)) * (targA-targZ);
1438 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPi0d_Abs -> Evaluate(ke)) * targA;
1448 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPp_Elas -> Evaluate(ke)) * targZ;
1449 xsec+= TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * (targA-targZ);
1451 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPp_Reac -> Evaluate(ke)) * targZ;
1452 xsec+= TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * (targA-targZ);
1454 else if (fate ==
kIHNFtCmp) {xsec = TMath::Max(0., fXSecPp_Cmp -> Evaluate(ke)) * targZ;
1455 xsec+= TMath::Max(0., fXSecPn_Cmp -> Evaluate(ke)) * (targA-targZ);
1465 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * targZ;
1466 xsec+= TMath::Max(0., fXSecNn_Elas -> Evaluate(ke)) * (targA-targZ);
1468 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * targZ;
1469 xsec+= TMath::Max(0., fXSecNn_Reac -> Evaluate(ke)) * (targA-targZ);
1471 else if (fate ==
kIHNFtCmp) {xsec = TMath::Max(0., fXSecPn_Cmp -> Evaluate(ke)) * targZ;
1472 xsec+= TMath::Max(0., fXSecNn_Cmp -> Evaluate(ke)) * (targA-targZ);
1481 <<
"Can't handle particles with pdg code = " << hpdgc;
1491 ke = TMath::Max(fMinKinEnergy, ke);
1492 ke = TMath::Min(fMaxKinEnergyHN, ke);
1495 double xsec = this->XSec(hpdgc,fate,ke,targA,targZ);
1498 double xsec_tot = 0;
1499 if (hpdgc ==
kPdgPiP ){xsec_tot = TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * targZ;
1500 xsec_tot+= TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * (targA-targZ);}
1501 else if (hpdgc ==
kPdgPiM ){xsec_tot = TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * targZ;
1502 xsec_tot+= TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * (targA-targZ);}
1503 else if (hpdgc ==
kPdgPi0 ){xsec_tot = TMath::Max(0., fXSecPi0p_Tot -> Evaluate(ke)) * targZ;
1504 xsec_tot+= TMath::Max(0., fXSecPi0n_Tot -> Evaluate(ke)) * (targA-targZ);}
1505 else if (hpdgc ==
kPdgProton ){xsec_tot = TMath::Max(0., fXSecPp_Tot -> Evaluate(ke)) * targZ;
1506 xsec_tot+= TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * (targA-targZ);}
1507 else if (hpdgc ==
kPdgNeutron){xsec_tot = TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * targZ;
1508 xsec_tot+= TMath::Max(0., fXSecNn_Tot -> Evaluate(ke)) * (targA-targZ);}
1509 else if (hpdgc ==
kPdgGamma ) xsec_tot = TMath::Max(0., fXSecGamN_Tot -> Evaluate(ke));
1510 else if (hpdgc ==
kPdgKP ) xsec_tot = TMath::Max(0., fXSecKpN_Tot -> Evaluate(ke));
1513 double frac = (xsec_tot>0) ? xsec/xsec_tot : 0.;
1538 int numPoints = 1000;
1541 assert((numPoints%numEnv)==0);
1542 double sr = 2.0 / numEnv;
1543 double cstep = 2.0 / (numPoints);
1545 double ke = (p->
E() - p->
Mass()) * 1000.0;
1546 if (TMath::Abs((
int)ke-ke)<.01) ke+=.3;
1557 double * buff =
new double[numPoints/numEnv + 1];
1558 double ** dist =
new double*[numEnv];
1559 for(
int ih=0;ih<numEnv;ih++)
1561 dist[ih] =
new double[3];
1573 double totxsec = 0.0;
1574 for(
int i=0;
i<numEnv;
i++)
1576 double lbound = -1 +
i*
sr;
1578 for(
int j=0;j<=numPoints / numEnv; j++)
1580 buff[j] = this->XSec(p->
Pdg(),
target,scode,fate,ke,lbound+j*cstep);
1585 avg/= (double(numPoints)/double(numEnv));
1586 dist[
i][0] = TMath::MaxElement(numPoints/numEnv+1,buff);
1588 dist[
i][2] = dist[
i][1] + ((
i==0)?0.0:dist[i-1][2]);
1603 rval = rnd->
RndFsi().Rndm()*dist[numEnv-1][2];
1610 if(rval<=dist[env][2])
break;
1613 if(env==numEnv) env=numEnv - 1;
1621 rval = rnd->
RndFsi().Rndm()*dist[env][0];
1624 if(rval < this->XSec(p->
Pdg(),
target,scode,fate,ke,
val))
break;
1630 int NUM_POINTS=2000;
1632 double points[200]={0};
1633 for(
int k=0;
k<NUM_POINTS;
k++)
1635 points[
int(
k/10)]=this->XSec(p->
Pdg(),
target,scode,fate,ke,-1+(2.0/NUM_POINTS)*
k);
1636 if(points[
int(
k/10)]>0) pvalues++;
1638 if(pvalues<(.05*NUM_POINTS))
1642 if(p->
P4()->P()<.005)
1644 val = 2*rnd->
RndFsi().Rndm()-1;
1649 LOG(
"Intranuke",
pWARN) <<
"Hung-up in IntBounce method - Exiting";
1652 for(
int ie=0;ie<200;ie+=10) {
1653 LOG(
"Intranuke",
pWARN) << points[ie+0] <<
", " << points[ie+1] <<
", " << points[ie+2] <<
", " 1654 << points[ie+3] <<
", " << points[ie+4] <<
", " << points[ie+5] <<
", " << points[ie+6] <<
", " 1655 << points[ie+7] <<
", " << points[ie+8] <<
", " << points[ie+9];
1657 for(
int ih=0;ih<numEnv;ih++)
1670 for(
int ih=0;ih<numEnv;ih++)
enum genie::EINukeFateHA_t INukeFateHA_t
static double fMinKinEnergy
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
#include "Numerical/GSFunc.h"
double E(void) const
Get energy.
double FracADep(int hpdgc, INukeFateHA_t fate, double ke, int targA) const
static RandomGen * Instance()
Access instance.
A numeric analysis tool class for interpolating 1-D functions.
double Mass(void) const
Mass that corresponds to the PDG code.
static INukeHadroData2014 * fInstance
A singleton holding random number generator classes. All random number generation in GENIE should tak...
void LoadCrossSections(void)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
double Frac(int hpdgc, INukeFateHN_t fate, double ke, int targA=0, int targZ=0) const
def Interpolate(x1, y1, x2, y2, yvalue)
enum genie::EINukeFateHN_t INukeFateHN_t
double XSec(int hpdgc, int tgt, int nprod, INukeFateHN_t rxnType, double ke, double costh) const
static double fMaxKinEnergyHN
void DummyMethodAndSilentCompiler()
static string AsString(INukeFateHN_t fate)
double FracAIndep(int hpdgc, INukeFateHA_t fate, double ke) const
void ReadhNFile(string filename, double ke, int npoints, int &curr_point, double *costh_array, double *xsec_array, int cols)
TLorentzVector * P4(void) const
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.
static INukeHadroData2014 * Instance(void)
static double fMaxKinEnergyHA
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)