ParametersNumu.cxx
Go to the documentation of this file.
1 //
2 // ParametersNumu.cpp
3 // nova-mrb
4 //
5 // Created by Brian Rebel on 10/29/15.
6 // Copyright © 2015 Brian Rebel. All rights reserved.
7 //
8 #include <bitset>
9 
12 
13 #include "Geometry/Geometry.h"
18 
20 
21 //------------------------------------------------------------------------------
22 std::pair<int, int> calcFirstLastLivePlane(int plane,
23  std::bitset<14> binary){
24  // novadaq::cnv::DetId det){
25  //if not the FD, return full ND size
26  //if (det != novadaq::cnv::kFARDET) return std::pair<int, int>(0,213);
27  int testDB = (plane / 64);
28  int minblock = testDB;
29  int maxblock = testDB;
30  //find block boundaries;
31  for (int i = testDB - 1; i >=0 ; --i){
32  if (binary[i]) minblock = i;
33  else break;
34  }
35  for (int i = testDB + 1; i < 14; ++i){
36  if (binary[i]) maxblock = i;
37  else break;
38  }
39  return std::pair<int, int>(64 * (minblock), 64 * (maxblock + 1) - 1);
40 }
41 
42 //------------------------------------------------------------------------------
44 : fEdgeXPlusXZ (0.)
45 , fEdgeXMinusXZ(0.)
46 , fEdgeFrontXZ (0.)
47 , fEdgeBackXZ (0.)
48 , fEdgeTopYZ (0.)
49 , fEdgeBottomYZ(0.)
50 , fEdgeFrontYZ (0.)
51 , fEdgeBackYZ (0.)
52 {
54 
55  fNumCells = geom->Plane(0)->Ncells() - 1;
56  fNumDiblocks = std::ceil(geom->NPlanes() / 64);
57 }
58 
59 //------------------------------------------------------------------------------
60 skim::ParametersNumu::ParametersNumu(size_t const& bestPIDTrack,
61  rb::Energy const& energy,
62  remid::ReMId const& remid,
64  cosrej::NueCosRej const& nuecosrej,
65  rb::Vertex const& vertex,
66  std::vector<rb::Track const*> & tracks,
67  std::vector<rb::Shower const*> & showers,
68  std::vector<rb::Prong const*> & prongs,
69  std::vector<slid::ShowerLID const*> & slids,
70  numue::NumuE const& numue,
71  rb::Cluster const& slice,
72  rb::Track const& track,
73  cvn::Result const& cvn,
74  cvn::Result const& cvn2017,
75  bool const& isData)
77 {
78 
81 
82  fParameters.fBestPIDTrack = 1.*bestPIDTrack;
83 
84  // Energy Variables
85  fParameters.fTrackCCE = numue.TrkCCE();
87 
89 
90  // ReMId variable
91  fParameters.fReMIdVal = remid.Value();
92 
93  // Slice variables
94  fParameters.fSliceHits = slice.NCell();
98  for(int i = 0;i < 10; ++i)fParameters.fSliceNHitsNearEdge[i] = 0;
99 
100  // check to see the minimum number of cells from edge of the detector
102  for(auto ch : slice.AllCells() ){
103  size_t cellsFromEdge = std::min((unsigned int)ch->Cell(), geom->Plane(ch->Plane())->Ncells() - 1 - ch->Cell());
104  LOG_DEBUG("EvaluatorNumu")
105  << ch->Cell()
106  << " "
107  << geom->Plane(ch->Plane())->Ncells()-1-ch->Cell()
108  << " "
110 
111  if( cellsFromEdge < fParameters.fSliceCellsFromEdge ){
112  fParameters.fSliceCellsFromEdge = cellsFromEdge;
113  if (ch->View() == geo::kX && cellsFromEdge == ch->Cell()) fParameters.fSliceClosestEdge = 0;
114  else if(ch->View() == geo::kX && cellsFromEdge == geom->Plane(ch->Plane())->Ncells() - 1 - ch->Cell()) fParameters.fSliceClosestEdge = 1;
115  else if(ch->View() == geo::kY && cellsFromEdge == ch->Cell()) fParameters.fSliceClosestEdge = 2;
116  else if(ch->View() == geo::kY && cellsFromEdge == geom->Plane(ch->Plane())->Ncells() - 1 - ch->Cell()) fParameters.fSliceClosestEdge = 3;
117  else fParameters.fSliceClosestEdge = -5;
118  }
119 
120  if(cellsFromEdge < 10) {
121  for(unsigned int i = 9; ( i >= cellsFromEdge && i < 10); i -= 1) ++fParameters.fSliceNHitsNearEdge[i];
122  }
123  }
124 
125  // CosRej variables
138 
139  // Track variables
140  fParameters.fTrackStartZ = track.Start().Z();
141  fParameters.fTrackStopZ = track.Stop().Z();
142  fParameters.fTrackStart = track.Start();
143  fParameters.fTrackStop = track.Stop();
144  fParameters.fTrackStartTime = track.Cell(0)->TNS();
145  fParameters.fTrackStopTime = track.Cell(track.NCell()-1)->TNS();
146  fParameters.fTrackDir = track.Dir();
147  for(int i = 0; i < 10; ++i) fParameters.fTrackNHitsNearEdge[i] = 0;
149  fParameters.fTrackLatestHitPos = EarliestLatestHitPos(track, false).second;
150 
151  // Vetex variables (2017)
152  fVertex = vertex.GetXYZ();
157  std::abs(fVertex.Y()));
158 
159  // Shower variables (2017)
160  fParameters.fNumShowers = 1.*showers.size();
161  if(showers.size()>0){
162  fParameters.fShowerCalE = showers[0]->CalorimetricEnergy();
163  fParameters.fShowerTotalE = showers[0]->TotalGeV();
164  fShowerDir = showers[0]->Dir();
168  fShowerVertex = showers[0]->Start();
172  fShowerEnd = showers[0]->Stop();
176 
177  fParameters.fShowerNumXCell = showers[0]->NXCell();
178  fParameters.fShowerNumYCell = showers[0]->NYCell();
179  } // showers.size()
180 
181  // Shower LID variables (2017)
182  fParameters.fNumShowersLID = 1.*slids.size();
183  if(slids.size()>0){
184  fParameters.fShowerVtxDist = slids[0]->Gap();
185  }
186 
196 
199 
200  fParameters.fCosShowers = 2.; // default value will pass any cuts
201 
202 
203  //////////////////////// CVN ///////////////////////////
204  // Differnet versions have different number of outputs
205  //
206  // Explanation for Production4 is in :
207  // https://cdcvs.fnal.gov/redmine/projects/nova_reconstruction/wiki/Prod4_tag
208 
209 
210  fParameters.fCVN2017Val = cvn2017.fOutput[0]+cvn2017.fOutput[1]+cvn2017.fOutput[2]+cvn2017.fOutput[3];
211 
212  // check Output Vector Size
213  int cvnOutputSize = cvn.fOutput.size();
214 
215  if( cvnOutputSize == 16 ) { /// 2017 and before
216 
217  // CVN Value formula from CAFMaker: FillPIDs.cxx -->
218  // srcvn.numuid = result.fOutput[0]+result.fOutput[1]+result.fOutput[2]+result.fOutput[3];)
219  fParameters.fCVNVal = cvn.fOutput[0]+cvn.fOutput[1]+cvn.fOutput[2]+cvn.fOutput[3];
220 
221  } else if( cvnOutputSize == 392 ) { /// 2018 ...
222  /// See StandardRecord/CVNLabels.h for constants
223 
224  float numuid = 0;
225  //std::vector<float>::const_iterator maxIt = std::max_element(cvn.fOutput.cbegin(), cvn.fOutput.cend());
226 
227  for(int idx = 0; idx < caf::kNumCVNFinalStates; ++idx){
229  const double prob = cvn.fOutput[idx];
230  if(state.nuPdg == 14) numuid += prob;
231  }
232 
233  /// srcvn.nueid += cvn.fOutput[caf::kCVN_nE_Other];
234  numuid += cvn.fOutput[caf::kCVN_nM_Other];
235 
237  }
238 
239  /////////////////////////////////////////////////////
240 
241  float nShowerHit = 0.;
242  if(showers.size() > 1)
243  fParameters.fCosShowers = ((fShowerDir * showers[1]->Dir())/
244  (fShowerDir.Mag() * showers[1]->Dir().Mag()));
245 
246  // The ProngLength cut applies for the longest prong, so find that in
247  // the following loop
248 
249  for(auto prg : prongs){
250  if(prg->TotalLength() > fParameters.fProngLength)
251  fParameters.fProngLength = prg->TotalLength();
252  }
253 
254  for(auto shw : showers){
255  nShowerHit += 1.*shw->NCell();
256  auto vtx = shw->Start();
257  auto end = shw->Stop();
258  auto maxX = std::max(vtx.X(), end.X());
259  auto maxY = std::max(vtx.Y(), end.Y());
260  auto minX = std::min(vtx.X(), end.X());
261  auto minY = std::min(vtx.Y(), end.Y());
262  if(fParameters.fShowerMinX > minX ) fParameters.fShowerMinX = minX;
264  if(fParameters.fShowerMaxX < maxX ) fParameters.fShowerMaxX = maxX;
266  if(fParameters.fShowerMinVtxZ > vtx.Z()) fParameters.fShowerMinVtxZ = vtx.Z();
268  if(fParameters.fShowerMaxVtxZ < vtx.Z()) fParameters.fShowerMaxVtxZ = vtx.Z();
270  }
271 
272 
273  // Check start and end Z for tracks other then best RemId one
274  for(size_t itrk=0; itrk<tracks.size(); ++itrk){
275 
276  if( itrk == bestPIDTrack ) continue; // Skip best pid track
277  if(tracks[itrk]->View() != geo::kXorY) continue; // 3D tracks only as in CAFMaker
278  auto vtx = tracks[itrk]->Start();
279  auto end = tracks[itrk]->Stop();
282  }
283 
284  ///----------------------------------------------------------------------------
285 
286  // now check the run history and the diblocks in this run
287  // the lines below are copied from CAFMaker_module.cc
288  unsigned int dibmask = (rh->GoodDiBlockMask()&rh->GetConfiguration());
289 
290  unsigned int dibfirst = 0;
291  //unsigned int diblast = 0;
292  unsigned int firstDBPlane = 0;
293  //unsigned int lastDBPlane = geom->NPlanes();
294 
295  if (dibmask) {
296  int iD;
297  iD=0; while (!((dibmask>>iD)&1)) iD++; dibfirst=iD+1;
298  //iD=0; while (dibmask>>iD) iD++; diblast=iD;
299 
300  firstDBPlane = (dibfirst - 1) * 64;
301  //lastDBPlane = (diblast * 64) - 1;
302  }
303 
304  std::bitset<14> binary(dibmask);
305 
306  std::pair<int,int> planesA = calcFirstLastLivePlane(slice.MinPlane(), binary);
307  std::pair<int,int> planesB = calcFirstLastLivePlane(slice.MaxPlane(), binary);
308 
309  if ((planesA.first != planesB.first) || (planesA.second != planesB.second))fParameters.fDiffLastFirstLiveDiblock = -1;
310  else fParameters.fDiffLastFirstLiveDiblock = (planesA.second - planesA.first + 1) * 0.015625;
311 
312  fParameters.fPlanesToFront = slice.MinPlane() - planesA.first;
313  fParameters.fPlanesToBack = planesA.second - slice.MaxPlane();
314 
315  LOG_DEBUG("ParametersNumu")
316  << "Inside: ParametersNumu.cxx--"
317  << " FirstPlane: "
319  << " firstDBPlane "
320  << firstDBPlane
321  << " planesA.first "
322  << planesA.first;
323 
324  // give cosmic track related parameters obviously stupid values
326 
359 
360 
361  //Added for 2017 Analysis ...
363  nuecosrej.StopMinDistToTop());
365  nuecosrej.StopMinDistToBottom());
367  nuecosrej.StopMinDistToWest());
369  nuecosrej.StopMinDistToEast());
371  nuecosrej.StopMinDistToFront());
373  nuecosrej.StopMinDistToBack());
374 
376 
377  return;
378 }
379 
380 //------------------------------------------------------------------------------
381 skim::ParametersNumu::ParametersNumu(size_t const& bestPIDTrack,
382  rb::Energy const& energy,
383  remid::ReMId const& remid,
384  cosrej::CosRejObj const& cosrej,
385  cosrej::NueCosRej const& nuecosrej,
386  rb::Vertex const& vertex,
387  std::vector<rb::Track const*> & tracks,
388  std::vector<rb::Shower const*> & showers,
389  std::vector<rb::Prong const*> & prongs,
390  std::vector<slid::ShowerLID const*> & slids,
391  rb::Track const& cosmictrack,
392  numue::NumuE const& numue,
393  rb::Cluster const& slice,
394  rb::Track const& track,
395  cvn::Result const& cvn,
396  cvn::Result const& cvn2017,
397  bool const& isData)
398 : ParametersNumu(bestPIDTrack,
399  energy,
400  remid,
401  cosrej,
402  nuecosrej,
403  vertex,
404  tracks,
405  showers,
406  prongs,
407  slids,
408  numue,
409  slice,
410  track,
411  cvn,
412  cvn2017,
413  isData)
414 {
415  if(fEdgeXPlusXZ == 0 && fEdgeXMinusXZ == 0){
417  }
418 
419  for(int i = 0; i < 10; ++i) fParameters.fCosTrackNHitsNearEdge[i] = 0;
420 
421  fParameters.fCosmicTrackStart = cosmictrack.Start();
422  fParameters.fCosmicTrackStop = cosmictrack.Stop();
424  fParameters.fCosmicTrackLatestHitPos = EarliestLatestHitPos(cosmictrack, true).second;
425  fParameters.fCosmicTrackDir = cosmictrack.Dir();
426  fParameters.fCosTrackStartTime = cosmictrack.Cell(0)->TNS();
427  fParameters.fCosTrackStopTime = cosmictrack.Cell(cosmictrack.NCell()-1)->TNS();
428  fParameters.fCosTrackXViewHits = cosmictrack.NXCell();
429  fParameters.fCosTrackYViewHits = cosmictrack.NYCell();
430  fParameters.fCosTrackTotalADC = cosmictrack.TotalADC();
431  fParameters.fCosTrackTotalGeV = cosmictrack.TotalGeV();
433  fParameters.fCosTrackMinTNS = cosmictrack.MinTNS();
434  fParameters.fCosTrackMinXYZ = cosmictrack.MinXYZ();
435  fParameters.fCosTrackMinPlane = cosmictrack.MinPlane();
436  fParameters.fCosTrackMaxTNS = cosmictrack.MaxTNS();
437  fParameters.fCosTrackMaxXYZ = cosmictrack.MaxXYZ();
438  fParameters.fCosTrackMaxPlane = cosmictrack.MaxPlane();
439 
440  return;
441 }
442 
443 //------------------------------------------------------------------------------
444 skim::ParametersNumu::ParametersNumu(size_t const& bestPIDTrack,
445  rb::Energy const& energy,
446  remid::ReMId const& remid,
447  cosrej::CosRejObj const& cosrej,
448  cosrej::NueCosRej const& nuecosrej,
449  rb::Vertex const& vertex,
450  std::vector<rb::Track const*> & tracks,
451  std::vector<rb::Shower const*> & showers,
452  std::vector<rb::Prong const*> & prongs,
453  std::vector<slid::ShowerLID const*> & slids,
454  qeef::QePId const& qepid,
455  numue::NumuE const& numue,
456  rb::Cluster const& slice,
457  rb::Track const& track,
458  cvn::Result const& cvn,
459  cvn::Result const& cvn2017,
460  bool const& isData)
461 : ParametersNumu(bestPIDTrack,
462  energy,
463  remid,
464  cosrej,
465  nuecosrej,
466  vertex,
467  tracks,
468  showers,
469  prongs,
470  slids,
471  numue,
472  slice,
473  track,
474  cvn,
475  cvn2017,
476  isData)
477 {
478  // QePID variables
479  fParameters.fQePIDVal = qepid.Value();
480  fParameters.fQePIDNTracks = qepid.Ntrk();
481 
482  return;
483 }
484 
485 
486 //------------------------------------------------------------------------------
487 //skim::ParametersNumu::ParametersNumu(caf::StandardRecord const& sr,
488 // bool const& isData)
489 //: ParametersNumu()
490 //{
491 //
492 // //fParameters.fBestPIDTrack = sr.sel.remid.bestidx;
493 // //fParameters.fNeutrinoE = sr.energy.numusimp.trkccE + (isData)*0.14*(sr.energy.numusimp.trkccE - sr.energy.mutrkE[sr.sel.remid.bestidx].E);
494 // //fParameters.fNDHadronicCal = sr.energy.numusimp.ndhadcalcatE + sr.energy.numusimp.ndhadcaltranE;
495 // fParameters.fReMIdVal = sr.sel.remid.pid;
496 // fParameters.fQePIDVal = sr.sel.qepid.pid;
497 // fParameters.fQePIDNTracks = sr.sel.qepid.ntrk;
498 // fParameters.fSliceHits = sr.slc.nhit;
499 // fParameters.fSliceContigPlanes = sr.slc.ncontplanes;
500 // fParameters.fSliceMaxPlane = sr.slc.lastplane;
501 // fParameters.fSliceMinPlane = sr.slc.firstplane;
502 // fParameters.fSliceCellsFromEdge = sr.slc.ncellsfromedge;
503 // fParameters.fPlanesToFront = sr.sel.contain.nplanestofront;
504 // fParameters.fPlanesToBack = sr.sel.contain.nplanestoback;
505 // fParameters.fCosRejKalFwdCell = sr.sel.contain.kalfwdcell;
506 // fParameters.fCosRejKalBakCell = sr.sel.contain.kalbakcell;
507 // fParameters.fCosRejAngleKal = sr.sel.cosrej.anglekal;
508 // fParameters.fCosRejCosBakCell = sr.sel.contain.cosbakcell;
509 // fParameters.fCosRejCosFwdCell = sr.sel.contain.cosfwdcell;
510 // fParameters.fCosRejConCosPID = sr.sel.cosrej.numucontpid;
511 // fParameters.fCosRejKalBakCellND = sr.sel.contain.kalbakcellnd;
512 // fParameters.fCosRejKalFwdCellND = sr.sel.contain.kalfwdcellnd;
513 // fParameters.fCosRejKalYPosAtTrans = sr.sel.contain.kalyposattrans;
514 // fParameters.fCosRejKalSpeed = sr.sel.cosrej.kfitspeed;
515 // fParameters.fCosRejCosSpeed = sr.sel.cosrej.cfitspeed;
516 // fParameters.fCosRejCosDirScore = sr.sel.cosrej.cdirscore;
517 // //fParameters.fTrackStartZ = sr.trk.kalman[sr.sel.remid.bestidx].start.Z();
518 // //fParameters.fTrackStopZ = sr.trk.kalman[sr.sel.remid.bestidx].stop.Z();
519 // //fParameters.fTrackStart = sr.trk.kalman[sr.sel.remid.bestidx].start;
520 // //fParameters.fTrackStop = sr.trk.kalman[sr.sel.remid.bestidx].stop;
521 // fParameters.fTrackStartTime = 0;//Medbh: can't find a way to access this through standard record!! srtrack has no info on its own hits!!
522 // fParameters.fTrackStopTime = 0;
523 // //fParameters.fTrackDir = sr.trk.kalman[sr.sel.remid.bestidx].dir;
524 // //fParameters.fTrackCCE = sr.energy.numusimp.trkccE;
525 //
526 // art::ServiceHandle<nova::dbi::RunHistoryService> rh;
527 // unsigned int dibmask = (rh->GoodDiBlockMask()&rh->GetConfiguration());
528 // std::bitset<14> binary(dibmask);
529 //
530 // std::pair<int,int> planesA = calcFirstLastLivePlane(sr.slc.firstplane, binary);
531 // std::pair<int,int> planesB = calcFirstLastLivePlane(sr.slc.lastplane, binary);
532 //
533 // if ((planesA.first != planesB.first) || (planesA.second != planesB.second))fParameters.fDiffLastFirstLiveDiblock = -1;
534 // else fParameters.fDiffLastFirstLiveDiblock = (planesA.second - planesA.first + 1) * 0.015625;
535 //
536 // return;
537 //}
538 
539 //------------------------------------------------------------------------------
541 {
542 
543  std::map<std::string, std::pair<double, double> > comps;
544 
545  comps["NeutrinoE"] = std::make_pair(fParameters.fNeutrinoE, compCuts.fNeutrinoE );
546  comps["NDHadronicCal"] = std::make_pair(fParameters.fNDHadronicCal, compCuts.fNDHadronicCal );
547  comps["ReMIdVal"] = std::make_pair(fParameters.fReMIdVal, compCuts.fReMIdVal );
548  comps["QePIDVal"] = std::make_pair(fParameters.fQePIDVal, compCuts.fQePIDVal );
549  comps["QePIDNTracks"] = std::make_pair(fParameters.fQePIDNTracks, compCuts.fQePIDNTracks );
550  comps["SliceHits"] = std::make_pair(fParameters.fSliceHits, compCuts.fSliceHits );
551  comps["SliceContigPlanes"] = std::make_pair(fParameters.fSliceContigPlanes, compCuts.fSliceContigPlanes );
552  comps["SliceMaxPlane"] = std::make_pair(fParameters.fSliceMaxPlane, compCuts.fSliceMaxPlane );
553  comps["SliceMinPlane"] = std::make_pair(fParameters.fSliceMinPlane, compCuts.fSliceMinPlane );
554  comps["SliceCellsFromEdge"] = std::make_pair(fParameters.fSliceCellsFromEdge, compCuts.fSliceCellsFromEdge );
555  comps["PlanesToFront"] = std::make_pair(fParameters.fPlanesToFront, compCuts.fPlanesToFront );
556  comps["PlanesToBack"] = std::make_pair(fParameters.fPlanesToBack, compCuts.fPlanesToBack );
557  comps["CosRejKalFwdCell"] = std::make_pair(fParameters.fCosRejKalFwdCell, compCuts.fCosRejKalFwdCell );
558  comps["CosRejKalBakCell"] = std::make_pair(fParameters.fCosRejKalBakCell, compCuts.fCosRejKalBakCell );
559  comps["CosRejAngleKal"] = std::make_pair(fParameters.fCosRejAngleKal, compCuts.fCosRejAngleKal );
560  comps["CosRejCosFwdCell"] = std::make_pair(fParameters.fCosRejCosFwdCell, compCuts.fCosRejCosFwdCell );
561  comps["CosRejCosBakCell"] = std::make_pair(fParameters.fCosRejCosBakCell, compCuts.fCosRejCosBakCell );
562  comps["CosRejConCosPID"] = std::make_pair(fParameters.fCosRejConCosPID, compCuts.fCosRejConCosPID );
563  comps["CosRejKalFwdCellND"] = std::make_pair(fParameters.fCosRejKalFwdCellND, compCuts.fCosRejKalFwdCellND );
564  comps["CosRejKalBakCellND"] = std::make_pair(fParameters.fCosRejKalBakCellND, compCuts.fCosRejKalBakCellND );
565  comps["CosRejKalYPosAtTrans"] = std::make_pair(fParameters.fCosRejKalYPosAtTrans, compCuts.fCosRejKalYPosAtTrans);
566  comps["TrackStartZ"] = std::make_pair(fParameters.fTrackStart.Z(), compCuts.fTrackStart.Z() );
567  comps["TrackStopZ"] = std::make_pair(fParameters.fTrackStop.Z(), compCuts.fTrackStop.Z() );
568  comps["TrackCCE"] = std::make_pair(fParameters.fTrackCCE, compCuts.fTrackCCE );
569 
570  //Added 2017 ...
571  comps["fDistAllTop"] = std::make_pair(fParameters.fDistAllTop, compCuts.fDistAllTop);
572  comps["fDistAllBottom"] = std::make_pair(fParameters.fDistAllBottom, compCuts.fDistAllBottom);
573  comps["fDistAllWest"] = std::make_pair(fParameters.fDistAllWest, compCuts.fDistAllWest);
574  comps["fDistAllEast"] = std::make_pair(fParameters.fDistAllEast, compCuts.fDistAllEast);
575  comps["fDistAllFront"] = std::make_pair(fParameters.fDistAllFront, compCuts.fDistAllFront);
576  comps["fDistAllBack"] = std::make_pair(fParameters.fDistAllBack, compCuts.fDistAllBack);
577  comps["fCVNVal"] = std::make_pair(fParameters.fCVNVal, compCuts.fCVNVal);
578  //Added 2018 ...
579  comps["fCVN2017Val"] = std::make_pair(fParameters.fCVN2017Val, compCuts.fCVN2017Val);
580 
581  comps["fNumShowers"] = std::make_pair(fParameters.fNumShowers, compCuts.fNumShowers);
582  comps["fShowerNumXCell"] = std::make_pair(fParameters.fShowerNumXCell, compCuts.fShowerNumXCell);
583  comps["fShowerNumYCell"] = std::make_pair(fParameters.fShowerNumYCell, compCuts.fShowerNumYCell);
584  comps["fCosShowers"] = std::make_pair(fParameters.fCosShowers, compCuts.fCosShowers);
585  comps["fShowerDirX"] = std::make_pair(fParameters.fShowerDirX, compCuts.fShowerDirX);
586  comps["fShowerDirY"] = std::make_pair(fParameters.fShowerDirY, compCuts.fShowerDirY);
587  comps["fShowerDirZ"] = std::make_pair(fParameters.fShowerDirZ, compCuts.fShowerDirZ);
588  comps["fShowerLength"] = std::make_pair(fParameters.fProngLength, compCuts.fProngLength);
589  comps["fShowerCalE"] = std::make_pair(fParameters.fShowerCalE, compCuts.fShowerCalE);
590  comps["fFracShowerHits"] = std::make_pair(fParameters.fFracShowerHits, compCuts.fFracShowerHits);
591  comps["fShowerVertexX"] = std::make_pair(fParameters.fShowerVertexX, compCuts.fShowerVertexX);
592  comps["fShowerVertexY"] = std::make_pair(fParameters.fShowerVertexY, compCuts.fShowerVertexY);
593  comps["fShowerVertexZ"] = std::make_pair(fParameters.fShowerVertexZ, compCuts.fShowerVertexZ);
594  comps["fShowerEndX"] = std::make_pair(fParameters.fShowerEndX, compCuts.fShowerEndX);
595  comps["fShowerEndY"] = std::make_pair(fParameters.fShowerEndY, compCuts.fShowerEndY);
596  comps["fShowerEndZ"] = std::make_pair(fParameters.fShowerEndZ, compCuts.fShowerEndZ);
597  comps["fShowerMinX"] = std::make_pair(fParameters.fShowerMinX, compCuts.fShowerMinX);
598  comps["fShowerMinY"] = std::make_pair(fParameters.fShowerMinY, compCuts.fShowerMinY);
599  comps["fShowerMaxX"] = std::make_pair(fParameters.fShowerMaxX, compCuts.fShowerMaxX);
600  comps["fShowerMaxY"] = std::make_pair(fParameters.fShowerMaxY, compCuts.fShowerMaxY);
601 
602  comps["fShowerMinVtxZ"] = std::make_pair(fParameters.fShowerMinVtxZ, compCuts.fShowerMinVtxZ);
603  comps["fShowerMinEndZ"] = std::make_pair(fParameters.fShowerMinEndZ, compCuts.fShowerMinEndZ);
604  comps["fShowerMaxVtxZ"] = std::make_pair(fParameters.fShowerMaxVtxZ, compCuts.fShowerMaxVtxZ);
605  comps["fShowerMaxEndZ"] = std::make_pair(fParameters.fShowerMaxEndZ, compCuts.fShowerMaxEndZ);
606  comps["fShowerVtxDist"] = std::make_pair(fParameters.fShowerVtxDist, compCuts.fShowerVtxDist);
607  comps["fShowerPt"] = std::make_pair(fParameters.fShowerPt, compCuts.fShowerPt);
608  comps["fVertexX"] = std::make_pair(fParameters.fVertexX, compCuts.fVertexX);
609  comps["fVertexY"] = std::make_pair(fParameters.fVertexY, compCuts.fVertexY);
610  comps["fVertexZ"] = std::make_pair(fParameters.fVertexZ, compCuts.fVertexZ);
611  comps["fVertexMaxW"] = std::make_pair(fParameters.fVertexMaxW, compCuts.fVertexMaxW);
612 
613  ///--
614  comps["fOtherTrackMaxVtxZ"] = std::make_pair(fParameters.fOtherTrackMaxVtxZ, compCuts.fOtherTrackMaxVtxZ);
615  comps["fOtherTrackMaxEndZ"] = std::make_pair(fParameters.fOtherTrackMaxEndZ, compCuts.fOtherTrackMaxEndZ);
616 
617 
618 
619  double fracDiff = 0.;
620 
621  for(auto itr : comps){
622 
623  auto skimSR = itr.second;
624 
625  fracDiff = std::abs((skimSR.first - skimSR.second)/skimSR.first);
626  if( fracDiff > 1.e-3)
627  LOG_DEBUG("ParametersNumu")
628  << itr.first
629  << ": "
630  << skimSR.first
631  << " "
632  << skimSR.second
633  << " "
634  << fracDiff;
635  }
636 
637  return;
638 }
639 
640 
641 //------------------------------------------------------------------------------
643 {
644 
645 }
646 
647 namespace skim{
648  //------------------------------------------------------------------------------
649  std::ostream& operator<< (std::ostream& o, skim::ParametersNumu const& p)
650  {
651  o
652  << "\nBestPIDTrack\t" << p.ParametersStruct().fBestPIDTrack
653  << "\nNeutrinoE\t" << p.ParametersStruct().fNeutrinoE
654  << "\nNDHadronicCal\t" << p.ParametersStruct().fNDHadronicCal
655  << "\nReMIdVal\t" << p.ParametersStruct().fReMIdVal
656  << "\nQePIDVal\t" << p.ParametersStruct().fQePIDVal
657  << "\nQePIDNTracks\t" << p.ParametersStruct().fQePIDNTracks
658  << "\nSliceHits\t" << p.ParametersStruct().fSliceHits
659  << "\nSliceContigPlanes\t" << p.ParametersStruct().fSliceContigPlanes
660  << "\nSliceMaxPlane\t" << p.ParametersStruct().fSliceMaxPlane
661  << "\nSliceMinPlane\t" << p.ParametersStruct().fSliceMinPlane
662  << "\nSliceCellsFromEdge\t" << p.ParametersStruct().fSliceCellsFromEdge
663  << "\nPlanesToFront\t" << p.ParametersStruct().fPlanesToFront
664  << "\nPlanesToBack\t" << p.ParametersStruct().fPlanesToBack
665  << "\nCosRejKalFwdCell\t" << p.ParametersStruct().fCosRejKalFwdCell
666  << "\nCosRejKalBakCell\t" << p.ParametersStruct().fCosRejKalBakCell
667  << "\nCosRejAngleKal\t" << p.ParametersStruct().fCosRejAngleKal
668  << "\nCosRejCosBakCell\t" << p.ParametersStruct().fCosRejCosBakCell
669  << "\nCosRejCosFwdCell\t" << p.ParametersStruct().fCosRejCosFwdCell
670  << "\nCosRejConCosPID\t" << p.ParametersStruct().fCosRejConCosPID
671  << "\nCosRejKalBakCellND\t" << p.ParametersStruct().fCosRejKalBakCellND
672  << "\nCosRejKalFwdCellND\t" << p.ParametersStruct().fCosRejKalFwdCellND
673  << "\nCosRejKalPosAtTrans\t" << p.ParametersStruct().fCosRejKalYPosAtTrans
674  //<< "\nTrackStartZ\t" << p.ParametersStruct().fTrackStartZ
675  //<< "\nTrackStopZ\t" << p.ParametersStruct().fTrackStopZ
676  << "\nTrackStart\tx: " << p.ParametersStruct().fTrackStart.X() << " y: " << p.ParametersStruct().fTrackStart.Y() << " z: " << p.ParametersStruct().fTrackStart.Z()
677  << "\nTrackStop\tx: " << p.ParametersStruct().fTrackStop.X() << " y: " << p.ParametersStruct().fTrackStop.Y() << " z: " << p.ParametersStruct().fTrackStop.Z()
678  << "\nTrackDir\tx: " << p.ParametersStruct().fTrackDir.X() << " y: " << p.ParametersStruct().fTrackDir.Y() << " z: " << p.ParametersStruct().fTrackDir.Z()
679  << "\nTrackCCE\t" << p.ParametersStruct().fTrackCCE //;
680  // Added 2017
681  << "\nfDistAllTop " << p.ParametersStruct().fDistAllTop
682  << "\nfDistAllBottom " << p.ParametersStruct().fDistAllBottom
683  << "\nfDistAllWest " << p.ParametersStruct().fDistAllWest
684  << "\nfDistAllEast " << p.ParametersStruct().fDistAllEast
685  << "\nfDistAllFront " << p.ParametersStruct().fDistAllFront
686  << "\nfDistAllBack " << p.ParametersStruct().fDistAllBack
687  << "\nfCVNVal " << p.ParametersStruct().fCVNVal
688  << "\nfNueCosRejPngPtp "<< p.ParametersStruct().fNueCosRejPngPtp
689  // Added 2018
690  << "\nfCVN2017Val " << p.ParametersStruct().fCVN2017Val;
691  return o;
692  }
693 }
694 
695 //-------------------------------------------------------------------------------
696 //New way of projecting tracks to edge of detector
697 
699 {
700 
701  // float EdgeTop = 780;
702  // float EdgeBottom = -780;
703  // float EdgeFront = 7800;
704  // float EdgeBack = 0;
705  // float EdgeWest = -780;
706  // float EdgeEast = 780;
707 
708  float MinDistToEdge = std::numeric_limits<float>::max();
709  /*LOG_VERBATIM("ParametersNumu") << "Calculating projections";
710  LOG_VERBATIM("ParametersNumu") << "X edges: " << fEdgeXMinusXZ << ", " << fEdgeXPlusXZ;
711  LOG_VERBATIM("ParametersNumu")<< "Y edges: " << fEdgeBottomYZ << ", " << fEdgeTopYZ;
712  LOG_VERBATIM("ParametersNumu")<< "Z edges: " << fEdgeBackYZ << ", " << fEdgeFrontYZ;
713  LOG_VERBATIM("ParametersNumu")<< "(not " << fEdgeBackXZ << ", " << fEdgeFrontXZ << ")";
714  LOG_VERBATIM("ParametersNumu") << "Dir(X,Y,Z): " << Dir.X() << ", " << Dir.Y() << ", " << Dir.Z() ;
715  LOG_VERBATIM("ParametersNumu") << "Pos(X,Y,Z): " << Pos.X() << ", " << Pos.Y() << ", " << Pos.Z() ;*/
716 
717  if(Pos.X() > fEdgeXPlusXZ || Pos.X() < fEdgeXMinusXZ ||
718  Pos.Y() > fEdgeTopYZ || Pos.Y() < fEdgeBottomYZ ||
719  Pos.Z() > fEdgeBackYZ || Pos.Z() < fEdgeFrontYZ)
720  {
721  LOG_VERBATIM("ParametersNumu") << "Pos out of range, return -99999";
722  return -99999;
723  }
724 
725  if(Dir.Z() != 0)
726  {
727  MinDistToEdge = ( fEdgeBackYZ - Pos.Z() ) / Dir.Z(); //distance to back of detector
728  LOG_VERBATIM("ParametersNumu") << "Z dist to back = " << MinDistToEdge << "\t or \t";
729  if(MinDistToEdge < 0)MinDistToEdge = ( fEdgeFrontYZ - Pos.Z() ) /Dir.Z(); //if that would involve moving backwards, use the distance to the front of the detector
730  LOG_VERBATIM("ParametersNumu") << ( fEdgeFrontYZ - Pos.Z() ) /Dir.Z() ;
731  }
732 
733  if(Dir.Y() != 0)
734  {
735  float YDist = ( fEdgeTopYZ - Pos.Y() ) / Dir.Y();
736  LOG_VERBATIM("ParametersNumu") << "Y dist to top =" << YDist << "\t or \t";
737  if(YDist < 0) YDist = ( fEdgeBottomYZ - Pos.Y() ) / Dir.Y();
738  LOG_VERBATIM("ParametersNumu") << ( fEdgeBottomYZ - Pos.Y() ) / Dir.Y() ;
739  if(YDist < MinDistToEdge) MinDistToEdge = YDist;
740  }
741 
742  if(Dir.X() != 0)
743  {
744  float XDist = ( fEdgeXPlusXZ - Pos.X() ) / Dir.X();
745  LOG_VERBATIM("ParametersNumu") << "X dist to East = " << XDist << "\t or \t";
746  if(XDist < 0) XDist = ( fEdgeXMinusXZ - Pos.X() ) / Dir.X();
747  LOG_VERBATIM("ParametersNumu") << ( fEdgeXMinusXZ - Pos.X() ) / Dir.X() ;
748  if(XDist < MinDistToEdge) MinDistToEdge = XDist;
749  }
750 
751  if(MinDistToEdge==99999 || MinDistToEdge < 0)MinDistToEdge = -99999;
752  LOG_VERBATIM("ParametersNumu") << "MinDist = " << MinDistToEdge ;
753  return MinDistToEdge;
754 
755  }
756 
757 //------------------------------------------------------------------------------
758 //Need detector edges for ProjectDistToEdge. Shamelessly stolen from livegeometry
760 {
762  double xyz1[3], xyz2[3];
763 
764  if(!(geom->DetId() == novadaq::cnv::kFARDET || geom->DetId() == novadaq::cnv::kNEARDET)) {
765  LOG_VERBATIM("ParametersNumu") << "UNKNOWN DETECTOR!!!";
766  fEdgeXPlusXZ = 0;
767  fEdgeXMinusXZ = 0;
768  fEdgeFrontXZ = 0;
769  fEdgeBackXZ = 0;
770  fEdgeTopYZ = 0;
771  fEdgeBottomYZ = 0;
772  fEdgeFrontYZ = 0;
773  fEdgeBackYZ = 0;
774  }
775 
776  // start with XZ view, which is easiest since z position does NOT change with cell number; this is odd plane numbers
777  geom->Plane(1)->Cell(0)->GetCenter(xyz1);
778  fEdgeFrontXZ = xyz1[2]-3.5; // the half width of the cell in Z is ~3.5 cm
779  geom->Plane(63)->Cell(0)->GetCenter(xyz2);
780  fEdgeXMinusXZ = (xyz1[0]+xyz2[0])/2.0 - 2.3; // Plane 0 is 'higher' than plane 63; this repeats for each diblock exactly. We don't want to worry about this though, so average it. We pretend things are actual boxes with right angles.
781  geom->Plane(1)->Cell(fNumCells)->GetCenter(xyz1); // cell 383 is most +x, cell 0 is most -X
782  geom->Plane(63)->Cell(fNumCells)->GetCenter(xyz2);
783  fEdgeXPlusXZ = (xyz1[0]+xyz2[0])/2.0 + 2.3; // 2.28 is approximate half width of cell here; again, round up slightly
784  geom->Plane((fNumDiblocks*64)-1)->Cell(0)->GetCenter(xyz1); // any cell in last plane will do for finding the back
785  fEdgeBackXZ = xyz1[2]+3.5;
786 
787  // now YZ view, which has Y AND Z changing with cell number for the same plane. The Z from cell 0 to cell 383 differs by about 2.5 cm.
788  // I'll average the Z values over a DCM to find the DCM edges. I never want a gap between a DCM edge and the detector edge, since that could unwittingly be considered 'good' even if the closest DCM is 'bad'. So, I'll use the DCMs that stick out the least to define the edge. This makes us 'lose' about 2 cm from parts of the edge at each end, but it's safest.
789 
790  geom->Plane(0)->Cell(0)->GetCenter(xyz1); // front bottom most cell
791  geom->Plane(0)->Cell(63)->GetCenter(xyz2); // front top cell of frontmost DCM
792  fEdgeFrontYZ = (xyz1[2]+xyz2[2])/2.0 - 3.5; // average the 2 to get the 'front'
793  geom->Plane(62)->Cell(0)->GetCenter(xyz2); // back most bottom cell of frontmost bottom DCM
794  fEdgeBottomYZ = (xyz1[1]+xyz2[1])/2.0 - 2.3; // reuse same point 1 for bottom calculation
795  geom->Plane(0)->Cell(fNumCells)->GetCenter(xyz1); // topmost frontmost cell, in topmost frontmost DCM
796  geom->Plane(62)->Cell(fNumCells)->GetCenter(xyz2); // topmost farther back cell in topmost frontmost DCM
797  fEdgeTopYZ = (xyz1[1]+xyz2[1])/2.0 + 2.3; // top edge
798  geom->Plane((fNumDiblocks*64)-2)->Cell(fNumCells-63)->GetCenter(xyz1); // frontmost topmost cell in backmost topmost DCM
799  geom->Plane((fNumDiblocks*64)-2)->Cell(fNumCells)->GetCenter(xyz2); // backmost topmost cell, in backmost topmost DCM
800  fEdgeBackYZ = (xyz1[2]+xyz2[2])/2.0 + 3.5; // back edge
801 
802  // Muon catcher. TODO: Make these more precise
803 
804  // Based on the gdml
805  //fMCEdge = 199.65;
806  //fMCTop = 75.3;
807  //fMCFront = 1277.65;
808  //fMCBack = 1577.54;
809 
810  // based on the event display
811  //fMCEdge = 190;
812  //fMCTop = 67.5;
813  //fMCFront = 1278.4;
814  //fMCBack = 1585;
815  }
816 
817 
818 //------------------------------------------------------------------------------
819 //Returns the position of the earliest hit in time
820 std::pair<TVector3,TVector3> skim::ParametersNumu::EarliestLatestHitPos(rb::Track const& track, bool cosmictrack)
821 {
823 
824  float mintime = 1e6;
825  float maxtime = 0.001;
826  TVector3 mintimepos;//position of earliest hit in time
827  TVector3 maxtimepos;//position of latest hit in time
828 
829  size_t trackCellsFromEdge = 1e6;
830  int closestEdge = -5;
831 
832  for(unsigned int i = 0; i < track.NCell(); i++)
833  {
834  auto chit = track.Cell(i);
835  if(chit->TNS() < mintime){
836  mintime = chit->TNS();
837  double xyz[3];
838  geom->Plane(chit->Plane())->Cell(chit->Cell())->GetCenter(xyz);
839  mintimepos.SetXYZ(xyz[0], xyz[1], xyz[2]);
840  }
841  if (chit->TNS() > maxtime){
842  maxtime = chit->TNS();
843  double xyz[3];
844  geom->Plane(chit->Plane())->Cell(chit->Cell())->GetCenter(xyz);
845  maxtimepos.SetXYZ(xyz[0], xyz[1], xyz[2]);
846  }
847 
848  size_t cellsFromEdge = std::min((unsigned int)chit->Cell(), geom->Plane(chit->Plane())->Ncells() - 1 - chit->Cell());
849 
850  if( cellsFromEdge < trackCellsFromEdge ){
851  trackCellsFromEdge = cellsFromEdge;
852  if(chit->View() == geo::kX && cellsFromEdge == chit->Cell())closestEdge = 0;
853  else if(chit->View() == geo::kX && cellsFromEdge == geom->Plane(chit->Plane())->Ncells() - 1 - chit->Cell()) closestEdge = 1;
854  else if(chit->View() == geo::kY && cellsFromEdge == chit->Cell())closestEdge = 2;
855  else if(chit->View() == geo::kY && cellsFromEdge == geom->Plane(chit->Plane())->Ncells() - 1 - chit->Cell()) closestEdge = 3;
856  else closestEdge = -5;
857  }
858 
859  if(cosmictrack){
860  fParameters.fCosTrackNCellsFromEdge = trackCellsFromEdge;
861  fParameters.fCosTrackClosestEdge = closestEdge;
862  if(cellsFromEdge < 10) {
863  for(unsigned int i = 9; ( i >= cellsFromEdge && i < 10 ); i-=1) fParameters.fCosTrackNHitsNearEdge[i]++;
864  }
865  } else {
866  fParameters.fTrackNCellsFromEdge = trackCellsFromEdge;
867  fParameters.fTrackClosestEdge = closestEdge;
868  if(cellsFromEdge < 10) {
869  for(unsigned int i=9; ( i >= cellsFromEdge && i < 10 ); i-=1) fParameters.fTrackNHitsNearEdge[i]++;
870  }
871  }
872  }
873 
874  return std::pair<TVector3, TVector3> (mintimepos, maxtimepos);
875 }
876 
877 
878 //-------------------- Analysis 2017 Muon Energy
879 
880 // float skim::ParametersNumu::A2017NumuMuE (float rawEM, float rawHA);
881 // float skim::ParametersNumu::A2017NumuHadE (float rawEM, float rawHA);
882 // float skim::ParametersNumu::A2017NumuRecoE(float rawEM, float rawHA);
TVector3 fTrackDir
track direction (unit vector) at start point
float fShowerMaxVtxZ
maximum Z position of all showers
float TNS() const
Definition: CellHit.h:46
T max(const caf::Proxy< T > &a, T b)
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
int fTrackNHitsNearEdge[10]
float fShowerEndY
end of the primary shower
A 3D position and time representing an interaction vertex.
Definition: Vertex.h:15
float fNumShowersLID
size of showerLIDs in a slice
float fFracShowerHits
fraction of slice hits in the primary shower
TVector3 fTrackStop
track end position (cm)
float fShowerMaxY
max y for all shower end points
float fDistAllBottom
distance of all showers in slice from the bottom edge of detector
Definition: event.h:34
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
double minY
Definition: plot_hist.C:9
void GetCenter(double *xyz, double localz=0.0) const
Definition: CellGeo.cxx:159
Energy estimators for CC events.
Definition: FillEnergies.h:7
float fPlanesToFront
number of planes to the front of detector
double StopMinDistToBottom() const
Minimum perpendicular distance of all prongs stop points to the bottom edge of the detector...
Definition: NueCosRej.h:124
TH2 * rh
Definition: drawXsec.C:5
float fDistAllFront
distance of all showers in slice from the front edge of detector
float fDistAllEast
distance of all showers in slice from the east edge of detector
float KalYPosAtTrans() const
Definition: CosRejObj.cxx:682
TVector3 fCosTrackMinXYZ
float fNeutrinoE
neutrino energy
float fShowerMinY
min y for all shower end points
X or Y views.
Definition: PlaneGeo.h:30
float fDistAllTop
distance of all showers in slice from the top edge of detector
float fSliceMaxPlane
maximum plane of the slice
float fTrackStopTime
track end time (ns)
float fVertexZ
vertex of the interaction
ush Pos
Definition: deflate.h:89
float fShowerEndX
end of the primary shower
const CellGeo * Cell(int icell) const
Definition: PlaneGeo.h:48
const char * p
Definition: xmltok.h:285
double StopMinDistToWest() const
Minimum perpendicular distance of all prongs stop points to the west edge of the detector (west is po...
Definition: NueCosRej.h:136
static Var numuid(const std::shared_ptr< CAFAnaModel > &model)
Definition: SliceLIDVar.h:63
float fShowerNumXCell
number of x cells in slice
double StartMinDistToTop() const
Minimum perpendicular distance of all prongs start points.
Definition: NueCosRej.h:96
Vertical planes which measure X.
Definition: PlaneGeo.h:28
unsigned int Ncells() const
Number of cells in this plane.
Definition: PlaneGeo.h:43
float fCosShowers
cosine of angle between showers in slice
Definition: event.h:19
A collection of associated CellHits.
Definition: Cluster.h:47
float fCVN2017Val
value of the Old (2017) CVN PID //Analysis 2018
float fVertexX
vertex of the interaction
float fOtherTrackMaxVtxZ
maximum Z position of non Best-RemID tracks
float TrkCCE() const
Definition: NumuE.cxx:254
int KalBakCellND() const
Definition: CosRejObj.cxx:670
double maxY
Definition: plot_hist.C:10
float fShowerMinEndZ
minimum Z position of all showers
float fSliceHits
hits in the slice
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
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
const PlaneGeo * Plane(unsigned int i) const
NumuCutParameters const & ParametersStruct() const
virtual TVector3 Start() const
Definition: Prong.h:73
Defines an enumeration for prong classification.
int KalFwdCell() const
Definition: CosRejObj.cxx:652
std::vector< float > fOutput
Vector of outputs from neural net.
Definition: Result.h:30
float abs(float number)
Definition: d0nt_math.hpp:39
Module to create a summary of total POT seen in a job.
Definition: Evaluator.h:27
TVector3 fCosTrackMaxXYZ
float fCosRejCosSpeed
inverse speed of the timing fit of the cosmic track
double Value() const
Definition: PID.h:22
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
int fTrackClosestEdge
0:-x, 1:+x, 2:-y or 3:+y
float fDiffLastFirstLiveDiblock
float fTrackStopZ
track end z position
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
float fSliceCellsFromEdge
minimum cells to edge of detector
TVector3 MaxXYZ() const
Definition: Cluster.cxx:492
TVector3 fTrackLatestHitPos
position (cm) or track&#39;s latest hit in time
float fDistAllBack
distance of all showers in slice from the back edge of detector
double MinTNS() const
Definition: Cluster.cxx:482
double StopMinDistToTop() const
Minimum perpendicular distance of all prongs stop points to the top edge of the detector.
Definition: NueCosRej.h:120
double TotalADC() const
Sum of the ADC of all the contained hits.
Definition: Cluster.cxx:360
float ProjectDistToEdge(TVector3 Pos, TVector3 Dir)
Far Detector at Ash River, MN.
double StartMinDistToEast() const
Minimum perpendicular distance of all prongs start points to the east edge of the detector (east is n...
Definition: NueCosRej.h:116
double StopMinDistToEast() const
Minimum perpendicular distance of all prongs stop points to the east edge of the detector (east is ne...
Definition: NueCosRej.h:140
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
Definition: Cluster.cxx:439
double StartMinDistToBottom() const
Minimum perpendicular distance of all prongs start points to the bottom edge of the detector...
Definition: NueCosRej.h:100
float fCosRejKalBakCell
just what it looks like
std::pair< int, int > calcFirstLastLivePlane(int plane, std::bitset< 14 > binary)
double StartMinDistToBack() const
Minimum perpendicular distance of all prongs start points to the back edge of the detector...
Definition: NueCosRej.h:108
float fShowerMinX
min x for all shower end points
float fVertexY
vertex of the interaction
float fVertexMaxW
maximum w value of the vertex
TVector3 GetXYZ() const
Definition: Vertex.cxx:45
float fTrackStartZ
track starting z position
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
float ConCosPID() const
Definition: CosRejObj.cxx:465
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
int KalBakCell() const
Definition: CosRejObj.cxx:664
double energy
Definition: plottest35.C:25
TVector3 fTrackEarliestHitPos
position (cm) or track&#39;s earliest hit in time
Near Detector in the NuMI cavern.
float fSliceClosestEdge
0:-x, 1:+x, 2:-y or 3:+y
float fShowerDirX
direction of the primary shower in slice
friend std::ostream & operator<<(std::ostream &o, ParametersNumu const &p)
float fTrackStartTime
track starting (ns)
int CosBakCell() const
Definition: CosRejObj.cxx:640
float fCosRejKalSpeed
inverse speed of the timing fit of the kalman track
int CosFwdCell() const
Definition: CosRejObj.cxx:628
float fCVNVal
value of the CVN PID
float fShowerVertexY
vertex of the primary shower
float fNumShowers
number of showers in slice
float fCosRejKalYPosAtTrans
just what it looks like
std::vector< std::string > comps
double StartMinDistToWest() const
Minimum perpendicular distance of all prongs start points to the west edge of the detector (west is p...
Definition: NueCosRej.h:112
float fShowerVtxDist
distance between the shower vertex and interaction vertex
TVector3 fCosmicTrackLatestHitPos
double StopMinDistToFront() const
Minimum perpendicular distance of all prongs stop points to the front edge of the detector...
Definition: NueCosRej.h:128
float CDirScore() const
Definition: CosRejObj.cxx:508
float fNDHadronicCal
hadronic energy in the ND
Definition: View.py:1
float fShowerEndZ
end of the primary shower
float fShowerMinVtxZ
minimum Z position of all showers
double MaxTNS() const
Definition: Cluster.cxx:528
float NDHadCalTran() const
Definition: NumuE.cxx:334
double StartMinDistToFront() const
Minimum perpendicular distance of all prongs start points to the front edge of the detector...
Definition: NueCosRej.h:104
TVector3 fCosmicTrackEarliestHitPos
static float min(const float a, const float b, const float c)
Definition: absgeo.cxx:45
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.cxx:462
float fShowerCalE
calorimetric energy in primary shower in slice
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
int Ntrk() const
Definition: QePId.cxx:75
Cosmic Rejection PIDs for Numu analysis.
Definition: FillParentInfo.h:9
TVector3 fCosmicTrackStart
void Compare(NumuCutParameters const &compCuts)
float fSliceContigPlanes
contiguous planes in slice
Result, basic output of CVN neural net.
Definition: Result.h:15
const int kNumCVNFinalStates
Definition: CVNLabels.h:11
float fOtherTrackMaxEndZ
maximum Z position of non Best-RemID tracks
A container for energy information.
Definition: Energy.h:20
double ProngTransMom() const
Transverse component of the energy-weighted average of prong directions.
Definition: NueCosRej.h:26
float fCosRejCosDirScore
difference between hough scores for timing fits of the cosmic track going forward and backwards ...
TVector3 MinXYZ() const
Definition: Cluster.cxx:446
float fQePIDVal
value of QePId parameter
float CFitSpeed() const
Definition: CosRejObj.cxx:496
float fShowerMaxEndZ
maximum Z position of all showers
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
float fProngLength
length of largest prong in slice
int MostContiguousPlanes(geo::View_t view) const
Longest run of adjacent planes with hits.
Definition: Cluster.cxx:635
void geom(int which=0)
Definition: geom.C:163
const int kCVN_nM_Other
Definition: CVNLabels.h:401
float fTrackCCE
track CC energy
float fBestPIDTrack
track with the best PID
TVector3 fCosmicTrackStop
TVector3 fTrackStart
track starting position (cm)
double TotalGeV(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple sum of the estimated GeV of all the hits.
Definition: Cluster.cxx:378
int KalFwdCellND() const
Definition: CosRejObj.cxx:658
float KFitSpeed() const
Definition: CosRejObj.cxx:490
float fQePIDNTracks
number of tracks for QePID
float fCosRejKalFwdCell
just what it looks like
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.cxx:508
float fDistAllWest
distance of all showers in slice from the west edge of detector
const CVNFinalState cvnStates[kNumCVNFinalStates]
Definition: CVNLabels.h:12
float fShowerVertexX
vertex of the primary shower
NumuCutParameters fParameters
the relevant parameters to cut on for a numu selection
A PID for muons.
Definition: FillPIDs.h:10
#define LOG_VERBATIM(category)
float fShowerNumYCell
number of y cells in slice
TVector3 fCosmicTrackDir
unsigned int NPlanes() const
float fSliceMinPlane
minimum plane of the slice
double StopMinDistToBack() const
Minimum perpendicular distance of all prongs stop points to the back edge of the detector.
Definition: NueCosRej.h:132
T min(const caf::Proxy< T > &a, T b)
TVector3 Stop() const
Position of the final trajectory point.
Definition: Track.cxx:186
int GoodDiBlockMask(int subrun=-1, bool reload=false)
float fCosTrackTotalCalorimetricEnergy
std::pair< TVector3, TVector3 > EarliestLatestHitPos(rb::Track const &track, bool cosmictrack)
Float_t e
Definition: plot.C:35
float fShowerPt
shower transverse momentum
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
int fCosTrackNHitsNearEdge[10]
int fSliceNHitsNearEdge[10]
fSliceNHitsNearEdge[i] = Number of hits within i cells of the x or y edges
float NDHadCalCat() const
Definition: NumuE.cxx:339
float fShowerDirZ
direction of the primary shower in slice
double fReMIdVal
value of ReMId parameter
Encapsulate the geometry of one entire detector (near, far, ndos)
fvar< T > ceil(const fvar< T > &x)
Definition: ceil.hpp:11
float fShowerTotalE
TotalE energy in primary shower in slice.
float fShowerMaxX
max x for all shower end points
float fShowerVertexZ
vertex of the primary shower
float AngleKal() const
Definition: CosRejObj.cxx:453
float fShowerDirY
direction of the primary shower in slice
float fPlanesToBack
number of planes to the back of the detector