NusCuts18.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Provisional (February 19th 2018) Nus18 cuts
4 // 3/5/2018 Added Nus17 cuts and renamed
5 // 2018 NC Disappearance Analysis
6 // TODO: Add technote docdb
7 
8 #include "CAFAna/Core/Cut.h"
11 #include "CAFAna/Cuts/Cuts.h"
12 #include "CAFAna/Vars/Vars.h"
14 #include "NuXAna/Vars/NusVars.h"
16 
17 #include "CAFAna/Cuts/SpillCuts.h"
18 
19 namespace ana
20 {
21 
22  //************** Period-related cuts ****************************
23 
24  extern const Cut kNus18Period1;
25  extern const Cut kNus18Period2;
26  extern const Cut kNus18Period3_5;
27  extern const Cut kNus18Period4_6;
28 
29  extern const SpillCut kSpillPeriod1;
30  extern const SpillCut kSpillPeriod2;
31  extern const SpillCut kSpillPeriod3_5;
32  extern const SpillCut kSpillPeriod4_6;
33 
38 
39  //************** Common cuts ****************************
40 
41  /// Data Quality cuts from docdb 21113
42  extern const Cut kNus18EventQuality;
43 
44  //************** Far Detector cuts ****************************
45 
46  extern const Cut kNus18Veto;
47 
48  /// FD Containment, nue-inspired, from docdb 21113
50  kDistAllTop > 100 &&
51  kDistAllBottom > 10 &&
52  kDistAllEast > 50 &&
53  kDistAllWest > 50 &&
54  kDistAllFront > 50 &&
55  kDistAllBack > 50;
56 
57  /// The Nus18 preselection cuts for the Far Detector from docdb 21113
60  kNus18Veto &&
61  kNus18EventQuality &&
63 
64  /// FD backward photon rejection cut, inherited from nue, from docdb 21113
66  (kDistAllBack < 200 && kSparsenessAsymm < -0.1) ||
67  (kDistAllBack >= 200);
68 
69  extern const Cut kNus18EnergyCut;
70 
71  /// Closest slice cuts based on approximation in space and time, from from docdb 21113
74 
75  /// Carve out space in shower maximum y and #p_{T}/p, from docdb 21113
76  const Cut kNus18ShwPtpLow = kMaxY > 580. && kPartPtp > 0.2;
77  const Cut kNus18ShwPtpHigh = kMaxY > 540. && kPartPtp > 0.4;
78 
79  /// 2018 Cos Rej BDT cuts
88 
89  /// 2018 Cos Rej BDT cut agnostic of period
90  extern const Cut kNus18NCCosRejAlt;
91 
92  /// 2018 Cos Rej BDT cut agnostic of period
94 
95  /// CVN cut
96  /// Cut differently for different polarities
97  /// 4/17 Added CVN2017 cut
98  extern const Cut kNus18CVNnc;
99 
100  const Cut kNus18FD =
101  kNus18FDPresel &&
102  kNus18BackwardCut &&
103  kNus18NCCosRejAlt &&
104  !(kNus18SlcTimeGap && kNus18SlcDist) &&
105  !(kNus18ShwPtpLow || kNus18ShwPtpHigh) &&
106  kNus18CVNnc &&
108 
110  kNus18FDPresel &&
111  kNus18BackwardCut &&
112  kNus18NCCosRejSideband &&
113  !(kNus18SlcTimeGap && kNus18SlcDist) &&
114  !(kNus18ShwPtpLow || kNus18ShwPtpHigh) &&
115  kNus18CVNnc &&
117 
118  //************** Near Detector cuts ****************************
119 
120  extern const Cut kNus18NDFiducial;
121 
123  kDistAllTop > 25 &&
124  kDistAllBottom > 25 &&
125  kDistAllEast > 25 &&
126  kDistAllWest > 25 &&
127  kDistAllFront > 25 &&
128  kDistAllBack > 25;
129 
130  // Cuts that define the preselection cuts for the Near Detector
132  kNus18EventQuality &&
133  kNus18NDFiducial &&
135 
136  /// Full Nus18 ND analysis selection
137  const Cut kNus18ND =
138  kNus18NDPresel &&
139  kNus18CVNnc &&
140  kPartPtp <= 0.8 &&
142 
143  // Decaf cuts: CVN NC id > .1 for decaf files (both FD and ND)
144 
145  // Cut for CVN Classic (cvn2017)
148 
149  // Cut for CVN ShortSimple (cvnProd3Train)
152 
153  // Final decaf cut to be used now in 2018 analysis
154  const Cut kNus18FHCDecafCut = kNus18FHCCVNClassicDecafCut || kNus18FHCCVNShortSimpleDecafCut;
155  const Cut kNus18RHCDecafCut = kNus18RHCCVNClassicDecafCut || kNus18RHCCVNShortSimpleDecafCut;
156 
157 }
const SpillCut kSpillPeriod4_6([](const caf::SRSpillProxy *sr){bool p4_6=false;if((sr->det==caf::kNEARDET &&(PeriodFromRunND(sr->run)==4||PeriodFromRunND(sr->run)==6))||(sr->det==caf::kFARDET &&(PeriodFromRunFD(sr->run)==4||PeriodFromRunFD(sr->run)==6))) p4_6=true;return p4_6;})
Definition: NusCuts18.h:32
const Cut kNus18NCCosRejSidebandp2
Definition: NusCuts18.h:85
const Var kNCCosRejAltp4_6
Definition: NusVarsTemp.h:110
const Cut kNus18FDContain
FD Containment, nue-inspired, from docdb 21113.
Definition: NusCuts18.h:49
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
const Cut kNus18FHCCVNClassicDecafCut([](const caf::SRProxy *sr){ std::cout<< "ERROR::kNus18FHCCVNClassicDecafCut cut on cvn2017. Return false"<< std::endl;abort();return false;})
Definition: NusCuts18.h:146
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kNus18FHCDecafCut
Definition: NusCuts18.h:154
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 kNus18FDPresel
The Nus18 preselection cuts for the Far Detector from docdb 21113.
Definition: NusCuts18.h:58
const Cut kNus18NCCosRejSidebandp3_5
Definition: NusCuts18.h:86
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 Cut kNus18RHCCVNClassicDecafCut([](const caf::SRProxy *sr){ std::cout<< "ERROR::kNus18RHCCVNClassicDecafCut cut on cvn2017. Return false"<< std::endl;abort();return false;})
Definition: NusCuts18.h:147
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 kNus18SlcDist
Definition: NusCuts18.h:73
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 SpillCut kStandardSpillCutsPeriod1
Definition: NusCuts18.h:34
const Cut kNus18RHCDecafCut
Definition: NusCuts18.h:155
const Cut kNus18NCCosRejAltp2
Definition: NusCuts18.h:81
const Cut kNus18SlcTimeGap
Closest slice cuts based on approximation in space and time, from from docdb 21113.
Definition: NusCuts18.h:72
const Var kNCCosRejAltp3_5
Definition: NusVarsTemp.h:96
const Cut kNus18EnergyCut([](const caf::SRProxy *sr){double energy=0.0;energy=kNus18Energy(sr);if(energy< 0.50) return false;if(energy > 20.0) return false;return true;})
Definition: NusCuts18.h:69
const Cut kNus18NCCosRejSidebandp1
Definition: NusCuts18.h:84
const Cut kNus18CVNnc([](const caf::SRProxy *sr){if(sr->slc.nhit< 25) return false;std::cout<< "ERROR::kNus18CVNnc. Looking for cvnProd3Train. Branch no longer exists."<< std::endl;abort();})
Definition: NusCuts18.h:98
const Cut kNus18FD
Definition: NusCuts18.h:100
const Var kSparsenessAsymm
Definition: NueVars.cxx:92
const Cut kNus18NDPresel
Definition: NusCuts18.h:131
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 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 kNus18Period3_5([](const caf::SRProxy *sr){bool p3_5=false;if((sr->hdr.det==caf::kNEARDET &&(PeriodFromRunND(sr->hdr.run)==3||PeriodFromRunND(sr->hdr.run)==5))||(sr->hdr.det==caf::kFARDET &&(PeriodFromRunFD(sr->hdr.run)==3||PeriodFromRunFD(sr->hdr.run)==5))) p3_5=true;return p3_5;})
Definition: NusCuts18.h:26
const Cut kNus18Period1([](const caf::SRProxy *sr){bool p1=false;if((sr->hdr.det==caf::kNEARDET &&PeriodFromRunND(sr->hdr.run)==1)||(sr->hdr.det==caf::kFARDET &&PeriodFromRunFD(sr->hdr.run)==1)) p1=true;return p1;})
Definition: NusCuts18.h:24
const Cut kNus18Veto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
Definition: NusCuts18.h:46
const Cut kNus18NDFiducial([](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: NusCuts18.h:120
const SpillCut kStandardSpillCutsPeriod4_6
Definition: NusCuts18.h:37
const Cut kNus18Period2([](const caf::SRProxy *sr){bool p2=false;if((sr->hdr.det==caf::kNEARDET &&PeriodFromRunND(sr->hdr.run)==2)||(sr->hdr.det==caf::kFARDET &&PeriodFromRunFD(sr->hdr.run)==2)) p2=true;return p2;})
Definition: NusCuts18.h:25
const Cut kNus18ShwPtpHigh
Definition: NusCuts18.h:77
const Cut kNus18FDSideband
Definition: NusCuts18.h:109
const Cut kNus18FHCCVNShortSimpleDecafCut([](const caf::SRProxy *sr){ std::cout<< "ERROR::kNus18FHCCVNShortSimpleDecafCut cut on cvnProd3Train. Return false"<< std::endl;abort();return false;})
Definition: NusCuts18.h:150
const Cut kNus18ND
Full Nus18 ND analysis selection.
Definition: NusCuts18.h:137
const Var kClosestSlcMinTop([](const caf::SRProxy *sr){return(float) sr->slc.closestsliceminfromtop;})
Definition: NusVars.h:82
const Cut kNus18NCCosRejAltp4_6
Definition: NusCuts18.h:83
const Cut kNus18NCCosRejAlt([](const caf::SRProxy *sr){caf::Det_t det=sr->hdr.det;bool rhc=sr->spill.isRHC;bool fhc=sr->spill.isFHC;unsigned int period=-1;if(det==caf::kNEARDET) period=PeriodFromRunND(sr->hdr.run);else if(det==caf::kFARDET) period=PeriodFromRunFD(sr->hdr.run);if(rhc) return kNus18NCCosRejAltp4_6(sr);else if(fhc){if(period==1) return kNus18NCCosRejAltp1(sr);else if(period==2) return kNus18NCCosRejAltp2(sr);else if(period==3||period==5) return kNus18NCCosRejAltp3_5(sr);}return false;})
2018 Cos Rej BDT cut agnostic of period
Definition: NusCuts18.h:90
const Cut kNus18BackwardCut
FD backward photon rejection cut, inherited from nue, from docdb 21113.
Definition: NusCuts18.h:65
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 SpillCut kSpillPeriod2([](const caf::SRSpillProxy *sr){bool p2=false;if((sr->det==caf::kNEARDET &&PeriodFromRunND(sr->run)==2)||(sr->det==caf::kFARDET &&PeriodFromRunFD(sr->run)==2)) p2=true;return p2;})
Definition: NusCuts18.h:30
const Cut kNus18EventQuality([](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: NusCuts18.h:42
const Cut kNus18ShwPtpLow
Carve out space in shower maximum y and #p_{T}/p, from docdb 21113.
Definition: NusCuts18.h:76
const Var kNCCosRejAltp2
Definition: NusVarsTemp.h:84
const Cut kNus18NCCosRejSideband([](const caf::SRProxy *sr){caf::Det_t det=sr->hdr.det;bool rhc=sr->spill.isRHC;bool fhc=sr->spill.isFHC;unsigned int period=-1;if(det==caf::kNEARDET) period=PeriodFromRunND(sr->hdr.run);else if(det==caf::kFARDET) period=PeriodFromRunFD(sr->hdr.run);if(rhc) return kNus18NCCosRejSidebandp4_6(sr);else if(fhc){if(period==1) return kNus18NCCosRejSidebandp1(sr);else if(period==2) return kNus18NCCosRejSidebandp2(sr);else if(period==3||period==5) return kNus18NCCosRejSidebandp3_5(sr);}return false;})
2018 Cos Rej BDT cut agnostic of period
Definition: NusCuts18.h:93
const SpillCut kStandardSpillCutsPeriod3_5
Definition: NusCuts18.h:36
const Cut kNus18NCCosRejAltp1
2018 Cos Rej BDT cuts
Definition: NusCuts18.h:80
const SpillCut kStandardSpillCutsPeriod2
Definition: NusCuts18.h:35
const Cut kNus18Period4_6([](const caf::SRProxy *sr){bool p4_6=false;if((sr->hdr.det==caf::kNEARDET &&(PeriodFromRunND(sr->hdr.run)==4||PeriodFromRunND(sr->hdr.run)==6))||(sr->hdr.det==caf::kFARDET &&(PeriodFromRunFD(sr->hdr.run)==4||PeriodFromRunFD(sr->hdr.run)==6))) p4_6=true;return p4_6;})
Definition: NusCuts18.h:27
const Var kNCCosRejAltp1
Definition: NusVarsTemp.h:71
const SpillCut kSpillPeriod3_5([](const caf::SRSpillProxy *sr){bool p3_5=false;if((sr->det==caf::kNEARDET &&(PeriodFromRunND(sr->run)==3||PeriodFromRunND(sr->run)==5))||(sr->det==caf::kFARDET &&(PeriodFromRunFD(sr->run)==3||PeriodFromRunFD(sr->run)==5))) p3_5=true;return p3_5;})
Definition: NusCuts18.h:31
const SpillCut kSpillPeriod1([](const caf::SRSpillProxy *sr){bool p1=false;if((sr->det==caf::kNEARDET &&PeriodFromRunND(sr->run)==1)||(sr->det==caf::kFARDET &&PeriodFromRunFD(sr->run)==1)) p1=true;return p1;})
Definition: NusCuts18.h:29
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
const Cut kNus18NCCosRejAltp3_5
Definition: NusCuts18.h:82
const Cut kNus18NCCosRejSidebandp4_6
Definition: NusCuts18.h:87
Template for Cut and SpillCut.
Definition: Cut.h:15
const Cut kNus18RHCCVNShortSimpleDecafCut([](const caf::SRProxy *sr){ std::cout<< "ERROR::kNus18RHCCVNShortSimpleDecafCut cut on cvnProd3Train. Return false"<< std::endl;abort();return false;})
Definition: NusCuts18.h:151
const Cut kNus18NDContain
Definition: NusCuts18.h:122
const Var kClosestSlcTime([](const caf::SRProxy *sr){return(float) sr->slc.closestslicetime;})
Definition: NusVars.h:80