Xsec_final.C
Go to the documentation of this file.
1 {
2 
3  //Gargamelle Experiment
4  double x[6] = {1.46513,2.4752,3.44589,4.44633,5.42126,7.93998};
5  double y[6] = {13.53,17.8427,24.5361,33.1036,37.9249,36.5359};
6  double exl[6] = {0.917728,0.98571,0.91773,0.95133,1.46119,2.10699};
7  double exh[6] = {1.08768,0.98571,0.98571,0.91773,1.52993,3.94362};
8  double eyl[6] = {2.2105,3.9125,4.5932,5.9587,8.5096,6.9779};
9  double eyh[6] = {3.576,3.4038,4.5971,5.4423,8.3394,6.4654};
10 
11  TGraphAsymmErrors* gargamelle = new TGraphAsymmErrors(6,x,y,exl,exh,eyl,eyh);
12  gargamelle->SetTitle("Gargamelle #nu_{e} CC data");
13  gargamelle->SetMarkerStyle(21);
14  gargamelle->SetMarkerColor(kViolet-1);
15  gargamelle->SetLineColor(kViolet-1);
16  gargamelle->SetLineWidth(2);
17  //gargamelle->Draw("AP");
18  //gargamelle->GetXaxis()->SetTitle("E_{#nu} (GeV)");
19  //gargamelle->GetYaxis()->SetTitle("#nu_{e} CC #it{#sigma} (#times10^{-39} cm^{2}/nucleon)");
20  //gargamelle->Draw("AP");
21 
22  //T2K results
23  double x_t2k[1]={1.343};
24  double y_t2k[1]={11.1};
25  double exl_t2k[1]={0.918};
26  double exh_t2k[1]={1.782};
27  double eyl_t2k[1]={2.1};
28  double eyh_t2k[1]={2.1};
29 
30  TGraphAsymmErrors *t2k=new TGraphAsymmErrors(1,x_t2k,y_t2k,exl_t2k,exh_t2k,eyl_t2k,eyh_t2k);
31  t2k->SetMarkerStyle(24);
32  t2k->SetLineColor(4);
33  t2k->SetMarkerColor(4);
34  t2k->SetLineWidth(2);
35 
36  //NOvA results
37  double x_nova[4]={1.25,1.75,2.25,2.75};
38  double y_nova[4]={22.0921,28.8235,28.16,37.6431};
39  double ex_nova[4]={0.25,0.25,0.25,0.25};
40  double ey_nova[4]={6.58498,5.99768,5.53289,6.66383};
41 
42  TGraphErrors *nova=new TGraphErrors(4,x_nova,y_nova,ex_nova,ey_nova);
43  //nova->SetMarkerStyle(8);
44  //nova->SetMarkerSize(1.2);
45  nova->SetLineColor(2);
46  //nova->SetMarkerColor(2);
47  nova->SetLineWidth(3);
48 
49  double ey_nova_stat[4]={4.88965,3.12006,2.64657,2.54683};
50  TGraphErrors *nova_stat=new TGraphErrors(4,x_nova,y_nova,ex_nova,ey_nova_stat);
51  nova_stat->SetMarkerStyle(8);
52  nova_stat->SetMarkerSize(1.2);
53  nova_stat->SetLineWidth(3);
54 
55  //GENIE prediction
56  TFile *fgenie=new TFile("xsec_genie.root");
57  TGraph *gr_genie=(TGraph*)fgenie->Get("nu_e_C12/tot_cc");
58  TSpline3* spline_nue=new TSpline3("mysplinenue",gr_genie);
59  TH1F *Xnue=new TH1F("Xnue","",100,0,10);
60  double x_genie[100]={0.};
61  double y_genie[100]={0.};
62 
63  for( int ibin=1; ibin<Xnue->GetNbinsX()+1; ++ibin ){
64  double binctr=Xnue->GetBinCenter(ibin);
65  double xnue=(spline_nue->Eval(binctr)/12.)*10.0;
66  Xnue->SetBinContent(ibin,xnue);
67 
68  x_genie[ibin-1]=binctr;
69  y_genie[ibin-1]=xnue;
70 
71  }
72 
73  //get genie error band
74  TFile *fband=new TFile("genie_band.root");
75  TH1F *hplus=(TH1F*)fband->Get("ccnue_1p_total");
76  TH1F *hminus=(TH1F*)fband->Get("ccnue_1m_total");
77  double x_band[49]={0.};
78  double y_band[49]={0.};
79  double exl_band[49]={0.};
80  double exh_band[49]={0.};
81  double eyl_band[49]={0.};
82  double eyh_band[49]={0.};
83  TH1F *Xnue2=new TH1F("Xnue2","",50,0,10);
84  for( int ibin=1; ibin<Xnue2->GetNbinsX()+1; ++ibin ){
85  double binctr=Xnue2->GetBinCenter(ibin);
86  //if( binctr>8. ) continue;
87  double xnue2=(spline_nue->Eval(binctr)/12.)*10.0;
88  Xnue2->SetBinContent(ibin,xnue2);
89 
90  if( ibin>1 ){
91  x_band[ibin-2]=binctr;
92  exl_band[ibin-2]=0.1;
93  exh_band[ibin-2]=0.1;
94  y_band[ibin-2]=xnue2;
95  eyl_band[ibin-2]=xnue2*(hminus->GetBinContent(ibin));
96  eyh_band[ibin-2]=xnue2*(hplus->GetBinContent(ibin));
97  }
98  }//loop bins
99 
100  TGraphAsymmErrors *band=new TGraphAsymmErrors(49,x_band,y_band,exl_band,exh_band,eyl_band,eyh_band);
101  band->SetFillColor(3);
102  band->SetLineColor(3);
103 
104 
105 /*
106  TBox *errband[50];
107  for( int ibin=1; ibin<Xnue2->GetNbinsX()+1; ++ibin ){
108  float xlow=(ibin-1)*0.2;
109  float xhigh=ibin*0.2;
110  float ylow=Xnue2->GetBinContent(ibin)*(1.0-hminus->GetBinContent(ibin));
111  float yhigh=Xnue2->GetBinContent(ibin)*(1.0+hplus->GetBinContent(ibin));
112  errband[ibin-1]=new TBox(xlow,ylow,xhigh,yhigh);
113  }
114 */
115 
116  TGraph *genie=new TGraph(100,x_genie,y_genie);
117  genie->SetLineStyle(2);
118  genie->SetLineWidth(3);
119  genie->SetLineColor(1);
120  genie->SetFillColor(3);
121 
122  gStyle->SetOptStat(0);
123  //TH2F template
124  TCanvas *c1=new TCanvas("Xsec_Enue_withNOvA","",700,600);
125  TH2F *h2f=new TH2F("h2f","",10,0,10,10,0,59);
126  //h2f->SetXTitle("E_{#nu} (GeV)");
127  h2f->SetXTitle("Electron Neutrino Energy (GeV)");
128  h2f->SetYTitle("#nu_{e} CC #it{#sigma} (#times10^{-39} cm^{2}/nucleon)");
129  h2f->GetXaxis()->CenterTitle();
130  h2f->GetYaxis()->CenterTitle();
131  h2f->Draw();
132 
133  TLatex* prelim = new TLatex(.9, .95, "NO#nuA Preliminary");
134  prelim->SetTextColor(kBlue+1);
135  prelim->SetNDC();
136  prelim->SetTextSize(2/30.);
137  prelim->SetTextAlign(32);
138  //prelim->Draw();
139 
140 /*
141  for( int i=1; i<40; ++i ){
142  errband[i]->SetFillColor(3);
143  errband[i]->SetLineColor(3);
144  errband[i]->Draw("c same");
145  }
146 */
147 
148  band->Draw("E3 same");
149 
150  gargamelle->Draw("P same");
151  t2k->Draw("P same");
152  nova->Draw("P z same");
153 
154  gStyle->SetEndErrorSize(4);
155 
156  nova_stat->Draw("P same");
157 
158  genie->Draw("c same");
159  //Xnue->Draw("HISt same");
160  //Xnue2->SetLineColor(2);
161  //Xnue2->Draw("HIST same");
162 
163  TLegend *leg=new TLegend(0.6,0.6,0.89,0.89);
164  leg->SetLineColor(0);
165  leg->SetFillColor(0);
166  leg->AddEntry(genie,"GENIE 2.8.0 #pm 1#sigma on C12","fl");
167  leg->AddEntry(gargamelle,"Gargamelle #nu_{e} data","pl");
168  leg->AddEntry(t2k,"T2K #nu_{e} data","pl");
169  leg->AddEntry(nova_stat,"NOvA #nu_{e} data","pl");
170  leg->AddEntry(nova_stat,"stat. uncert.","E");
171  leg->AddEntry(nova,"stat. + syst. uncert.","E");
172  leg->Draw("same");
173 
174 /*
175  TLatex* prelim = new TLatex(.9, .95, "NO#nuA Preliminary");
176  prelim->SetTextColor(kBlue+1);
177  prelim->SetNDC();
178  prelim->SetTextSize(2/30.);
179  prelim->SetTextAlign(32);
180  prelim->Draw();
181 */
182 
183 }
double y_band[49]
Definition: Xsec_final.C:78
double exl_t2k[1]
Definition: Xsec_final.C:25
double x_band[49]
Definition: Xsec_final.C:77
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
double eyl_band[49]
Definition: Xsec_final.C:81
TH2F * h2f
Definition: Xsec_final.C:125
TH1F * Xnue
Definition: Xsec_final.C:59
TGraphAsymmErrors * band
Definition: Xsec_final.C:100
TGraphErrors * nova_stat
Definition: Xsec_final.C:50
TGraphAsymmErrors * gargamelle
Definition: Xsec_final.C:11
double y_nova[4]
Definition: Xsec_final.C:38
TH1F * hplus
Definition: Xsec_final.C:75
double y[6]
Definition: Xsec_final.C:5
double eyl[6]
Definition: Xsec_final.C:8
TGraphAsymmErrors * t2k
Definition: Xsec_final.C:30
double x_nova[4]
Definition: Xsec_final.C:37
double exh_band[49]
Definition: Xsec_final.C:80
double ey_nova[4]
Definition: Xsec_final.C:40
double y_t2k[1]
Definition: Xsec_final.C:24
double x_t2k[1]
Definition: Xsec_final.C:23
TSpline3 * spline_nue
Definition: Xsec_final.C:58
double eyh[6]
Definition: Xsec_final.C:9
TH1F * Xnue2
Definition: Xsec_final.C:83
double y_genie[100]
Definition: Xsec_final.C:61
double exh[6]
Definition: Xsec_final.C:7
TLegend * leg
Definition: Xsec_final.C:163
double x_genie[100]
Definition: Xsec_final.C:60
double eyh_t2k[1]
Definition: Xsec_final.C:28
Hold drift constants from current run.
Definition: DriftCache.h:17
TLatex * prelim
Definition: Xsec_final.C:133
double eyl_t2k[1]
Definition: Xsec_final.C:27
double eyh_band[49]
Definition: Xsec_final.C:82
double exl[6]
Definition: Xsec_final.C:6
double ex_nova[4]
Definition: Xsec_final.C:39
TGraph * gr_genie
Definition: Xsec_final.C:57
TFile * fgenie
Definition: Xsec_final.C:56
double exh_t2k[1]
Definition: Xsec_final.C:26
TH1F * hminus
Definition: Xsec_final.C:76
enum BeamMode kViolet
Definition: FillPIDs.h:16
TFile * fband
Definition: Xsec_final.C:74
double ey_nova_stat[4]
Definition: Xsec_final.C:49
enum BeamMode kBlue
double exl_band[49]
Definition: Xsec_final.C:79
TCanvas * c1
Definition: Xsec_final.C:124