All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LArPandoraEvent.h
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraEventBuilding/LArPandoraEvent.h
3  *
4  * @brief A description of all outputs from an instance of pandora with functionality to filter and merge multiple output
5  */
6 
7 #ifndef LAR_PANDORA_EVENT_H
8 #define LAR_PANDORA_EVENT_H 1
9 
11 
13 
25 
26 namespace art {
27  class EDProducer;
28 }
29 #include "art/Framework/Principal/Event.h"
30 #include "art/Persistency/Common/PtrMaker.h"
31 #include "canvas/Persistency/Common/Assns.h"
32 #include "canvas/Persistency/Common/Ptr.h"
33 
34 #include <algorithm>
35 #include <map>
36 #include <memory>
37 #include <string>
38 #include <utility> // std::pair<>
39 
40 namespace lar_pandora
41 {
42 
43 /**
44  * @brief LArPandoraEvent class
45  */
47 {
48 public:
49  /**
50  * @brief Shorthand for a collection of objects of type T
51  */
52  template <typename T>
53  using Collection = std::vector< art::Ptr<T> >;
54 
55  template <typename R, typename D>
56  using PairVector = std::vector< std::pair< art::Ptr<R>, D > >;
57 
58  /**
59  * @brief General purpose short-hand with optional D parameter
60  */
61  template <typename L, typename R, typename D>
62  using Association = std::map< art::Ptr<L>, PairVector<R, D> >;
63 
64  // Collection typedef specializations
76 
77  // Association typedef specializations
87 
94 
95  /**
96  * @brief Class to handle the required producer labels
97  */
98  class Labels
99  {
100  public:
101  /**
102  * @brief Label type enumeration
103  */
105  {
132  };
133 
134  /**
135  * @brief Minimal parametrised constructor.
136  * Sets all collection labels to be the same as the PFParticle producer label
137  */
138  Labels(const std::string &pfParticleProducerLabel, const std::string &hitProducerLabel);
139 
140  /**
141  * @brief Track / Shower parametrised constructor.
142  * Sets all collection labels to be the same as the PFParticle producer label,
143  * except those relating to track and shower production, which are supplied.
144  */
145  Labels(const std::string &pfParticleProducerLabel, const std::string &trackProducerLabel, const std::string &showerProducerLabel,
146  const std::string &hitProducerLabel);
147 
148  /**
149  * @brief Get the label of a given type
150  *
151  * @param type the label type to retrieve
152  *
153  * @return the label
154  */
155  const std::string & GetLabel(const LabelType type) const;
156 
157  /**
158  * @brief Set the label of a given type
159  *
160  * @param type the label type to set
161  * @param label the label to set
162  */
163  void SetLabel(const LabelType type, const std::string &label);
164 
165  private:
166  std::map<LabelType, std::string> m_labels; ///< Map holding the labels
167  };
168 
169  /**
170  * @brief Constructor from an art::Event
171  *
172  * @param pProducer pointer to the producer to write the output
173  * @param pEvent pointer to the event to process
174  * @param inputLabel labels for the producers of the input collections
175  * @param shouldProduceT0s if T0s should be produced (usually only for multiple drift volume use cases)
176  */
177  LArPandoraEvent(art::EDProducer *pProducer, art::Event *pEvent, const Labels &inputLabels, const bool shouldProduceT0s = false);
178 
179  /**
180  * @brief Construct by copying an existing LArPandoraEvent, replacing the collections and associations
181  * by any objects associated with a PFParticle in the selection supplied.
182  *
183  * @param event input event to copy and filter
184  * @param pfParticleVector input vector of selected particles
185  */
186  LArPandoraEvent(const LArPandoraEvent &event, const PFParticleVector &selectedPFParticles);
187 
188  /**
189  * @brief Write (put) the collections in this LArPandoraEvent to the art::Event
190  */
191  void WriteToEvent() const;
192 
193 private:
194  /**
195  * @brief Get the collections and associations from m_pEvent with the required labels
196  */
197  void GetCollections();
198 
199  /**
200  * @brief Gets a given collection from m_pEvent with the label supplied
201  *
202  * @param inputLabel a label for the producer of the collection required
203  * @param outputCollection the required collection
204  */
205  template <typename T>
206  void GetCollection(const Labels::LabelType &inputLabel, Collection<T> &outputCollection) const;
207 
208  /**
209  * @brief Get the mapping between two collections with metadata using the specified label
210  *
211  * @param collectionL the collection from which the associations should be retrieved
212  * @param inputLabel a label for the producer of the association required
213  * @param outputAssociationMap output mapping between the two data types supplied (L -> R + D)
214  */
215  template <typename L, typename R, typename D>
216  void GetAssociationMap(const Collection<L> &collectionL, const Labels::LabelType &inputLabel,
217  Association<L, R, D> &outputAssociationMap) const;
218 
219  /**
220  * @brief Get the mapping between two collections with metadata using the specified label
221  *
222  * @param collectionL the collection from which the associations should be retrieved
223  * @param inputLabel a label for the producer of the association required
224  * @param outputAssociationMap output mapping between the two data types supplied (L -> R no metadata)
225  */
226  template <typename L, typename R>
227  void GetAssociationMap(const Collection<L> &collectionL, const Labels::LabelType &inputLabel,
228  Association<L, R, void*> &outputAssociationMap) const;
229 
230  /**
231  * @brief Collects all objects of type R with metadata D associated to a given object of type L
232  *
233  * @param anObject an input object of type L with which we want to collect associated objects of type R with metadata D
234  * @param associationLtoR the general input association between objects of type L and R
235  * @param associatedR output vector of objects of type R associated with anObject
236  */
237  template <typename L, typename R, typename D>
238  void CollectAssociated(const art::Ptr<L> &anObject, const Association<L, R, D> &associationLtoR, Collection<R> &associatedR) const;
239 
240  /**
241  * @brief Gets the filtered mapping from objects in collectionL to objects that also exist in collectionR using a "superset" input association
242  *
243  * @param collectionL a first filtered collection
244  * @param collectionR a second filtered collection
245  * @param inputAssociationLtoR mapping between the two unfiltered collections
246  * @param outputAssociationLtoR mapping between the two filtered collections
247  *
248  * @return mapping between the filtered collections
249  */
250  template <typename L, typename R, typename D>
251  void GetFilteredAssociationMap(const Collection<L> &collectionL, const Collection<R> &collectionR,
252  const Association<L, R, D> &inputAssociationLtoR, Association<L, R, D> &outputAssociationLtoR) const;
253 
254  /**
255  * @brief Write a given collection to the event
256  *
257  * @param collection the collection to write
258  */
259  template <typename T>
260  void WriteCollection(const Collection<T> &collection) const;
261 
262  /**
263  * @brief Write a given association to the event
264  *
265  * @param associationMap the association to write from objects of type L -> R + D
266  * @param collectionL the collection of type L that has been written
267  * @param collectionR the collection of type R that has been written
268  * @param thisProducesR will this producer produce collectionR of was it produced by a different module?
269  */
270  template <typename L, typename R, typename D>
271  void WriteAssociation(const Association<L, R, D> &associationMap, const Collection<L> &collectionL, const Collection<R> &collectionR,
272  const bool thisProducesR = true) const;
273 
274  /**
275  * @brief Write a given association to the event
276  *
277  * @param associationMap the association to write from objects of type L -> R (no metadata)
278  * @param collectionL the collection of type L that has been written
279  * @param collectionR the collection of type R that has been written
280  * @param thisProducesR will this producer produce collectionR of was it produced by a different module?
281  */
282  template <typename L, typename R>
283  void WriteAssociation(const Association<L, R, void*> &associationMap, const Collection<L> &collectionL, const Collection<R> &collectionR,
284  const bool thisProducesR = true) const;
285 
286  /**
287  * @brief Get the index of an objet in a given collection
288  *
289  * @param object the object to search for
290  * @param collection the collection to search through
291  *
292  * @return the index of the object in the collection
293  */
294  template<typename T>
295  size_t GetIndex(const art::Ptr<T> object, const Collection<T> &collection) const;
296 
297  art::EDProducer *m_pProducer; ///< The producer which should write the output collections and associations
298  art::Event *m_pEvent; ///< The event to consider
299  Labels m_labels; ///< A set of labels describing the producers for each input collection
300  bool m_shouldProduceT0s; ///< If T0s should be produced (usually only true for use cases with multiple drift volumes)
301 
302  // Collections
303  PFParticleCollection m_pfParticles; ///< The input collection of PFParticles
304  SpacePointCollection m_spacePoints; ///< The input collection of SpacePoints
305  ClusterCollection m_clusters; ///< The input collection of Clusters
306  VertexCollection m_vertices; ///< The input collection of Vertices
307  SliceCollection m_slices; ///< The input collection of Slices
308  TrackCollection m_tracks; ///< The input collection of Tracks
309  ShowerCollection m_showers; ///< The input collection of Showers
310  T0Collection m_t0s; ///< The input collection of T0s
311  PFParticleMetadataCollection m_metadata; ///< The input collection of PFParticle metadata
312  PCAxisCollection m_pcAxes; ///< The input collection of PCAxes
313  HitCollection m_hits; ///< The input collection of Hits
314 
315  // Association maps
316  PFParticleToSpacePointAssoc m_pfParticleSpacePointMap; ///< The input associations: PFParticle -> SpacePoint
317  PFParticleToClusterAssoc m_pfParticleClusterMap; ///< The input associations: PFParticle -> Cluster
318  PFParticleToVertexAssoc m_pfParticleVertexMap; ///< The input associations: PFParticle -> Vertex
319  PFParticleToSliceAssoc m_pfParticleSliceMap; ///< The input associations: PFParticle -> Slice
320  PFParticleToTrackAssoc m_pfParticleTrackMap; ///< The input associations: PFParticle -> Track
321  PFParticleToShowerAssoc m_pfParticleShowerMap; ///< The input associations: PFParticle -> Shower
322  PFParticleToT0Assoc m_pfParticleT0Map; ///< The input associations: PFParticle -> T0
323  PFParticleToPFParticleMetadataAssoc m_pfParticleMetadataMap; ///< The input associations: PFParticle -> Metadata
324  PFParticleToPCAxisAssoc m_pfParticlePCAxisMap; ///< The input associations: PFParticle -> PCAxis
325  SpacePointToHitAssoc m_spacePointHitMap; ///< The input associations: SpacePoint -> Hit
326  ClusterToHitAssoc m_clusterHitMap; ///< The input associations: Cluster -> Hit
327  SliceToHitAssoc m_sliceHitMap; ///< The input associations: Slice -> Hit
328  TrackToHitAssoc m_trackHitMap; ///< The input associations: Track -> Hit
329  ShowerToHitAssoc m_showerHitMap; ///< The input associations: Shower -> Hit
330  ShowerToPCAxisAssoc m_showerPCAxisMap; ///< The input associations: PCAxis -> Shower
331 };
332 
333 //------------------------------------------------------------------------------------------------------------------------------------------
334 
335 template <typename T>
336 inline void LArPandoraEvent::GetCollection(const Labels::LabelType &inputLabel, Collection<T> &outputCollection) const
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 }
343 
344 //------------------------------------------------------------------------------------------------------------------------------------------
345 
346 template <typename L, typename R, typename D>
347 inline void LArPandoraEvent::GetAssociationMap(const Collection<L> &collectionL, const Labels::LabelType &inputLabel,
348  Association<L, R, D> &outputAssociationMap) const
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 }
368 
369 //------------------------------------------------------------------------------------------------------------------------------------------
370 
371 template <typename L, typename R>
372 inline void LArPandoraEvent::GetAssociationMap(const Collection<L> &collectionL, const Labels::LabelType &inputLabel,
373  Association<L, R, void*> &outputAssociationMap) const
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 }
393 
394 //------------------------------------------------------------------------------------------------------------------------------------------
395 
396 template <typename L, typename R, typename D>
397 inline void LArPandoraEvent::CollectAssociated(const art::Ptr<L> &anObject, const Association<L, R, D> &associationLtoR,
398  Collection<R> &associatedR) const
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 }
410 
411 //------------------------------------------------------------------------------------------------------------------------------------------
412 
413 template <typename L, typename R, typename D>
414 inline void LArPandoraEvent::GetFilteredAssociationMap(const Collection<L> &collectionL, const Collection<R> &collectionR,
415  const Association<L, R, D> &inputAssociationLtoR, Association<L, R, D> &outputAssociationLtoR) const
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 }
434 
435 //------------------------------------------------------------------------------------------------------------------------------------------
436 
437 template <typename T>
438 inline void LArPandoraEvent::WriteCollection(const Collection<T> &collection) const
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 }
447 
448 //------------------------------------------------------------------------------------------------------------------------------------------
449 
450 template <typename L, typename R, typename D>
451 inline void LArPandoraEvent::WriteAssociation(const Association<L, R, D> &associationMap, const Collection<L> &collectionL,
452  const Collection<R> &collectionR, const bool thisProducesR) const
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 }
487 
488 //------------------------------------------------------------------------------------------------------------------------------------------
489 
490 template <typename L, typename R>
491 inline void LArPandoraEvent::WriteAssociation(const Association<L, R, void*> &associationMap, const Collection<L> &collectionL,
492  const Collection<R> &collectionR, const bool thisProducesR) const
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 }
526 
527 //------------------------------------------------------------------------------------------------------------------------------------------
528 
529 template<typename T>
530 inline size_t LArPandoraEvent::GetIndex(const art::Ptr<T> object, const Collection<T> &collection) const
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 }
538 
539 } // namespace lar_pandora
540 
541 #endif // #ifndef LAR_PANDORA_EVENT_H
Association< recob::PFParticle, recob::PCAxis, void * > PFParticleToPCAxisAssoc
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.
Collection< recob::Cluster > ClusterCollection
LArPandoraEvent class.
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.
Declaration of signal hit object.
Association< recob::Cluster, recob::Hit, void * > ClusterToHitAssoc
Association< recob::PFParticle, recob::SpacePoint, void * > PFParticleToSpacePointAssoc
PFParticleToTrackAssoc m_pfParticleTrackMap
The input associations: PFParticle -&gt; Track.
Collection< larpandoraobj::PFParticleMetadata > PFParticleMetadataCollection
PFParticleToClusterAssoc m_pfParticleClusterMap
The input associations: PFParticle -&gt; Cluster.
PFParticleToPCAxisAssoc m_pfParticlePCAxisMap
The input associations: PFParticle -&gt; PCAxis.
Class to keep data related to recob::Hit associated with recob::Track.
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...
Association< recob::Shower, recob::PCAxis, void * > ShowerToPCAxisAssoc
void SetLabel(const LabelType type, const std::string &label)
Set the label of a given type.
LArPandoraEvent(art::EDProducer *pProducer, art::Event *pEvent, const Labels &inputLabels, const bool shouldProduceT0s=false)
Constructor from an art::Event.
Association< recob::PFParticle, recob::Track, void * > PFParticleToTrackAssoc
PCAxisCollection m_pcAxes
The input collection of PCAxes.
PFParticleCollection m_pfParticles
The input collection of PFParticles.
Labels(const std::string &pfParticleProducerLabel, const std::string &hitProducerLabel)
Minimal parametrised constructor. Sets all collection labels to be the same as the PFParticle produce...
void GetCollections()
Get the collections and associations from m_pEvent with the required labels.
ClusterToHitAssoc m_clusterHitMap
The input associations: Cluster -&gt; Hit.
std::vector< art::Ptr< T > > Collection
Shorthand for a collection of objects of type T.
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...
Association< recob::Slice, recob::Hit, void * > SliceToHitAssoc
Collection< recob::PCAxis > PCAxisCollection
std::vector< std::pair< art::Ptr< R >, D > > PairVector
Association< recob::Track, recob::Hit, recob::TrackHitMeta > TrackToHitAssoc
PFParticleToPFParticleMetadataAssoc m_pfParticleMetadataMap
The input associations: PFParticle -&gt; Metadata.
Collection< recob::SpacePoint > SpacePointCollection
Collection< recob::Hit > HitCollection
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
SpacePointCollection m_spacePoints
The input collection of SpacePoints.
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
ShowerToHitAssoc m_showerHitMap
The input associations: Shower -&gt; Hit.
Association< recob::PFParticle, anab::T0, void * > PFParticleToT0Assoc
Collection< anab::T0 > T0Collection
Association< recob::SpacePoint, recob::Hit, void * > SpacePointToHitAssoc
art::Event * m_pEvent
The event to consider.
PFParticleToT0Assoc m_pfParticleT0Map
The input associations: PFParticle -&gt; T0.
Association< recob::PFParticle, recob::Shower, void * > PFParticleToShowerAssoc
Declaration of cluster object.
Association< recob::PFParticle, recob::Vertex, void * > PFParticleToVertexAssoc
Association< recob::PFParticle, larpandoraobj::PFParticleMetadata, void * > PFParticleToPFParticleMetadataAssoc
Collection< recob::Slice > SliceCollection
Collection< recob::Shower > ShowerCollection
Provides recob::Track data product.
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.
art::EDProducer * m_pProducer
The producer which should write the output collections and associations.
Association< recob::Shower, recob::Hit, void * > ShowerToHitAssoc
Association< recob::PFParticle, recob::Cluster, void * > PFParticleToClusterAssoc
Class to handle the required producer labels.
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG simSlidingORM6O6 effSlidingORW output
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.
std::map< art::Ptr< L >, PairVector< R, D > > Association
General purpose short-hand with optional D parameter.
void GetCollection(const Labels::LabelType &inputLabel, Collection< T > &outputCollection) const
Gets a given collection from m_pEvent with the label supplied.
Collection< recob::PFParticle > PFParticleCollection
Collection< recob::Vertex > VertexCollection
void WriteCollection(const Collection< T > &collection) const
Write a given collection to the event.
VertexCollection m_vertices
The input collection of Vertices.
helper function for LArPandoraInterface producer module
const std::string & GetLabel(const LabelType type) const
Get the label of a given type.
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.
Collection< recob::Track > TrackCollection
size_t GetIndex(const art::Ptr< T > object, const Collection< T > &collection) const
Get the index of an objet in a given collection.
Association< recob::PFParticle, recob::Slice, void * > PFParticleToSliceAssoc
std::map< LabelType, std::string > m_labels
Map holding the labels.
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) ...
void WriteToEvent() const
Write (put) the collections in this LArPandoraEvent to the art::Event.