Import Geant4 11.1.0 source tree
This commit is contained in:
@@ -41,15 +41,15 @@ class ActionInitialization : public G4VUserActionInitialization
|
||||
{
|
||||
public:
|
||||
ActionInitialization(DetectorConstruction* detector);
|
||||
virtual ~ActionInitialization();
|
||||
~ActionInitialization() override;
|
||||
|
||||
virtual void BuildForMaster() const;
|
||||
virtual void Build() const;
|
||||
void BuildForMaster() const override;
|
||||
void Build() const override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector;
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
/// \file DetectorConstruction.hh
|
||||
/// \brief Definition of the DetectorConstruction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -39,6 +35,8 @@
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "CLHEP/Units/SystemOfUnits.h"
|
||||
|
||||
class G4Box;
|
||||
class G4LogicalVolume;
|
||||
class G4VPhysicalVolume;
|
||||
@@ -50,90 +48,82 @@ class DetectorMessenger;
|
||||
class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
{
|
||||
public:
|
||||
|
||||
DetectorConstruction();
|
||||
virtual ~DetectorConstruction();
|
||||
|
||||
DetectorConstruction();
|
||||
~DetectorConstruction() override;
|
||||
|
||||
public:
|
||||
|
||||
void SetAbsorberMaterial (G4String);
|
||||
void SetAbsorberThickness(G4double);
|
||||
G4VPhysicalVolume* Construct() override;
|
||||
|
||||
void SetGapMaterial (G4String);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
|
||||
virtual G4VPhysicalVolume* Construct();
|
||||
void SetAbsorberMaterial (const G4String&);
|
||||
void SetAbsorberThickness(G4double);
|
||||
|
||||
void SetGapMaterial (const G4String&);
|
||||
void SetGapThickness(G4double);
|
||||
|
||||
void SetCalorSizeYZ(G4double);
|
||||
void SetNbOfLayers (G4int);
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() { return fWorldSizeX; }
|
||||
G4double GetWorldSizeYZ() { return fWorldSizeYZ; }
|
||||
|
||||
G4double GetCalorThickness() { return fCalorThickness; }
|
||||
G4double GetCalorSizeYZ() { return fCalorSizeYZ; }
|
||||
|
||||
G4int GetNbOfLayers() { return fNbOfLayers; }
|
||||
|
||||
G4Material* GetAbsorberMaterial() { return fAbsorberMaterial; }
|
||||
G4double GetAbsorberThickness() { return fAbsorberThickness; }
|
||||
|
||||
G4Material* GetGapMaterial() { return fGapMaterial; }
|
||||
G4double GetGapThickness() { return fGapThickness; }
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() { return fPhysiWorld; }
|
||||
const G4VPhysicalVolume* GetAbsorber() { return fPhysiAbsorber; }
|
||||
const G4VPhysicalVolume* GetGap() { return fPhysiGap; }
|
||||
|
||||
public:
|
||||
|
||||
void PrintCalorParameters();
|
||||
|
||||
G4double GetWorldSizeX() {return fWorldSizeX;};
|
||||
G4double GetWorldSizeYZ() {return fWorldSizeYZ;};
|
||||
|
||||
G4double GetCalorThickness() {return fCalorThickness;};
|
||||
G4double GetCalorSizeYZ() {return fCalorSizeYZ;};
|
||||
|
||||
G4int GetNbOfLayers() {return fNbOfLayers;};
|
||||
|
||||
G4Material* GetAbsorberMaterial() {return fAbsorberMaterial;};
|
||||
G4double GetAbsorberThickness() {return fAbsorberThickness;};
|
||||
|
||||
G4Material* GetGapMaterial() {return fGapMaterial;};
|
||||
G4double GetGapThickness() {return fGapThickness;};
|
||||
|
||||
const G4VPhysicalVolume* GetphysiWorld() {return fPhysiWorld;};
|
||||
const G4VPhysicalVolume* GetAbsorber() {return fPhysiAbsorber;};
|
||||
const G4VPhysicalVolume* GetGap() {return fPhysiGap;};
|
||||
|
||||
private:
|
||||
|
||||
G4Material* fAbsorberMaterial;
|
||||
G4double fAbsorberThickness;
|
||||
|
||||
G4Material* fGapMaterial;
|
||||
G4double fGapThickness;
|
||||
|
||||
G4int fNbOfLayers;
|
||||
G4double fLayerThickness;
|
||||
|
||||
G4double fCalorSizeYZ;
|
||||
G4double fCalorThickness;
|
||||
|
||||
G4Material* fDefaultMaterial;
|
||||
G4double fWorldSizeYZ;
|
||||
G4double fWorldSizeX;
|
||||
|
||||
G4Box* fSolidWorld; //pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld; //pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld; //pointer to the physical World
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
|
||||
G4Box* fSolidCalor; //pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor; //pointer to the physical Calor
|
||||
|
||||
G4Box* fSolidLayer; //pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer; //pointer to the physical Layer
|
||||
|
||||
G4Box* fSolidAbsorber; //pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber; //pointer to the physical Absorber
|
||||
|
||||
G4Box* fSolidGap; //pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap; //pointer to the physical Gap
|
||||
|
||||
DetectorMessenger* fDetectorMessenger; //pointer to the Messenger
|
||||
|
||||
private:
|
||||
|
||||
void DefineMaterials();
|
||||
void ComputeCalorParameters();
|
||||
G4VPhysicalVolume* ConstructCalorimeter();
|
||||
G4Material* fAbsorberMaterial = nullptr;
|
||||
G4Material* fGapMaterial = nullptr;
|
||||
G4Material* fDefaultMaterial = nullptr;
|
||||
|
||||
G4int fNbOfLayers = 10;
|
||||
G4double fAbsorberThickness = 10.*CLHEP::mm;
|
||||
G4double fGapThickness = 5.*CLHEP::mm;
|
||||
G4double fCalorSizeYZ = 10.*CLHEP::cm;
|
||||
|
||||
G4double fCalorThickness = 0.; // will be computed
|
||||
G4double fLayerThickness= 0.; // will be computed
|
||||
G4double fWorldSizeYZ = 0.; // will be computed;
|
||||
G4double fWorldSizeX = 0.; // will be computed;
|
||||
|
||||
G4Box* fSolidWorld = nullptr; //pointer to the solid World
|
||||
G4LogicalVolume* fLogicWorld = nullptr; //pointer to the logical World
|
||||
G4VPhysicalVolume* fPhysiWorld = nullptr; //pointer to the physical World
|
||||
|
||||
G4Box* fSolidCalor = nullptr; //pointer to the solid Calor
|
||||
G4LogicalVolume* fLogicCalor = nullptr; //pointer to the logical Calor
|
||||
G4VPhysicalVolume* fPhysiCalor = nullptr; //pointer to the physical Calor
|
||||
|
||||
G4Box* fSolidLayer = nullptr; //pointer to the solid Layer
|
||||
G4LogicalVolume* fLogicLayer = nullptr; //pointer to the logical Layer
|
||||
G4VPhysicalVolume* fPhysiLayer = nullptr; //pointer to the physical Layer
|
||||
|
||||
G4Box* fSolidAbsorber = nullptr; //pointer to the solid Absorber
|
||||
G4LogicalVolume* fLogicAbsorber = nullptr; //pointer to the logical Absorber
|
||||
G4VPhysicalVolume* fPhysiAbsorber = nullptr; //pointer to the physical Absorber
|
||||
|
||||
G4Box* fSolidGap = nullptr; //pointer to the solid Gap
|
||||
G4LogicalVolume* fLogicGap = nullptr; //pointer to the logical Gap
|
||||
G4VPhysicalVolume* fPhysiGap = nullptr; //pointer to the physical Gap
|
||||
|
||||
DetectorMessenger* fDetectorMessenger = nullptr; //pointer to the Messenger
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -141,10 +131,10 @@ class DetectorConstruction : public G4VUserDetectorConstruction
|
||||
inline void DetectorConstruction::ComputeCalorParameters()
|
||||
{
|
||||
// Compute derived parameters of the calorimeter
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers*fLayerThickness;
|
||||
|
||||
fWorldSizeX = 1.2*fCalorThickness; fWorldSizeYZ = 1.2*fCalorSizeYZ;
|
||||
fLayerThickness = fAbsorberThickness + fGapThickness;
|
||||
fCalorThickness = fNbOfLayers*fLayerThickness;
|
||||
|
||||
fWorldSizeX = 1.2*fCalorThickness; fWorldSizeYZ = 1.2*fCalorSizeYZ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
/// \file DetectorMessenger.hh
|
||||
/// \brief Definition of the DetectorMessenger class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -44,7 +40,6 @@ class G4UIdirectory;
|
||||
class G4UIcmdWithAString;
|
||||
class G4UIcmdWithAnInteger;
|
||||
class G4UIcmdWithADoubleAndUnit;
|
||||
class G4UIcmdWithoutParameter;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -52,23 +47,22 @@ class DetectorMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
DetectorMessenger(DetectorConstruction* );
|
||||
virtual ~DetectorMessenger();
|
||||
|
||||
virtual void SetNewValue(G4UIcommand*, G4String);
|
||||
|
||||
~DetectorMessenger() override;
|
||||
|
||||
void SetNewValue(G4UIcommand*, G4String) override;
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector;
|
||||
|
||||
G4UIdirectory* fDetDir;
|
||||
G4UIcmdWithAString* fAbsMaterCmd;
|
||||
G4UIcmdWithAString* fGapMaterCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fAbsThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fGapThickCmd;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeYZCmd;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd;
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
|
||||
G4UIdirectory* fDetDir = nullptr;
|
||||
G4UIcmdWithAString* fAbsMaterCmd = nullptr;
|
||||
G4UIcmdWithAString* fGapMaterCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fAbsThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fGapThickCmd = nullptr;
|
||||
G4UIcmdWithADoubleAndUnit* fSizeYZCmd = nullptr;
|
||||
G4UIcmdWithAnInteger* fNbLayersCmd = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,26 +48,28 @@ class EventAction : public G4UserEventAction
|
||||
{
|
||||
public:
|
||||
EventAction(RunAction*, HistoManager*);
|
||||
virtual ~EventAction();
|
||||
~EventAction() override;
|
||||
|
||||
void BeginOfEventAction(const G4Event*) override;
|
||||
void EndOfEventAction(const G4Event*) override;
|
||||
|
||||
virtual void BeginOfEventAction(const G4Event*);
|
||||
virtual void EndOfEventAction(const G4Event*);
|
||||
|
||||
void AddAbs(G4double de, G4double dl) {fEnergyAbs += de; fTrackLAbs += dl;};
|
||||
void AddGap(G4double de, G4double dl) {fEnergyGap += de; fTrackLGap += dl;};
|
||||
|
||||
|
||||
private:
|
||||
RunAction* fRunAct;
|
||||
HistoManager* fHistoManager;
|
||||
|
||||
G4double fEnergyAbs, fEnergyGap;
|
||||
G4double fTrackLAbs, fTrackLGap;
|
||||
|
||||
G4int fPrintModulo;
|
||||
RunAction* fRunAct = nullptr;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4double fEnergyAbs = 0.;
|
||||
G4double fEnergyGap = 0;
|
||||
G4double fTrackLAbs = 0;
|
||||
G4double fTrackLGap = 0;
|
||||
|
||||
G4int fPrintModulo = 100;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
/// \file PrimaryGeneratorAction.hh
|
||||
/// \brief Definition of the PrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,14 +44,14 @@ class DetectorConstruction;
|
||||
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
|
||||
{
|
||||
public:
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
virtual ~PrimaryGeneratorAction();
|
||||
PrimaryGeneratorAction(DetectorConstruction*);
|
||||
~PrimaryGeneratorAction() override;
|
||||
|
||||
virtual void GeneratePrimaries(G4Event*);
|
||||
void GeneratePrimaries(G4Event*) override;
|
||||
|
||||
private:
|
||||
G4ParticleGun* fParticleGun; //pointer a to G4 class
|
||||
DetectorConstruction* fDetector; //pointer to the geometry
|
||||
G4ParticleGun* fParticleGun = nullptr; //pointer a to G4 class
|
||||
DetectorConstruction* fDetector = nullptr; //pointer to the geometry
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -37,6 +37,7 @@
|
||||
#define RunAction_h 1
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
#include "G4Accumulable.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -48,21 +49,25 @@ class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction(HistoManager*);
|
||||
virtual ~RunAction();
|
||||
~RunAction() override;
|
||||
|
||||
virtual void BeginOfRunAction(const G4Run*);
|
||||
virtual void EndOfRunAction(const G4Run*);
|
||||
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
void BeginOfRunAction(const G4Run*) override;
|
||||
void EndOfRunAction(const G4Run*) override;
|
||||
|
||||
void FillPerEvent(G4double, G4double, G4double, G4double);
|
||||
|
||||
private:
|
||||
HistoManager* fHistoManager;
|
||||
HistoManager* fHistoManager = nullptr;
|
||||
|
||||
G4double fSumEAbs, fSum2EAbs;
|
||||
G4double fSumEGap, fSum2EGap;
|
||||
|
||||
G4double fSumLAbs, fSum2LAbs;
|
||||
G4double fSumLGap, fSum2LGap;
|
||||
G4Accumulable<G4double> fSumEAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2EAbs = 0.;
|
||||
G4Accumulable<G4double> fSumEGap = 0.;
|
||||
G4Accumulable<G4double> fSum2EGap = 0.;
|
||||
|
||||
G4Accumulable<G4double> fSumLAbs = 0.;
|
||||
G4Accumulable<G4double> fSum2LAbs = 0.;
|
||||
G4Accumulable<G4double> fSumLGap = 0.;
|
||||
G4Accumulable<G4double> fSum2LGap = 0.;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
//
|
||||
/// \file SteppingAction.hh
|
||||
/// \brief Definition of the SteppingAction class
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -47,13 +43,13 @@ class SteppingAction : public G4UserSteppingAction
|
||||
{
|
||||
public:
|
||||
SteppingAction(DetectorConstruction*, EventAction*);
|
||||
virtual ~SteppingAction();
|
||||
~SteppingAction() override;
|
||||
|
||||
void UserSteppingAction(const G4Step*) override;
|
||||
|
||||
virtual void UserSteppingAction(const G4Step*);
|
||||
|
||||
private:
|
||||
DetectorConstruction* fDetector;
|
||||
EventAction* fEventAction;
|
||||
DetectorConstruction* fDetector = nullptr;
|
||||
EventAction* fEventAction = nullptr;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user