fnexvscaf.C
Go to the documentation of this file.
1 //Author: Prabhjot Singh (prabhjot@fnal.gov).
2 //Dated: June 12, 2016 17:47 pm
3 //This program is a template macro to plot and compare FNEX vs. CAFAna plots of
4 //a. ND Data MC energy spectrum
5 //b. FD data spectrum
6 //c. FD oscillated prediction
7 //d. FD unoscillated prediction
8 //
9 //Many more to include.........
10 
11 #include "TLine.h"
12 
13 Cosmetics(TH1* h);
14 
15 bool nd = false; //true for near detector plots.
16 bool fd = true; //true for far detector plots.
17 
18 bool mc = true; //true for MC plots
19 bool data = false; //true for Data plots
20 bool datamc = false; //true for Data-MC comparisons
21 
22 bool fnex = false; //true for FNEX based plots only
23 bool caf = false; //true for CAFAna based plots only
24 
25 bool unoscillatedMC_prediction = false; //true for unoscillated MC prediction in FD
26 bool oscillatedMC_prediction = true; //true for oscillated MC prediction in FD
27 
28 bool plotpoint = false; //true if the FNEX results are from a plotpointjob
29 bool fitpoint = true; //true if the FNEX results are from a fitpointjob
30 
31 bool systematics = true; //true if you want an MC prediction that includes systematics
32 
34  gStyle->SetOptStat(" ");
35 
36  TString mcdata; // either MC or Data labelling
37  TString det; //Detector: ND or FD
38 
39  char* c1; //base file to compare things with: caf files
40  char* c2; //second file to compare with base file.
41 
42  char* hist1; //base histogram to compare things with.
43  char* hist2; //second histogram to be compared with based histogram
44 
45  const TString rootfile = "fnex_all_plot.root"; //output root file that has all fnex plots.
46 
47  if(nd){
48  c1 = "/nova/ana/users/prabhjot/FNEX/Kirk/NDspectra.root"; //base file, cafana file for the ND data-mc spectra
49  if(!systematics) c2 = "/nova/ana/users/prabhjot/FNEX/EventList_CAFAna_compar/SA_bestfit/OscillatedFD/fnex_plotpoint_hist.root"; // second file, fnex file for the ND data-mc spectra
50  if(systematics) c2 = "/nova/app/users/mcampbel/nova_test/single_syst_shift/floatingoscpars/noconstraints/allfloating_data_HIST.root";
51  det = "ND";
52 
53  if(mc){
54  hist1 = "nuEMC";
55  if(plotpoint) hist2 = "plot/MultiExperiment/NOvA_Experiment_NuMuSel/UncorrectedStacks/NDMCUncorrected";
56  if(fitpoint) hist2 = "fit/Fit/MultiExperiment/NOvA_NuMuSel/UncorrectedStacks/NDMCUncorrected";
57  mcdata = "MC";
58  CompareSpectra(c1, c2, hist1, hist2, mcdata, det, rootfile);
59  }//mc condition
60  if(data){
61  hist1 = "nuEData";
62  if(plotpoint) hist2 = "plot/MultiExperiment/NOvA_Experiment_NuMuSel/UncorrectedStacks/NDDataUncorrected";
63  if(fitpoint) hist2 = "fit/Fit/MultiExperiment/NOvA_NuMuSel/UncorrectedStacks/NDDataUncorrected";
64  mcdata = "Data";
65  CompareSpectra(c1, c2, hist1, hist2, mcdata, det, rootfile);
66  }//data condition
67  if(datamc && fnex && caf){
68  mcdata = "Data_by_MC";
69  CompareSpectraDataMC(c1, c2, mcdata, det, rootfile); //c1 is base file, caf file and c2 is fnex file.
70  }//end of (mcdata && fnex)
71  }//end of nd
72 
73  if(fd){
74  det = "FD";
76  c1 = "/nova/ana/users/prabhjot/FNEX/Kirk/sa_unosc_spec.root";
77  c2 = "/nova/ana/users/prabhjot/FNEX/Brian/fnex_plotpoint_no_osc_hist.root";
78  hist1 = "UnoscSpectrum"; //base histogram from caf
79  hist2 = "plot/MultiExperiment/NOvA_Experiment_NuMuSel/CorrectedStacks/FDMCCorrected"; //to select the corrected total FD MC spectrum
80  mcdata = "UnoscillatedMC_prediction";
81  CompareSpectra(c1, c2, hist1, hist2, mcdata, det, rootfile);
82  }
83  if(datamc && fnex && caf){
84  c1 = "/nova/ana/users/prabhjot/FNEX/Kirk/sa_unosc_spec.root";
85  c2 = "/nova/ana/users/prabhjot/FNEX/EventList_CAFAna_compar/SA_bestfit/UnoscillatedFD/fnex_plotpoint_hist.root";
86  mcdata = "Data_by_MC";
87  CompareSpectraDataMC(c1, c2, mcdata, det);
88  }
90  c1 = "/nova/ana/users/prabhjot/FNEX/Kirk/predictions.root";
91  if(!systematics){
92  c2 = "/nova/ana/users/prabhjot/FNEX/Brian/fnex_plotpoint_hist.root";
93  hist1 = "statsonlypred"; //base histogram from caf
94  } else {
95  c2 = "/nova/app/users/mcampbel/nova_test/single_syst_shift/floatingoscpars/noconstraints/allfloating_data_HIST.root";
96  hist1 = "systspred";
97  }
98  if(plotpoint) hist2 = "plot/MultiExperiment/NOvA_Experiment_NuMuSel/CorrectedStacks/FDMCCorrected"; //to select the corrected total FD MC spectrum
99  if(fitpoint) hist2 = "fit/Fit/MultiExperiment/NOvA_NuMuSel/CorrectedStacks/FDMCCorrected";
100  ComparePredictions(c1, c2, hist1, hist2, rootfile);
101  }//end of predictions
102  if(data){
103  c1 = "/nova/ana/users/prabhjot/FNEX/Kirk/FD_Data.root";
104  //c2 = "/nova/ana/users/prabhjot/FNEX/EventList_CAFAna_compar/SA_bestfit/OscillatedFD/fnex_plotpoint_hist.root";
105  c2 = "/nova/app/users/mcampbel/nova_test/single_syst_shift/floatingoscpars/noconstraints/allfloating_data_HIST.root";
106  hist1 = "hData";
107  if(plotpoint) hist2 = "plot/MultiExperiment/NOvA_Experiment_NuMuSel/CorrectedStacks/FDDataCorrected";
108  if(fitpoint) hist2 = "fit/Fit/MultiExperiment/NOvA_NuMuSel/CorrectedStacks/FDDataCorrected";
109  mcdata = "Data";
110  CompareSpectra(c1, c2, hist1, hist2, mcdata, det, rootfile);
111  }//end of data condition
112  }//end of fd condition
113 }//end of fnexvscaf()
114 ////////////////////////////////////////////////////////////////////////////////////////////////////////
115 ////////////////////////////////////////////////////////////////////////////////////////////////////////
116 ComparePredictions(char* c1, char* c2, char* hist1, char* hist2, const TString rootfile){
117  std::cout << "CAF: " << c1 << " : " << hist1 << endl;
118  std::cout << "FNEX: " << c2 << " : " << hist2 << endl;
119 
120  TFile* f1 = new TFile(c1, "read");
121  TFile* f2 = new TFile(c2, "read");
122 
123  f1->cd();
124  TH1* h1 = (TH1*)f1->Get(hist1);
125  h1->Sumw2();
126 
127  f2->cd();
128  TH1* h2 = (TH1*)f2->Get(hist2);
129  h2->Sumw2();
130  h2->SetLineWidth(2);
131  //h2->Scale(h1->Integral()/h2->Integral()); //for scaling of the fnex spectrum to have same area under the curve as the caf spectrum.
132 
133  new TCanvas;
134  gPad->SetGrid();
135 
136  h1->Draw("HIST same");
137  h2->Draw("HIST same");
138 
139  h1->GetYaxis()->SetRangeUser(0, 20);
140  h1->GetXaxis()->SetTitle("E^{reco}_{#nu} (GeV)");
141  h1->GetXaxis()->CenterTitle();
142 
143  TLegend *legend = new TLegend(0.50, 0.65, 0.90, 0.86);
144  legend->SetBorderSize(0);
145  legend->SetFillStyle(0);
146  if(!systematics) legend->AddEntry((TObject*)0, "Stat only FD prediction"," ");
147  if(systematics) legend->AddEntry((TObject*)0, "FD prediction with systematics"," ");
148  legend->AddEntry(h1, "CAFAna", "l");
149  legend->AddEntry(h2, "FNEX", "l");
150  legend->Draw();
151 
152  gPad->Print("Images/predictions_fd.pdf");
153 
154  new TCanvas;
155  gPad->SetGrid();
156 
158  //TH1* h2clone = new TH1D("hratio", "",h1->GetXaxis()->GetNbins(), h1->GetBinCenter(0), h1->GetBinCenter(h1->GetXaxis()->GetNbins()));
159  TH1* h2clone = new TH1D("hratio", "",h1->GetXaxis()->GetNbins(), 0, 5);
160  else TH1* h2clone = (TH1*)h2->Clone("h2Clone");
161  h2clone->Sumw2();
162 
164  Ratiohist(h1, h2, h2clone, kBlack, 20, "E^{reco}_{#nu} (GeV)", "FNEX / CAF", 0.5, 1.5);
165 
166  else{
167  h2clone->Divide(h1);
168  h2clone->Draw("PE");
169  h2clone->GetYaxis()->SetRangeUser(0, 3);
170  h2clone->SetMarkerStyle(20);
171  h2clone->SetLineColor(kBlack);
172  h2clone->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
173  h2clone->GetYaxis()->SetTitle("FNEX / CAF");
174 }
175  TLine* one = new TLine(0, 1, 5, 1);
176  one->SetLineWidth(2);
177  one->SetLineStyle(7);
178  one->Draw();
179 
180  if(nd) TLegend *legend2 = new TLegend(.35,.18,.87,.46);
181  TLegend *legend2 = new TLegend(.23,.61,.76,.89);
182  legend2->SetBorderSize(0);
183  legend2->SetFillStyle(0);
184  if(!systematics) legend2->AddEntry((TObject*)0, "Stat only FD prediction ratio","");
185  if(systematics) legend2->AddEntry((TObject*)0, "FD prediction (with systematics) ratio","");
186  legend2->AddEntry(h2clone, "FNEX by CAFAna", "lep");
187  legend2->Draw();
188 
189  gPad->Print("Images/ratio_predictions_fd_fnexbycaf.pdf");
190 
191  TFile* f = new TFile(rootfile, "UPDATE");
192  f->cd();
193 
194  h1->SetName("prediction_statonly_caf");
195  h2->SetName("prediction_statonly_fnex");
196  h2clone->SetName("prediction_statonly_fnexbycaf");
197 
198  h1->Write();
199  h2->Write();
200  h2clone->Write();
201 
202  f->Close();
203 }//end of ComparePredictions
204 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
205 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
206 CompareSpectra(char* c1, char* c2, char* hist1, char* hist2, TString mcdata, TString det, const TString rootfile){
207  std::cout << "CAF: " << c1 << " : " << hist1 << endl;
208  std::cout << "FNEX: " << c2 << " : " << hist2 << endl;
209 
210 
211  TFile* f1 = new TFile(c1, "read");
212  TFile* f2 = new TFile(c2, "read");
213 
214  f1->cd();
216  TCanvas* c = (TCanvas*)f1->Get(hist1);
217  TH1* h1 = (TH1*)c->GetPrimitive("cafanauniq12704__10");
218 
219  }//end of fd condition
220  else if(nd) TH1* h1 = (TH1*)f1->Get(hist1);
221 // else TH1* h1 = (TH1*)f1->Get(hist1);
222 
223  h1->SetLineColor(kRed);
224  h1->SetLineWidth(2);
225  h1->SetMarkerColor(kRed);
226  h1->SetMarkerStyle(20);
227 
228  f2->cd();
229  TH1* h2 = (TH1*)f2->Get(hist2);
230 
231  h2->SetLineColor(kBlue);
232  h2->SetMarkerColor(kBlue);
233  h2->SetLineWidth(2);
234 
235  //h2->Scale(h1->Integral()/h2->Integral()); //no scaling
236 
237  new TCanvas;
238 
239  if(nd){
240  h1->Draw("HIST same");
241  h2->Draw("HIST same");
242  }
243  if(fd && data){
244  h1->Draw("PE same");
245  h2->Draw("HIST same");
246  Cosmetics(h1);
247  }
248 
249  h1->Draw("HIST same");
250  h2->Draw("HIST same");
251 
252  if(nd) TLegend *legend = new TLegend(.47,.58,.99,.86);
253  if(fd && data) TLegend *legend = new TLegend(.66,.64,.97,.89);
254  TLegend *legend = new TLegend(.66,.64,.97,.89);
255  legend->SetBorderSize(0);
256  legend->SetFillStyle(0);
257  legend->AddEntry((TObject*)0, det+" "+mcdata," ");
258  legend->AddEntry(h1, "CAFAna");
259  legend->AddEntry(h2, "FNEX");
260  if(fd)legend->SetTextSize(.05);
261  legend->Draw();
262 
263 // gPad->Print("Images/uncorrected_energyspectrum_"+det+mcdata+".pdf");
264 
265  new TCanvas;
266  gPad->SetGrid();
268  //TH1* h2clone = new TH1D("hratio", "",h1->GetXaxis()->GetNbins(), h1->GetBinCenter(0), h1->GetBinCenter(h1->GetXaxis()->GetNbins()));
269  TH1* h2clone = new TH1D("hratio", "",h1->GetXaxis()->GetNbins(), 0, 5);
270  else TH1* h2clone = (TH1*)h2->Clone("h2Clone");
271  h2clone->Sumw2();
272 // TH1D* hratio = new TH1D("hratio", "",h1->GetXaxis()->GetNbins(), h1->GetBinCenter(0), h1->GetBinCenter(h1->GetXaxis()->GetNbins()));
273 
275  Ratiohist(h1, h2, h2clone, kBlack, 20, "E^{reco}_{#nu} (GeV)", "FNEX / CAF", 0.5, 1.5);
276 
277  else{
278  h2clone->Divide(h1);
279  h2clone->Draw("P");
280  if(fd) h2clone->GetYaxis()->SetRangeUser(0, 3);
281  h2clone->SetMarkerStyle(20);
282  h2clone->SetLineColor(kBlack);
283  h2clone->GetXaxis()->SetTitle(h1->GetXaxis()->GetTitle());
284  h2clone->GetYaxis()->SetTitle("FNEX / CAFAna");
285  }
286 
287  TLine* one = new TLine(0, 1, 5, 1);
288  one->SetLineWidth(2);
289  one->SetLineStyle(7);
290  one->Draw();
291 
292  if(nd)TLegend *legend2 = new TLegend(.35,.18,.87,.46);
293  if(fd)TLegend *legend2 = new TLegend(.23,.61,.76,.89);
294  legend2->SetBorderSize(0);
295  legend2->SetFillStyle(0);
296  legend2->AddEntry((TObject*)0, det+" "+mcdata," ");
297  if(nd)legend2->AddEntry(h2clone, "FNEX by CAFAna", "lep");
298  // if(fd)legend2->AddEntry(h2clone, "FNEX by CAFAna", "p");
299  legend2->Draw();
300 
301 // gPad->Print("Images/ratio_uncorrected_energyspectrum_"+det+"_"+mcdata+".pdf");
302 // gPad->Print("Images/ratio_uncorrected_energyspectrum_"+det+"_"+mcdata+".png");
303 
304 
305  TFile* f = new TFile(rootfile, "UPDATE");
306  f->cd();
307 
308  h1->SetName(det+"_"+mcdata+"_caf");
309  h2->SetName(det+"_"+mcdata+"_fnex");
310  h2clone->SetName(det+"_"+mcdata+"_fnexbycaf");
311 
312  h1->Write();
313  h2->Write();
314  h2clone->Write();
315 
316  f->Close();
317 
318 }//end of CompareSpectra()
319 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
320 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
321 CompareSpectraDataMC(char* c1, char* c2, TString mcdata, TString det, const TString rootfile){
322  std::cout << "CAF: " << c1 << endl;
323  std::cout << "FNEX: " << c2 << endl;
324 
325  if(nd) TFile* f1 = new TFile(c1, "read"); //c1 is caf //there is no caf based data file
326  TFile* f2 = new TFile(c2, "read"); //c2 is fnex
327 
328  if(nd){
329  f1->cd();
330  TH1* hmc1 = (TH1*)f1->Get("nuEMC");
331  TH1* hdata1 = (TH1*)f1->Get("nuEData");
332 
333  hmc1->SetLineColor(kRed);
334 
335  hdata1->SetLineColor(kBlack);
336  hdata1->SetMarkerStyle(20);
337  hdata1->SetMarkerColor(kBlack);
338 
339  TH1* hclone_caf_data = (TH1*)hdata1->Clone("hclone_caf_data");
340  hclone_caf_data->Sumw2();
341  hclone_caf_data->Divide(hmc1);
342  hclone_caf_data->SetMarkerStyle(20);
343  hclone_caf_data->SetLineColor(kBlack);
344  hclone_caf_data->SetTitle(hdata1->GetXaxis()->GetTitle());
345  hclone_caf_data->GetYaxis()->SetTitle("Data / MC");
346 
347  new TCanvas;
348  gPad->SetGrid();
349 
350  hmc1->Draw("HIST same");
351  hdata1->Draw("PE same");
352 
353  TLegend *legend1 = new TLegend(.47,.58,.99,.86);
354  legend1->SetBorderSize(0);
355  legend1->SetFillStyle(0);
356  legend1->AddEntry((TObject*)0, det+": ""CAFAna based"," ");
357  legend1->AddEntry(hmc1, "MC");
358  legend1->AddEntry(hdata1, "Data", "lep");
359  legend1->Draw();
360 
361  gPad->Print("Images/uncorrected_caf_energyspectrum_"+det+"_"+mcdata+".pdf");
362  gPad->Print("Images/uncorrected_caf_energyspectrum_"+det+"_"+mcdata+".png");
363  }//end of nd() condition
364 
365  f2->cd();
366  if(nd){
367  TH1* hmc2 = (TH1*)f2->Get("plot/MultiExperiment/NOvA_Experiment_NuMuSel/UncorrectedStacks/NDMCUncorrected");
368  TH1* hdata2 = (TH1*)f2->Get("plot/MultiExperiment/NOvA_Experiment_NuMuSel/UncorrectedStacks/NDDataUncorrected");
369  }//end of nd() condition
370 
371  if(fd){
372  TH1* hmc2 = (TH1*)f2->Get("plot/MultiExperiment/NOvA_Experiment_NuMuSel/CorrectedStacks/FDMCCorrected");
373  TH1* hdata2 = (TH1*)f2->Get("plot/MultiExperiment/NOvA_Experiment_NuMuSel/CorrectedStacks/FDDataCorrected");
374  }//end of fd() condition
375 
376  hmc2->SetLineColor(kRed);
377 
378  hdata2->SetLineColor(kBlack);
379  hdata2->SetMarkerColor(kBlack);
380  hdata2->SetMarkerStyle(20);
381 
382  TH1* hclone_fnex_data = (TH1*)hdata2->Clone("hclone_fnex_data");
383  hclone_fnex_data->Sumw2();
384  hclone_fnex_data->Divide(hmc2);
385  hclone_fnex_data->SetMarkerStyle(20);
386  hclone_fnex_data->SetLineColor(kRed);
387  hclone_fnex_data->SetMarkerColor(kRed);
388 
389  new TCanvas;
390  gPad->SetGrid();
391 
392  hmc2->Draw("HIST same");
393  hdata2->Draw("PE same");
394 
395  if(fd) hmc2->GetYaxis()->SetRangeUser(0, 25);
396 
397  hmc2->SetLineWidth(2);
398  hdata2->SetLineWidth(2);
399 
400  if(nd)TLegend *legend2 = new TLegend(.47,.58,.99,.86);
401  if(fd) TLegend *legend2 = new TLegend(.10,.61,.62,.89);
402  legend2->SetBorderSize(0);
403  legend2->SetFillStyle(0);
404  legend2->AddEntry((TObject*)0, "FNEX based"," ");
405  legend2->AddEntry(hmc2, "MC");
406  legend2->AddEntry(hdata2, "Data", "lep");
407  legend2->Draw();
408 
409  if(fd){
410  TPaveStats *ptstatsmc = new TPaveStats(0.62,0.50,0.89,0.88,"brNDC");
411  ptstatsmc->SetName("FD MC");
412  ptstatsmc->SetBorderSize(2);
413  ptstatsmc->SetTextAlign(12);
414  ptstatsmc->SetTextFont(42);
415  TText *text = ptstatsmc->AddText("FD: Integral");
416  text->SetTextSize(0.02);
417  text = ptstatsmc->AddText(Form("MC : %f",hmc2->Integral()));
418  text = ptstatsmc->AddText(Form("Data : %f",hdata2->Integral()));
419  ptstatsmc->GetLineWith("MC")->SetTextColor(kRed);
420  ptstatsmc->GetLineWith("Data")->SetTextColor(kBlack);
421  ptstatsmc->SetOptStat(1111);
422  ptstatsmc->SetOptFit(1);
423  ptstatsmc->Draw();
424  }
425  gPad->Print("Images/uncorrected_fnex_energyspectrum_"+det+"_"+mcdata+".png");
426  gPad->Print("Images/uncorrected_fnex_energyspectrum_"+det+"_"+mcdata+".pdf");
427 
428  new TCanvas;
429  gPad->SetGrid();
430  if(nd) hclone_caf_data->Draw("PE same");
431  hclone_fnex_data->Draw("PE same");
432  TLegend *legendratio = new TLegend(.39,.09,.91,.37);
433  legendratio->SetBorderSize(0);
434  legendratio->SetFillStyle(0);
435  legendratio->AddEntry((TObject*)0, "Ratio data by MC"," ");
436  if(nd)legendratio->AddEntry(hclone_caf_data, "CAFAna based");
437  legendratio->AddEntry(hclone_fnex_data, "FNEX based");
438  legendratio->Draw();
439  gPad->Print("Images/uncorrected_fnexcaf_energyspectrum_ratio_"+det+"_"+mcdata+".png");
440  gPad->Print("Images/uncorrected_fnexcaf_energyspectrum_ratio_"+det+"_"+mcdata+".pdf");
441 
442  TFile* f = new TFile(rootfile, "UPDATE");
443  f->cd();
444 
445  hmc1->SetName(det+"_DataMC_MC_caf");
446  hdata1->SetName(det+"_DataMC_Data_caf");
447  hmc2->SetName(det+"_DataMC_MC_fnex");
448  hdata2->SetName(det+"_DataMC_Data_fnex");
449 
450  hclone_caf_data->SetName(det+"_"+mcdata+"_caf");
451  hclone_fnex_data->SetName(det+"_"+mcdata+"_fnex");
452 
453  hmc1->Write();
454  hdata1->Write();
455  hmc2->Write();
456  hdata2->Write();
457  hclone_caf_data->Write();
458  hclone_fnex_data->Write();
459 
460  f->Close();
461 }//end of CompareSpectraDataMC
462 
463 Cosmetics(TH1* h){
464  h->SetTitle();
465 
466  h->GetXaxis()->CenterTitle();
467  h->GetXaxis()->SetTitle("E^{reco}_{#nu} (GeV)");
468  h->GetXaxis()->SetTitleSize(.05);
469  h->GetXaxis()->SetLabelSize(.04);
470  h->GetXaxis()->SetTitleOffset(0.75);
471 
472  h->GetYaxis()->SetTitle("Events");
473  h->GetYaxis()->CenterTitle();
474  h->GetYaxis()->SetDecimals();
475  h->GetYaxis()->SetTitleOffset(0.96);
476  h->GetYaxis()->SetTitleSize(.05);
477  h->GetYaxis()->SetLabelSize(.04);
478 }
479 
480 void Ratiohist(TH1* h1, TH1* h2, TH1* hratio, Color_t color, Style_t mstyle, TString labelx, TString labely, Double_t lowy, Double_t highy){
481  //Ratio of h2 wrt h1
482  hratio->Sumw2();
483  Double_t content_ratio;
484  for(Int_t nbin = 1; nbin <=h1->GetXaxis()->GetNbins(); nbin++){
485  Double_t bincontent1 = h1->GetBinContent(nbin);
486  Double_t bincontent2 = h2->GetBinContent(nbin);
487  if(bincontent1==0) content_ratio = 0.0;
488  else content_ratio = (bincontent2)/(bincontent1);
489 
490 // cout << "Bin = " << nbin << " Bin 1 value = " << bincontent1 << " , Bin 2 value = " << bincontent2 << " and ratio = " << content_ratio << endl;
491  hratio->Fill(h1->GetBinCenter(nbin), content_ratio);
492  }//end of for loop
493  hratio->SetMarkerStyle(mstyle);
494  hratio->SetMarkerSize(1.0);
495  hratio->SetLineColor(color);
496  hratio->SetMarkerColor(color);
497 
498  hratio->Draw("P HIST same");
499 
500  Cosmetics(hratio);
501 
502  hratio->GetYaxis()->SetRangeUser(lowy, highy);
503  hratio->GetYaxis()->SetTitle(labely);
504 }//end of Ratiohist(TH1*, TH1*)
505 
bool unoscillatedMC_prediction
Definition: fnexvscaf.C:25
TH1D * hist2
Definition: plotHisto.C:12
bool fd
Definition: fnexvscaf.C:16
CompareSpectraDataMC(char *c1, char *c2, TString mcdata, TString det, const TString rootfile)
Definition: fnexvscaf.C:321
Float_t f2
Create a list of fnex::Events to be used in fits.
ComparePredictions(char *c1, char *c2, char *hist1, char *hist2, const TString rootfile)
Definition: fnexvscaf.C:116
bool datamc
Definition: fnexvscaf.C:20
const XML_Char const XML_Char * data
Definition: expat.h:268
c2
Definition: demo5.py:33
CompareSpectra(char *c1, char *c2, char *hist1, char *hist2, TString mcdata, TString det, const TString rootfile)
Definition: fnexvscaf.C:206
TH1D * hist1
Definition: plotHisto.C:9
bool fitpoint
Definition: fnexvscaf.C:29
Float_t f1
bool oscillatedMC_prediction
Definition: fnexvscaf.C:26
OStream cout
Definition: OStream.cxx:6
TH1F * h2
Definition: plot.C:45
TH1F * h1
bool mc
Definition: fnexvscaf.C:18
Cosmetics(TH1 *h)
Definition: fnexvscaf.C:463
void Ratiohist(TH1 *h1, TH1 *h2, TH1 *hratio, Color_t color, Style_t mstyle, TString labelx, TString labely, Double_t lowy, Double_t highy)
Definition: fnexvscaf.C:480
bool plotpoint
Definition: fnexvscaf.C:28
bool systematics
Definition: fnexvscaf.C:31
c1
Definition: demo5.py:24
fnexvscaf()
Definition: fnexvscaf.C:33
bool nd
Definition: fnexvscaf.C:15
This module creates Common Analysis Files.
Definition: FileReducer.h:10
auto one()
Definition: PMNS.cxx:49