65 PandoraData(
const art::Event &evt,
const std::string &pandoraLabel,
const std::string &trackLabel =
"",
const std::string &showerLabel =
"");
119 template <
class T,
class U>
230 void PrintRule(
const unsigned int depth)
const;
238 void PrintTitle(
const std::string &name,
const unsigned int depth)
const;
248 void PrintProperty(
const std::string &name,
const T &
value,
const unsigned int depth)
const;
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;
313 std::cout << std::string(80,
'-') << std::endl;
314 std::cout <<
"Collection sizes" << std::endl;
315 std::cout << std::string(80,
'-') << std::endl;
326 std::cout << std::endl;
328 std::cout << std::string(80,
'-') << std::endl;
329 std::cout <<
"Association sizes" << std::endl;
330 std::cout << std::string(80,
'-') << std::endl;
371 std::cout << std::endl;
401 pfParticleMap[particle->
Self()] = particle;
408 const PandoraData &data,
const unsigned int depth)
const 429 for (
const auto &metadatum : metadata)
431 const auto &propertiesMap(metadatum->GetPropertiesMap());
432 this->
PrintProperty(
"# Properties", propertiesMap.size(), depth + 2);
434 for (
const auto &propertiesMapEntry : propertiesMap)
435 this->
PrintProperty(propertiesMapEntry.first, propertiesMapEntry.second, depth + 4);
447 for (
const auto &slice :
slices)
461 for (
const auto &
cluster : clusters)
470 this->
PrintProperty(
"# SpacePoints", spacePoints.size(), depth);
474 for (
const auto &spacePoint : spacePoints)
487 for (
const auto &
vertex : vertices)
500 for (
const auto &
track : tracks)
513 for (
const auto &
shower : showers)
522 for (
auto &daughterId : particle->
Daughters())
524 const auto daughterIter(pfParticleMap.find(daughterId));
526 if (daughterIter == pfParticleMap.end())
527 throw cet::exception(
"LArPandoraEventDump") <<
"Couldn't find daughter of PFParticle in the PFParticle map";
529 const auto &daughter(daughterIter->second);
530 this->
PrintParticle(daughter, pfParticleMap, data, depth + 4);
598 const auto &position(spacePoint->
XYZ());
624 const auto &position(vertex->
position());
671 for (
const auto &pcAxis : pcAxes)
676 this->
PrintProperty(
"# Hits used", pcAxis->getNumHitsUsed(), depth + 6);
698 const unsigned int nDashes(
std::max(0, 120 - static_cast<int>(depth)));
700 std::cout << std::string(depth,
' ') << std::string(nDashes,
'-') << std::endl;
707 std::cout << std::string(depth,
' ') << name << std::endl;
717 const unsigned int separation(
std::max(0, 32 - static_cast<int>(depth)));
719 std::cout << std::string(depth,
' ') << std::setw(separation) <<
std::left << (
"- " + name) << value << std::endl;
726 const std::string &showerLabel) :
727 m_pPFParticleToMetadataAssociation(nullptr),
728 m_pPFParticleToClusterAssociation(nullptr),
729 m_pPFParticleToSpacePointAssociation(nullptr),
730 m_pPFParticleToVertexAssociation(nullptr),
731 m_pPFParticleToTrackAssociation(nullptr),
732 m_pPFParticleToShowerAssociation(nullptr),
733 m_pPFParticleToSliceAssociation(nullptr),
734 m_pClusterToHitAssociation(nullptr),
735 m_pSpacePointToHitAssociation(nullptr),
736 m_pTrackToHitAssociation(nullptr),
737 m_pShowerToHitAssociation(nullptr),
738 m_pSliceToHitAssociation(nullptr),
739 m_pShowerToPCAxisAssociation(nullptr)
804 template <
class T,
class U>
811 throw cet::exception(
"LArPandoraEventDump") <<
"Association supplied type has already been loaded!";
void BuildPFParticleMap(const PandoraData &data, PFParticleMap &pfParticleMap) const
Build the map from PFParticle ID to PFParticle from the input data.
Association< recob::Slice > * m_pPFParticleToSliceAssociation
The PFParticle to slice association.
void PrintRule(const unsigned int depth) const
Print a horizontal line.
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
SubRunNumber_t subRun() const
const TVector3 & ShowerStart() const
std::string m_trackLabel
The track producer label.
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Association< recob::Hit > * m_pClusterToHitAssociation
The Cluster to hit association.
Collection< recob::Cluster > m_clusterCollection
The Cluster handle.
size_t Self() const
Returns the index of this particle.
void PrintEventMetadata(const art::Event &evt) const
Print the metadata about the event.
float RMS() const
RMS of the hit shape, in tick units.
LArPandoraEventDump(fhicl::ParameterSet const &pset)
Association< recob::PCAxis > * m_pShowerToPCAxisAssociation
The Shower to PCAxis association.
Declaration of signal hit object.
Collection< recob::SpacePoint > m_spacePointCollection
The SpacePoint handle.
Association< recob::Hit > * m_pSliceToHitAssociation
The Slice to hit association.
void PrintShower(const art::Ptr< recob::Shower > &shower, const PandoraData &data, const unsigned int depth) const
Print a given Shower.
void PrintVertex(const art::Ptr< recob::Vertex > &vertex, const unsigned int depth) const
Print a given Vertex.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
LArPandoraEventDump & operator=(LArPandoraEventDump const &)=delete
int PdgCode() const
Return the type of particle as a PDG ID.
geo::View_t View() const
View for the plane of the hit.
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.
void PrintHit(const art::Ptr< recob::Hit > &hit, const unsigned int depth) const
Print a given Hit.
void PrintEventSummary(const PandoraData &data) const
Print a summary of the event similar to the standard event dump.
Association< recob::Shower > * m_pPFParticleToShowerAssociation
The PFParticle to shower association.
void LoadAssociation(const art::Event &evt, const std::string &label, const Collection< T > &collection, Association< U > *&pAssociation)
Load an association from the event.
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
Association< recob::Cluster > * m_pPFParticleToClusterAssociation
The PFParticle to cluster association.
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
Provides recob::Track data product.
Collection< recob::PCAxis > m_pcAxisCollection
The PCAxis handle.
std::string m_showerLabel
The shower producer label.
void PrintTrack(const art::Ptr< recob::Track > &track, const PandoraData &data, const unsigned int depth) const
Print a given Track.
T get(std::string const &key) const
~PandoraData()
Default destructor.
Collection< recob::Slice > m_sliceCollection
The Slice handle.
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.
const Double32_t * XYZ() const
EventNumber_t event() const
Association< recob::Track > * m_pPFParticleToTrackAssociation
The PFParticle to track association.
EDAnalyzer(Table< Config > const &config)
Collection< recob::Vertex > m_vertexCollection
The Vertex handle.
Declaration of cluster object.
std::string m_pandoraLabel
The label of the Pandora pattern recognition producer.
Association< larpandoraobj::PFParticleMetadata > * m_pPFParticleToMetadataAssociation
The PFParticle to metadata association.
Collection< recob::Shower > m_showerCollection
The Shower handle.
std::vector< TCSlice > slices
Detector simulation of raw signals on wires.
void PrintTitle(const std::string &name, const unsigned int depth) const
Print a title line.
void analyze(art::Event const &evt) override
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
geo::View_t View() const
Returns the view for this cluster.
float PeakTime() const
Time of the signal peak, in tick units.
std::string value(boost::any const &)
Utility object to perform functions of association.
Association< recob::SpacePoint > * m_pPFParticleToSpacePointAssociation
The PFParticle to space point association.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
ID_t ID() const
Identifier of this cluster.
int ID() const
Return vertex id.
void PrintSlice(const art::Ptr< recob::Slice > &slice, const PandoraData &data, const unsigned int depth) const
Print a given Slice.
Association< recob::Hit > * m_pSpacePointToHitAssociation
The SpacePoint to hit association.
Association< recob::Hit > * m_pShowerToHitAssociation
The Shower to hit association.
std::string m_verbosityLevel
The level of verbosity to use.
void LoadCollection(const art::Event &evt, const std::string &label, Collection< T > &collection)
Load a collection from the event.
void PrintCluster(const art::Ptr< recob::Cluster > &cluster, const PandoraData &data, const unsigned int depth) const
Print a given Cluster.
Collection< recob::PFParticle > m_pfParticleCollection
The PFParticle handle.
PandoraData(const art::Event &evt, const std::string &pandoraLabel, const std::string &trackLabel="", const std::string &showerLabel="")
Default constructor.
Collection< larpandoraobj::PFParticleMetadata > m_pfParticleMetadataCollection
The PFParticleMetadata handle.
void PrintPFParticleHierarchy(const PandoraData &data) const
Print the full PFParticle Hierarchy.
Association< recob::Vertex > * m_pPFParticleToVertexAssociation
The PFParticle to vertex association.
void PrintProperty(const std::string &name, const T &value, const unsigned int depth) const
Print a given property with the correct amount of whitespace.
Class holding the handle for all of the data types from Pandora.
helper function for LArPandoraInterface producer module
raw::ChannelID_t Channel() const
ID of the readout channel the hit was extracted from.
const Point_t & position() const
Return vertex 3D position.
cet::coded_exception< error, detail::translate > exception
Association< recob::Hit > * m_pTrackToHitAssociation
The Track to hit association.
Collection< recob::Track > m_trackCollection
The Track handle.