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
@@ -50,7 +50,6 @@
class G4Step;
class G4TouchableHistory;
class G4HCofThisEvent;
class HistoManager;
class CheckVolumeSD : public G4VSensitiveDetector
@@ -58,13 +57,9 @@ class CheckVolumeSD : public G4VSensitiveDetector
public: // Without description
CheckVolumeSD(const G4String&);
virtual ~CheckVolumeSD();
~CheckVolumeSD() override = default;
virtual void Initialize(G4HCofThisEvent*);
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void PrintAll();
G4bool ProcessHits(G4Step*, G4TouchableHistory*) override;
private:
@@ -60,7 +60,7 @@ class DetectorConstruction : public G4VUserDetectorConstruction
public:
DetectorConstruction();
virtual ~DetectorConstruction();
~DetectorConstruction() override;
G4VPhysicalVolume* Construct() override;
void ConstructSDandField() override;
@@ -75,8 +75,8 @@ private:
void ComputeGeomParameters();
G4Material* fTargetMaterial;
G4Material* fWorldMaterial;
G4Material* fTargetMaterial;
G4Material* fWorldMaterial;
G4Tubs* fSolidW;
G4Tubs* fSolidA;
@@ -61,9 +61,9 @@ class DetectorMessenger: public G4UImessenger
public:
DetectorMessenger(DetectorConstruction* );
virtual ~DetectorMessenger();
~DetectorMessenger() override;
virtual void SetNewValue(G4UIcommand*, G4String);
void SetNewValue(G4UIcommand*, G4String) override;
private:
@@ -78,6 +78,7 @@ private:
G4UIcmdWithAnInteger* fBinCmd;
G4UIcmdWithAnInteger* fNOfAbsCmd;
G4UIcmdWithAnInteger* fVerbCmd;
G4UIcmdWithAnInteger* fBertCmd;
G4UIcmdWithABool* fBeamCmd;
G4UIcmdWithABool* fBCCmd;
G4UIcmdWithABool* fHNCmd;
@@ -56,41 +56,27 @@ class EventAction : public G4UserEventAction
public: // Without description
EventAction();
virtual ~EventAction();
~EventAction() override;
virtual void BeginOfEventAction(const G4Event*);
virtual void EndOfEventAction(const G4Event*);
void BeginOfEventAction(const G4Event*) override;
void EndOfEventAction(const G4Event*) override;
inline void SetPrintModulo(G4int val);
inline void AddEventToDebug(G4int val);
void SetPrintModulo(G4int val) { fPrintModulo = val; };
void AddEventToDebug(G4int val){ fSelectedEvents.push_back(val); };
EventAction & operator=(const EventAction &right) = delete;
EventAction(const EventAction&) = delete;
private:
EventAction & operator=(const EventAction &right);
EventAction(const EventAction&);
EventActionMessenger* fEventMessenger;
G4UImanager* fUI;
std::vector<G4int> fSelectedEvents;
G4int fPrintModulo;
G4int fSelected;
G4bool fDebugStarted;
G4UImanager* fUI;
std::vector<G4int> fSelectedEvents;
G4int fPrintModulo{100};
G4bool fDebugStarted{false};
};
inline void EventAction::SetPrintModulo(G4int val)
{
fPrintModulo = val;
}
inline void EventAction::AddEventToDebug(G4int val)
{
fSelectedEvents.push_back(val);
++fSelected;
}
#endif
@@ -56,13 +56,13 @@ class EventActionMessenger: public G4UImessenger
public:
EventActionMessenger(EventAction*);
virtual ~EventActionMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
~EventActionMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
EventAction* fEventAction;
EventAction* fEventAction;
G4UIcmdWithAnInteger* fPrintCmd;
G4UIcmdWithAnInteger* fCmd;
@@ -133,7 +133,6 @@ private:
std::vector<G4String> fNtupleI;
std::vector<G4String> fNtupleF;
std::vector<G4String> fNtupleD;
};
#endif
@@ -89,19 +89,21 @@ public:
void SetVerbose(G4int val);
inline void SetTargetRadius(G4double val) {fRadius = val;
fR2 = val*val;};
inline void SetTargetLength(G4double val) {fLength = val;};
inline void SetNumberOfSlices(G4int val) {fNSlices = val;};
inline void SetNumberOfBinsE(G4int val) {fNBinsE = val;};
inline void SetDefaultBeamPositionFlag(G4bool f) {fBeamFlag = f;};
inline void SetMaxEnergyDeposit(G4double val) {fEdepMax = val;};
inline void SetTargetRadius(G4double val) { fRadius = val; fR2 = val*val; };
inline void SetTargetLength(G4double val) { fLength = val; };
inline void SetNumberOfSlices(G4int val) { fNSlices = val; };
inline void SetNumberOfBinsE(G4int val) { fNBinsE = val; };
inline void SetDefaultBeamPositionFlag(G4bool f) { fBeamFlag = f; };
inline void SetMaxEnergyDeposit(G4double val) { fEdepMax = val; };
inline G4double Radius() const {return fRadius;};
inline G4double Length() const {return fLength;};
inline G4bool DefaultBeamPosition() const {return fBeamFlag;};
inline G4int NumberOfSlices() const {return fNSlices;};
inline G4int GetVerbose() const {return fVerbose;};
inline G4double Radius() const { return fRadius; };
inline G4double Length() const { return fLength; };
inline G4bool DefaultBeamPosition() const { return fBeamFlag; };
inline G4int NumberOfSlices() const { return fNSlices; };
inline G4int GetVerbose() const { return fVerbose; };
inline G4int PrintBertiniXS() const { return fPrintBertiniXS; };
inline void SetPrintBertiniXS(G4int key) { fPrintBertiniXS = key; };
private:
@@ -148,6 +150,7 @@ private:
G4int fNneu_back = 0;
G4int fNstep = 0;
G4int fNHisto = 28;
G4int fPrintBertiniXS = -1; // 0 - all
G4bool fBeamFlag = true;
G4bool fHistoBooked = false;
@@ -52,9 +52,9 @@ class HistoMessenger: public G4UImessenger
public:
HistoMessenger(Histo* );
virtual ~HistoMessenger();
~HistoMessenger() override;
virtual void SetNewValue(G4UIcommand* ,G4String );
void SetNewValue(G4UIcommand* ,G4String ) override;
private:
@@ -57,10 +57,10 @@ class PhysicsList: public G4VModularPhysicsList
public:
PhysicsList();
virtual ~PhysicsList();
~PhysicsList() override;
virtual void ConstructParticle();
virtual void ConstructProcess();
void ConstructParticle() override;
void ConstructProcess() override;
void AddPhysicsList(const G4String& name);
void List();
@@ -71,13 +71,12 @@ private:
void SetBuilderList1(G4bool flagHP = false);
void SetBuilderList2();
G4VPhysicsConstructor* fEmPhysicsList;
G4VPhysicsConstructor* fParticleList;
std::vector<G4VPhysicsConstructor*> fHadronPhys;
G4VPhysicsConstructor* fEmPhysicsList;
G4VPhysicsConstructor* fParticleList;
std::vector<G4VPhysicsConstructor*> fHadronPhys;
PhysicsListMessenger* fMessenger;
G4PhysListFactoryMessenger* fFactMessenger;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -27,8 +27,6 @@
/// \brief Definition of the PhysicsListMessenger class
//
//
//
//
/////////////////////////////////////////////////////////////////////////
//
// PhysicsListMessenger
@@ -58,8 +56,8 @@ class PhysicsListMessenger: public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList* p = 0);
virtual ~PhysicsListMessenger();
PhysicsListMessenger(PhysicsList* p = nullptr);
~PhysicsListMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
@@ -27,8 +27,6 @@
/// \brief Definition of the PrimaryGeneratorAction class
//
//
//
//
/////////////////////////////////////////////////////////////////////////
//
// PrimaryGeneratorAction
@@ -56,17 +54,18 @@ class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
virtual ~PrimaryGeneratorAction();
~PrimaryGeneratorAction() override;
virtual void GeneratePrimaries(G4Event*);
void GeneratePrimaries(G4Event*) override;
PrimaryGeneratorAction & operator=
(const PrimaryGeneratorAction &right) = delete;
PrimaryGeneratorAction(const PrimaryGeneratorAction&) = delete;
private:
PrimaryGeneratorAction & operator=(const PrimaryGeneratorAction &right);
PrimaryGeneratorAction(const PrimaryGeneratorAction&);
G4ParticleGun* fParticleGun;
HistoManager* fHisto;
G4ParticleGun* fParticleGun;
HistoManager* fHisto;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -35,7 +35,6 @@
//
// GEANT4 Header file
// RunAction
//
//
// -------------------------------------------------------------
@@ -52,20 +51,17 @@ class G4Timer;
class RunAction : public G4UserRunAction
{
public: // Without description
public:
RunAction();
virtual ~RunAction();
~RunAction() override = default;
public: // With description
virtual void BeginOfRunAction(const G4Run*);
// In this method histogramms are booked
void BeginOfRunAction(const G4Run*) override;
virtual void EndOfRunAction(const G4Run*);
// In this method BookHisto method is called in which histogramms are filled
void EndOfRunAction(const G4Run*) override;
private:
G4Timer* fTimer;
};
@@ -57,21 +57,19 @@ class StackingAction : public G4UserStackingAction
public:
StackingAction();
virtual ~StackingAction();
~StackingAction() override;
void SetKillStatus(G4bool value);
void SetKill(const G4String& name);
virtual G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*);
G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*) override;
private:
HistoManager* fHistoManager;
StackingMessenger* fStackMessenger;
G4bool fKillSecondary;
const G4ParticleDefinition* fParticle;
HistoManager* fHistoManager;
StackingMessenger* fStackMessenger;
const G4ParticleDefinition* fParticle{nullptr};
G4bool fKillSecondary{false};
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -56,11 +56,11 @@ class StackingMessenger: public G4UImessenger
{
public:
StackingMessenger(StackingAction*);
virtual ~StackingMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
explicit StackingMessenger(StackingAction*);
~StackingMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
StackingAction* fStackAction;
@@ -49,26 +49,20 @@
class G4Step;
class G4TouchableHistory;
class G4HCofThisEvent;
class HistoManager;
class TargetSD : public G4VSensitiveDetector
{
public: // Without description
TargetSD(const G4String&);
virtual ~TargetSD();
explicit TargetSD(const G4String&);
~TargetSD() override = default;
virtual void Initialize(G4HCofThisEvent*);
virtual G4bool ProcessHits(G4Step*,G4TouchableHistory*);
virtual void EndOfEvent(G4HCofThisEvent*);
virtual void clear();
virtual void PrintAll();
G4bool ProcessHits(G4Step*,G4TouchableHistory*) override;
private:
HistoManager* fHisto;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....