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
@@ -40,15 +40,15 @@ class F04ActionInitialization : public G4VUserActionInitialization
{
public:
F04ActionInitialization(F04DetectorConstruction*);
virtual ~F04ActionInitialization();
~F04ActionInitialization() 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:
F04DetectorConstruction* fDetConstruction;
F04DetectorConstruction* fDetConstruction = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -37,6 +37,8 @@
#include "G4LogicalVolume.hh"
#include "G4RotationMatrix.hh"
#include "CLHEP/Units/SystemOfUnits.h"
class G4Tubs;
class G4VPhysicalVolume;
@@ -55,12 +57,12 @@ class F04DetectorConstruction : public G4VUserDetectorConstruction
public:
F04DetectorConstruction();
virtual ~F04DetectorConstruction();
~F04DetectorConstruction() override;
virtual G4VPhysicalVolume* Construct();
G4VPhysicalVolume* Construct() override;
G4VPhysicalVolume* ConstructDetector();
virtual void ConstructSDandField();
void ConstructSDandField() override;
// StringToRotationMatrix() converts a string "X90,Y45" into a
// G4RotationMatrix.
@@ -94,14 +96,14 @@ class F04DetectorConstruction : public G4VUserDetectorConstruction
void SetTargetRadius(G4double);
void SetTargetPos(G4double);
void SetTargetAngle(G4int);
void SetDegraderMaterial (G4String);
void SetDegraderThickness(G4double);
void SetDegraderRadius(G4double);
void SetDegraderPos(G4double);
public:
G4Material* GetWorldMaterial() {return fWorldMaterial;}
G4double GetWorldSizeZ() {return fWorldSizeZ;}
G4double GetWorldSizeR() {return fWorldSizeR;}
@@ -133,57 +135,57 @@ class F04DetectorConstruction : public G4VUserDetectorConstruction
private:
F04DetectorMessenger* fDetectorMessenger; // pointer to the Messenger
G4Cache<F04GlobalField*> fFieldSetUp;
F04DetectorMessenger* fDetectorMessenger = nullptr; // pointer to the Messenger
G4Cache<F04GlobalField*> fFieldSetUp = nullptr;
F04Materials* fMaterials;
F04Materials* fMaterials = nullptr;
G4Material* fVacuum;
G4Tubs* fSolidWorld;
G4LogicalVolume* fLogicWorld;
G4VPhysicalVolume* fPhysiWorld;
G4Material* fVacuum = nullptr;
G4Tubs* fSolidTarget;
G4LogicalVolume* fLogicTarget;
G4VPhysicalVolume* fPhysiTarget;
G4Tubs* fSolidWorld = nullptr;
G4LogicalVolume* fLogicWorld = nullptr;
G4VPhysicalVolume* fPhysiWorld = nullptr;
G4Tubs* fSolidDegrader;
G4LogicalVolume* fLogicDegrader;
G4VPhysicalVolume* fPhysiDegrader;
G4Tubs* fSolidTarget = nullptr;
G4LogicalVolume* fLogicTarget = nullptr;
G4VPhysicalVolume* fPhysiTarget = nullptr;
G4Tubs* fSolidCaptureMgnt;
G4LogicalVolume* fLogicCaptureMgnt;
G4VPhysicalVolume* fPhysiCaptureMgnt;
G4Tubs* fSolidDegrader = nullptr;
G4LogicalVolume* fLogicDegrader = nullptr;
G4VPhysicalVolume* fPhysiDegrader = nullptr;
G4Tubs* fSolidTransferMgnt;
G4LogicalVolume* fLogicTransferMgnt;
G4VPhysicalVolume* fPhysiTransferMgnt;
G4Tubs* fSolidCaptureMgnt = nullptr;
G4LogicalVolume* fLogicCaptureMgnt = nullptr;
G4VPhysicalVolume* fPhysiCaptureMgnt = nullptr;
G4Material* fWorldMaterial;
G4double fWorldSizeR;
G4double fWorldSizeZ;
G4Tubs* fSolidTransferMgnt = nullptr;
G4LogicalVolume* fLogicTransferMgnt = nullptr;
G4VPhysicalVolume* fPhysiTransferMgnt = nullptr;
G4double fCaptureMgntLength;
G4double fCaptureMgntRadius;
G4double fCaptureMgntB1;
G4double fCaptureMgntB2;
G4Material* fWorldMaterial = nullptr;
G4double fWorldSizeR = 5. * CLHEP::m;
G4double fWorldSizeZ = 50. * CLHEP::m;
G4double fTransferMgntLength;
G4double fTransferMgntRadius;
G4double fTransferMgntB;
G4double fTransferMgntPos;
G4double fCaptureMgntLength = 4.0 * CLHEP::m;
G4double fCaptureMgntRadius = 0.6 * CLHEP::m;
G4double fCaptureMgntB1 = 0.;
G4double fCaptureMgntB2 = 0.;
G4Material* fTargetMaterial;
G4double fTargetThickness;
G4double fTargetRadius;
G4double fTargetPos;
G4int fTargetAngle;
G4double fTransferMgntLength = 15.0 * CLHEP::m;
G4double fTransferMgntRadius = 0.3 * CLHEP::m;
G4double fTransferMgntB = 0.;
G4double fTransferMgntPos = 0.;
G4Material* fDegraderMaterial;
G4double fDegraderThickness;
G4double fDegraderRadius;
G4double fDegraderPos;
G4Material* fTargetMaterial = nullptr;
G4double fTargetThickness = 16.0 * CLHEP::cm;
G4double fTargetRadius = 0.4 * CLHEP::cm;
G4double fTargetPos = 0.;
G4int fTargetAngle = 0.;
G4Material* fDegraderMaterial = nullptr;
G4double fDegraderThickness = 0.1 * CLHEP::cm;
G4double fDegraderRadius = 30.0 * CLHEP::cm;
G4double fDegraderPos = 0.;
G4ThreeVector fCaptureMgntCenter, fTransferMgntCenter;
@@ -47,37 +47,37 @@ class F04DetectorMessenger : public G4UImessenger
public:
F04DetectorMessenger(F04DetectorConstruction* );
virtual ~F04DetectorMessenger();
~F04DetectorMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
virtual void SetNewValue(G4UIcommand*, G4String);
private:
F04DetectorConstruction* fDetector;
F04DetectorConstruction* fDetector = nullptr;
G4UIdirectory* fDetDir;
G4UIdirectory* fDetDir = nullptr;
G4UIcmdWithAString* fWorldMaterCmd;
G4UIcmdWithADoubleAndUnit* fWorldRCmd;
G4UIcmdWithADoubleAndUnit* fWorldZCmd;
G4UIcmdWithAString* fWorldMaterCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fWorldRCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fWorldZCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fCaptureRCmd;
G4UIcmdWithADoubleAndUnit* fCaptureZCmd;
G4UIcmdWithADoubleAndUnit* fCaptureRCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fCaptureZCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTransferRCmd;
G4UIcmdWithADoubleAndUnit* fTransferZCmd;
G4UIcmdWithADoubleAndUnit* fTransferPCmd;
G4UIcmdWithADoubleAndUnit* fTransferRCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTransferZCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTransferPCmd = nullptr;
G4UIcmdWithAString* fTgtMaterCmd;
G4UIcmdWithADoubleAndUnit* fTgtRadCmd;
G4UIcmdWithADoubleAndUnit* fTgtThickCmd;
G4UIcmdWithADoubleAndUnit* fTgtPosCmd;
G4UIcmdWithAnInteger* fTgtAngCmd;
G4UIcmdWithAString* fTgtMaterCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTgtRadCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTgtThickCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTgtPosCmd = nullptr;
G4UIcmdWithAnInteger* fTgtAngCmd = nullptr;
G4UIcmdWithAString* fDgrMaterCmd;
G4UIcmdWithADoubleAndUnit* fDgrRadCmd;
G4UIcmdWithADoubleAndUnit* fDgrThickCmd;
G4UIcmdWithADoubleAndUnit* fDgrPosCmd;
G4UIcmdWithAString* fDgrMaterCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fDgrRadCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fDgrThickCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fDgrPosCmd = nullptr;
};
#endif
@@ -39,6 +39,8 @@
#include "G4UserLimits.hh"
#include "G4VisAttributes.hh"
#include "CLHEP/Units/SystemOfUnits.h"
// class F04ElementField - interface for the EM field of one element
// This is the interface class used by GlobalField to compute the field
@@ -49,13 +51,9 @@
// element. The Construct() function will add the derived object into
// GlobalField.
class F04ElementField
class F04ElementField
{
private:
F04ElementField& operator=(const F04ElementField&);
public:
/// Constructor.
@@ -65,7 +63,7 @@ class F04ElementField
void Construct();
/// Destructor.
virtual ~F04ElementField() {}
virtual ~F04ElementField() = default;
/// SetMaxStep(G4double) sets the max. step size
void SetMaxStep(G4double stp)
@@ -134,23 +132,29 @@ class F04ElementField
protected:
G4LogicalVolume* fVolume;
G4LogicalVolume* fVolume = nullptr;
G4AffineTransform fGlobal2local;
// F04ElementField(const F04ElementField&);
private:
F04ElementField& operator=(const F04ElementField&);
static G4ThreadLocal G4Navigator* fNavigator;
G4String fColor;
G4String fColor = "1,1,1";
G4ThreeVector fCenter;
G4double fMinX, fMinY, fMinZ, fMaxX, fMaxY, fMaxZ;
G4double fMinX = -DBL_MAX;
G4double fMinY = -DBL_MAX;
G4double fMinZ = -DBL_MAX;
G4double fMaxX = DBL_MAX;
G4double fMaxY = DBL_MAX;
G4double fMaxZ = DBL_MAX;
G4double fMaxStep;
G4UserLimits* fUserLimits;
G4double fMaxStep = 1. * CLHEP::mm;
G4UserLimits* fUserLimits = nullptr;
};
@@ -42,22 +42,22 @@ class F04EventAction : public G4UserEventAction
public:
F04EventAction(F04RunAction* );
virtual ~F04EventAction();
~F04EventAction() override;
public:
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
void BeginOfEventAction(const G4Event*) override;
void EndOfEventAction(const G4Event*) override;
G4int GetEventNo();
void SetEventVerbose(G4int);
private:
F04RunAction* fRunaction;
F04EventActionMessenger* fEventMessenger;
F04RunAction* fRunaction = nullptr;
F04EventActionMessenger* fEventMessenger = nullptr;
G4int fVerboseLevel;
G4int fVerboseLevel = 0;
};
#endif
@@ -44,15 +44,15 @@ class F04EventActionMessenger: public G4UImessenger
public:
F04EventActionMessenger(F04EventAction*);
virtual ~F04EventActionMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
~F04EventActionMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
F04EventAction* fEventAction;
F04EventAction* fEventAction = nullptr;
G4UIcmdWithAnInteger* fSetVerboseCmd;
G4UIcmdWithAnInteger* fSetVerboseCmd = nullptr;
};
#endif
@@ -47,29 +47,29 @@ class F04FieldMessenger: public G4UImessenger
{
public:
F04FieldMessenger(F04GlobalField*, F04DetectorConstruction* );
virtual ~F04FieldMessenger();
~F04FieldMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
virtual void SetNewValue(G4UIcommand*, G4String);
private:
F04GlobalField* fGlobalField;
G4UIdirectory* fDetDir;
F04GlobalField* fGlobalField = nullptr;
G4UIcmdWithADoubleAndUnit* fCaptureB1Cmd;
G4UIcmdWithADoubleAndUnit* fCaptureB2Cmd;
G4UIcmdWithADoubleAndUnit* fTransferBCmd;
G4UIdirectory* fDetDir = nullptr;
G4UIcmdWithAnInteger* fStepperCMD;
G4UIcmdWithADoubleAndUnit* fMinStepCMD;
G4UIcmdWithADoubleAndUnit* fDeltaChordCMD;
G4UIcmdWithADoubleAndUnit* fDeltaOneStepCMD;
G4UIcmdWithADoubleAndUnit* fDeltaIntersectionCMD;
G4UIcmdWithADoubleAndUnit* fEpsMinCMD;
G4UIcmdWithADoubleAndUnit* fEpsMaxCMD;
G4UIcmdWithADoubleAndUnit* fCaptureB1Cmd = nullptr;
G4UIcmdWithADoubleAndUnit* fCaptureB2Cmd = nullptr;
G4UIcmdWithADoubleAndUnit* fTransferBCmd = nullptr;
F04DetectorConstruction* fDetector;
G4UIcmdWithAnInteger* fStepperCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fMinStepCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fDeltaChordCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fDeltaOneStepCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fDeltaIntersectionCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fEpsMinCMD = nullptr;
G4UIcmdWithADoubleAndUnit* fEpsMaxCMD = nullptr;
F04DetectorConstruction* fDetector = nullptr;
};
#endif
@@ -35,7 +35,7 @@
#include "F04SimpleSolenoid.hh"
// F04FocusSolenoid implements a solenoid magnet with an increased
// F04FocusSolenoid implements a solenoid magnet with an increased
// cylindrical magnetic field in +/- z-direction (or half focusing)
class F04FocusSolenoid : public F04SimpleSolenoid
@@ -47,21 +47,21 @@ class F04FocusSolenoid : public F04SimpleSolenoid
G4LogicalVolume*, G4ThreeVector);
/// Destructor.
virtual ~F04FocusSolenoid() {}
~F04FocusSolenoid() override = default;
/// Set F04FocusSolenoid to only half-focusing (default negative z)
void SetHalf(G4bool h) { fHalf = h; }
/// AddFieldValue() adds the field for this solenoid into field[].
/// point[] is in global coordinates.
virtual void AddFieldValue(const G4double point[4], G4double field[6]) const;
void AddFieldValue(const G4double point[4], G4double field[6]) const override;
private:
G4bool fHalf;
G4bool fHalf = false;
G4double fB1;
G4double fB2;
G4double fB1 = 0.;
G4double fB2 = 0.;
};
@@ -62,7 +62,7 @@
// represents an element with an EM field must add the appropriate
// ElementField to the global GlobalField object.
typedef std::vector<F04ElementField*> FieldList;
using FieldList = std::vector<F04ElementField *>;
class F04GlobalField : public G4ElectroMagneticField {
//class F04GlobalField : public G4MagneticField {
@@ -78,7 +78,7 @@ private:
public:
virtual ~F04GlobalField();
~F04GlobalField() override;
/// GetObject() returns the single F04GlobalField object.
/// It is constructed, if necessary.
@@ -88,10 +88,10 @@ public:
/// GetFieldValue() returns the field value at a given point[].
/// field is really field[6]: Bx,By,Bz,Ex,Ey,Ez.
/// point[] is in global coordinates: x,y,z,t.
virtual void GetFieldValue(const G4double* point, G4double* field) const;
void GetFieldValue(const G4double* point, G4double* field) const override;
/// DoesFieldChangeEnergy() returns true.
virtual G4bool DoesFieldChangeEnergy() const { return true; }
G4bool DoesFieldChangeEnergy() const override { return true; }
/// AddElementField() adds the ElementField object for a single
/// element to the global field.
@@ -144,31 +144,31 @@ private:
static G4ThreadLocal F04GlobalField* fObject;
G4int fNfp;
G4bool fFirst;
G4int fNfp = 0;
G4bool fFirst = true;
FieldList* fFields;
FieldList* fFields = nullptr;
const F04ElementField **fFp;
const F04ElementField **fFp = nullptr;
private:
// A. INVARIANTS:
// A. INVARIANTS:
// --------------
// INVARIANT: an integer to indicate the type of RK integration method ('stepper') used
G4int fStepperType;
G4int fStepperType = 4; // ClassicalRK4 is default stepper;
// INVARIANTS: Accuracy parameters of field propagation (and the integration it uses.)
// 1. These values are lengths - initialised in src
G4double fMinStep;
G4double fDeltaChord;
G4double fDeltaOneStep;
G4double fDeltaIntersection;
G4double fMinStep = 0.01 * CLHEP::mm;
G4double fDeltaChord = 3.0 * CLHEP::mm;
G4double fDeltaOneStep = 0.01 * CLHEP::mm;
G4double fDeltaIntersection = 0.1 * CLHEP::mm;
// 2. Dimensionless numbers - can initialise here
G4double fEpsMin = 2.5e-7; // Relative accuracy of integration (minimum)
G4double fEpsMax = 0.001; // Relative accuracy of integration (maximum)
// B. STATE: objects which carry out the propagation and are modified during tracking
// B. STATE: objects which carry out the propagation and are modified during tracking
// --------
// G4Mag_EqRhs* fEquation;
// G4Mag_SpinEqRhs* fEquation;
@@ -44,23 +44,23 @@ class F04Materials
static F04Materials* GetInstance();
G4Material* GetMaterial(G4String);
private:
F04Materials();
void CreateMaterials();
private:
static F04Materials* fInstance;
G4NistManager* fNistMan;
G4NistManager* fNistMan = nullptr;
G4Material* fVacuum;
G4Material* fAir;
G4Material* fSci;
G4Material* fBeO;
G4Material* fVacuum = nullptr;
G4Material* fAir = nullptr;
G4Material* fSci = nullptr;
G4Material* fBeO = nullptr;
};
@@ -44,7 +44,7 @@ class F04PhysicsList: public G4VModularPhysicsList
public:
F04PhysicsList(G4String);
virtual ~F04PhysicsList();
~F04PhysicsList() override;
void SetStepMax(G4double);
F04StepMax* GetStepMaxProcess();
@@ -56,15 +56,15 @@ public:
/// Make sure that the physics list is empty.
void ClearPhysics();
*/
virtual void ConstructParticle();
virtual void ConstructProcess();
void ConstructParticle() override;
void ConstructProcess() override;
private:
G4double fMaxChargedStep;
G4double fMaxChargedStep = DBL_MAX;
static G4ThreadLocal F04StepMax* fStepMaxProcess;
F04PhysicsListMessenger* fMessenger;
F04PhysicsListMessenger* fMessenger = nullptr;
};
@@ -48,23 +48,23 @@ class F04PhysicsListMessenger : public G4UImessenger
public:
F04PhysicsListMessenger(F04PhysicsList* );
virtual ~F04PhysicsListMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
~F04PhysicsListMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
F04PhysicsList* fPhysicsList;
G4UIdirectory* fDirectory;
G4UIdirectory* fDecayDirectory;
F04PhysicsList* fPhysicsList = nullptr;
G4UIcmdWithADoubleAndUnit* fStepMaxCMD;
G4UIdirectory* fDirectory = nullptr;
G4UIdirectory* fDecayDirectory = nullptr;
G4UIcmdWithADoubleAndUnit* fStepMaxCMD = nullptr;
/*
G4UIcmdWithAString* fRemovePhysicsCMD;
G4UIcmdWithoutParameter* fClearPhysicsCMD;
G4UIcmdWithAString* fRemovePhysicsCMD = nullptr;
G4UIcmdWithoutParameter* fClearPhysicsCMD = nullptr;
*/
G4UIcmdWithoutParameter* fPienuCMD;
G4UIcmdWithoutParameter* fPimunuCMD;
G4UIcmdWithoutParameter* fPienuCMD = nullptr;
G4UIcmdWithoutParameter* fPimunuCMD = nullptr;
};
#endif
@@ -48,11 +48,11 @@ class F04PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
public:
F04PrimaryGeneratorAction(F04DetectorConstruction*);
virtual ~F04PrimaryGeneratorAction();
~F04PrimaryGeneratorAction() override;
public:
virtual void GeneratePrimaries(G4Event*);
void GeneratePrimaries(G4Event*) override;
void SetRndmFlag(G4String val) { fRndmFlag = val;}
@@ -62,21 +62,22 @@ class F04PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
private:
F04DetectorConstruction* fDetector; // pointer to the geometry
F04DetectorConstruction* fDetector = nullptr; // pointer to the geometry
G4ParticleGun* fParticleGun; // pointer a to G4 service class
F04PrimaryGeneratorMessenger* fGunMessenger; // messenger of this class
G4ParticleGun* fParticleGun = nullptr; // pointer a to G4 service class
G4String fRndmFlag; // flag for random impact point
F04PrimaryGeneratorMessenger* fGunMessenger = nullptr; // messenger of this class
G4bool fFirst;
G4String fRndmFlag ="off"; // flag for random impact point
G4bool fFirst = false;
G4AffineTransform fGlobal2local;
G4double fXvertex, fYvertex, fZvertex;
G4bool fVertexdefined;
G4double fXvertex = 0.;
G4double fYvertex = 0.;
G4double fZvertex = 0.;
G4bool fVertexDefined = false;
};
@@ -44,18 +44,18 @@ class F04PrimaryGeneratorMessenger : public G4UImessenger
public:
F04PrimaryGeneratorMessenger(F04PrimaryGeneratorAction*);
virtual ~F04PrimaryGeneratorMessenger();
~F04PrimaryGeneratorMessenger() override;
virtual void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String) override;
private:
F04PrimaryGeneratorAction* fAction;
F04PrimaryGeneratorAction* fAction = nullptr;
G4UIcmdWithAString* fRndmCmd;
G4UIcmdWithADoubleAndUnit* fSetXvertexCmd;
G4UIcmdWithADoubleAndUnit* fSetYvertexCmd;
G4UIcmdWithADoubleAndUnit* fSetZvertexCmd;
G4UIcmdWithAString* fRndmCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetXvertexCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetYvertexCmd = nullptr;
G4UIcmdWithADoubleAndUnit* fSetZvertexCmd = nullptr;
};
#endif
@@ -43,12 +43,12 @@ class F04RunAction : public G4UserRunAction
public:
F04RunAction();
virtual ~F04RunAction();
~F04RunAction() override;
public:
virtual void BeginOfRunAction(const G4Run*);
virtual void EndOfRunAction(const G4Run*);
void BeginOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
void SetRndmFreq(G4int val) {fSaveRndm = val;}
G4int GetRndmFreq() {return fSaveRndm;}
@@ -56,11 +56,11 @@ class F04RunAction : public G4UserRunAction
inline void SetAutoSeed (const G4bool val) {fAutoSeed = val;}
private:
F04RunActionMessenger* fRunMessenger;
G4int fSaveRndm;
G4bool fAutoSeed;
F04RunActionMessenger* fRunMessenger = nullptr;
G4int fSaveRndm = 0;
G4bool fAutoSeed = false;
};
@@ -47,19 +47,19 @@ class F04RunActionMessenger : public G4UImessenger
public:
F04RunActionMessenger(F04RunAction* );
virtual ~F04RunActionMessenger();
~F04RunActionMessenger() override;
virtual void SetNewValue(G4UIcommand* ,G4String );
void SetNewValue(G4UIcommand* ,G4String ) override;
private:
F04RunAction* fRunAction;
F04RunAction* fRunAction = nullptr;
G4UIdirectory* fRndmDir = nullptr;
G4UIcmdWithAnInteger* fRndmSaveCmd = nullptr;
G4UIcmdWithAString* fRndmReadCmd = nullptr;
G4UIcmdWithABool* fSetAutoSeedCmd = nullptr;
G4UIdirectory* fRndmDir;
G4UIcmdWithAnInteger* fRndmSaveCmd;
G4UIcmdWithAString* fRndmReadCmd;
G4UIcmdWithABool* fSetAutoSeedCmd;
};
#endif
@@ -48,16 +48,16 @@ class F04SimpleSolenoid : public F04ElementField
F04SimpleSolenoid(G4double, G4double, G4LogicalVolume*, G4ThreeVector);
/// Destructor.
virtual ~F04SimpleSolenoid() {}
~F04SimpleSolenoid() override = default;
/// GetLength() returns the length of the solenoid
virtual G4double GetLength() { return fFieldLength; }
G4double GetLength() override { return fFieldLength; }
/// GetWidth() returns the solenoid diameter
virtual G4double GetWidth() { return fFieldRadius*2.0; }
G4double GetWidth() override { return fFieldRadius*2.0; }
/// GetHeight() returns the solenoid diameter
virtual G4double GetHeight() { return fFieldRadius*2.0; }
G4double GetHeight() override { return fFieldRadius*2.0; }
/// SetFringeZ(G4double) sets the solenoid fringe field z-length
void SetFringeZ(G4double z) { fFringeZ = z; }
@@ -73,16 +73,16 @@ class F04SimpleSolenoid : public F04ElementField
/// AddFieldValue() adds the field for this solenoid into field[].
/// point[] is in global coordinates.
virtual void AddFieldValue(const G4double point[4], G4double field[6]) const;
void AddFieldValue(const G4double point[4], G4double field[6]) const override;
private:
G4double fBfield;
G4double fBfield = 0.;
G4double fFringeZ;
G4double fFringeZ = 0.;
G4double fFieldLength;
G4double fFieldRadius;
G4double fFieldLength = 0.;
G4double fFieldRadius = 0.;
};
@@ -36,15 +36,13 @@
class F04StackingAction : public G4UserStackingAction
{
public:
F04StackingAction();
virtual ~F04StackingAction();
F04StackingAction() = default;
~F04StackingAction() override = default;
public:
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack);
virtual void NewStage();
virtual void PrepareNewEvent();
private:
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track* aTrack) override;
void NewStage() override;
void PrepareNewEvent() override;
};
@@ -43,32 +43,32 @@ class F04StepMax : public G4VDiscreteProcess
F04StepMax(const G4String& processName = "UserStepMax");
virtual ~F04StepMax();
~F04StepMax() override = default;
F04StepMax(const F04StepMax&) = delete;
F04StepMax& operator=(const F04StepMax&) = delete;
virtual G4bool IsApplicable(const G4ParticleDefinition&);
G4bool IsApplicable(const G4ParticleDefinition&) override;
void SetStepMax(G4double);
G4double GetStepMax() {return fMaxChargedStep;};
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track&,
G4double PostStepGetPhysicalInteractionLength(const G4Track&,
G4double,
G4ForceCondition*);
G4ForceCondition*) override;
virtual G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
protected:
virtual G4double GetMeanFreePath(const G4Track&,
G4double GetMeanFreePath(const G4Track&,
G4double,
G4ForceCondition*);
G4ForceCondition*) override;
private:
G4double fMaxChargedStep;
G4double fMaxChargedStep = DBL_MAX;
};
@@ -33,8 +33,6 @@
#include "G4UserSteppingAction.hh"
class F04SteppingActionMessenger;
class G4LogicalVolume;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -43,16 +41,15 @@ class F04SteppingAction : public G4UserSteppingAction
{
public:
F04SteppingAction();
virtual ~F04SteppingAction();
F04SteppingAction() = default;
~F04SteppingAction() override = default;
virtual void UserSteppingAction(const G4Step*);
void UserSteppingAction(const G4Step*) override;
private:
F04SteppingActionMessenger* fSteppingMessenger;
G4LogicalVolume* fTargetVolume;
G4LogicalVolume* fTestPlaneVolume;
G4LogicalVolume* fTargetVolume = nullptr;
G4LogicalVolume* fTestPlaneVolume = nullptr;
};
#endif
@@ -1,54 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
/// \file field/field04/include/F04SteppingActionMessenger.hh
/// \brief Definition of the F04SteppingActionMessenger class
//
#ifndef F04SteppingActionMessenger_h
#define F04SteppingActionMessenger_h 1
#include "G4UImessenger.hh"
class F04SteppingAction;
class G4UIdirectory;
class F04SteppingActionMessenger: public G4UImessenger
{
public:
F04SteppingActionMessenger();
virtual ~F04SteppingActionMessenger();
virtual void SetNewValue(G4UIcommand* ,G4String );
private:
G4UIdirectory* fSteppingDir;
};
#endif
@@ -38,10 +38,10 @@ class F04SteppingVerbose : public G4SteppingVerbose
public:
F04SteppingVerbose();
virtual ~F04SteppingVerbose();
~F04SteppingVerbose() override = default;
virtual void StepInfo();
virtual void TrackingStarted();
void StepInfo() override;
void TrackingStarted() override;
};
#endif
@@ -37,11 +37,11 @@ class F04TrackingAction : public G4UserTrackingAction {
public:
F04TrackingAction() {};
virtual ~F04TrackingAction() {};
F04TrackingAction() = default;
~F04TrackingAction() override = default;
virtual void PreUserTrackingAction(const G4Track*);
virtual void PostUserTrackingAction(const G4Track*);
void PreUserTrackingAction(const G4Track*) override;
void PostUserTrackingAction(const G4Track*) override;
};
@@ -44,7 +44,7 @@
#include "G4ParticleDefinition.hh"
#include "G4TrajectoryPoint.hh"
typedef std::vector<G4VTrajectoryPoint*> TrajectoryPointContainer;
using TrajectoryPointContainer = std::vector<G4VTrajectoryPoint *>;
class F04Trajectory : public G4VTrajectory
{
@@ -58,7 +58,7 @@ class F04Trajectory : public G4VTrajectory
F04Trajectory();
F04Trajectory(const G4Track* aTrack);
F04Trajectory(F04Trajectory&);
virtual ~F04Trajectory();
~F04Trajectory() override;
// Operators
@@ -69,28 +69,28 @@ class F04Trajectory : public G4VTrajectory
// Get/Set functions
inline G4int GetTrackID() const { return fTrackID; }
inline G4int GetParentID() const { return fParentID; }
inline G4String GetParticleName() const { return fParticleName; }
inline G4double GetCharge() const { return fPDGCharge; }
inline G4int GetPDGEncoding() const { return fPDGEncoding; }
inline G4ThreeVector GetInitialMomentum() const {return fInitialMomentum;}
inline G4int GetTrackID() const override { return fTrackID; }
inline G4int GetParentID() const override { return fParentID; }
inline G4String GetParticleName() const override { return fParticleName; }
inline G4double GetCharge() const override { return fPDGCharge; }
inline G4int GetPDGEncoding() const override { return fPDGEncoding; }
inline G4ThreeVector GetInitialMomentum() const override {return fInitialMomentum;}
// Other member functions
virtual void ShowTrajectory(std::ostream& os=G4cout) const;
virtual void AppendStep(const G4Step* aStep);
virtual void MergeTrajectory(G4VTrajectory* secondTrajectory);
void ShowTrajectory(std::ostream& os=G4cout) const override;
void AppendStep(const G4Step* aStep) override;
void MergeTrajectory(G4VTrajectory* secondTrajectory) override;
G4ParticleDefinition* GetParticleDefinition();
virtual int GetPointEntries() const
int GetPointEntries() const override
{ return fpPointsContainer->size(); }
virtual G4VTrajectoryPoint* GetPoint(G4int i) const
G4VTrajectoryPoint* GetPoint(G4int i) const override
{ return (*fpPointsContainer)[i]; }
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
std::vector<G4AttValue>* CreateAttValues() const override;
//---------
private:
@@ -98,12 +98,12 @@ class F04Trajectory : public G4VTrajectory
// Member data
TrajectoryPointContainer* fpPointsContainer;
TrajectoryPointContainer* fpPointsContainer = nullptr;
G4int fTrackID;
G4int fParentID;
G4double fPDGCharge;
G4int fPDGEncoding;
G4int fTrackID = 0;
G4int fParentID = 0;
G4double fPDGCharge = 0.;
G4int fPDGEncoding = 0;
G4String fParticleName;
G4ThreeVector fInitialMomentum;
@@ -55,7 +55,7 @@ class F04TrajectoryPoint : public G4TrajectoryPoint {
F04TrajectoryPoint(const G4Track* aTrack);
F04TrajectoryPoint(const G4Step* aStep);
F04TrajectoryPoint(const F04TrajectoryPoint &right);
virtual ~F04TrajectoryPoint();
~F04TrajectoryPoint() override = default;
// Operators
@@ -73,8 +73,8 @@ class F04TrajectoryPoint : public G4TrajectoryPoint {
// Get method for HEPRep style attributes
virtual const std::map<G4String,G4AttDef>* GetAttDefs() const;
virtual std::vector<G4AttValue>* CreateAttValues() const;
const std::map<G4String,G4AttDef>* GetAttDefs() const override;
std::vector<G4AttValue>* CreateAttValues() const override;
//---------
private:
@@ -82,9 +82,9 @@ class F04TrajectoryPoint : public G4TrajectoryPoint {
// Member data
G4double fTime;
G4double fTime = 0;
G4ThreeVector fMomentum;
G4StepStatus fStepStatus;
G4StepStatus fStepStatus = fUndefined;
G4String fVolumeName;
};
@@ -47,15 +47,15 @@ class F04UserTrackInformation : public G4VUserTrackInformation
public:
F04UserTrackInformation();
virtual ~F04UserTrackInformation();
F04UserTrackInformation() = default;
~F04UserTrackInformation() override = default;
void SetTrackStatusFlag(TrackStatus s){ fStatus = s; }
TrackStatus GetTrackStatusFlag()const { return fStatus; }
private:
TrackStatus fStatus;
TrackStatus fStatus = undefined;
};