9 #include "CAFAna/Extrap/ExtrapSterile.h" 38 std::map<std::string, std::vector<std::string> > shiftlabels;
39 shiftlabels[
"CalFlat095"] = std::vector<std::string>();
40 shiftlabels[
"CalFlat105"] = std::vector<std::string>();
41 shiftlabels[
"CalSlopeX"] = std::vector<std::string>();
42 shiftlabels[
"CalSlopeY"] = std::vector<std::string>();
43 shiftlabels[
"CalFlat095"].push_back(
"prod_caf_R16-03-03-prod2reco.a_nd_genie_nonswap_nogenierw_fhc_nova_v08_full_calib-shift-nd-xyview-neg-offset_v1");
44 shiftlabels[
"CalFlat095"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xy-neg-offset_v1");
45 shiftlabels[
"CalFlat095"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xy-neg-offset_v1");
46 shiftlabels[
"CalFlat105"].push_back(
"prod_caf_R16-03-03-prod2reco.a_nd_genie_nonswap_nogenierw_fhc_nova_v08_full_calib-shift-nd-xyview-pos-offset_v1");
47 shiftlabels[
"CalFlat105"].push_back(
"prod_caf_R16-03-03-prod2reco.d_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-xy-pos-offset_v1");
48 shiftlabels[
"CalFlat105"].push_back(
"prod_caf_R16-03-03-prod2reco.d_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-xy-pos-offset_v1");
49 shiftlabels[
"CalSlopeX"].push_back(
"prod_caf_R16-03-03-prod2reco.a_nd_genie_nonswap_nogenierw_fhc_nova_v08_full_calib-shift-nd-x-func_v1");
50 shiftlabels[
"CalSlopeX"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-x-func_v1");
51 shiftlabels[
"CalSlopeX"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-x-func_v1");
52 shiftlabels[
"CalSlopeY"].push_back(
"prod_caf_R16-03-03-prod2reco.a_nd_genie_nonswap_nogenierw_fhc_nova_v08_full_calib-shift-nd-y-func_v1");
53 shiftlabels[
"CalSlopeY"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_nonswap_fhc_nova_v08_full_calib-shift-fd-y-func_v1");
54 shiftlabels[
"CalSlopeY"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_fluxswap_fhc_nova_v08_full_calib-shift-fd-y-func_v1");
57 std::map<std::string, std::vector<SpectrumLoader*> > systematics;
59 for(
const auto& shiftlabel : shiftlabels) {
60 systematics[shiftlabel.first] = std::vector<SpectrumLoader*>();
61 for(
const auto& samdef : shiftlabel.second){
62 systematics[shiftlabel.first].push_back(
new SpectrumLoader(samdef));
69 std::string labelRecoE =
"Calorimetric Energy (GeV)";
70 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
72 cut_samples[
"Ana01"] = std::pair<HistAxis*, std::pair<Cut*, Cut*> >(
80 std::map<std::string, IDecomp*> decomps_nominal;
81 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
82 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
83 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
84 std::map<std::string, PredictionSterile*> predsSt_nominal;
85 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
92 for(
const auto& sample : cut_samples) {
97 *sample.second.first, *sample.second.second.first,
101 floadfar, floadswap, floadtau,
102 sample.second.first->label, sample.second.first->bins,
103 sample.second.first->var, *sample.second.second.second,
108 floadnear, floadneardata,
109 *sample.second.first, *sample.second.second.first,
113 floadnear, floadneardata,
118 floadnear, floadswap, floadfar, floadtau, *decompnc_n, *decompnumu_n,
120 *sample.second.second.second, *sample.second.second.first,
kNumuND,
127 for(
const auto& systlabel : systematics) {
132 decomps_shifted[sample.first][systlabel.first][1] =
new CheatDecomp(
133 *systlabel.second[ndpos],
134 *sample.second.first, *sample.second.second.first,
138 *systlabel.second[fdpos], *systlabel.second[fspos], floadtau,
139 sample.second.first->label, sample.second.first->bins,
140 sample.second.first->var, *sample.second.second.second,
145 *systlabel.second[ndpos], floadneardata,
146 *sample.second.first, *sample.second.second.first,
150 *systlabel.second[ndpos], floadneardata,
155 *systlabel.second[ndpos], *systlabel.second[fspos], *systlabel.second[fdpos],
156 floadtau, *decompnc_s, *decompnumu_s,
158 *sample.second.second.second, *sample.second.second.first,
kNumuND,
167 for(
const auto& systlabel : systematics) {
168 for(
const auto&
loader : systlabel.second) {
181 std::string fullLocation = folder + filenm +
".root";
182 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
185 decomps_nominal, decomps_shifted,
186 predsNE_nominal, predsNE_shifted,
187 predsSt_nominal, predsSt_shifted
_HistAxis< Var > HistAxis
Cuts and Vars for the 2020 FD DiF Study.
const std::string fnametau_concat
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 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
const std::string fnameneardata_concat
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
_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.
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
Just return the ND truth spectra as the decomposition.
const Binning kNCDisappearanceEnergyBinning
Energy binnings used in Ana01 for nus extrapolation.