9 #include "CAFAna/Extrap/ExtrapSterile.h" 37 std::map<std::string, std::string> shiftlabels;
38 shiftlabels[
"NDRock"] =
"ND Rock Contamination";
43 if(sr->
hdr.
ismc ==
false) { return true; }
44 if(sr->
mc.
nnu < 1) { return false; }
45 if(sr->
mc.
nu[0].vtx.X() <
NDL) {
return false; }
46 if(sr->
mc.
nu[0].vtx.X() >
NDR) {
return false; }
47 if(sr->
mc.
nu[0].vtx.Y() <
NDB) {
return false; }
48 if(sr->
mc.
nu[0].vtx.Y() >
NDT) {
return false; }
49 if(sr->
mc.
nu[0].vtx.Z() <
NDF) {
return false; }
52 if(sr->
mc.
nu[0].vtx.Z() > NDM) {
return false; }
53 if(sr->
mc.
nu[0].vtx.Z() >
NDE) {
55 if(sr->
mc.
nu[0].vtx.Y() > MCT) {
return false; }
61 std::map<std::string, Cut*> systematics;
66 std::string labelRecoE =
"Calorimetric Energy (GeV)";
67 std::map<std::string, std::pair<HistAxis*, std::pair<Cut*, Cut*> > > cut_samples;
69 cut_samples[
"Ana01"] = std::pair<HistAxis*, std::pair<Cut*, Cut*> >(
77 std::map<std::string, IDecomp*> decomps_nominal;
78 std::map<std::string, std::map<std::string, std::map<int, IDecomp*> > > decomps_shifted;
79 std::map<std::string, PredictionNoExtrap*> predsNE_nominal;
80 std::map<std::string, std::map<std::string, std::map<int, PredictionNoExtrap*> > > predsNE_shifted;
81 std::map<std::string, PredictionSterile*> predsSt_nominal;
82 std::map<std::string, std::map<std::string, std::map<int, PredictionSterile*> > > predsSt_shifted;
91 for(
const auto& sample : cut_samples) {
94 *sample.second.second.second, *sample.second.second.first,
102 *sample.second.first, *sample.second.second.first,
107 *sample.second.first, *sample.second.second.second,
116 for(
const auto& shiftlabel : shiftlabels) {
117 decomps_shifted[sample.first][shiftlabel.first][1] =
new CheatDecomp(
119 *sample.second.first, *sample.second.second.first && *systematics[shiftlabel.first],
124 *sample.second.first, *sample.second.second.second,
130 *sample.second.second.second,
131 *sample.second.second.first && *systematics[shiftlabel.first],
132 kNumuND && *systematics[shiftlabel.first],
135 predsSt_shifted[sample.first][shiftlabel.first][1] =
145 std::string fullLocation = folder + filenm +
".root";
146 TFile* rootF =
new TFile(fullLocation.c_str(),
"RECREATE");
149 decomps_nominal, decomps_shifted,
150 predsNE_nominal, predsNE_shifted,
151 predsSt_nominal, predsSt_shifted
Near Detector underground.
const Cut kNDTruthFull([](const caf::SRProxy *sr){if(sr->hdr.ismc==false){return true;}if(sr->mc.nnu< 1){return false;}if(sr->mc.nu[0].vtx.X()< NDL){return false;}if(sr->mc.nu[0].vtx.X() > NDR){return false;}if(sr->mc.nu[0].vtx.Y()< NDB){return false;}if(sr->mc.nu[0].vtx.Y() > NDT){return false;}if(sr->mc.nu[0].vtx.Z()< NDF){return false;}double NDM=1587.;if(sr->mc.nu[0].vtx.Z() > NDM){return false;}if(sr->mc.nu[0].vtx.Z() > NDE){double MCT=(2./3.)*(NDT-NDB)+NDB;if(sr->mc.nu[0].vtx.Y() > MCT){return false;}}return true;})
_HistAxis< Var > HistAxis
Far Detector at Ash River.
Cuts and Vars for the 2020 FD DiF Study.
const std::string fnametau_concat
std::unique_ptr< IPrediction > Generate(Loaders &loaders, const SystShifts &shiftMC=kNoShift) const override
caf::Proxy< caf::SRHeader > hdr
Proxy for caf::StandardRecord.
Collection of SpectrumLoaders for many configurations.
caf::Proxy< std::vector< caf::SRNeutrino > > nu
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.
caf::Proxy< short int > nnu
Generates extrapolated NC predictions using ProportionalDecomp.
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 std::string fnameneardata_concat
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
caf::Proxy< caf::SRTruthBranch > mc
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.