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
+44 -49
View File
@@ -43,7 +43,7 @@
#ifndef G4Step_hh
#define G4Step_hh 1
#include <cstdlib> // Include from 'system'
#include <cstdlib> // Include from 'system'
#include <cmath> // Include from 'system'
#include "G4ios.hh" // Include from 'system'
#include <iomanip> // Include from 'system'
@@ -53,7 +53,6 @@
#include "G4StepPoint.hh" // Include from 'track'
#include "G4StepStatus.hh" // Include from 'track'
#include "G4TrackVector.hh" // Include from 'tracking'
#include "G4Profiler.hh" // Include from 'global'
class G4Polyline; // Forward declaration.
class G4Track; // Forward declaration.
@@ -61,9 +60,6 @@ class G4Track; // Forward declaration.
class G4Step
{
public:
// the profiler aliases are only used when compiled with GEANT4_USE_TIMEMORY
using ProfilerConfig = G4ProfilerConfig<G4ProfileType::Step>;
G4Step();
~G4Step();
// Constructor/Destructor
@@ -72,111 +68,110 @@ class G4Step
G4Step& operator=(const G4Step&);
// Copy Constructor and assignment operator
G4Track* GetTrack() const;
void SetTrack(G4Track* value);
inline G4Track* GetTrack() const;
inline void SetTrack(G4Track* value);
// Current track
G4StepPoint* GetPreStepPoint() const;
void SetPreStepPoint(G4StepPoint* value);
G4StepPoint* ResetPreStepPoint(G4StepPoint* value=nullptr);
inline G4StepPoint* GetPreStepPoint() const;
inline void SetPreStepPoint(G4StepPoint* value);
inline G4StepPoint* ResetPreStepPoint(G4StepPoint* value=nullptr);
// Pre-Step points
// If Set method is invoked, the previous StepPoint object is deleted.
// If Reset method is invoked, the previous StepPoint object is not deleted
// but its pointer is returned. Thus it's the caller's responsibility to
// properly delete it.
G4StepPoint* GetPostStepPoint() const;
void SetPostStepPoint(G4StepPoint* value);
G4StepPoint* ResetPostStepPoint(G4StepPoint* value=nullptr);
inline G4StepPoint* GetPostStepPoint() const;
inline void SetPostStepPoint(G4StepPoint* value);
inline G4StepPoint* ResetPostStepPoint(G4StepPoint* value=nullptr);
// Post-Step points
// If Set method is invoked, the previous StepPoint object is deleted.
// If Reset method is invoked, the previous StepPoint object is not deleted
// but its pointer is returned. Thus it's the caller's responsibility to
// properly delete it.
G4double GetStepLength() const;
void SetStepLength(G4double value);
inline G4double GetStepLength() const;
inline void SetStepLength(G4double value);
// Before the end of the AlongStepDoIt loop, StepLength keeps
// the initial value which is determined by the shortest geometrical Step
// proposed by a physics process. After finishing the AlongStepDoIt,
// it will be set equal to 'StepLength' in G4Step
G4double GetTotalEnergyDeposit() const;
void SetTotalEnergyDeposit(G4double value);
inline G4double GetTotalEnergyDeposit() const;
inline void SetTotalEnergyDeposit(G4double value);
// Total energy deposit
G4double GetNonIonizingEnergyDeposit() const;
void SetNonIonizingEnergyDeposit(G4double value);
inline G4double GetNonIonizingEnergyDeposit() const;
inline void SetNonIonizingEnergyDeposit(G4double value);
// Total non-ionizing energy deposit
G4SteppingControl GetControlFlag() const;
void SetControlFlag(G4SteppingControl StepControlFlag);
inline G4SteppingControl GetControlFlag() const;
inline void SetControlFlag(G4SteppingControl StepControlFlag);
// Control flag for stepping
void AddTotalEnergyDeposit(G4double value);
void ResetTotalEnergyDeposit();
inline void AddTotalEnergyDeposit(G4double value);
inline void ResetTotalEnergyDeposit();
// Manipulation of total energy deposit
void AddNonIonizingEnergyDeposit(G4double value);
void ResetNonIonizingEnergyDeposit();
inline void AddNonIonizingEnergyDeposit(G4double value);
inline void ResetNonIonizingEnergyDeposit();
// Manipulation of non-ionizing energy deposit
G4bool IsFirstStepInVolume() const;
G4bool IsLastStepInVolume() const;
inline G4bool IsFirstStepInVolume() const;
inline G4bool IsLastStepInVolume() const;
void SetFirstStepFlag();
void ClearFirstStepFlag();
void SetLastStepFlag();
void ClearLastStepFlag();
inline void SetFirstStepFlag();
inline void ClearFirstStepFlag();
inline void SetLastStepFlag();
inline void ClearLastStepFlag();
// Get/Set/Clear flag for initial/last step
// NOTE: flags are not used
G4ThreeVector GetDeltaPosition() const;
G4double GetDeltaTime() const;
inline G4ThreeVector GetDeltaPosition() const;
inline G4double GetDeltaTime() const;
// Difference of position, time, momentum and energy
G4ThreeVector GetDeltaMomentum() const;
G4double GetDeltaEnergy() const;
// These methods will be deleted
// NOTE: use GetTotalEnergyDeposit() to obtain energy loss in material
inline G4ThreeVector GetDeltaMomentum() const;
inline G4double GetDeltaEnergy() const;
// These methods provide difference between track energy and momentum
// at a step, it is incorrect to use these methods to compute energy
// deposition in media during the step, because secondary particles may
// be produced. For energy deposition use the method GetTotalEnergyDeposit()
void InitializeStep(G4Track* aValue);
inline void InitializeStep(G4Track* aValue);
// Initialize contents of G4Step
void UpdateTrack();
inline void UpdateTrack();
// Update track by using G4Step information
void CopyPostToPreStepPoint();
inline void CopyPostToPreStepPoint();
// Copy PostStepPoint to PreStepPoint
G4Polyline* CreatePolyline() const;
// For visualization
inline void SetPointerToVectorOfAuxiliaryPoints(std::vector<G4ThreeVector>* vec);
inline std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const;
// Auxiliary points modifiers
// --- Secondary buckets ---
std::size_t GetNumberOfSecondariesInCurrentStep() const;
inline std::size_t GetNumberOfSecondariesInCurrentStep() const;
// Secondaries in the current step
const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const;
const G4TrackVector* GetSecondary() const;
G4TrackVector* GetfSecondary();
G4TrackVector* NewSecondaryVector();
inline const G4TrackVector* GetSecondary() const;
inline G4TrackVector* GetfSecondary();
inline G4TrackVector* NewSecondaryVector();
// NOTE: Secondary bucket of the Step contains
// all secondaries during tracking the current track
// (i.e. NOT secondaries produced in the current step)
// all these methods give same object (i.e. G4TrackVector )
// but 2nd one will create bucket in addition
void DeleteSecondaryVector();
inline void DeleteSecondaryVector();
// Just delete secondary bucket
// NOTE: G4Track objects inside the bucket are not deleted
void SetSecondary(G4TrackVector* value);
inline void SetSecondary(G4TrackVector* value);
// Add secondary tracks to the bucket
protected:
+10
View File
@@ -129,6 +129,16 @@ inline void G4Step::ResetNonIonizingEnergyDeposit()
fNonIonizingEnergyDeposit = 0.;
}
inline G4double G4Step::GetDeltaEnergy() const
{
return fpPostStepPoint->GetKineticEnergy() - fpPreStepPoint->GetKineticEnergy();
}
inline G4ThreeVector G4Step::GetDeltaMomentum() const
{
return fpPostStepPoint->GetMomentum() - fpPreStepPoint->GetMomentum();
}
inline void G4Step::SetControlFlag(G4SteppingControl value)
{
fpSteppingControlFlag = value;
+52 -52
View File
@@ -57,100 +57,100 @@ class G4StepPoint
public:
G4StepPoint() = default;
~G4StepPoint()= default;
~G4StepPoint()= default;
// Constructor/Destructor
G4StepPoint(const G4StepPoint&) = default;
G4StepPoint& operator=(const G4StepPoint&);
// Copy Constructor and assignment operator
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector& aValue);
void AddPosition(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetPosition() const;
inline void SetPosition(const G4ThreeVector& aValue);
inline void AddPosition(const G4ThreeVector& aValue);
// Position
G4double GetLocalTime() const;
void SetLocalTime(const G4double aValue);
void AddLocalTime(const G4double aValue);
inline G4double GetLocalTime() const;
inline void SetLocalTime(const G4double aValue);
inline void AddLocalTime(const G4double aValue);
// Time since the track is created
G4double GetGlobalTime() const;
void SetGlobalTime(const G4double aValue);
void AddGlobalTime(const G4double aValue);
inline G4double GetGlobalTime() const;
inline void SetGlobalTime(const G4double aValue);
inline void AddGlobalTime(const G4double aValue);
// Time since the event in which the track belongs is created
G4double GetProperTime() const;
void SetProperTime(const G4double aValue);
void AddProperTime(const G4double aValue);
inline G4double GetProperTime() const;
inline void SetProperTime(const G4double aValue);
inline void AddProperTime(const G4double aValue);
// Proper time of the particle
const G4ThreeVector& GetMomentumDirection() const;
void SetMomentumDirection(const G4ThreeVector& aValue);
void AddMomentumDirection(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetMomentumDirection() const;
inline void SetMomentumDirection(const G4ThreeVector& aValue);
inline void AddMomentumDirection(const G4ThreeVector& aValue);
// Direction of momentum (should be an unit vector)
G4ThreeVector GetMomentum() const;
inline G4ThreeVector GetMomentum() const;
// Total momentum of the track
G4double GetTotalEnergy() const;
inline G4double GetTotalEnergy() const;
// Total energy of the track
G4double GetKineticEnergy() const;
void SetKineticEnergy(const G4double aValue);
void AddKineticEnergy(const G4double aValue);
inline G4double GetKineticEnergy() const;
inline void SetKineticEnergy(const G4double aValue);
inline void AddKineticEnergy(const G4double aValue);
// Kinetic Energy of the track
G4double GetVelocity() const;
void SetVelocity(G4double v);
inline G4double GetVelocity() const;
inline void SetVelocity(G4double v);
// Velocity
G4double GetBeta() const;
inline G4double GetBeta() const;
// Velocity of the track in unit of c(light velocity)
G4double GetGamma() const;
inline G4double GetGamma() const;
// Gamma factor (1/sqrt[1-beta*beta]) of the track
G4VPhysicalVolume* GetPhysicalVolume() const;
inline G4VPhysicalVolume* GetPhysicalVolume() const;
const G4VTouchable* GetTouchable() const;
const G4TouchableHandle& GetTouchableHandle() const;
void SetTouchableHandle(const G4TouchableHandle& apValue);
inline const G4VTouchable* GetTouchable() const;
inline const G4TouchableHandle& GetTouchableHandle() const;
inline void SetTouchableHandle(const G4TouchableHandle& apValue);
G4Material* GetMaterial() const;
void SetMaterial(G4Material*);
inline G4Material* GetMaterial() const;
inline void SetMaterial(G4Material*);
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
void SetMaterialCutsCouple(const G4MaterialCutsCouple*);
inline const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
inline void SetMaterialCutsCouple(const G4MaterialCutsCouple*);
G4VSensitiveDetector* GetSensitiveDetector() const;
void SetSensitiveDetector(G4VSensitiveDetector*);
inline G4VSensitiveDetector* GetSensitiveDetector() const;
inline void SetSensitiveDetector(G4VSensitiveDetector*);
G4double GetSafety() const;
void SetSafety(const G4double aValue);
inline G4double GetSafety() const;
inline void SetSafety(const G4double aValue);
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
void AddPolarization(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetPolarization() const;
inline void SetPolarization(const G4ThreeVector& aValue);
inline void AddPolarization(const G4ThreeVector& aValue);
G4StepStatus GetStepStatus() const;
void SetStepStatus(const G4StepStatus aValue);
inline G4StepStatus GetStepStatus() const;
inline void SetStepStatus(const G4StepStatus aValue);
const G4VProcess* GetProcessDefinedStep() const;
inline const G4VProcess* GetProcessDefinedStep() const;
// If the pointer is 0, this means the Step is defined
// by the user defined limit in the current volume
void SetProcessDefinedStep(const G4VProcess* aValue);
inline void SetProcessDefinedStep(const G4VProcess* aValue);
G4double GetMass() const;
void SetMass(G4double value);
inline G4double GetMass() const;
inline void SetMass(G4double value);
G4double GetCharge() const;
void SetCharge(G4double value);
inline G4double GetCharge() const;
inline void SetCharge(G4double value);
G4double GetMagneticMoment() const;
void SetMagneticMoment(G4double value);
inline G4double GetMagneticMoment() const;
inline void SetMagneticMoment(G4double value);
void SetWeight(G4double aValue);
G4double GetWeight() const;
inline void SetWeight(G4double aValue);
inline G4double GetWeight() const;
private:
+75 -79
View File
@@ -56,7 +56,6 @@
#include "G4VUserTrackInformation.hh"
#include "G4PhysicsModelCatalog.hh"
#include "G4Material.hh"
#include "G4Profiler.hh"
class G4Step; // Forward declaration
class G4MaterialCutsCouple;
@@ -66,9 +65,6 @@ class G4VProcess;
class G4Track
{
public:
// the profiler aliases are only used when compiled with GEANT4_USE_TIMEMORY
using ProfilerConfig = G4ProfilerConfig<G4ProfileType::Track>;
G4Track();
// Default constructor
G4Track(G4DynamicParticle* apValueDynamicParticle,
@@ -76,7 +72,7 @@ class G4Track
const G4ThreeVector& aValuePosition);
// Constructor - aValueTime is a global time
G4Track(const G4Track&);
G4Track(const G4Track&,G4bool copyTouchables = true);
// Copy Constructor - copies members other than tracking information
~G4Track();
@@ -94,137 +90,135 @@ class G4Track
inline G4bool operator!=(const G4Track&);
// Equality operators
void CopyTrackInfo(const G4Track&);
void CopyTrackInfo(const G4Track&, G4bool copyTouchables = true);
// Copy information of the track (w/o tracking information)
G4int GetTrackID() const;
void SetTrackID(const G4int aValue);
inline G4int GetTrackID() const;
inline void SetTrackID(const G4int aValue);
// Get/Set functions track ID
G4int GetParentID() const;
void SetParentID(const G4int aValue);
inline G4int GetParentID() const;
inline void SetParentID(const G4int aValue);
const G4DynamicParticle* GetDynamicParticle() const;
inline const G4DynamicParticle* GetDynamicParticle() const;
// Dynamic particle
const G4ParticleDefinition* GetParticleDefinition() const;
inline const G4ParticleDefinition* GetParticleDefinition() const;
// Particle definition
G4ParticleDefinition* GetDefinition() const;
inline G4ParticleDefinition* GetDefinition() const;
// Obsolete, for backwards compatibility...
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetPosition() const;
inline void SetPosition(const G4ThreeVector& aValue);
// Position, time
G4double GetGlobalTime() const;
void SetGlobalTime(const G4double aValue);
inline G4double GetGlobalTime() const;
inline void SetGlobalTime(const G4double aValue);
// Time since the event in which the track belongs is created
G4double GetLocalTime() const;
void SetLocalTime(const G4double aValue);
inline G4double GetLocalTime() const;
inline void SetLocalTime(const G4double aValue);
// Time since the current track is created
G4double GetProperTime() const;
void SetProperTime(const G4double aValue);
inline G4double GetProperTime() const;
inline void SetProperTime(const G4double aValue);
// Proper time of the current track
G4VPhysicalVolume* GetVolume() const;
G4VPhysicalVolume* GetNextVolume() const;
inline G4VPhysicalVolume* GetVolume() const;
inline G4VPhysicalVolume* GetNextVolume() const;
// Volume, material, touchable
G4Material* GetMaterial() const;
G4Material* GetNextMaterial() const;
inline G4Material* GetMaterial() const;
inline G4Material* GetNextMaterial() const;
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
inline const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
inline const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
const G4VTouchable* GetTouchable() const;
const G4TouchableHandle& GetTouchableHandle() const;
void SetTouchableHandle(const G4TouchableHandle& apValue);
inline const G4VTouchable* GetTouchable() const;
inline const G4TouchableHandle& GetTouchableHandle() const;
inline void SetTouchableHandle(const G4TouchableHandle& apValue);
const G4VTouchable* GetNextTouchable() const;
const G4TouchableHandle& GetNextTouchableHandle() const;
void SetNextTouchableHandle(const G4TouchableHandle& apValue);
inline const G4VTouchable* GetNextTouchable() const;
inline const G4TouchableHandle& GetNextTouchableHandle() const;
inline void SetNextTouchableHandle(const G4TouchableHandle& apValue);
const G4VTouchable* GetOriginTouchable() const;
const G4TouchableHandle& GetOriginTouchableHandle() const;
void SetOriginTouchableHandle(const G4TouchableHandle& apValue);
inline const G4VTouchable* GetOriginTouchable() const;
inline const G4TouchableHandle& GetOriginTouchableHandle() const;
inline void SetOriginTouchableHandle(const G4TouchableHandle& apValue);
G4double GetKineticEnergy() const;
void SetKineticEnergy(const G4double aValue);
inline G4double GetKineticEnergy() const;
inline G4double GetTotalEnergy() const;
inline void SetKineticEnergy(const G4double aValue);
// Energy
G4double GetTotalEnergy() const;
const G4ThreeVector& GetMomentumDirection() const;
void SetMomentumDirection(const G4ThreeVector& aValue);
inline G4ThreeVector GetMomentum() const;
inline const G4ThreeVector& GetMomentumDirection() const;
inline void SetMomentumDirection(const G4ThreeVector& aValue);
// Momentum
G4ThreeVector GetMomentum() const;
G4double GetVelocity() const;
void SetVelocity(G4double val);
inline G4double GetVelocity() const;
inline void SetVelocity(G4double val);
// Velocity
G4double CalculateVelocity() const;
inline G4double CalculateVelocity() const;
G4double CalculateVelocityForOpticalPhoton() const;
G4bool UseGivenVelocity() const;
void UseGivenVelocity(G4bool val);
inline G4bool UseGivenVelocity() const;
inline void UseGivenVelocity(G4bool val);
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetPolarization() const;
inline void SetPolarization(const G4ThreeVector& aValue);
// Polarization
G4TrackStatus GetTrackStatus() const;
void SetTrackStatus(const G4TrackStatus aTrackStatus);
inline G4TrackStatus GetTrackStatus() const;
inline void SetTrackStatus(const G4TrackStatus aTrackStatus);
// Track status, flags for tracking
G4bool IsBelowThreshold() const;
void SetBelowThresholdFlag(G4bool value = true);
inline G4bool IsBelowThreshold() const;
inline void SetBelowThresholdFlag(G4bool value = true);
// The flag of "BelowThreshold" is set to true
// If this track energy is below threshold energy
// in this material is determined by the range cut value
G4bool IsGoodForTracking() const;
void SetGoodForTrackingFlag(G4bool value = true);
inline G4bool IsGoodForTracking() const;
inline void SetGoodForTrackingFlag(G4bool value = true);
// The flag of "GoodForTracking" is set by processes
// if this track should be tracked
// even if the energy is below threshold
G4double GetTrackLength() const;
void AddTrackLength(const G4double aValue);
inline G4double GetTrackLength() const;
inline void AddTrackLength(const G4double aValue);
// Accumulated track length
const G4Step* GetStep() const;
void SetStep(const G4Step* aValue);
inline const G4Step* GetStep() const;
inline void SetStep(const G4Step* aValue);
// Step information
G4int GetCurrentStepNumber() const;
void IncrementCurrentStepNumber();
inline G4int GetCurrentStepNumber() const;
inline void IncrementCurrentStepNumber();
G4double GetStepLength() const;
void SetStepLength(G4double value);
inline G4double GetStepLength() const;
inline void SetStepLength(G4double value);
// Before the end of the AlongStepDoIt() loop, StepLength keeps
// the initial value which is determined by the shortest geometrical Step
// proposed by a physics process. After finishing the AlongStepDoIt(),
// it will be set equal to 'StepLength' in G4Step
const G4ThreeVector& GetVertexPosition() const;
void SetVertexPosition(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetVertexPosition() const;
inline void SetVertexPosition(const G4ThreeVector& aValue);
// Vertex (where this track was created) information
const G4ThreeVector& GetVertexMomentumDirection() const;
void SetVertexMomentumDirection(const G4ThreeVector& aValue);
inline const G4ThreeVector& GetVertexMomentumDirection() const;
inline void SetVertexMomentumDirection(const G4ThreeVector& aValue);
G4double GetVertexKineticEnergy() const;
void SetVertexKineticEnergy(const G4double aValue);
inline G4double GetVertexKineticEnergy() const;
inline void SetVertexKineticEnergy(const G4double aValue);
const G4LogicalVolume* GetLogicalVolumeAtVertex() const;
void SetLogicalVolumeAtVertex(const G4LogicalVolume*);
inline const G4LogicalVolume* GetLogicalVolumeAtVertex() const;
inline void SetLogicalVolumeAtVertex(const G4LogicalVolume*);
const G4VProcess* GetCreatorProcess() const;
void SetCreatorProcess(const G4VProcess* aValue);
inline const G4VProcess* GetCreatorProcess() const;
inline void SetCreatorProcess(const G4VProcess* aValue);
inline void SetCreatorModelID(const G4int id);
inline G4int GetCreatorModelID() const;
@@ -258,12 +252,12 @@ class G4Track
// the above "Get" methods return, respectively: nullptr, 0, false,
// 0, "", 0.
G4double GetWeight() const;
void SetWeight(G4double aValue);
inline G4double GetWeight() const;
inline void SetWeight(G4double aValue);
// Track weight; methods for manipulating a weight for this track
G4VUserTrackInformation* GetUserInformation() const;
void SetUserInformation(G4VUserTrackInformation* aValue) const;
inline G4VUserTrackInformation* GetUserInformation() const;
inline void SetUserInformation(G4VUserTrackInformation* aValue) const;
// User information
void SetAuxiliaryTrackInformation(G4int id,
@@ -363,6 +357,8 @@ class G4Track
G4bool useGivenVelocity = false;
// do not calculate velocity and just use current fVelocity
// if this flag is set
G4bool fCopyTouchables = true;
};
#include "G4Track.icc"
+3 -3
View File
@@ -231,9 +231,6 @@ class G4VParticleChange
const G4Track* theCurrentTrack = nullptr;
std::vector<G4Track*> theListOfSecondaries;
// The vector of secondaries
G4TrackStatus theStatusChange = fAlive;
// The changed (final) track status of a given particle
@@ -284,6 +281,9 @@ class G4VParticleChange
// Flag for setting weight of secondaries
G4bool debugFlag = false;
std::vector<G4Track*> theListOfSecondaries;
// The vector of secondaries
};
#include "G4VParticleChange.icc"