NumubarCCpi0_Cuts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Cut.h"
6 
7 #include "TMath.h"
8 
9 namespace ana
10 {
11  namespace numubarccpi0
12  {
13  //====================//
14  // Truth cuts //
15  //====================//
16  extern const Cut kTrueFiducial;
17  extern const Cut kIsNumuCC;
18  extern const Cut kIsNC;
19  extern const Cut kIsNu;
20  extern const Cut kIsAntiNu;
21 
24 
25  //======================//
26  // Preselection //
27  //======================//
28  extern const Cut kThreePngPlus;
29  extern const Cut kIsFiducial;
30  extern const Cut kNumuMyQuality;
31  extern const Cut kNumuTightContainND;
32 
33  const Cut kMuonIDCut = kMuonID > 0.24;
34 
36  kMuonIDCut && // PID cut
37  kIsFiducial && // fiducial cut
38  kNumuMyQuality && // ensures reconstruction
39  kNumuTightContainND; // containment
40 
41  //=====================//
42  // Signal cuts //
43  //=====================//
44  const Cut kNumuCC = kTrueFiducial && kIsNumuCC;
45  const Cut kNC = kTrueFiducial && kIsNC;
46 
47  const Cut kSignal = kNumuCC && kPrimaryPi0;
48  const Cut kNuSig = kSignal && kIsNu;
49  const Cut kAntiNuSig = kSignal && kIsAntiNu;
50  const Cut kBkg = !kSignal;
51 
54  const Cut kSecoPi0 = !kPrimaryPi0 && kSecondaryPi0;
55  const Cut kNoPi0 = !kPrimaryPi0 && !kSecondaryPi0;
56  const Cut kHasPi0 = kPrimaryPi0 || kSecondaryPi0;
57 
58  const Cut kIsOther = !kTrueFiducial || (kTrueFiducial && !kIsNC && !kIsNumuCC);
59 
60  const Cut kSignal_fixed = kNumuCC && kHasPi0;
62 
63  //=========================//
64  // Prong NHit Cuts //
65  //=========================//
69 
73 
77 
81 
82  const Cut kProngNHitCut4_4view = kProng1NHitCut4_4view && kProng2NHitCut4_4view;
83  const Cut kProngNHitCut4_emid = kProng1NHitCut4_emid && kProng2NHitCut4_emid;
84  const Cut kProngNHitCut4_5label = kProng1NHitCut4_5label && kProng2NHitCut4_5label;
85 
86  const Cut kProngNHitCut6_4view = kProng1NHitCut6_4view && kProng2NHitCut6_4view;
87  const Cut kProngNHitCut6_emid = kProng1NHitCut6_emid && kProng2NHitCut6_emid;
88  const Cut kProngNHitCut6_5label = kProng1NHitCut6_5label && kProng2NHitCut6_5label;
89 
90  //========================//
91  // Selection Cuts //
92  //========================//
93  const Cut kPresel = kNumuMyQuality && kNumuTightContainND && kIsFiducial;
94  const Cut kNumuCCsel = kPresel && kMuonIDCut;
95  const Cut kMuonE40Cut = kRecoMuKE > 0.40;
96  const Cut kPngPresel = kNumuCCsel && kMuonE40Cut && kThreePngPlus;
97 
103 
104  } // end of namespace numubarccpi0
105 } // end of namespace ana
const Var kProng1Score_emid([](const caf::SRProxy *sr){int png1=kProng1ID_emid(sr);if(png1< 0) return-5.0f;const auto &p1=sr->vtx.elastic.fuzzyk.png[png1];return(float)(p1.spprongcvnpartnumuccemid.emid);})
const Cut kProng2NHitCut6_5label
const Cut kProng1NHitCut6_5label
const Cut kProng2NHitCut4_4view
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kProngNHitCut6_emid
const Cut kThreePngPlus([](const caf::SRProxy *sr){if(!(sr->vtx.elastic.IsValid)) return false;return sr->vtx.elastic.fuzzyk.npng >=3;})
const Cut kProng1NHitCut6_4view
const Cut kProng2NHitCut6_4view
const Var kProng2Score_emid([](const caf::SRProxy *sr){int png2=kProng2ID_emid(sr);if(png2< 0) return-5.0f;const auto &p2=sr->vtx.elastic.fuzzyk.png[png2];return(float)(p2.spprongcvnpartnumuccemid.emid);})
const Var kProng2Score_5label([](const caf::SRProxy *sr){int png2=kProng2ID_5label(sr);if(png2< 0) return-5.0f;const auto &p2=sr->vtx.elastic.fuzzyk.png[png2];return(float)(p2.spprongcvnpart5label.emid);})
const Var kProng2NHit_5label([](const caf::SRProxy *sr){int png2=kProng2ID_5label(sr);if(png2< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png2].nhit;})
const Var kProng2NHit_emid([](const caf::SRProxy *sr){int png2=kProng2ID_emid(sr);if(png2< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png2].nhit;})
const Cut kProngScoreCut_5label_Cut6
const Cut kProngNHitCut4_emid
const Var kProng2Score_4view([](const caf::SRProxy *sr){int png2=kProng2ID_4view(sr);if(png2< 0) return-5.0f;const auto &p2=sr->vtx.elastic.fuzzyk.png[png2];return(float)(p2.cvnpart.emid);})
const Cut kNumuMyQuality([](const caf::SRProxy *sr){return(sr->trk.kalman.ntracks > 0 && sr->slc.nhit > 20 && sr->slc.ncontplanes > 4);})
const Cut kProngNHitCut4_5label
const Cut kNumuTightContainND([](const caf::SRProxy *sr){if(!(sr->vtx.elastic.IsValid)) return false;int ibesttrk=kBestTrack(sr);for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;++i){TVector3 start=sr->vtx.elastic.fuzzyk.png[i].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 20.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(int i=0;i< int(sr->trk.kalman.ntracks);++i){if(i==ibesttrk) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275|| sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return false;return((sr->trk.kalman.tracks[ibesttrk].stop.Z()< 1275 ||sr->trk.kalman.tracks[ibesttrk].trkyposattrans< 55) &&sr->trk.kalman.tracks[ibesttrk].trkfwdcellnd > 5 &&sr->trk.kalman.tracks[ibesttrk].trkbakcellnd > 10);})
const Cut kProng1NHitCut4_emid
const Cut kProng2NHitCut6_emid
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
const Var kProng1Score_4view([](const caf::SRProxy *sr){int png1=kProng1ID_4view(sr);if(png1< 0) return-5.0f;const auto &p1=sr->vtx.elastic.fuzzyk.png[png1];return(float)(p1.cvnpart.emid);})
const Cut kProngScoreCut_4view
const Cut kProng1NHitCut4_4view
const Var kMuonID([](const caf::SRProxy *sr){int ibesttrk=kBestTrack(sr);if(sr->trk.kalman.ntracks< 1) return-5.0f;if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return-5.0f;return(float) sr->trk.kalman.tracks[ibesttrk].muonid;})
const Cut kProngNHitCut6_5label
const Cut kProng1NHitCut6_emid
const Var kProng1NHit_4view([](const caf::SRProxy *sr){int png1=kProng1ID_4view(sr);if(png1< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png1].nhit;})
const Cut kIsFiducial([](const caf::SRProxy *sr){int ibesttrk=kBestTrack(sr);if(sr->trk.kalman.ntracks< 1) return false;if(ibesttrk< 0||ibesttrk >=int(sr->trk.kalman.ntracks)) return false;bool isfid=(sr->trk.kalman.tracks[ibesttrk].start.X()< vtxmax.X()&& sr->trk.kalman.tracks[ibesttrk].start.X() > vtxmin.X()&& sr->trk.kalman.tracks[ibesttrk].start.Y() > vtxmin.Y()&& sr->trk.kalman.tracks[ibesttrk].start.Y()< vtxmax.Y()&& sr->trk.kalman.tracks[ibesttrk].start.Z() > vtxmin.Z()&& sr->trk.kalman.tracks[ibesttrk].start.Z()< vtxmax.Z());return isfid;})
const Cut kProngScoreCut_5label_Cut4
const Var kProng1Score_5label([](const caf::SRProxy *sr){int png1=kProng1ID_5label(sr);if(png1< 0) return-5.0f;const auto &p1=sr->vtx.elastic.fuzzyk.png[png1];return(float)(p1.spprongcvnpart5label.emid);})
const Var kProng2NHit_4view([](const caf::SRProxy *sr){int png2=kProng2ID_4view(sr);if(png2< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png2].nhit;})
const Var kProng1NHit_5label([](const caf::SRProxy *sr){int png1=kProng1ID_5label(sr);if(png1< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png1].nhit;})
const Cut kProng2NHitCut4_emid
const Cut kProng1NHitCut4_5label
const Cut kProngNHitCut6_4view
const Var kProng1NHit_emid([](const caf::SRProxy *sr){int png1=kProng1ID_emid(sr);if(png1< 0) return-5;return(int) sr->vtx.elastic.fuzzyk.png[png1].nhit;})
const Cut kProngScoreCut_emid_Cut4
const Cut kProngScoreCut_emid_Cut6
const Cut kProng2NHitCut4_5label
const Cut kProngNHitCut4_4view