ComparisonPlots_Data.C
Go to the documentation of this file.
1 #include "CAFAna/Cuts/Cuts.h"
6 #include "CAFAna/Core/Binning.h"
7 #include "CAFAna/Core/Spectrum.h"
9 #include "CAFAna/nus/NuSPlotFunctions.h"
10 
12 #include "CAFAna/Vars/HistAxes.h"
15 
17 
18 #include "TCanvas.h"
19 #include "TH2.h"
20 #include "TProfile.h"
21 
22 using namespace ana;
23 
25  std::cout << "Please provide;"
26  << "A Detector;\n\t1 For ND.\n\t2 for FD. \n"
27  << "An input samweb definition. \n"
28  << "An output file name. \n"
29  << std::endl;
30 }
31 
32 void ComparisonPlots_Data( int WhichDetector, std::string OutputName, bool Cosmics=false,
33  std::string InputDef="/pnfs/nova/persistent/users/bzamoran/CheckEvents/fd_data.root",
34  unsigned int NumCuts=1, bool Debug=false )
35 {
36  // The variables I am going to use for WhichDetector are;
37  // WhichDetector == 1 -- Near Detector
38  // WhichDetector == 2 -- Far Detector
39 
40  // --- Define my loader, and pass it the file / dataset which it will load...
41  SpectrumLoader loader( InputDef );
43 
44  // --- Define my broad cuts - this is taken from Michael - Devs Repo /mbaird42/tracker_comparisons/FourSquare_plots.C
45  // Add the detector specific ones.
46  Cut kDetCut = kNoCut;
47  if ( WhichDetector == 1 ) {
48  kDetCut = kNumuContainND2017;
49  } else if (WhichDetector == 2) {
50  kDetCut = kNumuContainFD2017;
51  }
52 
53  // --- The timing cut.
54  Cut TimingCut = kInBeamSpill;
55  Var CosWeight = kUnweighted;
56  if (Cosmics) {
57  TimingCut = kInTimingSideband;
58  CosWeight = kTimingSidebandWeight;
59  }
60 
61  // ----- Define my cuts....
62  std::vector<Cut> kDefinedCut;
63  std::string CutNames[NumCuts];
64  if (NumCuts == 4) { // --- NumCuts == 4
65  // --- Cut
66  kDefinedCut.push_back( TimingCut && kNumuQuality ); // Good quality NuMu events
67  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut ); // That the event is contained.
68  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut ); // Reject cosmics
69  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut && kNumuPID2017 ); // Reject Neutral current events
70  // --- CutNames
71  CutNames[0] = "_QualCuts";
72  CutNames[1] = "_DetCuts" ;
73  CutNames[2] = "_CosmCuts";
74  CutNames[3] = "_NeuCCuts";
75  // --- CosmicRej
76  if ( WhichDetector == 2 ) {
77  kDefinedCut[2] = kDefinedCut[2] && kNumuCosmicRej2017;
78  kDefinedCut[3] = kDefinedCut[3] && kNumuCosmicRej2017;
79  }
80  }
81  else if (NumCuts == 1) { // --- NumCuts == 1
82  // --- Cut
83  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut && kNumuPID2017 ); // Reject Neutral current events
84  // --- CutNames
85  CutNames[0] = "_NeuCCuts";
86  // --- CosmicRej
87  if ( WhichDetector == 2 ) {
88  kDefinedCut[0] = kDefinedCut[0] && kNumuCosmicRej2017;
89  }
90  }
91 
92  // --- Load Michaels QuantileCuts.
93  std::string WhichPeriod = "full";
94  if (InputDef.find("period1") ) WhichPeriod = "period1";
95  else if (InputDef.find("period2") ) WhichPeriod = "period2";
96  else if (InputDef.find("period3") ) WhichPeriod = "period3";
97  else if (InputDef.find("period5") ) WhichPeriod = "period5";
98  TString fdspecfile = "/nova/app/users/karlwarb/Workspace/NuMuSystematics/FDQuantileHists/final_"+WhichPeriod+"_FD_histo_for_quantile_cuts.root";
99  TFile inFile(fdspecfile);
100  gDirectory->cd("dir_FDSpec2D");
101  TH2 *FDSpec2D = (TH2*)inFile.FindObjectAny("FDSpec2D");
102  // Add get the cuts....
103  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis, kHadEFracAxis, 4);
104 
105  // ----- Define my quantiles.
106  const unsigned int NumQuants = 5;
107  Cut kQuantCut[NumQuants] = { kNoCut, HadEFracQuantCuts[0], HadEFracQuantCuts[1], HadEFracQuantCuts[2], HadEFracQuantCuts[3] };
108  const std::string QuantNames[NumQuants] = {
109  "_AllQuants",
110  "_Quant1",
111  "_Quant2",
112  "_Quant3",
113  "_Quant4"
114  };
115 
116  // ---- Write some output.
117  std::cout << "Before I declare anything, the following is set;\n"
118  << "\tWhichDetector is " << WhichDetector << "\n"
119  << "\tInput definit is " << InputDef << "\n"
120  << "\tOutput file name " << OutputName << "\n"
121  << "\tRunning sideband " << Cosmics << "\n"
122  << "\tNumber of Cuts " << NumCuts << "\n"
123  << "\tIs debug mode is " << Debug << "\n"
124  << std::endl;
125 
126  // --- Declare all of my spectra, before setting them in a loop...
127  // *** Some key ones first.
128  Spectrum *sReconstEnergy[NumCuts][NumQuants]; // --- Reconstructed energy --- Vars.h ===> kCCE ---> sr->energy.numu.E
129  Spectrum *sSliceTimeFull[NumCuts][NumQuants]; // --- Mean time of slice Full --- NumuVars.h ===> kSliceTime ---> sr->slc.meantime/1000
130  Spectrum *sSliceTimeZoom[NumCuts][NumQuants]; // --- Mean time of slice Zoom --- NumuVars.h ===> kSliceTime ---> sr->slc.meantime/1000
131  Spectrum *sMuonEnergy [NumCuts][NumQuants]; // --- Muon energy in the slice --- Vars.h ===> kMuE --> energy.numu.recomuonE
132  Spectrum *sMuonEnPerHit [NumCuts][NumQuants]; // --- Muon energy per hit --- NumuVars.h ===> kTrkEPerNHit --> sr->trk.kalman.tracks[0].calE / sr->trk.kalman.tracks[0].nhit
133  Spectrum *sHadronEnergy [NumCuts][NumQuants]; // --- Hadronic energy --- NumuVars.h ===> kHadE --> sr->energy.numu.E - sr->energy.numu.recomuonE
134  Spectrum *sHadroEnPerHit[NumCuts][NumQuants]; // --- Hadronic energy per hit --- NumuVars.h ===> kHadEPerNHit --> function.
135  Spectrum *sHadFracEnergy[NumCuts][NumQuants]; // --- Hadronic energy fraction --- NumuVars.h ===> kHadEFrac --> kHadE / kCCE
136  Spectrum *sHitsPerSlice [NumCuts][NumQuants]; // --- Number of hits per slice --- Vars.h ===> kNHit --> slc.nhit
137  Spectrum *sRemIDScore [NumCuts][NumQuants]; // --- The RemID score --- Vars.h ===> kRemID --> sr->sel.remid.pid
138  Spectrum *sCVNCosmicScor[NumCuts][NumQuants]; // --- CVN Cosmic score --- Vars.h ===> sr->sel.cvn.output[14]
139  Spectrum *sCVNNuMuIDScor[NumCuts][NumQuants]; // --- CVN NuMuID score --- Vars.h ===> sr->sel.cvn.numuid
140  Spectrum *sNuMuContPID [NumCuts][NumQuants]; // --- Third analysis BDT --- NuMuVars.h ===> sr->sel.cosrej.numucontpid
141  Spectrum *sSANuMuContPID[NumCuts][NumQuants]; // --- Second analysis BDT --- Above.
142  // *** Some important Truth based ones.
143  Spectrum *sTrueNuEnergy [NumCuts][NumQuants]; // --- True neutrino energy --- Vars.h ===> kTrueE ---> sr->mc.nu[0].E
144  Spectrum *sReTrOverTrNuE[NumCuts][NumQuants]; // --- Reco - True / True Nu E --- Above.
145 
146  // *** Basic positional plots.
147  Spectrum *sTrkStartX[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartX --> trk.kalman.tracks[0].start.X()/100
148  Spectrum *sTrkStartY[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartY --> trk.kalman.tracks[0].start.Y()/100
149  Spectrum *sTrkStartZ[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartZ --> trk.kalman.tracks[0].start.Z()/100
150  Spectrum *sTrkEndX [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndX --> trk.kalman.tracks[0].stop.X()/100
151  Spectrum *sTrkEndY [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndY --> trk.kalman.tracks[0].stop.Y()/100
152  Spectrum *sTrkEndZ [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndZ --> trk.kalman.tracks[0].stop.Z()/100
153  Spectrum *sTrkLenXY [NumCuts][NumQuants]; // --- Diff in Track Len X Y --- Above. ===> kTrkLenXY --> (tracks[0].start.X - tracks[0].stop.X) / 100
154 
155  // *** Track based ones...
156  Spectrum *sNumKalTracks [NumCuts][NumQuants]; // --- Number of Kal trk in slc --- NuMuVars.h ===> sr->trk.kalman.ntracks
157  Spectrum *sNumKalTrHits [NumCuts][NumQuants]; // --- Number of hits in Kal tr --- NuMuVars.h ===> sr->trk.kalman.tracks[0].nhit
158  Spectrum *sRatKalHitSlc [NumCuts][NumQuants]; // --- Ratio of Kal hits in slc --- Above.
159  Spectrum *sKalTrLength [NumCuts][NumQuants]; // --- Length of Kalman track --- NuMuVars.h ===> sr->trk.kalman.tracks[0].len / 100
160  Spectrum *sKalTrBeamAng [NumCuts][NumQuants]; // --- Angle Kal track & beam --- NuMuVars.h ===> kCosNumi --> sr->trk.kalman.tracks[0].dir.Dot(beamDirND)
161  Spectrum *sKalMostFwdCel[NumCuts][NumQuants]; // --- Most forward Kal tr hit --- Above.
162  Spectrum *sKalMostBakCel[NumCuts][NumQuants]; // --- Most backward Kal tr hit --- Above.
163  Spectrum *sKalTrVer_MaxY[NumCuts][NumQuants]; // --- Highest Y Kalman tr vert --- Above.
164  Spectrum *sKalTrVer_MaxZ[NumCuts][NumQuants]; // --- Highest Z Kalman tr vert --- Above.
165  Spectrum *sKalTrDir_Y [NumCuts][NumQuants]; // --- Y direction of Kal track --- NuMuVars.h ===> sr->trk.kalman.tracks[0].dir.Y()
166  Spectrum *sScattKalTrLen[NumCuts][NumQuants]; // --- Scattering over tr len --- Above.
167 
168  // *** Hit based ones...
169  Spectrum *sFirstHitCell [NumCuts][NumQuants]; // --- The first cell hit --- Above.
170  Spectrum *sLastHitCell [NumCuts][NumQuants]; // --- The last cell hit --- Above.
171  Spectrum *sMaxActivity_Y[NumCuts][NumQuants]; // --- Maximum Y pos of activty --- NuMuVars.h ===> sr->slc.boxmax.Y() / 100.
172  Spectrum *sMinActivity_Y[NumCuts][NumQuants]; // --- Minimum Y pos of activty --- NuMuVars.h ===> sr->slc.boxmin.Y() / 100.
173  Spectrum *sMaxActivity_Z[NumCuts][NumQuants]; // --- Maximum Z pos of activty --- NuMuVars.h ===> sr->slc.boxmax.Z() / 100.
174  Spectrum *sMinActivity_Z[NumCuts][NumQuants]; // --- Minimum Z pos of activty --- NuMuVars.h ===> sr->slc.boxmin.Z() / 100.
175  Spectrum *sMinCellToEdge[NumCuts][NumQuants]; // --- Minimum cells to edge --- Above.
176 
177  // *** Visible energy quanta.
178  // Slice
179  Spectrum *sVisEInSlice [NumCuts][NumQuants]; // --- The Vis En in the slice --- Above. ---> kVisESlc ---> sr->slc.calE
180  Spectrum *sNHitInSlice [NumCuts][NumQuants]; // --- The Num.Hits in the slic --- Above. ---> kNHitSlc ---> sr->slc.nhit
181  Spectrum *sVisEPerHitSlc[NumCuts][NumQuants]; // --- Visibile E per hit in sl --- Above. ---> kEnPHSlc ---> kVisESlc / (1.78 * kNHitSlc)
182  // Track
183  Spectrum *sVisEInTrack [NumCuts][NumQuants]; // --- The Vis En of the track --- Above. ---> kVisETrk ---> sr->trk.kalman.tracks[0].calE
184  Spectrum *sNHitInTrack [NumCuts][NumQuants]; // --- The NumHits in the track --- Above. ---> kNHitTrk ---> sr->trk.kalman.tracks[0].nhit
185  Spectrum *sVisEPerHitTrk[NumCuts][NumQuants]; // --- Visibile E PerHit in trk --- Above. ---> kEnPHTrk ---> kVisESlc / (1.78 * kNHitTrk)
186  // Hadronic
187  Spectrum *sVisEInHadron [NumCuts][NumQuants]; // --- The Hadronic Vis Energy --- Above. ---> kVisEHad ---> (kVisESlc - kVisETrk)
188  Spectrum *sNHitInHadron [NumCuts][NumQuants]; // --- The Num of hadronic Hits --- Above. ---> kNHitHad ---> (kNHitHad - kNHitTrk)
189  Spectrum *sVisEPerHitHad[NumCuts][NumQuants]; // --- Visibile E PerHit hadron --- Above. ---> kEnPHHad ---> kVisEHad / (1.78 * kNHitHad)
190 
191  // *** RemID score / inputs
192  Spectrum *sRemIDScatLLH [NumCuts][NumQuants]; // --- RemID scattering angle --- NuMuVars.h ===> kReMIdScatLLH --> sel.remid.scatllh
193  Spectrum *sRemIDdEdxLLH [NumCuts][NumQuants]; // --- RemID dE/dx --- NuMuVars.h ===> kReMIdDEDxLLH --> sel.remid.dedxllh
194  Spectrum *sRemIDMeasFrac[NumCuts][NumQuants]; // --- RemID fraction of planes --- NuMuVars.h ===> kReMIdMeasFrac -> sel.remid.measfrac
195 
196  // *** Some calibration quantities
197  Spectrum *sCor_RecEn[NumCuts][NumQuants][4];
198  Spectrum *sCor_MuoEn[NumCuts][NumQuants][4];
199  Spectrum *sCor_HadEn[NumCuts][NumQuants][4];
200  Spectrum *sCor_HFrEn[NumCuts][NumQuants][4];
201 
202  const Cut kCorner[4] = { kW_TL, kW_TR, kW_BL, kW_BR };
203  const std::string CutName[4] = { "_TopL", "_TopR", "_BotL", "_BotR" };
204 
205  // --- And now set what is going to go into each of my spectra.
206  for (unsigned int cc=0; cc<NumCuts; ++cc) {
207  // --- Loop through my quantiles.
208  for (unsigned int qq=0; qq<NumQuants; ++qq) {
209  // What is the cut this time?
210  const Cut kThisCut = kNumu2017Veto && kDefinedCut[cc] && kQuantCut[qq];
211 
212  // *** Some key ones first...
213  sReconstEnergy[cc][qq] = new Spectrum("The reconstructed energy", EnergyBins, loader, kCCE , kThisCut, kNoShift, CosWeight );
214  sSliceTimeFull[cc][qq] = new Spectrum("The time of slice - Full", TimeFBins , loader, kSliceTime , kThisCut, kNoShift, CosWeight );
215  sSliceTimeZoom[cc][qq] = new Spectrum("The time of slice - Zoom", TimeZBins , loader, kSliceTime , kThisCut, kNoShift, CosWeight );
216  sMuonEnergy [cc][qq] = new Spectrum("The muon energy " , EnergyBins, loader, kMuE , kThisCut, kNoShift, CosWeight );
217  sMuonEnPerHit [cc][qq] = new Spectrum("The muon energy per hit" , EnPHitBins, loader, kTrkEPerNHit , kThisCut, kNoShift, CosWeight );
218  sHadronEnergy [cc][qq] = new Spectrum("The hadronic energy" , EnergyBins, loader, kHadE , kThisCut, kNoShift, CosWeight );
219  sHadroEnPerHit[cc][qq] = new Spectrum("The hadronic En per hit ", EnPHitBins, loader, kHadEPerNHit , kThisCut, kNoShift, CosWeight );
220  sHadFracEnergy[cc][qq] = new Spectrum("The hadronic energy frac", RatioBins , loader, kHadEFrac , kThisCut, kNoShift, CosWeight );
221  sHitsPerSlice [cc][qq] = new Spectrum("Number of hits per slice", NumHitBins, loader, kNHit , kThisCut, kNoShift, CosWeight );
222  sRemIDScore [cc][qq] = new Spectrum("The RemID score" , RatioBins , loader, kRemID , kThisCut, kNoShift, CosWeight );
223  sCVNCosmicScor[cc][qq] = new Spectrum("CVN Cosmic score" , RatioBins , loader, kCVNcos2017 , kThisCut, kNoShift, CosWeight );
224  sCVNNuMuIDScor[cc][qq] = new Spectrum("CVN NuMu score" , RatioBins , loader, kCVNm , kThisCut, kNoShift, CosWeight );
225  sNuMuContPID [cc][qq] = new Spectrum("The NuMu containment PID", RatioBins , loader, kNumuContPID , kThisCut, kNoShift, CosWeight );
226  sSANuMuContPID[cc][qq] = new Spectrum("SA NuMu containment PID" , RatioBins , loader, kSANumuContPID, kThisCut, kNoShift, CosWeight );
227  // *** Some important truth based ones.
228  sTrueNuEnergy [cc][qq] = new Spectrum("The true neutrino energy", EnergyBins, loader, kTrueE , kThisCut, kNoShift, CosWeight );
229  sReTrOverTrNuE[cc][qq] = new Spectrum("The R-T ov T Nu energy" , RangeBins , loader, kRTOvTNuE , kThisCut, kNoShift, CosWeight );
230 
231  // *** Positional plots
232  sTrkStartX[cc][qq] = new Spectrum("Starting X Pos of Track", YRangeBins, loader, kTrkStartX, kThisCut, kNoShift, CosWeight );
233  sTrkStartY[cc][qq] = new Spectrum("Starting Y Pos of Track", YRangeBins, loader, kTrkStartY, kThisCut, kNoShift, CosWeight );
234  sTrkStartZ[cc][qq] = new Spectrum("Starting Z Pos of Track", ZRangeBins, loader, kTrkStartZ, kThisCut, kNoShift, CosWeight );
235  sTrkEndX [cc][qq] = new Spectrum("Ending X Pos of Track" , YRangeBins, loader, kTrkEndX , kThisCut, kNoShift, CosWeight );
236  sTrkEndY [cc][qq] = new Spectrum("Ending Y Pos of Track" , YRangeBins, loader, kTrkEndY , kThisCut, kNoShift, CosWeight );
237  sTrkEndZ [cc][qq] = new Spectrum("Ending Z Pos of Track" , ZRangeBins, loader, kTrkEndZ , kThisCut, kNoShift, CosWeight );
238  sTrkLenXY [cc][qq] = new Spectrum("Track Length Diff in XY", YRangeBins, loader, kTrkLenXY , kThisCut, kNoShift, CosWeight );
239 
240  // *** Track based ones...
241  sNumKalTracks [cc][qq] = new Spectrum("Number of Kalman Tracks" , NumTrkBins, loader, kNKalman , kThisCut, kNoShift, CosWeight );
242  sNumKalTrHits [cc][qq] = new Spectrum("Number of Kal Track hits", NumHitBins, loader, kTrkNhits , kThisCut, kNoShift, CosWeight );
243  sRatKalHitSlc [cc][qq] = new Spectrum("Ratio of KalHit in Slice", RatioBins , loader, kRatOfKalHi, kThisCut, kNoShift, CosWeight );
244  sKalTrLength [cc][qq] = new Spectrum("Length of Kalman Track" , LengthBins, loader, kTrkLength , kThisCut, kNoShift, CosWeight );
245  sKalTrBeamAng [cc][qq] = new Spectrum("Angle of KalTr to Beam" , RatioBins , loader, kCosNumi , kThisCut, kNoShift, CosWeight );
246  sKalMostFwdCel[cc][qq] = new Spectrum("Most forward KalTr Cell" , CellsBins , loader, kKalFwdCell, kThisCut, kNoShift, CosWeight );
247  sKalMostBakCel[cc][qq] = new Spectrum("Most backward KalTr Cell", CellsBins , loader, kKalBakCell, kThisCut, kNoShift, CosWeight );
248  sKalTrVer_MaxY[cc][qq] = new Spectrum("Most pos Y KalTr Vertex" , YRangeBins, loader, kMaxKalYPos, kThisCut, kNoShift, CosWeight );
249  sKalTrVer_MaxZ[cc][qq] = new Spectrum("Most pos Z KalTr Vertex" , ZRangeBins, loader, kMaxKalZPos, kThisCut, kNoShift, CosWeight );
250  sKalTrDir_Y [cc][qq] = new Spectrum("Y Direction of KalTr" , CompBins , loader, kDirY , kThisCut, kNoShift, CosWeight );
251  sScattKalTrLen[cc][qq] = new Spectrum("Scatt over KalTr length" , TinyBins , loader, kScattTrLen, kThisCut, kNoShift, CosWeight );
252 
253  // *** Hit based ones...
254  sFirstHitCell [cc][qq] = new Spectrum("The first cell hit in sl", CellsBins , loader, kFirstCell , kThisCut, kNoShift, CosWeight );
255  sLastHitCell [cc][qq] = new Spectrum("The last cell hit in sl" , CellsBins , loader, kLastCell , kThisCut, kNoShift, CosWeight );
256  sMaxActivity_Y[cc][qq] = new Spectrum("Largest Y loc with a hit", YRangeBins, loader, kSlcMaxY , kThisCut, kNoShift, CosWeight );
257  sMinActivity_Y[cc][qq] = new Spectrum("Smalest Y loc with a hit", YRangeBins, loader, kSlcMinY , kThisCut, kNoShift, CosWeight );
258  sMaxActivity_Z[cc][qq] = new Spectrum("Largest Z loc with a hit", ZRangeBins, loader, kSlcMaxZ , kThisCut, kNoShift, CosWeight );
259  sMinActivity_Z[cc][qq] = new Spectrum("Largest Z loc with a hit", ZRangeBins, loader, kSlcMinZ , kThisCut, kNoShift, CosWeight );
260  sMinCellToEdge[cc][qq] = new Spectrum("Min cells hit to edge" , CellsBins , loader, kMinCellEdg, kThisCut, kNoShift, CosWeight );
261 
262  // *** Visible energy quanta.
263  // Slice
264  sVisEInSlice [cc][qq] = new Spectrum("Visible Energy in slice" , EnergyBins, loader, kVisESlc, kThisCut, kNoShift, CosWeight );
265  sNHitInSlice [cc][qq] = new Spectrum("Number of hits in slice" , NumHitBins, loader, kNHitSlc, kThisCut, kNoShift, CosWeight );
266  sVisEPerHitSlc[cc][qq] = new Spectrum("Visible E per hit in slc", EnPHitBins, loader, kEnPHSlc, kThisCut, kNoShift, CosWeight );
267  // Track
268  sVisEInTrack [cc][qq] = new Spectrum("Visible Energy in track" , EnergyBins, loader, kVisETrk, kThisCut, kNoShift, CosWeight );
269  sNHitInTrack [cc][qq] = new Spectrum("Number of hits in track" , NumHitBins, loader, kNHitTrk, kThisCut, kNoShift, CosWeight );
270  sVisEPerHitTrk[cc][qq] = new Spectrum("Visible E per hit in trk", EnPHitBins, loader, kEnPHTrk, kThisCut, kNoShift, CosWeight );
271  // Hadronic
272  sVisEInHadron [cc][qq] = new Spectrum("Visible Hadronic Energy" , EnergyBins, loader, kVisEHad, kThisCut, kNoShift, CosWeight );
273  sNHitInHadron [cc][qq] = new Spectrum("Number of hadronic hits" , NumHitBins, loader, kNHitHad, kThisCut, kNoShift, CosWeight );
274  sVisEPerHitHad[cc][qq] = new Spectrum("Visible E per hadron hit", EnPHitBins, loader, kEnPHHad, kThisCut, kNoShift, CosWeight );
275 
276  // *** RemID score / inputs
277  sRemIDScatLLH [cc][qq] = new Spectrum("RemID Scattering angle" , CompZBins , loader, kReMIdScatLLH , kThisCut, kNoShift, CosWeight );
278  sRemIDdEdxLLH [cc][qq] = new Spectrum("RemID dE/dx" , CompBins , loader, kReMIdDEDxLLH , kThisCut, kNoShift, CosWeight );
279  sRemIDMeasFrac[cc][qq] = new Spectrum("RemID fraction of planes", RatioBins , loader, kReMIdMeasFrac, kThisCut, kNoShift, CosWeight );
280 
281  // *** Calibration quantities
282  for (int cor=0; cor<4; ++cor) {
283  const Cut kCorCut = kThisCut && kCorner[cor];
284  sCor_RecEn[cc][qq][cor] = new Spectrum("Reconstructed Energy with corner cut", EnergyBins, loader, kCCE , kCorCut, kNoShift, CosWeight);
285  sCor_MuoEn[cc][qq][cor] = new Spectrum("Muon energy with corner cut" , EnergyBins, loader, kMuE , kCorCut, kNoShift, CosWeight);
286  sCor_HadEn[cc][qq][cor] = new Spectrum("Hadronic energy with corner cut" , EnergyBins, loader, kHadE , kCorCut, kNoShift, CosWeight);
287  sCor_HFrEn[cc][qq][cor] = new Spectrum("Hadronic energy frac with corner cut", RatioBins , loader, kHadEFrac, kCorCut, kNoShift, CosWeight);
288  }
289  } // Quantile loop
290  } // Cut loop
291 
292  // --- Do it!
293  loader.Go();
294 
295  // --- Open my outfile so that I save histograms!
296  TFile *outFile = new TFile(OutputName.c_str(),"RECREATE");
297  std::cerr << "Made my output file...." << std::endl;
298 
299  // --- Finally, write them to disk!
300  for (unsigned int cc=0; cc<NumCuts; ++cc) {
301  // --- Loop through my quantiles.
302  for (unsigned int qq=0; qq<NumQuants; ++qq) {
303  std::string MyAppend = CutNames[cc] + QuantNames[qq];
304  // *** Some key ones first...
305  sReconstEnergy[cc][qq] -> SaveTo( outFile, TString("sReconstEnergy")+TString(MyAppend) ) ;
306  sSliceTimeFull[cc][qq] -> SaveTo( outFile, TString("sSliceTimeFull")+TString(MyAppend) ) ;
307  sSliceTimeZoom[cc][qq] -> SaveTo( outFile, TString("sSliceTimeZoom")+TString(MyAppend) ) ;
308  sMuonEnergy [cc][qq] -> SaveTo( outFile, TString("sMuonEnergy") +TString(MyAppend) ) ;
309  sMuonEnPerHit [cc][qq] -> SaveTo( outFile, TString("sMuonEnPerHit") +TString(MyAppend) ) ;
310  sHadronEnergy [cc][qq] -> SaveTo( outFile, TString("sHadronEnergy") +TString(MyAppend) ) ;
311  sHadroEnPerHit[cc][qq] -> SaveTo( outFile, TString("sHadroEnPerHit")+TString(MyAppend) ) ;
312  sHadFracEnergy[cc][qq] -> SaveTo( outFile, TString("sHadFracEnergy")+TString(MyAppend) ) ;
313  sHitsPerSlice [cc][qq] -> SaveTo( outFile, TString("sHitsPerSlice") +TString(MyAppend) ) ;
314  sRemIDScore [cc][qq] -> SaveTo( outFile, TString("sRemIDScore") +TString(MyAppend) ) ;
315  sCVNCosmicScor[cc][qq] -> SaveTo( outFile, TString("sCVNCosmicScor")+TString(MyAppend) ) ;
316  sCVNNuMuIDScor[cc][qq] -> SaveTo( outFile, TString("sCVNNuMuIDScor")+TString(MyAppend) ) ;
317  sNuMuContPID [cc][qq] -> SaveTo( outFile, TString("sNuMuContPID") +TString(MyAppend) ) ;
318  sSANuMuContPID[cc][qq] -> SaveTo( outFile, TString("sSANuMuContPID")+TString(MyAppend) ) ;
319  // *** Some important truth based ones.
320  sTrueNuEnergy [cc][qq] -> SaveTo( outFile, TString("sTrueNuEnergy") +TString(MyAppend) ) ;
321  sReTrOverTrNuE[cc][qq] -> SaveTo( outFile, TString("sReTrOverTrNuE")+TString(MyAppend) ) ;
322 
323  // *** Positional plots
324  sTrkStartX[cc][qq] -> SaveTo( outFile, TString("sTrkStartX")+TString(MyAppend) ) ;
325  sTrkStartY[cc][qq] -> SaveTo( outFile, TString("sTrkStartY")+TString(MyAppend) ) ;
326  sTrkStartZ[cc][qq] -> SaveTo( outFile, TString("sTrkStartZ")+TString(MyAppend) ) ;
327  sTrkEndX [cc][qq] -> SaveTo( outFile, TString("sTrkEndX") +TString(MyAppend) ) ;
328  sTrkEndY [cc][qq] -> SaveTo( outFile, TString("sTrkEndY") +TString(MyAppend) ) ;
329  sTrkEndZ [cc][qq] -> SaveTo( outFile, TString("sTrkEndZ") +TString(MyAppend) ) ;
330  sTrkLenXY [cc][qq] -> SaveTo( outFile, TString("sTrkLenXY") +TString(MyAppend) ) ;
331 
332  // *** Track based ones...
333  sNumKalTracks [cc][qq] -> SaveTo( outFile, TString("sNumKalTracks") +TString(MyAppend) ) ;
334  sNumKalTrHits [cc][qq] -> SaveTo( outFile, TString("sNumKalTrHits") +TString(MyAppend) ) ;
335  sRatKalHitSlc [cc][qq] -> SaveTo( outFile, TString("sRatKalHitSlc") +TString(MyAppend) ) ;
336  sKalTrLength [cc][qq] -> SaveTo( outFile, TString("sKalTrLength") +TString(MyAppend) ) ;
337  sKalTrBeamAng [cc][qq] -> SaveTo( outFile, TString("sKalTrBeamAng") +TString(MyAppend) ) ;
338  sKalMostFwdCel[cc][qq] -> SaveTo( outFile, TString("sKalMostFwdCel")+TString(MyAppend) ) ;
339  sKalMostBakCel[cc][qq] -> SaveTo( outFile, TString("sKalMostBakCel")+TString(MyAppend) ) ;
340  sKalTrVer_MaxY[cc][qq] -> SaveTo( outFile, TString("sKalTrVer_MaxY")+TString(MyAppend) ) ;
341  sKalTrVer_MaxZ[cc][qq] -> SaveTo( outFile, TString("sKalTrVer_MaxZ")+TString(MyAppend) ) ;
342  sKalTrDir_Y [cc][qq] -> SaveTo( outFile, TString("sKalTrDir_Y") +TString(MyAppend) ) ;
343  sScattKalTrLen[cc][qq] -> SaveTo( outFile, TString("sScattKalTrLen")+TString(MyAppend) ) ;
344 
345  // *** Hit based ones...
346  sFirstHitCell [cc][qq] -> SaveTo( outFile, TString("sFirstHitCell") +TString(MyAppend) ) ;
347  sLastHitCell [cc][qq] -> SaveTo( outFile, TString("sLastHitCell") +TString(MyAppend) ) ;
348  sMaxActivity_Y[cc][qq] -> SaveTo( outFile, TString("sMaxActivity_Y")+TString(MyAppend) ) ;
349  sMinActivity_Y[cc][qq] -> SaveTo( outFile, TString("sMinActivity_Y")+TString(MyAppend) ) ;
350  sMaxActivity_Z[cc][qq] -> SaveTo( outFile, TString("sMaxActivity_Z")+TString(MyAppend) ) ;
351  sMinActivity_Z[cc][qq] -> SaveTo( outFile, TString("sMinActivity_Z")+TString(MyAppend) ) ;
352  sMinCellToEdge[cc][qq] -> SaveTo( outFile, TString("sMinCellToEdge")+TString(MyAppend) ) ;
353 
354  // *** Some more plots from Alex
355  // Slice
356  sVisEInSlice [cc][qq] -> SaveTo( outFile, TString("sVisEInSlice") +TString(MyAppend) ) ;
357  sNHitInSlice [cc][qq] -> SaveTo( outFile, TString("sNHitInSlice") +TString(MyAppend) ) ;
358  sVisEPerHitSlc[cc][qq] -> SaveTo( outFile, TString("sVisEPerHitSlc")+TString(MyAppend) ) ;
359  // Track
360  sVisEInTrack [cc][qq] -> SaveTo( outFile, TString("sVisEInTrack") +TString(MyAppend) ) ;
361  sNHitInTrack [cc][qq] -> SaveTo( outFile, TString("sNHitInTrack") +TString(MyAppend) ) ;
362  sVisEPerHitTrk[cc][qq] -> SaveTo( outFile, TString("sVisEPerHitTrk")+TString(MyAppend) ) ;
363  // Hadronic
364  sVisEInHadron [cc][qq] -> SaveTo( outFile, TString("sVisEInHadron") +TString(MyAppend) ) ;
365  sNHitInHadron [cc][qq] -> SaveTo( outFile, TString("sNHitInHadron") +TString(MyAppend) ) ;
366  sVisEPerHitHad[cc][qq] -> SaveTo( outFile, TString("sVisEPerHitHad")+TString(MyAppend) ) ;
367 
368  // *** RemID score / inputs
369  sRemIDScatLLH [cc][qq] -> SaveTo( outFile, TString("sRemIDScatLLH") +TString(MyAppend) ) ;
370  sRemIDdEdxLLH [cc][qq] -> SaveTo( outFile, TString("sRemIDdEdxLLH") +TString(MyAppend) ) ;
371  sRemIDMeasFrac[cc][qq] -> SaveTo( outFile, TString("sRemIDMeasFrac")+TString(MyAppend) ) ;
372 
373  // *** Calibration quantities
374  for (int cor=0; cor<4; ++cor) {
375  sCor_RecEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_RecEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
376  sCor_MuoEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_MuoEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
377  sCor_HadEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HadEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
378  sCor_HFrEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HFrEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
379  }
380 
381  std::cerr << "\tWritten quantile set " << qq << " for cut set " << cc << " to disk!!!" << std::endl;
382  }
383  std::cerr << "\n\tWritten cut set " << cc << " to disk!!!" << std::endl;
384  }
385 
386 }
const Var kHadE
Definition: NumuVars.h:23
const Binning ZRangeBins
const Var kNKalman
Definition: NumuVars.cxx:540
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kEnPHHad([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)(sr->slc.calE-sr->trk.kalman.tracks[0].calE)/(float)(1.78 *(sr->slc.nhit-sr->trk.kalman.tracks[0].nhit));})
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 Var kReMIdScatLLH
Definition: NumuVars.cxx:555
const Var kVisESlc([](const caf::SRProxy *sr){return sr->slc.calE;})
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &name)
const Var kNHitSlc([](const caf::SRProxy *sr){return sr->slc.nhit;})
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
const Var kNumuContPID
Definition: NumuVars.cxx:553
const Cut kNumuContainND2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;++i){TVector3 start=sr->vtx.elastic.fuzzyk.png[i].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 20.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(unsigned int i=0;i< sr->trk.kalman.ntracks;++i){if(i==sr->trk.kalman.idxremid) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275||sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}return(sr->trk.kalman.ntracks > sr->trk.kalman.idxremid &&sr->slc.firstplane > 1 &&sr->slc.lastplane< 212 &&sr->trk.kalman.tracks[0].start.Z()< 1100 &&(sr->trk.kalman.tracks[0].stop.Z()< 1275 ||sr->sel.contain.kalyposattrans< 55) &&sr->sel.contain.kalfwdcellnd > 5 &&sr->sel.contain.kalbakcellnd > 10);})
Definition: NumuCuts2017.h:11
const Var kEnPHSlc([](const caf::SRProxy *sr){if(sr->slc.nhit< 1) return-10.0f;return(float)(sr->slc.calE)/(float)(1.78 *sr->slc.nhit);})
const Binning YRangeBins
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
const Binning EnPHitBins
const Var kNHitHad([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)(sr->slc.nhit-sr->trk.kalman.tracks[0].nhit);})
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
OStream cerr
Definition: OStream.cxx:7
const Var kLastCell([](const caf::SRProxy *sr){return sr->slc.lastcell;})
const Binning TimeZBins
void SetSpillCut(const SpillCut &cut)
const Var kTrkEPerNHit([](const caf::SRProxy *sr){return(sr->trk.kalman.tracks[0].calE/sr->trk.kalman.tracks[0].nhit);})
const Var kReMIdMeasFrac
Definition: NumuVars.cxx:557
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 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 kDirY([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].dir.Y();})
Definition: NumuVars.h:38
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Var kSlcMinY([](const caf::SRProxy *sr){return sr->slc.boxmin.Y()/100.;})
Definition: NumuVars.h:88
const Cut kInTimingSideband([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return(kInTimingSideband_before(sr)|| kInTimingSideband_after(sr));else return(kInTimingSideband_before(sr)|| kInTimingSideband_afterA(sr)|| kInTimingSideband_afterB(sr));}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_after.Livetime(spill));else return(kInTimingSideband_before.Livetime(spill)+ kInTimingSideband_afterA.Livetime(spill)+ kInTimingSideband_afterB.Livetime(spill));}, [](const caf::SRSpillProxy *spill){return 0;})
Definition: TimingCuts.h:12
ifstream inFile
Definition: AnaPlotMaker.h:34
const Cut kNumu2017Veto([](const caf::SRProxy *sr){return sr->sel.veto.keep;})
cosmic veto cut for FD
Definition: NumuCuts2017.h:30
const Var kTrueE([](const caf::SRProxy *sr){assert(sr->mc.nnu==1);return sr->mc.nu[0].E;})
Definition: Vars.cxx:85
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 Binning EnergyBins
TFile * outFile
Definition: PlotXSec.C:135
const Cut kNumuContainFD2017
Definition: NumuCuts2017.h:21
const Var kRemID
PID
Definition: Vars.cxx:81
const Cut kW_TR([](const caf::SRProxy *sr){bool IsTrue(sr->trk.kalman.tracks[0].start.X() > XCent && sr->trk.kalman.tracks[0].start.Y() > YCent);return IsTrue;})
const Var kSANumuContPID([](const caf::SRProxy *sr){return sr->sel.cosrej.numuSAcontpid;})
const Var kHadEFrac
Definition: NumuVars.h:24
const Var kNHit
Definition: Vars.cxx:71
const Cut kW_BR([](const caf::SRProxy *sr){bool IsTrue(sr->trk.kalman.tracks[0].start.X() > XCent && sr->trk.kalman.tracks[0].start.Y()< YCent);return IsTrue;})
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
const Var kCCE
Definition: NumuVars.h:21
const Var kNHitTrk([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float) sr->trk.kalman.tracks[0].nhit;})
virtual void Go() override
Load all the registered spectra.
const Binning CompBins
const std::string QuantNames[NumQuant]
Definition: DoThePlots.C:207
loader
Definition: demo0.py:10
const Binning CompZBins
const Cut kNumuPID2017([](const caf::SRProxy *sr){return(sr->sel.remid.pid > 0.5 &&sr->sel.cvn.numuid > 0.5);})
Definition: NumuCuts2017.h:27
std::vector< float > Spectrum
Definition: Constants.h:610
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
const Cut kW_TL([](const caf::SRProxy *sr){bool IsTrue=(sr->trk.kalman.tracks[0].start.X()< XCent && sr->trk.kalman.tracks[0].start.Y() > YCent);return IsTrue;})
const Cut kNumuCosmicRej2017([](const caf::SRProxy *sr){return(sr->sel.cosrej.anglekal > 0.5 && sr->sel.cosrej.numucontpid2020 > 0.5 && sr->slc.nhit< 400);})
Definition: NumuCuts2017.h:24
const Binning CellsBins
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 SystShifts kNoShift
Definition: SystShifts.cxx:21
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
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;})
void ComparisonPlots_Data()
const Var kKalBakCell([](const caf::SRProxy *sr){return sr->sel.contain.kalbakcell;})
const Cut kW_BL([](const caf::SRProxy *sr){bool IsTrue(sr->trk.kalman.tracks[0].start.X()< XCent && sr->trk.kalman.tracks[0].start.Y()< YCent);return IsTrue;})
const Var kRTOvTNuE
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
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Var kVisETrk([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float) sr->trk.kalman.tracks[0].calE;})
const Binning LengthBins
void cc()
Definition: test_ana.C:28
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const Cut kInBeamSpill([](const caf::SRProxy *sr){if(sr->spill.run > util::kLastBadTimingRun) return kInBeamSpill_main(sr);else return kInBeamSpill_main(sr)||kInBeamSpill_shifted(sr);}, [](const caf::SRSpillProxy *spill){if(spill->run > util::kLastBadTimingRun) return kInBeamSpill_main.Livetime(spill);else return kInBeamSpill_main.Livetime(spill)+kInBeamSpill_shifted.Livetime(spill);}, [](const caf::SRSpillProxy *spill) -> double{return spill->spillpot;})
Does the event fall inside the window we call the beam spill?
Definition: TimingCuts.h:8
const Var kVisEHad([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)(sr->slc.calE-sr->trk.kalman.tracks[0].calE);})
const Binning RangeBins
const Binning NumTrkBins
const Var kReMIdDEDxLLH
Definition: NumuVars.cxx:556
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
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);})
const Cut kNumuQuality
Definition: NumuCuts.h:18
const Var kMuE
Definition: NumuVars.h:22
const Var kCVNm
PID
Definition: Vars.cxx:39
const Var kUnweighted
The simplest possible Var, always 1. Used as a default weight.
Definition: Var.h:96
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
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
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 TinyBins
const Binning RatioBins
const Var kEnPHTrk([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-10.0f;return(float)(sr->trk.kalman.tracks[0].calE)/(float)(1.78 *sr->trk.kalman.tracks[0].nhit);})
std::vector< std::string > CutNames
Definition: MakeCutFlow.C:49
enum BeamMode string