CutTableAna.C
Go to the documentation of this file.
4 #include "CAFAna/Core/Spectrum.h"
9 
11 
12 #include "TDirectory.h"
13 #include "TFile.h"
14 
15 using namespace ana;
16 
17 void MakeHBar(IPrediction* pred0, Spectrum* sCos0,
18  IPrediction* pred1, Spectrum* sCos1,
19  IPrediction* pred2, Spectrum* sCos2,
20  IPrediction* pred3, Spectrum* sCos3,
21  IPrediction* pred4, Spectrum* sCos4,
22  IPrediction* pred5, Spectrum* sCos5,
24  double scale, TDirectory* out);
25 
26 void SetHBarOptions(TH1* h, double offset, Color_t color);
27 
29 {
30  TH1::AddDirectory(0);
31 
32  // Set up the path to load data and save analysis plots
33  std::string folder = "/nova/ana/steriles/Ana01/";
34  std::string filenm = "CutTable";
35 
36  std::string loadLocation = folder + filenm + ".root";
37  std::string saveLocation = folder + filenm + "Ana.root";
38  std::string textLocation = folder + filenm + "Ana.txt";
39 
40  // Load the CAFAna objects from file
41  TFile* rootL = new TFile(loadLocation.c_str(), "READ"); // No overwrite allowed
42  TDirectory* tmpL = gDirectory;
43  TDirectory* loadDir = gDirectory;
44 
45  loadDir->cd((loadLocation + ":/dND_Reco0").c_str());
46  ProportionalDecomp dND_Reco0 = *ProportionalDecomp::LoadFrom(gDirectory);
47  loadDir->cd((loadLocation + ":/dND_Reco1").c_str());
48  ProportionalDecomp dND_Reco1 = *ProportionalDecomp::LoadFrom(gDirectory);
49  loadDir->cd((loadLocation + ":/dND_Reco2").c_str());
50  ProportionalDecomp dND_Reco2 = *ProportionalDecomp::LoadFrom(gDirectory);
51  loadDir->cd((loadLocation + ":/dND_Reco3").c_str());
52  ProportionalDecomp dND_Reco3 = *ProportionalDecomp::LoadFrom(gDirectory);
53  loadDir->cd((loadLocation + ":/dND_Reco4").c_str());
54  ProportionalDecomp dND_Reco4 = *ProportionalDecomp::LoadFrom(gDirectory);
55  loadDir->cd((loadLocation + ":/dND_Reco5").c_str());
56  ProportionalDecomp dND_Reco5 = *ProportionalDecomp::LoadFrom(gDirectory);
57 
58  loadDir->cd((loadLocation + ":/pFD_Reco0").c_str());
59  PredictionExtrap pFD_Reco0 = *PredictionNoExtrap::LoadFrom(gDirectory);
60  loadDir->cd((loadLocation + ":/pFD_Reco1").c_str());
61  PredictionExtrap pFD_Reco1 = *PredictionNoExtrap::LoadFrom(gDirectory);
62  loadDir->cd((loadLocation + ":/pFD_Reco2").c_str());
63  PredictionExtrap pFD_Reco2 = *PredictionNoExtrap::LoadFrom(gDirectory);
64  loadDir->cd((loadLocation + ":/pFD_Reco3").c_str());
65  PredictionExtrap pFD_Reco3 = *PredictionNoExtrap::LoadFrom(gDirectory);
66  loadDir->cd((loadLocation + ":/pFD_Reco4").c_str());
67  PredictionExtrap pFD_Reco4 = *PredictionNoExtrap::LoadFrom(gDirectory);
68  loadDir->cd((loadLocation + ":/pFD_Reco5").c_str());
69  PredictionExtrap pFD_Reco5 = *PredictionNoExtrap::LoadFrom(gDirectory);
70 
71  loadDir->cd((loadLocation + ":/sCS_Reco0").c_str());
72  Spectrum sCS_Reco0 = *Spectrum::LoadFrom(gDirectory);
73  loadDir->cd((loadLocation + ":/sCS_Reco1").c_str());
74  Spectrum sCS_Reco1 = *Spectrum::LoadFrom(gDirectory);
75  loadDir->cd((loadLocation + ":/sCS_Reco2").c_str());
76  Spectrum sCS_Reco2 = *Spectrum::LoadFrom(gDirectory);
77  loadDir->cd((loadLocation + ":/sCS_Reco3").c_str());
78  Spectrum sCS_Reco3 = *Spectrum::LoadFrom(gDirectory);
79  loadDir->cd((loadLocation + ":/sCS_Reco4").c_str());
80  Spectrum sCS_Reco4 = *Spectrum::LoadFrom(gDirectory);
81  loadDir->cd((loadLocation + ":/sCS_Reco5").c_str());
82  Spectrum sCS_Reco5 = *Spectrum::LoadFrom(gDirectory);
83 
84  loadDir->cd((loadLocation + ":/pFD_VertexX1").c_str());
85  PredictionExtrap pFD_VertexX1 = *PredictionNoExtrap::LoadFrom(gDirectory);
86  loadDir->cd((loadLocation + ":/pFD_VertexY1").c_str());
87  PredictionExtrap pFD_VertexY1 = *PredictionNoExtrap::LoadFrom(gDirectory);
88  loadDir->cd((loadLocation + ":/pFD_VertexZ1").c_str());
89  PredictionExtrap pFD_VertexZ1 = *PredictionNoExtrap::LoadFrom(gDirectory);
90  loadDir->cd((loadLocation + ":/pFD_Contain1").c_str());
91  PredictionExtrap pFD_Contain1 = *PredictionNoExtrap::LoadFrom(gDirectory);
92  loadDir->cd((loadLocation + ":/pFD_NHit3").c_str());
93  PredictionExtrap pFD_NHit3 = *PredictionNoExtrap::LoadFrom(gDirectory);
94  loadDir->cd((loadLocation + ":/pFD_CVN3").c_str());
95  PredictionExtrap pFD_CVN3 = *PredictionNoExtrap::LoadFrom(gDirectory);
96  loadDir->cd((loadLocation + ":/pFD_LID3").c_str());
97  PredictionExtrap pFD_LID3 = *PredictionNoExtrap::LoadFrom(gDirectory);
98  loadDir->cd((loadLocation + ":/pFD_Rem3").c_str());
99  PredictionExtrap pFD_Rem3 = *PredictionNoExtrap::LoadFrom(gDirectory);
100  loadDir->cd((loadLocation + ":/pFD_NumucontPID4").c_str());
101  PredictionExtrap pFD_NumucontPID4 = *PredictionNoExtrap::LoadFrom(gDirectory);
102  loadDir->cd((loadLocation + ":/pFD_PartPTP4").c_str());
103  PredictionExtrap pFD_PartPTP4 = *PredictionNoExtrap::LoadFrom(gDirectory);
104  loadDir->cd((loadLocation + ":/pFD_IsMu4").c_str());
105  PredictionExtrap pFD_IsMu4 = *PredictionNoExtrap::LoadFrom(gDirectory);
106  loadDir->cd((loadLocation + ":/pFD_EperHit4").c_str());
107  PredictionExtrap pFD_EperHit4 = *PredictionNoExtrap::LoadFrom(gDirectory);
108  loadDir->cd((loadLocation + ":/pFD_DistTop4").c_str());
109  PredictionExtrap pFD_DistTop4 = *PredictionNoExtrap::LoadFrom(gDirectory);
110 
111  loadDir->cd((loadLocation + ":/sCS_VertexX1").c_str());
112  Spectrum sCS_VertexX1 = *Spectrum::LoadFrom(gDirectory);
113  loadDir->cd((loadLocation + ":/sCS_VertexY1").c_str());
114  Spectrum sCS_VertexY1 = *Spectrum::LoadFrom(gDirectory);
115  loadDir->cd((loadLocation + ":/sCS_VertexZ1").c_str());
116  Spectrum sCS_VertexZ1 = *Spectrum::LoadFrom(gDirectory);
117  loadDir->cd((loadLocation + ":/sCS_Contain1").c_str());
118  Spectrum sCS_Contain1 = *Spectrum::LoadFrom(gDirectory);
119  loadDir->cd((loadLocation + ":/sCS_NHit3").c_str());
120  Spectrum sCS_NHit3 = *Spectrum::LoadFrom(gDirectory);
121  loadDir->cd((loadLocation + ":/sCS_CVN3").c_str());
122  Spectrum sCS_CVN3 = *Spectrum::LoadFrom(gDirectory);
123  loadDir->cd((loadLocation + ":/sCS_LID3").c_str());
124  Spectrum sCS_LID3 = *Spectrum::LoadFrom(gDirectory);
125  loadDir->cd((loadLocation + ":/sCS_Rem3").c_str());
126  Spectrum sCS_Rem3 = *Spectrum::LoadFrom(gDirectory);
127  loadDir->cd((loadLocation + ":/sCS_NumucontPID4").c_str());
128  Spectrum sCS_NumucontPID4 = *Spectrum::LoadFrom(gDirectory);
129  loadDir->cd((loadLocation + ":/sCS_PartPTP4").c_str());
130  Spectrum sCS_PartPTP4 = *Spectrum::LoadFrom(gDirectory);
131  loadDir->cd((loadLocation + ":/sCS_IsMu4").c_str());
132  Spectrum sCS_IsMu4 = *Spectrum::LoadFrom(gDirectory);
133  loadDir->cd((loadLocation + ":/sCS_EperHit4").c_str());
134  Spectrum sCS_EperHit4 = *Spectrum::LoadFrom(gDirectory);
135  loadDir->cd((loadLocation + ":/sCS_DistTop4").c_str());
136  Spectrum sCS_DistTop4 = *Spectrum::LoadFrom(gDirectory);
137 
138  loadDir->cd((loadLocation + ":/pNM1_VertexX").c_str());
139  PredictionExtrap pNM1_VertexX = *PredictionNoExtrap::LoadFrom(gDirectory);
140  loadDir->cd((loadLocation + ":/pNM1_VertexY").c_str());
141  PredictionExtrap pNM1_VertexY = *PredictionNoExtrap::LoadFrom(gDirectory);
142  loadDir->cd((loadLocation + ":/pNM1_VertexZ").c_str());
143  PredictionExtrap pNM1_VertexZ = *PredictionNoExtrap::LoadFrom(gDirectory);
144  loadDir->cd((loadLocation + ":/pNM1_Contain").c_str());
145  PredictionExtrap pNM1_Contain = *PredictionNoExtrap::LoadFrom(gDirectory);
146  loadDir->cd((loadLocation + ":/pNM1_NHit").c_str());
147  PredictionExtrap pNM1_NHit = *PredictionNoExtrap::LoadFrom(gDirectory);
148  loadDir->cd((loadLocation + ":/pNM1_CVN").c_str());
149  PredictionExtrap pNM1_CVN = *PredictionNoExtrap::LoadFrom(gDirectory);
150  loadDir->cd((loadLocation + ":/pNM1_LID").c_str());
151  PredictionExtrap pNM1_LID = *PredictionNoExtrap::LoadFrom(gDirectory);
152  loadDir->cd((loadLocation + ":/pNM1_Rem").c_str());
153  PredictionExtrap pNM1_Rem = *PredictionNoExtrap::LoadFrom(gDirectory);
154  loadDir->cd((loadLocation + ":/pNM1_NumucontPID").c_str());
155  PredictionExtrap pNM1_NumucontPID = *PredictionNoExtrap::LoadFrom(gDirectory);
156  loadDir->cd((loadLocation + ":/pNM1_PartPTP").c_str());
157  PredictionExtrap pNM1_PartPTP = *PredictionNoExtrap::LoadFrom(gDirectory);
158  loadDir->cd((loadLocation + ":/pNM1_IsMu").c_str());
159  PredictionExtrap pNM1_IsMu = *PredictionNoExtrap::LoadFrom(gDirectory);
160  loadDir->cd((loadLocation + ":/pNM1_EperHit").c_str());
161  PredictionExtrap pNM1_EperHit = *PredictionNoExtrap::LoadFrom(gDirectory);
162  loadDir->cd((loadLocation + ":/pNM1_DistTop").c_str());
163  PredictionExtrap pNM1_DistTop = *PredictionNoExtrap::LoadFrom(gDirectory);
164 
165  loadDir->cd((loadLocation + ":/sNM1_VertexX").c_str());
166  Spectrum sNM1_VertexX = *Spectrum::LoadFrom(gDirectory);
167  loadDir->cd((loadLocation + ":/sNM1_VertexY").c_str());
168  Spectrum sNM1_VertexY = *Spectrum::LoadFrom(gDirectory);
169  loadDir->cd((loadLocation + ":/sNM1_VertexZ").c_str());
170  Spectrum sNM1_VertexZ = *Spectrum::LoadFrom(gDirectory);
171  loadDir->cd((loadLocation + ":/sNM1_Contain").c_str());
172  Spectrum sNM1_Contain = *Spectrum::LoadFrom(gDirectory);
173  loadDir->cd((loadLocation + ":/sNM1_NHit").c_str());
174  Spectrum sNM1_NHit = *Spectrum::LoadFrom(gDirectory);
175  loadDir->cd((loadLocation + ":/sNM1_CVN").c_str());
176  Spectrum sNM1_CVN = *Spectrum::LoadFrom(gDirectory);
177  loadDir->cd((loadLocation + ":/sNM1_LID").c_str());
178  Spectrum sNM1_LID = *Spectrum::LoadFrom(gDirectory);
179  loadDir->cd((loadLocation + ":/sNM1_Rem").c_str());
180  Spectrum sNM1_Rem = *Spectrum::LoadFrom(gDirectory);
181  loadDir->cd((loadLocation + ":/sNM1_NumucontPID").c_str());
182  Spectrum sNM1_NumucontPID = *Spectrum::LoadFrom(gDirectory);
183  loadDir->cd((loadLocation + ":/sNM1_PartPTP").c_str());
184  Spectrum sNM1_PartPTP = *Spectrum::LoadFrom(gDirectory);
185  loadDir->cd((loadLocation + ":/sNM1_IsMu").c_str());
186  Spectrum sNM1_IsMu = *Spectrum::LoadFrom(gDirectory);
187  loadDir->cd((loadLocation + ":/sNM1_EperHit").c_str());
188  Spectrum sNM1_EperHit = *Spectrum::LoadFrom(gDirectory);
189  loadDir->cd((loadLocation + ":/sNM1_DistTop").c_str());
190  Spectrum sNM1_DistTop = *Spectrum::LoadFrom(gDirectory);
191 
192  tmpL->cd();
193  rootL->Close(); // Don't forget to close this file!
194 
195  // Create and open new files for saving the analysed results
196  TFile* rootF = new TFile(saveLocation.c_str(), "RECREATE"); // For root output
197  FILE* textF; // Text output
198  textF = fopen(textLocation.c_str(), "w");
199 
200  std::string labelEReco = "Calorimetric Energy (GeV)";
201  std::string labelVtxX = "X Vertex Position (cm)";
202  std::string labelVtxY = "Y Vertex Position (cm)";
203  std::string labelVtxZ = "Z Vertex Position (cm)";
204  std::string labelCont = "Min. Dist. to Det. Face (cm)";
205  std::string labelHits = "Number of Hits";
206  std::string labelCVN = "CVN NCID";
207  std::string labelLID = "LID";
208  std::string labelRemID = "RemID";
209  std::string labelNCP = "Cosmic Rejection BDT";
210  std::string labelPTP = "PT/P";
211  std::string labelIsMuon = "Is Muon";
212  std::string labelEPerHit = "Average E/Hit (GeV)";
213  std::string labelTop = "Dist. to Det. Top (cm)";
214 
215  // Run the plotting functions!
216  PlotSpectra(&dND_Reco0, &pFD_Reco0, sCS_Reco0, rootF, textF, "Reco0", labelEReco, 6, "logy");
217  PlotSpectra(&dND_Reco1, &pFD_Reco1, sCS_Reco1, rootF, textF, "Reco1", labelEReco, 6, "logy");
218  PlotSpectra(&dND_Reco2, &pFD_Reco2, sCS_Reco2, rootF, textF, "Reco2", labelEReco, 6, "logy");
219  PlotSpectra(&dND_Reco3, &pFD_Reco3, sCS_Reco3, rootF, textF, "Reco3", labelEReco, 6, "logy");
220  PlotSpectra(&dND_Reco4, &pFD_Reco4, sCS_Reco4, rootF, textF, "Reco4", labelEReco, 6, "logy");
221  PlotSpectra(&dND_Reco5, &pFD_Reco5, sCS_Reco5, rootF, textF, "Reco5", labelEReco, 6, "");
222 
223 
225  PlotSpectra(&pFD_VertexX1, sCS_VertexX1, calc, rootF, textF, "VtxX", labelVtxX, 6, "hist logy");
226  PlotSpectra(&pFD_VertexY1, sCS_VertexY1, calc, rootF, textF, "VtxY", labelVtxY, 6, "hist logy");
227  PlotSpectra(&pFD_VertexZ1, sCS_VertexZ1, calc, rootF, textF, "VtxZ", labelVtxZ, 6, "hist logy");
228  PlotSpectra(&pFD_Contain1, sCS_Contain1, calc, rootF, textF, "Cont", labelCont, 6, "hist logy");
229  PlotSpectra(&pFD_NHit3, sCS_NHit3, calc, rootF, textF, "NHit", labelHits, 6, "hist logy");
230  PlotSpectra(&pFD_CVN3, sCS_CVN3, calc, rootF, textF, "CVN", labelCVN, 6, "hist logy");
231  PlotSpectra(&pFD_LID3, sCS_LID3, calc, rootF, textF, "LID", labelLID, 6, "hist logy");
232  PlotSpectra(&pFD_Rem3, sCS_Rem3, calc, rootF, textF, "Rem", labelRemID, 6, "hist logy");
233  PlotSpectra(&pFD_NumucontPID4, sCS_NumucontPID4, calc, rootF, textF, "NumucontPID", labelNCP, 6, "hist logy");
234  PlotSpectra(&pFD_PartPTP4, sCS_PartPTP4, calc, rootF, textF, "PartPTP", labelPTP, 6, "hist logy");
235  PlotSpectra(&pFD_IsMu4, sCS_IsMu4, calc, rootF, textF, "IsMu", labelIsMuon, 6, "hist logy");
236  PlotSpectra(&pFD_EperHit4, sCS_EperHit4, calc, rootF, textF, "EperHit", labelEPerHit, 6, "hist logy");
237  PlotSpectra(&pFD_DistTop4, sCS_DistTop4, calc, rootF, textF, "DistTop", labelTop, 6, "hist logy");
238 
239  PlotSpectra(&pNM1_VertexX, sNM1_VertexX, calc, rootF, textF, "NM1VtxX", labelVtxX, 6, "hist");
240  PlotSpectra(&pNM1_VertexY, sNM1_VertexY, calc, rootF, textF, "NM1VtxY", labelVtxY, 6, "hist");
241  PlotSpectra(&pNM1_VertexZ, sNM1_VertexZ, calc, rootF, textF, "NM1VtxZ", labelVtxZ, 6, "hist");
242  PlotSpectra(&pNM1_Contain, sNM1_Contain, calc, rootF, textF, "NM1Cont", labelCont, 6, "hist");
243  PlotSpectra(&pNM1_NHit, sNM1_NHit, calc, rootF, textF, "NM1NHit", labelHits, 6, "hist");
244  PlotSpectra(&pNM1_CVN, sNM1_CVN, calc, rootF, textF, "NM1CVN", labelCVN, 6, "hist");
245  PlotSpectra(&pNM1_LID, sNM1_LID, calc, rootF, textF, "NM1LID", labelLID, 6, "hist");
246  PlotSpectra(&pNM1_Rem, sNM1_Rem, calc, rootF, textF, "NM1Rem", labelRemID, 6, "hist");
247  PlotSpectra(&pNM1_NumucontPID, sNM1_NumucontPID, calc, rootF, textF, "NM1NumucontPID", labelNCP, 6, "hist");
248  PlotSpectra(&pNM1_PartPTP, sNM1_PartPTP, calc, rootF, textF, "NM1PartPTP", labelPTP, 6, "hist");
249  PlotSpectra(&pNM1_IsMu, sNM1_IsMu, calc, rootF, textF, "NM1IsMu", labelIsMuon, 6, "hist");
250  PlotSpectra(&pNM1_EperHit, sNM1_EperHit, calc, rootF, textF, "NM1EperHit", labelEPerHit, 6, "hist");
251  PlotSpectra(&pNM1_DistTop, sNM1_DistTop, calc, rootF, textF, "NM1DistTop", labelTop, 6, "hist");
252 
253  // Run the plotting functions!
254  MakeHBar(&pFD_Reco0, &sCS_Reco0,
255  &pFD_Reco1, &sCS_Reco1,
256  &pFD_Reco2, &sCS_Reco2,
257  &pFD_Reco3, &sCS_Reco3,
258  &pFD_Reco4, &sCS_Reco4,
259  &pFD_Reco5, &sCS_Reco5,
260  calc, 6.05e20, rootF);
261 
262  // Close the files
263  fclose(textF);
264  rootF->Close();
265 }
266 
267 //------------------------------------------------------------------------------
268 void MakeHBar(IPrediction* pred0, Spectrum* sCos0,
269  IPrediction* pred1, Spectrum* sCos1,
270  IPrediction* pred2, Spectrum* sCos2,
271  IPrediction* pred3, Spectrum* sCos3,
272  IPrediction* pred4, Spectrum* sCos4,
273  IPrediction* pred5, Spectrum* sCos5,
275  double scale, TDirectory* out)
276 {
277  if(!sCos0->POT()) {
278  sCos0->OverridePOT(sCos0->Livetime()*2.5e18);
279  }
280  if(!sCos1->POT()) {
281  sCos1->OverridePOT(sCos1->Livetime()*2.5e18);
282  }
283  if(!sCos2->POT()) {
284  sCos2->OverridePOT(sCos2->Livetime()*2.5e18);
285  }
286  if(!sCos3->POT()) {
287  sCos3->OverridePOT(sCos3->Livetime()*2.5e18);
288  }
289  if(!sCos4->POT()) {
290  sCos4->OverridePOT(sCos4->Livetime()*2.5e18);
291  }
292  if(!sCos5->POT()) {
293  sCos5->OverridePOT(sCos5->Livetime()*2.5e18);
294  }
295 
308 
309  double nNC0 = sNC0.Integral(scale);
310  double nCC0 = sCC0.Integral(scale);
311  double nCs0 = sCos0->Integral(scale);
312  double nNC1 = sNC1.Integral(scale);
313  double nCC1 = sCC1.Integral(scale);
314  double nCs1 = sCos1->Integral(scale);
315  double nNC2 = sNC2.Integral(scale);
316  double nCC2 = sCC2.Integral(scale);
317  double nCs2 = sCos2->Integral(scale);
318  double nNC3 = sNC3.Integral(scale);
319  double nCC3 = sCC3.Integral(scale);
320  double nCs3 = sCos3->Integral(scale);
321  double nNC4 = sNC4.Integral(scale);
322  double nCC4 = sCC4.Integral(scale);
323  double nCs4 = sCos4->Integral(scale);
324  double nNC5 = sNC5.Integral(scale);
325  double nCC5 = sCC5.Integral(scale);
326  double nCs5 = sCos5->Integral(scale);
327 
328  TH1D* hCos = new TH1D("hCos", ";;Events", 6, 0, 6);
329  hCos->SetBinContent(6, nCs0);
330  hCos->SetBinContent(5, nCs1);
331  hCos->SetBinContent(4, nCs2);
332  hCos->SetBinContent(3, nCs3);
333  hCos->SetBinContent(2, nCs4);
334  hCos->SetBinContent(1, nCs5);
335 
336  TH1D* hCCs = new TH1D("hCCs", ";;Events", 6, 0, 6);
337  hCCs->SetBinContent(6, nCC0);
338  hCCs->SetBinContent(5, nCC1);
339  hCCs->SetBinContent(4, nCC2);
340  hCCs->SetBinContent(3, nCC3);
341  hCCs->SetBinContent(2, nCC4);
342  hCCs->SetBinContent(1, nCC5);
343 
344  TH1D* hNCs = new TH1D("hNCs", ";;Events", 6, 0, 6);
345  hNCs->SetBinContent(6, nNC0);
346  hNCs->SetBinContent(5, nNC1);
347  hNCs->SetBinContent(4, nNC2);
348  hNCs->SetBinContent(3, nNC3);
349  hNCs->SetBinContent(2, nNC4);
350  hNCs->SetBinContent(1, nNC5);
351 
352  SetHBarOptions(hCos, 0.6, kOrange+7);
353  SetHBarOptions(hCCs, 0.3, kGray+1);
355 
356  TLegend* leg = new TLegend(0.5, 0.3, 0.75, 0.45);
357  SetLegendOptions(leg);
358  leg->AddEntry(hCos, "Cosmic Background", "lf");
359  leg->AddEntry(hCCs, "CC Background", "lf");
360  leg->AddEntry(hNCs, "NC 3 Flavor Prediction", "lf");
361 
362  TCanvas* c = new TCanvas("CosRejHBar", "CosRejHBar", 500, 500);
363  gPad->SetFillStyle(0);
364  c->SetLeftMargin(0.2);
365  c->SetLogx();
366  hCos->Draw("hbar");
367  hCCs->Draw("hbar same");
368  hNCs->Draw("hbar same");
369  leg->Draw();
370  Preliminary();
371  c->RedrawAxis();
372 
373  out->WriteTObject(c);
374 }
375 
376 //------------------------------------------------------------------------------
377 void SetHBarOptions(TH1* h, double offset, Color_t col)
378 {
379  CenterTitles(h);
380 
381  h->SetBarWidth(0.3);
382  h->SetBarOffset(0.05 + offset);
383 
384  h->GetXaxis()->SetBinLabel(6, "Data Quality");
385  h->GetXaxis()->SetBinLabel(5, "Event Quality");
386  h->GetXaxis()->SetBinLabel(4, "Fiducial");
387  h->GetXaxis()->SetBinLabel(3, "Containment");
388  h->GetXaxis()->SetBinLabel(2, "NC Selection");
389  h->GetXaxis()->SetBinLabel(1, "Cosmic Rejection");
390 
391  h->SetLineColor(col);
392  h->SetLineWidth(0);
393  FillWithDimColor(h);
394  h->SetLineColor(h->GetFillColor());
395 }
osc::OscCalculatorDumb calc
Oscillation analysis framework, runs over CAF files outside of ART.
osc::IOscCalculatorAdjustable * DefaultOscCalc()
Create a new calculator with default assumptions for all parameters.
Definition: Calcs.cxx:49
General interface to oscillation calculators.
Definition: FwdDeclare.h:15
virtual Spectrum PredictComponent(osc::IOscCalculator *calc, Flavors::Flavors_t flav, Current::Current_t curr, Sign::Sign_t sign) const =0
void OverridePOT(double newpot)
DO NOT USE UNLESS YOU ARE 110% CERTAIN THERE ISN'T A BETTER WAY!
Definition: Spectrum.h:269
static std::unique_ptr< PredictionNoExtrap > LoadFrom(TDirectory *dir)
void CenterTitles(TH1 *histo)
Definition: Plots.cxx:1128
double Integral(double exposure, double *err=0, EExposureType expotype=kPOT) const
Return total number of events scaled to pot.
Definition: Spectrum.cxx:742
static std::unique_ptr< ProportionalDecomp > LoadFrom(TDirectory *dir)
void FillWithDimColor(TH1 *h, bool usealpha)
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:37
fclose(fg1)
Double_t scale
Definition: plot.C:25
Charged-current interactions.
Definition: IPrediction.h:39
void SetHBarOptions(TH1 *h, double offset, Color_t color)
Definition: CutTableAna.C:377
General interface to any calculator that lets you set the parameters.
Int_t col[ntarg]
Definition: Style.C:29
double POT() const
Definition: Spectrum.h:263
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void SetLegendOptions(TLegend *leg)
Set common options for a TLegend.
Splits Data proportionally according to MC.
Neutral-current interactions.
Definition: IPrediction.h:40
void MakeHBar(IPrediction *pred0, Spectrum *sCos0, IPrediction *pred1, Spectrum *sCos1, IPrediction *pred2, Spectrum *sCos2, IPrediction *pred3, Spectrum *sCos3, IPrediction *pred4, Spectrum *sCos4, IPrediction *pred5, Spectrum *sCos5, osc::IOscCalculator *calc, double scale, TDirectory *out)
Definition: CutTableAna.C:268
Both neutrinos and antineutrinos.
Definition: IPrediction.h:52
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
Take the output of an extrapolation and oscillate it as required.
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir)
Definition: Spectrum.cxx:1055
All neutrinos, any flavor.
Definition: IPrediction.h:26
void PlotSpectra(Spectrum spectra[], TDirectory *rootOut, FILE *textOFS, std::string name, std::string title, std::string det, int POT, std::string option)
const Color_t kNCBackgroundColor
Definition: Style.h:22
double Livetime() const
Seconds. For informational purposes only. No calculations use this.
Definition: Spectrum.h:266
void Preliminary()
void CutTableAna()
Definition: CutTableAna.C:28
h
Definition: demo3.py:41