All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PFParticleAnalysis_module.cc
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraAnalysis/PFParticleAnalysis_module.cc
3  *
4  * @brief Analysis module for created particles
5  */
6 
7 #include "art/Framework/Core/ModuleMacros.h"
8 #include "art/Framework/Core/EDAnalyzer.h"
9 
10 #include "TTree.h"
11 #include "TVector3.h"
12 
14 
15 #include <string>
16 
17 //------------------------------------------------------------------------------------------------------------------------------------------
18 
19 namespace lar_pandora
20 {
21 
22 /**
23  * @brief PFParticleAnalysis class
24  */
25 class PFParticleAnalysis : public art::EDAnalyzer
26 {
27 public:
28  /**
29  * @brief Constructor
30  *
31  * @param pset
32  */
33  PFParticleAnalysis(fhicl::ParameterSet const &pset);
34 
35  /**
36  * @brief Destructor
37  */
38  virtual ~PFParticleAnalysis();
39 
40  void beginJob();
41  void endJob();
42  void analyze(const art::Event &evt);
43  void reconfigure(fhicl::ParameterSet const &pset);
44 
45 private:
46 
47  TTree *m_pRecoTree; ///<
48 
49  int m_run; ///<
50  int m_event; ///<
51  int m_index; ///<
52 
53  int m_self; ///<
54  int m_pdgcode; ///<
55  int m_primary; ///<
56  int m_parent; ///<
57  int m_daughters; ///<
58  int m_generation; ///<
59  int m_neutrino; ///<
60  int m_finalstate; ///<
61  int m_vertex; ///<
62  int m_track; ///<
63  int m_trackid; ///<
64  int m_shower; ///<
65  int m_showerid; ///<
66 
67  int m_clusters; ///<
68  int m_spacepoints; ///<
69  int m_hits; ///<
71  int m_trackhits; ///<
72  int m_showerhits; ///<
73 
74  double m_pfovtxx; ///<
75  double m_pfovtxy; ///<
76  double m_pfovtxz; ///<
77 
78  double m_trkvtxx; ///<
79  double m_trkvtxy; ///<
80  double m_trkvtxz; ///<
81  double m_trkvtxdirx; ///<
82  double m_trkvtxdiry; ///<
83  double m_trkvtxdirz; ///<
84  double m_trkendx; ///<
85  double m_trkendy; ///<
86  double m_trkendz; ///<
87  double m_trkenddirx; ///<
88  double m_trkenddiry; ///<
89  double m_trkenddirz; ///<
90  double m_trklength; ///<
91  double m_trkstraightlength; ///<
92 
93  double m_shwvtxx; ///<
94  double m_shwvtxy; ///<
95  double m_shwvtxz; ///<
96  double m_shwvtxdirx; ///<
97  double m_shwvtxdiry; ///<
98  double m_shwvtxdirz; ///<
99  double m_shwlength; ///<
100  double m_shwopenangle; ///<
101  double m_shwbestplane; ///<
102 
103  double m_t0; ///<
104 
105  std::string m_particleLabel; ///<
106  std::string m_trackLabel; ///<
107  std::string m_showerLabel; ///<
108  bool m_printDebug; ///< switch for print statements (TODO: use message service!)
109 };
110 
111 DEFINE_ART_MODULE(PFParticleAnalysis)
112 
113 } // namespace lar_pandora
114 
115 //------------------------------------------------------------------------------------------------------------------------------------------
116 // implementation follows
117 
118 #include "art/Framework/Principal/Event.h"
119 #include "fhiclcpp/ParameterSet.h"
120 #include "art/Framework/Principal/Handle.h"
121 #include "art/Framework/Services/Registry/ServiceHandle.h"
122 #include "art_root_io/TFileService.h"
123 #include "art_root_io/TFileDirectory.h"
124 #include "messagefacility/MessageLogger/MessageLogger.h"
125 
131 
133 
134 #include <iostream>
135 
136 namespace lar_pandora
137 {
138 
139 PFParticleAnalysis::PFParticleAnalysis(fhicl::ParameterSet const &pset) : art::EDAnalyzer(pset)
140 {
141  this->reconfigure(pset);
142 }
143 
144 //------------------------------------------------------------------------------------------------------------------------------------------
145 
147 {
148 }
149 
150 //------------------------------------------------------------------------------------------------------------------------------------------
151 
152 void PFParticleAnalysis::reconfigure(fhicl::ParameterSet const &pset)
153 {
154  m_particleLabel = pset.get<std::string>("PFParticleModule","pandora");
155  m_trackLabel = pset.get<std::string>("TrackModule","pandora");
156  m_showerLabel = pset.get<std::string>("ShowerModule","pandora");
157  m_printDebug = pset.get<bool>("PrintDebug",false);
158 }
159 
160 //------------------------------------------------------------------------------------------------------------------------------------------
161 
163 {
164  mf::LogDebug("LArPandora") << " *** PFParticleAnalysis::beginJob() *** " << std::endl;
165 
166  //
167  art::ServiceHandle<art::TFileService const> tfs;
168 
169  m_pRecoTree = tfs->make<TTree>("pandora", "LAr PFParticles");
170  m_pRecoTree->Branch("run", &m_run, "run/I");
171  m_pRecoTree->Branch("event", &m_event, "event/I");
172  m_pRecoTree->Branch("index", &m_index, "index/I");
173  m_pRecoTree->Branch("self", &m_self, "self/I");
174  m_pRecoTree->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
175  m_pRecoTree->Branch("primary", &m_primary, "primary/I");
176  m_pRecoTree->Branch("parent", &m_parent, "parent/I");
177  m_pRecoTree->Branch("daughters", &m_daughters, "daughters/I");
178  m_pRecoTree->Branch("generation", &m_generation, "generation/I");
179  m_pRecoTree->Branch("neutrino", &m_neutrino, "neutrino/I");
180  m_pRecoTree->Branch("finalstate", &m_finalstate, "finalstate/I");
181  m_pRecoTree->Branch("vertex", &m_vertex, "vertex/I");
182  m_pRecoTree->Branch("track", &m_track, "track/I");
183  m_pRecoTree->Branch("trackid", &m_trackid, "trackid/I");
184  m_pRecoTree->Branch("shower", &m_shower, "shower/I");
185  m_pRecoTree->Branch("showerid", &m_showerid, "showerid/I");
186  m_pRecoTree->Branch("clusters", &m_clusters, "clusters/I");
187  m_pRecoTree->Branch("spacepoints", &m_spacepoints, "spacepoints/I");
188  m_pRecoTree->Branch("hits", &m_hits, "hits/I");
189  m_pRecoTree->Branch("trackhits", &m_trackhits, "trackhits/I");
190  m_pRecoTree->Branch("trajectorypoints", &m_trajectorypoints, "trajectorypoints/I");
191  m_pRecoTree->Branch("showerhits", &m_showerhits, "showerhits/I");
192  m_pRecoTree->Branch("pfovtxx", &m_pfovtxx, "pfovtxx/D");
193  m_pRecoTree->Branch("pfovtxy", &m_pfovtxy, "pfovtxy/D");
194  m_pRecoTree->Branch("pfovtxz", &m_pfovtxz, "pfovtxz/D");
195  m_pRecoTree->Branch("trkvtxx", &m_trkvtxx, "trkvtxx/D");
196  m_pRecoTree->Branch("trkvtxy", &m_trkvtxy, "trkvtxy/D");
197  m_pRecoTree->Branch("trkvtxz", &m_trkvtxz, "trkvtxz/D");
198  m_pRecoTree->Branch("trkvtxdirx", &m_trkvtxdirx, "trkvtxdirx/D");
199  m_pRecoTree->Branch("trkvtxdiry", &m_trkvtxdiry, "trkvtxdiry/D");
200  m_pRecoTree->Branch("trkvtxdirz", &m_trkvtxdirz, "trkvtxdirz/D");
201  m_pRecoTree->Branch("trkendx", &m_trkendx, "trkendx/D");
202  m_pRecoTree->Branch("trkendy", &m_trkendy, "trkendy/D");
203  m_pRecoTree->Branch("trkendz", &m_trkendz, "trkendz/D");
204  m_pRecoTree->Branch("trkenddirx", &m_trkenddirx, "trkenddirx/D");
205  m_pRecoTree->Branch("trkenddiry", &m_trkenddiry, "trkenddiry/D");
206  m_pRecoTree->Branch("trkenddirz", &m_trkenddirz, "trkenddirz/D");
207  m_pRecoTree->Branch("trklength", &m_trklength, "trklength/D");
208  m_pRecoTree->Branch("trkstraightlength", &m_trkstraightlength, "trkstraightlength/D");
209  m_pRecoTree->Branch("shwvtxx", &m_shwvtxx, "shwvtxx/D");
210  m_pRecoTree->Branch("shwvtxy", &m_shwvtxy, "shwvtxy/D");
211  m_pRecoTree->Branch("shwvtxz", &m_shwvtxz, "shwvtxz/D");
212  m_pRecoTree->Branch("shwvtxdirx", &m_shwvtxdirx, "shwvtxdirx/D");
213  m_pRecoTree->Branch("shwvtxdiry", &m_shwvtxdiry, "shwvtxdiry/D");
214  m_pRecoTree->Branch("shwvtxdirz", &m_shwvtxdirz, "shwvtxdirz/D");
215  m_pRecoTree->Branch("shwlength", &m_shwlength, "shwlength/D");
216  m_pRecoTree->Branch("shwopenangle", &m_shwopenangle, "shwopenangle/D");
217  m_pRecoTree->Branch("shwbestplane", &m_shwbestplane, "shwbestplane/D");
218  m_pRecoTree->Branch("t0", &m_t0, "t0/D");
219 }
220 
221 //------------------------------------------------------------------------------------------------------------------------------------------
222 
224 {
225 }
226 
227 //------------------------------------------------------------------------------------------------------------------------------------------
228 
229 void PFParticleAnalysis::analyze(const art::Event &evt)
230 {
231  if (m_printDebug)
232  std::cout << " *** PFParticleAnalysis::analyze(...) *** " << std::endl;
233 
234  m_run = evt.run();
235  m_event = evt.id().event();
236  m_index = 0;
237 
238  m_self = 0;
239  m_pdgcode = 0;
240  m_primary = 0;
241  m_parent = 0;
242  m_daughters = 0;
243  m_generation = 0;
244  m_neutrino = 0;
245  m_finalstate = 0;
246  m_vertex = 0;
247  m_track = 0;
248  m_trackid = -999;
249  m_shower = 0;
250  m_showerid = -999;
251 
252  m_clusters = 0;
253  m_spacepoints = 0;
254  m_hits = 0;
255  m_trajectorypoints = 0;
256  m_trackhits = 0;
257  m_showerhits = 0;
258 
259  m_pfovtxx = 0.0;
260  m_pfovtxy = 0.0;
261  m_pfovtxz = 0.0;
262 
263  m_trkvtxx = 0.0;
264  m_trkvtxy = 0.0;
265  m_trkvtxz = 0.0;
266  m_trkvtxdirx = 0.0;
267  m_trkvtxdiry = 0.0;
268  m_trkvtxdirz = 0.0;
269  m_trkendx = 0.0;
270  m_trkendy = 0.0;
271  m_trkendz = 0.0;
272  m_trkenddirx = 0.0;
273  m_trkenddiry = 0.0;
274  m_trkenddirz = 0.0;
275  m_trklength = 0.0;
276  m_trkstraightlength = 0.0;
277 
278  m_shwvtxx = 0.0;
279  m_shwvtxy = 0.0;
280  m_shwvtxz = 0.0;
281  m_shwvtxdirx = 0.0;
282  m_shwvtxdiry = 0.0;
283  m_shwvtxdirz = 0.0;
284  m_shwlength = 0.0;
285  m_shwopenangle = 0.0;
286  m_shwbestplane = 0.0;
287 
288  m_t0 = 0;
289 
290  if (m_printDebug)
291  {
292  std::cout << " Run: " << m_run << std::endl;
293  std::cout << " Event: " << m_event << std::endl;
294  }
295 
296  // Get the reconstructed PFParticles
297  // =================================
298  PFParticleVector particleVector;
299  PFParticleVector particles1, particles2;
300  PFParticlesToClusters particlesToClusters;
301  PFParticlesToSpacePoints particlesToSpacePoints;
302  PFParticlesToHits particlesToHits;
303  HitsToPFParticles hitsToParticles;
304 
306  LArPandoraHelper::CollectPFParticles(evt, m_particleLabel, particles1, particlesToClusters);
307  LArPandoraHelper::CollectPFParticles(evt, m_particleLabel, particles2, particlesToSpacePoints);
308  LArPandoraHelper::BuildPFParticleHitMaps(evt, m_particleLabel, particlesToHits, hitsToParticles);
309 
310  if (m_printDebug)
311  std::cout << " PFParticles: " << particleVector.size() << std::endl;
312 
313  if (particleVector.empty())
314  {
315  m_pRecoTree->Fill();
316  return;
317  }
318 
319  // Get the reconstructed vertices
320  // ==============================
321  VertexVector vertexVector;
322  PFParticlesToVertices particlesToVertices;
323  LArPandoraHelper::CollectVertices(evt, m_particleLabel, vertexVector, particlesToVertices);
324 
325  // Get the reconstructed tracks
326  // ============================
327  TrackVector trackVector, trackVector2;
328  PFParticlesToTracks particlesToTracks;
329  TracksToHits tracksToHits;
330  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVector, particlesToTracks);
331  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVector2, tracksToHits);
332 
333  // Get the reconstructed showers
334  // ============================
335  ShowerVector showerVector, showerVector2;
336  PFParticlesToShowers particlesToShowers;
337  ShowersToHits showersToHits;
338  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVector, particlesToShowers);
339  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVector2, showersToHits);
340 
341  // Get the reconstructed T0 objects
342  // ================================
343  T0Vector t0Vector;
344  PFParticlesToT0s particlesToT0s;
345  LArPandoraHelper::CollectT0s(evt, m_particleLabel, t0Vector, particlesToT0s);
346 
347  // Build an indexed map of the PFParticles
348  // =======================================
349  PFParticleMap particleMap;
350  LArPandoraHelper::BuildPFParticleMap(particleVector, particleMap);
351 
352  // Write PFParticle properties to ROOT file
353  // ========================================
354  for (unsigned int n = 0; n < particleVector.size(); ++n)
355  {
356  const art::Ptr<recob::PFParticle> particle = particleVector.at(n);
357 
358  m_index = n;
359  m_self = particle->Self();
360  m_pdgcode = particle->PdgCode();
361  m_primary = particle->IsPrimary();
362  m_parent = (particle->IsPrimary() ? -1 : particle->Parent());
363  m_daughters = particle->NumDaughters();
364  m_generation = LArPandoraHelper::GetGeneration(particleMap, particle);
365  m_neutrino = LArPandoraHelper::GetParentNeutrino(particleMap, particle);
366  m_finalstate = LArPandoraHelper::IsFinalState(particleMap, particle);
367  m_vertex = 0;
368  m_track = 0;
369  m_trackid = -999;
370  m_shower = 0;
371  m_showerid = -999;
372 
373  m_clusters = 0;
374  m_spacepoints = 0;
375  m_hits = 0;
376  m_trajectorypoints = 0;
377  m_trackhits = 0;
378  m_showerhits = 0;
379 
380  m_pfovtxx = 0.0;
381  m_pfovtxy = 0.0;
382  m_pfovtxz = 0.0;
383 
384  m_trkvtxx = 0.0;
385  m_trkvtxy = 0.0;
386  m_trkvtxz = 0.0;
387  m_trkvtxdirx = 0.0;
388  m_trkvtxdiry = 0.0;
389  m_trkvtxdirz = 0.0;
390  m_trkendx = 0.0;
391  m_trkendy = 0.0;
392  m_trkendz = 0.0;
393  m_trkenddirx = 0.0;
394  m_trkenddiry = 0.0;
395  m_trkenddirz = 0.0;
396  m_trklength = 0.0;
397  m_trkstraightlength = 0.0;
398 
399  m_shwvtxx = 0.0;
400  m_shwvtxy = 0.0;
401  m_shwvtxz = 0.0;
402  m_shwvtxdirx = 0.0;
403  m_shwvtxdiry = 0.0;
404  m_shwvtxdirz = 0.0;
405  m_shwlength = 0.0;
406  m_shwopenangle = 0.0;
407  m_shwbestplane = 0.0;
408 
409  m_t0 = 0.0;
410 
411  // Particles <-> Clusters
412  PFParticlesToClusters::const_iterator cIter = particlesToClusters.find(particle);
413  if (particlesToClusters.end() != cIter)
414  m_clusters = cIter->second.size();
415 
416  // Particles <-> SpacePoints
417  PFParticlesToSpacePoints::const_iterator pIter = particlesToSpacePoints.find(particle);
418  if (particlesToSpacePoints.end() != pIter)
419  m_spacepoints = pIter->second.size();
420 
421  // Particles <-> Hits
422  PFParticlesToHits::const_iterator hIter = particlesToHits.find(particle);
423  if (particlesToHits.end() != hIter)
424  m_hits = hIter->second.size();
425 
426  // Particles <-> Vertices
427  PFParticlesToVertices::const_iterator vIter = particlesToVertices.find(particle);
428  if (particlesToVertices.end() != vIter)
429  {
430  const VertexVector &vertexVector = vIter->second;
431  if (!vertexVector.empty())
432  {
433  if (vertexVector.size() !=1 && m_printDebug)
434  std::cout << " Warning: Found particle with more than one associated vertex " << std::endl;
435 
436  const art::Ptr<recob::Vertex> vertex = *(vertexVector.begin());
437  double xyz[3] = {0.0, 0.0, 0.0} ;
438  vertex->XYZ(xyz);
439 
440  m_vertex = 1;
441  m_pfovtxx = xyz[0];
442  m_pfovtxy = xyz[1];
443  m_pfovtxz = xyz[2];
444  }
445  }
446 
447  // Particles <-> T0s
448  PFParticlesToT0s::const_iterator t0Iter = particlesToT0s.find(particle);
449  if (particlesToT0s.end() != t0Iter)
450  {
451  const T0Vector &t0Vector = t0Iter->second;
452  if (!t0Vector.empty())
453  {
454  if (t0Vector.size() !=1 && m_printDebug)
455  std::cout << " Warning: Found particle with more than one associated T0 " << std::endl;
456 
457  const art::Ptr<anab::T0> t0 = *(t0Vector.begin());
458  m_t0 = t0->Time();
459  }
460  }
461 
462  // Particles <-> Tracks <-> Hits, T0s
463  PFParticlesToTracks::const_iterator trkIter = particlesToTracks.find(particle);
464  if (particlesToTracks.end() != trkIter)
465  {
466  const TrackVector &trackVector = trkIter->second;
467  if (!trackVector.empty())
468  {
469  if (trackVector.size() !=1 && m_printDebug)
470  std::cout << " Warning: Found particle with more than one associated track " << std::endl;
471 
472  const art::Ptr<recob::Track> track = *(trackVector.begin());
473  const auto &trackVtxPosition = track->Vertex();
474  const auto &trackVtxDirection = track->VertexDirection();
475  const auto &trackEndPosition = track->End();
476  const auto &trackEndDirection = track->EndDirection();
477 
478  m_track = 1;
479  m_trackid = track->ID();
480  m_trajectorypoints = track->NumberTrajectoryPoints();
481  m_trkvtxx = trackVtxPosition.x();
482  m_trkvtxy = trackVtxPosition.y();
483  m_trkvtxz = trackVtxPosition.z();
484  m_trkvtxdirx = trackVtxDirection.x();
485  m_trkvtxdiry = trackVtxDirection.y();
486  m_trkvtxdirz = trackVtxDirection.z();
487  m_trkendx = trackEndPosition.x();
488  m_trkendy = trackEndPosition.y();
489  m_trkendz = trackEndPosition.z();
490  m_trkenddirx = trackEndDirection.x();
491  m_trkenddiry = trackEndDirection.y();
492  m_trkenddirz = trackEndDirection.z();
493  m_trklength = track->Length();
494  m_trkstraightlength = (trackEndPosition - trackVtxPosition).R();
495 
496  TracksToHits::const_iterator trkIter2 = tracksToHits.find(track);
497  if (tracksToHits.end() != trkIter2)
498  m_trackhits = trkIter2->second.size();
499  }
500  }
501 
502  // Particles <-> Showers <-> Hits
503  PFParticlesToShowers::const_iterator shwIter = particlesToShowers.find(particle);
504  if (particlesToShowers.end() != shwIter)
505  {
506  const ShowerVector &showerVector = shwIter->second;
507  if (!showerVector.empty())
508  {
509  if (showerVector.size() !=1 && m_printDebug)
510  std::cout << " Warning: Found particle with more than one associated shower " << std::endl;
511 
512  const art::Ptr<recob::Shower> shower = *(showerVector.begin());
513  const TVector3 &showerVtxPosition = shower->ShowerStart();
514  const TVector3 &showerVtxDirection = shower->Direction();
515 
516  m_shower = 1;
517  m_showerid = shower->ID();
518 
519  m_shwvtxx = showerVtxPosition.x();
520  m_shwvtxy = showerVtxPosition.y();
521  m_shwvtxz = showerVtxPosition.z();
522  m_shwvtxdirx = showerVtxDirection.x();
523  m_shwvtxdiry = showerVtxDirection.y();
524  m_shwvtxdirz = showerVtxDirection.z();
525 
526  m_shwlength = shower->Length();
527  m_shwopenangle = shower->OpenAngle();
528  m_shwbestplane = shower->best_plane();
529 
530  ShowersToHits::const_iterator shwIter2 = showersToHits.find(shower);
531  if (showersToHits.end() != shwIter2)
532  m_showerhits = shwIter2->second.size();
533  }
534  }
535 
536  if (m_printDebug)
537  std::cout << " PFParticle [" << n << "] Primary=" << m_primary << " FinalState=" << m_finalstate
538  << " Pdg=" << m_pdgcode << " NuPdg=" << m_neutrino
539  << " (Self=" << m_self << ", Parent=" << m_parent << ")"
540  << " (Vertex=" << m_vertex << ", Track=" << m_track << ", Shower=" << m_shower
541  << ", Clusters=" << m_clusters << ", SpacePoints=" << m_spacepoints << ", Hits=" << m_hits << ") " << std::endl;
542 
543  m_pRecoTree->Fill();
544  }
545 }
546 
547 
548 
549 } //namespace lar_pandora
static void BuildPFParticleHitMaps(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits, PFParticlesToHits &particlesToHits, HitsToPFParticles &hitsToParticles, const DaughterMode daughterMode=kUseDaughters)
Build mapping between PFParticles and Hits using PFParticle/SpacePoint/Hit maps.
process_name vertex
Definition: cheaterreco.fcl:51
bool m_printDebug
switch for print statements (TODO: use message service!)
static void BuildPFParticleMap(const PFParticleVector &particleVector, PFParticleMap &particleMap)
Build particle maps for reconstructed particles.
static int GetParentNeutrino(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the parent neutrino PDG code (or zero for cosmics) for a given reconstructed particle...
std::map< art::Ptr< recob::PFParticle >, ClusterVector > PFParticlesToClusters
std::vector< art::Ptr< recob::Shower > > ShowerVector
process_name use argoneut_mc_hitfinder track
PFParticleAnalysis(fhicl::ParameterSet const &pset)
Constructor.
process_name shower
Definition: cheaterreco.fcl:51
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
std::map< art::Ptr< recob::PFParticle >, VertexVector > PFParticlesToVertices
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
std::map< art::Ptr< recob::PFParticle >, T0Vector > PFParticlesToT0s
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
static void CollectVertices(const art::Event &evt, const std::string &label, VertexVector &vertexVector, PFParticlesToVertices &particlesToVertices)
Collect the reconstructed PFParticles and associated Vertices from the ART event record.
void reconfigure(fhicl::ParameterSet const &pset)
std::vector< art::Ptr< recob::Track > > TrackVector
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
Provides recob::Track data product.
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
std::vector< art::Ptr< recob::Vertex > > VertexVector
art::ServiceHandle< art::TFileService > tfs
static int GetGeneration(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Return the generation of this particle (first generation if primary)
TCEvent evt
Definition: DataStructs.cxx:8
std::vector< art::Ptr< anab::T0 > > T0Vector
static void CollectT0s(const art::Event &evt, const std::string &label, T0Vector &t0Vector, PFParticlesToT0s &particlesToT0s)
Collect a vector of T0s from the ART event record.
helper function for LArPandoraInterface producer module
BEGIN_PROLOG could also be cout
static bool IsFinalState(const PFParticleMap &particleMap, const art::Ptr< recob::PFParticle > daughterParticle)
Determine whether a particle has been reconstructed as a final-state particle.