23 #include "NuXana/Prediction/FDPredictionSterile.h" 36 using std::ostringstream;
58 vector<pair<string, bool>> loaderOpts
59 = { {
"fullcaf",
false}, {
"concat",
true} };
60 bool concat = ParseOption<bool>(loaderOpts,
opt,
true);
63 vector<pair<string, string>> systOpts
64 = { {
"nosysts",
"nosysts"}, {
"filesysts",
"file"}, {
"xsecsysts",
"xsec"},
67 string systType = ParseOption<string>(systOpts,
opt,
"nosysts");
74 vector<const ISyst*>
systs;
75 if (systType ==
"file" || systType ==
"all") {
76 vector<const ISyst*> fileSysts = systFile ==
"default" ?
79 systs.insert(
end(systs), begin(fileSysts),
end(fileSysts));
81 if (systType ==
"xsec" || systType ==
"all") {
83 systs.insert(
end(systs), begin(xsecSysts),
end(xsecSysts));
105 if (sample.detector ==
covmx::kNearDet) gen =
new NDPredictionNoOscGenerator(*sample.GetAxis(), *sample.GetCut(),
kNoShift, kReweight);
109 if (systs.size() > 0) {
115 ostringstream outFileName;
116 outFileName <<
"pred_" << sample.GetTag();
117 if (res!=0) outFileName <<
"_res" << (
int)res;
118 outFileName <<
".root";
119 TFile*
outFile = TFile::Open(outFileName.str().c_str(),
"recreate");
122 ostringstream dirname;
123 dirname <<
"pred_" << sample.GetTag();
124 pred->SaveTo(outFile->mkdir(dirname.str().c_str()));
128 dirname <<
"pred_interp_" << sample.GetTag();;
129 predInterp->
SaveTo(outFile->mkdir(dirname.str().c_str()));
132 cout <<
endl <<
"Exception occurred! " << e.what() <<
endl;
void MakePredictionNoOsc_FHC_FD(TString opt, string systFile="default", double res=0)
Implements systematic errors by interpolation between shifted templates.
Cuts and Vars for the 2020 FD DiF Study.
Adapt the PMNS_Sterile calculator to standard interface.
::xsd::cxx::tree::exception< char > exception
void SetCut(covmx::Sample &sample)
std::string pnfs2xrootd(std::string loc, bool unauth)
covmx::Sample GetSampleFromOptString(TString optString)
Function to take an option TString and return a single associated covmx::Sample.
void Go()
Call Go() on all the loaders.
void SetAxis(TH1 *h, bool visible, int color, int style=1, bool scale=true)
std::vector< const ISyst * > getAllXsecSysts_2020()
void SetSpillCut(const SpillCut &cut)
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.
For nominal spectra and reweighting systs (xsec/flux)
const SystShifts kNoShift
vector< const ISyst * > LoadSystsFromFile(string filePath, string dirName)
Standard interface to all prediction techniques.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
Given loaders and an MC shift, Generate() generates an IPrediction.
Prevent histograms being added to the current directory.