NDDataMCSystBandAna.C
Go to the documentation of this file.
1 // Macro to plot ND Data/MC spectra with systematic error band
2 // To properly include NusFlatSysts (MC Stat, Norm, ND Cont),
3 // comment out the line in NusSysts.cxx, NusFlatSyst::Shift
4 // that only shifts the FD
5 
7 #include "CAFAna/Core/Spectrum.h"
10 #include "CAFAna/Systs/Systs.h"
11 #include "CAFAna/Vars/HistAxes.h"
13 
14 #include "TCanvas.h"
15 #include "TFile.h"
16 #include "TGraphAsymmErrors.h"
17 #include "TH1.h"
18 #include "TLegend.h"
19 #include "TStyle.h"
20 
21 #include <iostream>
22 #include <string>
23 #include <vector>
24 
25 using namespace ana;
26 
27 TLatex* DrawPOTLine(double x, double y, double pot);
28 
29 void PlotSyst(const Spectrum& nom, const Spectrum& dat,
30  const CheatDecomp& decomp,
31  const std::vector<Spectrum>& upShifts,
32  const std::vector<Spectrum>& downShifts,
33  TDirectory* out, FILE* text, strings strs);
34 
36 {
37  TH1::AddDirectory(0);
38 
39  std::string labelHits = "Number of Hits";
40 
41  // Create vector of systematics
42  std::vector<const ISyst*> systs;
43  systs.push_back(&kNusNDBeamSysts);
44  systs.push_back(&kNusNDBirksSyst);
45  systs.push_back(&kNusNDCalibFlatSyst);
46  systs.push_back(&kNusNDCalibSlopeXSyst);
47  systs.push_back(&kNusNDCalibSlopeYSyst);
48  systs.push_back(&kNusNDGENIESmallSysts);
49  systs.push_back(&kNusNDNDRockSyst);
50  systs.push_back(&kNusNDNueCCSyst);
51  systs.push_back(&kNusNDNumuCCSyst);
52  systs.push_back(&kNusMCStatsSyst);
53  systs.push_back(&kNusNDContSyst);
54  systs.push_back(&kNusNormSyst);
55 
56  std::string folder = "/nova/ana/steriles/Ana01/";
57  std::string filenm = "NDDataMCSystBand";
58 
59  std::string loadLocation = folder + filenm + ".root";
60  std::string saveLocation = folder + filenm + "Ana.root";
61  std::string textLocation = folder + filenm + "Ana.txt";
62 
63  // Load the CAFAna objects from file
64  TFile* rootL = new TFile(loadLocation.c_str(), "READ"); // No overwrite allowed
65  TDirectory* tmpL = gDirectory;
66  TDirectory* loadDir = gDirectory;
67 
68  loadDir->cd((loadLocation + ":/sMCCalE").c_str());
69  Spectrum sMCCalE = *Spectrum::LoadFrom(gDirectory);
70  loadDir->cd((loadLocation + ":/sDtCalE").c_str());
71  Spectrum sDtCalE = *Spectrum::LoadFrom(gDirectory);
72  loadDir->cd((loadLocation + ":/dcCalE").c_str());
73  CheatDecomp dcCalE = *CheatDecomp::LoadFrom(gDirectory);
74  loadDir->cd((loadLocation + ":/sMCNHit").c_str());
75  Spectrum sMCNHit = *Spectrum::LoadFrom(gDirectory);
76  loadDir->cd((loadLocation + ":/sDtNHit").c_str());
77  Spectrum sDtNHit = *Spectrum::LoadFrom(gDirectory);
78  loadDir->cd((loadLocation + ":/dcNHit").c_str());
79  CheatDecomp dcNHit = *CheatDecomp::LoadFrom(gDirectory);
80 
81  // Declare vectors for shifted spectra
82  std::vector<Spectrum> upsCalE, dnsCalE;
83  std::vector<Spectrum> upsNHit, dnsNHit;
84 
85  // These are important... without this the entire vector gets copied when
86  // resized and triggers an assertion in the Spectrum copy constructor
87  upsCalE.reserve(systs.size());
88  dnsCalE.reserve(systs.size());
89  upsNHit.reserve(systs.size());
90  dnsNHit.reserve(systs.size());
91 
92  // Set up the shifted spectra
93  for(const ISyst* syst : systs)
94  {
95  loadDir->cd((loadLocation + ":/sUpCalE" + syst->ShortName()).c_str());
96  upsCalE.emplace_back(*Spectrum::LoadFrom(gDirectory));
97  loadDir->cd((loadLocation + ":/sDnCalE" + syst->ShortName()).c_str());
98  dnsCalE.emplace_back(*Spectrum::LoadFrom(gDirectory));
99  loadDir->cd((loadLocation + ":/sUpNHit" + syst->ShortName()).c_str());
100  upsNHit.emplace_back(*Spectrum::LoadFrom(gDirectory));
101  loadDir->cd((loadLocation + ":/sDnNHit" + syst->ShortName()).c_str());
102  dnsNHit.emplace_back(*Spectrum::LoadFrom(gDirectory));
103  }
104 
105  tmpL->cd();
106  rootL->Close(); // Don't forget to close this file!
107 
108  TFile* rootF = new TFile(saveLocation.c_str(), "RECREATE");
109  FILE* textF;
110  textF = fopen(textLocation.c_str(), "w");
111  fprintf(textF, "ND Systematics\n\n");
112 
113  strings strs;
114  strs.fComponent = "";
115  strs.fDet = "ND";
116  strs.fPOT = "";
117  strs.fSample = "";
118  strs.fSystType = "";
119 
120  strs.fSystS = "All";
121  strs.fSystL = "All";
122 
123  sDtCalE = sDtCalE.FakeData(3.72e20);
124  sDtNHit = sDtNHit.FakeData(3.72e20);
125 
126  // Plot full syst bands
127  strs.fComponent = "CalE";
128  strs.fXLabel = "Calorimetric Energy (GeV)";
129  PlotSyst(sMCCalE, sDtCalE, dcCalE, upsCalE, dnsCalE, rootF, textF, strs);
130 
131  strs.fComponent = "NHit";
132  strs.fXLabel = "Number of Hits";
133  PlotSyst(sMCNHit, sDtNHit, dcNHit, upsNHit, dnsNHit, rootF, textF, strs);
134 
135  // Plot individual systematics
136  for(unsigned int i = 0, n = systs.size(); i < n; ++i) {
137  strs.fSystS = systs[i]->ShortName();
138  strs.fSystL = systs[i]->LatexName();
139 
140  strs.fComponent = "CalE";
141  strs.fXLabel = "Calorimetric Energy (GeV)";
142  PlotSyst(sMCCalE, sDtCalE, dcCalE, {upsCalE[i]}, {dnsCalE[i]}, rootF, textF, strs);
143  strs.fComponent = "NHit";
144  strs.fXLabel = "Number of Hits";
145  PlotSyst(sMCNHit, sDtNHit, dcNHit, {upsNHit[i]}, {dnsNHit[i]}, rootF, textF, strs);
146  }
147 
148  fclose(textF);
149  rootF->Close();
150 }
151 
152 
153 //----------------------------------------------------------------------
154 /// Draw common TLatex lines
155 TLatex* DrawPOTLine(double x, double y, double pot)
156 {
157  TLatex *tex = new TLatex();
158  tex->SetNDC();
159  tex->SetTextFont(42);
160  tex->SetTextSize(0.037);
161  tex->SetTextAlign(11);
162 
163  char potBuf[64];
164  sprintf(potBuf, "%4.2f", pot/1e20);
165  std::string sPOT = std::string(potBuf);
166  std::string potStr = sPOT + " #times 10^{20} POT";
167 
168  tex->DrawLatex(x, y, potStr.c_str());
169 
170  return tex;
171 }
172 
173 //----------------------------------------------------------------------
174 void PlotSyst(const Spectrum& nom, const Spectrum& dat,
175  const CheatDecomp& decomp,
176  const std::vector<Spectrum>& upShifts,
177  const std::vector<Spectrum>& downShifts,
178  TDirectory* out, FILE* text, strings strs)
179 {
180  // Scale everything to data POT
181  double scale = dat.POT();
182  double mcpot = nom.POT();
183 
184  // Get nominal histograms
185  TH1* hmc = nom.ToTH1(scale);
186  TH1* hdt = dat.ToTH1(scale);
187 
188  Spectrum snc = decomp.NCTotalComponent();
189  Spectrum sne = decomp.NueComponent() + decomp.AntiNueComponent();
190  Spectrum snm = decomp.NumuComponent() + decomp.AntiNumuComponent();
191  TH1* hnc = snc.ToTH1(scale);
192  TH1* hne = sne.ToTH1(scale);
193  TH1* hnm = snm.ToTH1(scale);
194 
195  // Set up vectors of shifted histograms
196  std::vector<TH1*> ups, dns;
197  for(const auto& upShift:upShifts) ups.push_back(upShift.ToTH1(scale));
198  for(const auto& downShift:downShifts) dns.push_back(downShift.ToTH1(scale));
199 
200  // Make configurable in future.
201  const std::string sPOT = "3.72";
202  // Construct histogram names and titles
203  std::string xlabel = strs.fXLabel;
204  std::string potStr = sPOT + " #times 10^{20} POT";
205  std::string ylabel = "10^{3} Events";
206  if(xlabel.find("Energy") != std::string::npos) { ylabel += " / 0.25 GeV"; }
207  ylabel += " / "+potStr;
208  std::string title = strs.fDet + " " + strs.fComponent +
209  " Error for " + strs.fSystL + " Systematic";
210 // std::string fullTitle = title + ";" + xlabel + ";" + ylabel;
211  std::string fullTitle = ";" + xlabel + ";" + ylabel;
212  std::string name = "c" + strs.fComponent + strs.fDet + strs.fSystS;
213  std::string ylabelRat = "Ratio to Nominal MC";
214  std::string fullTitleRat = ";" + xlabel + ";" + ylabelRat;
215 
216  fprintf(text, "%s\n", strs.fSystL.c_str());
217 
218  double tot_events = 0.;
219  double up_events = 0.;
220  double dn_events = 0.;
221 
222  // Variables for setting axis ranges
223  double maxval = 0.;
224  double maxvalRat = 0.;
225  double minvalRat = 1.;
226 
227  // Set up histograms for ratio canvas
228  TH1* hDtRat = (TH1*)hdt->Clone();
229  hDtRat->Divide(hmc);
230  TH1* hMCRat = (TH1*)hmc->Clone();
231 
232  // Set up objects for containing the MC errors
233  TGraphAsymmErrors* gmc = new TGraphAsymmErrors;
234  TGraphAsymmErrors* gMCRat = new TGraphAsymmErrors;
235  TGraphAsymmErrors* gFullErr = new TGraphAsymmErrors;
236 
237  // Loop over bins, don't include under/overflow bins
238  for(int i_bin = 1, n_bin = hmc->GetNbinsX(); i_bin <= n_bin; ++i_bin) {
239  double valmc = hmc->GetBinContent(i_bin)/1000.;
240  double valdt = hdt->GetBinContent(i_bin)/1000.;
241  tot_events += valmc;
242 
243  const double w = hmc->GetXaxis()->GetBinWidth(i_bin);
244  double errUp = 0.;
245  double errDn = 0.;
246  double errSt = 0.;
247 
248  // Set the bin values
249  hMCRat->SetBinContent(i_bin, 1.);
250  gmc ->SetPoint(i_bin, hmc->GetXaxis()->GetBinCenter(i_bin), valmc);
251  gFullErr->SetPoint(i_bin, hmc->GetXaxis()->GetBinCenter(i_bin), valmc);
252  gMCRat ->SetPoint(i_bin, hmc->GetXaxis()->GetBinCenter(i_bin), 1.);
253 
254  for(unsigned int i_syst = 0; i_syst < ups.size(); ++i_syst) {
255  double hi = ups[i_syst]->GetBinContent(i_bin)/1000. - valmc;
256  double lo = dns[i_syst]->GetBinContent(i_bin)/1000. - valmc; // This should be negative!
257 
258  // Correct values under a few "error" conditions
259  if(hi < 0. && lo > 0.) {
260  std::swap(lo, hi);
261  }
262  if(hi < 0.) {
263  lo = std::min(lo, hi);
264  hi = 0.;
265  }
266  if(lo > 0.) {
267  hi = std::max(lo, hi);
268  lo = 0.;
269  }
270 
271  errUp += hi*hi;
272  errDn += lo*lo;
273  } // End loop over systs
274 
275  errUp = sqrt(errUp);
276  errDn = sqrt(errDn);
277 
278  errSt += sqrt(hnc->GetBinContent(i_bin));
279  errSt += sqrt(hne->GetBinContent(i_bin));
280  errSt += sqrt(hnm->GetBinContent(i_bin));
281  errSt *= sqrt(scale/mcpot)/1000.;
282 
283  up_events += errUp;
284  dn_events += errDn;
285 
286  // Calculate a few quantities and protect against Inf/NaN
287  double errUpPct = ( (valmc > 0.) ? errUp/valmc : 0. );
288  double errDnPct = ( (valmc > 0.) ? errDn/valmc : 0. );
289  double errData = sqrt(valdt*1000.);
290  double errDataPct = ( (valdt > 0.) ? errData/(valdt*1000.) : 0. );
291  double dtrat = ( (valmc > 0.) ? valdt/valmc : 1. );
292  errData /= 1000.;
293 
294  hmc->SetBinContent(i_bin, valmc);
295  hdt->SetBinContent(i_bin, valdt);
296  hnc->SetBinContent(i_bin, hnc->GetBinContent(i_bin)/1000.);
297  hne->SetBinContent(i_bin, hne->GetBinContent(i_bin)/1000.);
298  hnm->SetBinContent(i_bin, hnm->GetBinContent(i_bin)/1000.);
299 
300  // Set bin errors
301  hdt ->SetBinError(i_bin, errData/1000.);
302  hDtRat->SetBinError(i_bin, errDataPct);
303 
304  gmc ->SetPointError(i_bin, w/2, w/2, errDn, errUp);
305  gMCRat ->SetPointError(i_bin, w/2, w/2, errDnPct, errUpPct);
306  gFullErr->SetPointError(i_bin, w/2, w/2, errDn + errSt, errUp + errSt);
307 
308  // Calculate maximum values for axis ranges
309  maxval = std::max(maxval, valmc + errUp + errSt);
310  maxval = std::max(maxval, valdt + errData);
311 
312  maxvalRat = std::max(maxvalRat, 1. + errUpPct);
313  maxvalRat = std::max(maxvalRat, dtrat + errDataPct);
314 
315  minvalRat = std::min(minvalRat, 1. - errDn/valmc);
316  minvalRat = std::min(minvalRat, dtrat - errDataPct);
317  } // End loop over bins
318 
319  minvalRat = 1. - std::abs(1. - minvalRat);
320  maxvalRat = 1. + std::abs(1. - maxvalRat);
321 
322  SetHistOptions(hmc, maxval, fullTitle, -404, kTotalMCColor, false);
323  gmc->SetFillColor(kTotalMCErrorBandColor);
324  gmc->SetLineColor(kTotalMCColor);
325  gmc->SetLineWidth(2);
326  gFullErr->SetFillColor(kTotalMCErrorBandColor);
327  gFullErr->SetLineColor(kTotalMCColor);
328  gFullErr->SetLineWidth(2);
329 
330  CenterTitles(hMCRat);
331  hMCRat->SetLineColor(kTotalMCColor);
332  hMCRat->SetMaximum(1.05*maxvalRat);
333  hMCRat->SetMinimum(0.95*minvalRat);
334  hMCRat->SetTitle(fullTitleRat.c_str());
335  gMCRat->SetFillColor(kTotalMCErrorBandColor);
336  gMCRat->SetLineColor(kTotalMCColor);
337  gMCRat->SetLineWidth(2);
338 
339  SetHistOptions(hdt, maxval, fullTitle, -404, kBlack, false);
340  hdt->SetMarkerStyle(kFullCircle);
341 
342  SetHistOptions(hnc, maxval, fullTitle, -404, kAzure+2, false);
343  SetHistOptions(hne, maxval, fullTitle, -404, kBeamNueBackgroundColor, false);
344  SetHistOptions(hnm, maxval, fullTitle, -404, kNumuBackgroundColor, false);
345 
346  CenterTitles(hDtRat);
347  hDtRat->SetLineColor(kBlack);
348  hDtRat->SetMaximum(1.05*maxvalRat);
349  hDtRat->SetMinimum(0.95*minvalRat);
350  hDtRat->SetTitle(fullTitleRat.c_str());
351 
352  double xL = 0.55, xR = 0.8;
353  double yB = 0.6, yT = 0.85;
354  TLegend* leg = new TLegend(xL, yB, xR, yT);
355  SetLegendOptions(leg);
356  leg->AddEntry(hdt, "ND Data", "lep");
357  leg->AddEntry(gmc, "Total MC Prediction", "lf");
358  leg->SetY1(leg->GetY2() - leg->GetNRows()*0.05);
359 
360  // Plot Data/MC, just spectrum
361  TCanvas* cNoRat = new TCanvas(name.c_str(), title.c_str(), 800, 500);
362  gPad->SetFillStyle(0);
363  hmc->Draw("hist ][");
364  gmc->Draw("e2 same");
365  hmc->Draw("hist ][ same");
366  hdt->Draw("same");
367  leg->Draw();
368  //DrawPOTLine(xL + 0.01, leg->GetY1() - 0.045, scale);
369  cNoRat->RedrawAxis();
370 
371  Preliminary();
372  out->WriteTObject(cNoRat);
373 
374  // Plot Data/MC, just spectrum, add individual components
375  TLegend* legAll = new TLegend(xL, yB, xR, yT);
376  SetLegendOptions(legAll);
377  legAll->AddEntry(hdt, "ND Data", "lep");
378  legAll->AddEntry(gmc, "Total Prediction", "lf");
379  legAll->AddEntry(hnc, "NC Prediction", "l");
380  legAll->AddEntry(hne, "#nu_{e} CC Background", "l");
381  legAll->AddEntry(hnm, "#nu_{#mu} CC Background", "l");
382  legAll->SetY1(legAll->GetY2() - legAll->GetNRows()*0.05);
383 
384  TCanvas* cAllMC = new TCanvas((name + "DC").c_str(), (title + "DC").c_str(), 800, 500);
385  gPad->SetFillStyle(0);
386  hmc->Draw("hist ][");
387  gmc->Draw("e2 same");
388  hmc->Draw("hist ][ same");
389  hnc->Draw("hist same");
390  hne->Draw("hist same");
391  hnm->Draw("hist same");
392  hdt->Draw("same");
393  legAll->Draw();
394  //DrawPOTLine(xL + 0.01, legAll->GetY1() - 0.045, scale);
395  cAllMC->RedrawAxis();
396 
397  Preliminary();
398  out->WriteTObject(cAllMC);
399 
400  // Plot Data/MC, just spectrum, add individual components, Stat and Systs
401  // There's probably a better way to do this, but this hack works.
402  TLegend* leg1 = new TLegend(xL, yB, xR, yT);
403  SetLegendOptions(leg1);
404  leg1->AddEntry(hdt, "ND Data", "lep");
405  leg1->SetY1(leg1->GetY2() - leg1->GetNRows()*0.05);
406 
407  TLegend* leg2 = new TLegend(xL, yB, xR, leg1->GetY1() - 0.015);
408  SetLegendOptions(leg2);
409  leg2->AddEntry(gFullErr, "#splitline{Total Prediction}{Stat. and Syst. Uncert.}", "lf");
410  leg2->SetY1(leg2->GetY2() - leg2->GetNRows()*0.05);
411 
412  TLegend* leg3 = new TLegend(xL, yB, xR, leg2->GetY1() - 0.0175);
413  SetLegendOptions(leg3);
414  leg3->AddEntry(hnc, "NC Prediction", "l");
415  leg3->AddEntry(hne, "#nu_{e} CC Background", "l");
416  leg3->AddEntry(hnm, "#nu_{#mu} CC Background", "l");
417  leg3->SetY1(leg3->GetY2() - leg3->GetNRows()*0.05);
418 
419  TCanvas* cError = new TCanvas((name + "StSy").c_str(), (title + "StSy").c_str(), 800, 500);
420  gPad->SetFillStyle(0);
421  hmc->Draw("hist ][");
422  gFullErr->Draw("e2 same");
423  hmc->Draw("hist ][ same");
424  hnc->Draw("hist same");
425  hne->Draw("hist same");
426  hnm->Draw("hist same");
427  hdt->Draw("same");
428  leg1->Draw();
429  leg2->Draw();
430  leg3->Draw();
431  //DrawPOTLine(xL + 0.01, leg3->GetY1() - 0.045, scale);
432  cError->RedrawAxis();
433 
434  Preliminary();
435  out->WriteTObject(cError);
436 
437  // Plot Data/MC, spectrum and ratio together
438  TCanvas* c = new TCanvas((name + "Rat").c_str(), (title + " Ratio").c_str(), 800, 800);
439  gPad->SetFillStyle(0);
440  TPad* pSpecs = new TPad("pSpecs", "", 0., 0.375, 1., 1.);
441  TPad* pRatio = new TPad("pRatio", "", 0., 0., 1., 0.375);
442  pSpecs->Draw();
443  pRatio->Draw();
444 
445  pSpecs->cd();
446  hmc->Draw("hist ][");
447  gmc->Draw("e2 same");
448  hmc->Draw("hist ][ same");
449  hdt->Draw("same");
450  leg->Draw();
451  //DrawPOTLine(xL + 0.01, leg->GetY1() - 0.045, scale);
452  pSpecs->RedrawAxis();
453  Preliminary();
454 
455  pRatio->cd();
456  hMCRat->Draw("hist ][");
457  gMCRat->Draw("e2 same");
458  hMCRat->Draw("hist ][ same");
459  hDtRat->Draw("same");
460  pRatio->RedrawAxis();
461 
462  c->Update();
463  out->WriteTObject(c);
464 
465  fprintf(text, "Number of events: %6.2f, Error up: %6.2f, Error down: %6.2f\n",
466  tot_events*1000., up_events*1000., dn_events*1000.);
467  fprintf(text, "Percentage up: %4.2f%%, Percentage down: %4.2f%%",
468  100.*up_events/tot_events, 100.*dn_events/tot_events);
469  fprintf(text, "\n\n");
470 
471  return;
472 }
void SetHistOptions(TH1 *h, double max, std::string title, int ndiv, Color_t col, bool fill)
Set common options for a TLegend.
T max(const caf::Proxy< T > &a, T b)
const XML_Char * name
Definition: expat.h:151
TSpline3 lo("lo", xlo, ylo, 12,"0")
std::string fDet
Definition: PPFXHelper.h:104
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
std::string fComponent
Definition: PPFXHelper.h:103
const NusSystFromHist kNusNDBirksSyst(kNusAna01SystFile,"ND","NDBirks","Birks C")
Definition: NusSysts.h:81
Spectrum NCTotalComponent() const override
Definition: CheatDecomp.h:27
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:209
const NusFlatSyst kNusNDContSyst("ndcont","ND Containment", 1.0, 0.6)
Definition: NusSysts.h:92
T sqrt(T number)
Definition: d0nt_math.hpp:156
void PlotSyst(TH1 *h, TH1 *hp1, TH1 *hm1, TH1 *hp2, TH1 *hm2, TDirectory *out, FILE *text, strings strs)
Definition: PPFXHelper.h:662
TLegend * leg1
Definition: plot_hist.C:105
void CenterTitles(TH1 *histo)
Definition: Plots.cxx:1481
const NusSystFromHist kNusNDCalibSlopeYSyst(kNusAna01SystFile,"ND","NDCalSlopeY","Sloped Miscalibration, Y")
Definition: NusSysts.h:84
const Color_t kTotalMCErrorBandColor
Definition: Style.h:17
Encapsulate code to systematically shift a caf::SRProxy.
Definition: ISyst.h:14
const Color_t kNumuBackgroundColor
Definition: Style.h:30
float abs(float number)
Definition: d0nt_math.hpp:39
void NDDataMCSystBandAna()
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:33
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
const NusSystFromHist kNusNDNDRockSyst(kNusAna01SystFile,"ND","NDRock","ND Rock")
Definition: NusSysts.h:86
static std::unique_ptr< CheatDecomp > LoadFrom(TDirectory *dir, const std::string &name)
Definition: CheatDecomp.cxx:70
Spectrum NueComponent() const override
Definition: CheatDecomp.h:32
fclose(fg1)
const NusSystFromHist kNusNDCalibSlopeXSyst(kNusAna01SystFile,"ND","NDCalSlopeX","Sloped Miscalibration, X")
Definition: NusSysts.h:83
Double_t scale
Definition: plot.C:25
TSpline3 hi("hi", xhi, yhi, 18,"0")
Spectrum AntiNumuComponent() const override
Definition: CheatDecomp.h:33
static std::unique_ptr< Spectrum > LoadFrom(TDirectory *dir, const std::string &name)
Definition: Spectrum.cxx:607
Spectrum FakeData(double pot) const
Fake data is a MC spectrum scaled to the POT expected in the data.
Definition: Spectrum.cxx:402
const Color_t kBeamNueBackgroundColor
Definition: Style.h:24
std::string fSystL
Definition: PPFXHelper.h:109
#define pot
TLatex * DrawPOTLine(double x, double y, double pot)
Draw common TLatex lines.
Spectrum NumuComponent() const override
Definition: CheatDecomp.h:31
const NusFlatSyst kNusMCStatsSyst("mcstat","MC Stats", 2.0, 4.8)
Definition: NusSysts.h:91
std::string fPOT
Definition: PPFXHelper.h:105
double POT() const
Definition: Spectrum.h:231
void Preliminary()
std::string fXLabel
Definition: PPFXHelper.h:110
const NusSystFromHist kNusNDGENIESmallSysts(kNusAna01SystFile,"ND","NDGENIESm","Summed small GENIE Systs")
Definition: NusSysts.h:85
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void SetLegendOptions(TLegend *leg)
Set common options for a TLegend.
const NusFlatSyst kNusNormSyst("normNus","Normalization", 4.9, 4.9)
Definition: NusSysts.h:93
std::string fSystType
Definition: PPFXHelper.h:107
TLatex * tex
Definition: f2_nu.C:499
std::string fSystS
Definition: PPFXHelper.h:108
const Color_t kTotalMCColor
Definition: Style.h:16
const NusSystFromHist kNusNDNumuCCSyst(kNusAna01SystFile,"ND","NDNumuCC","#nu_{#mu} CC Background")
Definition: NusSysts.h:88
T min(const caf::Proxy< T > &a, T b)
Float_t w
Definition: plot.C:20
Just return the ND truth spectra as the decomposition.
Definition: CheatDecomp.h:10
const NusSystFromHist kNusNDBeamSysts(kNusAna01SystFile,"ND","NDBeam","All Beam")
Definition: NusSysts.h:80
A helper structure to contain a group of string for plotting.
Definition: PPFXHelper.h:101
const NusSystFromHist kNusNDCalibFlatSyst(kNusAna01SystFile,"ND","NDCalFlat","Flat Miscalibration")
Definition: NusSysts.h:82
std::string fSample
Definition: PPFXHelper.h:106
Spectrum AntiNueComponent() const override
Definition: CheatDecomp.h:34
const NusSystFromHist kNusNDNueCCSyst(kNusAna01SystFile,"ND","NDNueCC","#nu_{e} CC Background")
Definition: NusSysts.h:87