5 #include "sbnanaobj/StandardRecord/Proxy/SRProxy.h"
38 std::string suffix =
"";
39 std::string label =
"";
46 std::string suffix =
"";
47 std::string label =
"";
54 std::string suffix =
"";
55 std::string label =
"";
63 std::string suffix =
"";
64 std::string label =
"";
71 std::string suffix =
"";
72 std::string label =
"";
122 for (
auto const& slc : sr->slc) {
123 if (slc.tmatch.index < 0)
135 for (
auto const& slc : sr->slc) {
136 if (slc.tmatch.index < 0)
148 for (
auto const& slc : sr->slc) {
149 if (slc.tmatch.index < 0)
161 for (
auto const& slc : sr->slc) {
162 if (slc.tmatch.index < 0)
174 for (
auto const& slc : sr->slc) {
175 if (slc.tmatch.index < 0)
247 {
"nocut",
"No cut",
kNoCut, kBlack},
252 {
"recoshw",
"Reconstructed shower",
kRecoShower, kBlack},
259 {
"recocut",
"Reconstruction (all)",
kRecoCut, kBlack},
260 {
"everything",
"Full selection",
kFullCut, kBlack},
263 {
"N1flash",
"N1 Flash score",
kN1Flash, kBlack},
264 {
"N1pandnu",
"N1 Neutrino score",
kN1Pandora, kBlack},
265 {
"N1recoshw",
"N1 Reconstructed shower",
kN1RecoShower, kBlack},
267 {
"N1dedx",
"N1 Shower dE/dx",
kN1Dedx, kBlack},
268 {
"N1convgap",
"N1 Conversion gap",
kN1ConvGap, kBlack},
269 {
"N1trklen",
"N1 Track length",
kN1TrkLen, kBlack},
270 {
"N1density",
"N1 Shower density",
kN1Density, kBlack},
271 {
"N1energy",
"N1 Shower energy",
kN1Energy, kBlack},
272 {
"N1recocut",
"N1 Reconstruction (all)",
kN1Reco, kBlack}
276 {
"nospillcut",
"No spill cut",
kNoSpillCut, kBlack},
280 {
"recocutspill",
"Reconstruction (all) spill",
kRecoSpillCut, kBlack},
281 {
"everythingspill",
"Full selection spill",
kFullSpillCut, kBlack}
285 {{
"nocut_spill",
"All Slices",
kNoSpillCut, kBlack},
const Binning kLengthBinning
const SpillCut kIsCosmicSpill([](const caf::SRSpillProxy *sr){return(sr->mc.nnu==0);})
const Cut kShowerConvGapCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].conversion_gap< 3.25f);})
const Cut kNoCut([](const caf::SRSliceProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
std::vector< PlotDef > plots_slice
std::vector< SelDef > types_slice
const Binning kCRTXFDBinning
std::vector< SelDefSpill > types_spill
const Var kRecoShower_EndX([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.x+shw->dir.x *shw->len):-9999.;})
const Var kRecoShower_OpenAngle([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?180.*shw->open_angle/M_PI:-5.;})
const SpillCut kNueCCSpill
const Cut kShowerDensityCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].density > 4.5);})
const Cut kIsNC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
Is this a Neutral Current event?
Represent the binning of a Spectrum's x-axis.
const SpillMultiVar kCRTHitX([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.x);}return positions;})
const Binning kTimeBinning
std::vector< SelDefSpill > sels_spill
const Binning kDensityBinning
const Binning kCRTYFDBinning
const SpillMultiVar kCRTHitTimeFD([](const caf::SRSpillProxy *sr){std::vector< double > times;for(const auto &hit:sr->crt_hits){auto thistime=hit.time-1600.;times.push_back(thistime);}return times;})
const Binning kEnergyBinning
const Binning kBDTBinning
const Var kRecoShower_StartX([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.x):-9999.;})
const Var kSlcFlashScore([](const caf::SRSliceProxy *slc) -> double{return((bool) kSlcHasFlash(slc)?(float) slc->fmatch.score:-5.f);})
const Cut kSlcFlashMatchCut([](const caf::SRSliceProxy *slc){return(kSlcHasFlashMatch(slc)&&slc->fmatch.score >0 &&slc->fmatch.score< 6);})
const Var kTruthEnergy([](const caf::SRSliceProxy *slc) -> double{return(kHasTruthMatch(slc)?(float) slc->truth.E:-5.f);})
const Var kRecoShower_StartY([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.y):-9999.;})
const Binning kOpenAngleBinning
process_name opflashCryoW ana
const Cut kShowerEnergyCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.2f);})
const Binning kLowEnergyGeVBinning
const SpillCut kThisCosmicSpill
const Cut kIsNue([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==12;})
const SpillCut kNuScoreSpillCut([](const caf::SRSpillProxy *sr){unsigned int counter(0);for(auto const &slc:sr->slc){continue;++counter;}return counter;})
const Var kSlcVtxX([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.x;})
const SpillVar kTruthNuEnergy([](const caf::SRSpillProxy *sr) -> double{return(sr->mc.nnu!=1?-5.f:(float) sr->mc.nu[0].E);})
const SpillCut kRecoSpillCut([](const caf::SRSpillProxy *sr){unsigned int counter(0);for(auto const &slc:sr->slc){continue;++counter;}return counter;})
const Var kSlcVtxY([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.y;})
std::vector< SelDefSpill > crtsels_spill
const SpillCut kContainedSpill([](const caf::SRSpillProxy *sr){unsigned int counter(0);for(auto const &slc:sr->slc){continue;++counter;}return counter;})
const Var kRecoShower_BestEnergy([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->bestplane_energy):-5;})
const Cut kHasNu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0;})
const SpillMultiVar kCRTHitPE([](const caf::SRSpillProxy *sr){std::vector< double > pes;for(const auto &hit:sr->crt_hits){pes.push_back(hit.pe);}return pes;})
const SpillCut kIsNueSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==12);})
auto counter(T begin, T end)
Returns an object to iterate values from begin to end in a range-for loop.
const SpillCut kTotalSpill
const Binning kPositionXFDBinning
const Cut kNueFlashScoreFDCut
const Var kSlcVtxZ([](const caf::SRSliceProxy *slc) -> double{return slc->vertex.z;})
const Cut kSlcIsRecoNu([](const caf::SRSliceProxy *slc){return!slc->is_clear_cosmic;})
const Var kRecoShower_EndY([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.y+shw->dir.y *shw->len):-9999.;})
const Cut kIsNumu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0 &&abs(slc->truth.pdg)==14;})
caf::Proxy< caf::StandardRecord > SRSpillProxy
const SpillMultiVar kCRTHitY([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.y);}return positions;})
const Var kRecoShower_Length([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->len):-5.;})
const Var kRecoShower_Energy([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->plane[1].energy):-5.;})
const SpillMultiVar kCRTHitZ([](const caf::SRSpillProxy *sr){std::vector< double > positions;for(const auto &hit:sr->crt_hits){positions.push_back(hit.position.z);}return positions;})
const Cut kSlcNuScoreCut([](const caf::SRSliceProxy *slc){return(kSlcIsRecoNu(slc)&&slc->nu_score >0.4);})
const SpillCut kNoSpillCut([](const caf::SRSpillProxy *){return true;})
The simplest possible cut: pass everything, used as a default.
const SpillCut kNumuCCSpill
const Cut kNueTrackLenCut([](const caf::SRSliceProxy *slc){return kLongestTrackLength(slc)< 110.f;})
const Var kRecoShower_StartZ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.z):-9999.;})
const Binning kPositionYFDBinning
const Binning kNueEnergyBinning
const Binning kDedxBinning
const SpillCut kIsNCSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return((bool) sr->mc.nu[0].isnc);})
const Cut kNuePandoraScoreFDCut
const Binning kPositionZFDBinning
std::vector< PlotDefSpill > plots_spill
const Cut kShowerdEdxCut([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_dEdx< 3.625f);})
const Var kRecoShower_Density([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->density):-5.;})
const SpillCut kIsNumuSpill([](const caf::SRSpillProxy *sr){if(kIsCosmicSpill(sr)||!kIsSingleNuSpill(sr)) return false;return(std::abs(sr->mc.nu[0].pdg)==14);})
const Binning kGapBinning
const Cut kRecoShower([](const caf::SRSliceProxy *slc){const int largestShwIdx(kLargestRecoShowerIdx(slc));return false;return(slc->reco.shw[largestShwIdx].bestplane_energy > 0.f &&slc->reco.shw[largestShwIdx].bestplane_dEdx > 0.f &&slc->reco.shw[largestShwIdx].conversion_gap > 0.f);})
const Binning kFlashBinning
Neutral-current interactions.
const SpillVar kSpillCounting
const Var kRecoShower_EndZ([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->start.z+shw->dir.z *shw->len):-9999.;})
const Binning kCRTZFDBinning
const Var kRecoShower_ConversionGap([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);return shw?double(shw->conversion_gap):-5.;})
std::vector< SelDef > sels_slice
std::vector< PlotDefMultiVar > crtplots_spill
const Var kRecoShower_BestdEdx([](const caf::SRSliceProxy *slc) -> double{const caf::SRShowerProxy *shw=LargestRecoShower(slc);if(!shw||shw->bestplane_dEdx< 0) return-5.;return shw->bestplane_dEdx;})
const Var kSlcNuScore([](const caf::SRSliceProxy *slc) -> double{return slc->nu_score;})
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
const SpillCut kCRTHitVetoFD([](const caf::SRSpillProxy *sr){for(auto const &crtHit:sr->crt_hits){auto thistime=crtHit.time-1600.;return false;}return true;})
const SpillVar kTruthLeptonEnergy([](const caf::SRSpillProxy *sr) -> double{if(sr->mc.nnu!=1) return-5.f;for(auto const &prim:sr->mc.nu[0].prim){if(std::abs(prim.pdg)!=11 &&std::abs(prim.pdg)!=13) continue;return prim.startE;}return-5.f;})
const SpillCut kFullSpillCut([](const caf::SRSpillProxy *sr){unsigned int counter(0);for(auto const &slc:sr->slc){continue;++counter;}return counter;})
const SpillCut kFlashMatchSpillCut([](const caf::SRSpillProxy *sr){unsigned int counter(0);for(auto const &slc:sr->slc){continue;++counter;}return counter;})
const Cut kNueNumShowersCut([](const caf::SRSliceProxy *slc){return((unsigned int) kRecoShowers_EnergyCut(slc)==1);})
const Var kLongestTrackLength([](const caf::SRSliceProxy *slc) -> double{const caf::SRTrackProxy *trk=LongestRecoTrack(slc);return trk?double(trk->len):-5.;})