10 #include "CAFAna/Extrap/ExtrapSterile.h" 28 std::string fnamenear_con=
"prod_caf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1";
29 std::string fnameneardata_con=
"prod_caf_R17-03-01-prod3reco.d_nd_numi_fhc_full_v1_goodruns";
30 std::string fFDMC_nons=
"prod_caf_R17-03-01-prod3reco.l_fd_genie_nonswap_fhc_nova_v08_full_v1";
31 std::string fFDMC_swps=
"prod_caf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_v1";
32 std::string fFDMC_taus=
"prod_caf_R17-03-01-prod3reco.l_fd_genie_tau_fhc_nova_v08_full_v1";
56 std::map<std::string, std::vector<std::string> > shiftlabels;
57 shiftlabels[
"CalFlat095ND"] = std::vector<std::string>();
58 shiftlabels[
"CalFlat105ND"] = std::vector<std::string>();
59 shiftlabels[
"CalFlat095FD"] = std::vector<std::string>();
60 shiftlabels[
"CalFlat105FD"] = std::vector<std::string>();
61 shiftlabels[
"CalFlat095ND"].push_back(
"prod_caf_R17-03-01-prod3reco.h_nd_genie_nonswap_fhc_nova_v08_periods1235_calib-shift-nd-xyview-neg-offset_v1");
62 shiftlabels[
"CalFlat095FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xyview-neg-offset_v1");
63 shiftlabels[
"CalFlat095FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xyview-neg-offset_v1");
64 shiftlabels[
"CalFlat095FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_tau_fhc_nova_v08_full_calib-shift-fd-xyview-neg-offset_v1");
67 shiftlabels[
"CalFlat105ND"].push_back(
"prod_caf_R17-03-01-prod3reco.h_nd_genie_nonswap_fhc_nova_v08_periods1235_calib-shift-nd-xyview-pos-offset_v1");
68 shiftlabels[
"CalFlat105FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xyview-pos-offset_v1");
69 shiftlabels[
"CalFlat105FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xyview-pos-offset_v1");
70 shiftlabels[
"CalFlat105FD"].push_back(
"prod_caf_R17-03-01-prod3reco.l_fd_genie_tau_fhc_nova_v08_full_calib-shift-fd-xyview-pos-offset_v1");
72 std::map<std::string, std::vector<SpectrumLoader*> > systematics;
74 for(
const auto& shiftlabel : shiftlabels) {
75 systematics[shiftlabel.first] = std::vector<SpectrumLoader*>();
76 for(
const auto& samdef : shiftlabel.second){
77 systematics[shiftlabel.first].push_back(
new SpectrumLoader(samdef));
85 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
87 cut_samples[
"Ana01"] = std::pair<HistAxis*, std::pair<Cut*, Cut*> >(
96 std::map<std::string, IDecomp*> decomps_nominal;
97 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
98 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
99 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
100 std::map<std::string, PredictionSterile*> predsSt_nominal;
101 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
108 for(
const auto& sample : cut_samples) {
113 *sample.second.first, *sample.second.second.first,
117 floadfar, floadswap, floadtau,
123 floadnear, floadneardata,
124 *sample.second.first, *sample.second.second.first,
128 floadnear, floadneardata,
133 floadnear, floadswap, floadfar, floadtau, *decompnc_n, *decompnumu_n,
135 *sample.second.second.second, *sample.second.second.first,
kNumuND,
149 for(
const auto& systlabel : systematics) {
153 if(systlabel.first.find(
"ND") != std::string::npos) {
154 decomps_shifted[sample.first][systlabel.first][1] =
new CheatDecomp(
155 *systlabel.second[0],
156 *sample.second.first, *sample.second.second.first,
160 floadfar, floadswap, floadtau,
166 *systlabel.second[0], floadneardata,
167 *sample.second.first, *sample.second.second.first,
171 *systlabel.second[0], floadneardata,
176 *systlabel.second[0], floadswap, floadfar,
177 floadtau, *decompnc_s, *decompnumu_s,
179 *sample.second.second.second, *sample.second.second.first,
kNumuND,
187 decomps_shifted[sample.first][systlabel.first][1] =
new CheatDecomp(
189 *sample.second.first, *sample.second.second.first,
193 *systlabel.second[fdpos], *systlabel.second[fspos], *systlabel.second[ftpos],
199 floadnear, floadneardata,
200 *sample.second.first, *sample.second.second.first,
204 floadnear, floadneardata,
209 floadnear, *systlabel.second[fspos], *systlabel.second[fdpos],
210 *systlabel.second[ftpos], *decompnc_s, *decompnumu_s,
212 *sample.second.second.second, *sample.second.second.first,
kNumuND,
222 for(
const auto& systlabel : systematics) {
223 for(
const auto&
loader : systlabel.second) {
236 std::string fullLocation = folder + filenm +
".root";
237 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
240 decomps_nominal, decomps_shifted,
241 predsNE_nominal, predsNE_shifted,
242 predsSt_nominal, predsSt_shifted
_HistAxis< Var > HistAxis
Cuts and Vars for the 2020 FD DiF Study.
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.
void SetSpillCut(const SpillCut &cut)
const Cut kNus17ND
Full Nus17 ND analysis selection.
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
virtual void Go() override
Load all the registered spectra.
const SystShifts kNoShift
const HistAxis kNCBinsNumuCCAxis("Reconstructed Neutrino Energy (GeV)", kNCDisappearanceEnergyBinning, kCCE)
Splits Data proportionally according to MC.
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
void SystsCalibRelLoad17()
A prediction object compatible with sterile oscillations.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
Just return the ND truth spectra as the decomposition.
const Binning kNCDisappearanceEnergyBinning
Energy binnings used in Ana01 for nus extrapolation.