LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SNNueAr40CCGen_module.cc
Go to the documentation of this file.
1 
11 // Framework includes
17 #include "fhiclcpp/ParameterSet.h"
18 
19 // nurandom includes
21 
22 // nusimdata includes
24 
25 // LArSoft includes
29 
30 // C++ includes
31 
32 namespace evgen {
33 
37  public:
38  explicit SNNueAr40CCGen(fhicl::ParameterSet const& pset);
39 
40  private:
41  void beginRun(art::Run& run) override;
42  void produce(art::Event& event) override;
43 
44  CLHEP::HepRandomEngine& fEngine;
46  };
47 
48  //____________________________________________________________________________
50  : EDProducer{pset} // Create a default random engine: obtain the random seed
51  // freom NuRandomService, unless overriden in configuration with key "Seed"
53  pset,
54  "Seed"))
55  , fGenerator{pset.get<fhicl::ParameterSet>("GeneratorAlg")}
56  {
57  produces<std::vector<simb::MCTruth>>();
58  produces<sumdata::RunData, art::InRun>();
59  }
60 
61  //____________________________________________________________________________
63  {
64  // Store information about the geometry we are using in run information
66  run.put(std::make_unique<sumdata::RunData>(geo->DetectorName()), art::fullRun());
67  }
68 
69  //____________________________________________________________________________
71  {
72  event.put(std::make_unique<std::vector<simb::MCTruth>>(fGenerator.Generate(fEngine)));
73  }
74 
75 }
76 
base_engine_t & createEngine(seed_t seed)
constexpr auto fullRun()
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Run.h:121
Definition: Run.h:37
void beginRun(art::Run &run) override
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:65
evgen::NueAr40CCGenerator fGenerator
SNNueAr40CCGen(fhicl::ParameterSet const &pset)
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
void produce(art::Event &event) override
std::vector< simb::MCTruth > Generate(CLHEP::HepRandomEngine &engine)
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
Namespace collecting geometry-related classes utilities.
Event Generation using GENIE, cosmics or single particles.
art framework interface to geometry description
CLHEP::HepRandomEngine & fEngine
Event finding and building.