NusCuts17.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Provisional (June 29th 2017) Nus17 cuts
4 // Summer 2017 NC Disappearance Analysis
5 // TODO: Add technote docdb
6 
7 #include "CAFAna/Core/Cut.h"
9 #include "CAFAna/Cuts/Cuts.h"
10 #include "CAFAna/Vars/Vars.h"
12 #include "NuXAna/Vars/NusVars.h"
14 
15 namespace ana
16 {
17 
18  //************** Common cuts ****************************
19 
20  /// Data Quality cuts from docdb 21113
21  extern const Cut kNus17EventQuality;
22 
23  //************** Far Detector cuts ****************************
24 
25  extern const Cut kNus17Veto;
26 
27  /// FD Containment, nue-inspired, from docdb 21113
29  kDistAllTop > 100 &&
30  kDistAllBottom > 10 &&
31  kDistAllEast > 50 &&
32  kDistAllWest > 50 &&
33  kDistAllFront > 50 &&
34  kDistAllBack > 50;
35 
36 
37  /// The Nus17 preselection cuts for the Far Detector from docdb 21113
40  kNus17Veto &&
41  kNus17EventQuality &&
43 
44  /// FD backward photon rejection cut, inherited from nue, from docdb 21113
46  (kDistAllBack < 200 && kSparsenessAsymm < -0.1) ||
47  (kDistAllBack >= 200);
48 
49  extern const Cut kNus17CVNnc;
50 
51  extern const Cut kNus17EnergyCut;
52 
53  /// Closest slice cuts based on approximation in space and time, from from docdb 21113
56 
57  /// Carve out space in shower maximum y and #p_{T}/p, from docdb 21113
58  const Cut kNus17ShwPtpLow = kMaxY > 580. && kPartPtp > 0.2;
59  const Cut kNus17ShwPtpHigh = kMaxY > 540. && kPartPtp > 0.4;
60 
61  /// NC Cosmic Rejection (official cosmic rejction cut for Nus17) from docdb 21113
62  /// based on BDT
63  extern const Cut kNus17NCCosRej;
64 
65  /// NC Cosmic Rejection (alternative cut) from docdb 21113
66  /// based on Gradient BDT
67  extern const Cut kNus17NCCosRejG;
68 
69  /// Until nccosrej branch is in CAFs, must use these cuts
72 
73  /// A cut that doesn't include the time and ptp-based cuts
74  /// Useful for cut flows
76  kNus17FDPresel &&
77  kNus17BackwardCut &&
78  kNus17NCCosRej &&
79  kNus17CVNnc &&
81 
82  /// Full Nus17 FD analysis selection, from docdb 21113
83  const Cut kNus17FD =
84  kNus17FDPresel &&
85  kNus17BackwardCut &&
86  kNus17NCCosRej &&
87  !(kNus17SlcTimeGap && kNus17SlcDist) &&
88  !(kNus17ShwPtpLow || kNus17ShwPtpHigh) &&
89  kNus17CVNnc &&
91 
92  const Cut kNus17FDAlt =
93  kNus17FDPresel &&
94  kNus17BackwardCut &&
95  kNus17NCCosRejAlt &&
96  !(kNus17SlcTimeGap && kNus17SlcDist) &&
97  !(kNus17ShwPtpLow || kNus17ShwPtpHigh) &&
98  kNus17CVNnc &&
100 
101  //************** Near Detector cuts ****************************
102 
103  extern const Cut kNus17NDFiducial;
104 
106  kDistAllTop > 25 &&
107  kDistAllBottom > 25 &&
108  kDistAllEast > 25 &&
109  kDistAllWest > 25 &&
110  kDistAllFront > 25 &&
111  kDistAllBack > 25;
112 
113  // Cuts that define the preselection cuts for the Near Detector
115  kNus17EventQuality &&
116  kNus17NDFiducial &&
118 
119  /// Full Nus17 ND analysis selection
120  const Cut kNus17ND =
121  kNus17NDPresel &&
122  kNus17CVNnc &&
123  kPartPtp <= 0.8 &&
125 
126 }
const Cut kNus17EnergyCut([](const caf::SRProxy *sr){double energy=0.0;energy=kNus17Energy(sr);if(energy< 0.25) return false;if(energy > 10.0) return false;return true;})
Definition: NusCuts17.h:51
const Var kPartPtp([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.partptp)|| std::isinf(1.*sr->sel.nuecosrej.partptp)) return-5.f;return float(sr->sel.nuecosrej.partptp);})
Definition: NusVars.h:74
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kDistAllBottom([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngbottom)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngbottom);})
Distance of all showers in slice from the bottom edge of detector.
Definition: NueVars.h:33
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 Var kDistAllWest([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngwest)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngwest);})
Distance of all showers in slice from the west edge of detector.
Definition: NueVars.h:36
const Var kDistAllTop([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngtop)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngtop);})
Distance of all showers in slice from the top edge of detector.
Definition: NueVars.h:30
const Cut kNus17FD
Full Nus17 FD analysis selection, from docdb 21113.
Definition: NusCuts17.h:83
const Var kDistAllBack([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngback)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngback);})
Distance of all showers in slice from the back edge of detector.
Definition: NueVars.h:42
const Cut kNus17NDFiducial([](const caf::SRProxy *sr){assert(sr->vtx.elastic.IsValid &&"Must apply EQ 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()< 150.0) return false;if(sr->vtx.elastic.vtx.Z() > 1000.0) return false;return true;})
Definition: NusCuts17.h:103
const Cut kNus17CVNnc([](const caf::SRProxy *sr){if(sr->slc.nhit < 25) return false;std::cout<< "ERROR::kNus17CVNnc. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();return true;})
Definition: NusCuts17.h:49
const Cut kNus17BackwardCut
FD backward photon rejection cut, inherited from nue, from docdb 21113.
Definition: NusCuts17.h:45
const Var kSparsenessAsymm
Definition: NueVars.cxx:92
const Var kNCCosRejAlt
Definition: NusVarsTemp.h:57
const Var kDistAllEast([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngeast)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngeast);})
Distance of all showers in slice from the east edge of detector.
Definition: NueVars.h:39
const Cut kNus17FDContain
FD Containment, nue-inspired, from docdb 21113.
Definition: NusCuts17.h:28
const Var kMaxY([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return-1000.0f;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return-1000.0f;float maxyall=-999.0;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;i++){maxyall=std::max(std::max(sr->vtx.elastic.fuzzyk.png[i].shwlid.start.Y(), sr->vtx.elastic.fuzzyk.png[i].shwlid.stop.Y()), maxyall);}return maxyall;})
Definition: NueVars.h:60
const Cut kNus17NDPresel
Definition: NusCuts17.h:114
const Cut kNus17NCCosRej([](const caf::SRProxy *sr){if(sr->sel.nccosrej.cospidbdt< 0.62) return false;return true;})
Definition: NusCuts17.h:63
const Cut kNus17SlcDist
Definition: NusCuts17.h:55
const Cut kNus17ND
Full Nus17 ND analysis selection.
Definition: NusCuts17.h:120
const Cut kNus17ShwPtpLow
Carve out space in shower maximum y and #p_{T}/p, from docdb 21113.
Definition: NusCuts17.h:58
const Cut kNus17NCCosRejAlt
Until nccosrej branch is in CAFs, must use these cuts.
Definition: NusCuts17.h:70
const Var kClosestSlcMinTop([](const caf::SRProxy *sr){return(float) sr->slc.closestsliceminfromtop;})
Definition: NusVars.h:82
const Cut kNus17FDSansTimePtp
Definition: NusCuts17.h:75
const Cut kNus17NDContain
Definition: NusCuts17.h:105
const Var kClosestSlcMinDist([](const caf::SRProxy *sr){return(float) sr->slc.closestslicemindist;})
Definition: NusVars.h:81
const Var kDistAllFront([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.distallpngfront)) return-1000.0f;return float(sr->sel.nuecosrej.distallpngfront);})
Distance of all showers in slice from the front edge of detector.
Definition: NueVars.h:45
const Cut kNus17Veto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
Definition: NusCuts17.h:25
const Cut kNus17ShwPtpHigh
Definition: NusCuts17.h:59
const Cut kNus17NCCosRejG([](const caf::SRProxy *sr){if(sr->sel.nccosrej.cospidbdtg< 0.85) return false;return true;})
Definition: NusCuts17.h:67
const Cut kNus17NCCosRejGAlt
Definition: NusCuts17.h:71
const Cut kNus17SlcTimeGap
Closest slice cuts based on approximation in space and time, from from docdb 21113.
Definition: NusCuts17.h:54
const Cut kNus17FDAlt
Definition: NusCuts17.h:92
Template for Cut and SpillCut.
Definition: Cut.h:15
const Cut kNus17FDPresel
The Nus17 preselection cuts for the Far Detector from docdb 21113.
Definition: NusCuts17.h:38
const Cut kNus17EventQuality([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;if(sr->sel.nuecosrej.hitsperplane >=8) return false;if(sr->vtx.elastic.fuzzyk.npng==0) return false;if(sr->slc.ncontplanes<=2) return false;return true;})
Data Quality cuts from docdb 21113.
Definition: NusCuts17.h:21
const Var kClosestSlcTime([](const caf::SRProxy *sr){return(float) sr->slc.closestslicetime;})
Definition: NusVars.h:80
const Var kNCCosRejGAlt
Definition: NusVarsTemp.h:43