All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFFHitFinder_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: RFFHitFinder
3 // Module Type: producer
4 // File: RFFHitFinder_module.cc
5 //
6 // Generated at Fri Jan 30 17:27:31 2015 by Wesley Ketchum using artmod
7 // from cetpkgsupport v1_08_02.
8 ////////////////////////////////////////////////////////////////////////
9 
10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "art/Framework/Services/Registry/ServiceHandle.h"
15 #include "canvas/Utilities/InputTag.h"
16 #include "fhiclcpp/ParameterSet.h"
17 
20 
21 #include <memory>
22 
24 
25 namespace hit{
26  class RFFHitFinder;
27 }
28 
29 namespace hit{
30 
31  class RFFHitFinder : public art::EDProducer {
32  public:
33  explicit RFFHitFinder(fhicl::ParameterSet const & p);
34 
35  // Plugins should not be copied or assigned.
36  RFFHitFinder(RFFHitFinder const &) = delete;
37  RFFHitFinder(RFFHitFinder &&) = delete;
38  RFFHitFinder & operator = (RFFHitFinder const &) = delete;
39  RFFHitFinder & operator = (RFFHitFinder &&) = delete;
40 
41  private:
42  // Required functions.
43  void produce(art::Event & e) override;
44 
45  // Selected optional functions.
46  void beginJob() override;
47 
48  art::InputTag fWireModuleLabel;
50  };
51 
52 
53  RFFHitFinder::RFFHitFinder(fhicl::ParameterSet const & p)
54  :
55  EDProducer{p},
56  fWireModuleLabel(p.get<std::string>("WireModuleLabel")),
57  fAlg(p.get<fhicl::ParameterSet>("RFFHitFinderAlgParams"))
58  {
59  //calls the produces stuff for me!
61  }
62 
63  void RFFHitFinder::produce(art::Event & e)
64  {
65  art::ServiceHandle<geo::Geometry const> geoHandle;
66 
67  art::Handle< std::vector<recob::Wire> > wireHandle;
68  e.getByLabel(fWireModuleLabel,wireHandle);
69 
70  std::unique_ptr< std::vector<recob::Hit> > hitCollection(new std::vector<recob::Hit>);
71  fAlg.Run(*wireHandle,*hitCollection,*geoHandle);
72 
74  hcol.use_hits(std::move(hitCollection));
75  hcol.put_into(e);
76 
77  //e.put(std::move(hitCollection));
78  }
79 
81  {
82  art::ServiceHandle<geo::Geometry const> geoHandle;
83  geo::Geometry const& geo(*geoHandle);
85  }
86 
87 }
88 
89 DEFINE_ART_MODULE(hit::RFFHitFinder)
art::InputTag fWireModuleLabel
void Run(std::vector< recob::Wire > const &, std::vector< recob::Hit > &, geo::Geometry const &)
pdgs p
Definition: selectors.fcl:22
void use_hits(std::unique_ptr< std::vector< recob::Hit >> &&srchits)
Uses the specified collection as data product.
Definition: HitCreator.cxx:390
process_name hit
Definition: cheaterreco.fcl:51
static void declare_products(art::ProducesCollector &collector, std::string instance_name="", bool doWireAssns=true, bool doRawDigitAssns=true)
Declares the hit products we are going to fill.
Definition: HitCreator.cxx:248
void SetFitterParamsVectors(geo::Geometry const &)
Helper functions to create a hit.
A class handling a collection of hits and its associations.
Definition: HitCreator.h:692
The geometry of one entire detector, as served by art.
Definition: Geometry.h:181
RFFHitFinder(fhicl::ParameterSet const &p)
RFFHitFinder & operator=(RFFHitFinder const &)=delete
void produce(art::Event &e) override
void put_into(art::Event &)
Moves the data into the event.
Definition: HitCreator.h:801
do i e
art framework interface to geometry description
RFFHitFinderAlg fAlg
void beginJob() override