ValidatePredictions.C
Go to the documentation of this file.
1 /// ValidatePredictions by J. Hewes <jhewes15@fnal.gov>
2 // Draw spectra from interpolated predictions and confirm they look OK
3 
4 #include "CAFAna/Core/HistCache.h"
6 
7 using namespace ana;
8 
9 using std::vector;
10 using ana::covmx::Sample;
11 
13 
14  vector<Sample> samples = GetNumuSamples(); // This loads all numu samples, as defined in CAFana/Core/Sample.h
15 
16  // Get an oscillation calculator, and set oscillation parameters from the 2020 executive summary
17  auto calc = DefaultSterileCalc(4);
18  calc->SetDm(2, 7.53e-5);
19  calc->SetDm(3, 2.56e-3);
20  calc->SetDm(4, 0.);
21  calc->SetAngle(1, 2, 0.587);
22  calc->SetAngle(1, 3, 0.148);
23  calc->SetAngle(2, 3, 0.846);
24  calc->SetAngle(1, 4, 0.);
25  calc->SetAngle(2, 4, 0.);
26  calc->SetAngle(3, 4, 0.);
27  calc->SetDelta(1, 3, 0.);
28  calc->SetDelta(2, 4, 0.);
29 
30  // Draw spectra and save them to file
31  cout << "Creating output file" << endl;
32  TFile* fOut = TFile::Open("numu_spectra.root", "recreate");
33  for (Sample& s : samples) {
34  cout << "Processing spectrum for " << s.GetTag() << endl;
36  TH1D* h = s.GetPrediction()->Predict(calc).ToTH1(13.35e20);
37  fOut->WriteTObject(h, s.GetTag().c_str());
38  HistCache::Delete(h);
39  delete s.GetPrediction();
40  s.ResetPrediction();
41  }
42  delete fOut;
43 
44 }
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
void SetEverything(covmx::Sample &sample, bool systs=false, double res=0)
Definition: Utilities.h:588
std::vector< covmx::Sample > GetNumuSamples()
Definition: Utilities.h:138
void ValidatePredictions()
osc::OscCalcDumb calc
const XML_Char * s
Definition: expat.h:262
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
Definition: Calcs.cxx:97
OStream cout
Definition: OStream.cxx:6
Float_t e
Definition: plot.C:35