Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
@@ -40,16 +40,14 @@ class DetectorConstruction;
class ActionInitialization : public G4VUserActionInitialization
{
public:
ActionInitialization(DetectorConstruction* );
~ActionInitialization() override = default;
ActionInitialization(DetectorConstruction*);
~ActionInitialization() override = default;
void BuildForMaster() const override;
void Build() const override;
private:
DetectorConstruction* fDetector = nullptr;
};
#endif
@@ -26,7 +26,7 @@
/// \file DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -45,57 +45,50 @@ class DetectorMessenger;
class DetectorConstruction : public G4VUserDetectorConstruction
{
public:
DetectorConstruction();
~DetectorConstruction() override;
~DetectorConstruction() override;
public:
G4VPhysicalVolume* Construct() override;
G4Material*
MaterialWithSingleIsotope(G4String, G4String, G4double, G4int, G4int);
void SetAbsorRadius (G4double);
void SetAbsorLength (G4double);
void SetAbsorMaterial (G4String);
G4Material* MaterialWithSingleIsotope(G4String, G4String, G4double, G4int, G4int);
void SetContainThickness (G4double);
void SetContainMaterial (G4String);
void SetAbsorRadius(G4double);
void SetAbsorLength(G4double);
void SetAbsorMaterial(G4String);
void SetContainThickness(G4double);
void SetContainMaterial(G4String);
public:
G4double GetAbsorRadius() { return fAbsorRadius; };
G4double GetAbsorLength() { return fAbsorLength; };
G4Material* GetAbsorMaterial() { return fAbsorMaterial; };
G4double GetAbsorRadius() {return fAbsorRadius;};
G4double GetAbsorLength() {return fAbsorLength;};
G4Material* GetAbsorMaterial() {return fAbsorMaterial;};
G4double GetContainThickness() { return fContainThickness; };
G4Material* GetContainMaterial() { return fContainMaterial; };
G4double GetContainThickness() {return fContainThickness;};
G4Material* GetContainMaterial() {return fContainMaterial;};
void PrintParameters();
void PrintParameters();
private:
G4double fAbsorRadius = 0., fAbsorLength = 0.;
G4Material* fAbsorMaterial = nullptr;
G4LogicalVolume* fLAbsor = nullptr;
G4double fAbsorRadius = 0., fAbsorLength = 0.;
G4Material* fAbsorMaterial = nullptr;
G4LogicalVolume* fLAbsor = nullptr;
G4double fContainThickness = 0.;
G4Material* fContainMaterial = nullptr;
G4LogicalVolume* fLContain = nullptr;
G4double fContainThickness = 0.;
G4Material* fContainMaterial = nullptr;
G4LogicalVolume* fLContain = nullptr;
G4Material* fWorldMaterial = nullptr;
G4VPhysicalVolume* fPWorld = nullptr;
DetectorMessenger* fDetectorMessenger = nullptr;
G4Material* fWorldMaterial = nullptr;
G4VPhysicalVolume* fPWorld = nullptr;
DetectorMessenger* fDetectorMessenger = nullptr;
private:
void DefineMaterials();
G4VPhysicalVolume* ConstructVolumes();
void DefineMaterials();
G4VPhysicalVolume* ConstructVolumes();
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -45,30 +45,27 @@ class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class DetectorMessenger: public G4UImessenger
class DetectorMessenger : public G4UImessenger
{
public:
DetectorMessenger(DetectorConstruction* );
~DetectorMessenger() override;
DetectorMessenger(DetectorConstruction*);
~DetectorMessenger() override;
void SetNewValue(G4UIcommand*, G4String) override;
private:
DetectorConstruction* fDetector = nullptr;
G4UIdirectory* fTesthadrDir = nullptr;
G4UIdirectory* fDetDir = nullptr;
G4UIcmdWithAString* fMaterCmd1 = nullptr;
G4UIcmdWithAString* fMaterCmd2 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd1 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd2 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd3 = nullptr;
G4UIcommand* fIsotopeCmd = nullptr;
DetectorConstruction* fDetector = nullptr;
G4UIdirectory* fTesthadrDir = nullptr;
G4UIdirectory* fDetDir = nullptr;
G4UIcmdWithAString* fMaterCmd1 = nullptr;
G4UIcmdWithAString* fMaterCmd2 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd1 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd2 = nullptr;
G4UIcmdWithADoubleAndUnit* fSizeCmd3 = nullptr;
G4UIcommand* fIsotopeCmd = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -40,21 +40,20 @@
class ElectromagneticPhysics : public G4VPhysicsConstructor
{
public:
public:
ElectromagneticPhysics(const G4String& name = "standard");
~ElectromagneticPhysics() override = default;
~ElectromagneticPhysics() override = default;
public:
public:
// This method is dummy for physics
void ConstructParticle() override {};
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
// registered to the process manager of each particle type
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -26,7 +26,7 @@
/// \file EventAction.hh
/// \brief Definition of the EventAction class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -42,22 +42,20 @@ class EventAction : public G4UserEventAction
{
public:
EventAction() = default;
~EventAction() override = default;
~EventAction() override = default;
public:
void BeginOfEventAction(const G4Event*) override;
void EndOfEventAction(const G4Event*) override;
void AddEdep (G4double Edep);
void AddEflow(G4double Eflow);
void EndOfEventAction(const G4Event*) override;
void AddEdep(G4double Edep);
void AddEflow(G4double Eflow);
private:
G4double fTotalEnergyDeposit = 0.;
G4double fTotalEnergyFlow = 0.;
G4double fTotalEnergyFlow = 0.;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -33,23 +33,22 @@
#ifndef GammaNuclearPhysics_h
#define GammaNuclearPhysics_h 1
#include "globals.hh"
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class GammaNuclearPhysics : public G4VPhysicsConstructor
{
public:
GammaNuclearPhysics(const G4String& name="gamma");
~GammaNuclearPhysics() override = default;
GammaNuclearPhysics(const G4String& name = "gamma");
~GammaNuclearPhysics() override = default;
public:
void ConstructParticle() override { };
void ConstructProcess() override;
void ConstructParticle() override {};
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -33,23 +33,22 @@
#ifndef GammaNuclearPhysicsLEND_h
#define GammaNuclearPhysicsLEND_h 1
#include "globals.hh"
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class GammaNuclearPhysicsLEND : public G4VPhysicsConstructor
{
public:
GammaNuclearPhysicsLEND(const G4String& name="gamma");
~GammaNuclearPhysicsLEND() override = default;
GammaNuclearPhysicsLEND(const G4String& name = "gamma");
~GammaNuclearPhysicsLEND() override = default;
public:
void ConstructParticle() override { };
void ConstructProcess() override;
void ConstructParticle() override {};
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -33,8 +33,8 @@
#ifndef HadronElasticPhysicsHP_h
#define HadronElasticPhysicsHP_h 1
#include "globals.hh"
#include "G4HadronElasticPhysics.hh"
#include "globals.hh"
class G4GenericMessenger;
@@ -42,28 +42,20 @@ class G4GenericMessenger;
class HadronElasticPhysicsHP : public G4HadronElasticPhysics
{
public:
HadronElasticPhysicsHP(G4int ver = 1);
~HadronElasticPhysicsHP() override;
public:
HadronElasticPhysicsHP(G4int ver = 1);
~HadronElasticPhysicsHP() override;
public:
public:
void ConstructProcess() override;
private:
void DefineCommands();
G4GenericMessenger* fMessenger = nullptr;
G4bool fThermal = false;
G4GenericMessenger* fMessenger = nullptr;
G4bool fThermal = false;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -26,23 +26,23 @@
/// \file HistoManager.hh
/// \brief Definition of the HistoManager class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef HistoManager_h
#define HistoManager_h 1
#include "globals.hh"
#include "G4AnalysisManager.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class HistoManager
{
public:
HistoManager();
~HistoManager() = default;
HistoManager();
~HistoManager() = default;
private:
void Book();
@@ -52,4 +52,3 @@ class HistoManager
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -36,25 +36,25 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsList: public G4VModularPhysicsList
class PhysicsList : public G4VModularPhysicsList
{
public:
PhysicsList();
~PhysicsList() override = default;
public:
PhysicsList();
~PhysicsList() override = default;
public:
void ConstructProcess() override;
void SetCuts()override;
public:
void ConstructProcess() override;
void SetCuts() override;
private:
G4VPhysicsConstructor* fHadronElastic = nullptr;
G4VPhysicsConstructor* fHadronInelastic = nullptr;
G4VPhysicsConstructor* fIonElastic = nullptr;
G4VPhysicsConstructor* fIonInelastic = nullptr;
G4VPhysicsConstructor* fGammaNuclear = nullptr;
G4VPhysicsConstructor* fElectromagnetic = nullptr;
G4VPhysicsConstructor* fDecay = nullptr;
G4VPhysicsConstructor* fRadioactiveDecay = nullptr;
private:
G4VPhysicsConstructor* fHadronElastic = nullptr;
G4VPhysicsConstructor* fHadronInelastic = nullptr;
G4VPhysicsConstructor* fIonElastic = nullptr;
G4VPhysicsConstructor* fIonInelastic = nullptr;
G4VPhysicsConstructor* fGammaNuclear = nullptr;
G4VPhysicsConstructor* fElectromagnetic = nullptr;
G4VPhysicsConstructor* fDecay = nullptr;
G4VPhysicsConstructor* fRadioactiveDecay = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -33,8 +33,8 @@
#ifndef PrimaryGeneratorAction_h
#define PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "G4ParticleGun.hh"
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4Event;
@@ -45,19 +45,18 @@ class DetectorConstruction;
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction(DetectorConstruction*);
~PrimaryGeneratorAction() override;
PrimaryGeneratorAction(DetectorConstruction*);
~PrimaryGeneratorAction() override;
public:
void GeneratePrimaries(G4Event*) override;
G4ParticleGun* GetParticleGun() {return fParticleGun;};
G4ParticleGun* GetParticleGun() { return fParticleGun; };
private:
G4ParticleGun* fParticleGun = nullptr;
DetectorConstruction* fDetector = nullptr;
G4ParticleGun* fParticleGun = nullptr;
DetectorConstruction* fDetector = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -36,24 +36,15 @@
class RadioactiveDecayPhysics : public G4VPhysicsConstructor
{
public:
public:
RadioactiveDecayPhysics(const G4String& name = "radioactiveDecay");
~RadioactiveDecayPhysics() override = default;
~RadioactiveDecayPhysics() override = default;
public:
void ConstructParticle() override;
void ConstructProcess() override;
void ConstructProcess() override;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -36,6 +36,7 @@
#include "G4Run.hh"
#include "G4VProcess.hh"
#include "globals.hh"
#include <map>
class DetectorConstruction;
@@ -47,46 +48,45 @@ class Run : public G4Run
{
public:
Run(DetectorConstruction*);
~Run() override = default;
~Run() override = default;
public:
void SetPrimary(G4ParticleDefinition* particle, G4double energy);
void SetPrimary(G4ParticleDefinition* particle, G4double energy);
void CountProcesses(const G4VProcess* process);
void ParticleCount(G4String, G4double, G4double);
void AddEdep (G4double edep);
void AddEflow (G4double eflow);
void ParticleFlux(G4String, G4double);
void ParticleCount(G4String, G4double, G4double);
void AddEdep(G4double edep);
void AddEflow(G4double eflow);
void ParticleFlux(G4String, G4double);
void Merge(const G4Run*) override;
void EndOfRun();
void EndOfRun();
private:
struct ParticleData {
ParticleData()
: fCount(0), fEmean(0.), fEmin(0.), fEmax(0.),fTmean(-1.) {}
ParticleData(G4int count, G4double ekin, G4double emin, G4double emax,
G4double meanLife)
: fCount(count),fEmean(ekin),fEmin(emin),fEmax(emax),fTmean(meanLife) {}
G4int fCount;
G4double fEmean;
G4double fEmin;
G4double fEmax;
G4double fTmean;
struct ParticleData
{
ParticleData() : fCount(0), fEmean(0.), fEmin(0.), fEmax(0.), fTmean(-1.) {}
ParticleData(G4int count, G4double ekin, G4double emin, G4double emax, G4double meanLife)
: fCount(count), fEmean(ekin), fEmin(emin), fEmax(emax), fTmean(meanLife)
{}
G4int fCount;
G4double fEmean;
G4double fEmin;
G4double fEmax;
G4double fTmean;
};
private:
DetectorConstruction* fDetector = nullptr;
G4ParticleDefinition* fParticle = nullptr;
G4double fEkin = 0.;
G4double fEkin = 0.;
G4double fEnergyDeposit = 0., fEnergyDeposit2 = 0.;
G4double fEnergyFlow = 0., fEnergyFlow2 = 0.;
std::map<G4String,G4int> fProcCounter;
std::map<G4String,ParticleData> fParticleDataMap1;
std::map<G4String,ParticleData> fParticleDataMap2;
G4double fEnergyFlow = 0., fEnergyFlow2 = 0.;
std::map<G4String, G4int> fProcCounter;
std::map<G4String, ParticleData> fParticleDataMap1;
std::map<G4String, ParticleData> fParticleDataMap2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -49,22 +49,20 @@ class RunAction : public G4UserRunAction
{
public:
RunAction(DetectorConstruction*, PrimaryGeneratorAction*);
~RunAction() override;
~RunAction() override;
public:
G4Run* GenerateRun() override;
G4Run* GenerateRun() override;
void BeginOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
private:
DetectorConstruction* fDetector = nullptr;
PrimaryGeneratorAction* fPrimary = nullptr;
Run* fRun = nullptr;
HistoManager* fHistoManager = nullptr;
DetectorConstruction* fDetector = nullptr;
PrimaryGeneratorAction* fPrimary = nullptr;
Run* fRun = nullptr;
HistoManager* fHistoManager = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -44,12 +44,12 @@ class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction(EventAction*);
~SteppingAction() override = default;
~SteppingAction() override = default;
void UserSteppingAction(const G4Step*) override;
private:
EventAction* fEventAction = nullptr;
EventAction* fEventAction = nullptr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,15 +40,15 @@ class EventAction;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class TrackingAction : public G4UserTrackingAction {
public:
class TrackingAction : public G4UserTrackingAction
{
public:
TrackingAction(EventAction*);
~TrackingAction() override = default;
void PreUserTrackingAction(const G4Track*) override;
~TrackingAction() override = default;
void PreUserTrackingAction(const G4Track*) override;
void PostUserTrackingAction(const G4Track*) override;
private:
EventAction* fEventAction = nullptr;
};