49 #include <TDirectory.h>
51 #include <TPostScript.h>
55 #include <TPavesText.h>
59 #include <TObjString.h>
61 #include "Framework/Conventions/GBuild.h"
70 using std::ostringstream;
74 using namespace genie;
84 TH1F *
DrawFrame (TGraph * gr0, TGraph * gr1, TPad * p,
const char * xt,
const char * yt,
double yminsc,
double ymaxsc);
85 TH1F *
DrawFrame (
double xmin,
double xmax,
double ymin,
double ymax, TPad * p,
const char * xt,
const char * yt);
86 void Draw (
const char * plot,
const char * title);
87 void Draw (TGraph* gr,
const char * opt);
88 TGraph*
TrimGraph (TGraph * gr,
int max_np_per_decade);
89 TGraph*
DrawRatio (TGraph * gr0, TGraph * gr1);
125 int main(
int argc,
char ** argv)
140 gC =
new TCanvas(
"c",
"",20,20,500,650);
141 gC->SetBorderMode(0);
149 gC->Range(0,0,100,100);
150 TPavesText hdr(10,40,90,70,3,
"tr");
151 hdr.AddText(
"GENIE cross sections");
154 hdr.AddText(
"Plotting data from: ");
158 hdr.AddText(
"Comparing with reference data (red circles) from: ");
172 gPadTitle =
new TPad(
"gPadTitle",
"",0.05,0.90,0.95,0.97);
173 gPadXSecs =
new TPad(
"gPadXSecs",
"",0.05,0.35,0.95,0.88);
174 gPadRatio =
new TPad(
"gPadRatio",
"",0.05,0.03,0.95,0.32);
176 gPadTitle =
new TPad(
"gPadTitle",
"",0.05,0.90,0.95,0.97);
177 gPadXSecs =
new TPad(
"gPadXSecs",
"",0.05,0.05,0.95,0.88);
178 gPadRatio =
new TPad(
"gPadRatio",
"",0.05,0.03,0.95,0.04);
204 gLS =
new TLegend(0.80,0.25,0.90,0.45);
205 gLS -> SetFillColor(0);
207 gLS -> SetBorderSize(0);
228 LOG(
"gxscomp",
pINFO) <<
"No reference plots will be shown.";
242 if( dirname.find (
"nu_e_bar") != string::npos )
244 label =
"#bar{#nu_{e}}";
248 if ( dirname.find (
"nu_e") != string::npos )
254 if ( dirname.find (
"nu_mu_bar") != string::npos )
256 label =
"#bar{#nu_{#mu}}";
260 if ( dirname.find (
"nu_mu") != string::npos )
266 if ( dirname.find (
"nu_tau_bar") != string::npos )
268 label =
"#bar{#nu_{#tau}}";
272 if ( dirname.find (
"nu_tau") != string::npos )
274 label =
"#nu_{#tau}";
294 label = dirname.substr ( dirname.find(
"nu_e_bar")+9, dirname.length() );
299 label = dirname.substr ( dirname.find(
"nu_e")+5, dirname.length() );
304 label = dirname.substr ( dirname.find(
"nu_mu_bar")+10, dirname.length() );
309 label = dirname.substr ( dirname.find(
"nu_mu")+6, dirname.length() );
314 label = dirname.substr ( dirname.find(
"nu_tau_bar")+11, dirname.length() );
319 label = dirname.substr ( dirname.find(
"nu_tau")+7, dirname.length() );
322 bool free_n = (label.size()==1 && label.find(
"n") !=string::npos);
323 bool free_p = (label.size()==2 && label.find(
"H1")!=string::npos);
324 bool free_nuc = free_p || free_n;
347 int ndir = directories->GetEntries();
348 for(
int idir=0; idir<ndir; idir++) {
349 TObjString *
dir = (TObjString*) directories->At(idir);
366 LOG(
"gxscomp",
pINFO) <<
"Probe : " << probestr;
367 LOG(
"gxscomp",
pINFO) <<
"Target : " << targetstr;
374 Draw(
"tot_cc", Form(
"%s + %s, TOT CC",probestr,targetstr));
375 Draw(
"tot_nc", Form(
"%s + %s, TOT NC",probestr,targetstr));
379 Draw(
"tot_cc_n", Form(
"%s + n %s, TOT CC" , probestr, targetstr));
380 Draw(
"tot_nc_n", Form(
"%s + n %s, TOT NC" , probestr, targetstr));
382 Draw(
"qel_cc_n", Form(
"%s + n %s, QEL CC" , probestr, targetstr));
384 Draw(
"qel_nc_n", Form(
"%s + n %s, NCEL" , probestr, targetstr));
385 Draw(
"res_cc_n", Form(
"%s + n %s, RES CC" , probestr, targetstr));
386 Draw(
"res_nc_n", Form(
"%s + n %s, RES NC" , probestr, targetstr));
387 Draw(
"res_cc_n_1232P33", Form(
"%s + n %s, RES CC, P33(1232)" , probestr, targetstr));
388 Draw(
"res_cc_n_1535S11", Form(
"%s + n %s, RES CC, S11(1535)" , probestr, targetstr));
389 Draw(
"res_cc_n_1520D13", Form(
"%s + n %s, RES CC, D13(1520)" , probestr, targetstr));
390 Draw(
"res_cc_n_1650S11", Form(
"%s + n %s, RES CC, S11(1650)" , probestr, targetstr));
391 Draw(
"res_cc_n_1700D13", Form(
"%s + n %s, RES CC, D13(1700)" , probestr, targetstr));
392 Draw(
"res_cc_n_1675D15", Form(
"%s + n %s, RES CC, D15(1675)" , probestr, targetstr));
393 Draw(
"res_cc_n_1620S31", Form(
"%s + n %s, RES CC, S31(1620)" , probestr, targetstr));
394 Draw(
"res_cc_n_1700D33", Form(
"%s + n %s, RES CC, D33(1700)" , probestr, targetstr));
395 Draw(
"res_cc_n_1440P11", Form(
"%s + n %s, RES CC, P11(1440)" , probestr, targetstr));
396 Draw(
"res_cc_n_1720P13", Form(
"%s + n %s, RES CC, P13(1720)" , probestr, targetstr));
397 Draw(
"res_cc_n_1680F15", Form(
"%s + n %s, RES CC, F15(1680)" , probestr, targetstr));
398 Draw(
"res_cc_n_1910P31", Form(
"%s + n %s, RES CC, P31(1910)" , probestr, targetstr));
399 Draw(
"res_cc_n_1920P33", Form(
"%s + n %s, RES CC, P33(1920)" , probestr, targetstr));
400 Draw(
"res_cc_n_1905F35", Form(
"%s + n %s, RES CC, F35(1905)" , probestr, targetstr));
401 Draw(
"res_cc_n_1950F37", Form(
"%s + n %s, RES CC, F37(1950)" , probestr, targetstr));
402 Draw(
"res_cc_n_1710P11", Form(
"%s + n %s, RES CC, P11(1710)" , probestr, targetstr));
403 Draw(
"res_nc_n_1232P33", Form(
"%s + n %s, RES NC, P33(1232)" , probestr, targetstr));
404 Draw(
"res_nc_n_1535S11", Form(
"%s + n %s, RES NC, S11(1535)" , probestr, targetstr));
405 Draw(
"res_nc_n_1520D13", Form(
"%s + n %s, RES NC, D13(1520)" , probestr, targetstr));
406 Draw(
"res_nc_n_1650S11", Form(
"%s + n %s, RES NC, S11(1650)" , probestr, targetstr));
407 Draw(
"res_nc_n_1700D13", Form(
"%s + n %s, RES NC, D13(1700)" , probestr, targetstr));
408 Draw(
"res_nc_n_1675D15", Form(
"%s + n %s, RES NC, D15(1675)" , probestr, targetstr));
409 Draw(
"res_nc_n_1620S31", Form(
"%s + n %s, RES NC, S31(1620)" , probestr, targetstr));
410 Draw(
"res_nc_n_1700D33", Form(
"%s + n %s, RES NC, D33(1700)" , probestr, targetstr));
411 Draw(
"res_nc_n_1440P11", Form(
"%s + n %s, RES NC, P11(1440)" , probestr, targetstr));
412 Draw(
"res_nc_n_1720P13", Form(
"%s + n %s, RES NC, P13(1720)" , probestr, targetstr));
413 Draw(
"res_nc_n_1680F15", Form(
"%s + n %s, RES NC, F15(1680)" , probestr, targetstr));
414 Draw(
"res_nc_n_1910P31", Form(
"%s + n %s, RES NC, P31(1910)" , probestr, targetstr));
415 Draw(
"res_nc_n_1920P33", Form(
"%s + n %s, RES NC, P33(1920)" , probestr, targetstr));
416 Draw(
"res_nc_n_1905F35", Form(
"%s + n %s, RES NC, F35(1905)" , probestr, targetstr));
417 Draw(
"res_nc_n_1950F37", Form(
"%s + n %s, RES NC, F37(1950)" , probestr, targetstr));
418 Draw(
"res_nc_n_1710P11", Form(
"%s + n %s, RES NC, P11(1710)" , probestr, targetstr));
419 Draw(
"dis_cc_n", Form(
"%s + n %s, DIS CC" , probestr, targetstr));
420 Draw(
"dis_nc_n", Form(
"%s + n %s, DIS NC" , probestr, targetstr));
422 Draw(
"dis_cc_n_ubarsea", Form(
"%s + n %s, DIS CC (#bar{u}_{sea})" , probestr, targetstr));
423 Draw(
"dis_cc_n_dval", Form(
"%s + n %s, DIS CC (d_{val})" , probestr, targetstr));
424 Draw(
"dis_cc_n_dsea", Form(
"%s + n %s, DIS CC (d_{sea})" , probestr, targetstr));
425 Draw(
"dis_cc_n_ssea", Form(
"%s + n %s, DIS CC (s_{sea})" , probestr, targetstr));
428 Draw(
"dis_cc_n_sbarsea", Form(
"%s + n %s, DIS CC (#bar{s}_{sea})" , probestr, targetstr));
429 Draw(
"dis_cc_n_dbarsea", Form(
"%s + n %s, DIS CC (#bar{d}_{val})" , probestr, targetstr));
430 Draw(
"dis_cc_n_uval", Form(
"%s + n %s, DIS CC (u_{val})" , probestr, targetstr));
431 Draw(
"dis_cc_n_usea", Form(
"%s + n %s, DIS CC (u_{sea})" , probestr, targetstr));
433 Draw(
"dis_nc_n_sbarsea", Form(
"%s + n %s, DIS NC (#bar{s}_{sea})" , probestr, targetstr));
434 Draw(
"dis_nc_n_ubarsea", Form(
"%s + n %s, DIS NC (#bar{u}_{sea})" , probestr, targetstr));
435 Draw(
"dis_nc_n_dbarsea", Form(
"%s + n %s, DIS NC (#bar{d}_{sea})" , probestr, targetstr));
436 Draw(
"dis_nc_n_dval", Form(
"%s + n %s, DIS NC (d_{val})" , probestr, targetstr));
437 Draw(
"dis_nc_n_dsea", Form(
"%s + n %s, DIS NC (d_{sea})" , probestr, targetstr));
438 Draw(
"dis_nc_n_uval", Form(
"%s + n %s, DIS NC (u_{val})" , probestr, targetstr));
439 Draw(
"dis_nc_n_usea", Form(
"%s + n %s, DIS NC (u_{sea})" , probestr, targetstr));
440 Draw(
"dis_nc_n_ssea", Form(
"%s + n %s, DIS NC (s_{sea})" , probestr, targetstr));
442 Draw(
"dis_cc_n_dval_charm", Form(
"%s + n %s, DIS CC (d_{val} -> c)" , probestr, targetstr));
443 Draw(
"dis_cc_n_dsea_charm", Form(
"%s + n %s, DIS CC (d_{sea} -> c)" , probestr, targetstr));
444 Draw(
"dis_cc_n_ssea_charm", Form(
"%s + n %s, DIS CC (s_{sea} -> c)" , probestr, targetstr));
447 Draw(
"dis_cc_n_dbarsea_charm", Form(
"%s + n %s, DIS CC (#bar{d}_{sea} -> #bar{c})" , probestr, targetstr));
448 Draw(
"dis_cc_n_sbarsea_charm", Form(
"%s + n %s, DIS CC (#bar{s}_{sea} -> #bar{c})" , probestr, targetstr));
454 Draw(
"tot_cc_p", Form(
"%s + p %s, TOT CC" , probestr, targetstr));
455 Draw(
"tot_nc_p", Form(
"%s + p %s, TOT NC" , probestr, targetstr));
457 Draw(
"qel_cc_p", Form(
"%s + p %s, QEL CC" , probestr, targetstr));
459 Draw(
"qel_nc_p", Form(
"%s + p %s, NCEL" , probestr, targetstr));
460 Draw(
"res_cc_p", Form(
"%s + p %s, RES CC" , probestr, targetstr));
461 Draw(
"res_nc_p", Form(
"%s + p %s, RES NC" , probestr, targetstr));
462 Draw(
"res_cc_p_1232P33", Form(
"%s + p %s, RES CC, P33(1232)" , probestr, targetstr));
463 Draw(
"res_cc_p_1535S11", Form(
"%s + p %s, RES CC, S11(1535)" , probestr, targetstr));
464 Draw(
"res_cc_p_1520D13", Form(
"%s + p %s, RES CC, D13(1520)" , probestr, targetstr));
465 Draw(
"res_cc_p_1650S11", Form(
"%s + p %s, RES CC, S11(1650)" , probestr, targetstr));
466 Draw(
"res_cc_p_1700D13", Form(
"%s + p %s, RES CC, D13(1700)" , probestr, targetstr));
467 Draw(
"res_cc_p_1675D15", Form(
"%s + p %s, RES CC, D15(1675)" , probestr, targetstr));
468 Draw(
"res_cc_p_1620S31", Form(
"%s + p %s, RES CC, S31(1620)" , probestr, targetstr));
469 Draw(
"res_cc_p_1700D33", Form(
"%s + p %s, RES CC, D33(1700)" , probestr, targetstr));
470 Draw(
"res_cc_p_1440P11", Form(
"%s + p %s, RES CC, P11(1440)" , probestr, targetstr));
471 Draw(
"res_cc_p_1720P13", Form(
"%s + p %s, RES CC, P13(1720)" , probestr, targetstr));
472 Draw(
"res_cc_p_1680F15", Form(
"%s + p %s, RES CC, F15(1680)" , probestr, targetstr));
473 Draw(
"res_cc_p_1910P31", Form(
"%s + p %s, RES CC, P31(1910)" , probestr, targetstr));
474 Draw(
"res_cc_p_1920P33", Form(
"%s + p %s, RES CC, P33(1920)" , probestr, targetstr));
475 Draw(
"res_cc_p_1905F35", Form(
"%s + p %s, RES CC, F35(1905)" , probestr, targetstr));
476 Draw(
"res_cc_p_1950F37", Form(
"%s + p %s, RES CC, F37(1950)" , probestr, targetstr));
477 Draw(
"res_cc_p_1710P11", Form(
"%s + p %s, RES CC, P11(1710)" , probestr, targetstr));
478 Draw(
"res_nc_p_1232P33", Form(
"%s + p %s, RES NC, P33(1232)" , probestr, targetstr));
479 Draw(
"res_nc_p_1535S11", Form(
"%s + p %s, RES NC, S11(1535)" , probestr, targetstr));
480 Draw(
"res_nc_p_1520D13", Form(
"%s + p %s, RES NC, D13(1520)" , probestr, targetstr));
481 Draw(
"res_nc_p_1650S11", Form(
"%s + p %s, RES NC, S11(1650)" , probestr, targetstr));
482 Draw(
"res_nc_p_1700D13", Form(
"%s + p %s, RES NC, D13(1700)" , probestr, targetstr));
483 Draw(
"res_nc_p_1675D15", Form(
"%s + p %s, RES NC, D15(1675)" , probestr, targetstr));
484 Draw(
"res_nc_p_1620S31", Form(
"%s + p %s, RES NC, S31(1620)" , probestr, targetstr));
485 Draw(
"res_nc_p_1700D33", Form(
"%s + p %s, RES NC, D33(1700)" , probestr, targetstr));
486 Draw(
"res_nc_p_1440P11", Form(
"%s + p %s, RES NC, P11(1440)" , probestr, targetstr));
487 Draw(
"res_nc_p_1720P13", Form(
"%s + p %s, RES NC, P13(1720)" , probestr, targetstr));
488 Draw(
"res_nc_p_1680F15", Form(
"%s + p %s, RES NC, F15(1680)" , probestr, targetstr));
489 Draw(
"res_nc_p_1910P31", Form(
"%s + p %s, RES NC, P31(1910)" , probestr, targetstr));
490 Draw(
"res_nc_p_1920P33", Form(
"%s + p %s, RES NC, P33(1920)" , probestr, targetstr));
491 Draw(
"res_nc_p_1905F35", Form(
"%s + p %s, RES NC, F35(1905)" , probestr, targetstr));
492 Draw(
"res_nc_p_1950F37", Form(
"%s + p %s, RES NC, F37(1950)" , probestr, targetstr));
493 Draw(
"res_nc_p_1710P11", Form(
"%s + p %s, RES NC, P11(1710)" , probestr, targetstr));
494 Draw(
"dis_cc_p", Form(
"%s + p %s, DIS CC" , probestr, targetstr));
495 Draw(
"dis_nc_p", Form(
"%s + p %s, DIS NC" , probestr, targetstr));
497 Draw(
"dis_cc_p_ubarsea", Form(
"%s + p %s, DIS CC (#bar{u}_{sea})" , probestr, targetstr));
498 Draw(
"dis_cc_p_dval", Form(
"%s + p %s, DIS CC (d_{val})" , probestr, targetstr));
499 Draw(
"dis_cc_p_dsea", Form(
"%s + p %s, DIS CC (d_{sea})" , probestr, targetstr));
500 Draw(
"dis_cc_p_ssea", Form(
"%s + p %s, DIS CC (s_{sea})" , probestr, targetstr));
503 Draw(
"dis_cc_n_sbarsea", Form(
"%s + n %s, DIS CC (#bar{s}_{sea})" , probestr, targetstr));
504 Draw(
"dis_cc_n_dbarsea", Form(
"%s + n %s, DIS CC (#bar{d}_{val})" , probestr, targetstr));
505 Draw(
"dis_cc_n_uval", Form(
"%s + n %s, DIS CC (u_{val})" , probestr, targetstr));
506 Draw(
"dis_cc_n_usea", Form(
"%s + n %s, DIS CC (u_{sea})" , probestr, targetstr));
508 Draw(
"dis_nc_p_sbarsea", Form(
"%s + p %s, DIS NC (#bar{s}_{sea})" , probestr, targetstr));
509 Draw(
"dis_nc_p_ubarsea", Form(
"%s + p %s, DIS NC (#bar{u}_{sea})" , probestr, targetstr));
510 Draw(
"dis_nc_p_dbarsea", Form(
"%s + p %s, DIS NC (#bar{d}_{sea})" , probestr, targetstr));
511 Draw(
"dis_nc_p_dval", Form(
"%s + p %s, DIS NC (d_{val})" , probestr, targetstr));
512 Draw(
"dis_nc_p_dsea", Form(
"%s + p %s, DIS NC (d_{sea})" , probestr, targetstr));
513 Draw(
"dis_nc_p_uval", Form(
"%s + p %s, DIS NC (u_{val})" , probestr, targetstr));
514 Draw(
"dis_nc_p_usea", Form(
"%s + p %s, DIS NC (u_{sea})" , probestr, targetstr));
515 Draw(
"dis_nc_p_ssea", Form(
"%s + p %s, DIS NC (s_{sea})" , probestr, targetstr));
517 Draw(
"dis_cc_p_dval_charm", Form(
"%s + p %s, DIS CC (d_{val} -> charm)" , probestr, targetstr));
518 Draw(
"dis_cc_p_dsea_charm", Form(
"%s + p %s, DIS CC (d_{sea} -> charm)" , probestr, targetstr));
519 Draw(
"dis_cc_p_ssea_charm", Form(
"%s + p %s, DIS CC (s_{sea} -> charm)" , probestr, targetstr));
522 Draw(
"dis_cc_p_dbarsea_charm", Form(
"%s + p %s, DIS CC (#bar{d}_{sea} -> #bar{charm})" , probestr, targetstr));
523 Draw(
"dis_cc_p_sbarsea_charm", Form(
"%s + p %s, DIS CC (#bar{s}_{sea} -> #bar{charm})" , probestr, targetstr));
529 TH1F*
DrawFrame(TGraph * gr0, TGraph * gr1, TPad * p,
const char * xt,
const char * yt,
double yminsc,
double ymaxsc)
537 TAxis * x0 = gr0 -> GetXaxis();
538 TAxis * y0 = gr0 -> GetYaxis();
539 xmin = x0 -> GetXmin();
540 xmax = x0 -> GetXmax();
541 ymin = y0 -> GetXmin();
542 ymax = y0 -> GetXmax();
545 TAxis * x1 = gr1 -> GetXaxis();
546 TAxis * y1 = gr1 -> GetYaxis();
547 xmin = TMath::Min(xmin, x1 -> GetXmin());
548 xmax = TMath::Max(xmax, x1 -> GetXmax());
549 ymin = TMath::Min(ymin, y1 -> GetXmin());
550 ymax = TMath::Max(ymax, y1 -> GetXmax());
556 xmin = TMath::Max(0.1, xmin);
558 return DrawFrame(xmin, xmax, ymin, ymax, p, xt, yt);
561 TH1F*
DrawFrame(
double xmin,
double xmax,
double ymin,
double ymax, TPad * p,
const char * xt,
const char * yt)
564 TH1F * hf = (TH1F*) p->DrawFrame(xmin, ymin, xmax, ymax);
565 hf->GetXaxis()->SetTitle(xt);
566 hf->GetYaxis()->SetTitle(yt);
567 hf->GetYaxis()->SetTitleSize(0.03);
568 hf->GetYaxis()->SetTitleOffset(1.5);
569 hf->GetXaxis()->SetLabelSize(0.03);
570 hf->GetYaxis()->SetLabelSize(0.03);
574 void Draw(TGraph* gr,
const char * opt)
580 void Draw(
const char * plot,
const char * title)
583 TPavesText hdr(10,10,90,90,1,
"tr");
585 hdr.SetFillColor(kWhite);
589 TGraph * gr_curr = (TGraph*)
gDirCurr->Get(plot);
590 TGraph * gr_ref0 = 0;
592 gr_ref0 = (TGraph*)
gDirRef0->Get(plot);
595 if(gr_curr == 0 && gr_ref0 ==0)
return;
602 TGraph * gr_ref0_trim =
TrimGraph(gr_ref0, 20);
607 DrawFrame (gr_curr, gr_ref0,
gPadXSecs,
"E_{#nu} (GeV)",
"#sigma (10^{-38} cm^{2})", 0.5, 1.5);
609 Draw (gr_ref0_trim,
"P");
622 TGraph * gr_ratio =
DrawRatio(gr_curr, gr_ref0);
624 Draw (gr_ratio,
"L");
640 const int np = gr->GetN();
641 vector<bool> remv(np);
647 double xmin = gr->GetX()[fp];
648 double xmax = 10 * xmin;
650 for(
int i=fp; i<np; i++) {
653 double x = gr->GetX()[i];
654 if(x > xmin && x <= xmax) ndec++;
657 if(ndec > max_np_per_decade) {
658 double keep_prob = (double)max_np_per_decade/ (
double) ndec;
659 int keep_rate = TMath::FloorNint(1./keep_prob);
661 for(
int i=fp; i<=lp; i++) {
662 if(ithrow % keep_rate) {
668 if(lp == np-1)
break;
673 for(
int i=0; i<np; i++) {
679 double * x =
new double[np2];
680 double * y =
new double[np2];
683 for(
int i=0; i<np; i++) {
685 x[j] = gr->GetX()[i];
686 y[j] = gr->GetY()[i];
690 TGraph * gr2 =
new TGraph(np2,x,y);
705 LOG(
"gxscomp",
pDEBUG) <<
"Drawing ratio...";
707 const int np = gr0->GetN();
709 double * x =
new double[np];
710 double * y =
new double[np];
712 for(
int i=0; i<np; i++) {
713 x[i] = gr0->GetX()[i];
716 if(gr0->Eval(x[i]) != 0. && gr1->Eval(x[i]) != 0.)
718 y[i] = gr0->Eval(x[i]) / gr1->Eval(x[i]);
721 if(gr0->Eval(x[i]) != 0.)
732 TGraph * ratio =
new TGraph(np,x,y);
742 LOG(
"gxscomp",
pINFO) <<
"*** Parsing command line arguments";
747 if( parser.OptionExists(
'f') ) {
748 string inp = parser.ArgAsString(
'f');
749 if(inp.find(
",") != string::npos) {
751 assert(inpv.size()==2);
769 if( parser.OptionExists(
'r') ) {
770 string inp = parser.ArgAsString(
'r');
771 if(inp.find(
",") != string::npos) {
773 assert(inpv.size()==2);
787 LOG(
"gxscomp",
pNOTICE) <<
"No reference cross section file";
792 if( parser.OptionExists(
'o') ) {
803 <<
"\n\n" <<
"Syntax:" <<
"\n"
804 <<
" gxscomp -f xsec_file [-r reference_xsec_file] [-o output]\n";
809 if(filename.size() == 0)
return false;
811 bool is_accessible = ! (gSystem->AccessPathName(filename.c_str()));
812 if (!is_accessible) {
814 <<
"The input ROOT file [" << filename <<
"] is not accessible";
825 unsigned int L = inpname.length();
829 if(inpname.substr(L-4, L).find(
"root") != string::npos) {
830 inpname.erase(L-4, L);
834 name << inpname <<
"nuxsec_test.ps";
836 return gSystem->BaseName(name.str().c_str());
string gOptOutputFilename
void MakePlotsCurrDir(void)
void DirNameToTarget(void)
bool IsNeutrino(int pdgc)
TGraph * TrimGraph(TGraph *gr, int max_np_per_decade)
void DirNameToProbe(void)
void SetDefaultStyle(bool black_n_white=false)
int main(int argc, char **argv)
TH1F * DrawFrame(TGraph *gr0, TGraph *gr1, TPad *p, const char *xt, const char *yt, double yminsc, double ymaxsc)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
bool IsAntiNeutrino(int pdgc)
string gOptXSecFilename_ref0
bool CheckRootFilename(string filename)
void Draw(const char *plot, const char *title)
vector< string > Split(string input, string delim)
bool gCurrTargetIsFreeNuc
string OutputFileName(string input_file_name)
TGraph * DrawRatio(TGraph *gr0, TGraph *gr1)
void Format(TGraph *gr, int lcol, int lsty, int lwid, int mcol, int msty, double msiz)
Command line argument parser.
void GetCommandLineArgs(int argc, char **argv)
string gOptXSecFilename_curr
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...