Import Geant4 10.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2019-12-06 15:12:28 +01:00
parent b2a62ae692
commit 5baee230e9
2997 changed files with 141580 additions and 98673 deletions
@@ -41,6 +41,10 @@
// version (Denis Bernard)
// 04-06-18 Performance optimization of the final state sampling (M. Novak)
// 10-04-19 CLHEP for boost and rotation, remove local functions (IgS)
// 02-09-19 Set base class to be G4PairProductionRelModel that can provide
// accurate sections now from threshold to very high energies
// including the LPM effect. (M. Novak)
// 14-10-19 Muon's pair genaration in SampleSecondaries
//
// Class Description:
//
@@ -53,11 +57,11 @@
#ifndef G4BetheHeitler5DModel_h
#define G4BetheHeitler5DModel_h 1
#include "G4BetheHeitlerModel.hh"
#include "G4PairProductionRelModel.hh"
class G4IonTable;
class G4BetheHeitler5DModel : public G4BetheHeitlerModel
class G4BetheHeitler5DModel : public G4PairProductionRelModel
{
public:
@@ -77,6 +81,10 @@ public:
inline void SetVerbose(G4int val) { fVerbose = val; }
// Only e+, e+ or mu+, mu- pairs supported
void SetLeptonPair(const G4ParticleDefinition* p1,
const G4ParticleDefinition* p2);
private:
// hide assignment operator
@@ -86,10 +94,20 @@ private:
G4double MaxDiffCrossSection(const G4double* par, G4double eZ,
G4double e, G4double loge) const;
inline void SetConversionMode(G4int to) { fConvMode = to; }
G4IonTable* theIonTable;
G4int fVerbose;
G4int fConversionType;
G4bool iraw;
const G4ParticleDefinition* fLepton1;
const G4ParticleDefinition* fLepton2;
G4int fConvMode;
const G4ParticleDefinition* fTheMuPlus;
const G4ParticleDefinition* fTheMuMinus;
};
#endif
@@ -201,7 +201,6 @@ private:
G4double rangeinit;
G4double geombig;
G4double geomlimit;
G4double lambdalimit;
G4double tlimit;
G4double tgeom;
//
@@ -108,6 +108,7 @@ protected:
inline G4double ScreenFunction2(const G4double delta);
inline void ScreenFunction12(const G4double delta, G4double &f1, G4double &f2);
// helper methods for cross-section computation under different approximations
G4double ComputeParametrizedXSectionPerAtom(G4double gammaEnergy, G4double Z);
G4double ComputeXSectionPerAtom(G4double gammaEnergy, G4double Z);
G4double ComputeDXSectionPerAtom(G4double eplusEnergy, G4double gammaEnergy,
G4double Z);
@@ -124,7 +125,8 @@ private:
G4double fCoulomb;
G4double fLradEl;
G4double fDeltaFactor;
G4double fDeltaMax;
G4double fDeltaMaxLow;
G4double fDeltaMaxHigh;
G4double fEtaValue;
G4double fLPMVarS1Cond;
G4double fLPMILVarS1Cond;
@@ -176,6 +178,9 @@ protected:
//
G4double fLPMEnergy;
//
G4double fParametrizedXSectionThreshold;
G4double fCoulombCorrectionThreshold;
//
G4Pow* fG4Calc;
G4ParticleDefinition* fTheGamma;
G4ParticleDefinition* fTheElectron;
@@ -58,7 +58,7 @@
// 3) Nuclear Form Factor:
// A.V. Butkevich et al. Nucl. Instr. Meth. A488 (2002), 282-294.
//
// ------------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
#ifndef G4ScreeningMottCrossSection_h
@@ -67,13 +67,12 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "globals.hh"
#include "G4Material.hh"
#include "G4ParticleDefinition.hh"
#include "G4ThreeVector.hh"
#include <vector>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static const G4int DIM = 750;
static const G4int DIMMOTT = 750;
class G4NistManager;
class G4Pow;
@@ -85,35 +84,29 @@ public:
explicit G4ScreeningMottCrossSection();
virtual ~G4ScreeningMottCrossSection();
~G4ScreeningMottCrossSection();
void Initialise(const G4ParticleDefinition*, G4double cosThetaLim);
inline void SetupParticle(const G4ParticleDefinition*);
void SetupKinematic(G4double kinEnergy, G4int Z);
G4double NuclearCrossSection(G4int, G4int);
G4ThreeVector GetNewDirection();
G4double NuclearCrossSection(G4int form, G4int fast);
G4double GetScatteringAngle(G4int form, G4int fast);
inline G4double GetMom2CM()const;
inline G4double GetMom2Lab()const;
inline G4double GetTrec() const;
inline G4double GetScreeningCoefficient() const;
inline G4double GetTotalCross() const;
G4double RatioMottRutherford(G4double tet);
G4double RatioMottRutherfordCosT(G4double sin2t2);
G4double McFcorrection(G4double);
G4double RatioMottRutherford(G4double);
G4double RatioMottRutherfordCosT(G4double);
G4double FormFactor2ExpHof(G4double);
G4double FormFactor2Gauss(G4double);
G4double FormFactor2UniformHelm(G4double);
G4double GetScatteringAngle(G4int, G4int);
G4double SetDifferentialXSection(G4double, G4double, G4int);
G4double McFcorrection(G4double sin2t2);
inline void SetupParticle(const G4ParticleDefinition*);
private:
inline G4double GetScreeningAngle();
void SetScreeningCoefficient();
G4double ComputeAngle(G4int idx, G4double& rand);
G4double FormFactor2ExpHof(G4double sin2t2);
G4double FormFactor2Gauss(G4double sin2t2);
G4double FormFactor2UniformHelm(G4double sin2t2);
G4double DifferentialXSection(G4int idx, G4int form);
G4double GetTransitionRandom();
@@ -124,6 +117,8 @@ private:
G4NistManager* fNistManager;
G4Pow* fG4pow;
const G4ParticleDefinition* particle;
G4double fTotalCross;
//cost - min - max
G4double cosThetaMin;// def 1.0
@@ -136,9 +131,6 @@ private:
G4double ecut;
G4double etag;
// projectile........................
const G4ParticleDefinition* particle;
G4double spin;
G4double mass;
@@ -155,20 +147,19 @@ private:
G4double beta;
G4double gamma;
// target nucleus
G4int targetZ;
G4int targetA;
G4double targetMass;
G4double Trec;
G4double As;
//constants
G4double alpha;
G4double htc2;
G4double e2;
//angle
G4double cross[DIM];
// target nucleus
G4double targetMass;
G4double As;
G4int targetZ;
G4int targetA;
// working array
std::vector<G4double> cross;
};
@@ -183,49 +174,6 @@ void G4ScreeningMottCrossSection::SetupParticle(const G4ParticleDefinition* p)
if(0.0 != spin) { spin = 0.5; }
tkin = 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2CM() const
{
return mom2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetMom2Lab() const
{
return momLab2;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTrec() const
{
return Trec;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetScreeningCoefficient() const
{
return As;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetTotalCross() const
{
return fTotalCross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4ScreeningMottCrossSection::GetScreeningAngle()
{
G4double screenangle=2.*std::asin(std::sqrt(As));
return std::min(screenangle, CLHEP::pi);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -38,11 +38,12 @@
// Modifications:
//
// 24.07.2018 Introduced possibility to use sampling tables to sample the
// emitted photon energy (instead of using rejectio) from the Seltzer-
// Berger scalled DCS for bremsstrahlung photon emission. Using these
// sampling tables option gives faster(30-70%) final state generation
// than the original rejection but takes some extra memory (+ ~6MB in
// the case of the full CMS detector). (M Novak)
// emitted photon energy (instead of using rejectio) from the
// Seltzer-Berger scalled DCS for bremsstrahlung photon emission.
// Using these sampling tables option gives faster(30-70%) final
// state generation than the original rejection but takes some
// extra memory (+ ~6MB in the case of the full CMS detector).
// (M Novak)
//
// Class Description:
//
@@ -60,6 +61,7 @@
#include "G4eBremsstrahlungRelModel.hh"
#include "globals.hh"
#include "G4Threading.hh"
class G4Physics2DVector;
class G4SBBremTable;
@@ -72,34 +74,34 @@ public:
explicit G4SeltzerBergerModel(const G4ParticleDefinition* p = nullptr,
const G4String& nam = "eBremSB");
virtual ~G4SeltzerBergerModel();
~G4SeltzerBergerModel() override;
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&) override;
void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
virtual void InitialiseForElement(const G4ParticleDefinition*,
G4int Z) override;
void InitialiseForElement(const G4ParticleDefinition*, G4int Z) override;
virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
void SampleSecondaries(std::vector<G4DynamicParticle*>*,
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double cutEnergy,
G4double maxEnergy) override;
virtual void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*,G4double) override;
void SetupForMaterial(const G4ParticleDefinition*,
const G4Material*, G4double) override;
inline void SetBicubicInterpolationFlag(G4bool val) { fIsUseBicubicInterpolation = val; }
inline void SetBicubicInterpolationFlag(G4bool val)
{ fIsUseBicubicInterpolation = val; };
protected:
virtual G4double ComputeDXSectionPerAtom(G4double gammaEnergy) override;
virtual G4String DirectoryPath() const;
G4double ComputeDXSectionPerAtom(G4double gammaEnergy) override;
private:
void ReadData(G4int izet, const char* path = nullptr);
//
void ReadData(G4int Z);
const G4String& FindDirectoryPath();
G4double SampleEnergyTransfer(const G4double kineticEnergy,
const G4double logKineticEnergy,
@@ -107,16 +109,15 @@ private:
const G4double emax);
// hide assignment operator and cctr
G4SeltzerBergerModel & operator=(const G4SeltzerBergerModel &right) = delete;
G4SeltzerBergerModel(const G4SeltzerBergerModel&) = delete;
private:
G4SeltzerBergerModel & operator=(const G4SeltzerBergerModel &right);
G4SeltzerBergerModel(const G4SeltzerBergerModel&);
static constexpr G4int gMaxZet = 101;
static constexpr G4double gExpNumLimit = -12.;
static G4double gYLimitData[gMaxZet];
static G4Physics2DVector* gSBDCSData[gMaxZet];
static G4SBBremTable* gSBSamplingTable;
static G4String gDataDirectory;
G4bool fIsUseBicubicInterpolation;
G4bool fIsUseSamplingTables;
@@ -125,6 +126,11 @@ private:
size_t fIndx;
size_t fIndy;
#ifdef G4MULTITHREADED
static G4Mutex theSBMutex;
#endif
};
#endif
@@ -74,14 +74,14 @@ public:
explicit G4UrbanMscModel(const G4String& nam = "UrbanMsc");
virtual ~G4UrbanMscModel();
~G4UrbanMscModel() override;
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&) override;
void Initialise(const G4ParticleDefinition*,
const G4DataVector&) override;
virtual void StartTracking(G4Track*) override;
void StartTracking(G4Track*) override;
virtual G4double
G4double
ComputeCrossSectionPerAtom(const G4ParticleDefinition* particle,
G4double KineticEnergy,
G4double AtomicNumber,
@@ -89,16 +89,15 @@ public:
G4double cut =0.,
G4double emax=DBL_MAX) override;
virtual G4ThreeVector& SampleScattering(const G4ThreeVector&,
G4double safety) override;
G4ThreeVector& SampleScattering(const G4ThreeVector&,
G4double safety) override;
virtual G4double
ComputeTruePathLengthLimit(const G4Track& track,
G4double& currentMinimalStep) override;
G4double ComputeTruePathLengthLimit(const G4Track& track,
G4double& currentMinimalStep) override;
virtual G4double ComputeGeomPathLength(G4double truePathLength) override;
G4double ComputeGeomPathLength(G4double truePathLength) override;
virtual G4double ComputeTrueStepLength(G4double geomStepLength) override;
G4double ComputeTrueStepLength(G4double geomStepLength) override;
G4double ComputeTheta0(G4double truePathLength, G4double KineticEnergy);
@@ -133,7 +132,7 @@ private:
G4double mass;
G4double charge,ChargeSquare;
G4double masslimite,lambdalimit,fr;
G4double masslimite,fr;
G4double taubig;
G4double tausmall;
@@ -177,7 +176,7 @@ private:
G4bool firstStep;
G4bool insideskin;
G4bool latDisplasmentbackup ;
G4bool latDisplasmentbackup;
G4bool dispAlg96;
G4double rangecut;