52 if (opt.Contains(
"caf", TString::kIgnoreCase))
54 else if (opt.Contains(
"concat", TString::kIgnoreCase))
60 if (opt.Contains(
"fhc", TString::kIgnoreCase))
62 else if (opt.Contains(
"rhc", TString::kIgnoreCase))
68 if (opt.Contains(
"extrap", TString::kIgnoreCase))
72 bool genie_nd =
true, genie_fd =
true;
73 bool genie_nova =
true, genie_general =
true;
74 if (opt.Contains(
"nd", TString::kIgnoreCase) and
75 !opt.Contains(
"fd", TString::kIgnoreCase))
77 if (opt.Contains(
"fd", TString::kIgnoreCase) and
78 !opt.Contains(
"nd", TString::kIgnoreCase))
80 if (opt.Contains(
"NoPred", TString::kIgnoreCase)) {
84 if (opt.Contains(
"1", TString::kIgnoreCase) and
85 !opt.Contains(
"2", TString::kIgnoreCase))
86 genie_general =
false;
87 if (opt.Contains(
"2", TString::kIgnoreCase) and
88 !opt.Contains(
"1", TString::kIgnoreCase))
96 std::vector<int> sigmas{-2, -1, +1, +2};
99 std::map<std::string, rwgt::ReweightLabel_t> genieLabels;
104 std::map<std::string, const ISyst*> xsecLabels;
109 std::map<std::string, std::map<int, SystShifts*> > systematics;
112 for (
const auto&
sigma : sigmas) {
113 for (
const auto& genieLabel : genieLabels)
115 for (
const auto& xsecLabel : xsecLabels)
122 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
128 std::map<std::string, NDPredictionSterile*> predsND_nominal;
129 std::map<std::string, FDPredictionSterile*> predsFD_nominal;
130 std::map<std::string, PredictionSterile*> predsExtrap_nominal;
131 std::map<std::string, std::map<std::string, std::map<int, NDPredictionSterile*> > > predsND_shifted;
132 std::map<std::string, std::map<std::string, std::map<int, FDPredictionSterile*> > > predsFD_shifted;
133 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsExtrap_shifted;
142 for(
const auto& sample : cut_samples) {
149 *sample.second.second.second, *sample.second.second.first,
163 for (
const auto& systLabel : systematics) {
164 for (
const auto& syst : systLabel.second) {
166 predsND_shifted[sample.first][systLabel.first][syst.first]
169 predsFD_shifted[sample.first][systLabel.first][syst.first]
172 predsExtrap_shifted[sample.first][systLabel.first][syst.first]
187 std::string fullLocation = folder + filenm +
".root";
188 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
190 SaveMaps(rootF, predsND_nominal, predsND_shifted);
192 SaveMaps(rootF, predsFD_nominal, predsFD_shifted);
194 SaveMaps(rootF, predsExtrap_nominal, predsExtrap_shifted);
208 std::map<std::string, rwgt::ReweightLabel_t> shiftlabels;
211 shiftlabels[
"ReweightMaNCEL"] = rwgt::fReweightMaNCEL;
213 shiftlabels[
"ReweightEtaNCEL"] = rwgt::fReweightEtaNCEL;
217 shiftlabels[
"ReweightVecCCQEshape"] = rwgt::fReweightVecCCQEshape;
219 shiftlabels[
"ReweightMaCCRES"] = rwgt::fReweightMaCCRES;
221 shiftlabels[
"ReweightMvCCRES"] = rwgt::fReweightMvCCRES;
223 shiftlabels[
"ReweightMaNCRES"] = rwgt::fReweightMaNCRES;
225 shiftlabels[
"ReweightMvNCRES"] = rwgt::fReweightMvNCRES;
229 shiftlabels[
"ReweightMaCOHpi"] = rwgt::fReweightMaCOHpi;
231 shiftlabels[
"ReweightR0COHpi"] = rwgt::fReweightR0COHpi;
233 shiftlabels[
"ReweightAhtBY"] = rwgt::fReweightAhtBY;
235 shiftlabels[
"ReweightBhtBY"] = rwgt::fReweightBhtBY;
237 shiftlabels[
"ReweightCV1uBY"] = rwgt::fReweightCV1uBY;
239 shiftlabels[
"ReweightCV2uBY"] = rwgt::fReweightCV2uBY;
249 shiftlabels[
"ReweightNormDISCC"] = rwgt::fReweightNormDISCC;
251 shiftlabels[
"ReweightRnubarnuCC"] = rwgt::fReweightRnubarnuCC;
253 shiftlabels[
"ReweightDISNuclMod"] = rwgt::fReweightDISNuclMod;
257 shiftlabels[
"ReweightNC"] = rwgt::fReweightNC;
261 shiftlabels[
"ReweightAGKY_xF1pi"] = rwgt::fReweightAGKY_xF1pi;
263 shiftlabels[
"ReweightAGKY_pT1pi"] = rwgt::fReweightAGKY_pT1pi;
265 shiftlabels[
"ReweightFormZone"] = rwgt::fReweightFormZone;
274 shiftlabels[
"ReweightMFP_pi"] = rwgt::fReweightMFP_pi;
276 shiftlabels[
"ReweightMFP_N"] = rwgt::fReweightMFP_N;
278 shiftlabels[
"ReweightFrCEx_pi"] = rwgt::fReweightFrCEx_pi;
280 shiftlabels[
"ReweightFrElas_pi"] = rwgt::fReweightFrElas_pi;
282 shiftlabels[
"ReweightFrInel_pi"] = rwgt::fReweightFrInel_pi;
284 shiftlabels[
"ReweightFrAbs_pi"] = rwgt::fReweightFrAbs_pi;
286 shiftlabels[
"ReweightFrPiProd_pi"] = rwgt::fReweightFrPiProd_pi;
288 shiftlabels[
"ReweightFrCEx_N"] = rwgt::fReweightFrCEx_N;
290 shiftlabels[
"ReweightFrElas_N"] = rwgt::fReweightFrElas_N;
292 shiftlabels[
"ReweightFrInel_N"] = rwgt::fReweightFrInel_N;
294 shiftlabels[
"ReweightFrAbs_N"] = rwgt::fReweightFrAbs_N;
296 shiftlabels[
"ReweightFrPiProd_N"] = rwgt::fReweightFrPiProd_N;
297 shiftlabels[
"ReweightCCQEPauliSupViaKF"] = rwgt::fReweightCCQEPauliSupViaKF;
298 shiftlabels[
"ReweightCCQEMomDistroFGtoSF"] = rwgt::fReweightCCQEMomDistroFGtoSF;
300 shiftlabels[
"ReweightBR1gamma"] = rwgt::fReweightBR1gamma;
302 shiftlabels[
"ReweightBR1eta"] = rwgt::fReweightBR1eta;
304 shiftlabels[
"ReweightTheta_Delta2Npi"] = rwgt::fReweightTheta_Delta2Npi;
315 std::map<std::string, const ISyst*> shiftlabels;
320 shiftlabels[
"PD3_MAQAGenieReducedSyst2018"] = AllSyst.at(0);
321 shiftlabels[
"PD3_RPACCQEEnhSyst2018"] = AllSyst.at(1);
322 shiftlabels[
"PD3_RPACCQESuppSyst2018"] = AllSyst.at(2);
323 shiftlabels[
"PD3_RPARESSyst2018"] = AllSyst.at(3);
324 shiftlabels[
"PD3_MECEShapeSyst2018Nu"] = AllSyst.at(4);
326 shiftlabels[
"PD3_MECEShapeSyst2018AntiNu"] = AllSyst.at(5);
327 shiftlabels[
"PD3_MECEnuShapeSyst2018Nu"] = AllSyst.at(6);
329 shiftlabels[
"PD3_MECEnuShapeSyst2018AntiNu"] = AllSyst.at(7);
330 shiftlabels[
"PD3_MECInitStateNPFracSyst2018Nu"] = AllSyst.at(8);
331 shiftlabels[
"PD3_MECInitStateNPFracSyst2018AntiNu"] = AllSyst.at(9);
332 shiftlabels[
"PD3_DISvpCC0pi"] = AllSyst.at(10);
333 shiftlabels[
"PD3_DISvpCC1pi"] = AllSyst.at(11);
334 shiftlabels[
"PD3_DISvpCC2pi"] = AllSyst.at(12);
335 shiftlabels[
"PD3_DISvpCC3pi"] = AllSyst.at(13);
336 shiftlabels[
"PD3_DISvpNC0pi"] = AllSyst.at(14);
337 shiftlabels[
"PD3_DISvpNC1pi"] = AllSyst.at(15);
338 shiftlabels[
"PD3_DISvpNC2pi"] = AllSyst.at(16);
339 shiftlabels[
"PD3_DISvpNC3pi"] = AllSyst.at(17);
340 shiftlabels[
"PD3_DISvnCC0pi"] = AllSyst.at(18);
341 shiftlabels[
"PD3_DISvnCC1pi"] = AllSyst.at(19);
342 shiftlabels[
"PD3_DISvnCC2pi"] = AllSyst.at(20);
343 shiftlabels[
"PD3_DISvnCC3pi"] = AllSyst.at(21);
344 shiftlabels[
"PD3_DISvnNC0pi"] = AllSyst.at(22);
345 shiftlabels[
"PD3_DISvnNC1pi"] = AllSyst.at(23);
346 shiftlabels[
"PD3_DISvnNC2pi"] = AllSyst.at(24);
347 shiftlabels[
"PD3_DISvnNC3pi"] = AllSyst.at(25);
348 shiftlabels[
"PD3_DISvbarpCC0pi"] = AllSyst.at(26);
349 shiftlabels[
"PD3_DISvbarpCC1pi"] = AllSyst.at(27);
350 shiftlabels[
"PD3_DISvbarpCC2pi"] = AllSyst.at(28);
351 shiftlabels[
"PD3_DISvbarpCC3pi"] = AllSyst.at(29);
352 shiftlabels[
"PD3_DISvbarpNC0pi"] = AllSyst.at(30);
353 shiftlabels[
"PD3_DISvbarpNC1pi"] = AllSyst.at(31);
354 shiftlabels[
"PD3_DISvbarpNC2pi"] = AllSyst.at(32);
355 shiftlabels[
"PD3_DISvbarpNC3pi"] = AllSyst.at(33);
356 shiftlabels[
"PD3_DISvbarnCC0pi"] = AllSyst.at(34);
357 shiftlabels[
"PD3_DISvbarnCC1pi"] = AllSyst.at(35);
358 shiftlabels[
"PD3_DISvbarnCC2pi"] = AllSyst.at(36);
359 shiftlabels[
"PD3_DISvbarnCC3pi"] = AllSyst.at(37);
360 shiftlabels[
"PD3_DISvbarnNC0pi"] = AllSyst.at(38);
361 shiftlabels[
"PD3_DISvbarnNC1pi"] = AllSyst.at(39);
362 shiftlabels[
"PD3_DISvbarnNC2pi"] = AllSyst.at(40);
363 shiftlabels[
"PD3_DISvbarnNC3pi"] = AllSyst.at(41);
364 shiftlabels[
"PD3_RadCorrNue"] = AllSyst.at(42);
365 shiftlabels[
"PD3_RadCorrNuebar"] = AllSyst.at(43);
366 shiftlabels[
"PD3_k2ndClassCurr"] = AllSyst.at(44);
Cuts and Vars for the 2020 FD DiF Study.
std::map< std::string, rwgt::ReweightLabel_t > GetGENIEShiftLabels()
Get GENIE systematics labels.
std::vector< const ISyst * > getAllXsecSysts_2018()
Get master XSec syst list for 2018 analyses.
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
Simple record of shifts applied to systematic parameters.
Collection of SpectrumLoaders for many configurations.
void SaveMaps(TDirectory *out, std::map< std::string, IDecomp * > decomps_nominal, std::map< std::string, std::map< std::string, std::map< int, IDecomp * > > > decomps_shifted, std::map< std::string, PredictionNoExtrap * > predsNE_nominal, std::map< std::string, std::map< std::string, std::map< int, PredictionNoExtrap * > > > predsNE_shifted, std::map< std::string, PredictionSterile * > predsSt_nominal, std::map< std::string, std::map< std::string, std::map< int, PredictionSterile * > > > predsSt_shifted)
Save all of the objects in the input maps to the out directory/file.
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Generates extrapolated NC predictions using ProportionalDecomp.
const HistAxis kNus18AxisE("Energy Deposited in Scintillator (GeV)", kNus18EnergyBinning, kNus18Energy)
Axes used in Nus18 analysis by nus group.
void Go()
Call Go() on all the loaders.
void Nus18SystsGENIELoad(TString opt)
void SetSpillCut(const SpillCut &cut)
std::map< std::string, const ISyst * > GetXSecShiftLabels()
Get cross-section systematics labels.
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
const Cut kNus18ND
Full Nus18 ND analysis selection.
Take the output of an extrapolation and oscillate it as required.
const SystShifts kNoShift
A prediction object compatible with sterile oscillations.
const HistAxis kNus18BinsNumuCCAxis("Reconstructed Neutrino Energy (GeV)", kNus18EnergyBinning, kCCE)
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
Take the output of an extrapolation and oscillate it as required.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
For nominal spectra and reweighting systs (xsec/flux)
Generates Near Detector predictions.
const NOvARwgtSyst * GetGenieKnobSyst(rwgt::ReweightLabel_t knobIdx, std::string altName, std::string altLabel)
Convenience function to get a GENIE knob syst. (Allows using the GENIE knob name & description as the...