LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArPandoraEventDump_module.cc
Go to the documentation of this file.
1 
10 
11 #include "fhiclcpp/ParameterSet.h"
12 
14 
26 
28 
29 namespace lar_pandora {
30 
32  public:
33  explicit LArPandoraEventDump(fhicl::ParameterSet const& pset);
34 
39 
40  void analyze(art::Event const& evt) override;
41 
42  private:
43  template <class T>
45 
46  template <class T>
48 
52  class PandoraData {
53  public:
62  PandoraData(const art::Event& evt,
63  const std::string& pandoraLabel,
64  const std::string& trackLabel = "",
65  const std::string& showerLabel = "");
66 
70  ~PandoraData();
71 
72  // Collections
83 
84  // Associations
99 
105 
108 
109  private:
117  template <class T>
118  void LoadCollection(const art::Event& evt,
119  const std::string& label,
120  Collection<T>& collection);
121 
130  template <class T, class U>
131  void LoadAssociation(const art::Event& evt,
132  const std::string& label,
133  const Collection<T>& collection,
134  Association<U>*& pAssociation);
135  };
136 
137  // -------------------------------------------------------------------------------------------------------------------------------------
138 
144  void PrintEventMetadata(const art::Event& evt) const;
145 
151  void PrintEventSummary(const PandoraData& data) const;
152 
158  void PrintPFParticleHierarchy(const PandoraData& data) const;
159 
166  void BuildPFParticleMap(const PandoraData& data, PFParticleMap& pfParticleMap) const;
167 
176  void PrintParticle(const art::Ptr<recob::PFParticle>& particle,
177  const PFParticleMap& pfParticleMap,
178  const PandoraData& data,
179  const unsigned int depth) const;
180 
187  void PrintHit(const art::Ptr<recob::Hit>& hit, const unsigned int depth) const;
188 
196  void PrintSlice(const art::Ptr<recob::Slice>& slice,
197  const PandoraData& data,
198  const unsigned int depth) const;
199 
208  const PandoraData& data,
209  const unsigned int depth) const;
210 
217  void PrintVertex(const art::Ptr<recob::Vertex>& vertex, const unsigned int depth) const;
218 
226  void PrintSpacePoint(const art::Ptr<recob::SpacePoint>& spacePoint,
227  const PandoraData& data,
228  const unsigned int depth) const;
229 
238  const PandoraData& data,
239  const unsigned int depth) const;
240 
249  const PandoraData& data,
250  const unsigned int depth) const;
251 
257  void PrintRule(const unsigned int depth) const;
258 
265  void PrintTitle(const std::string& name, const unsigned int depth) const;
266 
274  template <class T>
275  void PrintProperty(const std::string& name, const T& value, const unsigned int depth) const;
276 
277  std::string m_verbosityLevel;
278  std::string m_pandoraLabel;
279  std::string m_trackLabel;
280  std::string m_showerLabel;
281  };
282 
284 
285 } // namespace lar_pandora
286 
287 //------------------------------------------------------------------------------------------------------------------------------------------
288 // implementation follows
289 
290 namespace lar_pandora {
291 
293  : EDAnalyzer(pset)
294  , m_pandoraLabel(pset.get<std::string>("PandoraLabel"))
295  , m_trackLabel(pset.get<std::string>("TrackLabel", ""))
296  , m_showerLabel(pset.get<std::string>("ShowerLabel", ""))
297  {
298  m_verbosityLevel = pset.get<std::string>("VerbosityLevel");
299  std::transform(
300  m_verbosityLevel.begin(), m_verbosityLevel.end(), m_verbosityLevel.begin(), ::tolower);
301 
302  if (m_verbosityLevel != "brief" && m_verbosityLevel != "summary" &&
303  m_verbosityLevel != "detailed" && m_verbosityLevel != "extreme") {
304  throw cet::exception("LArPandoraEventDump")
305  << "Unknown verbosity level: " << m_verbosityLevel << std::endl;
306  }
307  }
308 
309  //------------------------------------------------------------------------------------------------------------------------------------------
310 
312  {
313  // Load the Pandora owned collections from the event
315 
316  this->PrintEventMetadata(evt);
317  this->PrintEventSummary(data);
318 
319  if (m_verbosityLevel != "brief") this->PrintPFParticleHierarchy(data);
320  }
321 
322  //------------------------------------------------------------------------------------------------------------------------------------------
323 
325  {
326  std::cout << std::string(80, '=') << std::endl;
327  std::cout << "run : " << evt.run() << std::endl;
328  std::cout << "subRun : " << evt.subRun() << std::endl;
329  std::cout << "event : " << evt.event() << std::endl;
330  std::cout << std::endl;
331  }
332 
333  //------------------------------------------------------------------------------------------------------------------------------------------
334 
336  {
337  std::cout << std::string(80, '-') << std::endl;
338  std::cout << "Collection sizes" << std::endl;
339  std::cout << std::string(80, '-') << std::endl;
340 
341  std::cout << "PFParticle : " << data.m_pfParticleCollection->size() << std::endl;
342  std::cout << "PFParticleMetadata : " << data.m_pfParticleMetadataCollection->size()
343  << std::endl;
344  std::cout << "Cluster : " << data.m_clusterCollection->size() << std::endl;
345  std::cout << "SpacePoint : " << data.m_spacePointCollection->size() << std::endl;
346  std::cout << "Vertex : " << data.m_vertexCollection->size() << std::endl;
347  std::cout << "Track : " << data.m_trackCollection->size() << std::endl;
348  std::cout << "Shower : " << data.m_showerCollection->size() << std::endl;
349  std::cout << "PCAxis : " << data.m_pcAxisCollection->size() << std::endl;
350  std::cout << "Slice : " << data.m_sliceCollection->size() << std::endl;
351  std::cout << std::endl;
352 
353  std::cout << std::string(80, '-') << std::endl;
354  std::cout << "Association sizes" << std::endl;
355  std::cout << std::string(80, '-') << std::endl;
356 
358  std::cout << "PFParticle -> Metadata : " << data.m_pPFParticleToMetadataAssociation->size()
359  << std::endl;
360 
362  std::cout << "PFParticle -> Cluster : " << data.m_pPFParticleToClusterAssociation->size()
363  << std::endl;
364 
366  std::cout << "PFParticle -> SpacePoint : "
367  << data.m_pPFParticleToSpacePointAssociation->size() << std::endl;
368 
370  std::cout << "PFParticle -> Vertex : " << data.m_pPFParticleToVertexAssociation->size()
371  << std::endl;
372 
374  std::cout << "PFParticle -> Track : " << data.m_pPFParticleToTrackAssociation->size()
375  << std::endl;
376 
378  std::cout << "PFParticle -> Shower : " << data.m_pPFParticleToShowerAssociation->size()
379  << std::endl;
380 
382  std::cout << "PFParticle -> Slice : " << data.m_pPFParticleToSliceAssociation->size()
383  << std::endl;
384 
386  std::cout << "Cluster -> Hit : " << data.m_pClusterToHitAssociation->size()
387  << std::endl;
388 
390  std::cout << "SpacePoint -> Hit : " << data.m_pSpacePointToHitAssociation->size()
391  << std::endl;
392 
393  if (data.m_pTrackToHitAssociation)
394  std::cout << "Track -> Hit : " << data.m_pTrackToHitAssociation->size()
395  << std::endl;
396 
397  if (data.m_pShowerToHitAssociation)
398  std::cout << "Shower -> Hit : " << data.m_pShowerToHitAssociation->size()
399  << std::endl;
400 
402  std::cout << "Shower -> PCAxis : " << data.m_pShowerToPCAxisAssociation->size()
403  << std::endl;
404 
405  if (data.m_pSliceToHitAssociation)
406  std::cout << "Slice -> Hit : " << data.m_pSliceToHitAssociation->size()
407  << std::endl;
408 
409  std::cout << std::endl;
410  }
411 
412  //------------------------------------------------------------------------------------------------------------------------------------------
413 
415  {
416  // Get the mapping from PFParticle ID to PFParticle
417  PFParticleMap pfParticleMap;
418  this->BuildPFParticleMap(data, pfParticleMap);
419 
420  // Print all primary PFParticles
421  for (unsigned int i = 0; i < data.m_pfParticleCollection->size(); ++i) {
422  const art::Ptr<recob::PFParticle> particle(data.m_pfParticleCollection, i);
423 
424  if (!particle->IsPrimary()) continue;
425 
426  this->PrintParticle(particle, pfParticleMap, data, 0);
427  }
428  }
429 
430  //------------------------------------------------------------------------------------------------------------------------------------------
431 
433  PFParticleMap& pfParticleMap) const
434  {
435  for (unsigned int i = 0; i < data.m_pfParticleCollection->size(); ++i) {
436  const art::Ptr<recob::PFParticle> particle(data.m_pfParticleCollection, i);
437  pfParticleMap[particle->Self()] = particle;
438  }
439  }
440 
441  //------------------------------------------------------------------------------------------------------------------------------------------
442 
444  const PFParticleMap& pfParticleMap,
445  const PandoraData& data,
446  const unsigned int depth) const
447  {
448  this->PrintRule(depth);
449  this->PrintTitle("PFParticle", depth);
450  this->PrintRule(depth);
451 
452  // Print the PFParticle details
453  this->PrintProperty("Key", particle.key(), depth);
454  this->PrintProperty("Id", particle->Self(), depth);
455  this->PrintProperty("PDG", particle->PdgCode(), depth);
456  this->PrintProperty("IsPrimary", particle->IsPrimary(), depth);
457 
458  if (!particle->IsPrimary()) this->PrintProperty("Parent", particle->Parent(), depth);
459 
460  // Print the metadata
462  const auto& metadata(data.m_pPFParticleToMetadataAssociation->at(particle.key()));
463  this->PrintProperty("# Metadata", metadata.size(), depth);
464 
465  for (const auto& metadatum : metadata) {
466  const auto& propertiesMap(metadatum->GetPropertiesMap());
467  this->PrintProperty("# Properties", propertiesMap.size(), depth + 2);
468 
469  for (const auto& propertiesMapEntry : propertiesMap)
470  this->PrintProperty(propertiesMapEntry.first, propertiesMapEntry.second, depth + 4);
471  }
472  }
473 
474  // Print the slices
476  const auto& slices(data.m_pPFParticleToSliceAssociation->at(particle.key()));
477  this->PrintProperty("# Slices", slices.size(), depth);
478 
479  if (m_verbosityLevel != "summary") {
480  for (const auto& slice : slices)
481  this->PrintSlice(slice, data, depth + 2);
482  }
483  }
484 
485  // Print the clusters
487  const auto& clusters(data.m_pPFParticleToClusterAssociation->at(particle.key()));
488  this->PrintProperty("# Clusters", clusters.size(), depth);
489 
490  if (m_verbosityLevel != "summary") {
491  for (const auto& cluster : clusters)
492  this->PrintCluster(cluster, data, depth + 2);
493  }
494  }
495 
496  // Print the space points
498  const auto& spacePoints(data.m_pPFParticleToSpacePointAssociation->at(particle.key()));
499  this->PrintProperty("# SpacePoints", spacePoints.size(), depth);
500 
501  if (m_verbosityLevel != "summary") {
502  for (const auto& spacePoint : spacePoints)
503  this->PrintSpacePoint(spacePoint, data, depth + 2);
504  }
505  }
506 
507  // Print the vertices
509  const auto& vertices(data.m_pPFParticleToVertexAssociation->at(particle.key()));
510  this->PrintProperty("# Vertices", vertices.size(), depth);
511 
512  if (m_verbosityLevel != "summary") {
513  for (const auto& vertex : vertices)
514  this->PrintVertex(vertex, depth + 2);
515  }
516  }
517 
518  // Print the tracks
520  const auto& tracks(data.m_pPFParticleToTrackAssociation->at(particle.key()));
521  this->PrintProperty("# Tracks", tracks.size(), depth);
522 
523  if (m_verbosityLevel != "summary") {
524  for (const auto& track : tracks)
525  this->PrintTrack(track, data, depth + 2);
526  }
527  }
528 
529  // Print the showers
531  const auto& showers(data.m_pPFParticleToShowerAssociation->at(particle.key()));
532  this->PrintProperty("# Showers", showers.size(), depth);
533 
534  if (m_verbosityLevel != "summary") {
535  for (const auto& shower : showers)
536  this->PrintShower(shower, data, depth + 2);
537  }
538  }
539 
540  // Print the daughters
541  this->PrintProperty("# Daughters", particle->NumDaughters(), depth);
542  this->PrintRule(depth);
543 
544  for (auto& daughterId : particle->Daughters()) {
545  const auto daughterIter(pfParticleMap.find(daughterId));
546 
547  if (daughterIter == pfParticleMap.end())
548  throw cet::exception("LArPandoraEventDump")
549  << "Couldn't find daughter of PFParticle in the PFParticle map";
550 
551  const auto& daughter(daughterIter->second);
552  this->PrintParticle(daughter, pfParticleMap, data, depth + 4);
553  }
554  }
555 
556  //------------------------------------------------------------------------------------------------------------------------------------------
557 
559  const unsigned int depth) const
560  {
561  this->PrintTitle("Hit", depth);
562  this->PrintProperty("Key", hit.key(), depth + 2);
563  this->PrintProperty("Channel", hit->Channel(), depth + 2);
564  this->PrintProperty("View", hit->View(), depth + 2);
565  this->PrintProperty("Peak time", hit->PeakTime(), depth + 2);
566  this->PrintProperty("RMS", hit->RMS(), depth + 2);
567  }
568 
569  //------------------------------------------------------------------------------------------------------------------------------------------
570 
572  const PandoraData& data,
573  const unsigned int depth) const
574  {
575  this->PrintTitle("Slice", depth);
576  this->PrintProperty("Key", slice.key(), depth + 2);
577  this->PrintProperty("ID", slice->ID(), depth + 2);
578 
579  if (!data.m_pSliceToHitAssociation) return;
580 
581  const auto& hits(data.m_pSliceToHitAssociation->at(slice.key()));
582  this->PrintProperty("# Hits", hits.size(), depth + 2);
583 
584  if (m_verbosityLevel != "extreme") return;
585 
586  // Print each associated hit
587  for (const auto& hit : hits)
588  this->PrintHit(hit, depth + 4);
589  }
590 
591  //------------------------------------------------------------------------------------------------------------------------------------------
592 
594  const PandoraData& data,
595  const unsigned int depth) const
596  {
597  this->PrintTitle("Cluster", depth);
598  this->PrintProperty("Key", cluster.key(), depth + 2);
599  this->PrintProperty("ID", cluster->ID(), depth + 2);
600  this->PrintProperty("View", cluster->View(), depth + 2);
601 
602  if (!data.m_pClusterToHitAssociation) return;
603 
604  const auto& hits(data.m_pClusterToHitAssociation->at(cluster.key()));
605  this->PrintProperty("# Hits", hits.size(), depth + 2);
606 
607  if (m_verbosityLevel == "detailed") return;
608 
609  // Print each associated hit
610  for (const auto& hit : hits)
611  this->PrintHit(hit, depth + 4);
612  }
613 
614  //------------------------------------------------------------------------------------------------------------------------------------------
615 
617  const PandoraData& data,
618  const unsigned int depth) const
619  {
620  this->PrintTitle("SpacePoint", depth);
621  this->PrintProperty("Key", spacePoint.key(), depth + 2);
622  this->PrintProperty("ID", spacePoint->ID(), depth + 2);
623  const auto& position(spacePoint->XYZ());
624  this->PrintProperty("X", position[0], depth + 2);
625  this->PrintProperty("Y", position[1], depth + 2);
626  this->PrintProperty("Z", position[2], depth + 2);
627 
628  if (!data.m_pSpacePointToHitAssociation) return;
629 
630  const auto& hits(data.m_pSpacePointToHitAssociation->at(spacePoint.key()));
631  this->PrintProperty("# Hits", hits.size(), depth + 2);
632 
633  if (m_verbosityLevel == "detailed") return;
634 
635  // Print each associated hit
636  for (const auto& hit : hits)
637  this->PrintHit(hit, depth + 4);
638  }
639 
640  //------------------------------------------------------------------------------------------------------------------------------------------
641 
643  const unsigned int depth) const
644  {
645  this->PrintTitle("Vertex", depth);
646  this->PrintProperty("Key", vertex.key(), depth + 2);
647  this->PrintProperty("ID", vertex->ID(), depth + 2);
648  const auto& position(vertex->position());
649  this->PrintProperty("X", position.X(), depth + 2);
650  this->PrintProperty("Y", position.Y(), depth + 2);
651  this->PrintProperty("Z", position.Z(), depth + 2);
652  }
653 
654  //------------------------------------------------------------------------------------------------------------------------------------------
655 
657  const PandoraData& data,
658  const unsigned int depth) const
659  {
660  this->PrintTitle("Track", depth);
661  this->PrintProperty("Key", track.key(), depth + 2);
662  this->PrintProperty("# Trajectory points", track->NumberTrajectoryPoints(), depth + 2);
663  this->PrintProperty("Length", track->Length(), depth + 2);
664 
665  if (!data.m_pTrackToHitAssociation) return;
666 
667  const auto& hits(data.m_pTrackToHitAssociation->at(track.key()));
668  this->PrintProperty("# Hits", hits.size(), depth + 2);
669 
670  if (m_verbosityLevel == "detailed") return;
671 
672  // Print each associated hit
673  for (const auto& hit : hits)
674  this->PrintHit(hit, depth + 4);
675  }
676 
677  //------------------------------------------------------------------------------------------------------------------------------------------
678 
680  const PandoraData& data,
681  const unsigned int depth) const
682  {
683  this->PrintTitle("Shower", depth);
684  this->PrintProperty("Key", shower.key(), depth + 2);
685  this->PrintProperty("ID", shower->ID(), depth + 2);
686  this->PrintProperty("StartX", shower->ShowerStart().X(), depth + 2);
687  this->PrintProperty("StartY", shower->ShowerStart().Y(), depth + 2);
688  this->PrintProperty("StartZ", shower->ShowerStart().Z(), depth + 2);
689  this->PrintProperty("Length", shower->Length(), depth + 2);
690  this->PrintProperty("OpenAngle", shower->OpenAngle(), depth + 2);
691 
692  if (data.m_pShowerToPCAxisAssociation) {
693  const auto& pcAxes(data.m_pShowerToPCAxisAssociation->at(shower.key()));
694  this->PrintProperty("# PCAxes", pcAxes.size(), depth + 2);
695 
696  for (const auto& pcAxis : pcAxes) {
697  this->PrintTitle("PCAxis", depth + 4);
698  this->PrintProperty("Key", pcAxis.key(), depth + 6);
699  this->PrintProperty("ID", pcAxis->getID(), depth + 6);
700  this->PrintProperty("# Hits used", pcAxis->getNumHitsUsed(), depth + 6);
701  }
702  }
703 
704  if (!data.m_pShowerToHitAssociation) return;
705 
706  const auto& hits(data.m_pShowerToHitAssociation->at(shower.key()));
707  this->PrintProperty("# Hits", hits.size(), depth + 2);
708 
709  if (m_verbosityLevel == "detailed") return;
710 
711  // Print each associated hit
712  for (const auto& hit : hits)
713  this->PrintHit(hit, depth + 4);
714  }
715 
716  //------------------------------------------------------------------------------------------------------------------------------------------
717 
718  void LArPandoraEventDump::PrintRule(const unsigned int depth) const
719  {
720  const unsigned int nDashes(std::max(0, 120 - static_cast<int>(depth)));
721 
722  std::cout << std::string(depth, ' ') << std::string(nDashes, '-') << std::endl;
723  }
724 
725  //------------------------------------------------------------------------------------------------------------------------------------------
726 
727  void LArPandoraEventDump::PrintTitle(const std::string& name, const unsigned int depth) const
728  {
729  std::cout << std::string(depth, ' ') << name << std::endl;
730  }
731 
732  //------------------------------------------------------------------------------------------------------------------------------------------
733 
734  template <class T>
735  void LArPandoraEventDump::PrintProperty(const std::string& name,
736  const T& value,
737  const unsigned int depth) const
738  {
739  // The separation between the property name and property value
740  const unsigned int separation(std::max(0, 32 - static_cast<int>(depth)));
741 
742  std::cout << std::string(depth, ' ') << std::setw(separation) << std::left << ("- " + name)
743  << value << std::endl;
744  }
745 
746  //------------------------------------------------------------------------------------------------------------------------------------------
747  //------------------------------------------------------------------------------------------------------------------------------------------
748 
750  const std::string& pandoraLabel,
751  const std::string& trackLabel,
752  const std::string& showerLabel)
753  : m_pPFParticleToMetadataAssociation(nullptr)
754  , m_pPFParticleToClusterAssociation(nullptr)
755  , m_pPFParticleToSpacePointAssociation(nullptr)
756  , m_pPFParticleToVertexAssociation(nullptr)
757  , m_pPFParticleToTrackAssociation(nullptr)
758  , m_pPFParticleToShowerAssociation(nullptr)
759  , m_pPFParticleToSliceAssociation(nullptr)
760  , m_pClusterToHitAssociation(nullptr)
761  , m_pSpacePointToHitAssociation(nullptr)
762  , m_pTrackToHitAssociation(nullptr)
763  , m_pShowerToHitAssociation(nullptr)
764  , m_pSliceToHitAssociation(nullptr)
765  , m_pShowerToPCAxisAssociation(nullptr)
766  {
767 
768  // Load the collections
769  this->LoadCollection(evt, pandoraLabel, m_pfParticleCollection);
770  this->LoadCollection(evt, pandoraLabel, m_pfParticleMetadataCollection);
771  this->LoadCollection(evt, pandoraLabel, m_clusterCollection);
772  this->LoadCollection(evt, pandoraLabel, m_spacePointCollection);
773  this->LoadCollection(evt, pandoraLabel, m_vertexCollection);
774  this->LoadCollection(evt, trackLabel, m_trackCollection);
775  this->LoadCollection(evt, showerLabel, m_showerCollection);
776  this->LoadCollection(evt, showerLabel, m_pcAxisCollection);
777  this->LoadCollection(evt, pandoraLabel, m_sliceCollection);
778 
779  // Load the associations
780  this->LoadAssociation(
782  this->LoadAssociation(
784  this->LoadAssociation(
786  this->LoadAssociation(
788  this->LoadAssociation(
793 
796 
797  this->LoadAssociation(
801  }
802 
803  //------------------------------------------------------------------------------------------------------------------------------------------
804 
806  {
807  // Clean up all heap memory
821  }
822 
823  //------------------------------------------------------------------------------------------------------------------------------------------
824 
825  template <class T>
827  const std::string& label,
828  Collection<T>& collection)
829  {
830  if (label.empty()) return;
831 
832  evt.getByLabel(label, collection);
833  }
834 
835  //------------------------------------------------------------------------------------------------------------------------------------------
836 
837  template <class T, class U>
839  const std::string& label,
840  const Collection<T>& collection,
841  Association<U>*& pAssociation)
842  {
843  if (label.empty()) return;
844 
845  if (pAssociation)
846  throw cet::exception("LArPandoraEventDump")
847  << "Association supplied type has already been loaded!";
848 
849  pAssociation = new Association<U>(collection, evt, label);
850  }
851 
852 } // namespace lar_pandora
void BuildPFParticleMap(const PandoraData &data, PFParticleMap &pfParticleMap) const
Build the map from PFParticle ID to PFParticle from the input data.
Association< recob::Slice > * m_pPFParticleToSliceAssociation
The PFParticle to slice association.
void PrintRule(const unsigned int depth) const
Print a horizontal line.
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:110
SubRunNumber_t subRun() const
Definition: Event.cc:35
const TVector3 & ShowerStart() const
Definition: Shower.h:197
std::string m_trackLabel
The track producer label.
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Definition: PFParticle.h:85
Association< recob::Hit > * m_pClusterToHitAssociation
The Cluster to hit association.
Collection< recob::Cluster > m_clusterCollection
The Cluster handle.
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
void PrintEventMetadata(const art::Event &evt) const
Print the metadata about the event.
double Length() const
Definition: Shower.h:227
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:228
LArPandoraEventDump(fhicl::ParameterSet const &pset)
Association< recob::PCAxis > * m_pShowerToPCAxisAssociation
The Shower to PCAxis association.
Declaration of signal hit object.
Collection< recob::SpacePoint > m_spacePointCollection
The SpacePoint handle.
Association< recob::Hit > * m_pSliceToHitAssociation
The Slice to hit association.
void PrintShower(const art::Ptr< recob::Shower > &shower, const PandoraData &data, const unsigned int depth) const
Print a given Shower.
void PrintVertex(const art::Ptr< recob::Vertex > &vertex, const unsigned int depth) const
Print a given Vertex.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:136
LArPandoraEventDump & operator=(LArPandoraEventDump const &)=delete
STL namespace.
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:79
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:276
void PrintParticle(const art::Ptr< recob::PFParticle > &particle, const PFParticleMap &pfParticleMap, const PandoraData &data, const unsigned int depth) const
Print a given PFParticle.
Cluster finding and building.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
void PrintEventSummary(const PandoraData &data) const
Print a summary of the event similar to the standard event dump.
Association< recob::Shower > * m_pPFParticleToShowerAssociation
The PFParticle to shower association.
void LoadAssociation(const art::Event &evt, const std::string &label, const Collection< T > &collection, Association< U > *&pAssociation)
Load an association from the event.
void hits()
Definition: readHits.C:15
Association< recob::Cluster > * m_pPFParticleToClusterAssociation
The PFParticle to cluster association.
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:207
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
Collection< recob::PCAxis > m_pcAxisCollection
The PCAxis handle.
size_t Parent() const
Definition: PFParticle.h:92
std::string m_showerLabel
The shower producer label.
void PrintTrack(const art::Ptr< recob::Track > &track, const PandoraData &data, const unsigned int depth) const
Print a given Track.
key_type key() const noexcept
Definition: Ptr.h:166
T get(std::string const &key) const
Definition: ParameterSet.h:314
double OpenAngle() const
Definition: Shower.h:231
Collection< recob::Slice > m_sliceCollection
The Slice handle.
Provides recob::Track data product.
void PrintSpacePoint(const art::Ptr< recob::SpacePoint > &spacePoint, const PandoraData &data, const unsigned int depth) const
Print a given SpacePoint.
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:82
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
EventNumber_t event() const
Definition: Event.cc:41
Association< recob::Track > * m_pPFParticleToTrackAssociation
The PFParticle to track association.
Collection< recob::Vertex > m_vertexCollection
The Vertex handle.
Declaration of cluster object.
std::string m_pandoraLabel
The label of the Pandora pattern recognition producer.
Association< larpandoraobj::PFParticleMetadata > * m_pPFParticleToMetadataAssociation
The PFParticle to metadata association.
double value
Definition: spectrum.C:18
Collection< recob::Shower > m_showerCollection
The Shower handle.
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
void analyze(art::Event const &evt) override
int ID() const
Definition: Slice.h:40
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
geo::View_t View() const
Returns the view for this cluster.
Definition: Cluster.h:714
ID_t ID() const
Definition: SpacePoint.h:74
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:220
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Definition: StdUtils.h:120
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Utility object to perform functions of association.
Association< recob::SpacePoint > * m_pPFParticleToSpacePointAssociation
The PFParticle to space point association.
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:711
int ID() const
Return vertex id.
Definition: Vertex.h:101
void PrintSlice(const art::Ptr< recob::Slice > &slice, const PandoraData &data, const unsigned int depth) const
Print a given Slice.
Association< recob::Hit > * m_pSpacePointToHitAssociation
The SpacePoint to hit association.
Association< recob::Hit > * m_pShowerToHitAssociation
The Shower to hit association.
std::string m_verbosityLevel
The level of verbosity to use.
void LoadCollection(const art::Event &evt, const std::string &label, Collection< T > &collection)
Load a collection from the event.
void PrintCluster(const art::Ptr< recob::Cluster > &cluster, const PandoraData &data, const unsigned int depth) const
Print a given Cluster.
Collection< recob::PFParticle > m_pfParticleCollection
The PFParticle handle.
PandoraData(const art::Event &evt, const std::string &pandoraLabel, const std::string &trackLabel="", const std::string &showerLabel="")
Default constructor.
Collection< larpandoraobj::PFParticleMetadata > m_pfParticleMetadataCollection
The PFParticleMetadata handle.
TCEvent evt
Definition: DataStructs.cxx:8
void PrintPFParticleHierarchy(const PandoraData &data) const
Print the full PFParticle Hierarchy.
Association< recob::Vertex > * m_pPFParticleToVertexAssociation
The PFParticle to vertex association.
RunNumber_t run() const
Definition: Event.cc:29
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
Class holding the handle for all of the data types from Pandora.
Float_t track
Definition: plot.C:35
helper function for LArPandoraInterface producer module
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:268
int ID() const
Definition: Shower.h:183
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:64
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
Association< recob::Hit > * m_pTrackToHitAssociation
The Track to hit association.
Collection< recob::Track > m_trackCollection
The Track handle.
vertex reconstruction