46 int startIdx=0,
int stopIdx=-1)
49 TString
filename =
"pred_xsec_fhc_" + suffix +
".root";
55 TString analysisName =
"pred_propDecomp";
59 std::cout <<
"[make_nue_xsec_pred] Found " << systs.size()
62 stopIdx = systs.size();
64 for (std::vector<const ISyst*>::iterator syst = systs.begin()+startIdx;
65 (syst != systs.begin()+stopIdx) && (syst != systs.end()); ++syst)
70 std::vector<int> sigmas = {-2, -1, 1, 2};
93 std::vector<HistDef>
hists;
105 hists.push_back({
"EnergyCVN2D",
106 {
"Nue Energy / Selection Bin",
110 std::vector<std::pair<IPrediction*, TString> >
predictions;
120 for (
auto hist:hists)
127 analysisName,
"Nominal", 0,
true,
hist.name,
weight.name);
132 auto predProp = extrapGen.Generate(loaders);
133 predictions.push_back({predProp.release(), path});
137 analysisName,
"Nominal", 0,
false,
hist.name,
weight.name);
141 auto predNoExtrap = noExtrapGen.Generate(loaders);
142 predictions.push_back({predNoExtrap.release(), path});
148 for (std::vector<const ISyst*>::iterator syst = systs.begin()+startIdx;
149 (syst != systs.begin()+stopIdx) && (syst != systs.end()); ++syst)
152 for (
auto sigma:sigmas)
156 for (
auto hist:hists)
169 auto predProp = extrapGen.Generate(loaders, shift);
170 predictions.push_back({predProp.release(), path});
178 auto predNoExtrap = noExtrapGen.Generate(loaders, shift);
179 predictions.push_back({predNoExtrap.release(), path});
189 std::vector<std::pair<IPrediction*, TString> >::iterator iPrediction =
194 for (
auto hist:hists)
202 analysisName,
"Nominal", 0,
true,
hist.name,
weight.name);
205 if (!path.EqualTo(iPrediction->second))
206 std::cout <<
"[make_nue_xsec_pred] WARNING: prediction path mismatch!" 215 analysisName,
"Nominal", 0,
false,
hist.name,
weight.name);
218 if (!path.EqualTo(iPrediction->second))
219 std::cout <<
"[make_nue_xsec_pred] WARNING: prediction path mismatch!" 229 for (std::vector<const ISyst*>::iterator syst = systs.begin()+startIdx;
230 (syst != systs.begin()+stopIdx) && (syst != systs.end()); ++syst)
233 for (
auto sigma:sigmas)
236 for (
auto hist:hists)
247 if (!path.EqualTo(iPrediction->second))
248 std::cout <<
"[make_nue_xsec_pred] WARNING: " 249 <<
"prediction path mismatch!" << std::endl;
252 (*syst)->ShortName(),
sigma,
261 if (!path.EqualTo(iPrediction->second))
262 std::cout <<
"[make_nue_xsec_pred] WARNING: " 263 <<
"prediction path mismatch!" << std::endl;
266 (*syst)->ShortName(),
sigma,
For nominal spectra and reweighting systs (xsec/flux)
Cuts and Vars for the 2020 FD DiF Study.
Simple record of shifts applied to systematic parameters.
const Cut kNue2017NDCVNSsb
const Binning kNue2017Binning
unsigned distance(const T &t1, const T &t2)
void Go()
Call Go() on all the loaders.
void WritePrediction(const IPrediction *prediction, const TString &analysisName, const TString &systName, const int &sigma, const bool &extrap=true, const TString &energyVar="EnergyCVN2D", const TString &weight="kXSecCVWgt2017")
void make_nue_xsec_pred(TString suffix="test", bool useConcat=true, int startIdx=0, int stopIdx=-1)
const SystShifts kNoShift
const Var kNue2017AnaBin([](const caf::SRProxy *sr){int selBin=kNue2017SelectionBin(sr);float nuE=kNueEnergy2017(sr);int nuEBin=nuE/0.5;assert(nuEBin<=8 &&"An event with nuE > 4.5 should never happen");int anaBin=9 *selBin+nuEBin;return anaBin;})
const TString ReadPrediction(const TString &analysisName, const TString &systName, const int &sigma, const bool &extrap=true, const TString &energyVar="EnergyCVN2D", const TString &weight="kXSecCVWgt2017")
Template for Var and SpillVar.
std::vector< const ISyst * > getAllXsecSysts_2017()
Get master XSec syst list for 2017 analyses.
const Cut kNue2017FDAllSamples
Our FD selection including all samples, for making predictions, etc.