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 <fstream>
15#include <iostream>
16#include <string>
17
18//------------//
19// Geant4 //
20//------------//
21#include "G4Event.hh"
22#include "G4IonTable.hh"
23#include "G4PhysicalConstants.hh"
24#include "G4RunManager.hh"
25#include "G4SystemOfUnits.hh"
26#include "G4VPrimaryGenerator.hh"
27
28//----------//
29// ROOT //
30//----------//
31#include "Math/Vector3D.h"
32#include "TFile.h"
33#include "TLorentzVector.h"
34#include "TRandom.h"
35#include "TTree.h"
36
37//-------------//
38// LDMX-SW //
39//-------------//
43
44namespace simcore {
45namespace generators {
46
53 public:
68 const std::string& name, const framework::config::Parameters& parameters);
69
77 void GeneratePrimaryVertex(G4Event* anEvent) override;
78
79 void RecordConfig(const std::string& id, ldmx::RunHeader& rh) override;
80
81 private:
83 TRandom* random_;
84
86 G4ThreeVector mpg_vertex_;
87
89 G4ThreeVector mpg_momentum_;
90
92 double mpg_n_particles_{1.};
93
95 int mpg_pdg_id_{99999};
96
102
103}; // MultiParticleGunPrimaryGenerator
104
105} // namespace generators
106} // namespace simcore
107
108#endif // SIMCORE_MULTIPARTICLEGUNPRIMARYGENERATOR_H_
Class that provides header information about an event such as event number and timestamp.
Header file for PrimaryGenerator.
Class that provides extra information for Geant4 primary particles.
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.
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 ...