LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 Types

using ModuleType = EDAnalyzer
 

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
 
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)
 
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)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
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 ()
 

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...
 

Detailed Description

Definition at line 31 of file LArPandoraEventDump_module.cc.

Member Typedef Documentation

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

Definition at line 47 of file LArPandoraEventDump_module.cc.

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

Definition at line 44 of file LArPandoraEventDump_module.cc.

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 292 of file LArPandoraEventDump_module.cc.

References fhicl::ParameterSet::get(), and m_verbosityLevel.

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  }
std::string m_trackLabel
The track producer label.
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.cc:6
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
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 311 of file LArPandoraEventDump_module.cc.

References m_pandoraLabel, m_showerLabel, m_trackLabel, m_verbosityLevel, PrintEventMetadata(), PrintEventSummary(), and PrintPFParticleHierarchy().

312  {
313  // Load the Pandora owned collections from the event
314  PandoraData data(evt, m_pandoraLabel, m_trackLabel, m_showerLabel);
315 
316  this->PrintEventMetadata(evt);
317  this->PrintEventSummary(data);
318 
319  if (m_verbosityLevel != "brief") this->PrintPFParticleHierarchy(data);
320  }
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:8
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 432 of file LArPandoraEventDump_module.cc.

References lar_pandora::LArPandoraEventDump::PandoraData::m_pfParticleCollection, and recob::PFParticle::Self().

Referenced by PrintPFParticleHierarchy().

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  }
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::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 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
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 593 of file LArPandoraEventDump_module.cc.

References hits(), recob::Cluster::ID(), art::Ptr< T >::key(), lar_pandora::LArPandoraEventDump::PandoraData::m_pClusterToHitAssociation, m_verbosityLevel, PrintHit(), PrintProperty(), PrintTitle(), and recob::Cluster::View().

Referenced by PrintParticle().

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  }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
key_type key() const noexcept
Definition: Ptr.h:166
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:714
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:711
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 324 of file LArPandoraEventDump_module.cc.

References art::Event::event(), art::Event::run(), and art::Event::subRun().

Referenced by analyze().

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  }
SubRunNumber_t subRun() const
Definition: Event.cc:35
EventNumber_t event() const
Definition: Event.cc:41
RunNumber_t run() const
Definition: Event.cc:29
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 335 of file LArPandoraEventDump_module.cc.

References lar_pandora::LArPandoraEventDump::PandoraData::m_clusterCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_pcAxisCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_pClusterToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pfParticleCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_pfParticleMetadataCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToClusterAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToMetadataAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToShowerAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToSliceAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToSpacePointAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToTrackAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToVertexAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pShowerToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pShowerToPCAxisAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pSliceToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pSpacePointToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pTrackToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_showerCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_sliceCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_spacePointCollection, lar_pandora::LArPandoraEventDump::PandoraData::m_trackCollection, and lar_pandora::LArPandoraEventDump::PandoraData::m_vertexCollection.

Referenced by analyze().

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 
357  if (data.m_pPFParticleToMetadataAssociation)
358  std::cout << "PFParticle -> Metadata : " << data.m_pPFParticleToMetadataAssociation->size()
359  << std::endl;
360 
361  if (data.m_pPFParticleToClusterAssociation)
362  std::cout << "PFParticle -> Cluster : " << data.m_pPFParticleToClusterAssociation->size()
363  << std::endl;
364 
365  if (data.m_pPFParticleToSpacePointAssociation)
366  std::cout << "PFParticle -> SpacePoint : "
367  << data.m_pPFParticleToSpacePointAssociation->size() << std::endl;
368 
369  if (data.m_pPFParticleToVertexAssociation)
370  std::cout << "PFParticle -> Vertex : " << data.m_pPFParticleToVertexAssociation->size()
371  << std::endl;
372 
373  if (data.m_pPFParticleToTrackAssociation)
374  std::cout << "PFParticle -> Track : " << data.m_pPFParticleToTrackAssociation->size()
375  << std::endl;
376 
377  if (data.m_pPFParticleToShowerAssociation)
378  std::cout << "PFParticle -> Shower : " << data.m_pPFParticleToShowerAssociation->size()
379  << std::endl;
380 
381  if (data.m_pPFParticleToSliceAssociation)
382  std::cout << "PFParticle -> Slice : " << data.m_pPFParticleToSliceAssociation->size()
383  << std::endl;
384 
385  if (data.m_pClusterToHitAssociation)
386  std::cout << "Cluster -> Hit : " << data.m_pClusterToHitAssociation->size()
387  << std::endl;
388 
389  if (data.m_pSpacePointToHitAssociation)
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 
401  if (data.m_pShowerToPCAxisAssociation)
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  }
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 558 of file LArPandoraEventDump_module.cc.

References recob::Hit::Channel(), art::Ptr< T >::key(), recob::Hit::PeakTime(), PrintProperty(), PrintTitle(), recob::Hit::RMS(), and recob::Hit::View().

Referenced by PrintCluster(), PrintShower(), PrintSlice(), PrintSpacePoint(), and PrintTrack().

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  }
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:228
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:276
key_type key() const noexcept
Definition: Ptr.h:166
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:220
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:268
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 443 of file LArPandoraEventDump_module.cc.

References recob::PFParticle::Daughters(), recob::PFParticle::IsPrimary(), art::Ptr< T >::key(), lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToClusterAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToMetadataAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToShowerAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToSliceAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToSpacePointAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToTrackAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pPFParticleToVertexAssociation, m_verbosityLevel, recob::PFParticle::NumDaughters(), recob::PFParticle::Parent(), recob::PFParticle::PdgCode(), PrintCluster(), PrintProperty(), PrintRule(), PrintShower(), PrintSlice(), PrintSpacePoint(), PrintTitle(), PrintTrack(), PrintVertex(), recob::PFParticle::Self(), tca::slices, and track.

Referenced by PrintPFParticleHierarchy().

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
461  if (data.m_pPFParticleToMetadataAssociation) {
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
475  if (data.m_pPFParticleToSliceAssociation) {
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
486  if (data.m_pPFParticleToClusterAssociation) {
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
497  if (data.m_pPFParticleToSpacePointAssociation) {
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
508  if (data.m_pPFParticleToVertexAssociation) {
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
519  if (data.m_pPFParticleToTrackAssociation) {
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
530  if (data.m_pPFParticleToShowerAssociation) {
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  }
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
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Definition: PFParticle.h:85
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
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:79
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:92
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
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
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
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.
Float_t track
Definition: plot.C:35
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 414 of file LArPandoraEventDump_module.cc.

References BuildPFParticleMap(), recob::PFParticle::IsPrimary(), lar_pandora::LArPandoraEventDump::PandoraData::m_pfParticleCollection, and PrintParticle().

Referenced by analyze().

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  }
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 735 of file LArPandoraEventDump_module.cc.

References art::left().

Referenced by PrintCluster(), PrintHit(), PrintParticle(), PrintShower(), PrintSlice(), PrintSpacePoint(), PrintTrack(), and PrintVertex().

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  }
double value
Definition: spectrum.C:18
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:94
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 718 of file LArPandoraEventDump_module.cc.

Referenced by PrintParticle().

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  }
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 679 of file LArPandoraEventDump_module.cc.

References hits(), recob::Shower::ID(), art::Ptr< T >::key(), recob::Shower::Length(), lar_pandora::LArPandoraEventDump::PandoraData::m_pShowerToHitAssociation, lar_pandora::LArPandoraEventDump::PandoraData::m_pShowerToPCAxisAssociation, m_verbosityLevel, recob::Shower::OpenAngle(), PrintHit(), PrintProperty(), PrintTitle(), and recob::Shower::ShowerStart().

Referenced by PrintParticle().

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  }
const TVector3 & ShowerStart() const
Definition: Shower.h:197
double Length() const
Definition: Shower.h:227
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
key_type key() const noexcept
Definition: Ptr.h:166
double OpenAngle() const
Definition: Shower.h:231
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:183
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 571 of file LArPandoraEventDump_module.cc.

References hits(), recob::Slice::ID(), art::Ptr< T >::key(), lar_pandora::LArPandoraEventDump::PandoraData::m_pSliceToHitAssociation, m_verbosityLevel, PrintHit(), PrintProperty(), and PrintTitle().

Referenced by PrintParticle().

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  }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
key_type key() const noexcept
Definition: Ptr.h:166
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:40
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 616 of file LArPandoraEventDump_module.cc.

References hits(), recob::SpacePoint::ID(), art::Ptr< T >::key(), lar_pandora::LArPandoraEventDump::PandoraData::m_pSpacePointToHitAssociation, m_verbosityLevel, PrintHit(), PrintProperty(), PrintTitle(), and recob::SpacePoint::XYZ().

Referenced by PrintParticle().

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  }
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
key_type key() const noexcept
Definition: Ptr.h:166
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
ID_t ID() const
Definition: SpacePoint.h:74
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::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 727 of file LArPandoraEventDump_module.cc.

Referenced by PrintCluster(), PrintHit(), PrintParticle(), PrintShower(), PrintSlice(), PrintSpacePoint(), PrintTrack(), and PrintVertex().

728  {
729  std::cout << std::string(depth, ' ') << name << std::endl;
730  }
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 656 of file LArPandoraEventDump_module.cc.

References hits(), art::Ptr< T >::key(), recob::Track::Length(), lar_pandora::LArPandoraEventDump::PandoraData::m_pTrackToHitAssociation, m_verbosityLevel, recob::Track::NumberTrajectoryPoints(), PrintHit(), PrintProperty(), and PrintTitle().

Referenced by PrintParticle().

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  }
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:136
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:207
key_type key() const noexcept
Definition: Ptr.h:166
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 642 of file LArPandoraEventDump_module.cc.

References recob::Vertex::ID(), art::Ptr< T >::key(), recob::Vertex::position(), PrintProperty(), and PrintTitle().

Referenced by PrintParticle().

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  }
key_type key() const noexcept
Definition: Ptr.h:166
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
int ID() const
Return vertex id.
Definition: Vertex.h:101
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:64
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

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

The label of the Pandora pattern recognition producer.

Definition at line 278 of file LArPandoraEventDump_module.cc.

Referenced by analyze().

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

The shower producer label.

Definition at line 280 of file LArPandoraEventDump_module.cc.

Referenced by analyze().

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

The track producer label.

Definition at line 279 of file LArPandoraEventDump_module.cc.

Referenced by analyze().

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

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