Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lar_pandora::LArPandoraEventDump Class Reference
Inheritance diagram for lar_pandora::LArPandoraEventDump:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Classes

class  PandoraData
 Class holding the handle for all of the data types from Pandora. More...
 

Public Member Functions

 LArPandoraEventDump (fhicl::ParameterSet const &pset)
 
 LArPandoraEventDump (LArPandoraEventDump const &)=delete
 
 LArPandoraEventDump (LArPandoraEventDump &&)=delete
 
LArPandoraEventDumpoperator= (LArPandoraEventDump const &)=delete
 
LArPandoraEventDumpoperator= (LArPandoraEventDump &&)=delete
 
void analyze (art::Event const &evt) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Types

template<class T >
using Collection = art::Handle< std::vector< T > >
 
template<class T >
using Association = art::FindManyP< T >
 

Private Member Functions

void PrintEventMetadata (const art::Event &evt) const
 Print the metadata about the event. More...
 
void PrintEventSummary (const PandoraData &data) const
 Print a summary of the event similar to the standard event dump. More...
 
void PrintPFParticleHierarchy (const PandoraData &data) const
 Print the full PFParticle Hierarchy. More...
 
void BuildPFParticleMap (const PandoraData &data, PFParticleMap &pfParticleMap) const
 Build the map from PFParticle ID to PFParticle from the input data. More...
 
void PrintParticle (const art::Ptr< recob::PFParticle > &particle, const PFParticleMap &pfParticleMap, const PandoraData &data, const unsigned int depth) const
 Print a given PFParticle. More...
 
void PrintHit (const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
 Print a given Hit. More...
 
void PrintSlice (const art::Ptr< recob::Slice > &slice, const PandoraData &data, const unsigned int depth) const
 Print a given Slice. More...
 
void PrintCluster (const art::Ptr< recob::Cluster > &cluster, const PandoraData &data, const unsigned int depth) const
 Print a given Cluster. More...
 
void PrintVertex (const art::Ptr< recob::Vertex > &vertex, const unsigned int depth) const
 Print a given Vertex. More...
 
void PrintSpacePoint (const art::Ptr< recob::SpacePoint > &spacePoint, const PandoraData &data, const unsigned int depth) const
 Print a given SpacePoint. More...
 
void PrintTrack (const art::Ptr< recob::Track > &track, const PandoraData &data, const unsigned int depth) const
 Print a given Track. More...
 
void PrintShower (const art::Ptr< recob::Shower > &shower, const PandoraData &data, const unsigned int depth) const
 Print a given Shower. More...
 
void PrintRule (const unsigned int depth) const
 Print a horizontal line. More...
 
void PrintTitle (const std::string &name, const unsigned int depth) const
 Print a title line. More...
 
template<class T >
void PrintProperty (const std::string &name, const T &value, const unsigned int depth) const
 Print a given property with the correct amount of whitespace. More...
 

Private Attributes

std::string m_verbosityLevel
 The level of verbosity to use. More...
 
std::string m_pandoraLabel
 The label of the Pandora pattern recognition producer. More...
 
std::string m_trackLabel
 The track producer label. More...
 
std::string m_showerLabel
 The shower producer label. More...
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 32 of file LArPandoraEventDump_module.cc.

Member Typedef Documentation

template<class T >
using lar_pandora::LArPandoraEventDump::Association = art::FindManyP<T>
private

Definition at line 49 of file LArPandoraEventDump_module.cc.

template<class T >
using lar_pandora::LArPandoraEventDump::Collection = art::Handle< std::vector<T> >
private

Definition at line 46 of file LArPandoraEventDump_module.cc.

Constructor & Destructor Documentation

lar_pandora::LArPandoraEventDump::LArPandoraEventDump ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 266 of file LArPandoraEventDump_module.cc.

266  :
267  EDAnalyzer(pset),
268  m_pandoraLabel(pset.get<std::string>("PandoraLabel")),
269  m_trackLabel(pset.get<std::string>("TrackLabel" , "")),
270  m_showerLabel(pset.get<std::string>("ShowerLabel", ""))
271 {
272  m_verbosityLevel = pset.get<std::string>("VerbosityLevel");
273  std::transform(m_verbosityLevel.begin(), m_verbosityLevel.end(), m_verbosityLevel.begin(), ::tolower);
274 
275  if (m_verbosityLevel != "brief" &&
276  m_verbosityLevel != "summary" &&
277  m_verbosityLevel != "detailed" &&
278  m_verbosityLevel != "extreme")
279  {
280  throw cet::exception("LArPandoraEventDump") << "Unknown verbosity level: " << m_verbosityLevel << std::endl;
281  }
282 }
std::string m_trackLabel
The track producer label.
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
std::string m_showerLabel
The shower producer label.
std::string m_pandoraLabel
The label of the Pandora pattern recognition producer.
std::string m_verbosityLevel
The level of verbosity to use.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
lar_pandora::LArPandoraEventDump::LArPandoraEventDump ( LArPandoraEventDump const &  )
delete
lar_pandora::LArPandoraEventDump::LArPandoraEventDump ( LArPandoraEventDump &&  )
delete

Member Function Documentation

void lar_pandora::LArPandoraEventDump::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 286 of file LArPandoraEventDump_module.cc.

287 {
288  // Load the Pandora owned collections from the event
290 
291  this->PrintEventMetadata(evt);
292  this->PrintEventSummary(data);
293 
294  if (m_verbosityLevel != "brief")
296 }
std::string m_trackLabel
The track producer label.
void PrintEventMetadata(const art::Event &evt) const
Print the metadata about the event.
void PrintEventSummary(const PandoraData &data) const
Print a summary of the event similar to the standard event dump.
std::string m_showerLabel
The shower producer label.
std::string m_pandoraLabel
The label of the Pandora pattern recognition producer.
std::string m_verbosityLevel
The level of verbosity to use.
TCEvent evt
Definition: DataStructs.cxx:7
void PrintPFParticleHierarchy(const PandoraData &data) const
Print the full PFParticle Hierarchy.
void lar_pandora::LArPandoraEventDump::BuildPFParticleMap ( const PandoraData data,
PFParticleMap pfParticleMap 
) const
private

Build the map from PFParticle ID to PFParticle from the input data.

Parameters
datathe pandora collections and associations
pfParticleMapthe output PFParticle map

Definition at line 396 of file LArPandoraEventDump_module.cc.

397 {
398  for (unsigned int i = 0; i < data.m_pfParticleCollection->size(); ++i)
399  {
400  const art::Ptr<recob::PFParticle> particle(data.m_pfParticleCollection, i);
401  pfParticleMap[particle->Self()] = particle;
402  }
403 }
LArPandoraEventDump& lar_pandora::LArPandoraEventDump::operator= ( LArPandoraEventDump const &  )
delete
LArPandoraEventDump& lar_pandora::LArPandoraEventDump::operator= ( LArPandoraEventDump &&  )
delete
void lar_pandora::LArPandoraEventDump::PrintCluster ( const art::Ptr< recob::Cluster > &  cluster,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given Cluster.

Parameters
clusterthe cluster to print
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 570 of file LArPandoraEventDump_module.cc.

571 {
572  this->PrintTitle("Cluster", depth);
573  this->PrintProperty("Key", cluster.key(), depth + 2);
574  this->PrintProperty("ID", cluster->ID(), depth + 2);
575  this->PrintProperty("View", cluster->View(), depth + 2);
576 
577  if (!data.m_pClusterToHitAssociation)
578  return;
579 
580  const auto &hits(data.m_pClusterToHitAssociation->at(cluster.key()));
581  this->PrintProperty("# Hits", hits.size(), depth + 2);
582 
583  if (m_verbosityLevel == "detailed")
584  return;
585 
586  // Print each associated hit
587  for (const auto &hit : hits)
588  this->PrintHit(hit, depth + 4);
589 }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
key_type key() const noexcept
Definition: Ptr.h:216
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
geo::View_t View() const
Returns the view for this cluster.
Definition: Cluster.h:741
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:738
std::string m_verbosityLevel
The level of verbosity to use.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
void lar_pandora::LArPandoraEventDump::PrintEventMetadata ( const art::Event evt) const
private

Print the metadata about the event.

Parameters
evtthe art event

Definition at line 300 of file LArPandoraEventDump_module.cc.

301 {
302  std::cout << std::string(80, '=') << std::endl;
303  std::cout << "run : " << evt.run() << std::endl;
304  std::cout << "subRun : " << evt.subRun() << std::endl;
305  std::cout << "event : " << evt.event() << std::endl;
306  std::cout << std::endl;
307 }
EventNumber_t event() const
Definition: DataViewImpl.cc:85
std::string string
Definition: nybbler.cc:12
SubRunNumber_t subRun() const
Definition: DataViewImpl.cc:78
RunNumber_t run() const
Definition: DataViewImpl.cc:71
QTextStream & endl(QTextStream &s)
void lar_pandora::LArPandoraEventDump::PrintEventSummary ( const PandoraData data) const
private

Print a summary of the event similar to the standard event dump.

Parameters
datathe pandora collections and associations

Definition at line 311 of file LArPandoraEventDump_module.cc.

312 {
313  std::cout << std::string(80, '-') << std::endl;
314  std::cout << "Collection sizes" << std::endl;
315  std::cout << std::string(80, '-') << std::endl;
316 
317  std::cout << "PFParticle : " << data.m_pfParticleCollection->size() << std::endl;
318  std::cout << "PFParticleMetadata : " << data.m_pfParticleMetadataCollection->size() << std::endl;
319  std::cout << "Cluster : " << data.m_clusterCollection->size() << std::endl;
320  std::cout << "SpacePoint : " << data.m_spacePointCollection->size() << std::endl;
321  std::cout << "Vertex : " << data.m_vertexCollection->size() << std::endl;
322  std::cout << "Track : " << data.m_trackCollection->size() << std::endl;
323  std::cout << "Shower : " << data.m_showerCollection->size() << std::endl;
324  std::cout << "PCAxis : " << data.m_pcAxisCollection->size() << std::endl;
325  std::cout << "Slice : " << data.m_sliceCollection->size() << std::endl;
326  std::cout << std::endl;
327 
328  std::cout << std::string(80, '-') << std::endl;
329  std::cout << "Association sizes" << std::endl;
330  std::cout << std::string(80, '-') << std::endl;
331 
332  if (data.m_pPFParticleToMetadataAssociation)
333  std::cout << "PFParticle -> Metadata : " << data.m_pPFParticleToMetadataAssociation->size() << std::endl;
334 
335  if (data.m_pPFParticleToClusterAssociation)
336  std::cout << "PFParticle -> Cluster : " << data.m_pPFParticleToClusterAssociation->size() << std::endl;
337 
338  if (data.m_pPFParticleToSpacePointAssociation)
339  std::cout << "PFParticle -> SpacePoint : " << data.m_pPFParticleToSpacePointAssociation->size() << std::endl;
340 
341  if (data.m_pPFParticleToVertexAssociation)
342  std::cout << "PFParticle -> Vertex : " << data.m_pPFParticleToVertexAssociation->size() << std::endl;
343 
344  if (data.m_pPFParticleToTrackAssociation)
345  std::cout << "PFParticle -> Track : " << data.m_pPFParticleToTrackAssociation->size() << std::endl;
346 
347  if (data.m_pPFParticleToShowerAssociation)
348  std::cout << "PFParticle -> Shower : " << data.m_pPFParticleToShowerAssociation->size() << std::endl;
349 
350  if (data.m_pPFParticleToSliceAssociation)
351  std::cout << "PFParticle -> Slice : " << data.m_pPFParticleToSliceAssociation->size() << std::endl;
352 
353  if (data.m_pClusterToHitAssociation)
354  std::cout << "Cluster -> Hit : " << data.m_pClusterToHitAssociation->size() << std::endl;
355 
356  if (data.m_pSpacePointToHitAssociation)
357  std::cout << "SpacePoint -> Hit : " << data.m_pSpacePointToHitAssociation->size() << std::endl;
358 
359  if (data.m_pTrackToHitAssociation)
360  std::cout << "Track -> Hit : " << data.m_pTrackToHitAssociation->size() << std::endl;
361 
362  if (data.m_pShowerToHitAssociation)
363  std::cout << "Shower -> Hit : " << data.m_pShowerToHitAssociation->size() << std::endl;
364 
365  if (data.m_pShowerToPCAxisAssociation)
366  std::cout << "Shower -> PCAxis : " << data.m_pShowerToPCAxisAssociation->size() << std::endl;
367 
368  if (data.m_pSliceToHitAssociation)
369  std::cout << "Slice -> Hit : " << data.m_pSliceToHitAssociation->size() << std::endl;
370 
371  std::cout << std::endl;
372 }
std::string string
Definition: nybbler.cc:12
QTextStream & endl(QTextStream &s)
void lar_pandora::LArPandoraEventDump::PrintHit ( const art::Ptr< recob::Hit > &  hit,
const unsigned int  depth 
) const
private

Print a given Hit.

Parameters
hitthe hit to print
depththe number of characters to indent

Definition at line 536 of file LArPandoraEventDump_module.cc.

537 {
538  this->PrintTitle("Hit", depth);
539  this->PrintProperty("Key", hit.key(), depth + 2);
540  this->PrintProperty("Channel", hit->Channel(), depth + 2);
541  this->PrintProperty("View", hit->View(), depth + 2);
542  this->PrintProperty("Peak time", hit->PeakTime(), depth + 2);
543  this->PrintProperty("RMS", hit->RMS(), depth + 2);
544 }
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:220
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:232
key_type key() const noexcept
Definition: Ptr.h:216
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
Definition: Hit.h:230
void lar_pandora::LArPandoraEventDump::PrintParticle ( const art::Ptr< recob::PFParticle > &  particle,
const PFParticleMap pfParticleMap,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given PFParticle.

Parameters
particlethe particle to print
pfParticleMapthe input mapping from PFParticle ID to PFParticle
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 407 of file LArPandoraEventDump_module.cc.

409 {
410  this->PrintRule(depth);
411  this->PrintTitle("PFParticle", depth);
412  this->PrintRule(depth);
413 
414  // Print the PFParticle details
415  this->PrintProperty("Key", particle.key(), depth);
416  this->PrintProperty("Id", particle->Self(), depth);
417  this->PrintProperty("PDG", particle->PdgCode(), depth);
418  this->PrintProperty("IsPrimary", particle->IsPrimary(), depth);
419 
420  if (!particle->IsPrimary())
421  this->PrintProperty("Parent", particle->Parent(), depth);
422 
423  // Print the metadata
424  if (data.m_pPFParticleToMetadataAssociation)
425  {
426  const auto &metadata(data.m_pPFParticleToMetadataAssociation->at(particle.key()));
427  this->PrintProperty("# Metadata", metadata.size(), depth);
428 
429  for (const auto &metadatum : metadata)
430  {
431  const auto &propertiesMap(metadatum->GetPropertiesMap());
432  this->PrintProperty("# Properties", propertiesMap.size(), depth + 2);
433 
434  for (const auto &propertiesMapEntry : propertiesMap)
435  this->PrintProperty(propertiesMapEntry.first, propertiesMapEntry.second, depth + 4);
436  }
437  }
438 
439  // Print the slices
440  if (data.m_pPFParticleToSliceAssociation)
441  {
442  const auto &slices(data.m_pPFParticleToSliceAssociation->at(particle.key()));
443  this->PrintProperty("# Slices", slices.size(), depth);
444 
445  if (m_verbosityLevel != "summary")
446  {
447  for (const auto &slice : slices)
448  this->PrintSlice(slice, data, depth + 2);
449  }
450 
451  }
452 
453  // Print the clusters
454  if (data.m_pPFParticleToClusterAssociation)
455  {
456  const auto &clusters(data.m_pPFParticleToClusterAssociation->at(particle.key()));
457  this->PrintProperty("# Clusters", clusters.size(), depth);
458 
459  if (m_verbosityLevel != "summary")
460  {
461  for (const auto &cluster : clusters)
462  this->PrintCluster(cluster, data, depth + 2);
463  }
464  }
465 
466  // Print the space points
467  if (data.m_pPFParticleToSpacePointAssociation)
468  {
469  const auto &spacePoints(data.m_pPFParticleToSpacePointAssociation->at(particle.key()));
470  this->PrintProperty("# SpacePoints", spacePoints.size(), depth);
471 
472  if (m_verbosityLevel != "summary")
473  {
474  for (const auto &spacePoint : spacePoints)
475  this->PrintSpacePoint(spacePoint, data, depth + 2);
476  }
477  }
478 
479  // Print the vertices
480  if (data.m_pPFParticleToVertexAssociation)
481  {
482  const auto &vertices(data.m_pPFParticleToVertexAssociation->at(particle.key()));
483  this->PrintProperty("# Vertices", vertices.size(), depth);
484 
485  if (m_verbosityLevel != "summary")
486  {
487  for (const auto &vertex : vertices)
488  this->PrintVertex(vertex, depth + 2);
489  }
490  }
491 
492  // Print the tracks
493  if (data.m_pPFParticleToTrackAssociation)
494  {
495  const auto &tracks(data.m_pPFParticleToTrackAssociation->at(particle.key()));
496  this->PrintProperty("# Tracks", tracks.size(), depth);
497 
498  if (m_verbosityLevel != "summary")
499  {
500  for (const auto &track : tracks)
501  this->PrintTrack(track, data, depth + 2);
502  }
503  }
504 
505  // Print the showers
506  if (data.m_pPFParticleToShowerAssociation)
507  {
508  const auto &showers(data.m_pPFParticleToShowerAssociation->at(particle.key()));
509  this->PrintProperty("# Showers", showers.size(), depth);
510 
511  if (m_verbosityLevel != "summary")
512  {
513  for (const auto &shower : showers)
514  this->PrintShower(shower, data, depth + 2);
515  }
516  }
517 
518  // Print the daughters
519  this->PrintProperty("# Daughters", particle->NumDaughters(), depth);
520  this->PrintRule(depth);
521 
522  for (auto &daughterId : particle->Daughters())
523  {
524  const auto daughterIter(pfParticleMap.find(daughterId));
525 
526  if (daughterIter == pfParticleMap.end())
527  throw cet::exception("LArPandoraEventDump") << "Couldn't find daughter of PFParticle in the PFParticle map";
528 
529  const auto &daughter(daughterIter->second);
530  this->PrintParticle(daughter, pfParticleMap, data, depth + 4);
531  }
532 }
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:114
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Definition: PFParticle.h:89
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
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.
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:83
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.
size_t Parent() const
Definition: PFParticle.h:96
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:216
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:86
std::vector< TCSlice > slices
Definition: DataStructs.cxx:12
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
Definition: tracks.py:1
void PrintSlice(const art::Ptr< recob::Slice > &slice, const PandoraData &data, const unsigned int depth) const
Print a given Slice.
std::string m_verbosityLevel
The level of verbosity to use.
void PrintCluster(const art::Ptr< recob::Cluster > &cluster, const PandoraData &data, const unsigned int depth) const
Print a given Cluster.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
vertex reconstruction
void lar_pandora::LArPandoraEventDump::PrintPFParticleHierarchy ( const PandoraData data) const
private

Print the full PFParticle Hierarchy.

Parameters
datathe pandora collections and associations

Definition at line 376 of file LArPandoraEventDump_module.cc.

377 {
378  // Get the mapping from PFParticle ID to PFParticle
379  PFParticleMap pfParticleMap;
380  this->BuildPFParticleMap(data, pfParticleMap);
381 
382  // Print all primary PFParticles
383  for (unsigned int i = 0; i < data.m_pfParticleCollection->size(); ++i)
384  {
385  const art::Ptr<recob::PFParticle> particle(data.m_pfParticleCollection, i);
386 
387  if (!particle->IsPrimary())
388  continue;
389 
390  this->PrintParticle(particle, pfParticleMap, data, 0);
391  }
392 }
void BuildPFParticleMap(const PandoraData &data, PFParticleMap &pfParticleMap) const
Build the map from PFParticle ID to PFParticle from the input data.
void PrintParticle(const art::Ptr< recob::PFParticle > &particle, const PFParticleMap &pfParticleMap, const PandoraData &data, const unsigned int depth) const
Print a given PFParticle.
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
template<class T >
void lar_pandora::LArPandoraEventDump::PrintProperty ( const std::string name,
const T &  value,
const unsigned int  depth 
) const
private

Print a given property with the correct amount of whitespace.

Parameters
namethe property name
valuethe property value
depththe number of characters to indent

Definition at line 714 of file LArPandoraEventDump_module.cc.

715 {
716  // The separation between the property name and property value
717  const unsigned int separation(std::max(0, 32 - static_cast<int>(depth)));
718 
719  std::cout << std::string(depth, ' ') << std::setw(separation) << std::left << ("- " + name) << value << std::endl;
720 }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
static int max(int a, int b)
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
QTextStream & endl(QTextStream &s)
void lar_pandora::LArPandoraEventDump::PrintRule ( const unsigned int  depth) const
private

Print a horizontal line.

Parameters
depththe number of characters to indent

Definition at line 696 of file LArPandoraEventDump_module.cc.

697 {
698  const unsigned int nDashes(std::max(0, 120 - static_cast<int>(depth)));
699 
700  std::cout << std::string(depth, ' ') << std::string(nDashes, '-') << std::endl;
701 }
std::string string
Definition: nybbler.cc:12
static int max(int a, int b)
QTextStream & endl(QTextStream &s)
void lar_pandora::LArPandoraEventDump::PrintShower ( const art::Ptr< recob::Shower > &  shower,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given Shower.

Parameters
showerthe shower to print
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 655 of file LArPandoraEventDump_module.cc.

656 {
657  this->PrintTitle("Shower", depth);
658  this->PrintProperty("Key", shower.key(), depth + 2);
659  this->PrintProperty("ID", shower->ID(), depth + 2);
660  this->PrintProperty("StartX", shower->ShowerStart().X(), depth + 2);
661  this->PrintProperty("StartY", shower->ShowerStart().Y(), depth + 2);
662  this->PrintProperty("StartZ", shower->ShowerStart().Z(), depth + 2);
663  this->PrintProperty("Length", shower->Length(), depth + 2);
664  this->PrintProperty("OpenAngle", shower->OpenAngle(), depth + 2);
665 
666  if (data.m_pShowerToPCAxisAssociation)
667  {
668  const auto &pcAxes(data.m_pShowerToPCAxisAssociation->at(shower.key()));
669  this->PrintProperty("# PCAxes", pcAxes.size(), depth + 2);
670 
671  for (const auto &pcAxis : pcAxes)
672  {
673  this->PrintTitle("PCAxis", depth + 4);
674  this->PrintProperty("Key", pcAxis.key(), depth + 6);
675  this->PrintProperty("ID", pcAxis->getID(), depth + 6);
676  this->PrintProperty("# Hits used", pcAxis->getNumHitsUsed(), depth + 6);
677  }
678  }
679 
680  if (!data.m_pShowerToHitAssociation)
681  return;
682 
683  const auto &hits(data.m_pShowerToHitAssociation->at(shower.key()));
684  this->PrintProperty("# Hits", hits.size(), depth + 2);
685 
686  if (m_verbosityLevel == "detailed")
687  return;
688 
689  // Print each associated hit
690  for (const auto &hit : hits)
691  this->PrintHit(hit, depth + 4);
692 }
const TVector3 & ShowerStart() const
Definition: Shower.h:192
double Length() const
Definition: Shower.h:201
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
key_type key() const noexcept
Definition: Ptr.h:216
double OpenAngle() const
Definition: Shower.h:202
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
std::string m_verbosityLevel
The level of verbosity to use.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
int ID() const
Definition: Shower.h:187
void lar_pandora::LArPandoraEventDump::PrintSlice ( const art::Ptr< recob::Slice > &  slice,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given Slice.

Parameters
slicethe slice to print
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 548 of file LArPandoraEventDump_module.cc.

549 {
550  this->PrintTitle("Slice", depth);
551  this->PrintProperty("Key", slice.key(), depth + 2);
552  this->PrintProperty("ID", slice->ID(), depth + 2);
553 
554  if (!data.m_pSliceToHitAssociation)
555  return;
556 
557  const auto &hits(data.m_pSliceToHitAssociation->at(slice.key()));
558  this->PrintProperty("# Hits", hits.size(), depth + 2);
559 
560  if (m_verbosityLevel != "extreme")
561  return;
562 
563  // Print each associated hit
564  for (const auto &hit : hits)
565  this->PrintHit(hit, depth + 4);
566 }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
key_type key() const noexcept
Definition: Ptr.h:216
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
int ID() const
Definition: Slice.h:29
std::string m_verbosityLevel
The level of verbosity to use.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
void lar_pandora::LArPandoraEventDump::PrintSpacePoint ( const art::Ptr< recob::SpacePoint > &  spacePoint,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given SpacePoint.

Parameters
spacePointthe spacePoint to print
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 593 of file LArPandoraEventDump_module.cc.

594 {
595  this->PrintTitle("SpacePoint", depth);
596  this->PrintProperty("Key", spacePoint.key(), depth + 2);
597  this->PrintProperty("ID", spacePoint->ID(), depth + 2);
598  const auto &position(spacePoint->XYZ());
599  this->PrintProperty("X", position[0], depth + 2);
600  this->PrintProperty("Y", position[1], depth + 2);
601  this->PrintProperty("Z", position[2], depth + 2);
602 
603  if (!data.m_pSpacePointToHitAssociation)
604  return;
605 
606  const auto &hits(data.m_pSpacePointToHitAssociation->at(spacePoint.key()));
607  this->PrintProperty("# Hits", hits.size(), depth + 2);
608 
609  if (m_verbosityLevel == "detailed")
610  return;
611 
612  // Print each associated hit
613  for (const auto &hit : hits)
614  this->PrintHit(hit, depth + 4);
615 }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
key_type key() const noexcept
Definition: Ptr.h:216
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
std::string m_verbosityLevel
The level of verbosity to use.
const Double32_t * XYZ() const
Definition: SpacePoint.h:76
ID_t ID() const
Definition: SpacePoint.h:75
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
void lar_pandora::LArPandoraEventDump::PrintTitle ( const std::string name,
const unsigned int  depth 
) const
private

Print a title line.

Parameters
namethe title name
depththe number of characters to indent

Definition at line 705 of file LArPandoraEventDump_module.cc.

706 {
707  std::cout << std::string(depth, ' ') << name << std::endl;
708 }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
QTextStream & endl(QTextStream &s)
void lar_pandora::LArPandoraEventDump::PrintTrack ( const art::Ptr< recob::Track > &  track,
const PandoraData data,
const unsigned int  depth 
) const
private

Print a given Track.

Parameters
trackthe track to print
datathe pandora collections and associations
depththe number of characters to indent

Definition at line 632 of file LArPandoraEventDump_module.cc.

633 {
634  this->PrintTitle("Track", depth);
635  this->PrintProperty("Key", track.key(), depth + 2);
636  this->PrintProperty("# Trajectory points", track->NumberTrajectoryPoints(), depth + 2);
637  this->PrintProperty("Length", track->Length(), depth + 2);
638 
639  if (!data.m_pTrackToHitAssociation)
640  return;
641 
642  const auto &hits(data.m_pTrackToHitAssociation->at(track.key()));
643  this->PrintProperty("# Hits", hits.size(), depth + 2);
644 
645  if (m_verbosityLevel == "detailed")
646  return;
647 
648  // Print each associated hit
649  for (const auto &hit : hits)
650  this->PrintHit(hit, depth + 4);
651 }
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
key_type key() const noexcept
Definition: Ptr.h:216
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
std::string m_verbosityLevel
The level of verbosity to use.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
void lar_pandora::LArPandoraEventDump::PrintVertex ( const art::Ptr< recob::Vertex > &  vertex,
const unsigned int  depth 
) const
private

Print a given Vertex.

Parameters
vertexthe vertex to print
depththe number of characters to indent

Definition at line 619 of file LArPandoraEventDump_module.cc.

620 {
621  this->PrintTitle("Vertex", depth);
622  this->PrintProperty("Key", vertex.key(), depth + 2);
623  this->PrintProperty("ID", vertex->ID(), depth + 2);
624  const auto &position(vertex->position());
625  this->PrintProperty("X", position.X(), depth + 2);
626  this->PrintProperty("Y", position.Y(), depth + 2);
627  this->PrintProperty("Z", position.Z(), depth + 2);
628 }
key_type key() const noexcept
Definition: Ptr.h:216
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
int ID() const
Return vertex id.
Definition: Vertex.h:99
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60

Member Data Documentation

std::string lar_pandora::LArPandoraEventDump::m_pandoraLabel
private

The label of the Pandora pattern recognition producer.

Definition at line 251 of file LArPandoraEventDump_module.cc.

std::string lar_pandora::LArPandoraEventDump::m_showerLabel
private

The shower producer label.

Definition at line 253 of file LArPandoraEventDump_module.cc.

std::string lar_pandora::LArPandoraEventDump::m_trackLabel
private

The track producer label.

Definition at line 252 of file LArPandoraEventDump_module.cc.

std::string lar_pandora::LArPandoraEventDump::m_verbosityLevel
private

The level of verbosity to use.

Definition at line 250 of file LArPandoraEventDump_module.cc.


The documentation for this class was generated from the following file: