48 if (opt.Contains(
"caf", TString::kIgnoreCase))
50 else if (opt.Contains(
"concat", TString::kIgnoreCase))
56 if (opt.Contains(
"fhc", TString::kIgnoreCase))
58 else if (opt.Contains(
"rhc", TString::kIgnoreCase))
64 if (opt.Contains(
"extrap", TString::kIgnoreCase))
72 const std::vector<int> sigmas{-3, -2, -1, +1, +2, +3};
78 std::map<std::string, std::map<int, SystShifts*> > systematics;
82 for (
const auto& shiftLabel : shiftLabels)
83 for(
const auto&
sigma : sigmas)
84 systematics[shiftLabel.first][
sigma] =
90 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
96 std::map<std::string, NDPredictionSterile*> predsND_nominal;
97 std::map<std::string, FDPredictionSterile*> predsFD_nominal;
98 std::map<std::string, PredictionSterile*> predsExtrap_nominal;
99 std::map<std::string, std::map<std::string, std::map<int, NDPredictionSterile*> > > predsND_shifted;
100 std::map<std::string, std::map<std::string, std::map<int, FDPredictionSterile*> > > predsFD_shifted;
101 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsExtrap_shifted;
110 for (
const auto& sample : cut_samples) {
117 *sample.second.second.second, *sample.second.second.first,
129 for(
const auto& shiftLabel : shiftLabels) {
130 for(
const auto& syst : systematics[shiftLabel.first]) {
131 predsND_shifted[sample.first][shiftLabel.first][syst.first]
133 predsFD_shifted[sample.first][shiftLabel.first][syst.first]
136 predsExtrap_shifted[sample.first][shiftLabel.first][syst.first]
151 std::string fullLocation = folder + filenm +
".root";
152 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
153 SaveMaps(rootF, predsND_nominal, predsND_shifted);
154 SaveMaps(rootF, predsFD_nominal, predsFD_shifted);
156 SaveMaps(rootF, predsExtrap_nominal, predsExtrap_shifted);
168 std::map<std::string, std::vector<std::string> > shiftLabels;
171 shiftLabels[
"BeamHornCurrent"] = std::vector<std::string>();
172 shiftLabels[
"BeamSpotSize"] = std::vector<std::string>();
173 shiftLabels[
"BeamposX"] = std::vector<std::string>();
174 shiftLabels[
"BeamposY"] = std::vector<std::string>();
175 shiftLabels[
"BeamH1PosX"] = std::vector<std::string>();
176 shiftLabels[
"BeamH1PosY"] = std::vector<std::string>();
177 shiftLabels[
"BeamH2PosX"] = std::vector<std::string>();
178 shiftLabels[
"BeamH2PosY"] = std::vector<std::string>();
179 shiftLabels[
"TargetPosZ"] = std::vector<std::string>();
180 shiftLabels[
"BeamExp"] = std::vector<std::string>();
181 shiftLabels[
"HornWater"] = std::vector<std::string>();
182 shiftLabels[
"totErr"] = std::vector<std::string>();
185 shiftLabels[
"BeamHornCurrent"].push_back(
"2kA");
186 shiftLabels[
"BeamHornCurrent"].push_back(
"Horn Current");
187 shiftLabels[
"BeamSpotSize"] .push_back(
"0.2mmBeamSpotSize");
188 shiftLabels[
"BeamSpotSize"] .push_back(
"Spot Size");
189 shiftLabels[
"BeamposX"] .push_back(
"1mmBeamShiftX");
190 shiftLabels[
"BeamposX"] .push_back(
"Beam Position X");
191 shiftLabels[
"BeamposY"] .push_back(
"1mmBeamShiftY");
192 shiftLabels[
"BeamposY"] .push_back(
"Beam Position Y");
193 shiftLabels[
"BeamH1PosX"] .push_back(
"3mmHorn1X");
194 shiftLabels[
"BeamH1PosX"] .push_back(
"Horn 1 X Position");
195 shiftLabels[
"BeamH1PosY"] .push_back(
"3mmHorn1Y");
196 shiftLabels[
"BeamH1PosY"] .push_back(
"Horn 1 Y Position");
197 shiftLabels[
"BeamH2PosX"] .push_back(
"3mmHorn2X");
198 shiftLabels[
"BeamH2PosX"] .push_back(
"Horn 2 X Position");
199 shiftLabels[
"BeamH2PosY"] .push_back(
"3mmHorn2Y");
200 shiftLabels[
"BeamH2PosY"] .push_back(
"Horn 2 Y Position");
201 shiftLabels[
"TargetPosZ"] .push_back(
"7mmTargetZ");
202 shiftLabels[
"TargetPosZ"] .push_back(
"Target Z position");
203 shiftLabels[
"BeamExp"] .push_back(
"Magnetic Field in Decay Pipe");
204 shiftLabels[
"BeamExp"] .push_back(
"Magnet Field in Decay Pipe");
205 shiftLabels[
"HornWater"] .push_back(
"1mmHornWater");
206 shiftLabels[
"HornWater"] .push_back(
"New Horn Geometry and 1mm water");
207 shiftLabels[
"totErr"] .push_back(
"totErr");
208 shiftLabels[
"totErr"] .push_back(
"Combined Beam Transport Systematics");
Cuts and Vars for the 2020 FD DiF Study.
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
void Nus18SystsBeamTranspLoad(TString opt)
Run systematics for Beam Transport.
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.
std::string FindCAFAnaDir()
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 SetSpillCut(const SpillCut &cut)
std::map< std::string, std::vector< std::string > > GetBeamTranspShiftLabels()
Get Beam Transport 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.