96 string filename =
"hadxs.root";
98 string data_dir = (gSystem->Getenv(
"GINUKEHADRONDATA")) ?
99 string(gSystem->Getenv(
"GINUKEHADRONDATA")) :
100 string(gSystem->Getenv(
"GENIE")) +
string(
"/data/intranuke/");
103 <<
"Saving INTRANUKE hadron x-section data to file: " << filename;
105 TFile f(filename.c_str(),
"UPDATE");
109 double cstep = 2.0 / (numPoints);
113 const int hN_kpNelas_nfiles = 18;
114 const int hN_kpNelas_points_per_file = 37;
115 const int hN_kpNelas_npoints = hN_kpNelas_points_per_file * hN_kpNelas_nfiles;
117 int hN_kpNelas_energies[hN_kpNelas_nfiles] = {
118 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
119 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
122 TGraph2D * hN_kpNelas_graph =
new TGraph2D(hN_kpNelas_npoints);
123 TGraph2D * hN_kpNelas_int =
new TGraph2D(hN_kpNelas_nfiles*numPoints);
128 for(
int ifile = 0; ifile < hN_kpNelas_nfiles; ifile++) {
130 ostringstream hN_datafile;
131 int ke = hN_kpNelas_energies[ifile];
132 hN_datafile << data_dir <<
"/diff_ang/kpn/kpn" << ke <<
".txt";
134 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
135 for(
int i=0; i<buff->GetN(); i++) {
136 buff -> GetPoint(i,x,y);
137 hN_kpNelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
153 for (
int ifile=0;ifile<hN_kpNelas_nfiles;ifile++) {
154 int subdiv = numPoints*ifile;
155 int ke = hN_kpNelas_energies[ifile];
156 for(
int j=0;j<numPoints; j++)
158 hN_kpNelas_int -> SetPoint(subdiv+j,
double(ke),-1+j*cstep,
163 hN_kpNelas_graph ->
Write(
"d_kpN_elas_data");
164 if (test_intbounce) {
165 hN_kpNelas_int ->
Write(
"d_kpN_elas_int");
167 delete hN_kpNelas_graph;
168 delete hN_kpNelas_int;
173 const int hN_kpPelas_nfiles = 18;
174 const int hN_kpPelas_points_per_file = 37;
175 const int hN_kpPelas_npoints = hN_kpPelas_points_per_file * hN_kpPelas_nfiles;
177 int hN_kpPelas_energies[hN_kpPelas_nfiles] = {
178 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000,
179 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800
182 TGraph2D * hN_kpPelas_graph =
new TGraph2D(hN_kpPelas_npoints);
184 TGraph2D * hN_kpPelas_int =
new TGraph2D(hN_kpPelas_nfiles*numPoints);
189 for(
int ifile = 0; ifile < hN_kpPelas_nfiles; ifile++) {
191 ostringstream hN_datafile;
192 int ke = hN_kpPelas_energies[ifile];
193 hN_datafile << data_dir <<
"/diff_ang/kpp/kpp" << ke <<
".txt";
195 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
196 for(
int i=0; i<buff->GetN(); i++) {
197 buff -> GetPoint(i,x,y);
198 hN_kpPelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
205 int subdiv = numPoints*ifile;
207 for(
int j=0;j<numPoints; j++)
212 hN_kpPelas_int -> SetPoint(subdiv+j,
double(ke),-1.+
double(j)*cstep,
228 hN_kpPelas_graph ->
Write(
"d_kpP_elas_data");
231 hN_kpPelas_int ->
Write(
"d_kpP_elas_int");
234 delete hN_kpPelas_graph;
235 delete hN_kpPelas_int;
241 const int hN_ppelas_nfiles = 20;
242 const int hN_ppelas_points_per_file = 21;
243 const int hN_ppelas_npoints = hN_ppelas_points_per_file * hN_ppelas_nfiles;
245 int hN_ppelas_energies[hN_ppelas_nfiles] = {
246 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
247 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
250 TGraph2D * hN_ppelas_graph =
new TGraph2D(hN_ppelas_npoints);
251 TGraph2D * hN_ppelas_int =
new TGraph2D(hN_ppelas_nfiles*numPoints);
257 for(
int ifile = 0; ifile < hN_ppelas_nfiles; ifile++) {
259 ostringstream hN_datafile;
260 int ke = hN_ppelas_energies[ifile];
261 hN_datafile << data_dir <<
"/diff_ang/pp/pp" << ke <<
".txt";
263 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
264 for(
int i=0; i<buff->GetN(); i++) {
265 buff -> GetPoint(i,x,y);
266 hN_ppelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
273 int subdiv = numPoints*ifile;
274 for(
int j=0;j<numPoints; j++)
276 hN_ppelas_int -> SetPoint(subdiv+j,
double(ke),-1+j*cstep,
282 hN_ppelas_graph ->
Write(
"d_pp_elas_data");
285 hN_ppelas_int ->
Write(
"d_pp_elas_int");
288 delete hN_ppelas_graph;
289 delete hN_ppelas_int;
295 const int hN_npelas_nfiles = 20;
296 const int hN_npelas_points_per_file = 21;
297 const int hN_npelas_npoints = hN_npelas_points_per_file * hN_npelas_nfiles;
299 int hN_npelas_energies[hN_npelas_nfiles] = {
300 50, 100, 150, 200, 250, 300, 350, 400, 450, 500,
301 550, 600, 650, 700, 750, 800, 850, 900, 950, 1000
304 TGraph2D * hN_npelas_graph =
new TGraph2D(hN_npelas_npoints);
305 TGraph2D * hN_npelas_int =
new TGraph2D(hN_npelas_nfiles*numPoints);
311 for(
int ifile = 0; ifile < hN_npelas_nfiles; ifile++) {
313 ostringstream hN_datafile;
314 int ke = hN_npelas_energies[ifile];
315 hN_datafile << data_dir <<
"/diff_ang/pn/pn" << ke <<
".txt";
317 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
318 for(
int i=0; i<buff->GetN(); i++) {
319 buff -> GetPoint(i,x,y);
320 hN_npelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
327 int subdiv = numPoints*ifile;
328 for(
int j=0;j<numPoints; j++)
330 hN_npelas_int -> SetPoint(subdiv+j,
double(ke),-1+j*cstep,
336 hN_npelas_graph ->
Write(
"d_np_elas_data");
339 hN_npelas_int ->
Write(
"d_np_elas_int");
342 delete hN_npelas_graph;
343 delete hN_npelas_int;
349 const int hN_pipNelas_nfiles = 60;
350 const int hN_pipNelas_points_per_file = 21;
351 const int hN_pipNelas_npoints = hN_pipNelas_points_per_file * hN_pipNelas_nfiles;
353 int hN_pipNelas_energies[hN_pipNelas_nfiles] = {
354 10, 20, 30, 40, 50, 60, 70, 80, 90,
355 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
356 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
357 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
358 700, 740, 780, 820, 860, 900, 940, 980,
359 1020, 1060, 1100, 1140, 1180, 1220, 1260,
360 1300, 1340, 1380, 1420, 1460, 1500
363 TGraph2D * hN_pipNelas_graph =
new TGraph2D(hN_pipNelas_npoints);
364 TGraph2D * hN_pipNelas_int =
new TGraph2D(hN_pipNelas_nfiles*numPoints);
370 for(
int ifile = 0; ifile < hN_pipNelas_nfiles; ifile++) {
372 ostringstream hN_datafile;
373 int ke = hN_pipNelas_energies[ifile];
374 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
376 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
377 for(
int i=0; i<buff->GetN(); i++) {
378 buff -> GetPoint(i,x,y);
379 hN_pipNelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
386 int subdiv = numPoints*ifile;
387 for(
int j=0;j<numPoints; j++)
389 hN_pipNelas_int -> SetPoint(subdiv+j,
double(ke),-1+j*cstep,
397 hN_pipNelas_graph ->
Write(
"d_pipN_elas_data");
400 hN_pipNelas_int ->
Write(
"d_pipN_elas_int");
403 delete hN_pipNelas_graph;
404 delete hN_pipNelas_int;
410 const int hN_pi0Nelas_nfiles = 60;
411 const int hN_pi0Nelas_points_per_file = 21;
412 const int hN_pi0Nelas_npoints = hN_pi0Nelas_points_per_file * hN_pi0Nelas_nfiles;
414 int hN_pi0Nelas_energies[hN_pi0Nelas_nfiles] = {
415 10, 20, 30, 40, 50, 60, 70, 80, 90,
416 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
417 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
418 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
419 700, 740, 780, 820, 860, 900, 940, 980,
420 1020, 1060, 1100, 1140, 1180, 1220, 1260,
421 1300, 1340, 1380, 1420, 1460, 1500
424 TGraph2D * hN_pi0Nelas_graph =
new TGraph2D(hN_pi0Nelas_npoints);
425 TGraph2D * hN_pi0Nelas_int =
new TGraph2D(hN_pi0Nelas_nfiles*numPoints);
431 for(
int ifile = 0; ifile < hN_pi0Nelas_nfiles; ifile++) {
433 ostringstream hN_datafile;
434 int ke = hN_pi0Nelas_energies[ifile];
435 hN_datafile << data_dir <<
"/diff_ang/pip/pip" << ke <<
".txt";
437 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
438 for(
int i=0; i<buff->GetN(); i++) {
439 buff -> GetPoint(i,x,y);
440 hN_pi0Nelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
447 int subdiv = numPoints*ifile;
448 for(
int j=0;j<numPoints; j++)
450 hN_pi0Nelas_int -> SetPoint(subdiv+j,
double(ke),-1+j*cstep,
458 hN_pi0Nelas_graph ->
Write(
"d_pi0N_elas_data");
461 hN_pi0Nelas_int ->
Write(
"d_pi0N_elas_int");
464 delete hN_pi0Nelas_graph;
465 delete hN_pi0Nelas_int;
471 const int hN_pimNelas_nfiles = 60;
472 const int hN_pimNelas_points_per_file = 21;
473 const int hN_pimNelas_npoints = hN_pimNelas_points_per_file * hN_pimNelas_nfiles;
475 int hN_pimNelas_energies[hN_pimNelas_nfiles] = {
476 10, 20, 30, 40, 50, 60, 70, 80, 90,
477 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
478 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
479 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
480 700, 740, 780, 820, 860, 900, 940, 980,
481 1020, 1060, 1100, 1140, 1180, 1220, 1260,
482 1300, 1340, 1380, 1420, 1460, 1500
485 TGraph2D * hN_pimNelas_graph =
new TGraph2D(hN_pimNelas_npoints);
490 for(
int ifile = 0; ifile < hN_pimNelas_nfiles; ifile++) {
492 ostringstream hN_datafile;
493 int ke = hN_pimNelas_energies[ifile];
494 hN_datafile << data_dir <<
"/diff_ang/pim/pim" << ke <<
".txt";
496 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
497 for(
int i=0; i<buff->GetN(); i++) {
498 buff -> GetPoint(i,x,y);
499 hN_pimNelas_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
505 hN_pimNelas_graph ->
Write(
"d_pimN_elas_data");
506 delete hN_pimNelas_graph;
511 const int hN_piNcex_nfiles = 60;
512 const int hN_piNcex_points_per_file = 21;
513 const int hN_piNcex_npoints = hN_piNcex_points_per_file * hN_piNcex_nfiles;
515 int hN_piNcex_energies[hN_piNcex_nfiles] = {
516 10, 20, 30, 40, 50, 60, 70, 80, 90,
517 100, 110, 120, 130, 140, 150, 160, 170, 180, 190,
518 200, 210, 220, 230, 240, 250, 260, 270, 280, 290,
519 300, 340, 380, 420, 460, 500, 540, 580, 620, 660,
520 700, 740, 780, 820, 860, 900, 940, 980,
521 1020, 1060, 1100, 1140, 1180, 1220, 1260,
522 1300, 1340, 1380, 1420, 1460, 1500
525 TGraph2D * hN_piNcex_graph =
new TGraph2D(hN_piNcex_npoints);
530 for(
int ifile = 0; ifile < hN_piNcex_nfiles; ifile++) {
532 ostringstream hN_datafile;
533 int ke = hN_piNcex_energies[ifile];
534 hN_datafile << data_dir <<
"/diff_ang/pie/pie" << ke <<
".txt";
536 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
537 for(
int i=0; i<buff->GetN(); i++) {
538 buff -> GetPoint(i,x,y);
539 hN_piNcex_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
545 hN_piNcex_graph ->
Write(
"d_piN_cex_data");
546 delete hN_piNcex_graph;
551 const int hN_piNabs_nfiles = 19;
552 const int hN_piNabs_points_per_file = 21;
553 const int hN_piNabs_npoints = hN_piNabs_points_per_file * hN_piNabs_nfiles;
555 int hN_piNabs_energies[hN_piNabs_nfiles] = {
556 50, 75, 100, 125, 150, 175, 200, 225, 250, 275,
557 300, 325, 350, 375, 400, 425, 450, 475, 500
560 TGraph2D * hN_piNabs_graph =
new TGraph2D(hN_piNabs_npoints);
565 for(
int ifile = 0; ifile < hN_piNabs_nfiles; ifile++) {
567 ostringstream hN_datafile;
568 int ke = hN_piNabs_energies[ifile];
569 hN_datafile << data_dir <<
"/diff_ang/pid2p/pid2p" << ke <<
".txt";
571 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
572 for(
int i=0; i<buff->GetN(); i++) {
573 buff -> GetPoint(i,x,y);
574 hN_piNabs_graph -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
580 hN_piNabs_graph ->
Write(
"d_piN_abs_data");
581 delete hN_piNabs_graph;
586 const int hN_gampi0pInelas_nfiles = 29;
587 const int hN_gampi0pInelas_points_per_file = 37;
588 const int hN_gampi0pInelas_npoints = hN_gampi0pInelas_points_per_file * hN_gampi0pInelas_nfiles;
590 int hN_gampi0pInelas_energies[hN_gampi0pInelas_nfiles] = {
591 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
592 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
593 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
596 TGraph2D * fhN2dXSecGamPi0P_Inelas =
new TGraph2D(hN_gampi0pInelas_npoints);
601 for(
int ifile = 0; ifile < hN_gampi0pInelas_nfiles; ifile++) {
603 ostringstream hN_datafile;
604 int ke = hN_gampi0pInelas_energies[ifile];
605 hN_datafile << data_dir <<
"/diff_ang/gampi0p/" << ke <<
"-pi0p.txt";
607 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
608 for(
int i=0; i<buff->GetN(); i++) {
609 buff -> GetPoint(i,x,y);
610 fhN2dXSecGamPi0P_Inelas -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
616 fhN2dXSecGamPi0P_Inelas ->
Write(
"d_gam_pi0p_inel_data");
617 delete fhN2dXSecGamPi0P_Inelas;
622 const int hN_gampi0nInelas_nfiles = 29;
623 const int hN_gampi0nInelas_points_per_file = 37;
624 const int hN_gampi0nInelas_npoints = hN_gampi0nInelas_points_per_file * hN_gampi0nInelas_nfiles;
626 int hN_gampi0nInelas_energies[hN_gampi0nInelas_nfiles] = {
627 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
628 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
629 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
632 TGraph2D * fhN2dXSecGamPi0N_Inelas =
new TGraph2D(hN_gampi0nInelas_npoints);
637 for(
int ifile = 0; ifile < hN_gampi0nInelas_nfiles; ifile++) {
639 ostringstream hN_datafile;
640 int ke = hN_gampi0nInelas_energies[ifile];
641 hN_datafile << data_dir <<
"/diff_ang/gampi0n/" << ke <<
"-pi0n.txt";
643 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
644 for(
int i=0; i<buff->GetN(); i++) {
645 buff -> GetPoint(i,x,y);
646 fhN2dXSecGamPi0N_Inelas -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
652 fhN2dXSecGamPi0N_Inelas ->
Write(
"d_gam_pi0n_inel_data");
653 delete fhN2dXSecGamPi0N_Inelas;
658 const int hN_gampipnInelas_nfiles = 29;
659 const int hN_gampipnInelas_points_per_file = 37;
660 const int hN_gampipnInelas_npoints = hN_gampipnInelas_points_per_file * hN_gampipnInelas_nfiles;
662 int hN_gampipnInelas_energies[hN_gampipnInelas_nfiles] = {
663 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
664 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
665 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
668 TGraph2D * fhN2dXSecGamPipN_Inelas =
new TGraph2D(hN_gampipnInelas_npoints);
673 for(
int ifile = 0; ifile < hN_gampipnInelas_nfiles; ifile++) {
675 ostringstream hN_datafile;
676 int ke = hN_gampipnInelas_energies[ifile];
677 hN_datafile << data_dir <<
"/diff_ang/gampi+n/" << ke <<
"-pi+n.txt";
679 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
680 for(
int i=0; i<buff->GetN(); i++) {
681 buff -> GetPoint(i,x,y);
682 fhN2dXSecGamPipN_Inelas -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
688 fhN2dXSecGamPipN_Inelas ->
Write(
"d_gam_pipn_inel_data");
689 delete fhN2dXSecGamPipN_Inelas;
694 const int hN_gampimpInelas_nfiles = 29;
695 const int hN_gampimpInelas_points_per_file = 37;
696 const int hN_gampimpInelas_npoints = hN_gampimpInelas_points_per_file * hN_gampimpInelas_nfiles;
698 int hN_gampimpInelas_energies[hN_gampimpInelas_nfiles] = {
699 160, 180, 200, 220, 240, 260, 280, 300, 320, 340,
700 360, 380, 400, 450, 500, 550, 600, 650, 700, 750,
701 800, 850, 900, 950, 1000, 1050, 1100, 1150, 1200
704 TGraph2D * fhN2dXSecGamPimP_Inelas =
new TGraph2D(hN_gampimpInelas_npoints);
709 for(
int ifile = 0; ifile < hN_gampimpInelas_nfiles; ifile++) {
711 ostringstream hN_datafile;
712 int ke = hN_gampimpInelas_energies[ifile];
713 hN_datafile << data_dir <<
"/diff_ang/gampi-p/" << ke <<
"-pi-p.txt";
715 TGraph * buff =
new TGraph(hN_datafile.str().c_str());
716 for(
int i=0; i<buff->GetN(); i++) {
717 buff -> GetPoint(i,x,y);
718 fhN2dXSecGamPimP_Inelas -> SetPoint(ipoint,(
double)ke,TMath::Cos(x*
kPi/180.),y);
724 fhN2dXSecGamPimP_Inelas ->
Write(
"d_gam_pimp_inel_data");
725 delete fhN2dXSecGamPimP_Inelas;
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Singleton class to load & serve hadron x-section splines used by GENIE's version of the INTRANUKE cas...