LDMX Software
PrimaryGeneratorAction.h
Go to the documentation of this file.
1
7#ifndef SIMCORE_G4USER_PRIMARYGENERATORACTION_H
8#define SIMCORE_G4USER_PRIMARYGENERATORACTION_H
9
10/*~~~~~~~~~~~~~~~~*/
11/* C++ StdLib */
12/*~~~~~~~~~~~~~~~~*/
13#include <algorithm>
14#include <memory>
15
16/*~~~~~~~~~~~~*/
17/* Geant4 */
18/*~~~~~~~~~~~~*/
19#include "G4VUserPrimaryGeneratorAction.hh"
20
21/*~~~~~~~~~~~~~~~*/
22/* Framework */
23/*~~~~~~~~~~~~~~~*/
24#include "Framework/Configure/Parameters.h"
25
26// Forward declarations
27class G4Event;
28
29namespace simcore::g4user {
30
35class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction {
36 public:
37 /*
38 * Constructor
39 *
40 * @param parameters The parameters used to configure the primary
41 * generator action.
42 */
44
48 virtual ~PrimaryGeneratorAction() = default;
49
81 void GeneratePrimaries(G4Event* event) override;
82
83 private:
88 bool useBeamspot_{false};
89
91 double beamspotXSize_{0};
92
94 double beamspotYSize_{0};
95
97 double beamspotZSize_{0.};
98
106
107}; // PrimaryGeneratorAction
108
109} // namespace simcore::g4user
110
111#endif // SIMCORE_G4USER_PRIMARYGENERATORACTION_H
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Implementation of Geant4 primary generator action.
double beamspotXSize_
Extent of the beamspot in x.
double beamspotYSize_
Extent of the beamspot in y.
double beamspotZSize_
Extent of the beamspot in y.
void GeneratePrimaries(G4Event *event) override
Generate primaries for the event.
virtual ~PrimaryGeneratorAction()=default
Class destructor.
bool useBeamspot_
Flag denoting whether the vertex position of a particle should be smeared.
bool time_shift_primaries_
Should we time-shift so that the primary vertices arrive (or originate) at t=0ns at z=0mm?