NDReco_module.cc
Go to the documentation of this file.
1 /////////////////////////////////////////////////////////
2 /// \brief produce variables useful to reconstruction pion energy
3 /// \author Kirk Bays kirk.r.bays@gmail.com
4 ////////////////////////////////////////////////////////
5 #include <string>
6 
12 #include "fhiclcpp/ParameterSet.h"
14 
15 #include "NDReco/NDRecoFxs.h"
16 #include "NDReco/NDRecoTrkObj.h"
17 #include "NDReco/NDRecoBpfObj.h"
18 #include "NDReco/NDRecoPngObj.h"
19 #include "NDReco/NDRecoVertexObj.h"
20 #include "Geometry/Geometry.h"
21 #include "Geometry/LiveGeometry.h"
22 #include "MCCheater/BackTracker.h"
23 #include "NovaDAQConventions/DAQConventions.h"
24 #include "RecoBase/CellHit.h"
25 #include "RecoBase/Cluster.h"
26 #include "RecoBase/Track.h"
27 #include "RecoBase/Prong.h"
28 #include "RecoBase/RecoHit.h"
29 #include "RecoBase/Vertex.h"
30 #include "ReMId/ReMId.h"
31 #include "SummaryData/SpillData.h"
32 #include "TimingFit/TimingFitAlg.h"
33 #include "Utilities/AssociationUtil.h"
35 #include "CVN/func/Result.h"
36 
37 #include "TFile.h"
38 #include "TMVA/Reader.h"
39 
40 #include "TH1.h"
41 #include "TH2.h"
42 
43 #include "structs.h"
44 namespace ndreco {
45 
46  class NDReco : public art::EDProducer {
47  public:
48  explicit NDReco(fhicl::ParameterSet const & pset);
49  virtual ~NDReco();
50 
51  void produce (art::Event & evt);
52  void beginJob();
53 
54  protected:
55  void Init();
56 
70  TVector3 vert; // EA vertex
71  float verttime; // EA vertex time
72 
76 
77  std::vector<volume> fVols;
78  };
79 }
80 
81 namespace ndreco
82 {
83 
84  //----------------------------------------------------------------------
87  fSlicerToken(consumes<std::vector<rb::Cluster>>(pset.get<std::string>("SlicerLabel"))),
88  fGeneratorLabel (pset.get< std::string >("GeneratorLabel")),
89  fNuMIBeamLabel (pset.get< std::string >("NuMIBeamLabel")),
90  fTrackLabel (pset.get< std::string >("TrackLabel")),
91  fTMVApath (pset.get< std::string >("tmvapath")),
92  fElasticArmsLabel (pset.get< std::string >("ElasticArmsLabel")),
93  fFuzzyKLabel (pset.get< std::string >("FuzzyKLabel")),
94  fBpfTrackLabel (pset.get< std::string >("BpfTrackLabel"))
95  {
96  produces< std::vector<ndreco::NDRecoTrkObj> >();
97  produces< art::Assns<ndreco::NDRecoTrkObj, rb::Track> >();
98 
99  produces< std::vector<ndreco::NDRecoBpfObj> >(); // has to have a unique name even if same a trk
100  produces< art::Assns<ndreco::NDRecoBpfObj, rb::Track> >();
101 
102  produces< std::vector<ndreco::NDRecoPngObj> >();
103  produces< art::Assns<ndreco::NDRecoPngObj, rb::Prong> >();
104 
105  produces<std::vector<ndreco::NDRecoVertexObj>>();
106  produces<art::Assns<ndreco::NDRecoVertexObj, rb::Cluster>>();
107 
108  fVols.push_back({0,
109  pset.get<fhicl::ParameterSet>("volume1").get<float>("xMin"),
110  pset.get<fhicl::ParameterSet>("volume1").get<float>("xMax"),
111  pset.get<fhicl::ParameterSet>("volume1").get<float>("yMin"),
112  pset.get<fhicl::ParameterSet>("volume1").get<float>("yMax"),
113  pset.get<fhicl::ParameterSet>("volume1").get<float>("zMin"),
114  pset.get<fhicl::ParameterSet>("volume1").get<float>("zMax")});
115 
116  fVols.push_back({1,
117  pset.get<fhicl::ParameterSet>("volume2").get<float>("xMin"),
118  pset.get<fhicl::ParameterSet>("volume2").get<float>("xMax"),
119  pset.get<fhicl::ParameterSet>("volume2").get<float>("yMin"),
120  pset.get<fhicl::ParameterSet>("volume2").get<float>("yMax"),
121  pset.get<fhicl::ParameterSet>("volume2").get<float>("zMin"),
122  pset.get<fhicl::ParameterSet>("volume2").get<float>("zMax")});
123 
124  fVols.push_back({2,
125  pset.get<fhicl::ParameterSet>("volume3").get<float>("xMin"),
126  pset.get<fhicl::ParameterSet>("volume3").get<float>("xMax"),
127  pset.get<fhicl::ParameterSet>("volume3").get<float>("yMin"),
128  pset.get<fhicl::ParameterSet>("volume3").get<float>("yMax"),
129  pset.get<fhicl::ParameterSet>("volume3").get<float>("zMin"),
130  pset.get<fhicl::ParameterSet>("volume3").get<float>("zMax")});
131 
132  fVols.push_back({3,
133  pset.get<fhicl::ParameterSet>("volume4").get<float>("xMin"),
134  pset.get<fhicl::ParameterSet>("volume4").get<float>("xMax"),
135  pset.get<fhicl::ParameterSet>("volume4").get<float>("yMin"),
136  pset.get<fhicl::ParameterSet>("volume4").get<float>("yMax"),
137  pset.get<fhicl::ParameterSet>("volume4").get<float>("zMin"),
138  pset.get<fhicl::ParameterSet>("volume4").get<float>("zMax")});
139 
140  fFuzzyK2DLabel = pset.get<std::string>("FuzzyK2DLabel");
141  fCellHitLabel = pset.get<std::string>("CellHitLabel");
142  }
143 
144  //----------------------------------------------------------------------
146  {
147  if(fNDRecoFxs) delete fNDRecoFxs;
148 
149  }
150 
151  //-------------------------------------------------------------------
153  {
154  Init();
155  }
156 
157  //-------------------------------------------------------------------
159  {
160 
161  // std::string pidpath = util::EnvExpansion(fTMVApath);
162  }
163 
164  //-------------------------------------------------------------------
166  {
168  evt.getByToken(fSlicerToken,slicevec);
169 
170  if(slicevec->empty()) {
171  mf::LogWarning ("No Slices")<<"No Slices in the input file";
172  return;
173  }
174 
175  auto fmElastic = art::FindManyP<rb::Vertex>(slicevec, evt, fElasticArmsLabel);
176  art::FindManyP<rb::Track> trackAssnList(slicevec, evt, fTrackLabel);
177  art::FindManyP<rb::Track> bpfAssnList(slicevec, evt, fBpfTrackLabel);
178 
179  std::unique_ptr< std::vector<ndreco::NDRecoTrkObj> > outputTrkObjects(new std::vector<ndreco::NDRecoTrkObj>);
180  std::unique_ptr< art::Assns<ndreco::NDRecoTrkObj, rb::Track> > assocTrk(new art::Assns<ndreco::NDRecoTrkObj, rb::Track>);
181  std::unique_ptr< std::vector<ndreco::NDRecoBpfObj> > outputBpfObjects(new std::vector<ndreco::NDRecoBpfObj>);
182  std::unique_ptr< art::Assns<ndreco::NDRecoBpfObj, rb::Track> > assocBpf(new art::Assns<ndreco::NDRecoBpfObj, rb::Track>);
183  std::unique_ptr< std::vector<ndreco::NDRecoPngObj> > outputPngObjects(new std::vector<ndreco::NDRecoPngObj>);
184  std::unique_ptr< art::Assns<ndreco::NDRecoPngObj, rb::Prong> > assocPng(new art::Assns<ndreco::NDRecoPngObj, rb::Prong>);
185  std::unique_ptr< std::vector<ndreco::NDRecoVertexObj>> outputVertexObjects(new std::vector<ndreco::NDRecoVertexObj>); ///< VertexE data product
186  std::unique_ptr< art::Assns<ndreco::NDRecoVertexObj, rb::Cluster>> assocVertex(new art::Assns<ndreco::NDRecoVertexObj, rb::Cluster>);
187 
188  // Karl::Get the horn current. do we need this?
190  if ( !evt.isRealData() )
191  {
192  evt.getByLabel(fGeneratorLabel, spillPot);
193  }
194  else
195  {
196  evt.getByLabel(fNuMIBeamLabel , spillPot);
197  }
198  bool isRHC = false;
199  if ( spillPot.failedToGet() ) {
200  mf::LogError("NDReco") << "Spill Data not found, aborting without horn current information";
201  abort();
202  }
203  else
204  {
205  isRHC = spillPot->isRHC;
206  }
207  mf::LogDebug("NDReco") << "Horn Current set to isRHC: "<< isRHC;
208 
209  // loop over slices
210  for(size_t i = 0; i < slicevec->size(); ++i){
211 
212  art::Ptr<rb::Cluster> slice(slicevec,i);
213 
214  if(slice->IsNoise())
215  {
216  continue;
217  }
218 
219  // Get EA vertex
220  vert.SetXYZ(0,0,0);
221  verttime = 0;
222  std::vector<art::Ptr<rb::Vertex>> elastics = fmElastic.at(i);
223  if(elastics.size() > 0)
224  { //this should always be size 1 or 0
225  int vtxId = 0; //always check the 0th entry since there should only be 1.
226  verttime = elastics[vtxId]->GetT();
227  vert = elastics[vtxId]->GetXYZ();
228  }
229  else continue; //skip this slice if there is no vertex
230 
232 
233  if(!trackAssnList.isValid())
234  {
235  mf::LogWarning("NDReco") << "NDReco: No Kalman Tracks!";
236  continue;
237  }
238 
239  const std::vector< art::Ptr<rb::Track> > sliceTracks = trackAssnList.at(i);
240 
241  // loop over tracks and fill per-track variables
242  for(size_t iTrack = 0; iTrack < sliceTracks.size(); ++iTrack)
243  {
244  ndreco::NDRecoTrkObj ndrecotrkobj; // initialization in constructor
245  art::Ptr<rb::Track> track = sliceTracks[iTrack];
246 
247  // get track direction to check validity
248  double tdx = track->Dir().X();
249  double tdy = track->Dir().Y();
250  double tdz = track->Dir().Z();
251 
252  // ignore bad track
253  if(!(tdx>=-1&&tdx<=1&&tdy>=-1&&tdy<=1&&tdz>=-1&&tdz<=1))
254  {
255  outputTrkObjects->push_back(ndrecotrkobj);
256  util::CreateAssn(*this,evt,*(outputTrkObjects.get()),track,*(assocTrk.get()));
257  continue;
258  }
259 
260  ndrecotrkobj.SetTrackScatt15(fNDRecoFxs->getTrackScatt(track, vert, 15));
261  ndrecotrkobj.SetTrackScatt30(fNDRecoFxs->getTrackScatt(track, vert, 30));
262 
263  ndrecotrkobj.SetTrackDedx15(fNDRecoFxs->getTrackDedx(track, vert, 15));
264  ndrecotrkobj.SetTrackDedx30(fNDRecoFxs->getTrackDedx(track, vert, 30));
265 
266  ndrecotrkobj.SetTrackActivity15(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 15));
267  ndrecotrkobj.SetTrackActivity30(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 30));
268  ndrecotrkobj.SetTrackActivity45(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 45));
269 
270  ndrecotrkobj.SetTrackProximity15(fNDRecoFxs->getTrackProximity(sliceTracks, iTrack, vert, 15));
271  ndrecotrkobj.SetTrackProximity30(fNDRecoFxs->getTrackProximity(sliceTracks, iTrack, vert, 30));
272 
273  outputTrkObjects->push_back(ndrecotrkobj);
274  util::CreateAssn(*this,evt,*(outputTrkObjects.get()),track,*(assocTrk.get()));
275  } // end of loop over Kalman tracks in slice
276 
277  //almost exact copy for BPF
278 
279  if(!bpfAssnList.isValid())
280  {
281  mf::LogWarning("NDReco") << "NDReco: No BPF Tracks!";
282  continue;
283  }
284 
285  const std::vector< art::Ptr<rb::Track> > bpfTracks = bpfAssnList.at(i);
286 
287  // loop over tracks and fill per-track variables
288  for(size_t iTrack = 0; iTrack < bpfTracks.size(); ++iTrack)
289  {
290  ndreco::NDRecoBpfObj ndrecobpfobj; // initialization in constructor
291  art::Ptr<rb::Track> track = bpfTracks[iTrack];
292 
293  // get track direction to check validity
294  double tdx = track->Dir().X();
295  double tdy = track->Dir().Y();
296  double tdz = track->Dir().Z();
297 
298  // ignore bad track
299  if(!(tdx>=-1&&tdx<=1&&tdy>=-1&&tdy<=1&&tdz>=-1&&tdz<=1))
300  {
301  outputBpfObjects->push_back(ndrecobpfobj);
302  util::CreateAssn(*this,evt,*(outputBpfObjects.get()),track,*(assocBpf.get()));
303  continue;
304  }
305 
306  ndrecobpfobj.SetTrackScatt15(fNDRecoFxs->getTrackScatt(track, vert, 15));
307  ndrecobpfobj.SetTrackScatt30(fNDRecoFxs->getTrackScatt(track, vert, 30));
308 
309  ndrecobpfobj.SetTrackDedx15(fNDRecoFxs->getTrackDedx(track, vert, 15));
310  ndrecobpfobj.SetTrackDedx30(fNDRecoFxs->getTrackDedx(track, vert, 30));
311 
312  ndrecobpfobj.SetTrackActivity15(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 15));
313  ndrecobpfobj.SetTrackActivity30(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 30));
314  ndrecobpfobj.SetTrackActivity45(fNDRecoFxs->getTrackActivity(track, vert, 30, slice->AllCells(), 45));
315 
316  ndrecobpfobj.SetTrackProximity15(fNDRecoFxs->getTrackProximity(bpfTracks, iTrack, vert, 15));
317  ndrecobpfobj.SetTrackProximity30(fNDRecoFxs->getTrackProximity(bpfTracks, iTrack, vert, 30));
318 
319  outputBpfObjects->push_back(ndrecobpfobj);
320  util::CreateAssn(*this,evt,*(outputBpfObjects.get()),track,*(assocBpf.get()));
321  } // end of loop over BPF tracks in slice
322 
323  //------------------------ Initializing constructors for Vertex Energis for each slice ----------------------
324  ndreco::NDRecoVertexObj ndrecovertexobj; // initialization in constructor
325 
326  //------------------------ End Initializing constructors for Vertex Energis for each slice ------------------
327 
328  //------------------------ Resetting Vertex Energis in each slice -------------------------------------------
329  double Prong3DvertexE[4] = {0.0,
330  0.0,
331  0.0,
332  0.0};
333 
334  double Prong2DvertexE[4] = {0.0,
335  0.0,
336  0.0,
337  0.0};
338 
339  double SlicevertexE[4] = {0.0,
340  0.0,
341  0.0,
342  0.0};
343  //------------------------ End Resetting Vertex Energis in each slice -------------------------------------------
344 
345  if (fmFuzzyProng3D.isValid())
346  { //loop over prongs and fill prong variables
347  std::vector<art::Ptr<rb::Prong>> prongs = fmFuzzyProng3D.at(0);
348  for (unsigned int iPng = 0; iPng < prongs.size(); ++iPng)
349  {
350  art::Ptr<rb::Prong> prong = prongs[iPng];
351  ndreco::NDRecoPngObj ndrecopngobj; // initialization in constructor
352 
353  ndrecopngobj.SetProngDedx15(fNDRecoFxs->getProngDedx(prong, vert, 15));
354  ndrecopngobj.SetProngDedx30(fNDRecoFxs->getProngDedx(prong, vert, 30));
355 
356  ndrecopngobj.SetProngActivity15(fNDRecoFxs->getProngActivity(prong, vert, 30, slice->AllCells(), 15));
357  ndrecopngobj.SetProngActivity30(fNDRecoFxs->getProngActivity(prong, vert, 30, slice->AllCells(), 30));
358  ndrecopngobj.SetProngActivity45(fNDRecoFxs->getProngActivity(prong, vert, 30, slice->AllCells(), 45));
359 
360  ndrecopngobj.SetProngProximity15(fNDRecoFxs->getProngProximity(prongs, iPng, vert, 15));
361  ndrecopngobj.SetProngProximity30(fNDRecoFxs->getProngProximity(prongs, iPng, vert, 30));
362 
363  outputPngObjects->push_back(ndrecopngobj);
364  util::CreateAssn(*this,evt,*(outputPngObjects.get()),prong,*(assocPng.get()));
365 
366  for (unsigned int ihit = 0; ihit < prong->NCell(); ++ihit)
367  {
368  rb::RecoHit Prong3DHit = prong->RecoHit(ihit);
369  if (Prong3DHit.IsCalibrated())
370  { // Only working on the calibrated 3D Prong hits
371  for (auto it = fVols.begin(); it != fVols.end(); ++it)
372  {
373  if (Prong3DHit.X() > vert.X() + it->xMin &&
374  Prong3DHit.X() < vert.X() + it->xMax &&
375  Prong3DHit.Y() > vert.Y() + it->yMin &&
376  Prong3DHit.Y() < vert.Y() + it->yMax &&
377  Prong3DHit.Z() > vert.Z() + it->zMin &&
378  Prong3DHit.Z() < vert.Z() + it->zMax)
379  {
380  Prong3DvertexE[it->volNum] += Prong3DHit.GeV(); ///< Calculating 3D Prong Vertex Energy
381  }
382  }
383  } // End selecting the calibrated 3D Prong hits
384  } // End iterating through 3D Prong hits
385  } // end loop over prongs
386  } // end check if prongs are valid
387 
388  auto fmFuzzyProng2D = art::FindManyP<rb::Prong>(elastics, evt, fFuzzyK2DLabel);
389  if (fmFuzzyProng2D.isValid())
390  { //Selecting properly reconstructed 2D prongs
391  std::vector<art::Ptr<rb::Prong>> prongs = fmFuzzyProng2D.at(0);
392 
393  //std::cout << "\n Found: " << prongs.size() << " 2D Prongs";
394  for (unsigned int iPng = 0; iPng < prongs.size(); ++iPng)
395  { // Iterating through 2D prongs
396  art::Ptr<rb::Prong> prong = prongs[iPng];
397  for (unsigned int ihit = 0; ihit < prong->NCell(); ++ihit)
398  { // Iterating through 2D prong hits
399  rb::RecoHit Prong2DHit = prong->RecoHit(ihit);
400  if (Prong2DHit.IsCalibrated())
401  { // Checking for calibrated 2D prong hit
402  for (auto it = fVols.begin(); it != fVols.end(); ++it)
403  {
404  if (Prong2DHit.X() > vert.X() + it->xMin &&
405  Prong2DHit.X() < vert.X() + it->xMax &&
406  Prong2DHit.Y() > vert.Y() + it->yMin &&
407  Prong2DHit.Y() < vert.Y() + it->yMax &&
408  Prong2DHit.Z() > vert.Z() + it->zMin &&
409  Prong2DHit.Z() < vert.Z() + it->zMax)
410  {
411  Prong2DvertexE[it->volNum] += Prong2DHit.GeV(); ///< Calculating 2D Prong Vertex Energy
412  }
413  }
414  } // End Checking for calibrated 2D prong hit
415  } // End Iterating through 2D prong hit
416  } // End Iterating through 2D prongs
417  } // End Selecting properly reconstructed 2D prongs
418 
419  for (unsigned int ihit = 0; ihit < slice->NCell(); ++ihit)
420  { // Iterating through slice hits
421  rb::RecoHit SliceHit = slice->RecoHit(ihit);
422  if (SliceHit.IsCalibrated())
423  { // Checking for calibrated slice hits
424  for (auto it = fVols.begin(); it != fVols.end(); ++it)
425  { // Iterating through volumes
426  if (SliceHit.X() > vert.X() + it->xMin &&
427  SliceHit.X() < vert.X() + it->xMax &&
428  SliceHit.Y() > vert.Y() + it->yMin &&
429  SliceHit.Y() < vert.Y() + it->yMax &&
430  SliceHit.Z() > vert.Z() + it->zMin &&
431  SliceHit.Z() < vert.Z() + it->zMax)
432  {
433  SlicevertexE[it->volNum] += SliceHit.GeV(); ///< Calculating Slice Vertex Energy
434  }
435  } // End iterating through volumes
436  } // End Checking for calibrated slice hits
437  } // End Iterating through slice hit
438  for (auto it = fVols.begin(); it != fVols.end(); ++it)
439  {
440  ndrecovertexobj.SetSliceVertexE(it->volNum, SlicevertexE[it->volNum]);
441  ndrecovertexobj.SetProng3DVertexE(it->volNum, Prong3DvertexE[it->volNum]);
442  ndrecovertexobj.SetProng2DVertexE(it->volNum, Prong2DvertexE[it->volNum]);
443  }
444  outputVertexObjects->push_back(ndrecovertexobj);
445  util::CreateAssn(*this, evt, *(outputVertexObjects.get()), slice, *(assocVertex.get()) );
446 
447  } //end loop over slices
448 
449  evt.put(std::move(outputTrkObjects));
450  evt.put(std::move(assocTrk));
451  evt.put(std::move(outputBpfObjects));
452  evt.put(std::move(assocBpf));
453  evt.put(std::move(outputPngObjects));
454  evt.put(std::move(assocPng));
455  evt.put(std::move(outputVertexObjects)); // For Vertex Activity Calculations
456  evt.put(std::move(assocVertex));
457 
458  } //end produce
459 } //end namespace
460 
std::string fTMVApath
bool isRHC
is the beam in antineutrino mode, aka RHC
Definition: SpillData.h:28
void SetProng3DVertexE(unsigned int volNum, float vertexE)
Vertex Energy (GeV) calculated using all 3D prong hits for each volume.
back track the reconstruction to the simulation
void SetTrackProximity15(float tprox15)
Closest start/end pt proximity to other start/end pts, excluding within 15 cm of vertex.
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
std::string fElasticArmsLabel
set< int >::iterator it
void SetProngActivity15(float pact15)
Activity within 15 cm of track end point, excluding things within 30 cm of vertex.
std::string fFuzzyKLabel
std::string fNuMIBeamLabel
std::vector< volume > fVols
void SetTrackProximity30(float tprox30)
Closest start/end pt proximity to other start/end pts, excluding within 30 cm of vertex.
void SetTrackScatt30(float tscatt30)
Track scattering variable excluding things within 30 cm of vertex.
std::string fGeneratorLabel
void SetTrackActivity15(float tact15)
Activity within 15 cm of track end point, excluding things within 30 cm of vertex.
float getProngActivity(const art::Ptr< rb::Prong > prong, TVector3 vert, float dist, art::PtrVector< rb::CellHit > const &sliceHits, float activitydist)
Definition: NDRecoFxs.cxx:256
float getTrackProximity(const std::vector< art::Ptr< rb::Track > > sliceTracks, int trknum, TVector3 vertex, float dist)
Definition: NDRecoFxs.cxx:153
void SetSliceVertexE(unsigned int volNum, float vertexE)
Vertex Energy (GeV) calculated using all slice hits for each volume.
void SetProngDedx30(float pdedx30)
Prong dedx variable excluding things within 30 cm of vertex.
void SetTrackActivity45(float tact45)
Activity within 45 cm of track end point, excluding things within 30 cm of vertex.
std::string fFuzzyWeight2DLabel
std::string fFuzzyWeight3DLabel
float Z() const
Definition: RecoHit.h:38
Definition: event.h:19
void produce(art::Event &evt)
void SetProngDedx15(float pdedx15)
Prong dedx variable excluding things within 15 cm of vertex.
float getProngProximity(const std::vector< art::Ptr< rb::Prong > > sliceProngs, int pngnum, TVector3 vertex, float dist)
Definition: NDRecoFxs.cxx:289
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
void SetTrackDedx30(float tdedx30)
Track dedx variable excluding things within 30 cm of vertex.
DEFINE_ART_MODULE(TestTMapFile)
float getTrackScatt(const art::Ptr< rb::Track > track, TVector3 vert, float dist)
Definition: NDRecoFxs.cxx:32
art::ServiceHandle< geo::Geometry > geom
float getTrackDedx(const art::Ptr< rb::Track > track, TVector3 vert, float dist)
Definition: NDRecoFxs.cxx:53
void SetProngProximity15(float pprox15)
Closest start/end pt proximity to other start/end pts, excluding within 15 cm of vertex.
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
void SetTrackDedx30(float tdedx30)
Track dedx variable excluding things within 30 cm of vertex.
void SetProng2DVertexE(unsigned int volNum, float vertexE)
Vertex Energy (GeV) calculated using all 2D prong hits for each volume.
void SetTrackDedx15(float tdedx15)
Track dedx variable excluding things within 15 cm of vertex.
void SetTrackProximity15(float tprox15)
Closest start/end pt proximity to other start/end pts, excluding within 15 cm of vertex.
Result for CVN.
std::string fCellHitLabel
float getProngDedx(const art::Ptr< rb::Prong > prong, TVector3 vert, float dist)
Definition: NDRecoFxs.cxx:195
void SetTrackProximity30(float tprox30)
Closest start/end pt proximity to other start/end pts, excluding within 30 cm of vertex.
T get(std::string const &key) const
Definition: ParameterSet.h:231
virtual TVector3 Dir() const
Unit vector describing prong direction.
Definition: Prong.h:77
int evt
ndreco::NDRecoFxs * fNDRecoFxs
rb::RecoHit RecoHit(const art::Ptr< rb::CellHit > &chit) const
Return calibrated hit based on assumed W coordinate.
Definition: Cluster.cxx:259
std::string fFuzzyK2DLabel
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
void SetProngActivity30(float pact30)
Activity within 30 cm of track end point, excluding things within 30 cm of vertex.
const art::ProductToken< std::vector< rb::Cluster > > fSlicerToken
void SetProngActivity45(float pact45)
Activity within 45 cm of track end point, excluding things within 30 cm of vertex.
void SetTrackScatt30(float tscatt30)
Track scattering variable excluding things within 30 cm of vertex.
void SetTrackDedx15(float tdedx15)
Track dedx variable excluding things within 15 cm of vertex.
Vertex location in position and time.
virtual ~NDReco()
Perform a "2 point" Hough transform on a collection of hits.
std::string fTrackLabel
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
float getTrackActivity(const art::Ptr< rb::Track > track, TVector3 vert, float dist, art::PtrVector< rb::CellHit > const &sliceHits, float activitydist)
Definition: NDRecoFxs.cxx:118
float GeV() const
Definition: RecoHit.cxx:69
art::ServiceHandle< geo::LiveGeometry > livegeom
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
float X() const
Definition: RecoHit.h:36
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void SetTrackActivity15(float tact15)
Activity within 15 cm of track end point, excluding things within 30 cm of vertex.
void SetTrackScatt15(float tscatt15)
Track scattering variable excluding things within 15 cm of vertex.
std::string fBpfTrackLabel
void SetTrackActivity45(float tact45)
Activity within 45 cm of track end point, excluding things within 30 cm of vertex.
float Y() const
Definition: RecoHit.h:37
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
Definition: DataViewImpl.h:387
void SetProngProximity30(float pprox30)
Closest start/end pt proximity to other start/end pts, excluding within 30 cm of vertex.
produce variables useful to reconstruction pion energy
Definition: FillReco.h:12
ProductToken< T > consumes(InputTag const &)
art::ServiceHandle< cheat::BackTracker > bt
NDReco(fhicl::ParameterSet const &pset)
Encapsulate the geometry of one entire detector (near, far, ndos)
void SetTrackScatt15(float tscatt15)
Track scattering variable excluding things within 15 cm of vertex.
bool failedToGet() const
Definition: Handle.h:196
void SetTrackActivity30(float tact30)
Activity within 30 cm of track end point, excluding things within 30 cm of vertex.
void SetTrackActivity30(float tact30)
Activity within 30 cm of track end point, excluding things within 30 cm of vertex.