LArSoft  v10_04_05
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 
13 
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include "GenericCRT.h"
21 
22 #include <memory>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 namespace sim {
28  class GenericCRT;
29 }
30 
32 public:
33  explicit GenericCRT(fhicl::ParameterSet const& p);
34 
35 private:
36  void produce(art::Event& e) override;
38 };
39 
41  : EDProducer{p}
42  , fCRTConvertUtil(p.get<std::string>("EnergyUnitsScale", "MeV"),
44 {
45  produces<std::vector<sim::AuxDetSimChannel>>();
46 }
47 
49 {
50  auto adCol = std::make_unique<std::vector<sim::AuxDetSimChannel>>();
51 
52  auto const& auxdethitcollection = e.getMany<std::vector<sim::AuxDetHit>>();
53 
54  for (size_t ii = 0; ii < auxdethitcollection.size(); ii++) {
55  for (auto ch : fCRTConvertUtil.GetAuxDetSimChannels(*(auxdethitcollection.at(ii))))
56  adCol->emplace_back(ch);
57  }
58 
59  e.put(std::move(adCol));
60 }
61 
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
sim::GenericCRTUtility fCRTConvertUtil
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
art framework interface to geometry description for auxiliary detectors
Monte Carlo Simulation.
GenericCRT(fhicl::ParameterSet const &p)
Float_t e
Definition: plot.C:35
std::vector< AuxDetSimChannel > GetAuxDetSimChannels(std::vector< AuxDetHit > const &adhits) const
Definition: GenericCRT.cxx:137
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const