NueCCIncCuts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Cut.h"
7 #include "3FlavorAna/Cuts/NueCutsSecondAna.h"
10 #include "CAFAna/Vars/Vars.h"
11 #include "CAFAna/Cuts/TruthCuts.h"
12 
15 
16 #include "TMath.h"
17 #include "TVector3.h"
18 
19 
20 namespace ana
21 {
22  namespace nueccinc
23  {
24  // Cut on ND vertex position
25  const Cut kcNueCCIncFiducial(
26  [](const caf::SRProxy* sr)
27  {
28  assert(sr->vtx.nelastic > 0 &&
29  "Must apply DQ cuts");
30  if (sr->vtx.elastic[0].vtx.X() < -130.0)
31  return false;
32  if (sr->vtx.elastic[0].vtx.X() > 150.0)
33  return false;
34  if (sr->vtx.elastic[0].vtx.Y() < -140.0)
35  return false;
36  if (sr->vtx.elastic[0].vtx.Y() > 140.0)
37  return false;
38  if (sr->vtx.elastic[0].vtx.Z() < 150.0)
39  return false;
40  if (sr->vtx.elastic[0].vtx.Z() > 800.0)
41  return false;
42  return true;
43  });
44 
45  const Cut
46  kcNueCCIncContainment([](const caf::SRProxy* sr){
47  if(sr->vtx.elastic[0].fuzzyk.nshwlid < 1) return false;
48  TVector3 start = sr->vtx.elastic[0].fuzzyk.png[0].shwlid.start;
49  TVector3 stop = sr->vtx.elastic[0].fuzzyk.png[0].shwlid.stop;
50 
51  //Make sure none of the event goes into the muon catcher
52  for(uint ix = 0; ix < sr->vtx.elastic[0].fuzzyk.nshwlid; ix++){
53  TVector3 start_muoncatcher =
54  sr->vtx.elastic[0].fuzzyk.png[ix].shwlid.start;
55  TVector3 stop_muoncatcher =
56  sr->vtx.elastic[0].fuzzyk.png[ix].shwlid.stop;
57  if (std::max(start_muoncatcher.Z(),
58  stop_muoncatcher.Z()) > 1250.0) return false;
59  }
60 
61 
62  if(sr->sel.nuecosrej.distallpngtop < 50) return false;
63  if(sr->sel.nuecosrej.distallpngbottom < 30) return false;
64  if(sr->sel.nuecosrej.distallpngeast < 50) return false;
65  if(sr->sel.nuecosrej.distallpngwest < 30) return false;
66  if(sr->sel.nuecosrej.distallpngfront < 150) return false;
67  return true;
68  });
69 
70 
71  //Phase Space Cuts
73  ([](const caf::SRNeutrinoProxy* sr){
74  float costheta = kTrueElecCosthetaST(sr);
75  float elece = kTrueElecEST(sr);
76 
77  if( (costheta >= 0.97) && (elece >= 1.4) && (elece < 6.0))
78  return true;
79  if( (costheta >= 0.94) && (costheta < 0.97) &&
80  (elece >= 1.4) && (elece < 4.1))
81  return true;
82  if( (costheta >= 0.90) && (costheta < 0.94) &&
83  (elece >= 1.0) && (elece < 2.5))
84  return true;
85  if( (costheta >= 0.85) && (costheta < 0.90) &&
86  (elece >= 1.0) && (elece < 2.0))
87  return true;
88 
89  return false;
90  });
91 
93  ([](const caf::SRProxy* sr){
94  float costheta = kvRecoCos(sr);
95  float elece = kvElecE(sr);
96 
97  if( (costheta >= 0.97) && (elece >= 1.4) && (elece < 6.0))
98  return true;
99  if( (costheta >= 0.94) && (costheta < 0.97) &&
100  (elece >= 1.4) && (elece < 4.1))
101  return true;
102  if( (costheta >= 0.90) && (costheta < 0.94) &&
103  (elece >= 1.0) && (elece < 2.5))
104  return true;
105  if( (costheta >= 0.85) && (costheta < 0.90) &&
106  (elece >= 1.0) && (elece < 2.0))
107  return true;
108 
109  return false;
110  });
111 
112  //Selection Cuts
113  //--------------
114  const Cut kcDQ = kNueSecondAnaDQ;
115  const Cut kcFiducial = kNueNDSecondAnaFiducial;
116  const Cut kcContainment = kNueNDSecondAnaContain;
117  const Cut kcFrontPlanes = kNueNDSecondAnaFrontPlanes;
118  const Cut kcNHits = kNueNDSecondAnaNHits;
119  const Cut kcProngLength = kNueNDSecondAnaProngLength;
120  const Cut kcRemid = kRemID < 0.40;//Optimize using uncertainty
121  // on the cross section
122 
123  const Cut kcMuonIDCut = kMuonID < -0.20;//Optimized using uncertainty on
124  // the cross section
125 
126 
127  const Cut kcCVN = kvCVN2017 > 0.85; //0.78;
128  //Optimize using uncertainty
129  // on the cross section and
130  // statistical FoM
131 
133  //Non-optimized but
134  // need to test something
135 
137  kcNueCCIncContainment && kcFrontPlanes && kcNHits;
138 
139  const Cut kcPresel = kcPresel_loose && kcMuonIDCut;
140 
141  //MC Cuts
142  //---------------
143 
144  const Cut ktMC( [](const caf::SRProxy* sr){
145  if(sr->hdr.ismc) return true;
146  return false;
147  });
148 
149  const Cut ktSignal( [](const caf::SRProxy* sr){
150  if(sr->mc.nnu == 0) return false;
151  return (sr->mc.nu[0].iscc &&
152  (sr->mc.nu[0].pdg == 12) &&
153  (sr->mc.nu[0].pdgorig == 12));
154  });
155 
156  const Cut ktNuebarCC( [](const caf::SRProxy* sr){
157  if(sr->mc.nnu == 0) return false;
158  return (sr->mc.nu[0].iscc &&
159  (sr->mc.nu[0].pdg == -12) &&
160  (sr->mc.nu[0].pdgorig == -12));
161  });
162 
163  const Cut ktNumuCC( [](const caf::SRProxy* sr){
164  if(sr->mc.nnu == 0) return false;
165  return (sr->mc.nu[0].iscc &&
166  (sr->mc.nu[0].pdg == 14) &&
167  (sr->mc.nu[0].pdgorig == 14));
168  });
169 
170  const Cut ktNumubarCC( [](const caf::SRProxy* sr){
171  if(sr->mc.nnu == 0) return false;
172  return (sr->mc.nu[0].iscc &&
173  (sr->mc.nu[0].pdg == -14) &&
174  (sr->mc.nu[0].pdgorig == -14));
175  });
176 
177  const Cut ktNC( [](const caf::SRProxy* sr){
178  if(sr->mc.nnu == 0) return false;
179  return (!sr->mc.nu[0].iscc);
180  });
181 
182 
183  const Cut ktOther = (!ktSignal && !ktNuebarCC &&
184  !ktNumuCC && !ktNumubarCC &&
185  !ktNC);
186 
187 
188  const Cut ktIsPi0([](const caf::SRProxy* sr)
189  {
190  //float MassOfPi0=0.135;
191  //float kinetic=-10;
192  //float en = -99;
193 
194  if(sr->mc.nnu == 0) return false;
195  //if(sr->vtx.nelastic == 0) return false;
196  assert(sr->mc.nnu == 1);
197  //if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return false;
198  //if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;
199 
200  if(sr->mc.nu[0].prim.size() == 0) return false;
201 
202  int nbofprim=sr->mc.nu[0].prim.size();
203  int countpi=0;
204  for(int i = 0; i < nbofprim; i++){
205  if(sr->mc.nu[0].prim[i].pdg == 111){
206  //en= sr->mc.nu[0].prim[i].p.E;
207  //kinetic = en - MassOfPi0;
208  //if (kinetic==0) return false;
209  //if(kinetic > 0.5) countpi++;
210  countpi++;
211  }
212  }
213  if (countpi==0) return false;
214  if(countpi > 0) return true;
215  return false;
216 
217  });
218 
219 
220  const Cut ktIsNCPi0 = ktNC && ktIsPi0;
222 
225 
227  !ktIsNCPi0 && !ktIsNCNotPi0 && !ktNumubarCC &&
228  !ktIsNumuCCPi0 && !ktIsNumuCCNotPi0);
229 
230 
231  //Spill Truth Cuts
232  //----------------
233  const TVector3 vtxmin(-130,-140,150);//(-100,-160,150);
234  const TVector3 vtxmax(150,140,800);//(160,100,900);
235 
236  const TVector3* vtxmin_ptr = new TVector3(-130,-140,150);//(-100,-160,150);
237  const TVector3* vtxmax_ptr = new TVector3(150,140,800);
238 
239  const SpillTruthCut
240  kTrueFiducialST([]
241  (const caf::SRNeutrinoProxy* sr){
242  return (sr->vtx.X() < vtxmax.X() &&
243  sr->vtx.X() > vtxmin.X() &&
244  sr->vtx.Y() < vtxmax.Y() &&
245  sr->vtx.Y() > vtxmin.Y() &&
246  sr->vtx.Z() < vtxmax.Z() &&
247  sr->vtx.Z() > vtxmin.Z() );
248  });
249 
250 
251 
252  const SpillTruthCut kIsNueCCST([](const caf::SRNeutrinoProxy* truth)
253  {
254  return (truth->iscc &&
255  truth->pdg == 12 &&
256  truth->pdgorig==12);
257  });
258 
259  const SpillTruthCut kIsNumuCCST([](const caf::SRNeutrinoProxy* truth)
260  {
261  return (truth->iscc &&
262  abs(truth->pdg) == 14 &&
263  abs(truth->pdgorig)== 14);
264  });
265 
266  const SpillTruthCut kIsCorrectSignal = kTrueEST >= 1.0 && kTrueEST < 6.0
267  && kTrueElecEST >= 1.0 && kTrueElecEST < 6.0 &&
268  kTrueElecCosthetaST >= 0.75 && kTrueElecCosthetaST <= 1.01;
269 
270 
271  const SpillTruthCut kIsTrueSigST =
272  kTrueFiducialST && kIsNueCCST; //&& kTrueElecECutST && kTrueElecCosCutST
273  //; && kTrueElectronPhaseSpaceCutST;
274 
275  const SpillTruthCut kIsTrueNotNumuCCST =
277 
278  const Cut kIsTrueSig = CutFromNuTruthCut(kIsTrueSigST);
279 
280 
281  //Definitions
282  struct SelDef{
285  };
286 
287  struct SelDefST{
289  SpillTruthCut cut;
290  };
291 
292  const int kcNumSels = 10;
293  const int kcNumChns = 8;
294  const int kcNumSels2 = 8;
295 
297  {"slicing", kNoCut},
298  {"dq", kcDQ},
299  {"fiducial", kcDQ && kcFiducial},
300  {"containment", kcDQ && kcFiducial && kcContainment},
301  {"frontplanes", kcDQ && kcFiducial && kcContainment && kcFrontPlanes},
302  {"nhits", kcDQ && kcFiducial && kcContainment &&
303  kcFrontPlanes && kcNHits},
304  {"muonid", kcDQ && kcFiducial && kcContainment && kcFrontPlanes &&
305  kcNHits && kcMuonIDCut},
306  {"cvn", kcDQ && kcFiducial && kcContainment && kcFrontPlanes &&
307  kcNHits && kcMuonIDCut && kcCVN},
308  };
309 
311  {"slicing", kNoCut},
312  {"dq", kcDQ},
313  {"fiducial", kcDQ && kcNueCCIncFiducial},
314  {"containment", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment},
315  {"frontplanes", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment
316  && kcFrontPlanes},
317  {"nhits", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
318  kcFrontPlanes && kcNHits},
319  {"muonid", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
320  kcFrontPlanes && kcNHits && kcMuonIDCut},
321  {"phasespace", kcPresel && kRecoElectronPhaseSpaceCut},
322  {"cvn", kcPresel && kcCVN},
323  {"electronid", kcPresel && kcElectronIDCut},
324  };
325 
326 
327  const int kcNumSelsTest = 9;
329  {"slicing", kNoCut},
330  {"dq", kcDQ},
331  {"fiducial", kcDQ && kcNueCCIncFiducial},
332  {"containment", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment},
333  {"frontplanes", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment
334  && kcFrontPlanes},
335  {"nhits", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
336  kcFrontPlanes && kcNHits},
337  {"muonid", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
338  kcFrontPlanes && kcNHits && kcRemid},
339  {"electronid", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
340  kcFrontPlanes && kcNHits && kcRemid && kcElectronIDCut},
341  {"cvn", kcDQ && kcNueCCIncFiducial && kcNueCCIncContainment &&
342  kcFrontPlanes && kcNHits && kcRemid && kcCVN},
343  };
344 
345 
346 
347 
348 
349 
350  const SelDef chns[kcNumChns] = {
351  {"mc", ktMC},
353  {"nuebarcc", ktMC && ktNuebarCC},
354  {"numucc", ktMC && ktNumuCC},
355  {"numubarcc", ktMC && ktNumubarCC},
356  {"nc", ktMC && ktNC},
357  {"other", ktMC && ktOther},
358  {"nuecc_nonfiducial", ktMC && ktSignal &&
360  };
361 
362 
363  const SelDef chns_data[kcNumChns+1] = {
364  {"data", !ktMC},
365  {"mc", ktMC},
367  {"nuebarcc", ktMC && ktNuebarCC},
368  {"numucc", ktMC && ktNumuCC},
369  {"numubarcc", ktMC && ktNumubarCC},
370  {"nc", ktMC && ktNC},
371  {"other", ktMC && ktOther},
372  {"nuecc_nonfiducial", ktMC && ktSignal &&
374  };
375 
376 
377 
378  const int kcNumChnsExtra = 12;
379 
381  {"data", !ktMC},
382  {"mc", ktMC},
383  {"nuecc", ktMC && ktSignal},
384  {"nuebarcc", ktMC && ktNuebarCC},
385  {"numucc_pi0", ktMC && ktIsNumuCCPi0},
386  {"numucc_not_pi0", ktMC && ktIsNumuCCNotPi0},
387  {"numubarcc", ktMC && ktNumubarCC},
388  {"nc_pi0", ktMC && ktIsNCPi0},
389  {"nc_not_pi0", ktMC && ktIsNCNotPi0},
390  {"other", ktMC && ktIsOther2},
391  {"non_pi0_background", ktMC && (ktIsNumuCCNotPi0 || ktNumubarCC ||
392  ktIsNCNotPi0 || ktIsOther2)},
393  {"background", ktMC && !ktSignal},
394  };
395 
396 
397  const int kcNumIntChnsST = 7;
398  const int kcNumIntChns = 8;
399 
401  {"nocut", ktMC},
402  {"cc", !kIsNC},
403  {"qe", kIsQE},
404  {"res", kIsRes},
405  {"dis", kIsDIS},
406  {"coh", kIsCoh},
407  {"mec", kIsDytmanMEC},
408  {"other", !kIsQE && !kIsRes && !kIsDIS && !kIsCoh && !kIsDytmanMEC},
409  };
410 
412  {"cc", kIsTrueSigST},
413  {"qe", kIsTrueSigST && kIsQE_NT},
414  {"res", kIsTrueSigST && kIsRes_NT},
415  {"dis", kIsTrueSigST && kIsDIS_NT},
416  {"coh", kIsTrueSigST && kIsCoh_NT},
417  {"mec", kIsTrueSigST && kIsDytmanMEC_NT},
418  {"other", kIsTrueSigST && !kIsQE_NT &&
419  !kIsRes_NT && !kIsDIS_NT && ! kIsCoh_NT && !kIsDytmanMEC_NT},
420  };
421 
422  //Cuts For ReMID Cut Optimization
423  //-------------------------------
424  const int kcReMIDSels = 3;
425  const int kcReMIDSelsST = 1;
426 
428  {"presel", kcPresel_loose},
429  {"presel_signal", kcPresel_loose && ktMC && !ktNumuCC && !ktNumubarCC},
430  {"presel_background",kcPresel_loose && ktMC && (ktNumuCC || ktNumubarCC)},
431  };
432 
434  {"spilltruth", kIsTrueNotNumuCCST},
435  };
436 
437  //Cuts For CVN Cut Optimization
438  //-----------------------------
439  const int kcCvnSels = 3;
440  const int kcCvnSelsST = 1;
441 
443  {"presel", kcPresel},
444  {"presel_signal", kcPresel && ktMC && ktSignal},
445  {"presel_background", kcPresel && ktMC && !ktSignal},
446  };
447 
449  {"spilltruth", kIsTrueSigST},
450  };
451 
452  //Analysis Cuts
453  const Cut kPresel2D =
454  kcPresel;
455  const Cut kPresel1D = kcPresel &&
457 
459  const NuTruthCut kTrueSignal1DST = kIsTrueSigST &&
461 
462  const Cut kTrueSignal2D = CutFromNuTruthCut(kTrueSignal2DST);
463  const Cut kTrueSignal1D = CutFromNuTruthCut(kTrueSignal1DST);
464 
465  //Define Signal Correctly For 1D Result
467  {"mc", ktMC},
469  && CutFromNuTruthCut(kTrueSignal1DST)},
470  {"nuebarcc", ktMC && ktNuebarCC},
471  {"numucc", ktMC && ktNumuCC},
472  {"numubarcc", ktMC && ktNumubarCC},
473  {"nc", ktMC && ktNC},
474  {"other", ktMC && ktOther},
475  {"nuecc_nonfiducial", ktMC && ktSignal &&
476  (!CutFromNuTruthCut(kTrueFiducialST) || !CutFromNuTruthCut(kTrueSignal1DST)) },
477  };
478 
479  }//end namespace nueccinc
480 } //end namespace ana
const Cut kIsQE
Definition: TruthCuts.cxx:104
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2040
const Cut kcNueCCIncContainment([](const caf::SRProxy *sr){if(sr->vtx.elastic[0].fuzzyk.nshwlid< 1) return false;TVector3 start=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.start;TVector3 stop=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.stop;for(uint ix=0;ix< sr->vtx.elastic[0].fuzzyk.nshwlid;ix++){TVector3 start_muoncatcher=sr->vtx.elastic[0].fuzzyk.png[ix].shwlid.start;TVector3 stop_muoncatcher=sr->vtx.elastic[0].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 TVector3 vtxmax(150, 140, 800)
const SpillTruthCut kIsNumuCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && abs(truth->pdg)==14 && abs(truth->pdgorig)==14);})
const NuTruthCut kTrueElectronPhaseSpaceCutST([](const caf::SRNeutrinoProxy *sr){float costheta=kTrueElecCosthetaST(sr);float elece=kTrueElecEST(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;})
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
const Cut kcFrontPlanes
Definition: NueCCIncCuts.h:117
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const NuTruthCut kTrueSignal1DST
Definition: NueCCIncCuts.h:459
const Cut kcNHits
Definition: NueCCIncCuts.h:118
const NuTruthCut kIsCoh_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kCoh);})
Definition: TruthCuts.h:73
const SelDefST cvn_selection_st[kcCvnSelsST]
Definition: NueCCIncCuts.h:448
const TVector3 * vtxmax_ptr
Definition: NueCCIncCuts.h:237
caf::Proxy< float > distallpngtop
Definition: SRProxy.h:1044
const SpillTruthCut kIsCorrectSignal
Definition: NueCCIncCuts.h:266
const Cut kPresel1D
Definition: NueCCIncCuts.h:455
const Cut kcPresel
Definition: NueCCIncCuts.h:139
Proxy for caf::SRNeutrino.
Definition: SRProxy.h:510
const TVector3 vtxmin(-130,-140, 150)
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2137
const SelDef chns[kcNumChns]
Definition: NueCCIncCuts.h:350
const Cut kIsRes
Definition: TruthCuts.cxx:111
caf::Proxy< float > distallpngeast
Definition: SRProxy.h:1042
const NuTruthCut kIsRes_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kRes);})
Definition: TruthCuts.h:67
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
const int kcNumSels2
Definition: NueCCIncCuts.h:294
const int kcCvnSels
Definition: NueCCIncCuts.h:439
const Var kElectronID
const Cut ktSignal([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;return(sr->mc.nu[0].iscc &&(sr->mc.nu[0].pdg==12)&&(sr->mc.nu[0].pdgorig==12));})
const int kcNumIntChns
Definition: NueCCIncCuts.h:398
void abs(TH1 *hist)
const NuTruthVar kTrueElecCosthetaST([](const caf::SRNeutrinoProxy *nu){if(abs(nu->pdg)!=12|| !nu->iscc) return-5.0;int nprims=nu->prim.size();for(int iprim=0;iprim< nprims;iprim++){if(abs(nu->prim[iprim].pdg)==11||abs(nu->prim[iprim].pdg)==13){TVector3 edir=nu->prim[iprim].p.Vect();TVector3 beamdir=NuMIBeamDirection(caf::kNEARDET);return edir.Unit().Dot(beamdir.Unit());}}return-5.0;})
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
const Cut kIsDIS
Definition: TruthCuts.cxx:118
const int kcNumSels
Definition: NueCCIncCuts.h:292
const int kcReMIDSelsST
Definition: NueCCIncCuts.h:425
const SelDef interaction_chns[kcNumIntChns]
Definition: NueCCIncCuts.h:400
const Cut kcContainment
Definition: NueCCIncCuts.h:116
const Cut kcProngLength
Definition: NueCCIncCuts.h:119
_Cut< caf::SRNeutrinoProxy > NuTruthCut
Cut designed to be used over the nuTree, ie all neutrinos, not just those that got slices...
Definition: Cut.h:104
const int kcReMIDSels
Definition: NueCCIncCuts.h:424
const SelDefST interaction_chns_st[kcNumIntChnsST]
Definition: NueCCIncCuts.h:411
const Cut kIsTrueSig
Definition: NueCCIncCuts.h:278
const NuTruthCut kIsDIS_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kDIS);})
Definition: TruthCuts.h:70
const Cut kIsDytmanMEC
Definition: TruthCuts.cxx:187
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
const Cut kcMuonIDCut
Definition: NueCCIncCuts.h:123
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:573
caf::Proxy< caf::SRNueCosRej > nuecosrej
Definition: SRProxy.h:1265
const Cut ktNumuCC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;return(sr->mc.nu[0].iscc &&(sr->mc.nu[0].pdg==14)&&(sr->mc.nu[0].pdgorig==14));})
const int kcCvnSelsST
Definition: NueCCIncCuts.h:440
const Var kvCVN2017([](const caf::SRProxy *sr){return(sr->sel.cvn2017.nueid);})
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
const Cut ktIsPi0([](const caf::SRProxy *sr){ if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1); if(sr->mc.nu[0].prim.size()==0) return false;int nbofprim=sr->mc.nu[0].prim.size();int countpi=0;for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111){ countpi++;}}if(countpi==0) return false;if(countpi > 0) return true;return false;})
const Cut kcDQ
Definition: NueCCIncCuts.h:114
const Var kMuonID
Definition: NDXSecMuonPID.h:32
const SelDef cut_flow[kcNumSels]
Definition: NueCCIncCuts.h:310
const NuTruthVar kTrueElecEST([](const caf::SRNeutrinoProxy *nu){float ee=-5;if(abs(nu->pdg)!=12|| !nu->iscc) return ee;int nprims=nu->prim.size();for(int iprim=0;iprim< nprims;iprim++){if(abs(nu->prim[iprim].pdg)==11||abs(nu->prim[iprim].pdg)==13){double E=nu->prim[iprim].p.E;ee=E;}}return ee;})
const Var kRemID
PID
Definition: Vars.cxx:81
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 SpillTruthCut kIsTrueSigST
Definition: NueCCIncCuts.h:271
const Cut ktOther
Definition: NueCCIncCuts.h:183
caf::Proxy< bool > iscc
Definition: SRProxy.h:538
const Cut ktIsOther2
Definition: NueCCIncCuts.h:226
const SelDef chns_1d[kcNumChns]
Definition: NueCCIncCuts.h:466
_Cut< caf::SRProxy > Cut
Representation of a cut (selection) to be applied to a caf::StandardRecord object.
Definition: Cut.h:96
const Cut ktMC([](const caf::SRProxy *sr){if(sr->hdr.ismc) return true;return false;})
const Cut ktNumubarCC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;return(sr->mc.nu[0].iscc &&(sr->mc.nu[0].pdg==-14)&&(sr->mc.nu[0].pdgorig==-14));})
const Cut ktIsNCNotPi0
Definition: NueCCIncCuts.h:221
const SpillTruthCut kIsNueCCST([](const caf::SRNeutrinoProxy *truth){return(truth->iscc && truth->pdg==12 && truth->pdgorig==12);})
caf::StandardRecord * sr
const NuTruthCut kIsQE_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kQE);})
Select truly quasielastic events.
Definition: TruthCuts.h:64
caf::Proxy< float > distallpngwest
Definition: SRProxy.h:1045
const Cut kcCVN
Definition: NueCCIncCuts.h:127
const Cut kcPresel_loose
Definition: NueCCIncCuts.h:136
const Var kvRecoCos([](const caf::SRProxy *sr) ->float{if(sr->vtx.nelastic< 1) return-1000.f;if(sr->vtx.elastic[0].fuzzyk.npng< 1) return-1000.f;TVector3 elecdir=(TVector3) sr->vtx.elastic[0].fuzzyk.png[0].dir;TVector3 beamdir=NuMIBeamDirection(caf::kNEARDET);return elecdir.Dot(beamdir);})
const SelDef cut_flow_test[kcNumSelsTest]
Definition: NueCCIncCuts.h:328
const int kcNumIntChnsST
Definition: NueCCIncCuts.h:397
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
const SelDef chns_extra[kcNumChnsExtra]
Definition: NueCCIncCuts.h:380
const NuTruthCut kIsDytmanMEC_NT([](const caf::SRNeutrinoProxy *truth){return(truth->mode==caf::kMEC);})
Definition: TruthCuts.h:90
const Cut ktNuebarCC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;return(sr->mc.nu[0].iscc &&(sr->mc.nu[0].pdg==-12)&&(sr->mc.nu[0].pdgorig==-12));})
const SelDef chns_data[kcNumChns+1]
Definition: NueCCIncCuts.h:363
const Cut ktIsNumuCCPi0
Definition: NueCCIncCuts.h:223
caf::Proxy< short int > pdgorig
Definition: SRProxy.h:553
const TVector3 * vtxmin_ptr
Definition: NueCCIncCuts.h:236
const SelDef remid_selection[kcReMIDSels]
Definition: NueCCIncCuts.h:427
const int kcNumChns
Definition: NueCCIncCuts.h:293
caf::Proxy< bool > ismc
Definition: SRProxy.h:242
caf::Proxy< caf::SRVector3D > vtx
Definition: SRProxy.h:2073
const Cut kTrueSignal2D
Definition: NueCCIncCuts.h:462
assert(nhit_max >=nhit_nbins)
caf::Proxy< float > distallpngbottom
Definition: SRProxy.h:1041
const int kcNumChnsExtra
Definition: NueCCIncCuts.h:378
const SelDefST remid_selection_st[kcReMIDSelsST]
Definition: NueCCIncCuts.h:433
const Cut kPresel2D
Definition: NueCCIncCuts.h:453
caf::Proxy< short int > pdg
Definition: SRProxy.h:552
const Cut kcElectronIDCut
Definition: NueCCIncCuts.h:132
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2141
const SelDef cvn_selection[kcCvnSels]
Definition: NueCCIncCuts.h:442
const Cut kcRemid
Definition: NueCCIncCuts.h:120
const Cut ktIsNumuCCNotPi0
Definition: NueCCIncCuts.h:224
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146
const SpillTruthCut kTrueFiducialST([](const caf::SRNeutrinoProxy *sr){return(sr->vtx.X()< vtxmax.X()&&sr->vtx.X() > vtxmin.X()&&sr->vtx.Y()< vtxmax.Y()&&sr->vtx.Y() > vtxmin.Y()&&sr->vtx.Z()< vtxmax.Z()&&sr->vtx.Z() > vtxmin.Z());})
const NuTruthVar kTrueEST([](const caf::SRNeutrinoProxy *nu) ->float{float ee=-5;if(abs(nu->pdg)!=12|| !nu->iscc) return ee;return(float) nu->E;})
const Var kvElecE([](const caf::SRProxy *sr) ->float{double p0=-0.10588;double p1=0.57885;double p2=-0.408767;double p3=0.153795;double p4=-0.0270565;double p5=0.00171687;float energy=-1000.f;if(sr->vtx.nelastic< 1) return-1000.f;if(sr->vtx.elastic[0].fuzzyk.npng< 1) return-1000.f;float x=(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.shwE);if(x< 0) return 0.0f;if(x<=6) energy=x-(p0+x *p1+p2 *pow(x, 2)+p3 *pow(x, 3)+p4 *pow(x, 4)+p5 *pow(x, 5));else energy=x;if(energy< 0) energy=x;return energy;})
const NuTruthCut kTrueSignal2DST
Definition: NueCCIncCuts.h:458
const SpillTruthCut kIsTrueNotNumuCCST
Definition: NueCCIncCuts.h:275
const Cut kIsCoh
Definition: TruthCuts.cxx:133
const Cut ktNC([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;return(!sr->mc.nu[0].iscc);})
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
const Cut ktIsNCPi0
Definition: NueCCIncCuts.h:220
const Cut kTrueSignal1D
Definition: NueCCIncCuts.h:463
Cut CutFromNuTruthCut(const NuTruthCut &stc)
Definition: Cut.cxx:7
const int kcNumSelsTest
Definition: NueCCIncCuts.h:327
caf::Proxy< float > distallpngfront
Definition: SRProxy.h:1043
const Cut kcFiducial
Definition: NueCCIncCuts.h:115
const Cut kRecoElectronPhaseSpaceCut([](const caf::SRProxy *sr){float costheta=kvRecoCos(sr);float elece=kvElecE(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 SelDef cut_flow2[kcNumSels2]
Definition: NueCCIncCuts.h:296
enum BeamMode string
unsigned int uint
const Cut kcNueCCIncFiducial([](const caf::SRProxy *sr){assert(sr->vtx.nelastic > 0 &&"Must apply DQ cuts");if(sr->vtx.elastic[0].vtx.X()< -130.0) return false;if(sr->vtx.elastic[0].vtx.X() > 150.0) return false;if(sr->vtx.elastic[0].vtx.Y()< -140.0) return false;if(sr->vtx.elastic[0].vtx.Y() > 140.0) return false;if(sr->vtx.elastic[0].vtx.Z()< 150.0) return false;if(sr->vtx.elastic[0].vtx.Z() > 800.0) return false;return true;})