LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
GenericCRT_module.cc
Go to the documentation of this file.
1 // Class: GenericCRT
3 // Plugin Type: producer (art v3_05_01)
4 // File: GenericCRT_module.cc
5 //
6 // Generated at Wed Oct 28 07:07:35 2020 by Andrzej Szelc using cetskelgen
7 // from cetlib version v3_10_00.
9 
12 
20 #include "fhiclcpp/ParameterSet.h"
22 
23 #include "GenericCRT.h"
24 
25 #include <memory>
26 #include <string>
27 #include <utility>
28 #include <vector>
29 
30 namespace sim {
31  class GenericCRT;
32 }
33 
35 public:
36  explicit GenericCRT(fhicl::ParameterSet const& p);
37  // The compiler-generated destructor is fine for non-base
38  // classes without bare pointers or other resource use.
39 
40  // Plugins should not be copied or assigned.
41  GenericCRT(GenericCRT const&) = delete;
42  GenericCRT(GenericCRT&&) = delete;
43  GenericCRT& operator=(GenericCRT const&) = delete;
44  GenericCRT& operator=(GenericCRT&&) = delete;
45 
46  // Required functions.
47  void produce(art::Event& e) override;
48 
49 private:
50  std::string fEnergyUnitsScale;
52 
53  // Declare member data here.
54 };
55 
57  : EDProducer{p} //
58  , fEnergyUnitsScale(p.get<std::string>("EnergyUnitsScale", "MeV"))
60 // More initializers here.
61 {
62 
63  produces<std::vector<sim::AuxDetSimChannel>>();
64 }
65 
67 {
68  // Implementation of required member function here.
69  //std::unique_ptr< std::vector< sim::AuxDetSimChannel > > adCol (new std::vector<sim::AuxDetSimChannel> );
70  auto adCol = std::make_unique<std::vector<sim::AuxDetSimChannel>>();
71 
72  auto const& auxdethitcollection = e.getMany<std::vector<sim::AuxDetHit>>();
73 
74  for (size_t ii = 0; ii < auxdethitcollection.size(); ii++) {
75  for (auto ch : fCRTConvertUtil.GetAuxDetSimChannels(*(auxdethitcollection.at(ii))))
76  adCol->emplace_back(ch);
77  }
78 
79  e.put(std::move(adCol));
80 }
81 
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
sim::GenericCRTUtility fCRTConvertUtil
GenericCRT & operator=(GenericCRT const &)=delete
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
void produce(art::Event &e) override
object containing MC truth information necessary for making RawDigits and doing back tracking ...
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
std::vector< sim::AuxDetSimChannel > GetAuxDetSimChannels(const std::vector< sim::AuxDetHit > &InputHitVector) const
Definition: GenericCRT.cxx:133
Monte Carlo Simulation.
GenericCRT(fhicl::ParameterSet const &p)
std::string fEnergyUnitsScale
Float_t e
Definition: plot.C:35
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const