49 using std::ostringstream;
52 using namespace genie;
53 using namespace genie::constants;
64 this->LoadCrossSections();
73 delete fXSecPipn_Elas;
74 delete fXSecPipn_Reac;
77 delete fXSecPipp_Elas;
78 delete fXSecPipp_Reac;
84 delete fXSecPi0n_Elas;
85 delete fXSecPi0n_Reac;
88 delete fXSecPi0p_Elas;
89 delete fXSecPi0p_Reac;
101 delete fXSecGamN_Tot;
109 delete fFracPA_Pipro;
115 delete fFracNA_Pipro;
118 delete fFracPipA_Tot;
119 delete fFracPipA_Elas;
120 delete fFracPipA_Inel;
121 delete fFracPipA_CEx;
122 delete fFracPipA_Abs;
123 delete fFracPipA_PiProd;
124 delete fFracPimA_Tot;
125 delete fFracPimA_Elas;
126 delete fFracPimA_Inel;
127 delete fFracPimA_CEx;
128 delete fFracPimA_Abs;
129 delete fFracPimA_PiProd;
130 delete fFracPi0A_Tot;
131 delete fFracPi0A_Elas;
132 delete fFracPi0A_Inel;
133 delete fFracPi0A_CEx;
134 delete fFracPi0A_Abs;
135 delete fFracPi0A_PiProd;
138 delete fhN2dXSecPP_Elas;
139 delete fhN2dXSecNP_Elas;
140 delete fhN2dXSecPipN_Elas;
141 delete fhN2dXSecPi0N_Elas;
142 delete fhN2dXSecPimN_Elas;
143 delete fhN2dXSecKpN_Elas;
144 delete fhN2dXSecKpP_Elas;
145 delete fhN2dXSecPiN_CEx;
146 delete fhN2dXSecPiN_Abs;
147 delete fhN2dXSecGamPi0P_Inelas;
148 delete fhN2dXSecGamPi0N_Inelas;
149 delete fhN2dXSecGamPipN_Inelas;
150 delete fhN2dXSecGamPimP_Inelas;
175 LOG(
"INukeData",
pINFO) <<
"INukeHadroData late initialization";
189 string data_dir = (gSystem->Getenv(
"GINUKEHADRONDATA")) ?
190 string(gSystem->Getenv(
"GINUKEHADRONDATA")) :
191 string(gSystem->Getenv(
"GENIE")) +
string(
"/data/evgen/intranuke");
194 <<
"Loading INTRANUKE hadron data from: " << data_dir;
198 string datafile_NN = data_dir +
"/tot_xsec/intranuke-xsections-NN.dat";
199 string datafile_pipN = data_dir +
"/tot_xsec/intranuke-xsections-pi+N.dat";
200 string datafile_pi0N = data_dir +
"/tot_xsec/intranuke-xsections-pi0N.dat";
201 string datafile_NA = data_dir +
"/tot_xsec/intranuke-fractions-NA.dat";
202 string datafile_piA = data_dir +
"/tot_xsec/intranuke-fractions-piA.dat";
203 string datafile_KA = data_dir +
"/tot_xsec/intranuke-fractions-KA.dat";
204 string datafile_gamN = data_dir +
"/tot_xsec/intranuke-xsections-gamN.dat";
205 string datafile_kN = data_dir +
"/tot_xsec/intranuke-xsections-kaonN.dat";
209 assert( ! gSystem->AccessPathName(datafile_NN. c_str()) );
210 assert( ! gSystem->AccessPathName(datafile_pipN.c_str()) );
211 assert( ! gSystem->AccessPathName(datafile_pi0N.c_str()) );
212 assert( ! gSystem->AccessPathName(datafile_NA. c_str()) );
213 assert( ! gSystem->AccessPathName(datafile_piA. c_str()) );
214 assert( ! gSystem->AccessPathName(datafile_KA. c_str()) );
215 assert( ! gSystem->AccessPathName(datafile_gamN.c_str()) );
216 assert( ! gSystem->AccessPathName(datafile_kN. c_str()) );
218 LOG(
"INukeData",
pINFO) <<
"Found all necessary data files...";
231 data_NN.ReadFile(datafile_NN.c_str(),
232 "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");
233 data_pipN.ReadFile(datafile_pipN.c_str(),
234 "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");
235 data_pi0N.ReadFile(datafile_pi0N.c_str(),
236 "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");
237 data_NA.ReadFile(datafile_NA.c_str(),
238 "ke/D:pA_tot/D:pA_elas/D:pA_inel/D:pA_cex/D:pA_abs/D:pA_pipro/D");
239 data_piA.ReadFile(datafile_piA.c_str(),
240 "ke/D:piA_tot/D:piA_elas/D:piA_inel/D:piA_cex/D:piA_np/D:piA_pp/D:piA_npp/D:piA_nnp/D:piA_2n2p/D:piA_piprod/D");
241 data_gamN.ReadFile(datafile_gamN.c_str(),
242 "ke/D:pi0p_tot/D:pipn_tot/D:pimp_tot/D:pi0n_tot/D:gamp_fs/D:gamn_fs/D:gamN_tot/D");
243 data_kN.ReadFile(datafile_kN.c_str(),
244 "ke/D:kpn_elas/D:kpp_elas/D:kp_abs/D:kpN_tot/D");
245 data_KA.ReadFile(datafile_KA.c_str(),
246 "ke/D:KA_tot/D:KA_elas/D:KA_inel/D:KA_abs/D");
248 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NN : " << data_NN.GetEntries();
249 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pipN : " << data_pipN.GetEntries();
250 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in pi0N : " << data_pi0N.GetEntries();
251 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in NA : " << data_NA.GetEntries();
252 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in piA : " << data_piA.GetEntries();
253 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in KA : " << data_KA.GetEntries();
254 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in gamN : " << data_gamN.GetEntries();
255 LOG(
"INukeData",
pDEBUG) <<
"Number of data rows in kN : " << data_kN.GetEntries();
257 LOG(
"INukeData",
pINFO) <<
"Done loading all x-section files...";
262 fXSecPp_Tot =
new Spline(&data_NN,
"ke:pp_tot");
263 fXSecPp_Elas =
new Spline(&data_NN,
"ke:pp_elas");
264 fXSecPp_Reac =
new Spline(&data_NN,
"ke:pp_reac");
265 fXSecPn_Tot =
new Spline(&data_NN,
"ke:pn_tot");
266 fXSecPn_Elas =
new Spline(&data_NN,
"ke:pn_elas");
267 fXSecPn_Reac =
new Spline(&data_NN,
"ke:pn_reac");
268 fXSecNn_Tot =
new Spline(&data_NN,
"ke:nn_tot");
269 fXSecNn_Elas =
new Spline(&data_NN,
"ke:nn_elas");
270 fXSecNn_Reac =
new Spline(&data_NN,
"ke:nn_reac");
273 fXSecPipn_Tot =
new Spline(&data_pipN,
"ke:pipn_tot");
274 fXSecPipn_CEx =
new Spline(&data_pipN,
"ke:pipn_cex");
275 fXSecPipn_Elas =
new Spline(&data_pipN,
"ke:pipn_elas");
276 fXSecPipn_Reac =
new Spline(&data_pipN,
"ke:pipn_reac");
277 fXSecPipp_Tot =
new Spline(&data_pipN,
"ke:pipp_tot");
278 fXSecPipp_CEx =
new Spline(&data_pipN,
"ke:pipp_cex");
279 fXSecPipp_Elas =
new Spline(&data_pipN,
"ke:pipp_elas");
280 fXSecPipp_Reac =
new Spline(&data_pipN,
"ke:pipp_reac");
281 fXSecPipd_Abs =
new Spline(&data_pipN,
"ke:pipd_abs");
284 fXSecPi0n_Tot =
new Spline(&data_pi0N,
"ke:pi0n_tot");
285 fXSecPi0n_CEx =
new Spline(&data_pi0N,
"ke:pi0n_cex");
286 fXSecPi0n_Elas =
new Spline(&data_pi0N,
"ke:pi0n_elas");
287 fXSecPi0n_Reac =
new Spline(&data_pi0N,
"ke:pi0n_reac");
288 fXSecPi0p_Tot =
new Spline(&data_pi0N,
"ke:pi0p_tot");
289 fXSecPi0p_CEx =
new Spline(&data_pi0N,
"ke:pi0p_cex");
290 fXSecPi0p_Elas =
new Spline(&data_pi0N,
"ke:pi0p_elas");
291 fXSecPi0p_Reac =
new Spline(&data_pi0N,
"ke:pi0p_reac");
292 fXSecPi0d_Abs =
new Spline(&data_pi0N,
"ke:pi0d_abs");
295 fXSecKpn_Elas =
new Spline(&data_kN,
"ke:kpn_elas");
296 fXSecKpp_Elas =
new Spline(&data_kN,
"ke:kpp_elas");
297 fXSecKpN_Abs =
new Spline(&data_kN,
"ke:kp_abs");
298 fXSecKpN_Tot =
new Spline(&data_kN,
"ke:kpN_tot");
301 fXSecGamp_fs =
new Spline(&data_gamN,
"ke:gamp_fs");
302 fXSecGamn_fs =
new Spline(&data_gamN,
"ke:gamn_fs");
303 fXSecGamN_Tot =
new Spline(&data_gamN,
"ke:gamN_tot");
306 fFracPA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
307 fFracPA_Elas =
new Spline(&data_NA,
"ke:pA_elas");
308 fFracPA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
309 fFracPA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
310 fFracPA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
311 fFracPA_Pipro =
new Spline(&data_NA,
"ke:pA_pipro");
312 fFracNA_Tot =
new Spline(&data_NA,
"ke:pA_tot");
313 fFracNA_Elas =
new Spline(&data_NA,
"ke:pA_elas");
314 fFracNA_Inel =
new Spline(&data_NA,
"ke:pA_inel");
315 fFracNA_CEx =
new Spline(&data_NA,
"ke:pA_cex");
316 fFracNA_Abs =
new Spline(&data_NA,
"ke:pA_abs");
317 fFracNA_Pipro =
new Spline(&data_NA,
"ke:pA_pipro");
320 fFracPipA_Tot =
new Spline(&data_piA,
"ke:piA_tot");
321 fFracPipA_Elas =
new Spline(&data_piA,
"ke:piA_elas");
322 fFracPipA_Inel =
new Spline(&data_piA,
"ke:piA_inel");
323 fFracPipA_CEx =
new Spline(&data_piA,
"ke:piA_cex");
324 fFracPipA_Abs =
new Spline(&data_piA,
"ke:piA_np+piA_pp+piA_npp+piA_nnp+piA_2n2p");
325 fFracPipA_PiProd =
new Spline(&data_piA,
"ke:piA_piprod");
326 fFracPimA_Tot =
new Spline(&data_piA,
"ke:piA_tot");
327 fFracPimA_Elas =
new Spline(&data_piA,
"ke:piA_elas");
328 fFracPimA_Inel =
new Spline(&data_piA,
"ke:piA_inel");
329 fFracPimA_CEx =
new Spline(&data_piA,
"ke:piA_cex");
330 fFracPimA_Abs =
new Spline(&data_piA,
"ke:piA_np+piA_pp+piA_npp+piA_nnp+piA_2n2p");
331 fFracPimA_PiProd =
new Spline(&data_piA,
"ke:piA_piprod");
332 fFracPi0A_Tot =
new Spline(&data_piA,
"ke:piA_tot");
333 fFracPi0A_Elas =
new Spline(&data_piA,
"ke:piA_elas");
334 fFracPi0A_Inel =
new Spline(&data_piA,
"ke:piA_inel");
335 fFracPi0A_CEx =
new Spline(&data_piA,
"ke:piA_cex");
336 fFracPi0A_Abs =
new Spline(&data_piA,
"ke:piA_np+piA_pp+piA_npp+piA_nnp+piA_2n2p");
337 fFracPi0A_PiProd =
new Spline(&data_piA,
"ke:piA_piprod");
339 fFracKA_Tot =
new Spline(&data_KA,
"ke:KA_tot");
340 fFracKA_Elas =
new Spline(&data_KA,
"ke:KA_elas");
341 fFracKA_Inel =
new Spline(&data_KA,
"ke:KA_inel");
342 fFracKA_Abs =
new Spline(&data_KA,
"ke:KA_abs");
369 const int hN_ppelas_nfiles = 20;
370 const int hN_ppelas_points_per_file = 21;
371 const int hN_ppelas_npoints = hN_ppelas_points_per_file * hN_ppelas_nfiles;
373 double hN_ppelas_energies[hN_ppelas_nfiles] = {
374 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
375 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
378 double hN_ppelas_costh [hN_ppelas_points_per_file];
379 double hN_ppelas_xsec [hN_ppelas_npoints];
383 for(
int ifile = 0; ifile < hN_ppelas_nfiles; ifile++) {
385 ostringstream hN_datafile;
386 double ke = hN_ppelas_energies[ifile];
387 hN_datafile << data_dir <<
"/diff_ang/pp/pp" << ke <<
".txt";
390 hN_datafile.str(), ke, hN_ppelas_points_per_file,
391 ipoint, hN_ppelas_costh, hN_ppelas_xsec,2);
399 fhN2dXSecPP_Elas =
new BLI2DNonUnifGrid(hN_ppelas_nfiles,hN_ppelas_points_per_file,
400 hN_ppelas_energies,hN_ppelas_costh,hN_ppelas_xsec);
405 const int hN_npelas_nfiles = 20;
406 const int hN_npelas_points_per_file = 21;
407 const int hN_npelas_npoints = hN_npelas_points_per_file * hN_npelas_nfiles;
409 double hN_npelas_energies[hN_npelas_nfiles] = {
410 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
411 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
414 double hN_npelas_costh [hN_npelas_points_per_file];
415 double hN_npelas_xsec [hN_npelas_npoints];
419 for(
int ifile = 0; ifile < hN_npelas_nfiles; ifile++) {
421 ostringstream hN_datafile;
422 double ke = hN_npelas_energies[ifile];
423 hN_datafile << data_dir <<
"/diff_ang/pn/pn" << ke <<
".txt";
426 hN_datafile.str(), ke, hN_npelas_points_per_file,
427 ipoint, hN_npelas_costh, hN_npelas_xsec,2);
435 fhN2dXSecNP_Elas =
new BLI2DNonUnifGrid(hN_npelas_nfiles,hN_npelas_points_per_file,
436 hN_npelas_energies,hN_npelas_costh,hN_npelas_xsec);
441 const int hN_pipNelas_nfiles = 60;
442 const int hN_pipNelas_points_per_file = 21;
443 const int hN_pipNelas_npoints = hN_pipNelas_points_per_file * hN_pipNelas_nfiles;
445 double hN_pipNelas_energies[hN_pipNelas_nfiles] = {
446 10, 20, 30, 40, 50, 60, 70, 80, 90,
447 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
448 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
449 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
450 700, 740, 780, 820, 860, 900, 940, 980,
451 1020, 1060, 1100, 1140, 1180, 1220, 1260,
452 1300, 1340, 1380, 1420, 1460, 1500
455 double hN_pipNelas_costh [hN_pipNelas_points_per_file];
456 double hN_pipNelas_xsec [hN_pipNelas_npoints];
460 for(
int ifile = 0; ifile < hN_pipNelas_nfiles; ifile++) {
462 ostringstream hN_datafile;
463 double ke = hN_pipNelas_energies[ifile];
464 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
467 hN_datafile.str(), ke, hN_pipNelas_points_per_file,
468 ipoint, hN_pipNelas_costh, hN_pipNelas_xsec,2);
476 fhN2dXSecPipN_Elas =
new BLI2DNonUnifGrid(hN_pipNelas_nfiles,hN_pipNelas_points_per_file,
477 hN_pipNelas_energies,hN_pipNelas_costh,hN_pipNelas_xsec);
482 const int hN_pi0Nelas_nfiles = 60;
483 const int hN_pi0Nelas_points_per_file = 21;
484 const int hN_pi0Nelas_npoints = hN_pi0Nelas_points_per_file * hN_pi0Nelas_nfiles;
486 double hN_pi0Nelas_energies[hN_pi0Nelas_nfiles] = {
487 10, 20, 30, 40, 50, 60, 70, 80, 90,
488 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
489 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
490 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
491 700, 740, 780, 820, 860, 900, 940, 980,
492 1020, 1060, 1100, 1140, 1180, 1220, 1260,
493 1300, 1340, 1380, 1420, 1460, 1500
496 double hN_pi0Nelas_costh [hN_pi0Nelas_points_per_file];
497 double hN_pi0Nelas_xsec [hN_pi0Nelas_npoints];
501 for(
int ifile = 0; ifile < hN_pi0Nelas_nfiles; ifile++) {
503 ostringstream hN_datafile;
504 double ke = hN_pi0Nelas_energies[ifile];
505 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
508 hN_datafile.str(), ke, hN_pi0Nelas_points_per_file,
509 ipoint, hN_pi0Nelas_costh, hN_pi0Nelas_xsec,2);
517 fhN2dXSecPi0N_Elas =
new BLI2DNonUnifGrid(hN_pi0Nelas_nfiles,hN_pi0Nelas_points_per_file,
518 hN_pi0Nelas_energies,hN_pi0Nelas_costh,hN_pi0Nelas_xsec);
523 const int hN_pimNelas_nfiles = 60;
524 const int hN_pimNelas_points_per_file = 21;
525 const int hN_pimNelas_npoints = hN_pimNelas_points_per_file * hN_pimNelas_nfiles;
527 double hN_pimNelas_energies[hN_pimNelas_nfiles] = {
528 10, 20, 30, 40, 50, 60, 70, 80, 90,
529 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
530 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
531 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
532 700, 740, 780, 820, 860, 900, 940, 980,
533 1020, 1060, 1100, 1140, 1180, 1220, 1260,
534 1300, 1340, 1380, 1420, 1460, 1500
537 double hN_pimNelas_costh [hN_pimNelas_points_per_file];
538 double hN_pimNelas_xsec [hN_pimNelas_npoints];
542 for(
int ifile = 0; ifile < hN_pimNelas_nfiles; ifile++) {
544 ostringstream hN_datafile;
545 double ke = hN_pimNelas_energies[ifile];
546 hN_datafile << data_dir <<
"/diff_ang/pim/pim" << ke <<
".txt";
549 hN_datafile.str(), ke, hN_pimNelas_points_per_file,
550 ipoint, hN_pimNelas_costh, hN_pimNelas_xsec,2);
558 fhN2dXSecPimN_Elas =
new BLI2DNonUnifGrid(hN_pimNelas_nfiles,hN_pimNelas_points_per_file,
559 hN_pimNelas_energies,hN_pimNelas_costh,hN_pimNelas_xsec);
564 const int hN_kpNelas_nfiles = 18;
565 const int hN_kpNelas_points_per_file = 37;
566 const int hN_kpNelas_npoints = hN_kpNelas_points_per_file * hN_kpNelas_nfiles;
568 double hN_kpNelas_energies[hN_kpNelas_nfiles] = {
569 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
570 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
573 double hN_kpNelas_costh [hN_kpNelas_points_per_file];
574 double hN_kpNelas_xsec [hN_kpNelas_npoints];
578 for(
int ifile = 0; ifile < hN_kpNelas_nfiles; ifile++) {
580 ostringstream hN_datafile;
581 double ke = hN_kpNelas_energies[ifile];
582 hN_datafile << data_dir <<
"/diff_ang/kpn/kpn" << ke <<
".txt";
585 hN_datafile.str(), ke, hN_kpNelas_points_per_file,
586 ipoint, hN_kpNelas_costh, hN_kpNelas_xsec,2);
594 fhN2dXSecKpN_Elas =
new BLI2DNonUnifGrid(hN_kpNelas_nfiles,hN_kpNelas_points_per_file,
595 hN_kpNelas_energies,hN_kpNelas_costh,hN_kpNelas_xsec);
600 const int hN_kpPelas_nfiles = 18;
601 const int hN_kpPelas_points_per_file = 37;
602 const int hN_kpPelas_npoints = hN_kpPelas_points_per_file * hN_kpPelas_nfiles;
604 double hN_kpPelas_energies[hN_kpPelas_nfiles] = {
605 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
606 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
609 double hN_kpPelas_costh [hN_kpPelas_points_per_file];
610 double hN_kpPelas_xsec [hN_kpPelas_npoints];
614 for(
int ifile = 0; ifile < hN_kpPelas_nfiles; ifile++) {
616 ostringstream hN_datafile;
617 double ke = hN_kpPelas_energies[ifile];
618 hN_datafile << data_dir <<
"/diff_ang/kpp/kpp" << ke <<
".txt";
621 hN_datafile.str(), ke, hN_kpPelas_points_per_file,
622 ipoint, hN_kpPelas_costh, hN_kpPelas_xsec,2);
630 fhN2dXSecKpP_Elas =
new BLI2DNonUnifGrid(hN_kpPelas_nfiles,hN_kpPelas_points_per_file,
631 hN_kpPelas_energies,hN_kpPelas_costh,hN_kpPelas_xsec);
636 const int hN_piNcex_nfiles = 60;
637 const int hN_piNcex_points_per_file = 21;
638 const int hN_piNcex_npoints = hN_piNcex_points_per_file * hN_piNcex_nfiles;
640 double hN_piNcex_energies[hN_piNcex_nfiles] = {
641 10, 20, 30, 40, 50, 60, 70, 80, 90,
642 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
643 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
644 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
645 700, 740, 780, 820, 860, 900, 940, 980,
646 1020, 1060, 1100, 1140, 1180, 1220, 1260,
647 1300, 1340, 1380, 1420, 1460, 1500
650 double hN_piNcex_costh [hN_piNcex_points_per_file];
651 double hN_piNcex_xsec [hN_piNcex_npoints];
655 for(
int ifile = 0; ifile < hN_piNcex_nfiles; ifile++) {
657 ostringstream hN_datafile;
658 double ke = hN_piNcex_energies[ifile];
659 hN_datafile << data_dir <<
"/diff_ang/pie/pie" << ke <<
".txt";
662 hN_datafile.str(), ke, hN_piNcex_points_per_file,
663 ipoint, hN_piNcex_costh, hN_piNcex_xsec,2);
671 fhN2dXSecPiN_CEx =
new BLI2DNonUnifGrid(hN_piNcex_nfiles,hN_piNcex_points_per_file,
672 hN_piNcex_energies,hN_piNcex_costh,hN_piNcex_xsec);
677 const int hN_piNabs_nfiles = 19;
678 const int hN_piNabs_points_per_file = 21;
679 const int hN_piNabs_npoints = hN_piNabs_points_per_file * hN_piNabs_nfiles;
681 double hN_piNabs_energies[hN_piNabs_nfiles] = {
682 50, 75, 100, 125, 150, 175, 200, 225, 250, 275,
683 300, 325, 350, 375, 400, 425, 450, 475, 500
686 double hN_piNabs_costh [hN_piNabs_points_per_file];
687 double hN_piNabs_xsec [hN_piNabs_npoints];
691 for(
int ifile = 0; ifile < hN_piNabs_nfiles; ifile++) {
693 ostringstream hN_datafile;
694 double ke = hN_piNabs_energies[ifile];
695 hN_datafile << data_dir <<
"/diff_ang/pid2p/pid2p" << ke <<
".txt";
698 hN_datafile.str(), ke, hN_piNabs_points_per_file,
699 ipoint, hN_piNabs_costh, hN_piNabs_xsec,2);
707 fhN2dXSecPiN_Abs =
new BLI2DNonUnifGrid(hN_piNabs_nfiles,hN_piNabs_points_per_file,
708 hN_piNabs_energies,hN_piNabs_costh,hN_piNabs_xsec);
713 const int hN_gampi0pInelas_nfiles = 29;
714 const int hN_gampi0pInelas_points_per_file = 37;
715 const int hN_gampi0pInelas_npoints = hN_gampi0pInelas_points_per_file * hN_gampi0pInelas_nfiles;
717 double hN_gampi0pInelas_energies[hN_gampi0pInelas_nfiles] = {
718 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
719 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
720 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
723 double hN_gampi0pInelas_costh [hN_gampi0pInelas_points_per_file];
724 double hN_gampi0pInelas_xsec [hN_gampi0pInelas_npoints];
728 for(
int ifile = 0; ifile < hN_gampi0pInelas_nfiles; ifile++) {
730 ostringstream hN_datafile;
731 double ke = hN_gampi0pInelas_energies[ifile];
732 hN_datafile << data_dir <<
"/diff_ang/gampi0p/" << ke <<
"-pi0p.txt";
735 hN_datafile.str(), ke, hN_gampi0pInelas_points_per_file,
736 ipoint, hN_gampi0pInelas_costh, hN_gampi0pInelas_xsec,3);
744 fhN2dXSecGamPi0P_Inelas =
new BLI2DNonUnifGrid(hN_gampi0pInelas_nfiles,hN_gampi0pInelas_points_per_file,
745 hN_gampi0pInelas_energies,hN_gampi0pInelas_costh,hN_gampi0pInelas_xsec);
750 const int hN_gampi0nInelas_nfiles = 29;
751 const int hN_gampi0nInelas_points_per_file = 37;
752 const int hN_gampi0nInelas_npoints = hN_gampi0nInelas_points_per_file * hN_gampi0nInelas_nfiles;
754 double hN_gampi0nInelas_energies[hN_gampi0nInelas_nfiles] = {
755 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
756 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
757 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
760 double hN_gampi0nInelas_costh [hN_gampi0nInelas_points_per_file];
761 double hN_gampi0nInelas_xsec [hN_gampi0nInelas_npoints];
764 for(
int ifile = 0; ifile < hN_gampi0nInelas_nfiles; ifile++) {
766 ostringstream hN_datafile;
767 double ke = hN_gampi0nInelas_energies[ifile];
768 hN_datafile << data_dir <<
"/diff_ang/gampi0n/" << ke <<
"-pi0n.txt";
771 hN_datafile.str(), ke, hN_gampi0nInelas_points_per_file,
772 ipoint, hN_gampi0nInelas_costh, hN_gampi0nInelas_xsec,3);
780 fhN2dXSecGamPi0N_Inelas =
new BLI2DNonUnifGrid(hN_gampi0nInelas_nfiles,hN_gampi0nInelas_points_per_file,
781 hN_gampi0nInelas_energies,hN_gampi0nInelas_costh,hN_gampi0nInelas_xsec);
786 const int hN_gampipnInelas_nfiles = 29;
787 const int hN_gampipnInelas_points_per_file = 37;
788 const int hN_gampipnInelas_npoints = hN_gampipnInelas_points_per_file * hN_gampipnInelas_nfiles;
790 double hN_gampipnInelas_energies[hN_gampipnInelas_nfiles] = {
791 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
792 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
793 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
796 double hN_gampipnInelas_costh [hN_gampipnInelas_points_per_file];
797 double hN_gampipnInelas_xsec [hN_gampipnInelas_npoints];
801 for(
int ifile = 0; ifile < hN_gampipnInelas_nfiles; ifile++) {
803 ostringstream hN_datafile;
804 double ke = hN_gampipnInelas_energies[ifile];
805 hN_datafile << data_dir <<
"/diff_ang/gampi+n/" << ke <<
"-pi+n.txt";
808 hN_datafile.str(), ke, hN_gampipnInelas_points_per_file,
809 ipoint, hN_gampipnInelas_costh, hN_gampipnInelas_xsec,3);
817 fhN2dXSecGamPipN_Inelas =
new BLI2DNonUnifGrid(hN_gampipnInelas_nfiles,hN_gampipnInelas_points_per_file,
818 hN_gampipnInelas_energies,hN_gampipnInelas_costh,hN_gampipnInelas_xsec);
823 const int hN_gampimpInelas_nfiles = 29;
824 const int hN_gampimpInelas_points_per_file = 37;
825 const int hN_gampimpInelas_npoints = hN_gampimpInelas_points_per_file * hN_gampimpInelas_nfiles;
827 double hN_gampimpInelas_energies[hN_gampimpInelas_nfiles] = {
828 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
829 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
830 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
833 double hN_gampimpInelas_costh [hN_gampimpInelas_points_per_file];
834 double hN_gampimpInelas_xsec [hN_gampimpInelas_npoints];
838 for(
int ifile = 0; ifile < hN_gampimpInelas_nfiles; ifile++) {
840 ostringstream hN_datafile;
841 double ke = hN_gampimpInelas_energies[ifile];
842 hN_datafile << data_dir <<
"/diff_ang/gampi-p/" << ke <<
"-pi-p.txt";
845 hN_datafile.str(), ke, hN_gampimpInelas_points_per_file,
846 ipoint, hN_gampimpInelas_costh, hN_gampimpInelas_xsec,3);
854 fhN2dXSecGamPimP_Inelas =
new BLI2DNonUnifGrid(hN_gampimpInelas_nfiles,hN_gampimpInelas_points_per_file,
855 hN_gampimpInelas_energies,hN_gampimpInelas_costh,hN_gampimpInelas_xsec);
858 LOG(
"INukeData",
pINFO) <<
"Done building x-section splines...";
862 string filename,
double ke,
int npoints,
int & curr_point,
863 double * costh_array,
double * xsec_array,
int cols)
866 std::ifstream hN_stream(filename.c_str(), ios::in);
867 if(!hN_stream.good()) {
869 <<
"Error reading INTRANUKE/hN data from: " << filename;
875 <<
"Error reading INTRANUKE/hN data from: " << filename;
877 <<
"Too few columns: " << cols;
882 <<
"Reading INTRANUKE/hN data from: " << filename;
886 hN_stream.getline(cbuf,400);
887 hN_stream.getline(cbuf,400);
888 hN_stream.getline(cbuf,400);
895 for(
int ip = 0; ip < npoints; ip++) {
896 hN_stream >> angle >> xsec;
898 for(
int ic = 0; ic < (cols-2); ic++) {
903 <<
"Adding data point: (KE = " << ke <<
" MeV, angle = "
904 << angle <<
", sigma = " << xsec <<
" mbarn)";
905 costh_array[ip] = TMath::Cos(angle*
kPi/180.);
906 xsec_array [curr_point] = xsec;
912 int hpdgc,
int tgtpdgc,
int nppdgc,
INukeFateHN_t fate,
double ke,
double costh)
const
925 double costh_eval = costh;
927 costh_eval = TMath::Min(costh, 1.);
928 costh_eval = TMath::Max(costh_eval, -1.);
935 ke_eval = TMath::Min(ke_eval, 999.);
936 ke_eval = TMath::Max(ke_eval, 50.);
937 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
943 ke_eval = TMath::Min(ke_eval, 999.);
944 ke_eval = TMath::Max(ke_eval, 50.);
945 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
950 ke_eval = TMath::Min(ke_eval, 1499.);
951 ke_eval = TMath::Max(ke_eval, 10.);
952 return fhN2dXSecPipN_Elas->Evaluate(ke_eval, costh_eval);
957 ke_eval = TMath::Min(ke_eval, 1499.);
958 ke_eval = TMath::Max(ke_eval, 10.);
959 return fhN2dXSecPi0N_Elas->Evaluate(ke_eval, costh_eval);
964 ke_eval = TMath::Min(ke_eval, 1499.);
965 ke_eval = TMath::Max(ke_eval, 10.);
966 return fhN2dXSecPimN_Elas->Evaluate(ke_eval, costh_eval);
971 ke_eval = TMath::Min(ke_eval, 1799.);
972 ke_eval = TMath::Max(ke_eval, 100.);
973 return fhN2dXSecKpN_Elas->Evaluate(ke_eval, costh_eval);
978 ke_eval = TMath::Min(ke_eval, 1799.);
979 ke_eval = TMath::Max(ke_eval, 100.);
980 return fhN2dXSecKpP_Elas->Evaluate(ke_eval, costh_eval);
988 ke_eval = TMath::Min(ke_eval, 1499.);
989 ke_eval = TMath::Max(ke_eval, 10.);
990 return fhN2dXSecPiN_CEx->Evaluate(ke_eval, costh_eval);
995 LOG(
"INukeData",
pWARN) <<
"Inelastic pp does not exist!";
996 ke_eval = TMath::Min(ke_eval, 999.);
997 ke_eval = TMath::Max(ke_eval, 50.);
998 return fhN2dXSecPP_Elas->Evaluate(ke_eval, costh_eval);
1003 ke_eval = TMath::Min(ke_eval, 999.);
1004 ke_eval = TMath::Max(ke_eval, 50.);
1005 return fhN2dXSecNP_Elas->Evaluate(ke_eval, costh_eval);
1013 ke_eval = TMath::Min(ke_eval, 499.);
1014 ke_eval = TMath::Max(ke_eval, 50.);
1015 return fhN2dXSecPiN_Abs->Evaluate(ke_eval, costh_eval);
1017 if(hpdgc==
kPdgKP)
return 1.;
1023 ke_eval = TMath::Min(ke_eval, 1199.);
1024 ke_eval = TMath::Max(ke_eval, 160.);
1025 return fhN2dXSecGamPi0P_Inelas->Evaluate(ke_eval, costh_eval);
1030 ke_eval = TMath::Min(ke_eval, 1199.);
1031 ke_eval = TMath::Max(ke_eval, 160.);
1032 return fhN2dXSecGamPipN_Inelas->Evaluate(ke_eval, costh_eval);
1037 ke_eval = TMath::Min(ke_eval, 1199.);
1038 ke_eval = TMath::Max(ke_eval, 160.);
1039 return fhN2dXSecGamPimP_Inelas->Evaluate(ke_eval, costh_eval);
1044 ke_eval = TMath::Min(ke_eval, 1199.);
1045 ke_eval = TMath::Max(ke_eval, 160.);
1046 return fhN2dXSecGamPi0N_Inelas->Evaluate(ke_eval, costh_eval);
1058 ke = TMath::Max(fMinKinEnergy, ke);
1059 ke = TMath::Min(fMaxKinEnergyHA, ke);
1061 LOG(
"INukeData",
pDEBUG) <<
"Querying hA cross section at ke = " << ke;
1065 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracPA_CEx -> Evaluate (ke));
1066 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracPA_Elas -> Evaluate (ke));
1067 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracPA_Inel -> Evaluate (ke));
1068 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracPA_Abs -> Evaluate (ke));
1069 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracPA_Pipro -> Evaluate (ke));
1078 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracNA_CEx -> Evaluate (ke));
1079 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracNA_Elas -> Evaluate (ke));
1080 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracNA_Inel -> Evaluate (ke));
1081 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracNA_Abs -> Evaluate (ke));
1082 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracNA_Pipro -> Evaluate (ke));
1089 }
else if (hpdgc ==
kPdgPiP) {
1091 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracPipA_CEx -> Evaluate (ke));
1092 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracPipA_Elas -> Evaluate (ke));
1093 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracPipA_Inel -> Evaluate (ke));
1094 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracPipA_Abs -> Evaluate (ke));
1096 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracPipA_PiProd -> Evaluate (ke));
1097 else if (fate ==
kIHAFtPiProd)
return TMath::Max(0., fFracPipA_PiProd -> Evaluate (ke));
1104 }
else if (hpdgc ==
kPdgPiM) {
1106 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracPimA_CEx -> Evaluate (ke));
1107 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracPimA_Elas -> Evaluate (ke));
1108 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracPimA_Inel -> Evaluate (ke));
1109 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracPimA_Abs -> Evaluate (ke));
1111 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracPimA_PiProd -> Evaluate (ke));
1112 else if (fate ==
kIHAFtPiProd)
return TMath::Max(0., fFracPimA_PiProd -> Evaluate (ke));
1119 }
else if (hpdgc ==
kPdgPi0) {
1121 if (fate ==
kIHAFtCEx )
return TMath::Max(0., fFracPi0A_CEx -> Evaluate (ke));
1122 else if (fate ==
kIHAFtElas )
return TMath::Max(0., fFracPi0A_Elas -> Evaluate (ke));
1123 else if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracPi0A_Inel -> Evaluate (ke));
1124 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracPi0A_Abs -> Evaluate (ke));
1126 else if (fate ==
kIHAFtPiProd )
return TMath::Max(0., fFracPi0A_PiProd -> Evaluate (ke));
1127 else if (fate ==
kIHAFtPiProd)
return TMath::Max(0., fFracPi0A_PiProd -> Evaluate (ke));
1133 }
else if (hpdgc ==
kPdgKP) {
1135 if (fate ==
kIHAFtInelas )
return TMath::Max(0., fFracKA_Inel -> Evaluate (ke));
1136 else if (fate ==
kIHAFtAbs )
return TMath::Max(0., fFracKA_Abs -> Evaluate (ke));
1145 <<
"Can't handle particles with pdg code = " << hpdgc;
1155 ke = TMath::Max(fMinKinEnergy, ke);
1156 ke = TMath::Min(fMaxKinEnergyHN, ke);
1158 LOG(
"INukeData",
pDEBUG) <<
"Querying hN cross section at ke = " << ke;
1164 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * targZ;
1165 xsec+= TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * (targA-targZ);
1167 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * targZ;
1168 xsec+= TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * (targA-targZ);
1170 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * targZ;
1171 xsec+= TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * (targA-targZ);
1173 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1181 }
else if (hpdgc ==
kPdgPiM) {
1183 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPipn_CEx -> Evaluate(ke)) * targZ;
1184 xsec+= TMath::Max(0., fXSecPipp_CEx -> Evaluate(ke)) * (targA-targZ);
1186 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPipn_Elas -> Evaluate(ke)) * targZ;
1187 xsec+= TMath::Max(0., fXSecPipp_Elas -> Evaluate(ke)) * (targA-targZ);
1189 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPipn_Reac -> Evaluate(ke)) * targZ;
1190 xsec+= TMath::Max(0., fXSecPipp_Reac -> Evaluate(ke)) * (targA-targZ);
1192 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPipd_Abs -> Evaluate(ke)) * targA;
1200 }
else if (hpdgc ==
kPdgPi0) {
1202 if (fate ==
kIHNFtCEx ) {xsec = TMath::Max(0., fXSecPi0p_CEx -> Evaluate(ke)) * targZ;
1203 xsec+= TMath::Max(0., fXSecPi0n_CEx -> Evaluate(ke)) * (targA-targZ);
1205 else if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPi0p_Elas -> Evaluate(ke)) * targZ;
1206 xsec+= TMath::Max(0., fXSecPi0n_Elas -> Evaluate(ke)) * (targA-targZ);
1208 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPi0p_Reac -> Evaluate(ke)) * targZ;
1209 xsec+= TMath::Max(0., fXSecPi0n_Reac -> Evaluate(ke)) * (targA-targZ);
1211 else if (fate ==
kIHNFtAbs ) {xsec = TMath::Max(0., fXSecPi0d_Abs -> Evaluate(ke)) * targA;
1221 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPp_Elas -> Evaluate(ke)) * targZ;
1222 xsec+= TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * (targA-targZ);
1224 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPp_Reac -> Evaluate(ke)) * targZ;
1225 xsec+= TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * (targA-targZ);
1235 if (fate ==
kIHNFtElas ) {xsec = TMath::Max(0., fXSecPn_Elas -> Evaluate(ke)) * targZ;
1236 xsec+= TMath::Max(0., fXSecNn_Elas -> Evaluate(ke)) * (targA-targZ);
1238 else if (fate ==
kIHNFtInelas) {xsec = TMath::Max(0., fXSecPn_Reac -> Evaluate(ke)) * targZ;
1239 xsec+= TMath::Max(0., fXSecNn_Reac -> Evaluate(ke)) * (targA-targZ);
1258 <<
"Can't handle particles with pdg code = " << hpdgc;
1268 ke = TMath::Max(fMinKinEnergy, ke);
1269 ke = TMath::Min(fMaxKinEnergyHN, ke);
1272 double xsec = this->XSec(hpdgc,fate,ke,targA,targZ);
1275 double xsec_tot = 0;
1276 if (hpdgc ==
kPdgPiP ){xsec_tot = TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * targZ;
1277 xsec_tot+= TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * (targA-targZ);}
1278 else if (hpdgc ==
kPdgPiM ){xsec_tot = TMath::Max(0., fXSecPipn_Tot -> Evaluate(ke)) * targZ;
1279 xsec_tot+= TMath::Max(0., fXSecPipp_Tot -> Evaluate(ke)) * (targA-targZ);}
1280 else if (hpdgc ==
kPdgPi0 ){xsec_tot = TMath::Max(0., fXSecPi0p_Tot -> Evaluate(ke)) * targZ;
1281 xsec_tot+= TMath::Max(0., fXSecPi0n_Tot -> Evaluate(ke)) * (targA-targZ);}
1282 else if (hpdgc ==
kPdgProton ){xsec_tot = TMath::Max(0., fXSecPp_Tot -> Evaluate(ke)) * targZ;
1283 xsec_tot+= TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * (targA-targZ);}
1284 else if (hpdgc ==
kPdgNeutron){xsec_tot = TMath::Max(0., fXSecPn_Tot -> Evaluate(ke)) * targZ;
1285 xsec_tot+= TMath::Max(0., fXSecNn_Tot -> Evaluate(ke)) * (targA-targZ);}
1286 else if (hpdgc ==
kPdgGamma ) xsec_tot = TMath::Max(0., fXSecGamN_Tot -> Evaluate(ke));
1287 else if (hpdgc ==
kPdgKP ) xsec_tot = TMath::Max(0., fXSecKpN_Tot -> Evaluate(ke));
1290 double frac = (xsec_tot>0) ? xsec/xsec_tot : 0.;
1315 int numPoints = 1000;
1318 assert((numPoints%numEnv)==0);
1319 double sr = 2.0 / numEnv;
1320 double cstep = 2.0 / (numPoints);
1322 double ke = (p->
E() - p->
Mass()) * 1000.0;
1323 if (TMath::Abs((
int)ke-ke)<.01) ke+=.3;
1334 double * buff =
new double[numPoints/numEnv + 1];
1335 double ** dist =
new double*[numEnv];
1336 for(
int ih=0;ih<numEnv;ih++)
1338 dist[ih] =
new double[3];
1350 double totxsec = 0.0;
1351 for(
int i=0;i<numEnv;i++)
1353 double lbound = -1 + i*
sr;
1355 for(
int j=0;j<=numPoints / numEnv; j++)
1357 buff[j] = this->XSec(p->
Pdg(),target,scode,fate,ke,lbound+j*cstep);
1362 avg/= (double(numPoints)/double(numEnv));
1363 dist[i][0] = TMath::MaxElement(numPoints/numEnv+1,buff);
1365 dist[i][2] = dist[i][1] + ((i==0)?0.0:dist[i-1][2]);
1380 rval = rnd->
RndFsi().Rndm()*dist[numEnv-1][2];
1387 if(rval<=dist[env][2])
break;
1390 if(env==numEnv) env=numEnv - 1;
1398 rval = rnd->
RndFsi().Rndm()*dist[env][0];
1401 if(rval < this->XSec(p->
Pdg(),target,scode,fate,ke,val))
break;
1407 int NUM_POINTS=2000;
1409 double points[200]={0};
1410 for(
int k=0;k<NUM_POINTS;k++)
1412 points[int(k/10)]=this->XSec(p->
Pdg(),target,scode,fate,ke,-1+(2.0/NUM_POINTS)*k);
1413 if(points[
int(k/10)]>0) pvalues++;
1415 if(pvalues<(.05*NUM_POINTS))
1419 if(p->
P4()->P()<.005)
1421 val = 2*rnd->
RndFsi().Rndm()-1;
1426 LOG(
"Intranuke",
pWARN) <<
"Hung-up in IntBounce method - Exiting";
1429 for(
int ie=0;ie<200;ie+=10) {
1430 LOG(
"Intranuke",
pWARN) << points[ie+0] <<
", " << points[ie+1] <<
", " << points[ie+2] <<
", "
1431 << points[ie+3] <<
", " << points[ie+4] <<
", " << points[ie+5] <<
", " << points[ie+6] <<
", "
1432 << points[ie+7] <<
", " << points[ie+8] <<
", " << points[ie+9];
1434 for(
int ih=0;ih<numEnv;ih++)
1447 for(
int ih=0;ih<numEnv;ih++)
static INukeHadroData * fInstance
void DummyMethodAndSilentCompiler()
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
double E(void) const
Get energy.
static RandomGen * Instance()
Access instance.
const TLorentzVector * P4(void) const
void LoadCrossSections(void)
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 Frac(int hpdgc, INukeFateHA_t fate, double ke) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
enum genie::EINukeFateHN_t INukeFateHN_t
static double fMinKinEnergy
static INukeHadroData * Instance(void)
double IntBounce(const GHepParticle *p, int target, int s1, INukeFateHN_t fate)
void ReadhNFile(string filename, double ke, int npoints, int &curr_point, double *costh_array, double *xsec_array, int cols)
static string AsString(INukeFateHN_t fate)
static double fMaxKinEnergyHN
double XSec(int hpdgc, int tgt, int nprod, INukeFateHN_t rxnType, double ke, double costh) const
Singleton class to load & serve hadron x-section splines used by GENIE's version of the INTRANUKE cas...
static double fMaxKinEnergyHA
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