LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_pandora::LArPandoraEventDump Class Reference
Inheritance diagram for lar_pandora::LArPandoraEventDump:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Classes

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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
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
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

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

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 266 of file LArPandoraEventDump_module.cc.

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

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 m_showerLabel
The shower producer label.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
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 286 of file LArPandoraEventDump_module.cc.

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

287 {
288  // Load the Pandora owned collections from the event
289  PandoraData data(evt, m_pandoraLabel, m_trackLabel, m_showerLabel);
290 
291  this->PrintEventMetadata(evt);
292  this->PrintEventSummary(data);
293 
294  if (m_verbosityLevel != "brief")
295  this->PrintPFParticleHierarchy(data);
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:5
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.

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

Referenced by PrintPFParticleHierarchy().

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 }
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

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

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
LArPandoraEventDump& lar_pandora::LArPandoraEventDump::operator= ( LArPandoraEventDump const &  )
delete
LArPandoraEventDump& lar_pandora::LArPandoraEventDump::operator= ( LArPandoraEventDump &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
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.

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

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

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

Referenced by analyze().

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 }
SubRunNumber_t subRun() const
Definition: Event.h:72
EventNumber_t event() const
Definition: Event.h:67
RunNumber_t run() const
Definition: Event.h:77
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.

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

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

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

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 }
key_type key() const
Definition: Ptr.h:356
float RMS() const
RMS of the hit shape, in tick units.
Definition: Hit.h:221
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:233
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:219
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:231
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.

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

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 }
key_type key() const
Definition: Ptr.h:356
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.
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:10
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:34
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.

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

Referenced by analyze().

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.

References art::left(), and max.

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

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 }
Int_t max
Definition: plot.C:27
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
std::string value(boost::any const &)
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.

References max.

Referenced by PrintParticle().

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 }
Int_t max
Definition: plot.C:27
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.

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

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 }
key_type key() const
Definition: Ptr.h:356
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.
void hits()
Definition: readHits.C:15
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.

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

Referenced by PrintParticle().

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 }
key_type key() const
Definition: Ptr.h:356
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
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:31
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.

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

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 }
key_type key() const
Definition: Ptr.h:356
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void hits()
Definition: readHits.C:15
const Double32_t * XYZ() const
Definition: SpacePoint.h:65
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:64
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 705 of file LArPandoraEventDump_module.cc.

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

706 {
707  std::cout << std::string(depth, ' ') << name << std::endl;
708 }
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.

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

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 }
key_type key() const
Definition: Ptr.h:356
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:105
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:170
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.

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

Referenced by PrintParticle().

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
Definition: Ptr.h:356
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
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

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.

Referenced by analyze().

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

The shower producer label.

Definition at line 253 of file LArPandoraEventDump_module.cc.

Referenced by analyze().

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

The track producer label.

Definition at line 252 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: