9 #include "CAFAna/Extrap/ExtrapSterile.h" 38 std::map<std::string, std::vector<std::string> > shiftlabels;
39 shiftlabels[
"NoiseV2"] = std::vector<std::string>();
40 shiftlabels[
"NoiseV2"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_nonswap_fhc_nova_v08_full_batch1_v1_newnoise");
41 shiftlabels[
"NoiseV2"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_fluxswap_fhc_nova_v08_full_batch1_v1_newnoise");
42 shiftlabels[
"NoiseV2"].push_back(
"prod_caf_R16-03-03-prod2reco.a_fd_genie_tau_fhc_nova_v08_full_batch1_v1_newnoise");
45 std::map<std::string, std::vector<SpectrumLoader*> > systematics;
47 for(
const auto& shiftlabel : shiftlabels) {
48 systematics[shiftlabel.first] = std::vector<SpectrumLoader*>();
49 for(
const auto& samdef : shiftlabel.second){
50 systematics[shiftlabel.first].push_back(
new SpectrumLoader(samdef));
57 std::string labelRecoE =
"Calorimetric Energy (GeV)";
58 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
60 cut_samples[
"Ana01"] = std::pair<HistAxis*, std::pair<Cut*, Cut*> >(
68 std::map<std::string, IDecomp*> decomps_nominal;
69 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
70 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
71 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
72 std::map<std::string, PredictionSterile*> predsSt_nominal;
73 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
80 for(
const auto& sample : cut_samples) {
85 *sample.second.first, *sample.second.second.first,
89 floadfar, floadswap, floadtau,
90 sample.second.first->label, sample.second.first->bins,
91 sample.second.first->var, *sample.second.second.second,
96 floadnear, floadneardata,
97 *sample.second.first, *sample.second.second.first,
101 floadnear, floadneardata,
106 floadnear, floadswap, floadfar, floadtau, *decompnc_n, *decompnumu_n,
108 *sample.second.second.second, *sample.second.second.first,
kNumuND,
115 for(
const auto& systlabel : systematics) {
120 decomps_shifted[sample.first][systlabel.first][1] =
new CheatDecomp(
122 *sample.second.first, *sample.second.second.first,
126 *systlabel.second[fdpos], *systlabel.second[fspos], *systlabel.second[ftpos],
127 sample.second.first->label, sample.second.first->bins,
128 sample.second.first->var, *sample.second.second.second,
133 floadnear, floadneardata,
134 *sample.second.first, *sample.second.second.first,
138 floadnear, floadneardata,
143 floadnear, *systlabel.second[fspos], *systlabel.second[fdpos],
144 *systlabel.second[ftpos], *decompnc_s, *decompnumu_s,
146 *sample.second.second.second, *sample.second.second.first,
kNumuND,
155 for(
const auto& systlabel : systematics) {
156 for(
const auto&
loader : systlabel.second) {
169 std::string fullLocation = folder + filenm +
".root";
170 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
173 decomps_nominal, decomps_shifted,
174 predsNE_nominal, predsNE_shifted,
175 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.