Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -224,6 +224,7 @@ class G4AdjointCSManager
G4double fMassRatio = 1.; // ion
G4double fLastCSCorrectionFactor = 1.;
G4ParticleDefinition* fCurrentParticleDef = nullptr;
std::size_t fCurrentParticleIndex = 0;
std::size_t fCurrentMatIndex = 0;
@@ -55,45 +55,45 @@ class G4AdjointCSMatrix
void Clear();
void AddData(G4double aPrimEnergy, G4double aCS,
std::vector<double>* aLogSecondEnergyVector,
std::vector<double>* aLogProbVector, size_t n_pro_decade = 0);
std::vector<G4double>* aLogSecondEnergyVector,
std::vector<G4double>* aLogProbVector, std::size_t n_pro_decade = 0);
G4bool GetData(unsigned int i, G4double& aPrimEnergy, G4double& aCS,
G4double& log0, std::vector<double>*& aLogSecondEnergyVector,
std::vector<double>*& aLogProbVector,
std::vector<size_t>*& aLogProbVectorIndex);
G4double& log0, std::vector<G4double>*& aLogSecondEnergyVector,
std::vector<G4double>*& aLogProbVector,
std::vector<std::size_t>*& aLogProbVectorIndex);
inline std::vector<double>* GetLogPrimEnergyVector()
inline std::vector<G4double>* GetLogPrimEnergyVector()
{
return &fLogPrimEnergyVector;
}
inline std::vector<double>* GetLogCrossSectionvector()
inline std::vector<G4double>* GetLogCrossSectionvector()
{
return &fLogCrossSectionVector;
}
inline G4bool IsScatProjToProj() { return fScatProjToProj; }
void Write(G4String file_name);
void Write(const G4String& file_name);
void Read(G4String file_name);
void Read(const G4String& file_name);
private:
std::vector<double> fLogPrimEnergyVector;
std::vector<G4double> fLogPrimEnergyVector;
// Adjoint Cross sections as functions of primary energy
std::vector<double> fLogCrossSectionVector;
std::vector<G4double> fLogCrossSectionVector;
std::vector<std::vector<double>*> fLogSecondEnergyMatrix;
std::vector<std::vector<double>*> fLogProbMatrix;
std::vector<std::vector<G4double>*> fLogSecondEnergyMatrix;
std::vector<std::vector<G4double>*> fLogProbMatrix;
// Each column represents the integrated probability of
// getting a secondary
// index of equidistant LogProb
std::vector<std::vector<size_t>*> fLogProbMatrixIndex;
std::vector<double> fLog0Vector;
std::vector<std::vector<std::size_t>*> fLogProbMatrixIndex;
std::vector<G4double> fLog0Vector;
size_t fNbPrimEnergy = 0;
std::size_t fNbPrimEnergy = 0;
G4bool fScatProjToProj;
};
@@ -47,7 +47,7 @@ class G4AdjointCSManager;
class G4AdjointForcedInteractionForGamma : public G4VContinuousDiscreteProcess
{
public:
explicit G4AdjointForcedInteractionForGamma(G4String process_name);
explicit G4AdjointForcedInteractionForGamma(const G4String& process_name);
~G4AdjointForcedInteractionForGamma() override;
@@ -102,6 +102,8 @@ class G4AdjointForcedInteractionForGamma : public G4VContinuousDiscreteProcess
G4double fTotNbAdjIntLength = 0.;
G4double fNbAdjIntLength = 0.;
G4int fLastFreeFlightTrackId = 1000;
G4bool fContinueGammaAsNewFreeFlight = false;
G4bool fFreeFlightGamma = false;
@@ -58,21 +58,21 @@ class G4AdjointInterpolator
G4double& y1, G4double& y2);
G4double Interpolation(G4double& x, G4double& x1, G4double& x2, G4double& y1,
G4double& y2, G4String InterPolMethod = "Log");
G4double& y2, const G4String& InterPolMethod = "Log");
size_t FindPosition(G4double& x, std::vector<G4double>& x_vec,
size_t ind_min = 0, size_t ind_max = 0);
std::size_t FindPosition(G4double& x, std::vector<G4double>& x_vec,
std::size_t ind_min = 0, std::size_t ind_max = 0);
size_t FindPositionForLogVector(G4double& x, std::vector<G4double>& x_vec);
std::size_t FindPositionForLogVector(G4double& x, std::vector<G4double>& x_vec);
// xvec should monotically increase
G4double Interpolate(G4double& x, std::vector<G4double>& x_vec,
std::vector<G4double>& y_vec,
G4String InterPolMethod = "Log");
const G4String& InterPolMethod = "Log");
G4double InterpolateWithIndexVector(
G4double& x, std::vector<G4double>& x_vec, std::vector<G4double>& y_vec,
std::vector<size_t>& index_vec, G4double x0,
std::vector<std::size_t>& index_vec, G4double x0,
G4double dx); // xvec should monotically increase
G4double InterpolateForLogVector(G4double& x, std::vector<G4double>& x_vec,
@@ -42,7 +42,7 @@ class G4AdjointPhotoElectricModel;
class G4InversePEEffect : public G4VAdjointReverseReaction
{
public:
explicit G4InversePEEffect(G4String process_name,
explicit G4InversePEEffect(const G4String& process_name,
G4AdjointPhotoElectricModel* aModel);
~G4InversePEEffect() override;
@@ -42,16 +42,15 @@ class G4AdjointIonIonisationModel;
class G4IonInverseIonisation : public G4VAdjointReverseReaction
{
public:
explicit G4IonInverseIonisation(G4bool whichScatCase, G4String process_name,
explicit G4IonInverseIonisation(G4bool whichScatCase, const G4String& process_name,
G4AdjointIonIonisationModel* aEmAdjointModel);
~G4IonInverseIonisation() override;
~G4IonInverseIonisation() override = default;
void ProcessDescription(std::ostream&) const override;
void DumpInfo() const override { ProcessDescription(G4cout); };
void DumpInfo() const override { ProcessDescription(G4cout); }
G4IonInverseIonisation(G4IonInverseIonisation&) = delete;
G4IonInverseIonisation& operator=(const G4IonInverseIonisation& right) =
delete;
G4IonInverseIonisation& operator=(const G4IonInverseIonisation& right) = delete;
};
#endif
@@ -47,7 +47,7 @@ class G4VParticleChange;
class G4VAdjointReverseReaction : public G4VDiscreteProcess
{
public:
explicit G4VAdjointReverseReaction(G4String process_name,
explicit G4VAdjointReverseReaction(const G4String& process_name,
G4bool whichScatCase);
~G4VAdjointReverseReaction() override;
@@ -138,20 +138,20 @@ class G4VEmAdjointModel
};
inline G4ParticleDefinition*
GetAdjointEquivalentOfDirectPrimaryParticleDefinition()
GetAdjointEquivalentOfDirectPrimaryParticleDefinition() const
{
return fAdjEquivDirectPrimPart;
}
inline G4ParticleDefinition*
GetAdjointEquivalentOfDirectSecondaryParticleDefinition()
GetAdjointEquivalentOfDirectSecondaryParticleDefinition() const
{
return fAdjEquivDirectSecondPart;
}
inline G4double GetHighEnergyLimit() { return fHighEnergyLimit; }
inline G4double GetHighEnergyLimit() const { return fHighEnergyLimit; }
inline G4double GetLowEnergyLimit() { return fLowEnergyLimit; }
inline G4double GetLowEnergyLimit() const { return fLowEnergyLimit; }
void SetHighEnergyLimit(G4double aVal);
@@ -173,7 +173,7 @@ class G4VEmAdjointModel
fSecondPartSameType = aBool;
}
inline G4bool GetSecondPartOfSameType() { return fSecondPartSameType; }
inline G4bool GetSecondPartOfSameType() const { return fSecondPartSameType; }
inline void SetUseMatrix(G4bool aBool) { fUseMatrix = aBool; }
@@ -189,18 +189,18 @@ class G4VEmAdjointModel
inline void SetApplyCutInRange(G4bool aBool) { fApplyCutInRange = aBool; }
inline G4bool GetUseMatrix() { return fUseMatrix; }
inline G4bool GetUseMatrix() const { return fUseMatrix; }
inline G4bool GetUseMatrixPerElement() { return fUseMatrixPerElement; }
inline G4bool GetUseMatrixPerElement() const { return fUseMatrixPerElement; }
inline G4bool GetUseOnlyOneMatrixForAllElements()
inline G4bool GetUseOnlyOneMatrixForAllElements() const
{
return fOneMatrixForAllElements;
}
inline G4bool GetApplyCutInRange() { return fApplyCutInRange; }
inline G4bool GetApplyCutInRange() const { return fApplyCutInRange; }
inline G4String GetName() { return fName; }
inline const G4String& GetName() const { return fName; }
inline virtual void SetCSBiasingFactor(G4double aVal)
{
@@ -44,7 +44,7 @@ class G4eAdjointMultipleScattering : public G4VMultipleScattering
public:
explicit G4eAdjointMultipleScattering(const G4String& processName = "msc");
~G4eAdjointMultipleScattering() override;
~G4eAdjointMultipleScattering() override = default;
void StartTracking(G4Track*) override;
@@ -42,16 +42,15 @@ class G4VEmAdjointModel;
class G4eInverseBremsstrahlung : public G4VAdjointReverseReaction
{
public:
explicit G4eInverseBremsstrahlung(G4bool whichScatCase, G4String process_name,
explicit G4eInverseBremsstrahlung(G4bool whichScatCase, const G4String& process_name,
G4VEmAdjointModel* aEmAdjointModel);
~G4eInverseBremsstrahlung() override;
~G4eInverseBremsstrahlung() override = default;
void ProcessDescription(std::ostream&) const override;
void DumpInfo() const override { ProcessDescription(G4cout); };
void DumpInfo() const override { ProcessDescription(G4cout); }
G4eInverseBremsstrahlung(G4eInverseBremsstrahlung&) = delete;
G4eInverseBremsstrahlung& operator=(const G4eInverseBremsstrahlung& right) =
delete;
G4eInverseBremsstrahlung& operator=(const G4eInverseBremsstrahlung& right) = delete;
};
#endif
@@ -42,12 +42,12 @@ class G4AdjointComptonModel;
class G4eInverseCompton : public G4VAdjointReverseReaction
{
public:
explicit G4eInverseCompton(G4bool whichScatCase, G4String process_name,
explicit G4eInverseCompton(G4bool whichScatCase, const G4String& process_name,
G4AdjointComptonModel* aEmAdjointModel);
~G4eInverseCompton() override;
~G4eInverseCompton() override = default;
void ProcessDescription(std::ostream&) const override;
void DumpInfo() const override { ProcessDescription(G4cout); };
void DumpInfo() const override { ProcessDescription(G4cout); }
G4eInverseCompton(G4eInverseCompton&) = delete;
G4eInverseCompton& operator=(const G4eInverseCompton& right) = delete;
@@ -42,9 +42,9 @@ class G4VEmAdjointModel;
class G4eInverseIonisation : public G4VAdjointReverseReaction
{
public:
G4eInverseIonisation(G4bool whichScatCase, G4String process_name,
G4eInverseIonisation(G4bool whichScatCase, const G4String& process_name,
G4VEmAdjointModel* aEmAdjointModel);
~G4eInverseIonisation();
~G4eInverseIonisation() override = default;
void ProcessDescription(std::ostream&) const override;
void DumpInfo() const override { ProcessDescription(G4cout); };
@@ -42,9 +42,9 @@ class G4AdjointhIonisationModel;
class G4hInverseIonisation : public G4VAdjointReverseReaction
{
public:
explicit G4hInverseIonisation(G4bool whichScatCase, G4String process_name,
explicit G4hInverseIonisation(G4bool whichScatCase, const G4String& process_name,
G4AdjointhIonisationModel* aEmAdjointModel);
~G4hInverseIonisation() override;
~G4hInverseIonisation() override = default;
G4hInverseIonisation(G4hInverseIonisation&) = delete;
G4hInverseIonisation& operator=(const G4hInverseIonisation& right) = delete;