8 #include "CAFAna/Extrap/ExtrapSterile.h" 34 std::vector<int> sigmas{-2, -1, +1, +2};
55 std::map<std::string, rwgt::ReweightLabel_t> shiftlabels;
57 shiftlabels[
"ReweightMaNCEL"] = rwgt::fReweightMaNCEL;
58 shiftlabels[
"ReweightEtaNCEL"] = rwgt::fReweightEtaNCEL;
61 shiftlabels[
"ReweightMaCCQEshape"] = rwgt::fReweightMaCCQEshape;
62 shiftlabels[
"ReweightNormCCQE"] = rwgt::fReweightNormCCQE;
64 shiftlabels[
"ReweightCCQEPauliSupViaKF"] = rwgt::fReweightCCQEPauliSupViaKF;
65 shiftlabels[
"ReweightVecCCQEshape"] = rwgt::fReweightVecCCQEshape;
66 shiftlabels[
"ReweightCCQEMomDistroFGtoSF"] = rwgt::fReweightCCQEMomDistroFGtoSF;
74 shiftlabels[
"ReweightMaCCRES"] = rwgt::fReweightMaCCRES;
75 shiftlabels[
"ReweightMvCCRES"] = rwgt::fReweightMvCCRES;
76 shiftlabels[
"ReweightMaNCRES"] = rwgt::fReweightMaNCRES;
77 shiftlabels[
"ReweightMvNCRES"] = rwgt::fReweightMvNCRES;
79 shiftlabels[
"ReweightMaCOHpi"] = rwgt::fReweightMaCOHpi;
80 shiftlabels[
"ReweightR0COHpi"] = rwgt::fReweightR0COHpi;
82 shiftlabels[
"ReweightRvpCC1pi"] = rwgt::fReweightRvpCC1pi;
83 shiftlabels[
"ReweightRvpCC2pi"] = rwgt::fReweightRvpCC2pi;
84 shiftlabels[
"ReweightRvnCC1pi"] = rwgt::fReweightRvnCC1pi;
85 shiftlabels[
"ReweightRvnCC2pi"] = rwgt::fReweightRvnCC2pi;
86 shiftlabels[
"ReweightRvpNC1pi"] = rwgt::fReweightRvpNC1pi;
87 shiftlabels[
"ReweightRvpNC2pi"] = rwgt::fReweightRvpNC2pi;
88 shiftlabels[
"ReweightRvnNC1pi"] = rwgt::fReweightRvnNC1pi;
89 shiftlabels[
"ReweightRvnNC2pi"] = rwgt::fReweightRvnNC2pi;
90 shiftlabels[
"ReweightRvbarpCC1pi"] = rwgt::fReweightRvbarpCC1pi;
91 shiftlabels[
"ReweightRvbarpCC2pi"] = rwgt::fReweightRvbarpCC2pi;
92 shiftlabels[
"ReweightRvbarnCC1pi"] = rwgt::fReweightRvbarnCC1pi;
93 shiftlabels[
"ReweightRvbarnCC2pi"] = rwgt::fReweightRvbarnCC2pi;
94 shiftlabels[
"ReweightRvbarpNC1pi"] = rwgt::fReweightRvbarpNC1pi;
95 shiftlabels[
"ReweightRvbarpNC2pi"] = rwgt::fReweightRvbarpNC2pi;
96 shiftlabels[
"ReweightRvbarnNC1pi"] = rwgt::fReweightRvbarnNC1pi;
97 shiftlabels[
"ReweightRvbarnNC2pi"] = rwgt::fReweightRvbarnNC2pi;
100 shiftlabels[
"ReweightAhtBY"] = rwgt::fReweightAhtBY;
101 shiftlabels[
"ReweightBhtBY"] = rwgt::fReweightBhtBY;
102 shiftlabels[
"ReweightCV1uBY"] = rwgt::fReweightCV1uBY;
103 shiftlabels[
"ReweightCV2uBY"] = rwgt::fReweightCV2uBY;
108 shiftlabels[
"ReweightNormDISCC"] = rwgt::fReweightNormDISCC;
109 shiftlabels[
"ReweightRnubarnuCC"] = rwgt::fReweightRnubarnuCC;
110 shiftlabels[
"ReweightDISNuclMod"] = rwgt::fReweightDISNuclMod;
113 shiftlabels[
"ReweightAGKY_xF1pi"] = rwgt::fReweightAGKY_xF1pi;
114 shiftlabels[
"ReweightAGKY_pT1pi"] = rwgt::fReweightAGKY_pT1pi;
115 shiftlabels[
"ReweightFormZone"] = rwgt::fReweightFormZone;
117 shiftlabels[
"ReweightTheta_Delta2Npi"] = rwgt::fReweightTheta_Delta2Npi;
118 shiftlabels[
"ReweightBR1gamma"] = rwgt::fReweightBR1gamma;
119 shiftlabels[
"ReweightBR1eta"] = rwgt::fReweightBR1eta;
125 shiftlabels[
"ReweightMFP_N"] = rwgt::fReweightMFP_N;
126 shiftlabels[
"ReweightFrCEx_N"] = rwgt::fReweightFrCEx_N;
127 shiftlabels[
"ReweightFrElas_N"] = rwgt::fReweightFrElas_N;
128 shiftlabels[
"ReweightFrInel_N"] = rwgt::fReweightFrInel_N;
129 shiftlabels[
"ReweightFrAbs_N"] = rwgt::fReweightFrAbs_N;
130 shiftlabels[
"ReweightFrPiProd_N"] = rwgt::fReweightFrPiProd_N;
131 shiftlabels[
"ReweightMFP_pi"] = rwgt::fReweightMFP_pi;
132 shiftlabels[
"ReweightFrCEx_pi"] = rwgt::fReweightFrCEx_pi;
133 shiftlabels[
"ReweightFrElas_pi"] = rwgt::fReweightFrElas_pi;
134 shiftlabels[
"ReweightFrInel_pi"] = rwgt::fReweightFrInel_pi;
135 shiftlabels[
"ReweightFrAbs_pi"] = rwgt::fReweightFrAbs_pi;
136 shiftlabels[
"ReweightFrPiProd_pi"] = rwgt::fReweightFrPiProd_pi;
142 std::map<std::string, std::map<int, SystShifts*> > systematics;
144 for(
const auto& shiftlabel : shiftlabels){
145 for(
const auto&
sigma : sigmas) {
147 new GenieRwgtTableSyst(shiftlabel.second),
sigma 154 shiftlabels[
"mecScale"] = rwgt::kReweightNull;
155 shiftlabels[
"RPA"] = rwgt::kReweightNull;
157 for(
const auto&
sigma : sigmas) {
164 std::string labelRecoE =
"Calorimetric Energy (GeV)";
165 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
167 cut_samples[
"Ana01"] = std::pair<HistAxis*, std::pair<Cut*, Cut*> >(
176 if(sr->
hdr.
ismc ==
false) { return true; }
178 if((evtno % 2) == 0) { return true; }
184 if(sr->
hdr.
ismc ==
false) { return true; }
186 if((evtno % 2) == 1) { return true; }
193 std::map<std::string, IDecomp*> decomps_nominal;
194 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
195 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
196 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
197 std::map<std::string, PredictionSterile*> predsSt_nominal;
198 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
207 for(
const auto& sample : cut_samples) {
212 *sample.second.first, *sample.second.second.first && kMod0,
217 *sample.second.first, *sample.second.second.second,
223 *sample.second.first, *sample.second.second.first && kMod1,
232 loaders, *decompnc_n, *decompnumu_n,
234 *sample.second.second.second, *sample.second.second.first && kMod0,
kNumuND && kMod0,
241 for(
const auto& shiftlabel : shiftlabels) {
242 for(
const auto& syst : systematics[shiftlabel.first]) {
243 decomps_shifted[sample.first][shiftlabel.first][syst.first] =
new CheatDecomp(
245 *sample.second.first, *sample.second.second.first && kMod0,
250 *sample.second.first, *sample.second.second.second,
256 *sample.second.first, *sample.second.second.first && kMod1,
265 loaders, *decompnc_s, *decompnumu_s,
267 *sample.second.second.second, *sample.second.second.first && kMod0,
kNumuND && kMod0,
270 predsSt_shifted[sample.first][shiftlabel.first][syst.first] =
new PredictionSterile(
282 std::string fullLocation = folder + filenm +
".root";
283 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
286 decomps_nominal, decomps_shifted,
287 predsNE_nominal, predsNE_shifted,
288 predsSt_nominal, predsSt_shifted
Near Detector underground.
_HistAxis< Var > HistAxis
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
const std::string fnametau_concat
Simple record of shifts applied to systematic parameters.
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
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.
void Go()
Call Go() on all the loaders.
const SpillCut kOnly14DB([](const caf::SRSpillProxy *spill){if(spill->det!=caf::kFARDET) return true;std::bitset< 14 > binary(spill->dibmask);for(int i=0;i< 14;++i){if(!binary[i]) return false;}return true;})
const std::string fnamenear_concat
void SetSpillCut(const SpillCut &cut)
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
SpectrumLoaderBase & GetLoader(caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Retrieve a specific loader.
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
const SystShifts kNoShift
const HistAxis kNCBinsNumuCCAxis("Reconstructed Neutrino Energy (GeV)", kNCDisappearanceEnergyBinning, kCCE)
A prediction object compatible with sterile oscillations.
const SpillCut kStandardSpillCuts
Apply this unless you're doing something special.
const std::string fnameswap_concat
const std::string fnamefar_concat
void SetLoaderPath(const std::string &path, caf::Det_t det, DataMC datamc, DataSource src=kBeam, SwappingConfig swap=kNonSwap)
Configure loader via wildcard path.
Just return the ND truth spectra as the decomposition.
const Binning kNCDisappearanceEnergyBinning
Energy binnings used in Ana01 for nus extrapolation.