nue_fnex_vs_caf.C
Go to the documentation of this file.
1 //Author: Prabhjot Singh (prabhjot@fnal.gov).
2 //Dated: Sep 20, 2016 15:03.
3 //This program is a template macro to plot and compare FNEX vs. CAFAna predictions or fits for the nue analysis for the following cases for all three cvn pid bins
4 //1. ND data
5 //2. ND MC intrinsic beam νe
6 //3. ND MC νμ CC
7 //4. ND MC neutral currents, NC
8 //
9 //5. FD data
10 //6. FD MC nue appearance, νμ → νe (SIGNAL)
11 //7. FD MC nue survival , νe → νe (BACKGROUND)
12 //8. FD MC numu survival , νμ → νμ (BACKGROUND)
13 //9. FD MC NC → NC (BACKGROUND)
14 //10. FD MC tau appearance (BACKGROUND)
15 //
16 //
17 //Set fit_or_plot = "plot" for Prediction Comparisons and
18 // = "fit" for Fir comparison
19 
20 #include <Header.h>
21 #include <HistogramAttr.h>
22 
24  gStyle->SetOptStat(" ");
25 
26  ofstream summary;
27  summary .open("Images/fnexvscaf/summary.txt");
28 
29  TFile* outfile = new TFile("Images/fnexvscaf/nue_fnex_vs_caf_histograms.root", "RECREATE");
30 
31  double nd_pot = 0.;
32  double fd_pot = 0.;
33  double dcp = 0.;
34  double th13 = 0.;
35  double th23 = 0.;
36  double dmsq32 = 0.;
37  double ymax = 0.;
38  double ratio = 0.;
39  double ratio_error = 0.;
40  double totalevents_fnex = 0.;
41  double totalevents_caf = 0.;
42 
43  int first_intr = 0;
44  int last_intr = 0;
45 
46  TString det_caf;
47  TString fit_or_plot = "plot"; // "plot" or "fit/Fit"
48  TString corr_uncorr = "Corrected"; // "Corrected" or "Uncorrected"
49 
50  TString datamc[] = { "mc", "data"};
51  TString PID[] = {"Low", "Mid", "High"};
52 
53  TString fnex_intr[] = {"ee", "mm" , "nc", "me" , "ee" , "mm" , "mt" , "nc", "em" , "mebar" , "eebar" , "mmbar" , "cosmic"};
54  TString caf_intr[] = {"nue", "numu", "nc", "nue_app", "nue_surv", "numu_surv", "tau_cc_all", "nc", "numu_app", "anue_app", "anue_surv", "anumu_surv", "cosmic"};
55 
56  TString det[] = {"ND", "FD"};
57 
58  TFile* file_fnex = new TFile("/nova/ana/users/prabhjot/FNEX/nue_analysis/realdata/plotpoint_job_caf_bestfitpoint_with_cosmic_nh/fnex_plotpoint_hist.root", "read"); //fnex file
59 
60  TFile* file_caf = new TFile("/nova/ana/users/prabhjot/SRT/development/results/histograms_forFNEX_CVN_prop_stats.root", "read");
61 
62  TH1F* hfnex;
63  TH1F* hfnex_uncorr;
64  TH1D* hcaf;
65  TH1D* h2;
66  TH1F* hist_ratio;
67  TH1F* hist_fd_totaldata_fnex = new TH1F("hist_fd_totaldata_fnex", " ", 60, 0 , 30);
68  TH1F* hist_fd_totaldata_caf = new TH1F("hist_fd_totaldata_caf", " ", 10, 0 , 5 );
69  TH1F* hist_fd_totalmc_fnex = new TH1F("hist_fd_totalmc_fnex", " ", 60, 0 , 30);
70  TH1F* hist_fd_totalmc_caf = new TH1F("hist_fd_totalmc_caf", " ", 10, 0 , 5 );
71  TH1F* hist_nd_totaldata_fnex = new TH1F("hist_nd_totaldata_fnex", " ", 60, 0 , 30);
72  TH1F* hist_nd_totaldata_caf = new TH1F("hist_nd_totaldata_caf", " ", 10, 0 , 5 );
73  TH1F* hist_nd_totalmc_fnex = new TH1F("hist_nd_totalmc_fnex", " ", 60, 0 , 30);
74  TH1F* hist_nd_totalmc_caf = new TH1F("hist_nd_totalmc_caf", " ", 10, 0 , 5 );
75 
76  //POT and best fit information.
77  std::cout << " " << std::endl;
78  std::cout << "--------------------- POT and BF parameters (START) ----------------" << std::endl;
79  TVectorT<double> pot = (TVectorT<double>)file_caf->Get("pot_nd_fd");
80  // //pot->Print();
81  nd_pot = pot[0];
82  fd_pot = pot[1];
83  cout << "ND POT = " << nd_pot << endl;
84  cout << "FD POT = " << fd_pot << endl;
85 
86  TVectorT<double> par = (TVectorT<double>)file_caf->Get("best_dcp_th13_th23_dmsq32");
87  dcp = par[0];
88  th13 = par[1];
89  th23 = par[2];
90  dmsq32 = par[3];
91  cout << "dCP (pi rad) = " << dcp/TMath::Pi() << endl;
92  cout << "th31 = " << th13 << endl;
93  cout << "th23 = " << th23 << " sinsqth23 = " << sin(th23)*sin(th23) << endl;
94  cout << "dmsq32 = " << dmsq32 << endl;
95  std::cout << "--------------------- POT and BF parameters (END) ---------------" << std::endl;
96  std::cout << " " << std::endl;
97 
98  //loop over ND and FD detectors.
99  //idet = 0 for ND
100  //idet = 1 for FD
101  for(int idet = 0; idet < sizeof(det)/sizeof(det[0]); idet++){
102  if(det[idet]=="ND"){
103  det_caf = "nd";
104  first_intr = 0;
105  last_intr = 3;
106  }
107  else if(det[idet]=="FD"){
108  det_caf = "fd";
109  first_intr = 3;
110  last_intr = sizeof(caf_intr)/sizeof(caf_intr[0]);
111  }
112  //loop over all three PIDs
113  //ipid = 0 for Low PID
114  //ipid = 1 for Mid PID
115  //ipid = 2 for High PID
116  for(int ipid = 0; ipid < sizeof(PID)/sizeof(PID[0]); ipid++){
117  TH1F* h_fnex_pid = new TH1F("h_fnex_pid", " ", 60, 0., 30.);
118  TH1F* h_caf_pid = new TH1F("h_caf_pid", " ", 10, 0., 5.);
119 
120  TH1F* h_fnex_pid_background = new TH1F("h_fnex_pid_background", " ", 60, 0., 30.);
121  TH1F* h_caf_pid_background = new TH1F("h_caf_pid_background", " ", 10, 0., 5.); //loop over data or mc plots
122 
123  //loop over data or MC
124  for(int idatamc = 0; idatamc < sizeof(datamc)/sizeof(datamc[0]); idatamc++){
125 
126  //loop over all interactions
127  //intr = 0 for ND fnex ee and caf nue
128  //inrt = 1 for ND fnex mm and caf numu
129  //intr = 2 for ND fnex nc and caf nc
130  //
131  //intr = 3 for FD fnex me and caf nue_app
132  //intr = 4 for FD fnex ee and caf nue_surv
133  //intr = 5 for FD fnex mm and caf numu_surv
134  //intr = 6 for FD fnex mt and caf tau_cc_all
135  //intr = 7 for FD fnex nc and caf nc
136  for(int intr = first_intr; intr < last_intr; intr++){
137  //fnex Corrected Histograms
138  if(datamc[idatamc]=="data") hfnex = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+"Data"+corr_uncorr);
139 
140  else if(datamc[idatamc]=="mc" && fnex_intr[intr] != "cosmic")
141  hfnex = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+corr_uncorr);
142 
143  else if(datamc[idatamc]=="mc" && fnex_intr[intr] == "cosmic")
144  hfnex = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+fnex_intr[intr]+corr_uncorr);
145 
146  if(!hfnex){
147  if(datamc[idatamc]=="data")
148  std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+"Data"+corr_uncorr << " does not exists." << std::endl;
149 
150  else if(datamc[idatamc]=="mc" && fnex_intr[intr] != "cosmic")
151  std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+corr_uncorr << " does not exists." << std::endl;
152 
153  else if(datamc[idatamc]=="mc" && fnex_intr[intr] == "cosmic")
154  std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+fnex_intr[intr]+corr_uncorr << " does not exists." << std::endl;
155  std::cout << "---------------------->>>>>>>>>>>> ABORTING >>>>>>>>>>>>>>>>--------------------------" << std::endl;
156  abort();
157  }//condition to check if fnex histogram exists or not
158 
159  if(det[idet] == "FD" && datamc[idatamc]=="mc" && fnex_intr[intr] == "mt"){
160  hfnex->Add((TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/"+corr_uncorr+"Stacks/"+det[idet]+datamc[idatamc]+"_mtbar"+corr_uncorr));
161  }
162 
163  hfnex->Rebin(2); //rebin fnex because caf bin is 0.5GeV/bin and fnex bin is 0.25GeV/bin
164 
165 // //fnex_uncorr FNEX Uncorrected Histograms
166 // if(datamc[idatamc]=="data") hfnex_uncorr = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+"DataUncorrected");
167 //
168 // else if(datamc[idatamc]=="mc" && fnex_intr[intr] != "cosmic")
169 // hfnex_uncorr = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+"Uncorrected");
170 //
171 // else if(datamc[idatamc]=="mc" && fnex_intr[intr] == "cosmic")
172 // hfnex_uncorr = (TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+fnex_intr[intr]+"Uncorrected");
173 //
174 // if(!hfnex_uncorr){
175 // if(datamc[idatamc]=="data")
176 // std::cout << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+"DataUncorrected" << " does not exists." << std::endl;
177 //
178 // else if(datamc[idatamc]=="mc" && fnex_intr[intr] != "cosmic")
179 // std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+"Uncorrected" << " does not exists." << std::endl;
180 //
181 // else if(datamc[idatamc]=="mc" && fnex_intr[intr] == "cosmic")
182 // std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+fnex_intr[intr]+"Uncorrected" << " does not exists." << std::endl;
183 // std::cout << "---------------------->>>>>>>>>>>> ABORTING >>>>>>>>>>>>>>>>--------------------------" << std::endl;
184 // abort();
185 // }//condition to check if fnex histogram exists or not
186 //
187 // if(det[idet] == "FD" && datamc[idatamc]=="mc" && fnex_intr[intr] == "mt"){
188 // hfnex_uncorr->Add((TH1F*)file_fnex->Get(fit_or_plot+"/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+datamc[idatamc]+"_mtbarUncorrected"));
189 // }
190 //
191 // hfnex_uncorr->Rebin(2); //rebin fnex because caf bin is 0.5GeV/bin and fnex bin is 0.25GeV/bin
192 
193  //caf
194  if(datamc[idatamc]=="data")
195  h2 = (TH1D*)file_caf->Get(det_caf+"_"+datamc[idatamc]);
196  else if(datamc[idatamc]=="mc" && det[idet]=="ND")
197  h2 = (TH1D*)file_caf->Get(det_caf+"_"+datamc[idatamc]+"/"+caf_intr[intr]);
198  else if(datamc[idatamc]=="mc" && det[idet]=="FD" && fnex_intr[intr] != "cosmic")
199  h2 = (TH1D*)file_caf->Get(det_caf+"_extrap_oscil_BF/"+caf_intr[intr]);
200  else if(datamc[idatamc]=="mc" && det[idet]=="FD" && fnex_intr[intr] == "cosmic")
201  h2 = (TH1D*)file_caf->Get(det_caf+"_"+caf_intr[intr]);
202 
203  if(!h2){
204  if(datamc[idatamc]=="data")
205  std::cout << "CAF histogram: " << det_caf+"_"+datamc[idatamc] << " does not exists." << std::endl;
206  else if(datamc[idatamc]=="mc" && det[idet]=="ND")
207  std::cout << "CAF histogram: " << det_caf+"_"+datamc[idatamc]+"/"+caf_intr[intr] << " does not exists." << std::endl;
208  else if(datamc[idatamc]=="mc" && det[idet]=="FD" && fnex_intr[intr] != "cosmic")
209  std::cout << "CAF histogram: " << det_caf+"_extrap_oscil_BF/"+caf_intr[intr] << " does not exists." << std::endl;
210  else if(datamc[idatamc]=="mc" && det[idet]=="FD" && fnex_intr[intr] == "cosmic")
211  std::cout << "CAF histogram: " << det_caf+"_"+caf_intr[intr] << " does not exists." << std::endl;
212  std::cout << "---------------------->>>>>>>>>>>> ABORTING >>>>>>>>>>>>>>>>--------------------------" << std::endl;
213  abort();
214  }//condition to check if CAF histogram exists or not
215 
216  hcaf = CorrectRange(h2, PID[ipid]);
217 
218 // if(datamc[idatamc]=="mc" && det[idet]=="FD")
219 // CompareHistos(
220 // hcaf,
221 // hfnex,
222 // hfnex_uncorr,
223 // "E^{reco}_{#nu} (GeV)",
224 // "Events",
225 // 632,
226 // 600,
227 // 2,
228 // 1,
229 // 0.52,
230 // 0.33,
231 // 0.89,
232 // 0.86,
233 // det[idet]+" "+datamc[idatamc]+" "+PID[ipid]+ " PID: "+caf_intr[intr],
234 // "CAF",
235 // "FNEX extrapolated",
236 // "FNEX not extrapolated",
237 // det[idet]+"_"+datamc[idatamc]+"_"+PID[ipid]+"_"+caf_intr[intr]+"_three"
238 // );
239 
240  //scale fnex by ratio of caf/fnex
241  // if(datamc[idatamc]=="mc" || det[idet]=="ND")
242  // hfnex->Scale(hcaf->Integral()/hfnex->Integral());
243 
244  //set y maximum range
245  if(hfnex->GetBinContent(hfnex->GetMaximumBin()) > hcaf->GetBinContent(hcaf->GetMaximumBin()) )
246  ymax = 1.1*hfnex->GetBinContent(hfnex->GetMaximumBin());
247  else if(hfnex->GetBinContent(hfnex->GetMaximumBin()) <= hcaf->GetBinContent(hcaf->GetMaximumBin()) )
248  ymax = 1.1*hcaf->GetBinContent(hcaf->GetMaximumBin());
249 
250  //Write integrals of different histograms in a summary file
251  summary << "//---------------------------------------------------------------//" << std::endl;
252  summary << "PID : " << PID[ipid] << " PID" << std::endl;
253  summary << "Detector : " << det[idet] << std::endl;
254  summary << "Data or MC : " << datamc[idatamc] << std::endl;
255  if(datamc[idatamc]=="mc")
256  summary << "Interaction : " << fnex_intr[intr] << std::endl;
257  summary << "CAF events : " << hcaf->Integral() << std::endl;
258 // summary << "FNEX Unorrected events: " << hfnex_uncorr->Integral() << std::endl;
259  summary << "FNEX Corrected events : " << hfnex->Integral() << std::endl;
260  summary << "//---------------------------------------------------------------//" << std::endl;
261 
262  if(datamc[idatamc]=="mc")
263  CompareHistos(
264  hcaf,
265  hfnex,
266  "E^{reco}_{#nu} (GeV)",
267  "Events",
268  632,
269  600,
270  2,
271  1,
272  0.64,
273  0.53,
274  0.89,
275  0.88,
276  det[idet]+" "+datamc[idatamc]+ " "+caf_intr[intr],
277  "CAF",
278  "FNEX",
279  PID[ipid]+"_PID_"+det[idet]+"_"+datamc[idatamc]+"_"+caf_intr[intr]
280  );
281 
282  else if(datamc[idatamc]=="data")
283  CompareHistos( hcaf,
284  hfnex,
285  "E^{reco}_{#nu} (GeV)",
286  "Events",
287  632,
288  600,
289  2,
290  1,
291  0.64,
292  0.53,
293  0.89,
294  0.88,
295  det[idet]+" "+datamc[idatamc],
296  "CAF",
297  "FNEX",
298  PID[ipid]+"_PID_"+det[idet]+"_"+datamc[idatamc]
299  );
300 
301  if(datamc[idatamc]=="data" && det[idet]=="FD"){
302  hist_fd_totaldata_fnex->Add(hfnex);
303  hist_fd_totaldata_caf->Add(hcaf);
304  }
305  if(datamc[idatamc]=="mc" && det[idet]=="FD"){
306  hist_fd_totalmc_fnex->Add(hfnex);
307  hist_fd_totalmc_caf->Add(hcaf);
308 
309  h_fnex_pid->Add(hfnex);
310  h_caf_pid->Add(hcaf);
311 
312  if( caf_intr[intr] != "nue_app"){
313  h_fnex_pid_background->Add(hfnex);
314  h_caf_pid_background->Add(hcaf);
315  }
316  }
317  if(datamc[idatamc]=="data" && det[idet]=="ND"){
318  hist_nd_totaldata_fnex->Add(hfnex);
319  hist_nd_totaldata_caf->Add(hcaf);
320  }
321  if(datamc[idatamc]=="mc" && det[idet]=="ND"){
322  hist_nd_totalmc_fnex->Add(hfnex);
323  hist_nd_totalmc_caf->Add(hcaf);
324 
325  h_fnex_pid->Add(hfnex);
326  h_caf_pid->Add(hcaf);
327  }
328 
329  delete hfnex;
330  delete hcaf;
331  delete h2;
332 
333  //loop only once if its a data case
334  if(datamc[idatamc]=="data") break;
335  }//end of loop over all interactions.
336  if(datamc[idatamc]=="mc") CompareHistos(h_caf_pid, h_fnex_pid, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, det[idet]+" "+datamc[idatamc]+" "+PID[ipid], "CAF", "FNEX", det[idet]+"_"+datamc[idatamc]+"_"+PID[ipid]);
337 
338  if(datamc[idatamc]=="mc" && det[idet]=="FD")
339  CompareHistos(h_caf_pid_background, h_fnex_pid_background, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, det[idet]+" "+datamc[idatamc]+" "+PID[ipid]+ " Background", "CAF", "FNEX", det[idet]+"_"+datamc[idatamc]+"_"+PID[ipid]+"_background");
340 
341  if(h_caf_pid) delete h_caf_pid;
342  if(h_fnex_pid) delete h_fnex_pid;
343  if(h_caf_pid_background) delete h_caf_pid_background;
344  if(h_fnex_pid_background) delete h_fnex_pid_background;
345  }//end of loop over data or mc
346  }//end of loop over all PIDs
347  }//end of loop over detector type
348  CompareHistos(hist_fd_totaldata_caf, hist_fd_totaldata_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "FD data total", "CAF", "FNEX", "FD_data_total");
349  CompareHistos(hist_fd_totalmc_caf, hist_fd_totalmc_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "FD MC total", "CAF", "FNEX", "FD_mc_total");
350 
351  CompareHistos(hist_nd_totaldata_caf, hist_nd_totaldata_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "ND data total", "CAF", "FNEX", "ND_data_total");
352  CompareHistos(hist_nd_totalmc_caf, hist_nd_totalmc_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "ND mc total", "CAF", "FNEX", "ND_mc_total");
353 
354  CompareHistos(hist_fd_totalmc_caf, hist_fd_totaldata_caf, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "FD CAF total", "MC", "data", "CAF_FD_databymc_total");
355  CompareHistos(hist_fd_totalmc_fnex, hist_fd_totaldata_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "FD FNEX total", "MC", "data", "FNEX_FD_databymc_total");
356 
357  CompareHistos(hist_nd_totalmc_caf, hist_nd_totaldata_caf, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "ND CAF total", "MC", "data", "CAF_ND_databymc_total");
358  CompareHistos(hist_nd_totalmc_fnex, hist_nd_totaldata_fnex, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "ND FNEX total", "MC", "data", "FNEX_ND_databymc_total");
359 
360  //Double ratios of CAF to FNEX ND Data/MC
361  TH1F* h_fnex_nd_datamc = (TH1F*)hist_nd_totaldata_fnex->Clone("h_fnex_nd_datamc");
362  h_fnex_nd_datamc ->Sumw2();
363  h_fnex_nd_datamc ->Divide(hist_nd_totalmc_fnex);
364  TH1F* h_caf_nd_datamc = (TH1F*)hist_nd_totaldata_caf->Clone("h_caf_nd_datamc");
365  h_caf_nd_datamc ->Divide(hist_nd_totalmc_caf);
366  h_caf_nd_datamc ->Sumw2();
367 
368  CompareHistos(h_fnex_nd_datamc, h_caf_nd_datamc, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.64, 0.53, 0.89, 0.88, "ND Data/MC", "FNEX", "CAF", "CAF_FNEX_dataoverMC_doubleratio");
369 
370  summary .close();
371 
372  outfile ->Write();
373  outfile ->Close();
374 }//end of main program
375 //--------------------------------------------------------------//
376 TH1D* CorrectRange(TH1D* h, TString PID){
377  int firstbin = 0;
378  if(PID=="Low") firstbin = 0;
379  if(PID=="Mid") firstbin = 10;
380  if(PID=="High") firstbin = 20;
381  TH1D* hlow = new TH1D("hlow", "", 10, 0, 5);
382  for(unsigned int i = 1; i < h->GetNbinsX()+1; i++){
383  hlow->SetBinContent(i, h->GetBinContent(i+firstbin));
384  }
385  return hlow;
386 }//end of CorrectRange
387 //---------------------------------------------------------------//
388 
double th23
Definition: runWimpSim.h:98
TH1 * ratio(TH1 *h1, TH1 *h2)
Int_t par
Definition: SimpleIterate.C:24
bool datamc
Definition: fnexvscaf.C:20
void CompareHistos(TH1 *hbase_orig, TH1 *hsec_orig, TString xlabel, TString ylabel, int cbase, int csec, int lbase, int lsec, float x1, float y1, float x2, float y2, TString legtitle, TString legbase, TString legsec, TString savefile)
void nue_fnex_vs_caf()
Double_t ymax
Definition: plot.C:25
#define pot
OStream cout
Definition: OStream.cxx:6
TH1F * h2
Definition: plot.C:45
ofstream summary
T sin(T number)
Definition: d0nt_math.hpp:132
double dmsq32
TH1D * CorrectRange(TH1D *h, TString PID)
double th13
Definition: runWimpSim.h:98
FILE * outfile
Definition: dump_event.C:13