#include "B2PrimaryGeneratorAction.hh" #include "G4LogicalVolumeStore.hh" #include "G4LogicalVolume.hh" #include "G4Box.hh" #include "G4Event.hh" #include "G4ParticleGun.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "G4SystemOfUnits.hh" #include "Randomize.hh"
B2PrimaryGeneratorAction.hh
This header defines the B2PrimaryGeneratorAction
class, which is responsible for generating the primary particles in the simulation. It inherits from G4VUserPrimaryGeneratorAction
, allowing it to implement custom behavior for particle generation during events.
G4LogicalVolumeStore.hh
This header provides access to the G4LogicalVolumeStore
, a container that holds all logical volumes in the simulation. Logical volumes define the properties of a volume, such as its material and sensitivity, but do not have a physical position in space.
G4LogicalVolume.hh
This header defines the G4LogicalVolume
class, which represents a logical volume in Geant4. It contains information about the volume's shape, material, and any daughter volumes it may contain. Logical volumes are essential for organizing the geometry of the simulation.
G4Box.hh
This header defines the G4Box
class, which represents a box-shaped solid (cuboid) in three-dimensional space. The box is defined by its half-lengths along each axis (x, y, z) and is centered at the origin with sides parallel to the coordinate axes. It is commonly used to create simple geometric shapes for simulations.
G4Event.hh
This header defines the G4Event
class, which represents an event in a Geant4 simulation. An event can consist of multiple interactions or processes that occur during a single time step in the simulation. This class is essential for managing and processing events generated during particle interactions.
G4ParticleGun.hh
This header defines the G4ParticleGun
class, which is used to generate particles in a Geant4 simulation. The particle gun allows you to specify properties such as particle type, energy, momentum direction, and position from which particles are emitted.
G4ParticleTable.hh
This header provides access to the G4ParticleTable
, which is a collection of all defined particle types in Geant4. It allows users to retrieve particle definitions based on their names (e.g., "proton") and is essential for setting up particle properties in simulations.
G4ParticleDefinition.hh
This header defines the G4ParticleDefinition
class, which contains detailed information about a specific type of particle (such as mass, charge, and decay properties). This information is crucial for simulating how particles behave under various conditions.
G4SystemOfUnits.hh
This header includes definitions for various physical units used throughout Geant4 (e.g., meters, seconds, electron volts). It allows developers to write code using standard physical units without needing to convert between different unit systems.
Randomize.hh
This header provides functions and classes for random number generation in Geant4 simulations. Randomization is often necessary for simulating stochastic processes, such as particle interactions and decay events.
B2PrimaryGeneratorAction::B2PrimaryGeneratorAction() : G4VUserPrimaryGeneratorAction() { G4int nofParticles = 1; fParticleGun = new G4ParticleGun(nofParticles);
B2PrimaryGeneratorAction
, which inherits from G4VUserPrimaryGeneratorAction
, a base class in Geant4 for generating primary particles.fParticleGun
) is created, which can generate a specified number of particles. Here, it is initialized to generate one particle.