NuebarCCIncCuts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Cut.h"
4 //#include "3FlavorAna/Cuts/NueCutsSecondAna.h"
7 
8 
11 
12 #include "TVector3.h"
13 namespace nuebarccinc
14 {
16 
17  ///////////////////////////////////////////////////////////
18  // Selection
19  //////////////////////////////////////////////////////////
20  // Cut on ND vertex position used in FHC analysis
21  const TVector3 vNueCCIncFiducialMin(-130,-140,150);
22  const TVector3 vNueCCIncFiducialMax(150,140,800);
23 
24  // Detector limits
25  const TVector3 tvtxmin(-191, -187, 0 );
26  const TVector3 tvtxmax( 192, 194, 1270);
27 
29 
30  // reimplement from fhc
32  extern const ana::Cut kNueCCIncFiducial ;
34 
35  // Preselection from nue cc inclusive analysis was verified to perform
36  // optimally also on RHC sample
40 
41  extern const ana::Cut kDQ; // = ana::kNueSecondAnaDQ;
42  extern const ana::Cut kFrontPlanes; // = ana::kNueNDSecondAnaFrontPlanes;
43  extern const ana::Cut kNHitsCut; // = ana::kNueNDSecondAnaNHits;
44  const ana::Cut kRemid = ana::kRemID < -0.40;//0.40; //Optimize using uncertainty
45  // on the cross section
46 
47  const ana::Cut kMuonIDCut = nuebarccinc::kMuonID < 0 && nuebarccinc::kMuonID >= -1;//-0.35; //Optimized using uncertainty on
48  // the cross section
49 
50  const ana::Cut kCVNNueIDCut = kCVNNueID > 0.5;//0.7; //0.85; //0.78;
51  //Optimize using uncertainty
52  // on the cross section and
53  // statistical FoM
54 
56 
58  kDQ &&
59  kNuebarCCIncFiducial &&
60  kNuebarCCIncContainment &&
61  kFrontPlanes &&
62  kNHitsCut;
63 
64  const ana::Cut kPreselection = kPreselectionLoose && kMuonIDCut && kRecoElectronPhaseSpaceCut;
65 
66  // looser containment and fiducial
69 
70  ///////////////////////////////////////////////////////////
71  // MC Cuts
72  //////////////////////////////////////////////////////////
74  const ana::Cut kTrueElectronPhaseSpaceCut = ana::CutFromNuTruthCut(kTrueElectronPhaseSpaceCutST);
75 
76 
77  // interaction modes
78  extern const ana::NuTruthCut kNueCCST;
80  extern const ana::NuTruthCut kNumuCCST;
82  extern const ana::NuTruthCut kNCST;
83  extern const ana::NuTruthCut kPi0ST;
84 
85  extern const ana::Cut kMC;
86  const ana::Cut kNueCC = ana::CutFromNuTruthCut(kNueCCST );
87  const ana::Cut kNuebarCC = ana::CutFromNuTruthCut(kNuebarCCST );
88  const ana::Cut kNumuCC = ana::CutFromNuTruthCut(kNumuCCST );
92 
93  const ana::Cut kOther = (!kNueCC && !kNuebarCC &&
94  !kNumuCC && !kNumubarCC &&
95  !kNC);
96 
97  const ana::Cut kIsNCPi0 = kNC && kIsPi0;
98  const ana::Cut kIsNCNotPi0 = kNC && !kIsPi0;
99 
100  const ana::Cut kIsNumuCCPi0 = kNumuCC && kIsPi0;
101  const ana::Cut kIsNumuCCNotPi0 = kNumuCC && !kIsPi0;
102  const ana::Cut kIsNumubarCCPi0 = kNumubarCC && kIsPi0;
103  const ana::Cut kIsNumubarCCNotPi0 = kNumubarCC && !kIsPi0;
104 
105  const ana::Cut kIsOther2 = (!kNueCC && !kNuebarCC &&
106  !kIsNCPi0 && !kIsNCNotPi0 && !kNumubarCC &&
107  !kIsNumuCCPi0 && !kIsNumuCCNotPi0 &&
108  !kIsNumubarCCPi0 && !kIsNumubarCCNotPi0);
109 
111 
112  //Definitions
113  struct SelDef{
116  };
117 
118  struct SelDefST{
121  };
122 
123  struct Style {
125  int color;
126  int line_style = 1;
127  };
128 
129  const int kNumSels = 8;
130  const int kNumChns = 8;
131  const int kNumSels2 = 8;
132 
134  {"slicing", ana::kNoCut},
135  {"dq", kDQ},
136  {"fiducial", kDQ && kNuebarCCIncFiducial},
137  {"containment", kDQ && kNuebarCCIncFiducial && kNuebarCCIncContainment},
138  {"frontplanes", kDQ && kNuebarCCIncFiducial && kNuebarCCIncContainment && kFrontPlanes},
139  {"nhits", kDQ && kNuebarCCIncFiducial && kNuebarCCIncContainment && kFrontPlanes && kNHitsCut},
140  {"muonid", kDQ && kNuebarCCIncFiducial && kNuebarCCIncContainment && kFrontPlanes && kNHitsCut && kMuonIDCut},
141  {"cvn", kDQ && kNuebarCCIncFiducial && kNuebarCCIncContainment && kFrontPlanes && kNHitsCut && kMuonIDCut && kCVNNueIDCut},
142  };
143 
144  const SelDef chns[kNumChns] = {
145  {"mc", kMC},
146  {"nuebarcc", kMC && kNuebarCC && ana::CutFromNuTruthCut(kNuebarCCIncFiducialST) },
147  {"nuecc", kMC && kNueCC},
148  {"nc", kMC && kNC},
149  {"numucc", kMC && kNumuCC},
150  {"numubarcc", kMC && kNumubarCC},
151  {"nuebarcc_nonfiducial", kMC && kNuebarCC && !ana::CutFromNuTruthCut(kNuebarCCIncFiducialST)},
152  {"other", kMC && kOther},
153  };
154 
156  {"MC Total", kRed},
157  {"#bar{#nu}_{e}", kAzure+10},
158  {"#nu_{e}", kAzure+3},
159  {"NC", kGreen+1},
160  {"#nu_{#mu}", kViolet+1},
161  {"#bar{#nu}_{#mu}", kMagenta},
162  {"#bar{#nu}_{e} Non Fiducial", kGray+1},
163  {"Other", kOrange+3},
164  };
165 
166  const int kNumChnsExtra = 13;
167 
169  {"mc", kMC},
170  {"nuecc", kMC && kNueCC},
171  {"nuebarcc", kMC && kNuebarCC},
172  {"numucc_pi0", kMC && kIsNumuCCPi0},
173  {"numucc_not_pi0", kMC && kIsNumuCCNotPi0},
174  {"numubarcc_pi0", kMC && kIsNumubarCCPi0},
175  {"numubarcc_not_pi0", kMC && kIsNumubarCCNotPi0},
176  {"numubarcc", kMC && kNumubarCC},
177  {"nc_pi0", kMC && kIsNCPi0},
178  {"nc_not_pi0", kMC && kIsNCNotPi0},
179  {"other", kMC && kIsOther2},
180  {"non_pi0_background", kMC && (kIsNumuCCNotPi0 ||
181  kIsNumubarCCNotPi0 ||
182  kNumubarCC ||
183  kIsNCNotPi0 ||
184  kIsOther2 )},
185  {"background", kMC && !kNuebarCC},
186  };
187 
188 
189  const int kNumIntChnsST = 7;
190  const int kNumIntChns = 8;
191 
193  {"nocut", kMC},
194  {"cc", !ana::kIsNC},
195  {"qe", ana::kIsQE},
196  {"res", ana::kIsRes},
197  {"dis", ana::kIsDIS},
198  {"coh", ana::kIsCoh},
199  {"mec", ana::kIsDytmanMEC},
200  {"other",
201  !ana::kIsQE &&
202  !ana::kIsRes &&
203  !ana::kIsDIS &&
204  !ana::kIsCoh &&
206  };
207 
209  {"cc", kNuebarCCIncTrueSignalST},
210  {"qe", kNuebarCCIncTrueSignalST && ana::kIsQE_NT},
211  {"res", kNuebarCCIncTrueSignalST && ana::kIsRes_NT},
212  {"dis", kNuebarCCIncTrueSignalST && ana::kIsDIS_NT},
213  {"coh", kNuebarCCIncTrueSignalST && ana::kIsCoh_NT},
214  {"mec", kNuebarCCIncTrueSignalST && ana::kIsDytmanMEC_NT},
215  {"other",
216  kNuebarCCIncTrueSignalST &&
217  !ana::kIsQE_NT &&
218  !ana::kIsRes_NT &&
219  !ana::kIsDIS_NT &&
220  !ana::kIsCoh_NT &&
221  !ana::kIsDytmanMEC_NT},
222  };
223 
224 } //end namespace ana
const Cut kIsQE
Definition: TruthCuts.cxx:104
enum BeamMode kOrange
const int kNumChnsExtra
const ana::Var kCVNNueID
const ana::Cut kCVNNueIDCut
const ana::NuTruthCut kNuebarCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==-12 && truth->pdgorig==-12);})
enum BeamMode kRed
const int kNumSels2
const TVector3 vNueCCIncFiducialMin(-130,-140, 150)
const NuTruthCut kIsCoh_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kCoh);})
Definition: TruthCuts.h:73
const ana::Cut kIsNumubarCCPi0
const ana::Cut kNuebarCC
const ana::Cut kNumuCC
const Cut kIsRes
Definition: TruthCuts.cxx:111
const NuTruthCut kIsRes_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kRes);})
Definition: TruthCuts.h:67
const ana::Cut kIsPi0
const ana::Cut kFrontPlanes
const ana::NuTruthCut kNumuCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==14 && truth->pdgorig==14);})
const ana::Cut kTrueElectronPhaseSpaceCut
const ana::NuTruthCut kTrueDetectorST([](const caf::SRNeutrinoProxy *sr){return(sr->vtx.X()< tvtxmax.X()&&sr->vtx.X() > tvtxmin.X()&&sr->vtx.Y() > tvtxmin.Y()&&sr->vtx.Y()< tvtxmax.Y()&&sr->vtx.Z() > tvtxmin.Z()&&sr->vtx.Z()< tvtxmax.Z());})
const Cut kIsDIS
Definition: TruthCuts.cxx:118
const ana::NuTruthCut kNueCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==12 && truth->pdgorig==12);})
const ana::NuTruthCut kNuebarCCIncFiducialST
const ana::Cut kNC
const SelDef chns[kNumChns]
const ana::NuTruthCut kNueCCIncFiducialST([](const caf::SRNeutrinoProxy *sr){return(sr->vtx.X()< vNueCCIncFiducialMax.X()&& sr->vtx.X() > vNueCCIncFiducialMin.X()&& sr->vtx.Y()< vNueCCIncFiducialMax.Y()&& sr->vtx.Y() > vNueCCIncFiducialMin.Y()&& sr->vtx.Z()< vNueCCIncFiducialMax.Z()&& sr->vtx.Z() > vNueCCIncFiducialMin.Z());})
const NuTruthCut kIsDIS_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kDIS);})
Definition: TruthCuts.h:70
const Cut kIsDytmanMEC
Definition: TruthCuts.cxx:187
const ana::Cut kIsNumuCCPi0
const ana::NuTruthCut kNumubarCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==-14 && truth->pdgorig==-14);})
const ana::Cut kIsNumuCCNotPi0
const ana::Cut kMuonIDCut
const int kNumChns
const Var kRemID
PID
Definition: Vars.cxx:81
const ana::Cut kNuebarCCIncContainmentLoose([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return false;TVector3 start=sr->vtx.elastic.fuzzyk.png[0].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[0].shwlid.stop;for(uint ix=0;ix< sr->vtx.elastic.fuzzyk.nshwlid;ix++){TVector3 start_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.start;TVector3 stop_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.stop;if(std::max(start_muoncatcher.Z(), stop_muoncatcher.Z()) > 1250.0) return false;}if(sr->sel.nuecosrej.distallpngtop< 30) return false;if(sr->sel.nuecosrej.distallpngbottom< 10) return false;if(sr->sel.nuecosrej.distallpngeast< 30) return false;if(sr->sel.nuecosrej.distallpngwest< 10) return false;if(sr->sel.nuecosrej.distallpngfront< 100) return false;return true;})
const ana::Cut kNumubarCC
const Cut kIsNC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return!sr->mc.nu[0].iscc;})
Is this a Neutral Current event?
Definition: TruthCuts.h:8
const SelDef interaction_chns[kNumIntChns]
const ana::NuTruthCut kPi0ST([](const caf::SRNeutrinoProxy *truth){if(truth->prim.size()==0) return false;int nbofprim=truth->prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(truth->prim[i].pdg==111){countpi++;}}if(countpi==0) return false;if(countpi > 0) return true;return false;})
const NuTruthCut kIsQE_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kQE);})
Select truly quasielastic events.
Definition: TruthCuts.h:64
const ana::Cut kRemid
const ana::Cut kNueCCIncFiducial([](const caf::SRProxy *sr){assert(sr->vtx.elastic.IsValid &&"Must apply DQ cuts");return(sr->vtx.elastic.vtx.X()< vNueCCIncFiducialMax.X()&& sr->vtx.elastic.vtx.X() > vNueCCIncFiducialMin.X()&& sr->vtx.elastic.vtx.Y()< vNueCCIncFiducialMax.Y()&& sr->vtx.elastic.vtx.Y() > vNueCCIncFiducialMin.Y()&& sr->vtx.elastic.vtx.Z()< vNueCCIncFiducialMax.Z()&& sr->vtx.elastic.vtx.Z() > vNueCCIncFiducialMin.Z());return true;})
const ana::Cut kPreselectionLoose
const ana::Cut kNuebarCCIncFiducial
const ana::Cut kHasReconstructedElectronProng([](const caf::SRProxy *sr){return true_electron_png(sr) >=0;})
const ana::Cut kPreselection
const TVector3 vNueCCIncFiducialMax(150, 140, 800)
const ana::Cut kOther
const ana::Cut kNHitsCut
const NuTruthCut kIsDytmanMEC_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kMEC);})
Definition: TruthCuts.h:90
const SelDefST interaction_chns_st[kNumIntChnsST]
const SelDef cut_flow2[kNumSels2]
const ana::Cut kIsNumubarCCNotPi0
const ana::Cut kNuebarCCIncContainment
const int kNumIntChnsST
const ana::Cut kIsNCPi0
const Style chns_style[kNumChns]
enum BeamMode kViolet
const ana::Cut kMC([](const caf::SRProxy *sr){if(sr->hdr.ismc) return true;return false;})
const ana::Cut kIsNCNotPi0
const TVector3 tvtxmin(-191,-187, 0)
const ana::Cut kNueCCIncContainment([](const caf::SRProxy *sr){if(sr->vtx.elastic.fuzzyk.nshwlid< 1) return false;TVector3 start=sr->vtx.elastic.fuzzyk.png[0].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[0].shwlid.stop;for(uint ix=0;ix< sr->vtx.elastic.fuzzyk.nshwlid;ix++){TVector3 start_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.start;TVector3 stop_muoncatcher=sr->vtx.elastic.fuzzyk.png[ix].shwlid.stop;if(std::max(start_muoncatcher.Z(), stop_muoncatcher.Z()) > 1250.0) return false;}if(sr->sel.nuecosrej.distallpngtop< 50) return false;if(sr->sel.nuecosrej.distallpngbottom< 30) return false;if(sr->sel.nuecosrej.distallpngeast< 50) return false;if(sr->sel.nuecosrej.distallpngwest< 30) return false;if(sr->sel.nuecosrej.distallpngfront< 150) return false;return true;})
const ana::NuTruthCut kTrueElectronPhaseSpaceCutST([](const caf::SRNeutrinoProxy *sr){float costheta=kTrueElectronCosThetaST(sr);float elece=kTrueElectronEST(sr);if((costheta >=0.97)&&(elece >=1.4)&&(elece< 6.0)) return true;if((costheta >=0.94)&&(costheta< 0.97)&&(elece >=1.4)&&(elece< 4.1)) return true;if((costheta >=0.90)&&(costheta< 0.94)&&(elece >=1.0)&&(elece< 2.5)) return true;if((costheta >=0.85)&&(costheta< 0.90)&&(elece >=1.0)&&(elece< 2.0)) return true;return false;})
const ana::Cut kDQ([](const caf::SRProxy *sr){if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.fuzzyk.npng==0) return false;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx<=5||sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity<=5) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap > 100) return false; if(sr->vtx.elastic.fuzzyk.nshwlid >=2){if((sr->vtx.elastic.fuzzyk.png[0].shwlid.dir). Dot(sr->vtx.elastic.fuzzyk.png[1].shwlid.dir)< -0.95) return false;}float xyhitdiff=abs(sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx-sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity);float xyhitsum=sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx+sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;if(xyhitdiff/xyhitsum >=0.4) return false;float nhitall=0.0;for(unsigned int j=0;j< sr->vtx.elastic.fuzzyk.nshwlid;j++){nhitall+=sr->vtx.elastic.fuzzyk.png[j].shwlid.nhit;}if(nhitall/sr->slc.nhit<=0.7) return false;return true;})
const int kNumSels
const int kNumIntChns
const ana::Cut kRecoElectronPhaseSpaceCut([](const caf::SRProxy *sr){float costheta=kRecoElectronCosTheta(sr);float elece=kElectronE(sr);if((costheta >=0.97)&&(elece >=1.4)&&(elece< 6.0)) return true;if((costheta >=0.94)&&(costheta< 0.97)&&(elece >=1.4)&&(elece< 4.1)) return true;if((costheta >=0.90)&&(costheta< 0.94)&&(elece >=1.0)&&(elece< 2.5)) return true;if((costheta >=0.85)&&(costheta< 0.90)&&(elece >=1.0)&&(elece< 2.0)) return true;return false;})
const ana::NuTruthCut kNCST([](const caf::SRNeutrinoProxy *truth){return!truth->iscc;})
const ana::Cut kNueCC
enum BeamMode kGreen
const SelDef chns_extra[kNumChnsExtra]
const TVector3 tvtxmax(192, 194, 1270)
const ana::NuTruthCut kNuebarCCIncTrueSignalST
const ana::Cut kIsOther2
const Cut kIsCoh
Definition: TruthCuts.cxx:133
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
const ana::Cut kNuebarCCIncFiducialLoose([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->vtx.elastic.vtx.X()< -165.0) return false;if(sr->vtx.elastic.vtx.X() > 165.0) return false;if(sr->vtx.elastic.vtx.Y()< -165.0) return false;if(sr->vtx.elastic.vtx.Y() > 165.0) return false;if(sr->vtx.elastic.vtx.Z()< 100.0) return false;if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;return true;})
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
enum BeamMode string