MakeNusPredictionSystsAna01.C
Go to the documentation of this file.
3 #include "CAFAna/Core/Loaders.h"
6 #include "NuXAna/Cuts/NusCuts.h"
10 #include "CAFAna/Extrap/ExtrapSterile.h"
16 #include "NuXAna/Systs/NusSysts.h"
18 #include "CAFAna/Vars/HistAxes.h"
19 #include "NuXAna/Vars/HistAxes.h"
21 
22 #include "OscLib/OscCalcSterile.h"
24 
25 using namespace ana;
26 
28 {
29  TH1::AddDirectory(0);
30 
31  // Set up some calculators:
32  // Set up oscillation calculator that uses default 3 flavor parameters
34 
35  // Set up paths to files for loading
36  Loaders load_p1p2e3b;
37 
43 
44  Loaders load_e3c;
45 
51 
52  load_p1p2e3b.SetSpillCut(kStandardSpillCuts);
54 
55 
56 
57  std::vector<const ISyst*> systs = getAllNusSysts();
58 
59  // Set up the sterile prediction
60  const SterileGenerator genNus_p1p2e3b(
64  );
65 
66  const SterileGenerator genNus_e3c(
70  );
71 
72  PredictionInterp predI_p1p2e3b(systs, calc3f, genNus_p1p2e3b, load_p1p2e3b);
73  PredictionInterp predI_e3c(systs, calc3f, genNus_e3c, load_e3c);
74 
75  // Fill the spectra!
76  load_p1p2e3b.Go();
77  load_e3c.Go();
78 
79 
80  // Set up output filename
81  TFile* rootF = new TFile(outfile.c_str(), "RECREATE");
82 
83  TDirectory* tmp = gDirectory;
84  TDirectory* saveDir = gDirectory;
85 
86  // Save all of the objects
87  saveDir = rootF->mkdir("nus_pred_p1p2e3b");
88  predI_p1p2e3b.SaveTo(saveDir);
89 
90  saveDir = rootF->mkdir("nus_pred_e3c");
91  predI_e3c.SaveTo(saveDir);
92 
93  tmp->cd();
94  rootF->Close(); // Close the file
95 }
Near Detector underground.
Definition: SREnums.h:10
Implements systematic errors by interpolation between shifted templates.
Far Detector at Ash River.
Definition: SREnums.h:11
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const Cut kNusFD
Definition: NusCuts.h:46
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
Adapt the PMNS_Sterile calculator to standard interface.
const std::vector< std::string > fFDMC_non
Float_t tmp
Definition: plot.C:36
Generates extrapolated NC predictions using ProportionalDecomp.
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
const std::string fnamenear_concat
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
virtual void SaveTo(TDirectory *dir, const std::string &name) const override
osc::OscCalcSterile * DefaultSterileCalc(int nflavors)
Create a sterile calculator with default assumptions for all parameters.
Definition: Calcs.cxx:97
std::vector< const ISyst * > getAllNusSysts()
Get a vector of all the nus group systs.
Definition: NusSysts.cxx:202
const std::string fnameneardata_concat
const std::vector< std::string > fFDMC_swp
const std::string fFDMC_non_3c
const Cut kNumuND
Definition: NumuCuts.h:55
const HistAxis kNCAxis("Calorimetric Energy (GeV)", kNCDisappearanceEnergyBinning, kCaloE)
Axes used in Ana01 analysis by nus group.
Definition: HistAxes.h:8
const SystShifts kNoShift
Definition: SystShifts.cxx:21
void SetLoaderFiles(const std::vector< std::string > &files, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via explicit file list.
Definition: Loaders.cxx:45
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
const std::string fFDMC_tau_3c
const HistAxis kNCBinsNumuCCAxis("Reconstructed Neutrino Energy (GeV)", kNCDisappearanceEnergyBinning, kCCE)
Definition: HistAxes.h:9
const Var kTuftsWeightCC
Definition: XsecTunes.h:31
const std::vector< std::string > fFDMC_tau
const std::string fFDMC_swp_3c
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Definition: Loaders.cxx:25
const Cut kNusND
Definition: NusCuts.h:71
void MakeNusPredictionSystsAna01(std::string outfile)
FILE * outfile
Definition: dump_event.C:13