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
@@ -32,10 +32,9 @@
#include "G4VUserActionInitialization.hh"
namespace B4
{
class DetectorConstruction;
class DetectorConstruction;
}
namespace B4b
@@ -56,8 +55,6 @@ class ActionInitialization : public G4VUserActionInitialization
B4::DetectorConstruction* fDetConstruction = nullptr;
};
}
} // namespace B4b
#endif
@@ -25,12 +25,14 @@
//
//
/// \file B4/B4b/include/DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
/// \brief Definition of the B4::DetectorConstruction class
#ifndef B4DetectorConstruction_h
#define B4DetectorConstruction_h 1
#include "G4VUserDetectorConstruction.hh"
#include "G4Threading.hh"
#include "globals.hh"
class G4VPhysicalVolume;
@@ -76,28 +78,29 @@ class DetectorConstruction : public G4VUserDetectorConstruction
// data members
//
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
// magnetic field messenger
static G4ThreadLocal G4GlobalMagFieldMessenger* fMagFieldMessenger;
// magnetic field messenger
G4VPhysicalVolume* fAbsorberPV = nullptr; // the absorber physical volume
G4VPhysicalVolume* fGapPV = nullptr; // the gap physical volume
G4VPhysicalVolume* fAbsorberPV = nullptr; // the absorber physical volume
G4VPhysicalVolume* fGapPV = nullptr; // the gap physical volume
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
G4bool fCheckOverlaps = true; // option to activate checking of volumes overlaps
};
// inline functions
inline const G4VPhysicalVolume* DetectorConstruction::GetAbsorberPV() const {
inline const G4VPhysicalVolume* DetectorConstruction::GetAbsorberPV() const
{
return fAbsorberPV;
}
inline const G4VPhysicalVolume* DetectorConstruction::GetGapPV() const {
inline const G4VPhysicalVolume* DetectorConstruction::GetGapPV() const
{
return fGapPV;
}
}
} // namespace B4
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
+7 -7
View File
@@ -33,6 +33,8 @@
#include "G4UserEventAction.hh"
#include "globals.hh"
class G4Event;
namespace B4b
{
@@ -48,19 +50,17 @@ class EventAction : public G4UserEventAction
EventAction() = default;
~EventAction() override = default;
void BeginOfEventAction(const G4Event* event) override;
void EndOfEventAction(const G4Event* event) override;
void BeginOfEventAction(const G4Event* event) override;
void EndOfEventAction(const G4Event* event) override;
private:
// methods
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength,
G4double gapEdep, G4double gapTrackLength) const;
void PrintEventStatistics(G4double absoEdep, G4double absoTrackLength, G4double gapEdep,
G4double gapTrackLength) const;
};
}
} // namespace B4b
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -25,13 +25,12 @@
//
//
/// \file B4/B4b/include/PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
/// \brief Definition of the B4::PrimaryGeneratorAction class
#ifndef B4PrimaryGeneratorAction_h
#define B4PrimaryGeneratorAction_h 1
#include "G4VUserPrimaryGeneratorAction.hh"
#include "globals.hh"
class G4ParticleGun;
class G4Event;
@@ -48,17 +47,17 @@ namespace B4
class PrimaryGeneratorAction : public G4VUserPrimaryGeneratorAction
{
public:
PrimaryGeneratorAction();
~PrimaryGeneratorAction() override;
public:
PrimaryGeneratorAction();
~PrimaryGeneratorAction() override;
void GeneratePrimaries(G4Event* event) override;
void GeneratePrimaries(G4Event* event) override;
private:
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
private:
G4ParticleGun* fParticleGun = nullptr; // G4 particle gun
};
}
} // namespace B4
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+2 -4
View File
@@ -31,7 +31,6 @@
#define B4bRunAction_h 1
#include "G4UserRunAction.hh"
#include "globals.hh"
class G4Run;
@@ -65,12 +64,11 @@ class RunAction : public G4UserRunAction
G4Run* GenerateRun() override;
void BeginOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
void EndOfRunAction(const G4Run*) override;
};
}
} // namespace B4b
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
+23 -20
View File
@@ -59,48 +59,51 @@ const G4int kDim = 2;
class RunData : public G4Run
{
public:
RunData() = default;
~RunData() override = default;
public:
RunData() = default;
~RunData() override = default;
void Add(G4int id, G4double de, G4double dl);
void FillPerEvent();
void Add(G4int id, G4double de, G4double dl);
void FillPerEvent();
void Reset();
void Reset();
// Get methods
G4String GetVolumeName(G4int id) const;
G4double GetEdep(G4int id) const;
G4double GetTrackLength(G4int id) const;
// Get methods
G4String GetVolumeName(G4int id) const;
G4double GetEdep(G4int id) const;
G4double GetTrackLength(G4int id) const;
private:
std::array<G4String, kDim> fVolumeNames = { "Absorber", "Gap" };
std::array<G4double, kDim> fEdep = { 0., 0. };
std::array<G4double, kDim> fTrackLength = { 0., 0. };
private:
std::array<G4String, kDim> fVolumeNames = {"Absorber", "Gap"};
std::array<G4double, kDim> fEdep = {0., 0.};
std::array<G4double, kDim> fTrackLength = {0., 0.};
};
// inline functions
inline void RunData::Add(G4int id, G4double de, G4double dl) {
inline void RunData::Add(G4int id, G4double de, G4double dl)
{
fEdep[id] += de;
fTrackLength[id] += dl;
}
inline G4String RunData::GetVolumeName(G4int id) const {
inline G4String RunData::GetVolumeName(G4int id) const
{
return fVolumeNames[id];
}
inline G4double RunData::GetEdep(G4int id) const {
inline G4double RunData::GetEdep(G4int id) const
{
return fEdep[id];
}
inline G4double RunData::GetTrackLength(G4int id) const {
inline G4double RunData::GetTrackLength(G4int id) const
{
return fTrackLength[id];
}
}
} // namespace B4b
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
@@ -32,6 +32,8 @@
#include "G4UserSteppingAction.hh"
class G4Step;
namespace B4
{
class DetectorConstruction;
@@ -48,17 +50,17 @@ namespace B4b
class SteppingAction : public G4UserSteppingAction
{
public:
SteppingAction(const B4::DetectorConstruction* detConstruction);
~SteppingAction() override = default;
public:
SteppingAction(const B4::DetectorConstruction* detConstruction);
~SteppingAction() override = default;
void UserSteppingAction(const G4Step* step) override;
void UserSteppingAction(const G4Step* step) override;
private:
const B4::DetectorConstruction* fDetConstruction = nullptr;
private:
const B4::DetectorConstruction* fDetConstruction = nullptr;
};
}
} // namespace B4b
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......