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 "TFile.h"
32#include "TLorentzVector.h"
33#include "TRandom.h"
34#include "TTree.h"
35#include "TVector3.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 mpgVertex_;
87
89 G4ThreeVector mpgMomentum_;
90
92 double mpgNParticles_{1.};
93
95 int mpgPdgID_{99999};
96
101 bool mpgEnablePoisson_{false};
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:27
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54
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.
G4ThreeVector mpgVertex_
The vertex position from which to fire the particles.
bool mpgEnablePoisson_
Flag denoting whether the number of incident particles should be Poisson distributed.
void RecordConfig(const std::string &id, ldmx::RunHeader &rh) override
Record the configuration of the primary generator into the run header.
G4ThreeVector mpgMomentum_
The initial momentum of the particles.
double mpgNParticles_
Number of particles that will be fired by the gun per event.