fnex_corrected_uncorrected.C
Go to the documentation of this file.
1 //plot corrected and uncorrected FNEX plots
2 
3 #include <Header.h>
4 #include <HistogramAttr.h>
5 
7  int first_intr = 0;
8  int last_intr = 0;
9 
10  TString det_caf;
11 
12  TString PID[] = { "Low" };
13 
14  TString datamc[] = {"mc"};
15 
16  TString fnex_intr[] = {"me", "ee", "mm", "nc", "em"};
17 
18  TString det[] = {"FD"};
19 
20  TFile* file_fnex = new TFile("/nova/ana/users/prabhjot/FNEX/nue_analysis/realdata/fnex_fitpoint_hist.root", "read"); //fnex file
21 
22  TH1F* fnex_corrected;
23  TH1F* fnex_uncorrected;
24 
25 
26  for(int idet = 0; idet < sizeof(det)/sizeof(det[0]); idet++){
27  if(det[idet]=="ND"){
28  det_caf = "nd";
29  first_intr = 0;
30  last_intr = 3;
31  }
32  else if(det[idet]=="FD"){
33  det_caf = "fd";
34  first_intr = 0;
35  last_intr = sizeof(fnex_intr)/sizeof(fnex_intr[0]);
36  }
37 
38  for(int ipid = 0; ipid < sizeof(PID)/sizeof(PID[0]); ipid++){
39 
40  for(int idatamc = 0; idatamc < sizeof(datamc)/sizeof(datamc[0]); idatamc++){
41 
42  for(int intr = first_intr; intr < last_intr; intr++){
43 
44  if(datamc[idatamc]=="mc") fnex_corrected = (TH1F*)file_fnex->Get("fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/CorrectedStacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+"Corrected");
45 
46  if(datamc[idatamc]=="mc") fnex_uncorrected = (TH1F*)file_fnex->Get("fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/UncorrectedStacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+"Uncorrected");
47 
48  if(!fnex_corrected){
49  std::cout << "FNEX histogram: " << "fit/Fit/MultiExperiment/NOvA_NuESel_"+PID[ipid]+"PID_NuMuSel/CorrectedStacks/"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]+"Corrected" << " does not exists." << std::endl;
50  std::cout << "---------------------->>>>>>>>>>>> ABORTING >>>>>>>>>>>>>>>>--------------------------" << std::endl;
51  abort();
52  }//condition to check if fnex histogram exists or not
53 
54  if(!fnex_uncorrected){
55  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;
56  std::cout << "---------------------->>>>>>>>>>>> ABORTING >>>>>>>>>>>>>>>>--------------------------" << std::endl;
57  abort();
58  }//condition to check if fnex histogram exists or not
59  CompareHistos(fnex_corrected, fnex_uncorrected, "E^{reco}_{#nu} (GeV)", "Events", 632, 600, 2, 1, 0.60, 0.53, 0.86, 0.88, PID[ipid]+"PID_"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr], "Corrected", "Uncorrected", "fnex_correctedvsuncorrected"+PID[ipid]+"PID_"+det[idet]+datamc[idatamc]+"_"+fnex_intr[intr]);
60  }//end of loop over all interactions.
61  }//end of loop over data or mc
62  }//end of loop over all PIDs
63  }//end of loop over detector type
64 
65 }//end of main function
void fnex_corrected_uncorrected()
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)
OStream cout
Definition: OStream.cxx:6