DataMCComp_header.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #include "CAFAna/Core/Binning.h"
7 #include "CAFAna/Core/Cut.h"
8 #include "CAFAna/Core/Loaders.h"
10 #include "CAFAna/Core/Spectrum.h"
12 #include "CAFAna/Core/Utilities.h"
13 
15 #include "CAFAna/Cuts/Cuts.h"
19 #include "CAFAna/Cuts/PeriodCuts.h"
20 #include "CAFAna/Cuts/SpillCuts.h"
21 #include "CAFAna/Cuts/TimingCuts.h"
22 #include "CAFAna/Cuts/TruthCuts.h"
23 
24 #include "CAFAna/Vars/BPFVars.h"
27 #include "CAFAna/Vars/HistAxes.h"
31 #include "CAFAna/Vars/Vars.h"
32 #include "CAFAna/Vars/XsecTunes.h"
33 
37 
39 
40 #include "TGraphAsymmErrors.h"
41 #include "TFeldmanCousins.h"
42 
43 
44 #include "/nova/app/users/asutton/3Flavor/Ana2020/BoxOpening_br_ana/plotting_header.h"
45 
46 using namespace ana;
47 
48 
49 
50 // Function to make data graph with error bars
51 // same as the one in CAFAna/nue/Ana2018/sideband/fd_plot.h
52 // but including that caused some conflicts that I didn't want to debug
53 TGraphAsymmErrors* GraphWithPoissonErrors2(const TH1* h, const TH1* h2, bool noErrorsXaxis, bool drawEmptyBins)
54 {
55  TGraphAsymmErrors* gr = new TGraphAsymmErrors(h);
56 
57  TFeldmanCousins fc(0.6827);//1 sigma
58 
59  std::vector<int> removePoints; // keep track of the points to remove
60  for(int i = 0; i < h->GetNbinsX(); ++i){
61  double x, y;
62  gr->GetPoint(i, x, y);
63 
64  if ( (drawEmptyBins && h2->GetBinContent(i+1) > 0.05) || y>=1 ){
65  if ( y < 50 ) gr->SetPointEYlow(i, y-fc.CalculateLowerLimit(y,0));
66  else gr->SetPointEYlow(i,sqrt(y));
67  if ( y < 30 ) gr->SetPointEYhigh(i,fc.CalculateUpperLimit(y,0)-y);
68  else gr->SetPointEYhigh(i,sqrt(y));
69  } else {
70  removePoints.push_back(i);
71  }
72 
73  if(noErrorsXaxis){
74  gr->SetPointEXlow(i, 0);
75  gr->SetPointEXhigh(i, 0);
76  } // Do not use bin width as X-error for points
77  }
78 
79  // get rid of uninteresting points
80  for (uint i = 0; i < removePoints.size(); ++i)
81  gr->RemovePoint(removePoints[i]-i);
82 
83  return gr;
84 }
85 
86 // These are also defined elsewhere but I had some issue with includes
87 // also only need them to select periods for debugging
89  {
90  if(hdr.det == caf::kNEARDET){
91  return PeriodFromRunND(hdr.run);
92  }
93  else if(hdr.det == caf::kFARDET){
94  return PeriodFromRunFD(hdr.run);
95  }
96  else{
97  std::cout << "PeriodFromHeader(): Unknown detector "
98  << hdr.det << ". Abort" << std::endl;
99  abort();
100  }
101  }
102 
103 const Cut kPeriod10([](const caf::SRProxy* sr) {
104  return PeriodFromHeader(sr->hdr) == 10;
105  });
106 
107 // --- Cut for kalbak study.
108 const Cut kKalBakCut( [](const caf::SRProxy* sr) {
109  return (sr->sel.contain.kalbakcell > 40 &&
110  sr->sel.contain.kalbakcell < 88);
111  });
112 
113 
114 // ************** Define my additional Vars **************
115 // --- The Reco - True / True neutrino energy
116 const Var kERes = ( (kCCE-kTrueE)/kTrueE );
117 
118 // --- Kalman track E per nHit.
119 const Var kTrkEPerNHit( [](const caf::SRProxy* sr) {
120  return (sr->trk.kalman.tracks[0].calE / sr->trk.kalman.tracks[0].nhit);
121  });
122 
123 // --- The most forward Kalman track hit cell.
124 const Var kKalFwdCell( [](const caf::SRProxy* sr) { return sr->sel.contain.kalfwdcell; });
125 
126 // --- The most backward Kalman track hit cell.
127 const Var kKalBakCell( [](const caf::SRProxy* sr) { return sr->sel.contain.kalbakcell; });
128 
129 // --- The highest Y vertex of Kalman track.
130 const Var kMaxKalYPos( [](const caf::SRProxy* sr) {
131  if(sr->trk.kalman.ntracks < 1) return -10.0f;
132  return std::max( sr->trk.kalman.tracks[0].start.Y()/100,
133  sr->trk.kalman.tracks[0].stop.Y()/100 );
134  });
135 
136 // --- The highest Z vertex of Kalman track.
137 const Var kMaxKalZPos( [](const caf::SRProxy* sr) {
138  if(sr->trk.kalman.ntracks < 1) return -10.0f;
139  return std::max( sr->trk.kalman.tracks[0].start.Z()/100,
140  sr->trk.kalman.tracks[0].stop.Z()/100 );
141  });
142 
143 // --- Scattering over track length
144 const Var kScattTrLen( [](const caf::SRProxy* sr) {
145  if(sr->trk.kalman.ntracks < 1) return -10.0f;
146  return (float)((float)sr->sel.cosrej.scatt / (float)sr->trk.kalman.tracks[0].len);
147  });
148 
149 // --- Min Proj cells to edge
150 const Var kMinCellEdg( [](const caf::SRProxy* sr) {
151  return std::min((sr->sel.contain.kalfwdcell + sr->sel.contain.kalbakcell),
153  });
154 
155 // --- Ratio of kalman hits in slice.
156 const Var kRatOfKalHi( [](const caf::SRProxy* sr) {
157  if(sr->trk.kalman.ntracks < 1) return -10.0f;
158  return (float)((float)sr->trk.kalman.tracks[0].nhit / (float)sr->slc.nhit);
159  });
160 
161 // --- The first hit cell.
162 const Var kFirstCell( [](const caf::SRProxy* sr) { return sr->slc.firstcell; });
163 
164 // --- The last hit cell.
165 const Var kLastCell ( [](const caf::SRProxy* sr) { return sr->slc.lastcell; });
166 
167 // --- The difference in XY Track Length
168 const Var kTrkLenXY( [](const caf::SRProxy* sr) {
169  if(sr->trk.kalman.ntracks < 1) return -10.0f;
170  float XLen = ( sr->trk.kalman.tracks[0].start.X() - sr->trk.kalman.tracks[0].stop.X() ) /100;
171  float YLen = ( sr->trk.kalman.tracks[0].start.Y() - sr->trk.kalman.tracks[0].stop.Y() ) /100;
172  return XLen - YLen;
173  });
174 
175 // --- The True Hadronic Energy
177 
178 // --- The True Hadronic Energy Fraction
179 const Var kTrueHFrE( [](const caf::SRProxy* sr) {
180  float HadE = kTrueHadE(sr);
181  float TruE = kTrueE(sr);
182  return ( HadE / TruE );
183  });
184 
185 // ******* Define some bin sets which I want to use *******
186 
187 const Binning NumHitBins = Binning::Simple( 20, 0.0 , 400 );
188 const Binning RatioBins = Binning::Simple( 51, -0.01 , 1.01 );
189 const Binning CVNLooseBins = Binning::Simple( 31, 0.695, 1.005 );
190 const Binning CosRejBins = Binning::Simple( 35, 0.3 , 0.80 );
191 
192 // Energy bins
194 const Binning EnergyBins = Binning::Simple( 100, 0 , 5 );
195 const Binning LowEnBins = Binning::Simple( 25, 0 , 3 );
196 const Binning EnPHitBins = Binning::Simple( 40, 0 , 0.04 );
197 const Binning EResBins = Binning::Simple( 100, -0.5, 0.5 );
198 const Binning HadFracBins = Binning::Simple( 26, -0.02, 1.02 );
199 
200 // Length / hit bins
201 const Binning NumTrkBins = Binning::Simple( 11, -0.5, 10.5 );
202 const Binning YRangeBins = Binning::Simple( 24, -8 , 8 );
203 const Binning ZRangeBins = Binning::Simple( 25, 0 , 60 );
204 const Binning XYDiffBins = Binning::Simple( 20, 0 , 10 );
205 const Binning LengthBins = Binning::Simple( 25, 0 , 20 );
206 const Binning LgCellsBins = Binning::Simple( 25, 0 , 1000 );
207 const Binning SmCellsBins = Binning::Simple( 25, 0 , 400 );
208 
209 // Time bins
210 const Binning TimeFBins = Binning::Simple( 100, 0, 550 );
211 const Binning TimeZBins = Binning::Simple( 50, 200, 250 );
212 
213 // ******* Prediction struct *******
214 struct PredDef
215 {
216  const IPrediction * pred;
217  const TString xp_type;
218  const TString syst_name;
219  const TString sigma_name;
220  const TString edef_name;
221 };
222 
223 
224 // ******* Make the variable map *******
225 // Using pair for shortname in directories and files
226 // and longname for x-axis title
227 struct Variable
228 {
231 };
232 
233 const std::map< std::pair<std::string, std::string >, Variable > vars =
234  {
235  // Interesting things
236  { std::make_pair("recoE" , "Reconstructed Neutrino Energy (GeV)"), {kCCE , kNumuCCEOptimisedBinning} },
237  { std::make_pair("sliceTime_Full", "Time of slice - full (us)" ), {kSliceTime , TimeFBins } },
238  { std::make_pair("sliceTime_Zoom", "Time of slice - zoom (us)" ), {kSliceTime , TimeZBins } },
239  { std::make_pair("muonE" , "Reconstructed muon energy (GeV)" ), {kMuE , LowEnBins } },
240  { std::make_pair("muonEPerHit" , "Muon energy per hit (GeV/hit)" ), {kTrkCalEPerNHit, EnPHitBins } },
241  { std::make_pair("hadE" , "Reconstructed hadronic energy (GeV)"), {kHadE , LowEnBins } },
242  { std::make_pair("hadEPerHit" , "Hadronic energy per hit (GeV/hit)" ), {kHadEPerNHit , EnPHitBins } },
243  { std::make_pair("hadEFrac" , "Hadronic energy fraction in slice" ), {kHadEFrac , RatioBins } },
244  { std::make_pair("sliceNHits" , "Number of hits per slice" ), {kNHit , NumHitBins } },
245  { std::make_pair("remID" , "RemID score" ), {kRemID , RatioBins } },
246  { std::make_pair("cvnLoose" , "CVN loose p_{T}^{sum} score" ), {kCVNm_looseptp , CVNLooseBins } },
247  { std::make_pair("cosRej" , "Cosmic rejection score" ), {kNumuContPID , CosRejBins } },
248 
249  // Track Positions
250  { std::make_pair("trackStartX" , "Track start X position (m)" ), {kTrkStartX, YRangeBins} },
251  { std::make_pair("trackStartY" , "Track start Y position (m)" ), {kTrkStartY, YRangeBins} },
252  { std::make_pair("trackStartZ" , "Track start Z position (m)" ), {kTrkStartZ, ZRangeBins} },
253  { std::make_pair("trackEndX" , "Track stop X position (m)" ), {kTrkEndX , YRangeBins} },
254  { std::make_pair("trackEndY" , "Track stop Y position (m)" ), {kTrkEndY , YRangeBins} },
255  { std::make_pair("trackEndZ" , "Track stop Z position (m)" ), {kTrkEndZ , ZRangeBins} },
256  { std::make_pair("trackXYLenDiff", "Difference in XY track lengths (m)"), {kTrkLenXY , XYDiffBins} },
257 
258  // Track stuff
259  { std::make_pair("kalNTracks" , "Number of Kalman tracks" ), {kNKalman , NumTrkBins } },
260  { std::make_pair("kalTrackNHits" , "Number of hits per Kal track" ), {kTrkNhits , NumHitBins } },
261  { std::make_pair("kalHitSliceRatio", "Fraction of Kal track hits in slice"), {kRatOfKalHi, RatioBins } },
262  { std::make_pair("kalTrackLen" , "Length of Kalman track" ), {kTrkLength , LengthBins } },
263  { std::make_pair("kalNumiAngle" , "Angle of Kalman track to beam" ), {kCosNumi , RatioBins } },
264  { std::make_pair("kalFwdCell" , "Kalman projection forward cells" ), {kKalFwdCell, LgCellsBins } },
265  { std::make_pair("kalBakCell" , "Kalman projection backward cells" ), {kKalBakCell, LgCellsBins } },
266  { std::make_pair("minCellEdge" , "Minimum projected cells to edge" ), {kMinCellEdg, LgCellsBins } },
267 
268  // Slice stuff
269  { std::make_pair("firstCell" , "Slice first cell"), {kFirstCell , SmCellsBins } },
270  { std::make_pair("lastCell" , "Slice last cell" ), {kLastCell , SmCellsBins } },
271  { std::make_pair("sliceMaxY" , "Slice max Y (m)" ), {kSlcMaxY , YRangeBins } },
272  { std::make_pair("sliceMinY" , "Slice min Y (m)" ), {kSlcMinY , YRangeBins } },
273  { std::make_pair("sliceMaxX" , "Slice max X (m)" ), {kSlcMaxX , YRangeBins } },
274  { std::make_pair("sliceMinX" , "Slice min X (m)" ), {kSlcMinX , YRangeBins } },
275  { std::make_pair("sliceMaxZ" , "Slice max Z (m)" ), {kSlcMaxZ , ZRangeBins } },
276  { std::make_pair("sliceMinZ" , "Slice min Z (m)" ), {kSlcMinZ , ZRangeBins } },
277 
278  // Truth stuff
279  { std::make_pair("trueE", "True neutrino energy (GeV)"), {kTrueE, EnergyBins} },
280  { std::make_pair("resE" , "(RecoE - TrueE) / TrueE" ), {kERes , EResBins } }
281  };
282 
283 
284 
const Var kHadE
Definition: NumuVars.h:23
Near Detector underground.
Definition: SREnums.h:10
const Binning ZRangeBins
T max(const caf::Proxy< T > &a, T b)
const TString sigma_name
const Cut kKalBakCut([](const caf::SRProxy *sr){return(sr->sel.contain.kalbakcell > 40 && sr->sel.contain.kalbakcell< 88);})
const Var kNKalman
Definition: NumuVars.cxx:540
const Binning CosRejBins
Far Detector at Ash River.
Definition: SREnums.h:11
Represent the binning of a Spectrum&#39;s x-axis.
Definition: Binning.h:16
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kMaxKalYPos([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return std::max(sr->trk.kalman.tracks[0].start.Y()/100, sr->trk.kalman.tracks[0].stop.Y()/100);})
const TString syst_name
const Var kSlcMaxZ([](const caf::SRProxy *sr){return sr->slc.boxmax.Z()/100.;})
Definition: NumuVars.h:93
const Var kSlcMaxY([](const caf::SRProxy *sr){return sr->slc.boxmax.Y()/100.;})
Definition: NumuVars.h:92
caf::Proxy< size_t > ntracks
Definition: SRProxy.h:1756
const Var kNumuContPID
Definition: NumuVars.cxx:553
caf::Proxy< caf::SRHeader > hdr
Definition: SRProxy.h:2119
Struct to hold prediction information.
caf::Proxy< unsigned int > firstcell
Definition: SRProxy.h:1283
caf::Proxy< caf::SRContain > contain
Definition: SRProxy.h:1230
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2108
T sqrt(T number)
Definition: d0nt_math.hpp:156
const Binning YRangeBins
const Binning EnPHitBins
const Var kMinCellEdg([](const caf::SRProxy *sr){return std::min((sr->sel.contain.kalfwdcell+sr->sel.contain.kalbakcell), (sr->sel.contain.cosfwdcell+sr->sel.contain.cosbakcell));})
const Var kTrkStartY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.Y()/100;})
Definition: NumuVars.h:52
const Var kFirstCell([](const caf::SRProxy *sr){return sr->slc.firstcell;})
const Var kSliceTime([](const caf::SRProxy *sr){return sr->slc.meantime/1000;})
Definition: NumuVars.h:34
const Binning LowEnBins
const Var kTrueHFrE([](const caf::SRProxy *sr){float HadE=kTrueHadE(sr);float TruE=kTrueE(sr);return(HadE/TruE);})
const Var kLastCell([](const caf::SRProxy *sr){return sr->slc.lastcell;})
const IPrediction * pred
const Binning TimeZBins
caf::Proxy< int > cosfwdcell
Definition: SRProxy.h:789
const Var kTrkCalEPerNHit([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 0.f;return sr->trk.kalman.tracks[0].calE/sr->trk.kalman.tracks[0].nhit;})
Definition: NumuVars.h:68
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
caf::Proxy< int > cosbakcell
Definition: SRProxy.h:784
const Var kTrkEPerNHit([](const caf::SRProxy *sr){return(sr->trk.kalman.tracks[0].calE/sr->trk.kalman.tracks[0].nhit);})
const Var kKalFwdCell([](const caf::SRProxy *sr){return sr->sel.contain.kalfwdcell;})
const Var kTrkLength([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].len/100;})
Definition: NumuVars.h:65
const Var kScattTrLen([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)((float) sr->sel.cosrej.scatt/(float) sr->trk.kalman.tracks[0].len);})
const Var kSlcMinX([](const caf::SRProxy *sr){return sr->slc.boxmin.X()/100.;})
Definition: NumuVars.h:87
const Var kHadEPerNHit([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 0.0f;int nHit=sr->slc.nhit-sr->trk.kalman.tracks[0].nhit;if(nHit<=0) return 0.0f;float hadE=sr->energy.numu.hadcalE;return hadE/nHit;})
Definition: NumuVars.h:63
const Var kSlcMaxX([](const caf::SRProxy *sr){return sr->slc.boxmax.X()/100.;})
Definition: NumuVars.h:91
unsigned int PeriodFromRunFD(int run)
: Helper function to compute the period given a run number for the FD.
Definition: RunPeriods.cxx:15
caf::Proxy< caf::SRCosRej > cosrej
Definition: SRProxy.h:1231
const Var kSlcMinY([](const caf::SRProxy *sr){return sr->slc.boxmin.Y()/100.;})
Definition: NumuVars.h:88
caf::Proxy< unsigned int > lastcell
Definition: SRProxy.h:1287
const Binning XYDiffBins
caf::Proxy< unsigned int > nhit
Definition: SRProxy.h:1294
const Var kRatOfKalHi([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)((float) sr->trk.kalman.tracks[0].nhit/(float) sr->slc.nhit);})
const Var kERes
const Var kTrueE([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?0.:float(sr->mc.nu[0].E);})
Definition: Vars.cxx:85
const Binning EnergyBins
caf::Proxy< float > scatt
Definition: SRProxy.h:866
const Var kRemID
PID
Definition: Vars.cxx:81
caf::Proxy< caf::SRTrackBranch > trk
Definition: SRProxy.h:2127
const Var kHadEFrac
Definition: NumuVars.h:24
const Var kNHit
Definition: Vars.cxx:71
const Var kTrkStartZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.Z()/100;})
Definition: NumuVars.h:53
TGraphAsymmErrors * GraphWithPoissonErrors2(const TH1 *h, const TH1 *h2, bool noErrorsXaxis, bool drawEmptyBins)
Same as above but use a reference histogram to determine which empty bins to draw.
Definition: Plots.cxx:942
const Var kCCE
Definition: NumuVars.h:21
int PeriodFromHeader(const caf::SRHeaderProxy &hdr)
Definition: PeriodCuts.cxx:9
caf::StandardRecord * sr
const std::map< std::pair< std::string, std::string >, Variable > vars
const Binning EResBins
const TString edef_name
const Var kTrkStartX([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].start.X()/100;})
Definition: NumuVars.h:51
const Var kCVNm_looseptp
Definition: Vars.cxx:40
const Var kTrkEndZ([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.Z()/100;})
Definition: NumuVars.h:57
OStream cout
Definition: OStream.cxx:6
TH1F * h2
Definition: plot.C:45
const Var kTrkLenXY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;float XLen=(sr->trk.kalman.tracks[0].start.X()-sr->trk.kalman.tracks[0].stop.X())/100;float YLen=(sr->trk.kalman.tracks[0].start.Y()-sr->trk.kalman.tracks[0].stop.Y())/100;return XLen-YLen;})
caf::Proxy< int > kalbakcell
Definition: SRProxy.h:796
caf::Proxy< int > kalfwdcell
Definition: SRProxy.h:801
caf::Proxy< caf::SRKalman > kalman
Definition: SRProxy.h:1775
const TString xp_type
const Var kKalBakCell([](const caf::SRProxy *sr){return sr->sel.contain.kalbakcell;})
caf::Proxy< caf::SRSlice > slc
Definition: SRProxy.h:2124
const Var kTrkEndY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.Y()/100;})
Definition: NumuVars.h:56
const Binning NumHitBins
const Var kTrkEndX([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return sr->trk.kalman.tracks[0].stop.X()/100;})
Definition: NumuVars.h:55
const Binning LengthBins
const Var kTrueMuonE([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return 0.f;if(sr->mc.nu[0].prim.empty()) return 0.f;if(std::abs(sr->mc.nu[0].prim[0].pdg)!=13) return 0.f;return float(sr->mc.nu[0].prim[0].p.E);})
Definition: NumuVars.h:107
const Var kTrueHadE
const Binning kNumuCCEOptimisedBinning
Optimised binning for numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39; in that talk...
Definition: Binnings.cxx:28
const Binning OptEnBins
const Binning LgCellsBins
Standard interface to all prediction techniques.
Definition: IPrediction.h:57
const Binning NumTrkBins
const Cut kPeriod10([](const caf::SRProxy *sr){return PeriodFromHeader(sr->hdr)==10;})
const Binning SmCellsBins
const Binning CVNLooseBins
const Binning TimeFBins
const Var kMaxKalZPos([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return std::max(sr->trk.kalman.tracks[0].start.Z()/100, sr->trk.kalman.tracks[0].stop.Z()/100);})
caf::Proxy< std::vector< caf::SRKalmanTrack > > tracks
Definition: SRProxy.h:1758
caf::Proxy< caf::SRIDBranch > sel
Definition: SRProxy.h:2123
T min(const caf::Proxy< T > &a, T b)
const Var kMuE
Definition: NumuVars.h:22
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:114
const Var kCosNumi([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks > 0 &&sr->trk.kalman.idxremid!=999){if(sr->hdr.det==1){return sr->trk.kalman.tracks[0].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman.tracks[0].dir.Dot(beamDirFD);}}return-5.f;})
Definition: NumuVars.h:43
unsigned int PeriodFromRunND(int run)
: Helper function to compute the period given a run number for the ND.
Definition: RunPeriods.cxx:34
const Binning HadFracBins
const Var kSlcMinZ([](const caf::SRProxy *sr){return sr->slc.boxmin.Z()/100.;})
Definition: NumuVars.h:89
const Var kTrkNhits([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 65535;return int(sr->trk.kalman.tracks[0].nhit);})
Definition: NumuVars.h:59
const Binning RatioBins
unsigned int uint