NusCuts.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Cut.h"
6 
7 #include "CAFAna/Vars/Vars.h"
8 
9 namespace ana
10 {
11  extern const Cut kCosmicVeto;
12 
13  /// Data Quality cuts from docdb 14241
14  extern const Cut kNusEventQuality;
15 
16  /// FD Fiducial volume from docdb 15285
17  extern const Cut kNusFDFiducial;
18 
19  /// Loose FD containment for decafs
20  /// This was used for the decaf motivation study in docdb 15152
21  extern const Cut kNusFDFidLoose;
22 
23  /// Containment variable for NC events from docdb 14241
24  extern const Cut kNusFDContain;
25 
26  /// Cut that is more CC rejection than NC selection from docdb 15285
27  extern const Cut kNusNCSel;
28 
29  /// Decaf cut motivated by doc-db 15152
30  extern const Cut kNusFDDecafCut;
31 
32  /// Cosmic rejection for the NC sample from docdb 15241
33  extern const Cut kNusCosRej;
34 
35  const Cut kNCCalERange = (kCaloE > 0.5 && kCaloE < 4.0);
36 
37  // Cuts that define the full cuts for the Far Detector
38  const Cut kNusFDPresel =
40  kCosmicVeto &&
41  kNusEventQuality &&
42  kNusFDFiducial &&
44 
45  const Cut kNusFDAllE = kNusFDPresel && kNusCosRej && kNusNCSel;
46  const Cut kNusFD = kNusFDAllE && kNCCalERange;
47 
48  //************** Near Detector cuts ****************************
49 
50  /// ND Fiducial volume from docdb 15242
51  extern const Cut kNusNDFiducial;
52 
53  /// Loose ND containment for decafs
54  /// This was used for the decaf motivation study in docdb 15152
55  extern const Cut kNusNDFidLoose;
56 
57  /// Containment variable for NC events from docdb 15242
58  extern const Cut kNusNDContain;
59 
60  /// Extra containment cut for the ND first motivated in docdb 13402
61  extern const Cut kNusNDHarshTrk;
62 
63  /// Cosmic rejection for the ND sample, since numucontpid not filled here
64  /// and the starttop/stoptop is too harsh for ND
65  /// First motivated in 15242
66  extern const Cut kNusCosRejMod;
67 
68  // Cuts that define the full cuts for the Near Detector
69  const Cut kNusNDPresel = kNusEventQuality && kNusNDFiducial && kNusNDContain && kNusNDHarshTrk;
70  const Cut kNusNDAllE = kNusNDPresel && kNusCosRejMod && kNusNCSel;
71  const Cut kNusND = kNusNDAllE && kNCCalERange;
72 }
const Cut kNusFDFiducial([](const caf::SRProxy *sr){ if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< -680.0) return false;if(vtx.X() > 650.0) return false;if(vtx.Y()< -720.0) return false;if(vtx.Y() > 500.0) return false;if(vtx.Z()< 50.0) return false;if(vtx.Z() > 5450.0) return false;return true;})
FD Fiducial volume from docdb 15285.
Definition: NusCuts.h:17
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kApplySecondAnalysisMask([](const caf::SRProxy *sr){if(sr->hdr.det!=caf::kFARDET) return true; std::bitset< 14 > binary(sr->hdr.dibmask);std::pair< int, int > planesA=calcFirstLastLivePlane(sr->slc.firstplane, binary);std::pair< int, int > planesB=calcFirstLastLivePlane(sr->slc.lastplane, binary);if((planesA.first!=planesB.first)||(planesA.second!=planesB.second)) return false;return((planesA.second-planesA.first+1)/64 >=4);})
Definition: AnalysisMasks.h:18
const Cut kNusEventQuality([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.gap >=100.) return false;if(sr->slc.ncontplanes<=2) return false;return true;})
Data Quality cuts from docdb 14241.
Definition: NusCuts.h:14
const Cut kNusFD
Definition: NusCuts.h:46
const Cut kNusNDFiducial([](const caf::SRProxy *sr){assert(sr->vtx.elastic.IsValid &&"Must apply DQ cuts");if(sr->vtx.elastic.vtx.X()< -100.0) return false;if(sr->vtx.elastic.vtx.X() > 100.0) return false;if(sr->vtx.elastic.vtx.Y()< -100.0) return false;if(sr->vtx.elastic.vtx.Y() > 100.0) return false;if(sr->vtx.elastic.vtx.Z()< 200.0) return false;if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;return true;})
ND Fiducial volume from docdb 15242.
Definition: NusCuts.h:51
const Cut kNusFDAllE
Definition: NusCuts.h:45
const Cut kNusNDPresel
Definition: NusCuts.h:69
const Cut kNusFDContain([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 10) return false;if(std::min(cr.startwest, cr.stopwest)< 10) return false;if(std::min(cr.starttop, cr.stoptop) < 10) return false;if(std::min(cr.startbottom, cr.stopbottom)< 10) return false;if(std::min(cr.startfront, cr.stopfront)< 10) return false;if(std::min(cr.startback, cr.stopback)< 10) return false;return true;})
Containment variable for NC events from docdb 14241.
Definition: NusCuts.h:24
const Cut kNusFDFidLoose([](const caf::SRProxy *sr){double buf=10.;if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< (FDL+buf)) return false;if(vtx.X() >(FDR-buf)) return false;if(vtx.Y()< (FDB+buf)) return false;if(vtx.Y() >(FDT-buf)) return false;if(vtx.Z()< (FDF+buf)) return false;if(vtx.Z() >(FDE-buf)) return false;return true;})
Definition: NusCuts.h:21
const Cut kNusNCSel([](const caf::SRProxy *sr){if(sr->slc.nhit >=200) return false;if(sr->slc.nhit< 20) return false;if(sr->sel.cvn.ncid< 0.2) return false;return true;})
Cut that is more CC rejection than NC selection from docdb 15285.
Definition: NusCuts.h:27
const Cut kNusNDFidLoose([](const caf::SRProxy *sr){double buf=10.;if(!sr->vtx.elastic.IsValid) return false;const TVector3 vtx=sr->vtx.elastic.vtx;if(vtx.X()< (NDL+buf)) return false;if(vtx.X() >(NDR-buf)) return false;if(vtx.Y()< (NDB+buf)) return false;if(vtx.Y() >(NDT-buf)) return false;if(vtx.Z()< (NDF+buf)) return false;if(vtx.Z() >(NDE-buf)) return false;return true;})
Definition: NusCuts.h:55
const Cut kNusNDAllE
Definition: NusCuts.h:70
const Cut kNCCalERange
Definition: NusCuts.h:35
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
const Cut kNusFDDecafCut([](const caf::SRProxy *sr){if(sr->sel.cosrej.numucontpid2019<=0.42) return false;return true;})
Decaf cut motivated by doc-db 15152.
Definition: NusCuts.h:30
const Cut kNusNDHarshTrk([](const caf::SRProxy *sr){double buf=25.;if(sr->trk.kalman.ntracks==0) return false;for(unsigned int i=0, n=sr->trk.kalman.ntracks;i< n;++i){TVector3 start=sr->trk.kalman.tracks[i].start;TVector3 stop=sr->trk.kalman.tracks[i].stop;if(std::min(start.X(), stop.X())< (NDL+buf)) return false;if(std::max(start.X(), stop.X()) >(NDR-buf)) return false;if(std::min(start.Y(), stop.Y())< (NDB+buf)) return false;if(std::max(start.Y(), stop.Y()) >(NDT-buf)) return false;if(std::min(start.Z(), stop.Z())< (NDF+buf)) return false;if(std::max(start.Z(), stop.Z()) >(NDE-buf)) return false;}return true;})
Extra containment cut for the ND first motivated in docdb 13402.
Definition: NusCuts.h:61
Template for Cut and SpillCut.
Definition: Cut.h:15
const Cut kNusNDContain([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;if(std::min(cr.starteast, cr.stopeast)< 25) return false;if(std::min(cr.startwest, cr.stopwest)< 25) return false;if(std::min(cr.starttop, cr.stoptop) < 25) return false;if(std::min(cr.startbottom, cr.stopbottom)< 25) return false;if(std::min(cr.startfront, cr.stopfront)< 25) return false;if(std::min(cr.startback, cr.stopback)< 25) return false;return true;})
Containment variable for NC events from docdb 15242.
Definition: NusCuts.h:58
const Cut kNusFDPresel
Definition: NusCuts.h:38
const Cut kNusCosRejMod([](const caf::SRProxy *sr){double partptp=sr->sel.nuecosrej.partptp;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(partptp >=0.8) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon==1) return false;double nhit=(double) sr->slc.nhit;if(nhit<=0.) return false;if(sr->slc.calE/nhit<=0.009) return false;return true;})
Definition: NusCuts.h:66
const Cut kCosmicVeto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
Definition: NusCuts.h:11
const Cut kNusND
Definition: NusCuts.h:71
const Cut kNusCosRej([](const caf::SRProxy *sr){double numucontpid2019=sr->sel.cosrej.numucontpid2019;double partptp=sr->sel.nuecosrej.partptp;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return false;if(numucontpid2019<=0.5) return false;if(partptp >=0.8) return false;if(sr->vtx.elastic.fuzzyk.png[0].shwlid.lid.ismuon==1) return false;double nhit=(double) sr->slc.nhit;if(nhit<=0.) return false;if(sr->slc.calE/nhit<=0.018) return false;if(std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop)< 480) return false;return true;})
Cosmic rejection for the NC sample from docdb 15241.
Definition: NusCuts.h:33