LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
LArPandoraEvent class. More...
#include "LArPandoraEvent.h"
Classes | |
class | Labels |
Class to handle the required producer labels. More... | |
Public Member Functions | |
LArPandoraEvent (art::EDProducer *pProducer, art::Event *pEvent, const Labels &inputLabels, const bool shouldProduceT0s=false) | |
Constructor from an art::Event. More... | |
LArPandoraEvent (const LArPandoraEvent &event, const PFParticleVector &selectedPFParticles) | |
Construct by copying an existing LArPandoraEvent, replacing the collections and associations by any objects associated with a PFParticle in the selection supplied. More... | |
void | WriteToEvent () const |
Write (put) the collections in this LArPandoraEvent to the art::Event. More... | |
Private Member Functions | |
void | GetCollections () |
Get the collections and associations from m_pEvent with the required labels. More... | |
template<typename T > | |
void | GetCollection (const Labels::LabelType &inputLabel, Collection< T > &outputCollection) const |
Gets a given collection from m_pEvent with the label supplied. More... | |
template<typename L , typename R , typename D > | |
void | GetAssociationMap (const Collection< L > &collectionL, const Labels::LabelType &inputLabel, Association< L, R, D > &outputAssociationMap) const |
Get the mapping between two collections with metadata using the specified label. More... | |
template<typename L , typename R > | |
void | GetAssociationMap (const Collection< L > &collectionL, const Labels::LabelType &inputLabel, Association< L, R, void * > &outputAssociationMap) const |
Get the mapping between two collections with metadata using the specified label. More... | |
template<typename L , typename R , typename D > | |
void | CollectAssociated (const art::Ptr< L > &anObject, const Association< L, R, D > &associationLtoR, Collection< R > &associatedR) const |
Collects all objects of type R with metadata D associated to a given object of type L. More... | |
template<typename L , typename R , typename D > | |
void | GetFilteredAssociationMap (const Collection< L > &collectionL, const Collection< R > &collectionR, const Association< L, R, D > &inputAssociationLtoR, Association< L, R, D > &outputAssociationLtoR) const |
Gets the filtered mapping from objects in collectionL to objects that also exist in collectionR using a "superset" input association. More... | |
template<typename T > | |
void | WriteCollection (const Collection< T > &collection) const |
Write a given collection to the event. More... | |
template<typename L , typename R , typename D > | |
void | WriteAssociation (const Association< L, R, D > &associationMap, const Collection< L > &collectionL, const Collection< R > &collectionR, const bool thisProducesR=true) const |
Write a given association to the event. More... | |
template<typename L , typename R > | |
void | WriteAssociation (const Association< L, R, void * > &associationMap, const Collection< L > &collectionL, const Collection< R > &collectionR, const bool thisProducesR=true) const |
Write a given association to the event. More... | |
template<typename T > | |
size_t | GetIndex (const art::Ptr< T > object, const Collection< T > &collection) const |
Get the index of an objet in a given collection. More... | |
Private Attributes | |
art::EDProducer * | m_pProducer |
The producer which should write the output collections and associations. More... | |
art::Event * | m_pEvent |
The event to consider. More... | |
Labels | m_labels |
A set of labels describing the producers for each input collection. More... | |
bool | m_shouldProduceT0s |
If T0s should be produced (usually only true for use cases with multiple drift volumes) More... | |
PFParticleCollection | m_pfParticles |
The input collection of PFParticles. More... | |
SpacePointCollection | m_spacePoints |
The input collection of SpacePoints. More... | |
ClusterCollection | m_clusters |
The input collection of Clusters. More... | |
VertexCollection | m_vertices |
The input collection of Vertices. More... | |
SliceCollection | m_slices |
The input collection of Slices. More... | |
TrackCollection | m_tracks |
The input collection of Tracks. More... | |
ShowerCollection | m_showers |
The input collection of Showers. More... | |
T0Collection | m_t0s |
The input collection of T0s. More... | |
PFParticleMetadataCollection | m_metadata |
The input collection of PFParticle metadata. More... | |
PCAxisCollection | m_pcAxes |
The input collection of PCAxes. More... | |
HitCollection | m_hits |
The input collection of Hits. More... | |
PFParticleToSpacePointAssoc | m_pfParticleSpacePointMap |
The input associations: PFParticle -> SpacePoint. More... | |
PFParticleToClusterAssoc | m_pfParticleClusterMap |
The input associations: PFParticle -> Cluster. More... | |
PFParticleToVertexAssoc | m_pfParticleVertexMap |
The input associations: PFParticle -> Vertex. More... | |
PFParticleToSliceAssoc | m_pfParticleSliceMap |
The input associations: PFParticle -> Slice. More... | |
PFParticleToTrackAssoc | m_pfParticleTrackMap |
The input associations: PFParticle -> Track. More... | |
PFParticleToShowerAssoc | m_pfParticleShowerMap |
The input associations: PFParticle -> Shower. More... | |
PFParticleToT0Assoc | m_pfParticleT0Map |
The input associations: PFParticle -> T0. More... | |
PFParticleToPFParticleMetadataAssoc | m_pfParticleMetadataMap |
The input associations: PFParticle -> Metadata. More... | |
PFParticleToPCAxisAssoc | m_pfParticlePCAxisMap |
The input associations: PFParticle -> PCAxis. More... | |
SpacePointToHitAssoc | m_spacePointHitMap |
The input associations: SpacePoint -> Hit. More... | |
ClusterToHitAssoc | m_clusterHitMap |
The input associations: Cluster -> Hit. More... | |
SliceToHitAssoc | m_sliceHitMap |
The input associations: Slice -> Hit. More... | |
TrackToHitAssoc | m_trackHitMap |
The input associations: Track -> Hit. More... | |
ShowerToHitAssoc | m_showerHitMap |
The input associations: Shower -> Hit. More... | |
ShowerToPCAxisAssoc | m_showerPCAxisMap |
The input associations: PCAxis -> Shower. More... | |
LArPandoraEvent class.
Definition at line 45 of file LArPandoraEvent.h.
using lar_pandora::LArPandoraEvent::Association = std::map<art::Ptr<L>, PairVector<R, D>> |
General purpose short-hand with optional D parameter.
Definition at line 60 of file LArPandoraEvent.h.
Definition at line 65 of file LArPandoraEvent.h.
typedef Association<recob::Cluster, recob::Hit, void*> lar_pandora::LArPandoraEvent::ClusterToHitAssoc |
Definition at line 87 of file LArPandoraEvent.h.
using lar_pandora::LArPandoraEvent::Collection = std::vector<art::Ptr<T>> |
Shorthand for a collection of objects of type T.
Definition at line 51 of file LArPandoraEvent.h.
Definition at line 63 of file LArPandoraEvent.h.
using lar_pandora::LArPandoraEvent::PairVector = std::vector<std::pair<art::Ptr<R>, D>> |
Definition at line 54 of file LArPandoraEvent.h.
Definition at line 71 of file LArPandoraEvent.h.
Definition at line 64 of file LArPandoraEvent.h.
typedef Collection<larpandoraobj::PFParticleMetadata> lar_pandora::LArPandoraEvent::PFParticleMetadataCollection |
Definition at line 72 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::Cluster, void*> lar_pandora::LArPandoraEvent::PFParticleToClusterAssoc |
Definition at line 76 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::PCAxis, void*> lar_pandora::LArPandoraEvent::PFParticleToPCAxisAssoc |
Definition at line 82 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, larpandoraobj::PFParticleMetadata, void*> lar_pandora::LArPandoraEvent::PFParticleToPFParticleMetadataAssoc |
Definition at line 84 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::Shower, void*> lar_pandora::LArPandoraEvent::PFParticleToShowerAssoc |
Definition at line 81 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::Slice, void*> lar_pandora::LArPandoraEvent::PFParticleToSliceAssoc |
Definition at line 79 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::SpacePoint, void*> lar_pandora::LArPandoraEvent::PFParticleToSpacePointAssoc |
Definition at line 77 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, anab::T0, void*> lar_pandora::LArPandoraEvent::PFParticleToT0Assoc |
Definition at line 85 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::Track, void*> lar_pandora::LArPandoraEvent::PFParticleToTrackAssoc |
Definition at line 80 of file LArPandoraEvent.h.
typedef Association<recob::PFParticle, recob::Vertex, void*> lar_pandora::LArPandoraEvent::PFParticleToVertexAssoc |
Definition at line 78 of file LArPandoraEvent.h.
Definition at line 70 of file LArPandoraEvent.h.
typedef Association<recob::Shower, recob::Hit, void*> lar_pandora::LArPandoraEvent::ShowerToHitAssoc |
Definition at line 91 of file LArPandoraEvent.h.
typedef Association<recob::Shower, recob::PCAxis, void*> lar_pandora::LArPandoraEvent::ShowerToPCAxisAssoc |
Definition at line 92 of file LArPandoraEvent.h.
Definition at line 68 of file LArPandoraEvent.h.
typedef Association<recob::Slice, recob::Hit, void*> lar_pandora::LArPandoraEvent::SliceToHitAssoc |
Definition at line 89 of file LArPandoraEvent.h.
Definition at line 66 of file LArPandoraEvent.h.
typedef Association<recob::SpacePoint, recob::Hit, void*> lar_pandora::LArPandoraEvent::SpacePointToHitAssoc |
Definition at line 88 of file LArPandoraEvent.h.
Definition at line 73 of file LArPandoraEvent.h.
Definition at line 69 of file LArPandoraEvent.h.
typedef Association<recob::Track, recob::Hit, recob::TrackHitMeta> lar_pandora::LArPandoraEvent::TrackToHitAssoc |
Definition at line 90 of file LArPandoraEvent.h.
Definition at line 67 of file LArPandoraEvent.h.
lar_pandora::LArPandoraEvent::LArPandoraEvent | ( | art::EDProducer * | pProducer, |
art::Event * | pEvent, | ||
const Labels & | inputLabels, | ||
const bool | shouldProduceT0s = false |
||
) |
Constructor from an art::Event.
pProducer | pointer to the producer to write the output |
pEvent | pointer to the event to process |
inputLabel | labels for the producers of the input collections |
shouldProduceT0s | if T0s should be produced (usually only for multiple drift volume use cases) |
Definition at line 11 of file LArPandoraEvent.cxx.
References GetCollections().
lar_pandora::LArPandoraEvent::LArPandoraEvent | ( | const LArPandoraEvent & | event, |
const PFParticleVector & | selectedPFParticles | ||
) |
Construct by copying an existing LArPandoraEvent, replacing the collections and associations by any objects associated with a PFParticle in the selection supplied.
event | input event to copy and filter |
pfParticleVector | input vector of selected particles |
Definition at line 25 of file LArPandoraEvent.cxx.
References CollectAssociated(), GetFilteredAssociationMap(), m_clusterHitMap, m_clusters, m_hits, m_metadata, m_pcAxes, m_pfParticleClusterMap, m_pfParticleMetadataMap, m_pfParticlePCAxisMap, m_pfParticles, m_pfParticleShowerMap, m_pfParticleSliceMap, m_pfParticleSpacePointMap, m_pfParticleT0Map, m_pfParticleTrackMap, m_pfParticleVertexMap, m_shouldProduceT0s, m_showerHitMap, m_showerPCAxisMap, m_showers, m_sliceHitMap, m_slices, m_spacePointHitMap, m_spacePoints, m_t0s, m_trackHitMap, m_tracks, m_vertices, and part.
|
inlineprivate |
Collects all objects of type R with metadata D associated to a given object of type L.
anObject | an input object of type L with which we want to collect associated objects of type R with metadata D |
associationLtoR | the general input association between objects of type L and R |
associatedR | output vector of objects of type R associated with anObject |
Definition at line 425 of file LArPandoraEvent.h.
Referenced by LArPandoraEvent().
|
inlineprivate |
Get the mapping between two collections with metadata using the specified label.
collectionL | the collection from which the associations should be retrieved |
inputLabel | a label for the producer of the association required |
outputAssociationMap | output mapping between the two data types supplied (L -> R + D) |
Definition at line 368 of file LArPandoraEvent.h.
Referenced by GetCollections().
|
inlineprivate |
Get the mapping between two collections with metadata using the specified label.
collectionL | the collection from which the associations should be retrieved |
inputLabel | a label for the producer of the association required |
outputAssociationMap | output mapping between the two data types supplied (L -> R no metadata) |
Definition at line 396 of file LArPandoraEvent.h.
|
inlineprivate |
Gets a given collection from m_pEvent with the label supplied.
inputLabel | a label for the producer of the collection required |
outputCollection | the required collection |
Definition at line 356 of file LArPandoraEvent.h.
Referenced by GetCollections().
|
private |
Get the collections and associations from m_pEvent with the required labels.
Definition at line 118 of file LArPandoraEvent.cxx.
References lar_pandora::LArPandoraEvent::Labels::ClusterLabel, lar_pandora::LArPandoraEvent::Labels::ClusterToHitLabel, GetAssociationMap(), GetCollection(), lar_pandora::LArPandoraEvent::Labels::HitLabel, m_clusterHitMap, m_clusters, m_hits, m_metadata, m_pcAxes, m_pfParticleClusterMap, m_pfParticleMetadataMap, m_pfParticlePCAxisMap, m_pfParticles, m_pfParticleShowerMap, m_pfParticleSliceMap, m_pfParticleSpacePointMap, m_pfParticleT0Map, m_pfParticleTrackMap, m_pfParticleVertexMap, m_shouldProduceT0s, m_showerHitMap, m_showerPCAxisMap, m_showers, m_sliceHitMap, m_slices, m_spacePointHitMap, m_spacePoints, m_t0s, m_trackHitMap, m_tracks, m_vertices, lar_pandora::LArPandoraEvent::Labels::PCAxisLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleMetadataLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToClusterLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToMetadataLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToPCAxisLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToShowerLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToSliceLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToSpacePointLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToT0Label, lar_pandora::LArPandoraEvent::Labels::PFParticleToTrackLabel, lar_pandora::LArPandoraEvent::Labels::PFParticleToVertexLabel, lar_pandora::LArPandoraEvent::Labels::ShowerLabel, lar_pandora::LArPandoraEvent::Labels::ShowerToHitLabel, lar_pandora::LArPandoraEvent::Labels::ShowerToPCAxisLabel, lar_pandora::LArPandoraEvent::Labels::SliceLabel, lar_pandora::LArPandoraEvent::Labels::SliceToHitLabel, lar_pandora::LArPandoraEvent::Labels::SpacePointLabel, lar_pandora::LArPandoraEvent::Labels::SpacePointToHitLabel, lar_pandora::LArPandoraEvent::Labels::T0Label, lar_pandora::LArPandoraEvent::Labels::TrackLabel, lar_pandora::LArPandoraEvent::Labels::TrackToHitLabel, and lar_pandora::LArPandoraEvent::Labels::VertexLabel.
Referenced by LArPandoraEvent().
|
inlineprivate |
Gets the filtered mapping from objects in collectionL to objects that also exist in collectionR using a "superset" input association.
collectionL | a first filtered collection |
collectionR | a second filtered collection |
inputAssociationLtoR | mapping between the two unfiltered collections |
outputAssociationLtoR | mapping between the two filtered collections |
Definition at line 444 of file LArPandoraEvent.h.
Referenced by LArPandoraEvent().
|
inlineprivate |
Get the index of an objet in a given collection.
object | the object to search for |
collection | the collection to search through |
Definition at line 562 of file LArPandoraEvent.h.
|
inlineprivate |
Write a given association to the event.
associationMap | the association to write from objects of type L -> R + D |
collectionL | the collection of type L that has been written |
collectionR | the collection of type R that has been written |
thisProducesR | will this producer produce collectionR of was it produced by a different module? |
Definition at line 487 of file LArPandoraEvent.h.
Referenced by WriteToEvent().
|
inlineprivate |
Write a given association to the event.
associationMap | the association to write from objects of type L -> R (no metadata) |
collectionL | the collection of type L that has been written |
collectionR | the collection of type R that has been written |
thisProducesR | will this producer produce collectionR of was it produced by a different module? |
Definition at line 525 of file LArPandoraEvent.h.
|
inlineprivate |
Write a given collection to the event.
collection | the collection to write |
Definition at line 474 of file LArPandoraEvent.h.
Referenced by WriteToEvent().
void lar_pandora::LArPandoraEvent::WriteToEvent | ( | ) | const |
Write (put) the collections in this LArPandoraEvent to the art::Event.
Definition at line 83 of file LArPandoraEvent.cxx.
References m_clusterHitMap, m_clusters, m_hits, m_metadata, m_pcAxes, m_pfParticleClusterMap, m_pfParticleMetadataMap, m_pfParticlePCAxisMap, m_pfParticles, m_pfParticleShowerMap, m_pfParticleSliceMap, m_pfParticleSpacePointMap, m_pfParticleT0Map, m_pfParticleTrackMap, m_pfParticleVertexMap, m_shouldProduceT0s, m_showerHitMap, m_showerPCAxisMap, m_showers, m_sliceHitMap, m_slices, m_spacePointHitMap, m_spacePoints, m_t0s, m_trackHitMap, m_tracks, m_vertices, WriteAssociation(), and WriteCollection().
Referenced by lar_pandora::CollectionSplitting::produce(), and lar_pandora::LArPandoraExternalEventBuilding::produce().
|
private |
The input associations: Cluster -> Hit.
Definition at line 346 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Clusters.
Definition at line 319 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Hits.
Definition at line 327 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
A set of labels describing the producers for each input collection.
Definition at line 312 of file LArPandoraEvent.h.
Referenced by lar_pandora::LArPandoraEvent::Labels::GetLabel(), lar_pandora::LArPandoraEvent::Labels::Labels(), and lar_pandora::LArPandoraEvent::Labels::SetLabel().
|
private |
The input collection of PFParticle metadata.
Definition at line 325 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of PCAxes.
Definition at line 326 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The event to consider.
Definition at line 311 of file LArPandoraEvent.h.
|
private |
The input associations: PFParticle -> Cluster.
Definition at line 333 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> Metadata.
Definition at line 342 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> PCAxis.
Definition at line 344 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of PFParticles.
Definition at line 317 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> Shower.
Definition at line 339 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> Slice.
Definition at line 336 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> SpacePoint.
Definition at line 331 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> T0.
Definition at line 340 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> Track.
Definition at line 337 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PFParticle -> Vertex.
Definition at line 335 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The producer which should write the output collections and associations.
Definition at line 310 of file LArPandoraEvent.h.
|
private |
If T0s should be produced (usually only true for use cases with multiple drift volumes)
Definition at line 314 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: Shower -> Hit.
Definition at line 349 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: PCAxis -> Shower.
Definition at line 350 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Showers.
Definition at line 323 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: Slice -> Hit.
Definition at line 347 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Slices.
Definition at line 321 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: SpacePoint -> Hit.
Definition at line 345 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of SpacePoints.
Definition at line 318 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of T0s.
Definition at line 324 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input associations: Track -> Hit.
Definition at line 348 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Tracks.
Definition at line 322 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().
|
private |
The input collection of Vertices.
Definition at line 320 of file LArPandoraEvent.h.
Referenced by GetCollections(), LArPandoraEvent(), and WriteToEvent().