LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
CollectionSplitting_module.cc
Go to the documentation of this file.
1 
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;
35  std::string m_TrackProducerLabel;
36  std::string m_ShowerProducerLabel;
37  std::string m_HitProducerLabel;
41 };
42 
44 
45 } // namespace lar_pandora
46 
47 //------------------------------------------------------------------------------------------------------------------------------------------
48 // implementation follows
49 
57 
59 
60 namespace lar_pandora
61 {
62 
64  m_InputProducerLabel(pset.get<std::string>("InputProducerLabel")),
65  m_TrackProducerLabel(pset.get<std::string>("TrackProducerLabel")),
66  m_ShowerProducerLabel(pset.get<std::string>("ShowerProducerLabel")),
67  m_HitProducerLabel(pset.get<std::string>("HitProducerLabel")),
68  m_ShouldProduceNeutrinos(pset.get<bool>("ShouldProduceNeutrinos", true)),
69  m_ShouldProduceCosmics(pset.get<bool>("ShouldProduceCosmics", true)),
70  m_ShouldProduceT0s(pset.get<bool>("ShouldProduceT0s", false))
71 {
72  produces< std::vector<recob::PFParticle> >();
73  produces< std::vector<recob::SpacePoint> >();
74  produces< std::vector<recob::Cluster> >();
75  produces< std::vector<recob::Vertex> >();
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::Track> >();
85  produces< art::Assns<recob::PFParticle, recob::Shower> >();
86  produces< art::Assns<recob::PFParticle, recob::PCAxis> >();
87  produces< art::Assns<recob::PFParticle, larpandoraobj::PFParticleMetadata> >();
88  produces< art::Assns<recob::Track, recob::Hit> >();
89  produces< art::Assns<recob::Shower, recob::Hit> >();
90  produces< art::Assns<recob::Shower, recob::PCAxis> >();
91  produces< art::Assns<recob::SpacePoint, recob::Hit> >();
92  produces< art::Assns<recob::Cluster, recob::Hit> >();
93 
95  {
96  produces< std::vector<anab::T0> >();
97  produces< art::Assns<recob::PFParticle, anab::T0> >();
98  }
99 }
100 
101 //------------------------------------------------------------------------------------------------------------------------------------------
102 
104 {
106  throw cet::exception("LArPandora") << " CollectionSplitting -- Must be configured to produce neutrinos or cosmics or both.";
107 
109  const lar_pandora::LArPandoraEvent fullEvent(this, &evt, labels, m_ShouldProduceT0s);
110 
112  {
113  fullEvent.WriteToEvent();
114  }
115  else
116  {
118  filteredEvent.WriteToEvent();
119  }
120 }
121 
122 } // namespace lar_pandora
123 
LArPandoraEvent class.
std::string m_TrackProducerLabel
Label for the track producer using the Pandora instance that produced the collections we want to spli...
Declaration of signal hit object.
bool m_ShouldProduceT0s
If we should produce T0s (relevant when stitching over multiple drift volumes)
STL namespace.
LArPandoraEvent FilterByPdgCode(const bool shouldProduceNeutrinos) const
Produce a copy of the event keeping only the collections that are associated with a top-level particl...
bool m_ShouldProduceCosmics
If we should produce collections related to cosmic top-level PFParticles.
CollectionSplitting & operator=(CollectionSplitting const &)=delete
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:42
A description of all outputs from an instance of pandora with functionality to filter and merge multi...
Declaration of cluster object.
Provides recob::Track data product.
std::string m_InputProducerLabel
Label for the Pandora instance that produced the collections we want to split up. ...
CollectionSplitting(fhicl::ParameterSet const &pset)
Class to handle the required producer labels.
std::string m_HitProducerLabel
Label for the hit producer that was used as input to the Pandora instance specified.
std::string m_ShowerProducerLabel
Label for the shower producer using the Pandora instance that produced the collections we want to spl...
Float_t e
Definition: plot.C:34
bool m_ShouldProduceNeutrinos
If we should produce collections related to neutrino top-level PFParticles.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void WriteToEvent() const
Write (put) the collections in this LArPandoraEvent to the art::Event.