Compare_NoExtrap.C
Go to the documentation of this file.
2 
6 #include "CAFAna/Core/Spectrum.h"
8 #include "CAFAna/Core/Loaders.h"
9 
10 #include "CAFAna/Vars/HistAxes.h"
13 
15 
17 
18 #include "TFile.h"
19 
20 #include <vector>
21 #include <string>
22 
23 using namespace ana;
24 
25 void Compare_NoExtrap( std::string InputDef, bool RunAllCuts=false, bool Debug=false )
26 {
27 
28  // FHC or RHC?
29  std::string sFHC = "fhc";
30  auto flux = Loaders::kFHC;
31  if (InputDef.find("rhc") != std::string::npos ) {
32  sFHC = "rhc";
34  }
35 
36  // What PID and Cos Rej Cut am I using?
37  Cut kMyPIDCut = kNumuPID2018;
38  Cut kMyCosRejCut = kNumuCosmicRej2018;
39 
40  // Add the detector specific ones.
41  Cut kDetCut = kNumuContainFD2017;
42  std::string sDet = "FD_";
43  if ( InputDef.find("nd") != std::string::npos) {
44  kDetCut = kNumuContainND2017;
45  sDet = "ND_";
46  }
47 
48  // What weights do I want to use?
49  Var MyWeight = kUnweighted;
50 
51  // --- The timing cut.
52  Cut TimingCut = kInBeamSpill;
53 
54  // ----- Define my cuts....
55  std::vector<Cut> kDefinedCut;
56  unsigned int NumCuts = 1;
57  if (RunAllCuts) NumCuts=4;
58  std::string CutNames[NumCuts];
59  if (NumCuts == 4) { // --- NumCuts == 4
60  // --- Cut
61  kDefinedCut.push_back( TimingCut && kNumuQuality ); // Good quality NuMu events
62  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut ); // That the event is contained.
63  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut ); // Reject cosmics
64  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut && kMyPIDCut ); // Reject Neutral current events
65  // --- CutNames
66  CutNames[0] = "_QualCuts";
67  CutNames[1] = "_DetCuts" ;
68  CutNames[2] = "_CosmCuts";
69  CutNames[3] = "_PIDCuts";
70  // --- CosmicRej
71  if ( InputDef.find("fd") != std::string::npos ) {
72  kDefinedCut[2] = kDefinedCut[2] && kMyCosRejCut;
73  kDefinedCut[3] = kDefinedCut[3] && kMyCosRejCut;
74  }
75  }
76  else if (NumCuts == 1) { // --- NumCuts == 1
77  // --- Cut
78  kDefinedCut.push_back( TimingCut && kNumuQuality && kDetCut && kMyPIDCut ); // Go straight to full cuts.
79  // --- CutNames
80  CutNames[0] = "_AllCuts";
81  // --- CosmicRej
82  if ( InputDef.find("fd") != std::string::npos ) {
83  kDefinedCut[0] = kDefinedCut[0] && kMyCosRejCut;
84  }
85 
86  //kDefinedCut[0] = kDefinedCut[0] && kNumu2017Veto;
87  }
88 
89  // --- Load the Quantile Cuts.
90  // Figure out the file name should be...
91  std::string NUMUDATA_DIR = "/cvmfs/nova.opensciencegrid.org/externals/numudata/v00.00/NULL/";
92  std::string fdspecfile = NUMUDATA_DIR+"ana2018/Quantiles/quantiles__"+sFHC+"_full__numu2018.root";
93  //std::string fdspecfile = (std::string)std::getenv("NUMUDATA_DIR")+"ana2018/Quantiles/quantiles__"+sFHC+"_full__numu2018.root";
94 
95  // Load the file...
96  std::cerr << "fdspecfile is " << fdspecfile << std::endl;
97  TFile* inFile = TFile::Open( fdspecfile.c_str() );
98  std::cerr << "Opened file." << std::endl;
99  TH2 *FDSpec2D = (TH2*)inFile->FindObjectAny( "FDSpec2D" );
100  std::cerr << "Loaded object." << std::endl;
101  // Add get the cuts....
102  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis, kHadEFracAxis, 4);
103 
104  std::cerr << "Loaded the quartiles." << std::endl;
105 
106  // ----- Define my quantiles.
107  const unsigned int NumQuants = 5;
108  Cut kQuantCut[NumQuants] = { kNoCut , HadEFracQuantCuts[0], HadEFracQuantCuts[1], HadEFracQuantCuts[2], HadEFracQuantCuts[3] };
109  const std::string QuantNames[NumQuants] = { "_AllQuants", "_Quant1" , "_Quant2" , "_Quant3" , "_Quant4" };
110 
111  // --- Decide which kind of sample I am looking at....
112  // I need to add the period to the output name.
113  std::string sPer = "full";
114  if (InputDef.find("period1") != std::string::npos ) sPer = "Period1";
115  else if (InputDef.find("period2") != std::string::npos ) sPer = "Period2";
116  else if (InputDef.find("period3") != std::string::npos ) sPer = "Period3";
117  else if (InputDef.find("period4") != std::string::npos ) sPer = "Period4";
118  else if (InputDef.find("period5") != std::string::npos ) sPer = "Period5";
119  else if (InputDef.find("period6") != std::string::npos ) sPer = "Period6";
120  else if (InputDef.find("period7") != std::string::npos ) sPer = "Period7";
121  else if (InputDef.find("period8") != std::string::npos ) sPer = "Period8";
122  // Need to flag that is PredNoExtrap.
123  std::string sSwap = "PredNoExtrap_";
124 
125  // --- What kind of files?
126  std::string sCAF = "CAF";
128  if (InputDef.find("sumdecaf") != std::string::npos ) {
129  sCAF = "concat";
130  CAFType = ECAFType::kNumuConcat;
131  }
132  if (InputDef.find("restricted") != std::string::npos ) {
133  sCAF = "res-concat";
134  CAFType = ECAFType::kNumuConcat;
135  }
136 
137  // --- Make the name of my output file.
138  std::string OutputName = "CompPlots_" + sDet + sSwap + sFHC + "_" + sPer + "_" + sCAF + ".root";
139 
140  // ---- Write some output.
141  std::cout << "Before I declare anything, the following is set;\n"
142  << "\tInput definit is " << InputDef << "\n"
143  << "\tOutput file name " << OutputName << "\n"
144  << "\tNumber of Cuts " << NumCuts << "\n"
145  << "\tIs debug mode is " << Debug << "\n"
146  << std::endl;
147 
148 
149  // --- Declare all of my spectra, before setting them in a loop...
150  // *** Some key ones first.
151  PredictionNoExtrap *sReconstEnergy[NumCuts][NumQuants]; // --- Reconstructed energy --- Vars.h ===> kCCE ---> sr->energy.numu.E
152  PredictionNoExtrap *sSliceTimeFull[NumCuts][NumQuants]; // --- Mean time of slice Full --- NumuVars.h ===> kSliceTime ---> sr->slc.meantime/1000
153  PredictionNoExtrap *sSliceTimeZoom[NumCuts][NumQuants]; // --- Mean time of slice Zoom --- NumuVars.h ===> kSliceTime ---> sr->slc.meantime/1000
154  PredictionNoExtrap *sMuonEnergy [NumCuts][NumQuants]; // --- Muon energy in the slice --- Vars.h ===> kMuE --> energy.numu.recomuonE
155  PredictionNoExtrap *sMuonEnPerHit [NumCuts][NumQuants]; // --- Muon energy per hit --- NumuVars.h ===> kTrkEPerNHit --> sr->trk.kalman.tracks[0].calE / sr->trk.kalman.tracks[0].nhit
156  PredictionNoExtrap *sHadronEnergy [NumCuts][NumQuants]; // --- Hadronic energy --- NumuVars.h ===> kHadE --> sr->energy.numu.E - sr->energy.numu.recomuonE
157  PredictionNoExtrap *sHadroEnPerHit[NumCuts][NumQuants]; // --- Hadronic energy per hit --- NumuVars.h ===> kHadEPerNHit --> function.
158  PredictionNoExtrap *sHadFracEnergy[NumCuts][NumQuants]; // --- Hadronic energy fraction --- NumuVars.h ===> kHadEFrac --> kHadE / kCCE
159  PredictionNoExtrap *sHitsPerSlice [NumCuts][NumQuants]; // --- Number of hits per slice --- Vars.h ===> kNHit --> slc.nhit
160  PredictionNoExtrap *sRemIDScore [NumCuts][NumQuants]; // --- The RemID score --- Vars.h ===> kRemID --> sr->sel.remid.pid
161  PredictionNoExtrap *sCVNCosmicScor[NumCuts][NumQuants]; // --- CVN Cosmic score --- Vars.h ===> sr->sel.cvn.output[390]
162  PredictionNoExtrap *sCVNNuMuIDScor[NumCuts][NumQuants]; // --- CVN NuMuID score --- Vars.h ===> sr->sel.cvnProd3Train.numuid
163  PredictionNoExtrap *sCVNNuMuID2017[NumCuts][NumQuants]; // --- CVN NuMuID score --- Vars.h ===> sr->sel.cvn2017.numuid
164  PredictionNoExtrap *sNuMuContPID [NumCuts][NumQuants]; // --- Third analysis BDT --- NuMuVars.h ===> sr->sel.cosrej.numucontpid
165  PredictionNoExtrap *sSANuMuContPID[NumCuts][NumQuants]; // --- Second analysis BDT --- Above.
166  // *** Some important Truth based ones.
167  PredictionNoExtrap *sTrueNuEnergy [NumCuts][NumQuants]; // --- True neutrino energy --- Vars.h ===> kTrueE ---> sr->mc.nu[0].E
168  PredictionNoExtrap *sReTrOverTrNuE[NumCuts][NumQuants]; // --- Reco - True / True Nu E --- Above.
169 
170  // *** Basic positional plots.
171  PredictionNoExtrap *sTrkStartX[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartX --> trk.kalman.tracks[0].start.X()/100
172  PredictionNoExtrap *sTrkStartY[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartY --> trk.kalman.tracks[0].start.Y()/100
173  PredictionNoExtrap *sTrkStartZ[NumCuts][NumQuants]; // --- Start Pos of Track --- NumuVars.h ===> kTrkStartZ --> trk.kalman.tracks[0].start.Z()/100
174  PredictionNoExtrap *sTrkEndX [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndX --> trk.kalman.tracks[0].stop.X()/100
175  PredictionNoExtrap *sTrkEndY [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndY --> trk.kalman.tracks[0].stop.Y()/100
176  PredictionNoExtrap *sTrkEndZ [NumCuts][NumQuants]; // --- End Pos of Track --- NumuVars.h ===> kTrkEndZ --> trk.kalman.tracks[0].stop.Z()/100
177  PredictionNoExtrap *sTrkLenXY [NumCuts][NumQuants]; // --- Diff in Track Len X Y --- Above. ===> kTrkLenXY --> (tracks[0].start.X - tracks[0].stop.X) / 100
178  //*
179  // *** Track based ones...
180  PredictionNoExtrap *sNumKalTracks [NumCuts][NumQuants]; // --- Number of Kal trk in slc --- NuMuVars.h ===> sr->trk.kalman.ntracks
181  PredictionNoExtrap *sNumKalTrHits [NumCuts][NumQuants]; // --- Number of hits in Kal tr --- NuMuVars.h ===> sr->trk.kalman.tracks[0].nhit
182  PredictionNoExtrap *sRatKalHitSlc [NumCuts][NumQuants]; // --- Ratio of Kal hits in slc --- Above.
183  PredictionNoExtrap *sKalTrLength [NumCuts][NumQuants]; // --- Length of Kalman track --- NuMuVars.h ===> sr->trk.kalman.tracks[0].len / 100
184  PredictionNoExtrap *sKalTrBeamAng [NumCuts][NumQuants]; // --- Angle Kal track & beam --- NuMuVars.h ===> kCosNumi --> sr->trk.kalman.tracks[0].dir.Dot(beamDirND)
185  PredictionNoExtrap *sKalMostFwdCel[NumCuts][NumQuants]; // --- Most forward Kal tr hit --- Above.
186  PredictionNoExtrap *sKalMostBakCel[NumCuts][NumQuants]; // --- Most backward Kal tr hit --- Above.
187  PredictionNoExtrap *sKalTrVer_MaxY[NumCuts][NumQuants]; // --- Highest Y Kalman tr vert --- Above.
188  PredictionNoExtrap *sKalTrVer_MaxZ[NumCuts][NumQuants]; // --- Highest Z Kalman tr vert --- Above.
189  PredictionNoExtrap *sKalTrDir_Y [NumCuts][NumQuants]; // --- Y direction of Kal track --- NuMuVars.h ===> sr->trk.kalman.tracks[0].dir.Y()
190  PredictionNoExtrap *sScattKalTrLen[NumCuts][NumQuants]; // --- Scattering over tr len --- Above.
191 
192  // *** Hit based ones...
193  PredictionNoExtrap *sFirstHitCell [NumCuts][NumQuants]; // --- The first cell hit --- Above.
194  PredictionNoExtrap *sLastHitCell [NumCuts][NumQuants]; // --- The last cell hit --- Above.
195  PredictionNoExtrap *sMaxActivity_Y[NumCuts][NumQuants]; // --- Maximum Y pos of activty --- NuMuVars.h ===> sr->slc.boxmax.Y() / 100.
196  PredictionNoExtrap *sMinActivity_Y[NumCuts][NumQuants]; // --- Minimum Y pos of activty --- NuMuVars.h ===> sr->slc.boxmin.Y() / 100.
197  PredictionNoExtrap *sMaxActivity_Z[NumCuts][NumQuants]; // --- Maximum Z pos of activty --- NuMuVars.h ===> sr->slc.boxmax.Z() / 100.
198  PredictionNoExtrap *sMinActivity_Z[NumCuts][NumQuants]; // --- Minimum Z pos of activty --- NuMuVars.h ===> sr->slc.boxmin.Z() / 100.
199  PredictionNoExtrap *sMinCellToEdge[NumCuts][NumQuants]; // --- Minimum cells to edge --- Above.
200 
201  // *** RemID score / inputs
202  PredictionNoExtrap *sRemIDScatLLH [NumCuts][NumQuants]; // --- RemID scattering angle --- NuMuVars.h ===> kReMIdScatLLH --> sel.remid.scatllh
203  PredictionNoExtrap *sRemIDdEdxLLH [NumCuts][NumQuants]; // --- RemID dE/dx --- NuMuVars.h ===> kReMIdDEDxLLH --> sel.remid.dedxllh
204  PredictionNoExtrap *sRemIDMeasFrac[NumCuts][NumQuants]; // --- RemID fraction of planes --- NuMuVars.h ===> kReMIdMeasFrac -> sel.remid.measfrac
205 
206  // *** Some calibration quantities
207  PredictionNoExtrap *sCor_RecEn[NumCuts][NumQuants][4];
208  PredictionNoExtrap *sCor_MuoEn[NumCuts][NumQuants][4];
209  PredictionNoExtrap *sCor_HadEn[NumCuts][NumQuants][4];
210  PredictionNoExtrap *sCor_HFrEn[NumCuts][NumQuants][4];
211  // Some special truth based ones.
212  PredictionNoExtrap *sCor_RecTr[NumCuts][NumQuants][4];
213  PredictionNoExtrap *sCor_MuoTr[NumCuts][NumQuants][4];
214  PredictionNoExtrap *sCor_HadTr[NumCuts][NumQuants][4];
215  PredictionNoExtrap *sCor_HFrTr[NumCuts][NumQuants][4];
216  PredictionNoExtrap *sCor_ReTr [NumCuts][NumQuants][4];
217  //*/
218  const Cut kCorner[4] = { kW_TL, kW_TR, kW_BL, kW_BR };
219  const std::string CutName[4] = { "_TopL", "_TopR", "_BotL", "_BotR" };
220 
221  // --- Set my loader
222  Loaders *loader = new Prod4NomLoaders( CAFType, flux, sPer );
224 
225  // --- And now set what is going to go into each of my spectra.
226  for (unsigned int cc=0; cc<NumCuts; ++cc) {
227  // --- Loop through my quantiles.
228  for (unsigned int qq=0; qq<NumQuants; ++qq) {
229  // What is the cut this time?
230  const Cut kThisCut = kDefinedCut[cc] && kQuantCut[qq];
231 
232  // *** Some key ones first...
233  sReconstEnergy[cc][qq] = new PredictionNoExtrap( *loader, "The reconstructed energy", OptEnBins , kCCE , kThisCut, kNoShift, MyWeight );
234  sSliceTimeFull[cc][qq] = new PredictionNoExtrap( *loader, "The time of slice - Full", TimeFBins , kSliceTime , kThisCut, kNoShift, MyWeight );
235  sSliceTimeZoom[cc][qq] = new PredictionNoExtrap( *loader, "The time of slice - Zoom", TimeZBins , kSliceTime , kThisCut, kNoShift, MyWeight );
236  sMuonEnergy [cc][qq] = new PredictionNoExtrap( *loader, "The muon energy " , LowEnBins , kMuE , kThisCut, kNoShift, MyWeight );
237  sMuonEnPerHit [cc][qq] = new PredictionNoExtrap( *loader, "The muon energy per hit" , EnPHitBins, kTrkEPerNHit , kThisCut, kNoShift, MyWeight );
238  sHadronEnergy [cc][qq] = new PredictionNoExtrap( *loader, "The hadronic energy" , LowEnBins , kHadE , kThisCut, kNoShift, MyWeight );
239  sHadroEnPerHit[cc][qq] = new PredictionNoExtrap( *loader, "The hadronic En per hit ", EnPHitBins, kHadEPerNHit , kThisCut, kNoShift, MyWeight );
240  sHadFracEnergy[cc][qq] = new PredictionNoExtrap( *loader, "The hadronic energy frac", RatioBins , kHadEFrac , kThisCut, kNoShift, MyWeight );
241  sHitsPerSlice [cc][qq] = new PredictionNoExtrap( *loader, "Number of hits per slice", NumHitBins, kNHit , kThisCut, kNoShift, MyWeight );
242  sRemIDScore [cc][qq] = new PredictionNoExtrap( *loader, "The RemID score" , RemIDBins , kRemID , kThisCut, kNoShift, MyWeight );
243  sCVNCosmicScor[cc][qq] = new PredictionNoExtrap( *loader, "CVN Cosmic score" , RatioBins , kCVNcos , kThisCut, kNoShift, MyWeight );
244  sCVNNuMuIDScor[cc][qq] = new PredictionNoExtrap( *loader, "CVN NuMu score" , RatioBins , kCVNm , kThisCut, kNoShift, MyWeight );
245  sCVNNuMuID2017[cc][qq] = new PredictionNoExtrap( *loader, "2017 CVN NuMu score" , RatioBins , kCVNm2017 , kThisCut, kNoShift, MyWeight );
246  sNuMuContPID [cc][qq] = new PredictionNoExtrap( *loader, "The NuMu containment PID", RatioBins , kNumuContPID , kThisCut, kNoShift, MyWeight );
247  sSANuMuContPID[cc][qq] = new PredictionNoExtrap( *loader, "SA NuMu containment PID" , RatioBins , kSANumuContPID, kThisCut, kNoShift, MyWeight );
248  // *** Some important truth based ones.
249  sTrueNuEnergy [cc][qq] = new PredictionNoExtrap( *loader, "The true neutrino energy", EnergyBins, kTrueE , kThisCut, kNoShift, MyWeight );
250  sReTrOverTrNuE[cc][qq] = new PredictionNoExtrap( *loader, "The R-T ov T Nu energy" , RangeBins , kRTOvTNuE, kThisCut, kNoShift, MyWeight );
251 
252  // *** Positional plots
253  sTrkStartX[cc][qq] = new PredictionNoExtrap( *loader, "Starting X Pos of Track", YRangeBins, kTrkStartX, kThisCut, kNoShift, MyWeight );
254  sTrkStartY[cc][qq] = new PredictionNoExtrap( *loader, "Starting Y Pos of Track", YRangeBins, kTrkStartY, kThisCut, kNoShift, MyWeight );
255  sTrkStartZ[cc][qq] = new PredictionNoExtrap( *loader, "Starting Z Pos of Track", ZRangeBins, kTrkStartZ, kThisCut, kNoShift, MyWeight );
256  sTrkEndX[cc][qq] = new PredictionNoExtrap( *loader, "Ending X Pos of Track" , YRangeBins, kTrkEndX , kThisCut, kNoShift, MyWeight );
257  sTrkEndY[cc][qq] = new PredictionNoExtrap( *loader, "Ending Y Pos of Track" , YRangeBins, kTrkEndY , kThisCut, kNoShift, MyWeight );
258  sTrkEndZ[cc][qq] = new PredictionNoExtrap( *loader, "Ending Z Pos of Track" , ZRangeBins, kTrkEndZ , kThisCut, kNoShift, MyWeight );
259  sTrkLenXY[cc][qq] = new PredictionNoExtrap( *loader, "Difference in XY Tr Len", ZRangeBins, kTrkLenXY , kThisCut, kNoShift, MyWeight );
260  //*
261  // *** Track based ones...
262  sNumKalTracks [cc][qq] = new PredictionNoExtrap( *loader, "Number of Kalman Tracks" , NumTrkBins, kNKalman , kThisCut, kNoShift, MyWeight );
263  sNumKalTrHits [cc][qq] = new PredictionNoExtrap( *loader, "Number of Kal Track hits", NumHitBins, kTrkNhits , kThisCut, kNoShift, MyWeight );
264  sRatKalHitSlc [cc][qq] = new PredictionNoExtrap( *loader, "Ratio of KalHit in Slice", RatioBins , kRatOfKalHi, kThisCut, kNoShift, MyWeight );
265  sKalTrLength [cc][qq] = new PredictionNoExtrap( *loader, "Length of Kalman Track" , LengthBins, kTrkLength , kThisCut, kNoShift, MyWeight );
266  sKalTrBeamAng [cc][qq] = new PredictionNoExtrap( *loader, "Angle of KalTr to Beam" , RatioBins , kCosNumi , kThisCut, kNoShift, MyWeight );
267  sKalMostFwdCel[cc][qq] = new PredictionNoExtrap( *loader, "Most forward KalTr Cell" , CellsBins , kKalFwdCell, kThisCut, kNoShift, MyWeight );
268  sKalMostBakCel[cc][qq] = new PredictionNoExtrap( *loader, "Most backward KalTr Cell", CellsBins , kKalBakCell, kThisCut, kNoShift, MyWeight );
269  sKalTrVer_MaxY[cc][qq] = new PredictionNoExtrap( *loader, "Most pos Y KalTr Vertex" , YRangeBins, kMaxKalYPos, kThisCut, kNoShift, MyWeight );
270  sKalTrVer_MaxZ[cc][qq] = new PredictionNoExtrap( *loader, "Most pos Z KalTr Vertex" , ZRangeBins, kMaxKalZPos, kThisCut, kNoShift, MyWeight );
271  sKalTrDir_Y [cc][qq] = new PredictionNoExtrap( *loader, "Y Direction of KalTr" , CompBins , kDirY , kThisCut, kNoShift, MyWeight );
272  sScattKalTrLen[cc][qq] = new PredictionNoExtrap( *loader, "Scatt over KalTr length" , TinyBins , kScattTrLen, kThisCut, kNoShift, MyWeight );
273 
274  // *** Hit based ones...
275  sFirstHitCell [cc][qq] = new PredictionNoExtrap( *loader, "The first cell hit in sl", CellsBins , kFirstCell , kThisCut, kNoShift, MyWeight );
276  sLastHitCell [cc][qq] = new PredictionNoExtrap( *loader, "The last cell hit in sl" , CellsBins , kLastCell , kThisCut, kNoShift, MyWeight );
277  sMaxActivity_Y[cc][qq] = new PredictionNoExtrap( *loader, "Largest Y loc with a hit", YRangeBins, kSlcMaxY , kThisCut, kNoShift, MyWeight );
278  sMinActivity_Y[cc][qq] = new PredictionNoExtrap( *loader, "Smalest Y loc with a hit", YRangeBins, kSlcMinY , kThisCut, kNoShift, MyWeight );
279  sMaxActivity_Z[cc][qq] = new PredictionNoExtrap( *loader, "Largest Z loc with a hit", ZRangeBins, kSlcMaxZ , kThisCut, kNoShift, MyWeight );
280  sMinActivity_Z[cc][qq] = new PredictionNoExtrap( *loader, "Largest Z loc with a hit", ZRangeBins, kSlcMinZ , kThisCut, kNoShift, MyWeight );
281  sMinCellToEdge[cc][qq] = new PredictionNoExtrap( *loader, "Min cells hit to edge" , CellsBins , kMinCellEdg, kThisCut, kNoShift, MyWeight );
282 
283  // *** RemID score / inputs
284  sRemIDScatLLH [cc][qq] = new PredictionNoExtrap( *loader, "RemID Scattering angle" , CompZBins , kReMIdScatLLH , kThisCut, kNoShift, MyWeight );
285  sRemIDdEdxLLH [cc][qq] = new PredictionNoExtrap( *loader, "RemID dE/dx" , CompBins , kReMIdDEDxLLH , kThisCut, kNoShift, MyWeight );
286  sRemIDMeasFrac[cc][qq] = new PredictionNoExtrap( *loader, "RemID fraction of planes", RatioBins , kReMIdMeasFrac , kThisCut, kNoShift, MyWeight );
287 
288  // *** Calibration quantities
289  for (int cor=0; cor<4; ++cor) {
290  const Cut kCorCut = kThisCut && kCorner[cor];
291  sCor_RecEn[cc][qq][cor] = new PredictionNoExtrap( *loader, "Reconstructed Energy with corner cut", EnergyBins, kCCE , kCorCut, kNoShift, MyWeight);
292  sCor_MuoEn[cc][qq][cor] = new PredictionNoExtrap( *loader, "Muon energy with corner cut" , EnergyBins, kMuE , kCorCut, kNoShift, MyWeight);
293  sCor_HadEn[cc][qq][cor] = new PredictionNoExtrap( *loader, "Hadronic energy with corner cut" , EnergyBins, kHadE , kCorCut, kNoShift, MyWeight);
294  sCor_HFrEn[cc][qq][cor] = new PredictionNoExtrap( *loader, "Hadronic energy frac with corner cut", RatioBins , kHadEFrac, kCorCut, kNoShift, MyWeight);
295  // Additional truth based ones.
296  sCor_RecTr[cc][qq][cor] = new PredictionNoExtrap( *loader, "True Energy with corner cut" , EnergyBins, kTrueE , kCorCut, kNoShift, MyWeight);
297  sCor_MuoTr[cc][qq][cor] = new PredictionNoExtrap( *loader, "True Mu En with corner cut" , EnergyBins, kTrueMuonE, kCorCut, kNoShift, MyWeight);
298  sCor_HadTr[cc][qq][cor] = new PredictionNoExtrap( *loader, "True Had En with corner cut" , EnergyBins, kTrueHadE , kCorCut, kNoShift, MyWeight);
299  sCor_HFrTr[cc][qq][cor] = new PredictionNoExtrap( *loader, "True HadEFrac with corner cut", RatioBins , kTrueHFrE , kCorCut, kNoShift, MyWeight);
300  sCor_ReTr [cc][qq][cor] = new PredictionNoExtrap( *loader, "Reco-True/True w. corner cut" , RangeBins , kRTOvTNuE , kCorCut, kNoShift, MyWeight);
301  }
302  //*/
303  } // Quantile loop
304  } // Cut loop
305 
306  // --- Do it!
307  loader->Go();
308 
309  // --- Open my outfile so that I save histograms!
310  TFile *outFile = new TFile(OutputName.c_str(),"RECREATE");
311  std::cerr << "Made my output file...." << std::endl;
312 
313  // --- Finally, write them to disk!
314  for (unsigned int cc=0; cc<NumCuts; ++cc) {
315  // --- Loop through my quantiles.
316  for (unsigned int qq=0; qq<NumQuants; ++qq) {
317  std::string MyAppend = CutNames[cc] + QuantNames[qq];
318  // *** Some key ones first...
319  sReconstEnergy[cc][qq] -> SaveTo( outFile, TString("sReconstEnergy")+TString(MyAppend) ) ;
320  sSliceTimeFull[cc][qq] -> SaveTo( outFile, TString("sSliceTimeFull")+TString(MyAppend) ) ;
321  sSliceTimeZoom[cc][qq] -> SaveTo( outFile, TString("sSliceTimeZoom")+TString(MyAppend) ) ;
322  sMuonEnergy [cc][qq] -> SaveTo( outFile, TString("sMuonEnergy") +TString(MyAppend) ) ;
323  sMuonEnPerHit [cc][qq] -> SaveTo( outFile, TString("sMuonEnPerHit") +TString(MyAppend) ) ;
324  sHadronEnergy [cc][qq] -> SaveTo( outFile, TString("sHadronEnergy") +TString(MyAppend) ) ;
325  sHadroEnPerHit[cc][qq] -> SaveTo( outFile, TString("sHadroEnPerHit")+TString(MyAppend) ) ;
326  sHadFracEnergy[cc][qq] -> SaveTo( outFile, TString("sHadFracEnergy")+TString(MyAppend) ) ;
327  sHitsPerSlice [cc][qq] -> SaveTo( outFile, TString("sHitsPerSlice") +TString(MyAppend) ) ;
328  sRemIDScore [cc][qq] -> SaveTo( outFile, TString("sRemIDScore") +TString(MyAppend) ) ;
329  sCVNCosmicScor[cc][qq] -> SaveTo( outFile, TString("sCVNCosmicScor")+TString(MyAppend) ) ;
330  sCVNNuMuIDScor[cc][qq] -> SaveTo( outFile, TString("sCVNNuMuIDScor")+TString(MyAppend) ) ;
331  sCVNNuMuID2017[cc][qq] -> SaveTo( outFile, TString("sCVNNuMuID2017")+TString(MyAppend) ) ;
332  sNuMuContPID [cc][qq] -> SaveTo( outFile, TString("sNuMuContPID") +TString(MyAppend) ) ;
333  sSANuMuContPID[cc][qq] -> SaveTo( outFile, TString("sSANuMuContPID")+TString(MyAppend) ) ;
334  // *** Some important truth based ones.
335  sTrueNuEnergy [cc][qq] -> SaveTo( outFile, TString("sTrueNuEnergy") +TString(MyAppend) ) ;
336  sReTrOverTrNuE[cc][qq] -> SaveTo( outFile, TString("sReTrOverTrNuE")+TString(MyAppend) ) ;
337 
338  // *** Positional plots
339  sTrkStartX[cc][qq] -> SaveTo( outFile, TString("sTrkStartX")+TString(MyAppend) ) ;
340  sTrkStartY[cc][qq] -> SaveTo( outFile, TString("sTrkStartY")+TString(MyAppend) ) ;
341  sTrkStartZ[cc][qq] -> SaveTo( outFile, TString("sTrkStartZ")+TString(MyAppend) ) ;
342  sTrkEndX[cc][qq] -> SaveTo( outFile, TString("sTrkEndX") +TString(MyAppend) ) ;
343  sTrkEndY[cc][qq] -> SaveTo( outFile, TString("sTrkEndY") +TString(MyAppend) ) ;
344  sTrkEndZ[cc][qq] -> SaveTo( outFile, TString("sTrkEndZ") +TString(MyAppend) ) ;
345  sTrkLenXY[cc][qq] -> SaveTo( outFile, TString("sTrkLenXY") +TString(MyAppend) ) ;
346  //*
347  // *** Track based ones...
348  sNumKalTracks [cc][qq] -> SaveTo( outFile, TString("sNumKalTracks") +TString(MyAppend) ) ;
349  sNumKalTrHits [cc][qq] -> SaveTo( outFile, TString("sNumKalTrHits") +TString(MyAppend) ) ;
350  sRatKalHitSlc [cc][qq] -> SaveTo( outFile, TString("sRatKalHitSlc") +TString(MyAppend) ) ;
351  sKalTrLength [cc][qq] -> SaveTo( outFile, TString("sKalTrLength") +TString(MyAppend) ) ;
352  sKalTrBeamAng [cc][qq] -> SaveTo( outFile, TString("sKalTrBeamAng") +TString(MyAppend) ) ;
353  sKalMostFwdCel[cc][qq] -> SaveTo( outFile, TString("sKalMostFwdCel")+TString(MyAppend) ) ;
354  sKalMostBakCel[cc][qq] -> SaveTo( outFile, TString("sKalMostBakCel")+TString(MyAppend) ) ;
355  sKalTrVer_MaxY[cc][qq] -> SaveTo( outFile, TString("sKalTrVer_MaxY")+TString(MyAppend) ) ;
356  sKalTrVer_MaxZ[cc][qq] -> SaveTo( outFile, TString("sKalTrVer_MaxZ")+TString(MyAppend) ) ;
357  sKalTrDir_Y [cc][qq] -> SaveTo( outFile, TString("sKalTrDir_Y") +TString(MyAppend) ) ;
358  sScattKalTrLen[cc][qq] -> SaveTo( outFile, TString("sScattKalTrLen")+TString(MyAppend) ) ;
359 
360  // *** Hit based ones...
361  sFirstHitCell [cc][qq] -> SaveTo( outFile, TString("sFirstHitCell") +TString(MyAppend) ) ;
362  sLastHitCell [cc][qq] -> SaveTo( outFile, TString("sLastHitCell") +TString(MyAppend) ) ;
363  sMaxActivity_Y[cc][qq] -> SaveTo( outFile, TString("sMaxActivity_Y")+TString(MyAppend) ) ;
364  sMinActivity_Y[cc][qq] -> SaveTo( outFile, TString("sMinActivity_Y")+TString(MyAppend) ) ;
365  sMinCellToEdge[cc][qq] -> SaveTo( outFile, TString("sMinCellToEdge")+TString(MyAppend) ) ;
366  sMaxActivity_Z[cc][qq] -> SaveTo( outFile, TString("sMaxActivity_Z")+TString(MyAppend) ) ;
367  sMinActivity_Z[cc][qq] -> SaveTo( outFile, TString("sMinActivity_Z")+TString(MyAppend) ) ;
368 
369  // *** RemID score / inputs
370  sRemIDScatLLH [cc][qq] -> SaveTo( outFile, TString("sRemIDScatLLH") +TString(MyAppend) ) ;
371  sRemIDdEdxLLH [cc][qq] -> SaveTo( outFile, TString("sRemIDdEdxLLH") +TString(MyAppend) ) ;
372  sRemIDMeasFrac[cc][qq] -> SaveTo( outFile, TString("sRemIDMeasFrac")+TString(MyAppend) ) ;
373 
374  // *** Calibration quantities
375  for (int cor=0; cor<4; ++cor) {
376  sCor_RecEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_RecEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
377  sCor_MuoEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_MuoEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
378  sCor_HadEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HadEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
379  sCor_HFrEn[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HFrEn")+TString(MyAppend)+TString(CutName[cor]) ) ;
380  // Additional truth based ones.
381  sCor_RecTr[cc][qq][cor] -> SaveTo( outFile, TString("sCor_RecTr")+TString(MyAppend)+TString(CutName[cor]) ) ;
382  sCor_MuoTr[cc][qq][cor] -> SaveTo( outFile, TString("sCor_MuoTr")+TString(MyAppend)+TString(CutName[cor]) ) ;
383  sCor_HadTr[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HadTr")+TString(MyAppend)+TString(CutName[cor]) ) ;
384  sCor_HFrTr[cc][qq][cor] -> SaveTo( outFile, TString("sCor_HFrTr")+TString(MyAppend)+TString(CutName[cor]) ) ;
385  sCor_ReTr [cc][qq][cor] -> SaveTo( outFile, TString("sCor_ReTr" )+TString(MyAppend)+TString(CutName[cor]) ) ;
386  }
387  //*/
388  std::cerr << "\tWritten quantile set " << qq << " for cut set " << cc << " to disk!!!" << std::endl;
389  }
390  std::cerr << "\n\tWritten cut set " << cc << " to disk!!!" << std::endl;
391  }
392 
393 }
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 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
void SaveTo(const osc::IOscCalc &x, TDirectory *dir, const std::string &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
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
Collection of SpectrumLoaders for many configurations.
Definition: Loaders.h:23
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 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 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 Binning TimeZBins
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
Loaders::FluxType flux
void Compare_NoExtrap(std::string InputDef, bool RunAllCuts=false, bool Debug=false)
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
void Go()
Call Go() on all the loaders.
Definition: Loaders.cxx:162
const Var kSlcMinY([](const caf::SRProxy *sr){return sr->slc.boxmin.Y()/100.;})
Definition: NumuVars.h:88
const Cut kNumuCosmicRej2018([](const caf::SRProxy *sr){return(sr->sel.cosrej.anglekal > 0.5 && sr->sel.cosrej.numucontpid2019 > 0.53 && sr->slc.nhit< 400 && sr->sel.nuecosrej.pngptp< 0.9 );})
Definition: NumuCuts2018.h:19
const Binning RemIDBins
ifstream inFile
Definition: AnaPlotMaker.h:34
void SetSpillCut(const SpillCut &cut)
Definition: Loaders.cxx:121
std::string sFHC
Definition: MakeCutFlow.C:35
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
std::string sPer
Definition: MakeThePlots.C:111
const Binning CompBins
const std::string QuantNames[NumQuant]
Definition: DoThePlots.C:207
loader
Definition: demo0.py:10
const Binning CompZBins
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 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;})
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
const Binning LengthBins
void cc()
Definition: test_ana.C:28
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 Cut kNumuPID2018([](const caf::SRProxy *sr){std::cout<< "ERROR::kNumuPID2018, cutting on both cvnProd3Train and cvn2017."<< " Neither branch exists anymore. Returning False."<< std::endl;abort();return false;})
Definition: NumuCuts2018.h:22
const Var kTrueHadE
const Binning OptEnBins
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 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);})
Prediction that just uses FD MC, with no extrapolation.
For nominal spectra and reweighting systs (xsec/flux)
Definition: Prod4Loaders.h:96
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
std::vector< std::string > CutNames
Definition: MakeCutFlow.C:49
ECAFType
Definition: Loaders.h:19
enum BeamMode string