LDMX Software
GenieGenerator.h
Go to the documentation of this file.
1
7#ifndef SIMCORE_GENIE_GENERATOR_H
8#define SIMCORE_GENIE_GENERATOR_H
9
10//----------//
11// ROOT //
12//----------//
13#include "TRandom.h"
14#include "TRandomGen.h"
15
16//------------//
17// GENIE //
18//------------//
19#include <string>
20#include <vector>
21
22#include "GENIE/Framework/EventGen/GEVGDriver.h"
23#include "GENIE/Framework/EventGen/HepMC3Converter.h"
24
25//------------//
26// LDMX //
27//------------//
28#include "Framework/Logger.h"
29#include "SimCore/G4User/UserEventInformation.h"
31
32// Forward declarations
33class G4Event;
34
35namespace simcore {
36namespace generators {
37
43 public:
59 GenieGenerator(const std::string& name,
60 const framework::config::Parameters& parameters);
61
64
70 void GeneratePrimaryVertex(G4Event* event) final override;
71
72 void RecordConfig(const std::string& id, ldmx::RunHeader& rh) final override;
73
74 private:
78 genie::GEVGDriver evg_driver_;
79 genie::HepMC3Converter hep_mc3_converter_;
80
81 double energy_;
82 std::vector<int> targets_;
83 std::vector<double> abundances_;
84 std::vector<double> position_;
85 std::vector<double> beam_size_;
86 float target_thickness_;
87 float time_;
88 std::vector<double> direction_;
89
90 std::string tune_;
91 std::string spline_file_;
92
93 std::string message_threshold_file_;
94
95 std::vector<float> ev_weighting_integral_;
96 size_t n_events_generated_;
97 std::vector<size_t> n_events_by_target_;
98 std::vector<float> xsec_by_target_;
99
100 float xsec_total_;
101
102 void fillConfig(
104 bool validateConfig();
105
106 void initializeGENIE();
107 void calculateTotalXS();
108
109 enableLogging("GenieGenerator")
110
111}; // GenieGenerator
112
113} // namespace generators
114} // namespace simcore
115
116#endif // SIMCORE_GENIE_GENERATOR_H
Header file for PrimaryGenerator.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:57
Interface that defines a simulation primary generator.
Class that uses GENIE's GEVGDriver to generator eN interactions.
void calculateTotalXS()
GENIE initialization.
void initializeGENIE()
simple validation check on configuration params
void RecordConfig(const std::string &id, ldmx::RunHeader &rh) final override
Record the configuration of the primary generator into the run header.
genie::GEVGDriver evg_driver_
The GENIE event generator driver and convertor to HepMC3GenEvent.
GenieGenerator(const std::string &name, const framework::config::Parameters &parameters)
Constructor.
bool validateConfig()
fill the configuration
void GeneratePrimaryVertex(G4Event *event) final override
Generate the primary vertices in the Geant4 event.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...