_Geant4 Version:4.11.2
_Operating System:Ubuntu24.04
_Compiler/Version:gcc 13.2.0
_CMake Version: 3.27.0
In Fact I have a trivial or stupid question. I don’t understand why the PrimaryGenerator Action constructor requires as an argument a DetectorConstruction* which is not used. For example in the TestEm5 example
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* DC)
:G4VUserPrimaryGeneratorAction(),
fParticleGun(0),fDetector(DC),fRndmBeam(0),fGunMessenger(0)
{
G4int n_particle = 1;
fParticleGun = new G4ParticleGun(n_particle);
SetDefaultKinematic();
//create a messenger for this class
fGunMessenger = new PrimaryGeneratorMessenger(this);
}