CollectionSplitting_module.cc
Go to the documentation of this file.
1 /**
2  * @file larpandora/LArPandoraEventBuilding/CollectionSplitting_module.cc
3  *
4  * @brief module for lar pandora collection splitting
5  */
6 
10 
11 #include "fhiclcpp/ParameterSet.h"
12 
13 #include <memory>
14 
15 namespace lar_pandora
16 {
17 
18 class CollectionSplitting;
19 
20 
22 {
23 public:
24  explicit CollectionSplitting(fhicl::ParameterSet const & pset);
25 
26  CollectionSplitting(CollectionSplitting const &) = delete;
30 
31  void produce(art::Event & e) override;
32 
33 private:
34  std::string m_inputProducerLabel; ///< Label for the Pandora instance that produced the collections we want to split up
35  std::string m_trackProducerLabel; ///< Label for the track producer using the Pandora instance that produced the collections we want to split up
36  std::string m_showerProducerLabel; ///< Label for the shower producer using the Pandora instance that produced the collections we want to split up
37  std::string m_hitProducerLabel; ///< Label for the hit producer that was used as input to the Pandora instance specified
38  bool m_shouldProduceT0s; ///< If we should produce T0s (relevant when stitching over multiple drift volumes)
39 };
40 
42 
43 } // namespace lar_pandora
44 
45 //------------------------------------------------------------------------------------------------------------------------------------------
46 // implementation follows
47 
57 
59 
60 namespace lar_pandora
61 {
62 
64  EDProducer{pset},
65  m_inputProducerLabel(pset.get<std::string>("InputProducerLabel")),
66  m_trackProducerLabel(pset.get<std::string>("TrackProducerLabel")),
67  m_showerProducerLabel(pset.get<std::string>("ShowerProducerLabel")),
68  m_hitProducerLabel(pset.get<std::string>("HitProducerLabel")),
69  m_shouldProduceT0s(pset.get<bool>("ShouldProduceT0s", false))
70 {
71  produces< std::vector<recob::PFParticle> >();
72  produces< std::vector<recob::SpacePoint> >();
73  produces< std::vector<recob::Cluster> >();
74  produces< std::vector<recob::Vertex> >();
75  produces< std::vector<recob::Slice> >();
76  produces< std::vector<recob::Track> >();
77  produces< std::vector<recob::Shower> >();
78  produces< std::vector<recob::PCAxis> >();
79  produces< std::vector<larpandoraobj::PFParticleMetadata> >();
80 
81  produces< art::Assns<recob::PFParticle, recob::SpacePoint> >();
82  produces< art::Assns<recob::PFParticle, recob::Cluster> >();
83  produces< art::Assns<recob::PFParticle, recob::Vertex> >();
84  produces< art::Assns<recob::PFParticle, recob::Slice> >();
85  produces< art::Assns<recob::PFParticle, recob::Track> >();
86  produces< art::Assns<recob::PFParticle, recob::Shower> >();
87  produces< art::Assns<recob::PFParticle, recob::PCAxis> >();
88  produces< art::Assns<recob::PFParticle, larpandoraobj::PFParticleMetadata> >();
89  produces< art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta> >();
90  produces< art::Assns<recob::Shower, recob::Hit> >();
91  produces< art::Assns<recob::Shower, recob::PCAxis> >();
92  produces< art::Assns<recob::SpacePoint, recob::Hit> >();
93  produces< art::Assns<recob::Cluster, recob::Hit> >();
94  produces< art::Assns<recob::Slice, recob::Hit> >();
95 
97  {
98  produces< std::vector<anab::T0> >();
99  produces< art::Assns<recob::PFParticle, anab::T0> >();
100  }
101 }
102 
103 //------------------------------------------------------------------------------------------------------------------------------------------
104 
106 {
108  const lar_pandora::LArPandoraEvent pandoraEvent(this, &evt, labels, m_shouldProduceT0s);
109 
110  pandoraEvent.WriteToEvent();
111 }
112 
113 } // namespace lar_pandora
std::string m_trackProducerLabel
Label for the track producer using the Pandora instance that produced the collections we want to spli...
LArPandoraEvent class.
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
Class to keep data related to recob::Hit associated with recob::Track.
std::string m_showerProducerLabel
Label for the shower producer using the Pandora instance that produced the collections we want to spl...
CollectionSplitting & operator=(CollectionSplitting const &)=delete
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
A description of all outputs from an instance of pandora with functionality to filter and merge multi...
std::string m_inputProducerLabel
Label for the Pandora instance that produced the collections we want to split up. ...
bool m_shouldProduceT0s
If we should produce T0s (relevant when stitching over multiple drift volumes)
Declaration of signal hit object.
CollectionSplitting(fhicl::ParameterSet const &pset)
Class to handle the required producer labels.
Provides recob::Track data product.
TCEvent evt
Definition: DataStructs.cxx:7
std::string m_hitProducerLabel
Label for the hit producer that was used as input to the Pandora instance specified.
void WriteToEvent() const
Write (put) the collections in this LArPandoraEvent to the art::Event.