Import Geant4 10.7.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2020-06-26 10:23:25 +02:00
parent c02c370437
commit 67ba86d073
1871 changed files with 174422 additions and 131884 deletions
@@ -72,12 +72,12 @@ public:
virtual ~G4BetheHeitler5DModel();
virtual void Initialise(const G4ParticleDefinition*,
const G4DataVector&) final;
const G4DataVector&) override;
void SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* aDynamicGamma,
G4double, G4double) final;
G4double, G4double) override;
inline void SetVerbose(G4int val) { fVerbose = val; }
@@ -65,7 +65,7 @@ class G4MaterialCutsCouple;
class G4ParticleChangeForLoss;
class G4PAIModelData;
class G4PAIModel : public G4VEmModel, public G4VEmFluctuationModel
class G4PAIModel final : public G4VEmModel, public G4VEmFluctuationModel
{
public:
@@ -60,7 +60,7 @@ class G4ParticleChangeForLoss;
class G4PAIPhotData;
class G4PAIPhotModel : public G4VEmModel, public G4VEmFluctuationModel
class G4PAIPhotModel final : public G4VEmModel, public G4VEmFluctuationModel
{
public:
@@ -153,7 +153,7 @@ G4UniversalFluctuation::SampleGauss(CLHEP::HepRandomEngine* rndm,
G4double& eloss)
{
G4double x = eav;
G4double sig = std::sqrt(esig2);
const G4double sig = std::sqrt(esig2);
if(eav < 0.25*sig) {
x += (2.*rndm->flat() - 1.)*eav;
} else {
@@ -101,6 +101,10 @@ public:
G4double ComputeTheta0(G4double truePathLength, G4double KineticEnergy);
// hide assignment operator
G4UrbanMscModel & operator=(const G4UrbanMscModel &right) = delete;
G4UrbanMscModel(const G4UrbanMscModel&) = delete;
private:
G4double SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy);
@@ -109,17 +113,17 @@ private:
void SampleDisplacementNew(G4double sinTheta, G4double phi);
inline void SetParticle(const G4ParticleDefinition*);
void InitialiseModelCache();
inline void UpdateCache();
inline void SetParticle(const G4ParticleDefinition*);
inline G4double Randomizetlimit();
inline G4double SimpleScattering(G4double xmeanth, G4double x2meanth);
// hide assignment operator
G4UrbanMscModel & operator=(const G4UrbanMscModel &right) = delete;
G4UrbanMscModel(const G4UrbanMscModel&) = delete;
inline G4double ComputeStepmin();
inline G4double ComputeTlimitmin();
CLHEP::HepRandomEngine* rndmEngineMod;
@@ -158,7 +162,6 @@ private:
G4double par1,par2,par3;
G4double stepmin;
G4double stepmina,stepminb;
G4double currentKinEnergy;
G4double currentLogKinEnergy;
@@ -166,12 +169,23 @@ private:
G4double rangeinit;
G4double currentRadLength;
G4int currentMaterialIndex;
G4double rangecut;
G4double drr,finalr;
G4double Zold;
G4double Zeff,Z2,Z23,lnZ;
G4double coeffth1,coeffth2;
G4double coeffc1,coeffc2,coeffc3,coeffc4;
G4double tlow;
G4double invmev;
struct mscData {
G4double ecut, Zeff, Z23, sqrtZ;
G4double coeffth1, coeffth2;
G4double coeffc1, coeffc2, coeffc3, coeffc4;
G4double stepmina, stepminb;
G4double doverra, doverrb;
};
static std::vector<mscData*> msc;
// index of G4MaterialCutsCouple
G4int idx;
G4bool firstStep;
G4bool insideskin;
@@ -179,9 +193,6 @@ private:
G4bool latDisplasmentbackup;
G4bool dispAlg96;
G4double rangecut;
G4double drr,finalr;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -213,33 +224,6 @@ inline G4double G4UrbanMscModel::Randomizetlimit()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline void G4UrbanMscModel::UpdateCache()
{
lnZ = G4Log(Zeff);
// correction in theta0 formula
G4double w = G4Exp(lnZ/6.);
G4double facz = 0.990395+w*(-0.168386+w*0.093286) ;
coeffth1 = facz*(1. - 8.7780e-2/Zeff);
coeffth2 = facz*(4.0780e-2 + 1.7315e-4*Zeff);
// tail parameters
G4double Z13 = w*w;
coeffc1 = 2.3785 - Z13*(4.1981e-1 - Z13*6.3100e-2);
coeffc2 = 4.7526e-1 + Z13*(1.7694 - Z13*3.3885e-1);
coeffc3 = 2.3683e-1 - Z13*(1.8111 - Z13*3.2774e-1);
coeffc4 = 1.7888e-2 + Z13*(1.9659e-2 - Z13*2.6664e-3);
Z2 = Zeff*Zeff;
Z23 = Z13*Z13;
stepmina = 15.99/(1.+0.119*Zeff);
stepminb = 4.39/(1.+0.079*Zeff);
Zold = Zeff;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
inline
G4double G4UrbanMscModel::SimpleScattering(G4double xmeanth, G4double x2meanth)
{
@@ -255,6 +239,22 @@ G4double G4UrbanMscModel::SimpleScattering(G4double xmeanth, G4double x2meanth)
return cth;
}
inline G4double G4UrbanMscModel::ComputeStepmin()
{
// define stepmin using estimation of the ratio
// of lambda_elastic/lambda_transport
G4double rat = currentKinEnergy*invmev;
return lambda0*1.e-3/(2.e-3+rat*(msc[idx]->stepmina+msc[idx]->stepminb*rat));
}
inline G4double G4UrbanMscModel::ComputeTlimitmin()
{
G4double x = (particle == positron) ?
0.7*msc[idx]->sqrtZ*stepmin : 0.87*msc[idx]->Z23*stepmin;
if(currentKinEnergy < tlow) { x *= 0.5*(1.+currentKinEnergy/tlow); }
return std::max(x, tlimitminfix);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -91,15 +91,17 @@ public:
G4double tmin,
G4double maxEnergy) override;
private:
// hide assignment operator
G4eeToTwoGammaModel & operator=(const G4eeToTwoGammaModel &right) = delete;
G4eeToTwoGammaModel(const G4eeToTwoGammaModel&) = delete;
private:
G4double pi_rcl2;
G4ParticleDefinition* theGamma;
G4ParticleChangeForGamma* fParticleChange;
static G4bool fSampleAtomicPDF;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......