Import Geant4 11.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2023-12-08 10:43:34 +01:00
parent dd1f179cda
commit 860a2b92bf
3962 changed files with 139318 additions and 164259 deletions
@@ -48,15 +48,15 @@ class F01ActionInitialization : public G4VUserActionInitialization
{
public:
F01ActionInitialization(F01DetectorConstruction*);
virtual ~F01ActionInitialization();
~F01ActionInitialization() override = default;
virtual void BuildForMaster() const;
virtual void Build() const;
void BuildForMaster() const override;
void Build() const override;
virtual G4VSteppingVerbose* InitializeSteppingVerbose() const;
G4VSteppingVerbose* InitializeSteppingVerbose() const override;
private:
F01DetectorConstruction* fDetConstruction;
F01DetectorConstruction* fDetConstruction = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,9 +45,9 @@ class F01CalorHit : public G4VHit
{
public:
F01CalorHit();
F01CalorHit() = default;
F01CalorHit(const F01CalorHit&);
virtual ~F01CalorHit();
~F01CalorHit() override = default;
const F01CalorHit& operator=(const F01CalorHit&);
G4bool operator==(const F01CalorHit&) const;
@@ -55,7 +55,7 @@ class F01CalorHit : public G4VHit
inline void* operator new(size_t);
inline void operator delete(void*);
virtual void Print();
void Print() override;
public:
@@ -71,14 +71,15 @@ class F01CalorHit : public G4VHit
private:
G4double fEdepAbs, fTrackLengthAbs;
G4double fEdepGap, fTrackLengthGap;
G4double fEdepAbs = 0.;
G4double fTrackLengthAbs = 0.;
G4double fEdepGap = 0.;
G4double fTrackLengthGap = 0.;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
typedef G4THitsCollection<F01CalorHit> F01CalorHitsCollection;
using F01CalorHitsCollection = G4THitsCollection<F01CalorHit>;
extern G4ThreadLocal G4Allocator<F01CalorHit>* F01CalorHitAllocator;
@@ -49,17 +49,17 @@ class F01CalorimeterSD : public G4VSensitiveDetector
public:
F01CalorimeterSD(G4String, F01DetectorConstruction* );
virtual ~F01CalorimeterSD();
~F01CalorimeterSD() override;
virtual void Initialize(G4HCofThisEvent*);
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
virtual void EndOfEvent(G4HCofThisEvent*);
void Initialize(G4HCofThisEvent*) override;
G4bool ProcessHits(G4Step*,G4TouchableHistory*) override;
void EndOfEvent(G4HCofThisEvent*) override;
private:
F01CalorHitsCollection* fCalCollection;
F01DetectorConstruction* fDetector;
G4int* fHitID;
F01CalorHitsCollection* fCalCollection = nullptr;
F01DetectorConstruction* fDetector = nullptr;
G4int* fHitID = nullptr;
};
#endif
@@ -38,6 +38,8 @@
#include "G4VUserDetectorConstruction.hh"
#include "G4Cache.hh"
#include "CLHEP/Units/SystemOfUnits.h"
class G4Box;
class G4Tubs;
class G4LogicalVolume;
@@ -57,7 +59,7 @@ class F01DetectorConstruction : public G4VUserDetectorConstruction
public:
F01DetectorConstruction();
virtual ~F01DetectorConstruction();
~F01DetectorConstruction() override;
public:
@@ -71,8 +73,8 @@ class F01DetectorConstruction : public G4VUserDetectorConstruction
void SetWorldSizeZ(G4double);
void SetWorldSizeR(G4double);
virtual G4VPhysicalVolume* Construct();
virtual void ConstructSDandField();
G4VPhysicalVolume* Construct() override;
void ConstructSDandField() override;
public:
@@ -96,36 +98,37 @@ class F01DetectorConstruction : public G4VUserDetectorConstruction
void SetUseFSALstepper( G4bool val ) { fUseFSALstepper = val; }
G4bool AreUsingFSALstepper() { return fUseFSALstepper; }
private:
F01DetectorMessenger* fDetectorMessenger; // pointer -> Messenger
F01DetectorMessenger* fDetectorMessenger = nullptr; // pointer -> Messenger
G4Cache<F01CalorimeterSD*> fCalorimeterSD; // pointer -> sensitive detector
G4Cache<F01FieldSetup*> fEmFieldSetup;
G4Tubs* fSolidWorld; // pointer to the solid World
G4LogicalVolume* fLogicWorld; // pointer to the logical World
G4VPhysicalVolume* fPhysiWorld; // pointer to the physical World
G4Tubs* fSolidWorld = nullptr; // pointer to the solid World
G4LogicalVolume* fLogicWorld = nullptr; // pointer to the logical World
G4VPhysicalVolume* fPhysiWorld = nullptr; // pointer to the physical World
G4Tubs* fSolidAbsorber; // pointer to the solid Absorber
G4LogicalVolume* fLogicAbsorber; // pointer to the logical Absorber
G4VPhysicalVolume* fPhysiAbsorber; // pointer to the physical Absorber
G4Material* fAbsorberMaterial;
G4double fAbsorberThickness;
G4double fAbsorberRadius;
G4Tubs* fSolidAbsorber = nullptr; // pointer to the solid Absorber
G4LogicalVolume* fLogicAbsorber = nullptr; // pointer to the logical Absorber
G4VPhysicalVolume* fPhysiAbsorber = nullptr; // pointer to the physical Absorber
G4double fZAbsorber;
G4double fZStartAbs, fZEndAbs;
G4Material* fAbsorberMaterial = nullptr;
G4double fAbsorberThickness = 1.0 * CLHEP::mm;
G4double fAbsorberRadius = 20000. * CLHEP::mm;
G4Material* fWorldMaterial;
G4double fWorldSizeR;
G4double fWorldSizeZ;
G4double fZAbsorber = 21990. * CLHEP::mm;
G4double fZStartAbs = 0.;
G4double fZEndAbs = 0.;
G4Material* fWorldMaterial = nullptr;
G4double fWorldSizeR = 22000. * CLHEP::mm;
G4double fWorldSizeZ = 44000. * CLHEP::mm;
G4bool fUseFSALstepper= false;
private:
void DefineMaterials();
void ComputeCalorParameters();
G4VPhysicalVolume* ConstructCalorimeter();
@@ -52,25 +52,25 @@ class F01DetectorMessenger: public G4UImessenger
public:
F01DetectorMessenger(F01DetectorConstruction* );
virtual ~F01DetectorMessenger();
~F01DetectorMessenger() override;
virtual void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String) override;
private:
F01DetectorConstruction* fDetector;
F01DetectorConstruction* fDetector = nullptr;
G4UIdirectory* fDetDir;
G4UIdirectory* fDetDir = nullptr;
G4UIcmdWithAString* fAbsMaterCmd;
G4UIcmdWithADoubleAndUnit* fAbsThickCmd;
G4UIcmdWithADoubleAndUnit* fAbsRadCmd;
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fAbsThickCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fAbsRadCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fAbsZposCmd;
G4UIcmdWithADoubleAndUnit* fAbsZposCmd = nullptr;
G4UIcmdWithAString* fWorldMaterCmd;
G4UIcmdWithADoubleAndUnit* fWorldZCmd;
G4UIcmdWithADoubleAndUnit* fWorldRCmd;
G4UIcmdWithAString* fWorldMaterCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fWorldZCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fWorldRCmd = nullptr;
};
@@ -25,8 +25,8 @@
//
/// \file field/field01/include/F01FieldMessenger.hh
/// \brief F01FieldMessenger allows interactive user control of
// - the strength of the (uniform) magnetic field
// - the key parameters for the accuracy of integration
// - the strength of the (uniform) magnetic field
// - the key parameters for the accuracy of integration
// - the integration method used - a choice between
// * different embedded Runge-Kutta methods or 'tableaus'
// * the symplectic Boris method for accelerator setups
@@ -53,24 +53,24 @@ class F01FieldMessenger: public G4UImessenger
{
public:
F01FieldMessenger(F01FieldSetup* );
virtual ~F01FieldMessenger();
~F01FieldMessenger() override;
virtual void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String) override;
private:
F01FieldSetup* fEMfieldSetup;
F01FieldSetup* fEMfieldSetup = nullptr;
G4UIdirectory* fFieldDir;
G4UIdirectory* fFieldDir = nullptr;
G4UIcmdWithAnInteger* fStepperCmd;
G4UIcmdWithADoubleAndUnit* fMagFieldZCmd;
G4UIcmdWith3VectorAndUnit* fMagFieldCmd;
G4UIcmdWithADoubleAndUnit* fMinStepCmd;
G4UIcmdWithADoubleAndUnit* fDeltaOneStepCmd;
G4UIcmdWithADouble* fEpsMinCmd;
G4UIcmdWithADouble* fEpsMaxCmd;
G4UIcmdWithoutParameter* fUpdateCmd;
G4UIcmdWithAnInteger* fStepperCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fMagFieldZCmd = nullptr;
G4UIcmdWith3VectorAndUnit* fMagFieldCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fMinStepCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fDeltaOneStepCmd = nullptr;
G4UIcmdWithADouble* fEpsMinCmd = nullptr;
G4UIcmdWithADouble* fEpsMaxCmd = nullptr;
G4UIcmdWithoutParameter* fUpdateCmd = nullptr;
};
#endif
@@ -124,10 +124,10 @@ protected:
F01FieldMessenger* fFieldMessenger = nullptr;
// Parameters / Invariant during tracking loop
G4double fMinStep = -1.0;
G4double fDeltaOneStep= -1.0;
G4double fDesiredEpsilonMin = 1.0e-05; // tight: 1.0e-8 std: 1.0e-5 to 1.e-6 loose: 1.0e-4
G4double fDesiredEpsilonMax = 0.005; // tight: 1.0e-5 std: 1.0e-4 to 5.e-3 loose: 1.0e-3+
G4double fMinStep = -1.0;
G4double fDeltaOneStep= -1.0;
G4double fDesiredEpsilonMin = 1.0e-05; // tight: 1.0e-8 std: 1.0e-5 to 1.e-6 loose: 1.0e-4
G4double fDesiredEpsilonMax = 0.005; // tight: 1.0e-5 std: 1.0e-4 to 5.e-3 loose: 1.0e-3+
};
#endif
@@ -50,10 +50,10 @@ class F01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
F01PrimaryGeneratorAction(F01DetectorConstruction*);
virtual ~F01PrimaryGeneratorAction();
~F01PrimaryGeneratorAction() override;
public:
virtual void GeneratePrimaries(G4Event*);
void GeneratePrimaries(G4Event*) override;
void SetRndmFlag(G4String val) { fRndmFlag = val; }
void SetXVertex(G4double x);
void SetYVertex(G4double y);
@@ -62,16 +62,17 @@ class F01PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
static G4String GetPrimaryName();
private:
G4ParticleGun* fParticleGun; //pointer a to G4 service class
F01DetectorConstruction* fDetector; //pointer to the geometry
G4ParticleGun* fParticleGun = nullptr; //pointer a to G4 service class
F01DetectorConstruction* fDetector = nullptr; //pointer to the geometry
F01PrimaryGeneratorMessenger* fGunMessenger; //messenger of this class
G4String fRndmFlag; //flag for random impact point
F01PrimaryGeneratorMessenger* fGunMessenger = nullptr; //messenger of this class
G4String fRndmFlag = "off"; //flag for random impact point
static G4ParticleDefinition* fgPrimaryParticle;
G4double fXVertex, fYVertex, fZVertex;
G4bool fVertexDefined;
G4double fXVertex = 0.;
G4double fYVertex = 0.;
G4double fZVertex = 0.;
G4bool fVertexDefined = false;
};
#endif
@@ -47,16 +47,16 @@ class F01PrimaryGeneratorMessenger: public G4UImessenger
{
public:
F01PrimaryGeneratorMessenger(F01PrimaryGeneratorAction*);
virtual ~F01PrimaryGeneratorMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
~F01PrimaryGeneratorMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
F01PrimaryGeneratorAction* fAction;
G4UIcmdWithAString* fRndmCmd;
G4UIcmdWithADoubleAndUnit* fSetXVertexCmd;
G4UIcmdWithADoubleAndUnit* fSetYVertexCmd;
G4UIcmdWithADoubleAndUnit* fSetZVertexCmd;
F01PrimaryGeneratorAction* fAction = nullptr;
G4UIcmdWithAString* fRndmCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetXVertexCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetYVertexCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetZVertexCmd = nullptr;
};
#endif
@@ -28,6 +28,8 @@
#include "G4UserRunAction.hh"
#include "CLHEP/Units/SystemOfUnits.h"
class G4ParticleDefinition;
class G4Transportation;
class G4CoupledTransportation;
@@ -38,13 +40,13 @@ class F01RunAction: public G4UserRunAction {
public:
F01RunAction();
virtual ~F01RunAction();
virtual void BeginOfRunAction( const G4Run* aRun );
virtual void EndOfRunAction( const G4Run* aRun );
F01RunAction() = default;
~F01RunAction() override = default;
// Helper method to change the Transportation's 'looper' parameters
void BeginOfRunAction( const G4Run* aRun ) override;
void EndOfRunAction( const G4Run* aRun ) override;
// Helper method to change the Transportation's 'looper' parameters
void ChangeLooperParameters(const G4ParticleDefinition* particleDef );
// Helper method to find the Transportation process for a particle type
@@ -59,13 +61,16 @@ public:
G4int GetNumberOfTrials() { return fNumberOfTrials; }
G4double GetWarningEnergy() { return fWarningEnergy; }
G4double GetImportantEnergy() { return fImportantEnergy; }
private:
// Values for initialising 'loopers' parameters of Transport process
G4int fNumberOfTrials = 0; // Default will not overwrite
G4double fWarningEnergy = -1.0; // Default values - non operational
G4double fImportantEnergy = -1.0; // Default - will not overwrite
G4int fNumberOfTrials = 15; // Arbitrary
G4double fWarningEnergy = 1.0 * CLHEP::kiloelectronvolt; // Arbitrary
G4double fImportantEnergy = 10.0 * CLHEP::kiloelectronvolt; // Arbitrary
// Applications should determine these thresholds according to
// - physics requirements, and
// - the computing cost of continuing integration for looping tracks
G4int fVerboseLevel = 0;
};
@@ -55,15 +55,15 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class F01SteppingVerbose : public G4SteppingVerbose
class F01SteppingVerbose : public G4SteppingVerbose
{
public:
F01SteppingVerbose();
virtual ~F01SteppingVerbose();
F01SteppingVerbose() = default;
~F01SteppingVerbose() override = default;
virtual void StepInfo();
virtual void TrackingStarted();
void StepInfo() override;
void TrackingStarted() override;
};