Plotting_DataAndPrediction.C
Go to the documentation of this file.
1 #pragma once
2 
5 #include "CAFAna/Core/Ratio.h"
7 
8 #include "TFeldmanCousins.h"
9 #include "TGraphAsymmErrors.h"
10 #include "TLegend.h"
11 #include "TLegendEntry.h"
12 #include "TPaveText.h"
13 
15 
16 using namespace ana;
17 
18 //STYLING.
19 Color_t color_band = kViolet-9;
20 Color_t color_pred = kViolet+1;
21 Color_t color_ws = kGreen+2;
22 Color_t color_nc = kBlue-7;
23 Color_t color_data = kBlack;
24 Color_t color_cos = kAzure+1;
25 Color_t color_bkg = kGray+1;
26 Color_t color_noosc = kRed+1;
27 Color_t color_noosc_b = kRed-9;
28 Style_t line_ws = kSolid;
29 Style_t line_nc = kSolid;
30 Style_t line_data = kSolid;
31 Style_t line_pred = kSolid;
32 Style_t line_cos = kSolid;
33 Style_t line_bkg = kSolid;
34 Style_t marker_ws = kFullCircle;
35 Style_t marker_nc = kFullSquare;
36 Style_t marker_data = kFullCircle;
37 Style_t marker_pred = kFullCircle;
38 Style_t marker_cos = kFullTriangleUp;
39 Style_t marker_bkg = kFullCircle;
40 
41 void Plotting_DataAndPrediction(std::string s_HornCurrent = "fhc",
42  bool drawData = false,
43  bool drawSystBand = true,
44  bool makeUnoscPlots = true,
45  std::string s_FileAppend = "",
46  bool isPreliminary = true)
47 {
48  unsigned int nQuantiles = 4;
49  double pot;
50  double livetime;
51  Sign::Sign_t WS;
54  if(s_HornCurrent=="fhc") {
55  pot = kAna2020FHCPOT;
56  livetime = kAna2020FHCLivetime;
57  WS = Sign::kAntiNu;
58  Beam = BeamType2020::kFHC;
59  sFHC = "FHC";
60  } else {
61  pot = kAna2020RHCPOT;
62  livetime = kAna2020RHCLivetime;
63  WS = Sign::kNu;
64  Beam = BeamType2020::kRHC;
65  sFHC = "RHC";
66  }
67 
68  std::string s_OutDir = "";
69  std::string s_InDir = "/cvmfs/nova.osgstorage.org/analysis/3flavor/Predictions/";
70  std::string s_PredFile = s_InDir + "pred_xp_numu_NumuEnergy_AllQuantiles_full_"+sFHC+"AllSysts_PtQuants3_numuconcat_realNDData_20200427.root";
71  std::string s_CosFile = s_InDir + "fd_cosmic_pred_numu_"+s_HornCurrent+"_v2.root";
72  std::string s_DataFile = s_InDir + "data_2020_numu_" +s_HornCurrent+"_v4.root";
73  std::string s_DataHist = "/nova/ana/nu_mu_ana/Ana2019/Data/fd_dataspectrum_"+s_HornCurrent+"_full__numu2019.root";
74 
75  // -- Set the fle append structure.
76  s_FileAppend += "_" + s_HornCurrent;
77  if(drawSystBand)
78  {
79  s_FileAppend += "_SystBand";
80  }
81 
82  // -- A default Osc calculator
83  auto calc_Def = DefaultOscCalc();
84  // -- Set to Ana2019 best fit
86  calc ->SetdCP (2*M_PI);
87  calc ->SetTh23(asin(sqrt(0.565)));
88  calc ->SetDmsq32(2.48e-3);
89  // -- A No Osc calculator
90  osc::NoOscillations base_NoOsc;
91  auto calc_NoOsc = base_NoOsc.Copy();
92 
93  // -- Get the systematics
94  auto systs = get3FlavorAna2020AllSysts( EAnaType2020::kNumuAna, true, Beam, false, true );
95 
96  TFile *f_Cosmics = new TFile( s_CosFile.c_str(), "READ");
97  std::vector<TH1*> hCosmics;
98  for(unsigned int i = 0; i < nQuantiles+1; i++) {
99  Spectrum* cosm = Spectrum::LoadFrom(f_Cosmics, ("numu_cos_q"+std::to_string(i)).c_str()).release();
100  hCosmics.push_back( cosm->ToTH1( livetime, kLivetime ) );
101  std::cout << "\t Loaded Q"<<i<<" cosmics. Integral is " << hCosmics.back()->Integral() << std::endl;
102  }
103 
104  SystShifts bfshifts = SystShifts();
105  //for(auto syst: bfshiftsFile->ActiveSysts()){
106  // if(std::find(systs.begin(), systs.end(), syst) != systs.end())
107  // bfshifts.SetShift(syst, bfshiftsFile->GetShift(syst));
108  //}
109  std::cerr << "Got bfshifts." << std::endl;
110  std::vector<PredictionSyst3Flavor2020*> vec_Pred;
111  for(unsigned int i = 0; i < nQuantiles; i++)
112  {
113  vec_Pred.push_back( new PredictionSyst3Flavor2020(ENu2020ExtrapType::kNuMuPtExtrap, calc_Def, s_HornCurrent, i+1, systs, false, "") );
114  }
115  std::cerr << "Pushed back vec_Pred." << std::endl;
116 
117  std::vector<TH1*> hCC;
118  std::vector<TH1*> hNuMu;
119  std::vector<TH1*> hNC;
120  std::vector<TH1*> hWS;
121  std::vector<TH1*> hNoOsc;
122  std::vector<TH1*> hPred;
123  std::vector<TH1*> hBkg;
124  std::vector<TH1*> hAllBkg;
125  std::vector<TH1*> hNoOscNC;
126  std::vector<TH1*> hNoOscNumu;
127 
128  for(unsigned int i = 0; i < nQuantiles; i++)
129  {
130  hCC.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kCC, Sign::kBoth).ToTH1(pot));
131  hNuMu.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
132  hNC.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
133  hWS.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, WS).ToTH1(pot));
134  hNoOsc.push_back (vec_Pred[i]->Predict(calc_NoOsc).ToTH1(pot));
135  hPred.push_back (vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
136  hBkg.push_back (vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
137  hAllBkg.push_back(vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
138 
139  hNoOscNC.push_back (vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
140  hNoOscNumu.push_back(vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
141  if(i==0)
142  {
143  hCC.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kCC, Sign::kBoth).ToTH1(pot));
144  hNuMu.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
145  hNC.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
146  hWS.push_back (vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, WS).ToTH1(pot));
147  hNoOsc.push_back (vec_Pred[i]->Predict(calc_NoOsc).ToTH1(pot));
148  hPred.push_back (vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
149  hBkg.push_back (vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
150  hAllBkg.push_back(vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
151 
152  hNoOscNC.push_back (vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
153  hNoOscNumu.push_back(vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
154  }
155  else
156  {
157  hCC [0]->Add(vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kCC, Sign::kBoth).ToTH1(pot));
158  hNuMu [0]->Add(vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
159  hNC [0]->Add(vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
160  hWS [0]->Add(vec_Pred[i]->PredictComponentSyst(calc, bfshifts, Flavors::kAllNuMu, Current::kCC, WS).ToTH1(pot));
161  hNoOsc [0]->Add(vec_Pred[i]->Predict(calc_NoOsc).ToTH1(pot));
162  hPred [0]->Add(vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
163  hBkg [0]->Add(vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
164  hAllBkg[0]->Add(vec_Pred[i]->PredictSyst(calc, bfshifts).ToTH1(pot));
165 
166  hNoOscNC [0]->Add(vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAll, Current::kNC, Sign::kBoth).ToTH1(pot));
167  hNoOscNumu[0]->Add(vec_Pred[i]->PredictComponent(calc_NoOsc, Flavors::kAllNuMu, Current::kCC, Sign::kBoth).ToTH1(pot));
168  }
169  }
170  std::cerr << "Pushed back the various quartile vectors." << std::endl;
171  // Write out the event lists before scaling...
172  for(unsigned int i = 0; i < hBkg.size(); i++){
173  std::cout << "Looking at Quartile " << i << ", event counts as follows;"
174  << "\n\t hNoOsc " << hNoOsc [i]->Integral()
175  << "\n\t hNoOscNumu " << hNoOscNumu[i]->Integral()
176  << "\n\t hPred " << hPred [i]->Integral()
177  //<< "\n\t hCC " << hCC [i]->Integral()
178  << "\n\t hNuMu " << hNuMu [i]->Integral()
179  //<< "\n\t hAllBkg " << hAllBkg [i]->Integral()
180  << "\n\t hCosmics " << hCosmics [i]->Integral()
181  //<< "\n\t hBkg " << hBkg [i]->Integral()
182  << "\n\t hNC " << hNC [i]->Integral()
183  << "\n\t hWS " << hWS [i]->Integral()
184  << std::endl;
185  }
186 
187  //FAKE STACK.
188  for(unsigned int i = 0; i < hBkg.size(); i++){
189  hBkg[i] ->Add(hNuMu [i], -1);
190  hAllBkg[i]->Add(hNuMu [i], -1);
191  hAllBkg[i]->Add(hCosmics[i]);
192  hWS[i] ->Add(hAllBkg [i]);
193  hPred[i] ->Add(hCosmics[i]);
194  hNoOsc[i] ->Add(hCosmics[i]);
195  }
196 
197  for(unsigned int i = 0; i < hBkg.size(); i++)
198  {
199  hCosmics[i]->Scale(0.1, "width");
200  hCC[i] ->Scale(0.1, "width");
201  hNuMu[i] ->Scale(0.1, "width");
202  hNC[i] ->Scale(0.1, "width");
203  hWS[i] ->Scale(0.1, "width");
204  hNoOsc[i] ->Scale(0.1, "width");
205  hPred[i] ->Scale(0.1, "width");
206  hBkg[i] ->Scale(0.1, "width");
207  hAllBkg[i] ->Scale(0.1, "width");
208  }
209  std::cerr << "Scaled everything." << std::endl;
210  TFile *f_Data = new TFile(s_DataFile.c_str(), "OPEN");
211  TFile *f_DataHist = new TFile(s_DataHist.c_str(), "OPEN");
212  std::cerr << "Loaded data.\n\t" << s_DataFile << "\n\t" << s_DataHist << std::endl;
213  std::vector<TGraphAsymmErrors*> vec_Data;
214  std::vector<Spectrum> spec_Pred;
215  std::vector<Spectrum> spec_NoOsc;
216  for(unsigned int i = 0; i < hPred.size(); i++)
217  {
218  Spectrum spec(hPred[i], pot, livetime);
219  spec_Pred.push_back(spec);
220  Spectrum spec_NO(hNoOsc[i], pot, livetime);
221  spec_NoOsc.push_back(spec_NO);
222  std::cerr << "\t Made spec and spec_NO." << std::endl;
223  vec_Data.push_back((TGraphAsymmErrors*)f_Data->Get(Form("g1_fd_spectra_Q%i", i)));
224  vec_Data.at(i)->SetMarkerStyle(kFullCircle);
225  }
226  std::cerr << "Looped though hPred." << std::endl;
227  std::vector<Spectrum> ups[nQuantiles+1], dns[nQuantiles+1];
228  std::vector<Spectrum> upsNoOsc[nQuantiles+1], dnsNoOsc[nQuantiles+1];
229 
230  if(drawSystBand)
231  {
232  for(unsigned int i = 0; i < hPred.size(); i++)
233  {
234  for(const ISyst* syst: systs){
235  SystShifts shifts;
236  if(i==0)
237  {
238  shifts.SetShift(syst, +1);
239  TH1 * htempup = vec_Pred[0]->PredictSyst(calc, shifts).ToTH1(pot);
240  htempup ->Add(vec_Pred[0]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
241  htempup ->Add(vec_Pred[0]->PredictSyst(calc, bfshifts).ToTH1(pot));
242  TH1 * htempupNoOsc = vec_Pred[0]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot);
243  for(unsigned int j = 1; j < nQuantiles; j++)
244  {
245  htempup ->Add(vec_Pred[j]->PredictSyst(calc, shifts).ToTH1(pot));
246  htempup ->Add(vec_Pred[j]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
247  htempup ->Add(vec_Pred[j]->PredictSyst(calc, bfshifts).ToTH1(pot));
248  htempupNoOsc->Add(vec_Pred[j]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot));
249  }
250  htempup->Scale(0.1, "width");
251  htempup->Add(hCosmics[0]);
252  htempupNoOsc->Scale(0.1, "width");
253 
254  Spectrum specup(htempup, pot, livetime);
255  ups[i].push_back(specup);
256  Spectrum specupNoOsc(htempupNoOsc, pot, livetime);
257  upsNoOsc[i].push_back(specupNoOsc);
258 
259  shifts.SetShift(syst, -1);
260  TH1 * htempdn = vec_Pred[0]->PredictSyst(calc, shifts).ToTH1(pot);
261  htempdn ->Add(vec_Pred[0]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
262  htempdn ->Add(vec_Pred[0]->PredictSyst(calc, bfshifts).ToTH1(pot));
263  TH1 * htempdnNoOsc = vec_Pred[0]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot);
264  for(unsigned int j = 1; j < nQuantiles; j++)
265  {
266  htempdn ->Add(vec_Pred[j]->PredictSyst(calc, shifts).ToTH1(pot));
267  htempdn ->Add(vec_Pred[j]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
268  htempdn ->Add(vec_Pred[j]->PredictSyst(calc, bfshifts).ToTH1(pot));
269  htempdnNoOsc->Add(vec_Pred[j]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot));
270  }
271  htempdn->Scale(0.1, "width");
272  htempdn->Add(hCosmics[0]);
273  htempdnNoOsc->Scale(0.1, "width");
274 
275  Spectrum specdn(htempdn, pot, livetime);
276  dns[i].push_back(specdn);
277  Spectrum specdnNoOsc(htempdnNoOsc, pot, livetime);
278  dnsNoOsc[i].push_back(specdnNoOsc);
279  }
280  else
281  {
282  shifts.SetShift(syst, +1);
283  TH1* htempup = vec_Pred[i-1]->PredictSyst(calc, shifts).ToTH1(pot);
284  htempup ->Add(vec_Pred[i-1]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
285  htempup ->Add(vec_Pred[i-1]->PredictSyst(calc, bfshifts).ToTH1(pot));
286  TH1* htempupNoOsc = vec_Pred[i-1]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot);
287  htempup->Scale(0.1, "width");
288  htempup->Add(hCosmics[i]);
289  htempupNoOsc->Scale(0.1, "width");
290  Spectrum specup(htempup, pot, livetime);
291  ups[i].push_back(specup);
292  Spectrum specupNoOsc(htempupNoOsc, pot, livetime);
293  upsNoOsc[i].push_back(specupNoOsc);
294  shifts.SetShift(syst, -1);
295  TH1 * htempdn = vec_Pred[i-1]->PredictSyst(calc, shifts).ToTH1(pot);
296  htempdn ->Add(vec_Pred[i-1]->PredictSyst(calc, SystShifts::Nominal()).ToTH1(pot), -1);
297  htempdn ->Add(vec_Pred[i-1]->PredictSyst(calc, bfshifts).ToTH1(pot));
298  TH1 * htempdnNoOsc = vec_Pred[i-1]->PredictSyst(calc_NoOsc, shifts).ToTH1(pot);
299  htempdn->Scale(0.1, "width");
300  htempdn->Add(hCosmics[i]);
301  htempdnNoOsc->Scale(0.1, "width");
302  Spectrum specdn(htempdn, pot, livetime);
303  dns[i].push_back(specdn);
304  Spectrum specdnNoOsc(htempdnNoOsc, pot, livetime);
305  dnsNoOsc[i].push_back(specdnNoOsc);
306  }
307  }
308  }
309  }
310  std::cerr << "Past the Syst loop..." << std::endl;
311  DecorateHist(hWS [0], line_ws, color_ws, 1, marker_ws, color_ws, 1);
312  DecorateHist(hNC [0], line_nc, color_nc, 1, marker_nc, color_nc, 1);
314  DecorateHist(hCosmics[0], line_cos, color_cos, 1, marker_cos, color_cos, 1);
315  DecorateHist(hAllBkg [0], line_bkg, color_bkg, 1, marker_bkg, color_bkg, 1);
316  DecorateHist(hBkg [0], line_bkg, color_bkg, 1, marker_bkg, color_bkg, 1);
318  FillWithDimColor(hWS [0], 0);
319  FillWithDimColor(hCosmics[0], 0);
320  FillWithDimColor(hAllBkg [0], 0);
321  std::cerr << "Decorated the hist, and filled with dim colours" << std::endl;
322  double maxPredByQ = 0.;
323  double maxDataByQ = 0.;
324  double maxNoOscByQ = 0.;
325  double maxQ = 0.;
326  for(unsigned int i = 1; i < hBkg.size(); i++)
327  {
328  DecorateHist(hWS [i], line_ws, color_ws, 2, marker_ws, color_ws, 2);
329  DecorateHist(hNC [i], line_nc, color_nc, 2, marker_nc, color_nc, 2);
331  DecorateHist(hCosmics[i], line_cos, color_cos, 2, marker_cos, color_cos, 2);
332  DecorateHist(hAllBkg [i], line_bkg, color_bkg, 2, marker_bkg, color_bkg, 2);
333  DecorateHist(hBkg [i], line_bkg, color_bkg, 2, marker_bkg, color_bkg, 2);
335  FillWithDimColor(hWS [i], 0);
336  FillWithDimColor(hCosmics[i], 0);
337  FillWithDimColor(hAllBkg [i], 0);
338  if(hPred[i]->GetMaximum()>maxPredByQ)
339  {
340  maxPredByQ = hPred[i]->GetMaximum();
341  }
342  if(hNoOsc[i]->GetMaximum()>maxNoOscByQ)
343  {
344  maxNoOscByQ = hNoOsc[i]->GetMaximum();
345  }
346  for(int j = 0; j < vec_Data[i]->GetN(); j++)
347  {
348  double x, y;
349  vec_Data[i]->GetPoint(j, x, y);
350  double ey = vec_Data[i]->GetErrorYhigh(j);
351  if((y+ey)>maxDataByQ)
352  {
353  maxDataByQ = y + ey;
354  }
355  }
356  }
357 
358  maxQ = std::max(maxPredByQ, maxDataByQ);
359 
360  TFile *f_Out = new TFile((s_OutDir+"DataPred" + s_FileAppend + ".root").c_str(), "RECREATE");
361  TCanvas *c = new TCanvas("c_DataPred_Spectra" ,"c_DataPred_Spectra", 600, 500);
362  TCanvas *c_ByQ = new TCanvas("c_DataPred_Spectra_ByQ","c_DataPred_Spectra_ByQ", 600, 500);
363  TPad *p1, *p2, *p3, *p4;
364  SplitCanvasQuant(c_ByQ, p1, p2, p3, p4);
365 
366  TLatex* xTitle = new TLatex(0.5, 0.03, "Reconstructed Neutrino Energy (GeV)");
367  xTitle->SetNDC();
368  xTitle->SetTextAlign(22);
369  TLatex* yTitle = new TLatex(0.02, 0.5, "Events / 0.1 GeV");
370  yTitle->SetNDC();
371  yTitle->SetTextAlign(22);
372  yTitle->SetTextAngle(90.);
373 
374  std::string s_HornLabel = s_HornCurrent=="rhc" ? "Antineutrino beam" : "Neutrino beam";
375  std::string s_WSLabel = s_HornCurrent=="rhc" ? "Wrong Sign: #nu_{#mu}CC." : "Wrong Sign: #bar{#nu}_{#mu}CC.";
376 
377  TLegend *leg = new TLegend(0.53,0.50,0.75,0.88);
378  TLegend *leg_l = new TLegend(0.10,0.75,0.25,0.88);
379  TLegend *leg_r = new TLegend(0.52,0.75,0.65,0.88);
380  if (drawData) {
381  leg->AddEntry(vec_Data[0],"FD Data","LEP") ; leg_l->AddEntry(vec_Data[0],"FD Data","LEP");
382  }
383  leg ->AddEntry(hPred [0],"Prediction","L"); leg_l->AddEntry(hPred [0],"Prediction","L");
384  TLegendEntry *ent_Band;
385  if(drawSystBand)
386  {
387  ent_Band =leg ->AddEntry("error","1-#sigma syst. range", "BF");
388  ent_Band =leg_l->AddEntry("error","1-#sigma syst. range", "BF");
389  ent_Band->SetFillStyle(1001);
390  ent_Band->SetFillColor(color_band);
391  ent_Band->SetLineColor(color_band);
392  }
393  leg->AddEntry(hWS [0], s_WSLabel.c_str(),"BF"); leg_r->AddEntry(hWS [0], s_WSLabel.c_str(),"BF");
394  leg->AddEntry(hAllBkg [0], "Total bkgd." ,"BF"); leg_r->AddEntry(hAllBkg [0], "Total bkgd." ,"BF");
395  leg->AddEntry(hCosmics[0], "Cosmic bkgd." ,"BF"); leg_r->AddEntry(hCosmics[0], "Cosmic bkgd." ,"BF");
396  leg ->SetTextSize (0.05); leg ->SetBorderSize(0); leg ->SetFillStyle (0);
397  leg_l->SetTextSize (0.03); leg_l->SetBorderSize(0); leg_l->SetFillStyle (0);
398  leg_r->SetTextSize (0.03); leg_r->SetBorderSize(0); leg_r->SetFillStyle (0);
399 
400  c->cd();
401  ana::CenterTitles(hPred[0]);
402  if(drawSystBand)
403  {
404  TH1 *nom = spec_Pred[0].ToTH1(pot);
405  nom->GetYaxis()->SetTitle("Events / 0.1 GeV");
406  std::vector<TH1*> upsh, dnsh;
407  for(const auto& upShift: ups[0]) upsh.push_back(upShift.ToTH1(pot));
408  for(const auto& downShift: dns[0]) dnsh.push_back(downShift.ToTH1(pot));
409  PlotWithSystErrorBand(nom, upsh, dnsh, color_pred, color_band, 1.6);
410  }
411  else
412  {
413  hPred[0]->Draw("HIST");
414  hPred[0]->GetYaxis()->SetRangeUser(0, hPred[0]->GetMaximum()*1.6);
415  hPred[0]->GetYaxis()->SetTitle("Events / 0.1 GeV");
416  }
417  hWS [0]->Draw("HIST SAME");
418  hAllBkg [0]->Draw("HIST SAME");
419  hCosmics[0]->Draw("HIST SAME");
420  if (drawData) vec_Data[0]->Draw("P");
421 
423  MyCornerLabel(s_HornLabel);
424  drawQuantLabel(0);
425  leg->Draw();
426 
427  c->SaveAs((TString)s_OutDir + c->GetName() + (TString)s_FileAppend + ".pdf");
428  c->Write();
429 
430  c_ByQ->cd();
431 
432  for(unsigned int i = 1; i < hBkg.size(); i++)
433  {
434  if(i==1) p1->cd();
435  if(i==2) p2->cd();
436  if(i==3) p3->cd();
437  if(i==4) p4->cd();
438  if(drawSystBand)
439  {
440  TH1 *nom = spec_Pred[i].ToTH1(pot);
441  if(i==3)
442  {
443  nom->GetXaxis()->ChangeLabel(6,-1,0);
444  }
445  std::vector<TH1*> upsh, dnsh;
446  for(const auto& upShift: ups[i]) upsh.push_back(upShift.ToTH1(pot));
447  for(const auto& downShift: dns[i]) dnsh.push_back(downShift.ToTH1(pot));
448  //PlotWithSystErrorBand_Quant(i, nom, upsh, dnsh, color_pred, color_band, maxQ*1.25);
449  if (s_HornCurrent=="fhc") { PlotWithSystErrorBand_Quant(i, nom, upsh, dnsh, color_pred, color_band, 5.99); }
450  else { PlotWithSystErrorBand_Quant(i, nom, upsh, dnsh, color_pred, color_band, 2.99); }
451  }
452  else
453  {
454  MakeHistCanvasReady_Quant(i, hPred[i], 5.99);
455  hPred[i]->Draw("HIST");
456  if(i==3)
457  {
458  hPred[i]->GetXaxis()->ChangeLabel(6,-1,0);
459  }
460  }
461  hWS [i]->Draw("HIST SAME");
462  hAllBkg [i]->Draw("HIST SAME");
463  hCosmics[i]->Draw("HIST SAME");
464  if (drawData) vec_Data[i]->Draw("P");
465  drawQuantLabel(i);
466  leg_l->Draw();
467  leg_r->Draw();
468  }
469 
470  c_ByQ->cd();
472  MyCornerLabel(s_HornLabel);
473  xTitle->Draw();
474  yTitle->Draw();
475 
476  c_ByQ->SaveAs((TString)s_OutDir + "c_DataPred_Spectra_ByQ" + (TString)s_FileAppend + ".pdf");
477  c_ByQ->Write();
478 
479  if(makeUnoscPlots)
480  {
481  TCanvas *c_NoOsc = new TCanvas("c_DataPred_NoOsc", "c_DataPred_NoOsc", 600, 500);
482  TCanvas *c_ByQ_NoOsc = new TCanvas("c_DataPred_NoOsc_ByQ","c_DataPred_NoOsc_ByQ", 600, 500);
483  TPad *p1_NoOsc, *p2_NoOsc, *p3_NoOsc, *p4_NoOsc;
484  SplitCanvasQuant(c_ByQ_NoOsc, p1_NoOsc, p2_NoOsc, p3_NoOsc, p4_NoOsc);
485 
486  TLegend *leg_NoOsc = new TLegend(0.55, 0.40, 0.78, 0.85);
487  if (drawData) leg_NoOsc->AddEntry(vec_Data[0], "FD Data", "LEP");
488  leg_NoOsc->AddEntry(hPred [0], "Prediction", "L" );
489  TLegendEntry *ent_Band;
490  TLegendEntry *ent_Band_NoOsc;
491  if(drawSystBand)
492  {
493  /*
494  ent_Band =leg_NoOsc->AddEntry("error","1-#sigma syst. range", "BF");
495  ent_Band->SetFillStyle(1001);
496  ent_Band->SetFillColor(color_band);
497  ent_Band->SetLineColor(color_band);
498  */
499  leg_NoOsc->AddEntry(hNoOsc[0], "No oscillation", "L" );
500  ent_Band_NoOsc =leg_NoOsc->AddEntry("errorNoOsc","1-#sigma syst. range", "BF");
501  ent_Band_NoOsc->SetFillStyle(1001);
502  ent_Band_NoOsc->SetFillColor(color_noosc_b);
503  ent_Band_NoOsc->SetLineColor(color_noosc_b);
504  }
505  else
506  {
507  leg_NoOsc->AddEntry(hNoOsc[0], "No oscillation", "L" );
508  }
509  leg_NoOsc->AddEntry(hAllBkg[0], "Total bkgd.", "BF");
510 
511  leg_NoOsc->SetTextSize(0.05);
512  leg_NoOsc->SetBorderSize(0);
513  leg_NoOsc->SetFillStyle(0);
514 
515  c_NoOsc->cd();
516  ana::CenterTitles(hNoOsc[0]);
517  if(drawSystBand)
518  {
519  TH1 *nomNoOsc = spec_NoOsc[0].ToTH1(pot);
520  nomNoOsc->GetYaxis()->SetTitle("Events / 0.1 GeV");
521  std::vector<TH1*> upshNoOsc, dnshNoOsc;
522  for(const auto& upShift: upsNoOsc[0]) upshNoOsc.push_back(upShift .ToTH1(pot));
523  for(const auto& downShift: dnsNoOsc[0]) dnshNoOsc.push_back(downShift.ToTH1(pot));
524  PlotWithSystErrorBand(nomNoOsc, upshNoOsc, dnshNoOsc, color_noosc, color_noosc_b, 1.3);
525  TH1 *nom = spec_Pred[0].ToTH1(pot);
526  std::vector<TH1*> upsh, dnsh;
527  for(const auto& upShift: ups[0]) upsh.push_back(upShift.ToTH1(pot));
528  for(const auto& downShift: dns[0]) dnsh.push_back(downShift.ToTH1(pot));
529  PlotWithSystErrorBand(nom, upsh, dnsh, color_pred, color_band, 1., false);
530  }
531  else
532  {
533  hNoOsc[0]->Draw("HIST");
534  hNoOsc[0]->GetYaxis()->SetRangeUser(0, hNoOsc[0]->GetMaximum()*1.15);
535  hNoOsc[0]->GetYaxis()->SetTitle("Events / 0.1 GeV");
536  }
537  hAllBkg [0]->Draw("HIST SAME");
538  hPred [0]->Draw("HIST SAME");
539  if (drawData) vec_Data[0]->Draw("P");
540 
542  MyCornerLabel(s_HornLabel);
543  drawQuantLabel(0);
544  //leg_NoOsc->Draw();
545 
546  c_NoOsc->SaveAs((TString)s_OutDir + c_NoOsc->GetName() + (TString)s_FileAppend + ".pdf");
547  c_NoOsc->Write();
548 
549  c_ByQ_NoOsc->cd();
550 
551  for(unsigned int i = 1; i < hBkg.size(); i++)
552  {
553  if(i==1) p1_NoOsc->cd();
554  if(i==2) p2_NoOsc->cd();
555  if(i==3) p3_NoOsc->cd();
556  if(i==4) p4_NoOsc->cd();
557  if(drawSystBand)
558  {
559  TH1 *nom = spec_Pred [i].ToTH1(pot);
560  TH1 *nomNoOsc = spec_NoOsc[i].ToTH1(pot);
561  if(i==3)
562  {
563  nomNoOsc->GetXaxis()->ChangeLabel(6,-1,0);
564  }
565  std::vector<TH1*> upsh, dnsh;
566  for(const auto& upShift: ups[i]) upsh.push_back(upShift.ToTH1(pot));
567  for(const auto& downShift: dns[i]) dnsh.push_back(downShift.ToTH1(pot));
568  std::vector<TH1*> upshNoOsc, dnshNoOsc;
569  for(const auto& upShift: upsNoOsc[i]) upshNoOsc.push_back(upShift .ToTH1(pot));
570  for(const auto& downShift: dnsNoOsc[i]) dnshNoOsc.push_back(downShift.ToTH1(pot));
571  PlotWithSystErrorBand_Quant(i, nomNoOsc, upshNoOsc, dnshNoOsc, color_noosc, color_noosc_b, 15.99);
572  PlotWithSystErrorBand_Quant(i, nom, upsh, dnsh, color_pred, color_band, 15.99, false);
573  //PlotWithSystErrorBand_Quant(i, nomNoOsc, upshNoOsc, dnshNoOsc, color_noosc, color_noosc_b, maxNoOscByQ*1.3);
574  //PlotWithSystErrorBand_Quant(i, nom, upsh, dnsh, color_pred, color_band, maxNoOscByQ*1.3, false);
575  }
576  else
577  {
578  //MakeHistCanvasReady_Quant(i, hNoOsc[i], maxNoOscByQ*1.14);
579  MakeHistCanvasReady_Quant(i, hNoOsc[i], 27.1);
580  hNoOsc[i]->Draw("HIST");
581  if(i==3)
582  {
583  hNoOsc[i]->GetXaxis()->ChangeLabel(6,-1,0);
584  }
585  }
586  hPred [i]->Draw("HIST SAME");
587  hAllBkg [i]->Draw("HIST SAME");
588  if (drawData) vec_Data[i]->Draw("P");
589  drawQuantLabel(i);
590  //leg_NoOsc->Draw();
591  }
592 
593  c_ByQ_NoOsc->cd();
595  MyCornerLabel(s_HornLabel);
596  xTitle->Draw();
597  yTitle->Draw();
598 
599  c_ByQ_NoOsc->SaveAs((TString)s_OutDir + "c_DataPred_NoOsc_ByQ" + (TString)s_FileAppend + ".pdf");
600  c_ByQ_NoOsc->Write();
601 
602  TCanvas *c_Rat = new TCanvas("c_DataPred_RatioNoOsc", "c_DataPred_RatioNoOsc", 600, 500);
603  TCanvas *c_ByQ_Rat = new TCanvas("c_DataPred_RatioNoOsc_ByQ","c_DataPred_RatioNoOsc_ByQ", 600, 500);
604  TPad *p1_Rat, *p2_Rat, *p3_Rat, *p4_Rat;
605  SplitCanvasQuant(c_ByQ_Rat, p1_Rat, p2_Rat, p3_Rat, p4_Rat);
606 
607  std::vector<TH1*> hDataUnscaled;
608  for(unsigned int i = 0; i <= nQuantiles; i++)
609  {
610  std::unique_ptr<Spectrum> spec = Spectrum::LoadFrom(f_DataHist, Form("fd_data_q%i", i));
611  hDataUnscaled.push_back(std::move(spec)->ToTH1(std::move(spec)->POT()));
612  hDataUnscaled[i]->Add(hBkg[i], -1);
613  hDataUnscaled[i]->Add(hCosmics[i], -1);
614  }
615 
616  std::vector<TH1*> hNoOscDenom;
617  std::vector<TH1*> hPredRatio;
618  std::vector<TGraphAsymmErrors*> vec_DataRatio = vec_Data;
619 
620  std::vector<TH1*> upsNoOscRatio[nQuantiles+1], dnsNoOscRatio[nQuantiles+1];
621  for(unsigned int i = 0; i < nQuantiles+1; i++)
622  {
623  for(unsigned int j = 0; j < upsNoOsc[i].size(); j++)
624  {
625  Ratio ratioups(ups[i][j], upsNoOsc[i][j]);
626  upsNoOscRatio[i].push_back(ratioups.ToTH1());
627  Ratio ratiodns(dns[i][j], dnsNoOsc[i][j]);
628  dnsNoOscRatio[i].push_back(ratiodns.ToTH1());
629  }
630  }
631 
632  for(unsigned int i = 0; i < hNoOsc.size(); i++)
633  {
634  TH1* tempdenom = (TH1*)hNoOsc[i]->Clone();
635  TH1* tempratio = (TH1*)hPred[i]->Clone();
636  hNoOscDenom.push_back(tempdenom);
637  hPredRatio .push_back(tempratio);
638  hNoOscDenom[i]->Add(hBkg[i], -1);
639  hPredRatio [i]->Add(hBkg[i], -1);
640  hPredRatio [i]->Divide(hNoOscDenom[i]);
641 
642  hPredRatio[i]->GetXaxis()->CenterTitle();
643  hPredRatio[i]->GetYaxis()->CenterTitle();
644  hPredRatio[i]->GetXaxis()->SetTitle("Reconstructed Neutrino Energy (GeV)");
645  hPredRatio[i]->GetYaxis()->SetTitle("Ratio To No Oscillation");
646 
647  TFeldmanCousins fc(0.6827);
648  for(int j = 0; j < vec_DataRatio[i]->GetN(); j++)
649  {
650  double x, y, yUnscaled;
651  vec_DataRatio[i]->GetPoint(j, x, y);
652 
653  int bin = hCosmics[i]->FindBin(x);
654  yUnscaled = hDataUnscaled[i]->GetBinContent(bin);
655  double scaleFactor = 0.1*hCosmics[i]->GetBinWidth(bin);
656  y -= hCosmics[i]->GetBinContent(bin) - hBkg[i]->GetBinContent(bin);
657  vec_DataRatio[i]->SetPoint (j, x, y/hNoOscDenom[i]->GetBinContent(bin));
658  if(yUnscaled<0)
659  {
660  vec_DataRatio[i]->SetPointEYlow (j, 0.);
661  }
662  else
663  {
664  vec_DataRatio[i]->SetPointEYlow (j,(yUnscaled-fc.CalculateLowerLimit(yUnscaled, 0))/hNoOscDenom[i]->GetBinContent(bin));
665  }
666  vec_DataRatio[i]->SetPointEYhigh(j,(fc.CalculateUpperLimit(yUnscaled, 0)-yUnscaled)/hNoOscDenom[i]->GetBinContent(bin));
667  /*
668  std::cout << i << " " << bin << " " << y << " "
669  << (fc.CalculateLowerLimit(y, 0)) << " " << fc.CalculateUpperLimit(y, 0) << " " << hNoOscDenom[i]->GetBinContent(bin) << " "
670  << (y-fc.CalculateLowerLimit(y, 0))/hNoOscDenom[i]->GetBinContent(bin) << " " << vec_DataRatio[i]->GetErrorYlow(j) << " "
671  << (fc.CalculateUpperLimit(y, 0) -y)/hNoOscDenom[i]->GetBinContent(bin) << std::endl;
672  */
673  }
674  }
675 
676  TLegend *leg_Rat = new TLegend(0.22, 0.65, 0.57, 0.8);
677  //TLegend *leg_Rat = new TLegend(0.26, 0.7, 0.6, 0.85);
678  if (drawData) leg_Rat->AddEntry(vec_Data [0], "FD Data", "LEP");
679  leg_Rat->AddEntry(hPredRatio[0], "Prediction", "L" );
680  TLegendEntry *ent_Band_Rat;
681  if(drawSystBand)
682  {
683  ent_Band_Rat = leg_Rat->AddEntry("errorRat","1-#sigma syst. range", "BF");
684  ent_Band_Rat->SetFillStyle(1001);
685  ent_Band_Rat->SetFillColor(color_band);
686  ent_Band_Rat->SetLineColor(color_band);
687  }
688  leg_Rat->SetTextSize(0.05);
689  leg_Rat->SetBorderSize(0);
690  leg_Rat->SetFillStyle(0);
691 
692  c_Rat->cd();
693  PlotWithSystErrorBand(hPredRatio[0], upsNoOscRatio[0], dnsNoOscRatio[0], color_pred, color_band, 1.6);
694  TLine *l_At1 = new TLine(hPredRatio[0]->GetXaxis()->GetXmin(), 1., hPredRatio[0]->GetXaxis()->GetXmax(), 1.);
695  TLine *l_At0 = new TLine(hPredRatio[0]->GetXaxis()->GetXmin(), 0., hPredRatio[0]->GetXaxis()->GetXmax(), 0.);
696  l_At1->SetLineColor(kGray);
697  l_At1->SetLineStyle(kDashed);
698  l_At1->Draw();
699  l_At0->SetLineColor(kGray);
700  l_At0->SetLineStyle(kDashed);
701  l_At0->Draw();
702  if (drawData) vec_DataRatio[0]->Draw("P0");
703  hPredRatio [0]->GetYaxis()->SetRangeUser(-0.1, 1.6);
704 
706  MyCornerLabel(s_HornLabel);
707  //drawQuantLabel(0);
708  gPad->RedrawAxis();
709 
710  //leg_Rat->Draw();
711  c_Rat->SaveAs((TString)s_OutDir + c_Rat->GetName() + (TString)s_FileAppend + ".pdf");
712  c_Rat->Write();
713 
714  c_ByQ_Rat->cd();
715 
716  for(unsigned int i = 1; i < hBkg.size(); i++)
717  {
718  if(i==1) p1_Rat->cd();
719  if(i==2) p2_Rat->cd();
720  if(i==3) p3_Rat->cd();
721  if(i==4) p4_Rat->cd();
722  //MakeHistCanvasReady_Quant(i, hPredRatio[i], 1.4);
723  PlotWithSystErrorBand_Quant(i, hPredRatio[i], upsNoOscRatio[i], dnsNoOscRatio[i], color_pred, color_band, 1.6);
724  //hPredRatio [i]->Draw("HIST");
725  if (drawData) vec_DataRatio[i]->Draw("P0");
726  if(i==3)
727  {
728  hPredRatio[i]->GetXaxis()->ChangeLabel(6,-1,0);
729  }
730  hPredRatio[i]->GetYaxis()->SetRangeUser(-0.15, 1.6);
731  //leg_Rat->Draw();
732  drawQuantLabel(i);
733  }
734 
735  c_ByQ_Rat->cd();
737  MyCornerLabel(s_HornLabel);
738  xTitle->Draw();
739  yTitle->Draw();
740 
741  c_ByQ_Rat->SaveAs((TString)s_OutDir + "c_DataPred_RatioNoOsc_ByQ" + (TString)s_FileAppend + ".pdf");
742  c_ByQ_Rat->Write();
743 
744 
745  /*
746  TCanvas *c_RatSpec = new TCanvas("c_RatSpec_", "c_RatSpec_", 1000, 1000);
747  TPad *p1_RatSpec = new TPad("p1_RatSpec", "p1_RatSpec", 0, 0.3, 1, 1);
748  TPad *p2_RatSpec = new TPad("p2_RatSpec", "p2_RatSpec", 0, 0, 1, 0.3);
749  p1_RatSpec->SetBottomMargin(0.);
750  p2_RatSpec->SetTopMargin(0.);
751 
752  p1_RatSpec->cd();
753  if(drawSystBand)
754  {
755  TH1 *nomNoOsc = spec_NoOsc[0].ToTH1(pot);
756  nomNoOsc->GetYaxis()->SetTitle("Events / 0.1 GeV");
757  std::vector<TH1*> upshNoOsc, dnshNoOsc;
758  for(const auto& upShift: upsNoOsc[0]) upshNoOsc.push_back(upShift .ToTH1(pot));
759  for(const auto& downShift: dnsNoOsc[0]) dnshNoOsc.push_back(downShift.ToTH1(pot));
760  PlotWithSystErrorBand(nomNoOsc, upshNoOsc, dnshNoOsc, color_noosc, color_noosc_b, 1.3);
761  TH1 *nom = spec_Pred[0].ToTH1(pot);
762  std::vector<TH1*> upsh, dnsh;
763  for(const auto& upShift: ups[0]) upsh.push_back(upShift.ToTH1(pot));
764  for(const auto& downShift: dns[0]) dnsh.push_back(downShift.ToTH1(pot));
765  PlotWithSystErrorBand(nom, upsh, dnsh, color_pred, color_band, 1., false);
766  }
767  else
768  {
769  hNoOsc[0]->Draw("HIST");
770  hNoOsc[0]->GetYaxis()->SetRangeUser(0, hNoOsc[0]->GetMaximum()*1.15);
771  hNoOsc[0]->GetYaxis()->SetTitle("Events / 0.1 GeV");
772  }
773  hAllBkg [0]->Draw("HIST SAME");
774  hPred [0]->Draw("HIST SAME");
775  vec_Data[0]->Draw("P");
776 
777  //drawQuantLabel(0);
778  //leg_NoOsc->Draw();
779 
780  p2_RatSpec->cd();
781  // PlotWithSystErrorBand(hPredRatio[0], upsNoOscRatio[0], dnsNoOscRatio[0], color_pred, color_band, 1.6);
782  vec_DataRatio[0]->Draw("P0");
783  l_At1->Draw();
784  hPredRatio[0]->GetYaxis()->SetRangeUser(-0.1, 1.6);
785 
786  leg_Rat->Draw();
787  gPad->RedrawAxis();
788 
789 
790  //c_RatSpec->cd();
791  //PreliminaryBoxOpening();
792  //MyCornerLabel(s_HornLabel);
793 
794  c_RatSpec->cd();
795  p1_RatSpec->Draw();
796  p2_RatSpec->Draw();
797  c_RatSpec->SaveAs((TString)s_OutDir + c_RatSpec->GetName() + (TString)s_FileAppend + ".pdf");
798  c_RatSpec->Write();
799  */
800 
801  }
802 
803  f_Out->Close();
804 
805 }
806 
T max(const caf::Proxy< T > &a, T b)
Color_t color_band
Pass neutrinos through unchanged.
Definition: IOscCalc.h:45
enum BeamMode kRed
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Antineutrinos-only.
Definition: IPrediction.h:50
TH1D * ToTH1(Color_t col=kBlack, Style_t style=kSolid) const
Definition: Ratio.cxx:67
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
void MakeHistCanvasReady_Quant(const int quant, TH1 *hist, double ymax)
Definition: Plots.cxx:1363
Loads shifted spectra from files.
TH1D * ToTH1(double exposure, Color_t col=kBlack, Style_t style=kSolid, EExposureType expotype=kPOT, EBinType bintype=kBinContent) const
Histogram made from this Spectrum, scaled to some exposure.
Definition: Spectrum.cxx:148
Style_t line_pred
Simple record of shifts applied to systematic parameters.
Definition: SystShifts.h:20
T sqrt(T number)
Definition: d0nt_math.hpp:156
Style_t marker_data
Style_t marker_bkg
Style_t marker_cos
OStream cerr
Definition: OStream.cxx:7
void CenterTitles(TH1 *histo)
Definition: Plots.cxx:1481
static SystShifts Nominal()
Definition: SystShifts.h:34
osc::OscCalcDumb calc
osc::IOscCalcAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
virtual void SetDmsq32(const T &dmsq32)=0
#define M_PI
Definition: SbMath.h:34
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
TGraphAsymmErrors * PlotWithSystErrorBand(IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float headroom, bool newaxis, EBinType bintype)
Plot prediction with +/-1sigma error band.
Definition: Plots.cxx:304
Style_t line_ws
Style_t marker_ws
void Plotting_DataAndPrediction(std::string s_HornCurrent="fhc", bool drawSystBand=true, bool makeUnoscPlots=true, std::string s_FileAppend="", double dmsq=0., double th23=0., bool isPreliminary=true)
std::string sFHC
Definition: MakeCutFlow.C:35
Charged-current interactions.
Definition: IPrediction.h:39
Color_t color_ws
Color_t color_noosc
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:535
Style_t marker_nc
correl_xv GetXaxis() -> SetDecimals()
virtual _IOscCalc< T > * Copy() const override
Definition: IOscCalc.h:49
#define pot
const double kAna2020FHCLivetime
Definition: Exposures.h:237
const double j
Definition: BetheBloch.cxx:29
void PreliminaryBoxOpening()
Definition: numu_tools.h:187
const double kAna2020FHCPOT
Definition: Exposures.h:233
float bin[41]
Definition: plottest35.C:14
Color_t color_cos
const double kAna2020RHCPOT
Definition: Exposures.h:235
void MyCornerLabel(std::string Str)
Represent the ratio between two spectra.
Definition: Ratio.h:8
Neutrinos-only.
Definition: IPrediction.h:49
OStream cout
Definition: OStream.cxx:6
std::vector< double > POT
Color_t color_bkg
double livetime
Definition: saveFDMCHists.C:21
TGraphAsymmErrors * PlotWithSystErrorBand_Quant(const int quant, IPrediction *pred, const std::vector< const ISyst * > &systs, osc::IOscCalc *calc, double pot, int col, int errCol, float maxy, bool newaxis)
Definition: Plots.cxx:541
const double kAna2020RHCLivetime
Definition: Exposures.h:238
enum BeamMode kViolet
Color_t color_noosc_b
Style_t line_bkg
TPaveText * drawQuantLabel(int quantId=0)
Definition: numu_tools.h:4
virtual void SetTh23(const T &th23)=0
Neutral-current interactions.
Definition: IPrediction.h:40
std::vector< const ISyst * > get3FlavorAna2020AllSysts(const EAnaType2020 ana, const bool smallgenie, const BeamType2020 beam, const bool isFit, const bool ptExtrap)
Style_t line_nc
Color_t color_data
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
Color_t color_pred
void SplitCanvasQuant(TCanvas *&canvas, TPad *&pad1, TPad *&pad2, TPad *&pad3, TPad *&pad4)
Definition: Plots.cxx:1437
void Beam(bool isRHC)
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
All neutrinos, any flavor.
Definition: IPrediction.h:26
Float_t e
Definition: plot.C:35
Color_t color_nc
enum BeamMode kGreen
void DecorateHist(TH1 *h, Style_t lineStyle, Color_t lineColor, int lineWidth, Style_t markerStyle, Color_t markerColor, double markerSize)
Definition: PlottingTools.h:94
enum BeamMode kBlue
void SetShift(const ISyst *syst, double shift, bool force=false)
Definition: SystShifts.cxx:81
void FillWithDimColor(TH1 *h, bool usealpha, float dim)
Style_t line_data
virtual void SetdCP(const T &dCP)=0
T asin(T number)
Definition: d0nt_math.hpp:60
Style_t line_cos
Style_t marker_pred
enum BeamMode string