LDMX Software
MultiParticleGunPrimaryGenerator.h
Go to the documentation of this file.
1
8#ifndef SIMCORE_MULTIPARTICLEGUNPRIMARYGENERATOR_H_
9#define SIMCORE_MULTIPARTICLEGUNPRIMARYGENERATOR_H_
10
11//----------------//
12// C++ StdLib //
13//----------------//
14#include <string>
15
16//------------//
17// Geant4 //
18//------------//
19#include "G4Event.hh"
20#include "G4PhysicalConstants.hh"
21#include "G4SystemOfUnits.hh"
22#include "G4VPrimaryGenerator.hh"
23
24//----------//
25// ROOT //
26//----------//
27#include "TRandom.h"
28
29//-------------//
30// LDMX-SW //
31//-------------//
33
34namespace simcore {
35namespace generators {
36
43 public:
58 const std::string& name, const framework::config::Parameters& parameters);
59
67 void GeneratePrimaryVertex(G4Event* anEvent) override;
68
69 void RecordConfig(const std::string& id, ldmx::RunHeader& rh) override;
70
71 private:
73 TRandom* random_;
74
76 G4ThreeVector mpg_vertex_;
77
79 G4ThreeVector mpg_momentum_;
80
82 double mpg_n_particles_{1.};
83
85 int mpg_pdg_id_{99999};
86
92
93}; // MultiParticleGunPrimaryGenerator
94
95} // namespace generators
96} // namespace simcore
97
98#endif // SIMCORE_MULTIPARTICLEGUNPRIMARYGENERATOR_H_
Header file for PrimaryGenerator.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:68
Interface that defines a simulation primary generator.
Generates a Geant4 event from particle gun, but can have many particles.
void GeneratePrimaryVertex(G4Event *anEvent) override
Generate vertices in the Geant4 event.
void RecordConfig(const std::string &id, ldmx::RunHeader &rh) override
Record the configuration of the primary generator into the run header.
MultiParticleGunPrimaryGenerator(const std::string &name, const framework::config::Parameters &parameters)
Constructor.
double mpg_n_particles_
Number of particles that will be fired by the gun per event.
G4ThreeVector mpg_vertex_
The vertex position from which to fire the particles.
G4ThreeVector mpg_momentum_
The initial momentum of the particles.
bool mpg_enable_poisson_
Flag denoting whether the number of incident particles should be Poisson distributed.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...