All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lar_pandora::LArPandoraEvent Class Reference

LArPandoraEvent class. More...

#include <LArPandoraEvent.h>

Classes

class  Labels
 Class to handle the required producer labels. More...
 

Public Types

template<typename T >
using Collection = std::vector< art::Ptr< T > >
 Shorthand for a collection of objects of type T. More...
 
template<typename R , typename D >
using PairVector = std::vector< std::pair< art::Ptr< R >, D > >
 
template<typename L , typename R , typename D >
using Association = std::map< art::Ptr< L >, PairVector< R, D > >
 General purpose short-hand with optional D parameter. More...
 
typedef Collection< recob::HitHitCollection
 
typedef Collection
< recob::PFParticle
PFParticleCollection
 
typedef Collection
< recob::Cluster
ClusterCollection
 
typedef Collection
< recob::SpacePoint
SpacePointCollection
 
typedef Collection< recob::VertexVertexCollection
 
typedef Collection< recob::SliceSliceCollection
 
typedef Collection< recob::TrackTrackCollection
 
typedef Collection< recob::ShowerShowerCollection
 
typedef Collection< recob::PCAxisPCAxisCollection
 
typedef Collection
< larpandoraobj::PFParticleMetadata
PFParticleMetadataCollection
 
typedef Collection< anab::T0T0Collection
 
typedef Association
< recob::PFParticle,
recob::Cluster, void * > 
PFParticleToClusterAssoc
 
typedef Association
< recob::PFParticle,
recob::SpacePoint, void * > 
PFParticleToSpacePointAssoc
 
typedef Association
< recob::PFParticle,
recob::Vertex, void * > 
PFParticleToVertexAssoc
 
typedef Association
< recob::PFParticle,
recob::Slice, void * > 
PFParticleToSliceAssoc
 
typedef Association
< recob::PFParticle,
recob::Track, void * > 
PFParticleToTrackAssoc
 
typedef Association
< recob::PFParticle,
recob::Shower, void * > 
PFParticleToShowerAssoc
 
typedef Association
< recob::PFParticle,
recob::PCAxis, void * > 
PFParticleToPCAxisAssoc
 
typedef Association
< recob::PFParticle,
larpandoraobj::PFParticleMetadata,
void * > 
PFParticleToPFParticleMetadataAssoc
 
typedef Association
< recob::PFParticle, anab::T0,
void * > 
PFParticleToT0Assoc
 
typedef Association
< recob::Cluster, recob::Hit,
void * > 
ClusterToHitAssoc
 
typedef Association
< recob::SpacePoint,
recob::Hit, void * > 
SpacePointToHitAssoc
 
typedef Association
< recob::Slice, recob::Hit,
void * > 
SliceToHitAssoc
 
typedef Association
< recob::Track, recob::Hit,
recob::TrackHitMeta
TrackToHitAssoc
 
typedef Association
< recob::Shower, recob::Hit,
void * > 
ShowerToHitAssoc
 
typedef Association
< recob::Shower, recob::PCAxis,
void * > 
ShowerToPCAxisAssoc
 

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

Detailed Description

LArPandoraEvent class.

Definition at line 46 of file LArPandoraEvent.h.

Member Typedef Documentation

template<typename L , typename R , typename D >
using lar_pandora::LArPandoraEvent::Association = std::map< art::Ptr<L>, PairVector<R, D> >

General purpose short-hand with optional D parameter.

Definition at line 62 of file LArPandoraEvent.h.

Definition at line 67 of file LArPandoraEvent.h.

Definition at line 88 of file LArPandoraEvent.h.

template<typename T >
using lar_pandora::LArPandoraEvent::Collection = std::vector< art::Ptr<T> >

Shorthand for a collection of objects of type T.

Definition at line 53 of file LArPandoraEvent.h.

Definition at line 65 of file LArPandoraEvent.h.

template<typename R , typename D >
using lar_pandora::LArPandoraEvent::PairVector = std::vector< std::pair< art::Ptr<R>, D > >

Definition at line 56 of file LArPandoraEvent.h.

Definition at line 73 of file LArPandoraEvent.h.

Definition at line 66 of file LArPandoraEvent.h.

Definition at line 74 of file LArPandoraEvent.h.

Definition at line 78 of file LArPandoraEvent.h.

Definition at line 84 of file LArPandoraEvent.h.

Definition at line 85 of file LArPandoraEvent.h.

Definition at line 83 of file LArPandoraEvent.h.

Definition at line 81 of file LArPandoraEvent.h.

Definition at line 79 of file LArPandoraEvent.h.

Definition at line 86 of file LArPandoraEvent.h.

Definition at line 82 of file LArPandoraEvent.h.

Definition at line 80 of file LArPandoraEvent.h.

Definition at line 72 of file LArPandoraEvent.h.

Definition at line 92 of file LArPandoraEvent.h.

Definition at line 93 of file LArPandoraEvent.h.

Definition at line 70 of file LArPandoraEvent.h.

Definition at line 90 of file LArPandoraEvent.h.

Definition at line 68 of file LArPandoraEvent.h.

Definition at line 89 of file LArPandoraEvent.h.

Definition at line 75 of file LArPandoraEvent.h.

Definition at line 71 of file LArPandoraEvent.h.

Definition at line 91 of file LArPandoraEvent.h.

Definition at line 69 of file LArPandoraEvent.h.

Constructor & Destructor Documentation

lar_pandora::LArPandoraEvent::LArPandoraEvent ( art::EDProducer *  pProducer,
art::Event *  pEvent,
const Labels inputLabels,
const bool  shouldProduceT0s = false 
)

Constructor from an art::Event.

Parameters
pProducerpointer to the producer to write the output
pEventpointer to the event to process
inputLabellabels for the producers of the input collections
shouldProduceT0sif T0s should be produced (usually only for multiple drift volume use cases)

Definition at line 12 of file LArPandoraEvent.cxx.

12  :
13  m_pProducer(pProducer),
14  m_pEvent(pEvent),
15  m_labels(inputLabels),
16  m_shouldProduceT0s(shouldProduceT0s)
17 {
18  this->GetCollections();
19 }
void GetCollections()
Get the collections and associations from m_pEvent with the required labels.
art::Event * m_pEvent
The event to consider.
art::EDProducer * m_pProducer
The producer which should write the output collections and associations.
Labels m_labels
A set of labels describing the producers for each input collection.
bool m_shouldProduceT0s
If T0s should be produced (usually only true for use cases with multiple drift volumes) ...
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.

Parameters
eventinput event to copy and filter
pfParticleVectorinput vector of selected particles

Definition at line 23 of file LArPandoraEvent.cxx.

23  :
24  m_pProducer(event.m_pProducer),
25  m_pEvent(event.m_pEvent),
26  m_labels(event.m_labels),
27  m_shouldProduceT0s(event.m_shouldProduceT0s),
28  m_hits(event.m_hits)
29 {
30  m_pfParticles = selectedPFParticles;
31 
32  // Only collect objects associated to a selected particles
33  for (const auto &part : selectedPFParticles)
34  {
35  this->CollectAssociated(part, event.m_pfParticleSpacePointMap, m_spacePoints);
36  this->CollectAssociated(part, event.m_pfParticleClusterMap, m_clusters);
37  this->CollectAssociated(part, event.m_pfParticleVertexMap, m_vertices);
38  this->CollectAssociated(part, event.m_pfParticleSliceMap, m_slices);
39  this->CollectAssociated(part, event.m_pfParticleTrackMap, m_tracks);
40  this->CollectAssociated(part, event.m_pfParticleShowerMap, m_showers);
41  this->CollectAssociated(part, event.m_pfParticlePCAxisMap, m_pcAxes);
42  this->CollectAssociated(part, event.m_pfParticleMetadataMap, m_metadata);
43 
45  this->CollectAssociated(part, event.m_pfParticleT0Map, m_t0s);
46  }
47 
48  // Filter the association maps from the input event to only include objects associated to the selected particles
49  this->GetFilteredAssociationMap(m_pfParticles, m_spacePoints, event.m_pfParticleSpacePointMap, m_pfParticleSpacePointMap);
50  this->GetFilteredAssociationMap(m_pfParticles, m_clusters, event.m_pfParticleClusterMap, m_pfParticleClusterMap);
51  this->GetFilteredAssociationMap(m_pfParticles, m_vertices, event.m_pfParticleVertexMap, m_pfParticleVertexMap);
52  this->GetFilteredAssociationMap(m_pfParticles, m_slices, event.m_pfParticleSliceMap, m_pfParticleSliceMap);
53  this->GetFilteredAssociationMap(m_pfParticles, m_tracks, event.m_pfParticleTrackMap, m_pfParticleTrackMap);
54  this->GetFilteredAssociationMap(m_pfParticles, m_showers, event.m_pfParticleShowerMap, m_pfParticleShowerMap);
55  this->GetFilteredAssociationMap(m_pfParticles, m_pcAxes, event.m_pfParticlePCAxisMap, m_pfParticlePCAxisMap);
56  this->GetFilteredAssociationMap(m_pfParticles, m_metadata, event.m_pfParticleMetadataMap, m_pfParticleMetadataMap);
57  this->GetFilteredAssociationMap(m_spacePoints, event.m_hits, event.m_spacePointHitMap, m_spacePointHitMap);
58  this->GetFilteredAssociationMap(m_clusters, event.m_hits, event.m_clusterHitMap, m_clusterHitMap);
59  this->GetFilteredAssociationMap(m_slices, event.m_hits, event.m_sliceHitMap, m_sliceHitMap);
60  this->GetFilteredAssociationMap(m_tracks, event.m_hits, event.m_trackHitMap, m_trackHitMap);
61  this->GetFilteredAssociationMap(m_showers, event.m_hits, event.m_showerHitMap, m_showerHitMap);
62  this->GetFilteredAssociationMap(m_showers, m_pcAxes, event.m_showerPCAxisMap, m_showerPCAxisMap);
63 
65  this->GetFilteredAssociationMap(m_pfParticles, m_t0s, event.m_pfParticleT0Map, m_pfParticleT0Map);
66 }
HitCollection m_hits
The input collection of Hits.
PFParticleToVertexAssoc m_pfParticleVertexMap
The input associations: PFParticle -&gt; Vertex.
ClusterCollection m_clusters
The input collection of Clusters.
T0Collection m_t0s
The input collection of T0s.
SliceToHitAssoc m_sliceHitMap
The input associations: Slice -&gt; Hit.
SpacePointToHitAssoc m_spacePointHitMap
The input associations: SpacePoint -&gt; Hit.
PFParticleToTrackAssoc m_pfParticleTrackMap
The input associations: PFParticle -&gt; Track.
PFParticleToClusterAssoc m_pfParticleClusterMap
The input associations: PFParticle -&gt; Cluster.
PFParticleToPCAxisAssoc m_pfParticlePCAxisMap
The input associations: PFParticle -&gt; PCAxis.
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...
PCAxisCollection m_pcAxes
The input collection of PCAxes.
PFParticleCollection m_pfParticles
The input collection of PFParticles.
ClusterToHitAssoc m_clusterHitMap
The input associations: Cluster -&gt; Hit.
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...
PFParticleToPFParticleMetadataAssoc m_pfParticleMetadataMap
The input associations: PFParticle -&gt; Metadata.
SpacePointCollection m_spacePoints
The input collection of SpacePoints.
ShowerToHitAssoc m_showerHitMap
The input associations: Shower -&gt; Hit.
art::Event * m_pEvent
The event to consider.
PFParticleToT0Assoc m_pfParticleT0Map
The input associations: PFParticle -&gt; T0.
PFParticleToSliceAssoc m_pfParticleSliceMap
The input associations: PFParticle -&gt; Slice.
ShowerToPCAxisAssoc m_showerPCAxisMap
The input associations: PCAxis -&gt; Shower.
art::EDProducer * m_pProducer
The producer which should write the output collections and associations.
TrackToHitAssoc m_trackHitMap
The input associations: Track -&gt; Hit.
SliceCollection m_slices
The input collection of Slices.
PFParticleToShowerAssoc m_pfParticleShowerMap
The input associations: PFParticle -&gt; Shower.
Labels m_labels
A set of labels describing the producers for each input collection.
VertexCollection m_vertices
The input collection of Vertices.
ShowerCollection m_showers
The input collection of Showers.
PFParticleMetadataCollection m_metadata
The input collection of PFParticle metadata.
TrackCollection m_tracks
The input collection of Tracks.
PFParticleToSpacePointAssoc m_pfParticleSpacePointMap
The input associations: PFParticle -&gt; SpacePoint.
bool m_shouldProduceT0s
If T0s should be produced (usually only true for use cases with multiple drift volumes) ...

Member Function Documentation

template<typename L , typename R , typename D >
void lar_pandora::LArPandoraEvent::CollectAssociated ( const art::Ptr< L > &  anObject,
const Association< L, R, D > &  associationLtoR,
Collection< R > &  associatedR 
) const
inlineprivate

Collects all objects of type R with metadata D associated to a given object of type L.

Parameters
anObjectan input object of type L with which we want to collect associated objects of type R with metadata D
associationLtoRthe general input association between objects of type L and R
associatedRoutput vector of objects of type R associated with anObject

Definition at line 397 of file LArPandoraEvent.h.

399 {
400  if (associationLtoR.find(anObject) == associationLtoR.end())
401  throw cet::exception("LArPandora") << " LArPandoraEvent::CollectAssociated -- Can not find association for object supplied." << std::endl;
402 
403  for (const auto &entry : associationLtoR.at(anObject))
404  {
405  // Ensure we don't repeat objects in the output collection
406  if (std::find(associatedR.begin(), associatedR.end(), entry.first) == associatedR.end())
407  associatedR.push_back(entry.first);
408  }
409 }
template<typename L , typename R , typename D >
void lar_pandora::LArPandoraEvent::GetAssociationMap ( const Collection< L > &  collectionL,
const Labels::LabelType inputLabel,
Association< L, R, D > &  outputAssociationMap 
) const
inlineprivate

Get the mapping between two collections with metadata using the specified label.

Parameters
collectionLthe collection from which the associations should be retrieved
inputLabela label for the producer of the association required
outputAssociationMapoutput mapping between the two data types supplied (L -> R + D)

Definition at line 347 of file LArPandoraEvent.h.

349 {
350  const auto &assocHandle(m_pEvent->getValidHandle<art::Assns<L, R, D> >(m_labels.GetLabel(inputLabel)));
351 
352  // Check that there are no associaions from objects not in collectionL
353  for (const auto &entry : *assocHandle)
354  {
355  auto it(std::find(collectionL.begin(), collectionL.end(), entry.first));
356  if (it == collectionL.end())
357  throw cet::exception("LArPandora") << " LArPandoraEvent::GetAssociationMap -- Found object in association that isn't in the supplied collection" << std::endl;
358  }
359 
360  // Ensure there is an entry for every object of type L
361  for (const auto &objectL : collectionL)
362  outputAssociationMap[objectL];
363 
364  // Fill the association map
365  for (const auto &entry : *assocHandle)
366  outputAssociationMap.at(entry.first).emplace_back(entry.second, *entry.data);
367 }
art::Event * m_pEvent
The event to consider.
Labels m_labels
A set of labels describing the producers for each input collection.
const std::string & GetLabel(const LabelType type) const
Get the label of a given type.
template<typename L , typename R >
void lar_pandora::LArPandoraEvent::GetAssociationMap ( const Collection< L > &  collectionL,
const Labels::LabelType inputLabel,
Association< L, R, void * > &  outputAssociationMap 
) const
inlineprivate

Get the mapping between two collections with metadata using the specified label.

Parameters
collectionLthe collection from which the associations should be retrieved
inputLabela label for the producer of the association required
outputAssociationMapoutput mapping between the two data types supplied (L -> R no metadata)

Definition at line 372 of file LArPandoraEvent.h.

374 {
375  const auto &assocHandle(m_pEvent->getValidHandle<art::Assns<L, R> >(m_labels.GetLabel(inputLabel)));
376 
377  // Check that there are no associaions from objects not in collectionL
378  for (const auto &entry : *assocHandle)
379  {
380  auto it(std::find(collectionL.begin(), collectionL.end(), entry.first));
381  if (it == collectionL.end())
382  throw cet::exception("LArPandora") << " LArPandoraEvent::GetAssociationMap -- Found object in association that isn't in the supplied collection" << std::endl;
383  }
384 
385  // Ensure there is an entry for every object of type L
386  for (const auto &objectL : collectionL)
387  outputAssociationMap[objectL];
388 
389  // Fill the association map
390  for (const auto &entry : *assocHandle)
391  outputAssociationMap.at(entry.first).emplace_back(entry.second, nullptr);
392 }
art::Event * m_pEvent
The event to consider.
Labels m_labels
A set of labels describing the producers for each input collection.
const std::string & GetLabel(const LabelType type) const
Get the label of a given type.
template<typename T >
void lar_pandora::LArPandoraEvent::GetCollection ( const Labels::LabelType inputLabel,
Collection< T > &  outputCollection 
) const
inlineprivate

Gets a given collection from m_pEvent with the label supplied.

Parameters
inputLabela label for the producer of the collection required
outputCollectionthe required collection

Definition at line 336 of file LArPandoraEvent.h.

337 {
338  const auto &handle(m_pEvent->getValidHandle<std::vector<T> >(m_labels.GetLabel(inputLabel)));
339 
340  for (unsigned int i = 0; i != handle->size(); i++)
341  outputCollection.emplace_back(handle, i);
342 }
art::Event * m_pEvent
The event to consider.
Labels m_labels
A set of labels describing the producers for each input collection.
const std::string & GetLabel(const LabelType type) const
Get the label of a given type.
void lar_pandora::LArPandoraEvent::GetCollections ( )
private

Get the collections and associations from m_pEvent with the required labels.

Definition at line 106 of file LArPandoraEvent.cxx.

107 {
118 
133 
134  if (m_shouldProduceT0s)
135  {
138  }
139 }
HitCollection m_hits
The input collection of Hits.
PFParticleToVertexAssoc m_pfParticleVertexMap
The input associations: PFParticle -&gt; Vertex.
ClusterCollection m_clusters
The input collection of Clusters.
T0Collection m_t0s
The input collection of T0s.
SliceToHitAssoc m_sliceHitMap
The input associations: Slice -&gt; Hit.
SpacePointToHitAssoc m_spacePointHitMap
The input associations: SpacePoint -&gt; Hit.
PFParticleToTrackAssoc m_pfParticleTrackMap
The input associations: PFParticle -&gt; Track.
PFParticleToClusterAssoc m_pfParticleClusterMap
The input associations: PFParticle -&gt; Cluster.
PFParticleToPCAxisAssoc m_pfParticlePCAxisMap
The input associations: PFParticle -&gt; PCAxis.
PCAxisCollection m_pcAxes
The input collection of PCAxes.
PFParticleCollection m_pfParticles
The input collection of PFParticles.
ClusterToHitAssoc m_clusterHitMap
The input associations: Cluster -&gt; Hit.
PFParticleToPFParticleMetadataAssoc m_pfParticleMetadataMap
The input associations: PFParticle -&gt; Metadata.
SpacePointCollection m_spacePoints
The input collection of SpacePoints.
ShowerToHitAssoc m_showerHitMap
The input associations: Shower -&gt; Hit.
PFParticleToT0Assoc m_pfParticleT0Map
The input associations: PFParticle -&gt; T0.
PFParticleToSliceAssoc m_pfParticleSliceMap
The input associations: PFParticle -&gt; Slice.
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.
ShowerToPCAxisAssoc m_showerPCAxisMap
The input associations: PCAxis -&gt; Shower.
TrackToHitAssoc m_trackHitMap
The input associations: Track -&gt; Hit.
SliceCollection m_slices
The input collection of Slices.
PFParticleToShowerAssoc m_pfParticleShowerMap
The input associations: PFParticle -&gt; Shower.
void GetCollection(const Labels::LabelType &inputLabel, Collection< T > &outputCollection) const
Gets a given collection from m_pEvent with the label supplied.
VertexCollection m_vertices
The input collection of Vertices.
ShowerCollection m_showers
The input collection of Showers.
PFParticleMetadataCollection m_metadata
The input collection of PFParticle metadata.
TrackCollection m_tracks
The input collection of Tracks.
PFParticleToSpacePointAssoc m_pfParticleSpacePointMap
The input associations: PFParticle -&gt; SpacePoint.
bool m_shouldProduceT0s
If T0s should be produced (usually only true for use cases with multiple drift volumes) ...
template<typename L , typename R , typename D >
void lar_pandora::LArPandoraEvent::GetFilteredAssociationMap ( const Collection< L > &  collectionL,
const Collection< R > &  collectionR,
const Association< L, R, D > &  inputAssociationLtoR,
Association< L, R, D > &  outputAssociationLtoR 
) const
inlineprivate

Gets the filtered mapping from objects in collectionL to objects that also exist in collectionR using a "superset" input association.

Parameters
collectionLa first filtered collection
collectionRa second filtered collection
inputAssociationLtoRmapping between the two unfiltered collections
outputAssociationLtoRmapping between the two filtered collections
Returns
mapping between the filtered collections

Definition at line 414 of file LArPandoraEvent.h.

416 {
417  for (const auto &objectL : collectionL)
418  {
419  if (inputAssociationLtoR.find(objectL) == inputAssociationLtoR.end())
420  throw cet::exception("LArPandora") << " LArPandoraEvent::GetFilteredAssociationMap -- Can not find association for object in supplied collection." << std::endl;
421 
422  if (outputAssociationLtoR.find(objectL) != outputAssociationLtoR.end())
423  throw cet::exception("LArPandora") << " LArPandoraEvent::GetFilteredAssociationMap -- Repeated objects in input collectionL" << std::endl;
424 
425  for (const auto &entry : inputAssociationLtoR.at(objectL))
426  {
427  if (std::find(collectionR.begin(), collectionR.end(), entry.first) == collectionR.end())
428  continue;
429 
430  outputAssociationLtoR[objectL].push_back(entry);
431  }
432  }
433 }
template<typename T >
size_t lar_pandora::LArPandoraEvent::GetIndex ( const art::Ptr< T >  object,
const Collection< T > &  collection 
) const
inlineprivate

Get the index of an objet in a given collection.

Parameters
objectthe object to search for
collectionthe collection to search through
Returns
the index of the object in the collection

Definition at line 530 of file LArPandoraEvent.h.

531 {
532  const auto it(std::find(collection.begin(), collection.end(), object));
533  if (it == collection.end())
534  throw cet::exception("LArPandora") << " LArPandoraEvent::GetIndex -- Can't find input object in the supplied collection." << std::endl;
535 
536  return static_cast<size_t>(std::distance(collection.begin(), it));
537 }
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
object (unordered set of name/value pairs)
template<typename L , typename R , typename D >
void lar_pandora::LArPandoraEvent::WriteAssociation ( const Association< L, R, D > &  associationMap,
const Collection< L > &  collectionL,
const Collection< R > &  collectionR,
const bool  thisProducesR = true 
) const
inlineprivate

Write a given association to the event.

Parameters
associationMapthe association to write from objects of type L -> R + D
collectionLthe collection of type L that has been written
collectionRthe collection of type R that has been written
thisProducesRwill this producer produce collectionR of was it produced by a different module?

Definition at line 451 of file LArPandoraEvent.h.

453 {
454  // The output assocation to populate
455  std::unique_ptr<art::Assns<L, R, D> > outputAssn(new art::Assns<L, R, D>);
456 
457  // NB. The art::Ptrs in the stored collections refer to the producer that originally created the objects (e.g. Pandora pat-rec). To make
458  // correct associations, we need to make new art::Ptrs to refer to the *copies* of the objects made by this producer. This is done using
459  // the PtrMaker utility.
460  const art::PtrMaker<L> makePtrL(*m_pEvent);
461 
462  for (auto it = associationMap.begin(); it != associationMap.end(); ++it)
463  {
464  const auto indexL(this->GetIndex(it->first, collectionL));
465  const auto outputPtrL(makePtrL(indexL));
466 
467  for (const auto &entry : it->second)
468  {
469  const auto &objectR(entry.first);
470  const auto &objectD(entry.second);
471 
472  if (thisProducesR)
473  {
474  const art::PtrMaker<R> makePtrR(*m_pEvent);
475  const auto indexR(this->GetIndex(objectR, collectionR));
476  outputAssn->addSingle(outputPtrL, makePtrR(indexR), objectD);
477  }
478  else
479  {
480  outputAssn->addSingle(outputPtrL, objectR, objectD);
481  }
482  }
483  }
484 
485  m_pEvent->put(std::move(outputAssn));
486 }
art::Event * m_pEvent
The event to consider.
size_t GetIndex(const art::Ptr< T > object, const Collection< T > &collection) const
Get the index of an objet in a given collection.
template<typename L , typename R >
void lar_pandora::LArPandoraEvent::WriteAssociation ( const Association< L, R, void * > &  associationMap,
const Collection< L > &  collectionL,
const Collection< R > &  collectionR,
const bool  thisProducesR = true 
) const
inlineprivate

Write a given association to the event.

Parameters
associationMapthe association to write from objects of type L -> R (no metadata)
collectionLthe collection of type L that has been written
collectionRthe collection of type R that has been written
thisProducesRwill this producer produce collectionR of was it produced by a different module?

Definition at line 491 of file LArPandoraEvent.h.

493 {
494  // The output assocation to populate
495  std::unique_ptr<art::Assns<L, R> > outputAssn(new art::Assns<L, R>);
496 
497  // NB. The art::Ptrs in the stored collections refer to the producer that originally created the objects (e.g. Pandora pat-rec). To make
498  // correct associations, we need to make new art::Ptrs to refer to the *copies* of the objects made by this producer. This is done using
499  // the PtrMaker utility.
500  const art::PtrMaker<L> makePtrL(*m_pEvent);
501 
502  for (auto it = associationMap.begin(); it != associationMap.end(); ++it)
503  {
504  const auto indexL(this->GetIndex(it->first, collectionL));
505  const auto outputPtrL(makePtrL(indexL));
506 
507  for (const auto &entry : it->second)
508  {
509  const auto &objectR(entry.first);
510 
511  if (thisProducesR)
512  {
513  const art::PtrMaker<R> makePtrR(*m_pEvent);
514  const auto indexR(this->GetIndex(objectR, collectionR));
515  outputAssn->addSingle(outputPtrL, makePtrR(indexR));
516  }
517  else
518  {
519  outputAssn->addSingle(outputPtrL, objectR);
520  }
521  }
522  }
523 
524  m_pEvent->put(std::move(outputAssn));
525 }
art::Event * m_pEvent
The event to consider.
size_t GetIndex(const art::Ptr< T > object, const Collection< T > &collection) const
Get the index of an objet in a given collection.
template<typename T >
void lar_pandora::LArPandoraEvent::WriteCollection ( const Collection< T > &  collection) const
inlineprivate

Write a given collection to the event.

Parameters
collectionthe collection to write

Definition at line 438 of file LArPandoraEvent.h.

439 {
440  std::unique_ptr<std::vector<T> > output(new std::vector<T>);
441 
442  for (const auto &object : collection)
443  output->push_back(*object);
444 
445  m_pEvent->put(std::move(output));
446 }
art::Event * m_pEvent
The event to consider.
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
void lar_pandora::LArPandoraEvent::WriteToEvent ( ) const

Write (put) the collections in this LArPandoraEvent to the art::Event.

Definition at line 70 of file LArPandoraEvent.cxx.

71 {
81 
96 
98  {
99  this->WriteCollection(m_t0s);
101  }
102 }
HitCollection m_hits
The input collection of Hits.
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.
PFParticleToVertexAssoc m_pfParticleVertexMap
The input associations: PFParticle -&gt; Vertex.
ClusterCollection m_clusters
The input collection of Clusters.
T0Collection m_t0s
The input collection of T0s.
SliceToHitAssoc m_sliceHitMap
The input associations: Slice -&gt; Hit.
SpacePointToHitAssoc m_spacePointHitMap
The input associations: SpacePoint -&gt; Hit.
PFParticleToTrackAssoc m_pfParticleTrackMap
The input associations: PFParticle -&gt; Track.
PFParticleToClusterAssoc m_pfParticleClusterMap
The input associations: PFParticle -&gt; Cluster.
PFParticleToPCAxisAssoc m_pfParticlePCAxisMap
The input associations: PFParticle -&gt; PCAxis.
PCAxisCollection m_pcAxes
The input collection of PCAxes.
PFParticleCollection m_pfParticles
The input collection of PFParticles.
ClusterToHitAssoc m_clusterHitMap
The input associations: Cluster -&gt; Hit.
PFParticleToPFParticleMetadataAssoc m_pfParticleMetadataMap
The input associations: PFParticle -&gt; Metadata.
SpacePointCollection m_spacePoints
The input collection of SpacePoints.
ShowerToHitAssoc m_showerHitMap
The input associations: Shower -&gt; Hit.
PFParticleToT0Assoc m_pfParticleT0Map
The input associations: PFParticle -&gt; T0.
PFParticleToSliceAssoc m_pfParticleSliceMap
The input associations: PFParticle -&gt; Slice.
ShowerToPCAxisAssoc m_showerPCAxisMap
The input associations: PCAxis -&gt; Shower.
TrackToHitAssoc m_trackHitMap
The input associations: Track -&gt; Hit.
SliceCollection m_slices
The input collection of Slices.
PFParticleToShowerAssoc m_pfParticleShowerMap
The input associations: PFParticle -&gt; Shower.
void WriteCollection(const Collection< T > &collection) const
Write a given collection to the event.
VertexCollection m_vertices
The input collection of Vertices.
ShowerCollection m_showers
The input collection of Showers.
PFParticleMetadataCollection m_metadata
The input collection of PFParticle metadata.
TrackCollection m_tracks
The input collection of Tracks.
PFParticleToSpacePointAssoc m_pfParticleSpacePointMap
The input associations: PFParticle -&gt; SpacePoint.
bool m_shouldProduceT0s
If T0s should be produced (usually only true for use cases with multiple drift volumes) ...

Member Data Documentation

ClusterToHitAssoc lar_pandora::LArPandoraEvent::m_clusterHitMap
private

The input associations: Cluster -> Hit.

Definition at line 326 of file LArPandoraEvent.h.

ClusterCollection lar_pandora::LArPandoraEvent::m_clusters
private

The input collection of Clusters.

Definition at line 305 of file LArPandoraEvent.h.

HitCollection lar_pandora::LArPandoraEvent::m_hits
private

The input collection of Hits.

Definition at line 313 of file LArPandoraEvent.h.

Labels lar_pandora::LArPandoraEvent::m_labels
private

A set of labels describing the producers for each input collection.

Definition at line 299 of file LArPandoraEvent.h.

PFParticleMetadataCollection lar_pandora::LArPandoraEvent::m_metadata
private

The input collection of PFParticle metadata.

Definition at line 311 of file LArPandoraEvent.h.

PCAxisCollection lar_pandora::LArPandoraEvent::m_pcAxes
private

The input collection of PCAxes.

Definition at line 312 of file LArPandoraEvent.h.

art::Event* lar_pandora::LArPandoraEvent::m_pEvent
private

The event to consider.

Definition at line 298 of file LArPandoraEvent.h.

PFParticleToClusterAssoc lar_pandora::LArPandoraEvent::m_pfParticleClusterMap
private

The input associations: PFParticle -> Cluster.

Definition at line 317 of file LArPandoraEvent.h.

PFParticleToPFParticleMetadataAssoc lar_pandora::LArPandoraEvent::m_pfParticleMetadataMap
private

The input associations: PFParticle -> Metadata.

Definition at line 323 of file LArPandoraEvent.h.

PFParticleToPCAxisAssoc lar_pandora::LArPandoraEvent::m_pfParticlePCAxisMap
private

The input associations: PFParticle -> PCAxis.

Definition at line 324 of file LArPandoraEvent.h.

PFParticleCollection lar_pandora::LArPandoraEvent::m_pfParticles
private

The input collection of PFParticles.

Definition at line 303 of file LArPandoraEvent.h.

PFParticleToShowerAssoc lar_pandora::LArPandoraEvent::m_pfParticleShowerMap
private

The input associations: PFParticle -> Shower.

Definition at line 321 of file LArPandoraEvent.h.

PFParticleToSliceAssoc lar_pandora::LArPandoraEvent::m_pfParticleSliceMap
private

The input associations: PFParticle -> Slice.

Definition at line 319 of file LArPandoraEvent.h.

PFParticleToSpacePointAssoc lar_pandora::LArPandoraEvent::m_pfParticleSpacePointMap
private

The input associations: PFParticle -> SpacePoint.

Definition at line 316 of file LArPandoraEvent.h.

PFParticleToT0Assoc lar_pandora::LArPandoraEvent::m_pfParticleT0Map
private

The input associations: PFParticle -> T0.

Definition at line 322 of file LArPandoraEvent.h.

PFParticleToTrackAssoc lar_pandora::LArPandoraEvent::m_pfParticleTrackMap
private

The input associations: PFParticle -> Track.

Definition at line 320 of file LArPandoraEvent.h.

PFParticleToVertexAssoc lar_pandora::LArPandoraEvent::m_pfParticleVertexMap
private

The input associations: PFParticle -> Vertex.

Definition at line 318 of file LArPandoraEvent.h.

art::EDProducer* lar_pandora::LArPandoraEvent::m_pProducer
private

The producer which should write the output collections and associations.

Definition at line 297 of file LArPandoraEvent.h.

bool lar_pandora::LArPandoraEvent::m_shouldProduceT0s
private

If T0s should be produced (usually only true for use cases with multiple drift volumes)

Definition at line 300 of file LArPandoraEvent.h.

ShowerToHitAssoc lar_pandora::LArPandoraEvent::m_showerHitMap
private

The input associations: Shower -> Hit.

Definition at line 329 of file LArPandoraEvent.h.

ShowerToPCAxisAssoc lar_pandora::LArPandoraEvent::m_showerPCAxisMap
private

The input associations: PCAxis -> Shower.

Definition at line 330 of file LArPandoraEvent.h.

ShowerCollection lar_pandora::LArPandoraEvent::m_showers
private

The input collection of Showers.

Definition at line 309 of file LArPandoraEvent.h.

SliceToHitAssoc lar_pandora::LArPandoraEvent::m_sliceHitMap
private

The input associations: Slice -> Hit.

Definition at line 327 of file LArPandoraEvent.h.

SliceCollection lar_pandora::LArPandoraEvent::m_slices
private

The input collection of Slices.

Definition at line 307 of file LArPandoraEvent.h.

SpacePointToHitAssoc lar_pandora::LArPandoraEvent::m_spacePointHitMap
private

The input associations: SpacePoint -> Hit.

Definition at line 325 of file LArPandoraEvent.h.

SpacePointCollection lar_pandora::LArPandoraEvent::m_spacePoints
private

The input collection of SpacePoints.

Definition at line 304 of file LArPandoraEvent.h.

T0Collection lar_pandora::LArPandoraEvent::m_t0s
private

The input collection of T0s.

Definition at line 310 of file LArPandoraEvent.h.

TrackToHitAssoc lar_pandora::LArPandoraEvent::m_trackHitMap
private

The input associations: Track -> Hit.

Definition at line 328 of file LArPandoraEvent.h.

TrackCollection lar_pandora::LArPandoraEvent::m_tracks
private

The input collection of Tracks.

Definition at line 308 of file LArPandoraEvent.h.

VertexCollection lar_pandora::LArPandoraEvent::m_vertices
private

The input collection of Vertices.

Definition at line 306 of file LArPandoraEvent.h.


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