Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -61,13 +61,13 @@ G4AnnihiToMuPair::G4AnnihiToMuPair(const G4String& processName,
{
//e+ Energy threshold
const G4double Mu_massc2 = G4MuonPlus::MuonPlus()->GetPDGMass();
LowestEnergyLimit = 2.*Mu_massc2*Mu_massc2/electron_mass_c2 - electron_mass_c2;
fLowEnergyLimit = 2.*Mu_massc2*Mu_massc2/electron_mass_c2 - electron_mass_c2;
//modele ok up to 1000 TeV due to neglected Z-interference
HighestEnergyLimit = 1000.*TeV;
//model is ok up to 1000 TeV due to neglected Z-interference
fHighEnergyLimit = 1000.*TeV;
CurrentSigma = 0.0;
CrossSecFactor = 1.;
fCurrentSigma = 0.0;
fCrossSecFactor = 1.;
SetProcessSubType(6);
G4LossTableManager::Instance()->Register(this);
}
@@ -92,7 +92,6 @@ void G4AnnihiToMuPair::BuildPhysicsTable(const G4ParticleDefinition&)
// Build cross section and mean free path tables
//here no tables, just calling PrintInfoDefinition
{
CurrentSigma = 0.0;
PrintInfoDefinition();
}
@@ -101,9 +100,9 @@ void G4AnnihiToMuPair::BuildPhysicsTable(const G4ParticleDefinition&)
void G4AnnihiToMuPair::SetCrossSecFactor(G4double fac)
// Set the factor to artificially increase the cross section
{
CrossSecFactor = fac;
fCrossSecFactor = fac;
G4cout << "The cross section for AnnihiToMuPair is artificially "
<< "increased by the CrossSecFactor=" << CrossSecFactor << G4endl;
<< "increased by the CrossSecFactor=" << fCrossSecFactor << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -118,12 +117,12 @@ G4double G4AnnihiToMuPair::ComputeCrossSectionPerAtom(G4double Epos, G4double Z)
static const G4double pia = CLHEP::pi * CLHEP::fine_structure_const; // pi * alphaQED
G4double CrossSection = 0.;
if (Epos < LowestEnergyLimit) return CrossSection;
if (Epos <= fLowEnergyLimit) return CrossSection;
G4double xi = LowestEnergyLimit/Epos;
G4double xi = fLowEnergyLimit/Epos;
G4double piaxi = pia * sqrt(xi);
G4double SigmaEl = Sig0 * xi * (1.+xi/2.) * piaxi;
if( Epos>LowestEnergyLimit+1.e-5 ) SigmaEl /= (1.-std::exp( -piaxi/std::sqrt(1-xi) ));
if( Epos>fLowEnergyLimit+1.e-5 ) SigmaEl /= (1.-std::exp( -piaxi/std::sqrt(1-xi) ));
CrossSection = SigmaEl*Z; // SigmaEl per electron * number of electrons per atom
return CrossSection;
}
@@ -151,21 +150,17 @@ G4double G4AnnihiToMuPair::CrossSectionPerVolume(G4double PositronEnergy,
G4double G4AnnihiToMuPair::GetMeanFreePath(const G4Track& aTrack,
G4double, G4ForceCondition*)
// returns the positron mean free path in GEANT4 internal units
{
const G4DynamicParticle* aDynamicPositron = aTrack.GetDynamicParticle();
G4double PositronEnergy = aDynamicPositron->GetKineticEnergy()
+electron_mass_c2;
G4Material* aMaterial = aTrack.GetMaterial();
CurrentSigma = CrossSectionPerVolume(PositronEnergy, aMaterial);
G4double PositronEnergy = aDynamicPositron->GetTotalEnergy();
const G4Material* aMaterial = aTrack.GetMaterial();
// cross section before step
fCurrentSigma = CrossSectionPerVolume(PositronEnergy, aMaterial);
// increase the CrossSection by CrossSecFactor (default 1)
G4double mfp = DBL_MAX;
if(CurrentSigma > DBL_MIN) mfp = 1.0/(CurrentSigma*CrossSecFactor);
return mfp;
return (fCurrentSigma > 0.0) ? 1.0/(fCurrentSigma*fCrossSecFactor) : 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -176,43 +171,36 @@ G4VParticleChange* G4AnnihiToMuPair::PostStepDoIt(const G4Track& aTrack,
// generation of e+e- -> mu+mu-
//
{
aParticleChange.Initialize(aTrack);
static const G4double Mele=electron_mass_c2;
static const G4double Mmuon=G4MuonPlus::MuonPlus()->GetPDGMass();
// current Positron energy and direction, return if energy too low
const G4DynamicParticle *aDynamicPositron = aTrack.GetDynamicParticle();
G4double Epos = aDynamicPositron->GetKineticEnergy() + Mele;
G4double Epos = aDynamicPositron->GetTotalEnergy();
G4double xs = CrossSectionPerVolume(Epos, aTrack.GetMaterial());
// test of cross section
if(CurrentSigma*G4UniformRand() >
CrossSectionPerVolume(Epos, aTrack.GetMaterial()))
if(xs > 0.0 && fCurrentSigma*G4UniformRand() > xs)
{
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
}
if (Epos < LowestEnergyLimit) {
return G4VDiscreteProcess::PostStepDoIt(aTrack,aStep);
}
const G4ThreeVector PosiDirection = aDynamicPositron->GetMomentumDirection();
G4double xi = fLowEnergyLimit/Epos; // xi is always less than 1,
// goes to 0 at high Epos
G4ParticleMomentum PositronDirection =
aDynamicPositron->GetMomentumDirection();
G4double xi = LowestEnergyLimit/Epos; // xi is always less than 1,
// goes to 0 at high Epos
// generate cost
// generate cost; probability function 1+cost**2 at high Epos
//
G4double cost;
do { cost = 2.*G4UniformRand()-1.; }
// Loop checking, 07-Aug-2015, Vladimir Ivanchenko
while (2.*G4UniformRand() > 1.+xi+cost*cost*(1.-xi) );
//1+cost**2 at high Epos
G4double sint = sqrt(1.-cost*cost);
// generate phi
//
G4double phi=2.*pi*G4UniformRand();
G4double phi=2.*CLHEP::pi*G4UniformRand();
G4double Ecm = sqrt(0.5*Mele*(Epos+Mele));
G4double Pcm = sqrt(Ecm*Ecm-Mmuon*Mmuon);
@@ -243,8 +231,8 @@ G4VParticleChange* G4AnnihiToMuPair::PostStepDoIt(const G4Track& aTrack,
// rotate to actual Positron direction
//
MuPlusDirection.rotateUz(PositronDirection);
MuMinusDirection.rotateUz(PositronDirection);
MuPlusDirection.rotateUz(PosiDirection);
MuMinusDirection.rotateUz(PosiDirection);
aParticleChange.SetNumberOfSecondaries(2);
// create G4DynamicParticle object for the particle1
@@ -271,9 +259,9 @@ void G4AnnihiToMuPair::PrintInfoDefinition()
G4String comments ="e+e->mu+mu- annihilation, atomic e- at rest, SubType=.";
G4cout << G4endl << GetProcessName() << ": " << comments
<< GetProcessSubType() << G4endl;
G4cout << " threshold at " << LowestEnergyLimit/GeV << " GeV"
G4cout << " threshold at " << fLowEnergyLimit/CLHEP::GeV << " GeV"
<< " good description up to "
<< HighestEnergyLimit/TeV << " TeV for all Z." << G4endl;
<< fHighEnergyLimit/CLHEP::TeV << " TeV for all Z." << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -81,5 +81,3 @@ G4double G4BetheBlochNoDeltaModel::CrossSectionPerVolume(
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -61,19 +61,15 @@ G4GammaConversionToMuons::G4GammaConversionToMuons(const G4String& processName,
G4ProcessType type)
: G4VDiscreteProcess (processName, type),
Mmuon(G4MuonPlus::MuonPlus()->GetPDGMass()),
Rc(elm_coupling/Mmuon),
Rc(CLHEP::elm_coupling/Mmuon),
LimitEnergy (5.*Mmuon),
LowestEnergyLimit (2.*Mmuon),
HighestEnergyLimit(1e12*GeV), // ok to 1e12GeV, then LPM suppression
Energy5DLimit(0.0),
CrossSecFactor(1.),
f5Dmodel(nullptr),
HighestEnergyLimit(1e12*CLHEP::GeV), // ok to 1e12GeV, then LPM suppression
theGamma(G4Gamma::Gamma()),
theMuonPlus(G4MuonPlus::MuonPlus()),
theMuonMinus(G4MuonMinus::MuonMinus())
{
SetProcessSubType(fGammaConversionToMuMu);
MeanFreePath = DBL_MAX;
fManager = G4LossTableManager::Instance();
fManager->Register(this);
}
@@ -98,7 +94,7 @@ void G4GammaConversionToMuons::BuildPhysicsTable(const G4ParticleDefinition& p)
// Build cross section and mean free path tables
{ //here no tables, just calling PrintInfoDefinition
Energy5DLimit = G4EmParameters::Instance()->MaxEnergyFor5DMuPair();
if(Energy5DLimit > 0.0 && !f5Dmodel) {
if(Energy5DLimit > 0.0 && nullptr != f5Dmodel) {
f5Dmodel = new G4BetheHeitler5DModel();
f5Dmodel->SetLeptonPair(theMuonPlus, theMuonMinus);
const size_t numElems = G4ProductionCutsTable::GetProductionCutsTable()->GetTableSize();
@@ -120,11 +116,7 @@ G4double G4GammaConversionToMuons::GetMeanFreePath(const G4Track& aTrack,
const G4DynamicParticle* aDynamicGamma = aTrack.GetDynamicParticle();
G4double GammaEnergy = aDynamicGamma->GetKineticEnergy();
const G4Material* aMaterial = aTrack.GetMaterial();
MeanFreePath = (GammaEnergy <= LowestEnergyLimit)
? DBL_MAX : ComputeMeanFreePath(GammaEnergy,aMaterial);
return MeanFreePath;
return ComputeMeanFreePath(GammaEnergy, aMaterial);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -207,7 +199,7 @@ G4double G4GammaConversionToMuons::ComputeCrossSectionPerAtom(
G4double Eg=G4Exp(G4Log(1.-4.*Mmuon/Egam)*PowThres)*
G4Exp(G4Log( G4Exp(G4Log(Wsatur)*PowSat)+G4Exp(G4Log(Egam)*PowSat))/PowSat);
G4double CrossSection=7./9.*sigfac*G4Log(1.+WMedAppr*CorFuc*Eg);
CrossSection*=CrossSecFactor; // increase the CrossSection by (by default 1)
CrossSection *= CrossSecFactor; // increase the CrossSection by (by default 1)
return CrossSection;
}
@@ -216,6 +208,7 @@ G4double G4GammaConversionToMuons::ComputeCrossSectionPerAtom(
void G4GammaConversionToMuons::SetCrossSecFactor(G4double fac)
// Set the factor to artificially increase the cross section
{
if(fac < 0.0) return;
CrossSecFactor=fac;
G4cout << "The cross section for GammaConversionToMuons is artificially "
<< "increased by the CrossSecFactor=" << CrossSecFactor << G4endl;
@@ -57,15 +57,12 @@
using namespace std;
G4eeToHadrons::G4eeToHadrons(const G4String& name)
: G4VEmProcess(name),
multimodel(nullptr),
csFactor(1.0),
isInitialised(false)
: G4VEmProcess(name)
{
//SetVerboseLevel(2);
SetProcessSubType(fAnnihilationToHadrons);
SetBuildTableFlag(false);
SetIntegral(true);
SetCrossSectionType(fEmOnePeak);
SetSecondaryParticle(G4Gamma::Gamma());
}
@@ -116,7 +113,7 @@ void G4eeToHadrons::SetCrossSecFactor(G4double fac)
void G4eeToHadrons::ProcessDescription(std::ostream& out) const
{
out << "No description available." << G4endl;
out << "G4eeToHadrons - positron annihilation on atomic electrons" << G4endl;
G4VEmProcess::ProcessDescription(out);
}
@@ -70,10 +70,6 @@ G4eeToHadronsModel::G4eeToHadronsModel(G4Vee2hadrons* mod, G4int ver,
const G4String& nam)
: G4VEmModel(nam),
model(mod),
crossPerElectron(0),
crossBornPerElectron(0),
isInitialised(false),
nbins(100),
verbose(ver)
{
theGamma = G4Gamma::Gamma();
@@ -102,8 +98,8 @@ void G4eeToHadronsModel::Initialise(const G4ParticleDefinition*,
isInitialised = true;
// CM system
emin = model->LowEnergy();
emax = model->HighEnergy();
emin = model->LowEnergy();
emax = model->HighEnergy();
// peak energy
epeak = std::min(model->PeakEnergy(), emax);
@@ -174,7 +170,7 @@ G4double G4eeToHadronsModel::ComputeCrossSectionPerElectron(
G4double energy,
G4double, G4double)
{
return (crossPerElectron) ? crossPerElectron->Value(energy) : 0.0;
return crossPerElectron->Value(energy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -185,46 +181,44 @@ void G4eeToHadronsModel::SampleSecondaries(std::vector<G4DynamicParticle*>* newp
G4double,
G4double)
{
if(crossPerElectron) {
G4double t = dParticle->GetKineticEnergy() + 2*electron_mass_c2;
G4LorentzVector inlv = dParticle->Get4Momentum() +
G4LorentzVector(0.0,0.0,0.0,electron_mass_c2);
G4double e = inlv.m();
G4ThreeVector inBoost = inlv.boostVector();
//G4cout << "G4eeToHadronsModel::SampleSecondaries e= " << e
// << " " << inlv << " " << inBoost <<G4endl;
if(e > emin) {
G4DynamicParticle* gamma = GenerateCMPhoton(e);
G4LorentzVector gLv = gamma->Get4Momentum();
G4LorentzVector lv(0.0,0.0,0.0,e);
lv -= gLv;
G4double mass = lv.m();
//G4cout << "mass= " << mass << " " << lv << G4endl;
G4ThreeVector boost = lv.boostVector();
//G4cout << "mass= " << mass << " " << boost << G4endl;
const G4ThreeVector dir = gamma->GetMomentumDirection();
model->SampleSecondaries(newp, mass, dir);
G4int np = newp->size();
for(G4int j=0; j<np; ++j) {
G4DynamicParticle* dp = (*newp)[j];
G4LorentzVector v = dp->Get4Momentum();
v.boost(boost);
//G4cout << j << ". " << v << G4endl;
v.boost(inBoost);
//G4cout << " " << v << G4endl;
dp->Set4Momentum(v);
t -= v.e();
}
//G4cout << "Gamma " << gLv << G4endl;
gLv.boost(inBoost);
//G4cout << " " << gLv << G4endl;
gamma->Set4Momentum(gLv);
t -= gLv.e();
newp->push_back(gamma);
if(std::abs(t) > MeV) {
G4cout << "G4eeToHadronsModel::SampleSecondaries: Ebalance(MeV)= "
<< t/MeV << " primary 4-momentum: " << inlv << G4endl;
}
G4double t = dParticle->GetKineticEnergy() + 2*electron_mass_c2;
G4LorentzVector inlv = dParticle->Get4Momentum() +
G4LorentzVector(0.0,0.0,0.0,electron_mass_c2);
G4double e = inlv.m();
G4ThreeVector inBoost = inlv.boostVector();
//G4cout << "G4eeToHadronsModel::SampleSecondaries e= " << e
// << " " << inlv << " " << inBoost <<G4endl;
if(e > emin) {
G4DynamicParticle* gamma = GenerateCMPhoton(e);
G4LorentzVector gLv = gamma->Get4Momentum();
G4LorentzVector lv(0.0,0.0,0.0,e);
lv -= gLv;
G4double mass = lv.m();
//G4cout << "mass= " << mass << " " << lv << G4endl;
G4ThreeVector boost = lv.boostVector();
//G4cout << "mass= " << mass << " " << boost << G4endl;
const G4ThreeVector dir = gamma->GetMomentumDirection();
model->SampleSecondaries(newp, mass, dir);
G4int np = newp->size();
for(G4int j=0; j<np; ++j) {
G4DynamicParticle* dp = (*newp)[j];
G4LorentzVector v = dp->Get4Momentum();
v.boost(boost);
//G4cout << j << ". " << v << G4endl;
v.boost(inBoost);
//G4cout << " " << v << G4endl;
dp->Set4Momentum(v);
t -= v.e();
}
//G4cout << "Gamma " << gLv << G4endl;
gLv.boost(inBoost);
//G4cout << " " << gLv << G4endl;
gamma->Set4Momentum(gLv);
t -= gLv.e();
newp->push_back(gamma);
if(std::abs(t) > CLHEP::MeV) {
G4cout << "G4eeToHadronsModel::SampleSecondaries: Ebalance(MeV)= "
<< t/MeV << " primary 4-momentum: " << inlv << G4endl;
}
}
}
@@ -350,4 +344,3 @@ G4DynamicParticle* G4eeToHadronsModel::GenerateCMPhoton(G4double e)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -63,17 +63,10 @@
using namespace std;
G4eeToHadronsMultiModel::G4eeToHadronsMultiModel(G4int ver,
const G4String& mname) : G4VEmModel(mname),
csFactor(1.0),
nModels(0),
verbose(ver),
isInitialised(false)
const G4String& mname) : G4VEmModel(mname), verbose(ver)
{
thKineticEnergy = DBL_MAX;
maxKineticEnergy = 4.521*GeV; //crresponding to 10TeV in lab
fParticleChange = nullptr;
cross = nullptr;
delta = 1.0*MeV; //for bin width
maxKineticEnergy = 4.521*CLHEP::GeV; //crresponding to 10TeV in lab
delta = 1.0*CLHEP::MeV; //for bin width
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -127,8 +120,6 @@ void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition*,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4eeToHadronsMultiModel::AddEEModel(G4Vee2hadrons* mod,
const G4DataVector& cuts)
{
@@ -168,6 +159,26 @@ G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerAtom(
return Z*ComputeCrossSectionPerElectron(p, kineticEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerElectron(const G4ParticleDefinition*,
G4double kineticEnergy,
G4double, G4double)
{
G4double res = 0.0;
G4double energy = LabToCM(kineticEnergy);
if (energy > thKineticEnergy) {
for(G4int i=0; i<nModels; i++) {
if(energy >= ekinMin[i] && energy <= ekinMax[i]){
res += (models[i])->ComputeCrossSectionPerElectron(0,energy);
}
cumSum[i] = res;
}
}
return res*csFactor;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -181,7 +192,7 @@ void G4eeToHadronsMultiModel::SampleSecondaries(
G4double energy = LabToCM(kinEnergy);
if (energy > thKineticEnergy) {
G4double q = cumSum[nModels-1]*G4UniformRand();
for(G4int i=0; i<nModels; i++) {
for(G4int i=0; i<nModels; ++i) {
if(q <= cumSum[i]) {
(models[i])->SampleSecondaries(newp, couple,dp);
if(newp->size() > 0) {
@@ -82,7 +82,6 @@ G4eeToPGammaModel::G4eeToPGammaModel(G4eeCrossSections* cr,
particle = G4Eta::Eta();
}
massP = particle->GetPDGMass();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -71,7 +71,7 @@ G4eeToTwoPiModel::G4eeToTwoPiModel(G4eeCrossSections* cr,
G4cout << "#####G4eeToTwoPiModel####" << G4endl;
massPi = G4PionPlus::PionPlus()->GetPDGMass();
massRho = 775.5*MeV;
massRho = 775.5*CLHEP::MeV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -44,14 +44,10 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4hBremsstrahlung.hh"
#include "G4SystemOfUnits.hh"
#include "G4hBremsstrahlungModel.hh"
#include "G4EmParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4hBremsstrahlung::G4hBremsstrahlung(const G4String& name)
: G4MuBremsstrahlung(name)
{}
@@ -65,27 +61,17 @@ G4hBremsstrahlung::~G4hBremsstrahlung()
G4bool G4hBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
{
return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
return (p.GetPDGCharge() != 0.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hBremsstrahlung::InitialiseEnergyLossProcess(
const G4ParticleDefinition*,
const G4ParticleDefinition*)
const G4ParticleDefinition* part,
const G4ParticleDefinition* bpart)
{
if(!isInitialised) {
isInitialised = true;
if (!EmModel()) { SetEmModel(new G4hBremsstrahlungModel()); }
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
EmModel()->SetLowEnergyLimit(param->MinKinEnergy());
EmModel()->SetHighEnergyLimit(param->MaxKinEnergy());
EmModel()->SetSecondaryThreshold(param->MuHadBremsstrahlungTh());
AddEmModel(1, EmModel(), fm);
}
if(nullptr == EmModel(0)) { SetEmModel(new G4hBremsstrahlungModel()); }
G4MuBremsstrahlung::InitialiseEnergyLossProcess(part, bpart);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -51,6 +51,7 @@
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Log.hh"
#include "G4NistManager.hh"
using namespace std;
@@ -44,14 +44,10 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4hPairProduction.hh"
#include "G4SystemOfUnits.hh"
#include "G4hPairProductionModel.hh"
#include "G4EmParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4hPairProduction::G4hPairProduction(const G4String& name)
: G4MuPairProduction(name)
{}
@@ -65,38 +61,24 @@ G4hPairProduction::~G4hPairProduction()
G4bool G4hPairProduction::IsApplicable(const G4ParticleDefinition& p)
{
return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
return (p.GetPDGCharge() != 0.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hPairProduction::InitialiseEnergyLossProcess(
const G4ParticleDefinition* part,
const G4ParticleDefinition*)
const G4ParticleDefinition* bpart)
{
if (!isInitialised) {
isInitialised = true;
theParticle = part;
if (!EmModel()) { SetEmModel(new G4hPairProductionModel(part)); }
G4double limit = part->GetPDGMass()*8.;
if(limit > lowestKinEnergy) { lowestKinEnergy = limit; }
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
EmModel()->SetLowEnergyLimit(param->MinKinEnergy());
EmModel()->SetHighEnergyLimit(param->MaxKinEnergy());
EmModel()->SetSecondaryThreshold(param->MuHadBremsstrahlungTh());
AddEmModel(1, EmModel(), fm);
}
if (nullptr == EmModel(0)) { SetEmModel(new G4hPairProductionModel(part)); }
G4MuPairProduction::InitialiseEnergyLossProcess(part, bpart);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hPairProduction::ProcessDescription(std::ostream& out) const
{
out << " Hadron pair production";
out << "e+e- pair production by hadrons";
G4VEnergyLossProcess::ProcessDescription(out);
}
@@ -52,7 +52,6 @@
#include "G4BetheBlochNoDeltaModel.hh"
#include "G4ICRU73NoDeltaModel.hh"
#include "G4UniversalFluctuation.hh"
#include "G4BohrFluctuations.hh"
#include "G4IonFluctuations.hh"
#include "G4UnitsTable.hh"
#include "G4Electron.hh"
@@ -61,18 +60,11 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4hhIonisation::G4hhIonisation(const G4String& name)
: G4VEnergyLossProcess(name),
theParticle(nullptr),
//theBaseParticle(nullptr),
isInitialised(false)
: G4VEnergyLossProcess(name)
{
SetStepFunction(0.1, 0.1*mm);
SetVerboseLevel(1);
SetProcessSubType(fIonisation);
SetSecondaryParticle(G4Electron::Electron());
mass = 0.0;
ratio = 0.0;
flucModel = nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -84,8 +76,7 @@ G4hhIonisation::~G4hhIonisation()
G4bool G4hhIonisation::IsApplicable(const G4ParticleDefinition& p)
{
return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 100.0*MeV &&
!p.IsShortLived());
return (p.GetPDGCharge() != 0.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -109,15 +100,14 @@ void G4hhIonisation::InitialiseEnergyLossProcess(
if(isInitialised) { return; }
theParticle = part;
if(bpart) {
if(nullptr != bpart) {
G4cout << "G4hhIonisation::InitialiseEnergyLossProcess WARNING: no "
<< "base particle should be defined for the process "
<< GetProcessName() << G4endl;
}
SetBaseParticle(0);
mass = theParticle->GetPDGMass();
ratio = electron_mass_c2/mass;
G4double eth = 2*MeV*mass/proton_mass_c2;
G4double eth = 2*CLHEP::MeV*mass/proton_mass_c2;
flucModel = new G4IonFluctuations();
G4EmParameters* param = G4EmParameters::Instance();
@@ -129,17 +119,19 @@ void G4hhIonisation::InitialiseEnergyLossProcess(
G4int bin = G4lrint(param->NumberOfBinsPerDecade()*std::log10(emax/emin));
SetDEDXBinning(bin);
G4VEmModel* em = nullptr;
if(part->GetPDGCharge() > 0.0) { em = new G4BraggNoDeltaModel(); }
else { em = new G4ICRU73NoDeltaModel(); }
G4VEmModel* em = EmModel(0);
if (nullptr == em) {
if(part->GetPDGCharge() > 0.0) { em = new G4BraggNoDeltaModel(); }
else { em = new G4ICRU73NoDeltaModel(); }
}
em->SetLowEnergyLimit(emin);
em->SetHighEnergyLimit(eth);
AddEmModel(1, em, flucModel);
em = new G4BetheBlochNoDeltaModel();
em = EmModel(1);
if(nullptr == em) { em = new G4BetheBlochNoDeltaModel(); }
em->SetLowEnergyLimit(eth);
em->SetHighEnergyLimit(emax);
SetEmModel(em);
AddEmModel(1, em, flucModel);
if(verboseLevel>1) {
@@ -150,17 +142,9 @@ void G4hhIonisation::InitialiseEnergyLossProcess(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hhIonisation::PrintInfo()
{
G4cout << " Delta-ray will not be produced; "
<< G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4hhIonisation::ProcessDescription(std::ostream& out) const
{
out << "No description available." << G4endl;
out << "G4hhIonisation: no delta rays" << G4endl;
G4VEnergyLossProcess::ProcessDescription(out);
}
@@ -53,19 +53,15 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4mplIonisation::G4mplIonisation(G4double mCharge, const G4String& name)
: G4VEnergyLossProcess(name),
magneticCharge(mCharge),
isInitialised(false)
magneticCharge(mCharge)
{
// By default classical magnetic charge is used
if(magneticCharge == 0.0) { magneticCharge = eplus*0.5/fine_structure_const; }
if(magneticCharge == 0.0) { magneticCharge = CLHEP::eplus*0.5/CLHEP::fine_structure_const; }
SetVerboseLevel(0);
SetProcessSubType(fIonisation);
SetStepFunction(0.2, 1*mm);
SetSecondaryParticle(G4Electron::Electron());
}
@@ -101,8 +97,6 @@ void G4mplIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* p,
{
if(isInitialised) { return; }
SetBaseParticle(0);
// monopole model is responsible both for energy loss and fluctuations
G4mplIonisationWithDeltaModel* ion =
new G4mplIonisationWithDeltaModel(magneticCharge,"PAI");
@@ -127,14 +121,9 @@ void G4mplIonisation::InitialiseEnergyLossProcess(const G4ParticleDefinition* p,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4mplIonisation::PrintInfo()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4mplIonisation::ProcessDescription(std::ostream& out) const
{
out << "No description available." << G4endl;
out << "Magnetic monopole ionisation" << G4endl;
G4VEnergyLossProcess::ProcessDescription(out);
}
@@ -64,28 +64,23 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
std::vector<G4double>* G4mplIonisationModel::dedx0 = nullptr;
G4mplIonisationModel::G4mplIonisationModel(G4double mCharge, const G4String& nam)
: G4VEmModel(nam),G4VEmFluctuationModel(nam),
magCharge(mCharge),
twoln10(log(100.0)),
twoln10(G4Log(100.0)),
betalow(0.01),
betalim(0.1),
beta2lim(betalim*betalim),
bg2lim(beta2lim*(1.0 + beta2lim))
{
nmpl = G4int(abs(magCharge) * 2 * fine_structure_const + 0.5);
nmpl = G4int(std::abs(magCharge) * 2 * CLHEP::fine_structure_const + 0.5);
if(nmpl > 6) { nmpl = 6; }
else if(nmpl < 1) { nmpl = 1; }
pi_hbarc2_over_mc2 = pi * hbarc * hbarc / electron_mass_c2;
pi_hbarc2_over_mc2 = CLHEP::pi*CLHEP::hbarc*CLHEP::hbarc/CLHEP::electron_mass_c2;
chargeSquare = magCharge * magCharge;
dedxlim = 45.*nmpl*nmpl*GeV*cm2/g;
fParticleChange = nullptr;
monopole = nullptr;
mass = 0.0;
dedxlim = 45.*nmpl*nmpl*CLHEP::GeV*CLHEP::cm2/CLHEP::g;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -102,9 +97,9 @@ void G4mplIonisationModel::SetParticle(const G4ParticleDefinition* p)
monopole = p;
mass = monopole->GetPDGMass();
G4double emin =
std::min(LowEnergyLimit(),0.1*mass*(1./sqrt(1. - betalow*betalow) - 1.));
std::min(LowEnergyLimit(),0.1*mass*(1./std::sqrt(1. - betalow*betalow) - 1.));
G4double emax =
std::max(HighEnergyLimit(),10.*mass*(1./sqrt(1. - beta2lim) - 1.));
std::max(HighEnergyLimit(),10.*mass*(1./std::sqrt(1. - beta2lim) - 1.));
SetLowEnergyLimit(emin);
SetHighEnergyLimit(emax);
}
@@ -114,10 +109,10 @@ void G4mplIonisationModel::SetParticle(const G4ParticleDefinition* p)
void G4mplIonisationModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
if(!monopole) { SetParticle(p); }
if(!fParticleChange) { fParticleChange = GetParticleChangeForLoss(); }
if(nullptr == monopole) { SetParticle(p); }
if(nullptr == fParticleChange) { fParticleChange = GetParticleChangeForLoss(); }
if(IsMaster()) {
if(!dedx0) { dedx0 = new std::vector<G4double>; }
if(nullptr == dedx0) { dedx0 = new std::vector<G4double>; }
G4ProductionCutsTable* theCoupleTable=
G4ProductionCutsTable::GetProductionCutsTable();
G4int numOfCouples = theCoupleTable->GetTableSize();
@@ -146,12 +141,12 @@ G4double G4mplIonisationModel::ComputeDEDXPerVolume(const G4Material* material,
G4double kineticEnergy,
G4double)
{
if(!monopole) { SetParticle(p); }
if(nullptr == monopole) { SetParticle(p); }
G4double tau = kineticEnergy / mass;
G4double gam = tau + 1.0;
G4double bg2 = tau * (tau + 2.0);
G4double beta2 = bg2 / (gam * gam);
G4double beta = sqrt(beta2);
G4double beta = std::sqrt(beta2);
// low-energy asymptotic formula
//G4double dedx = dedxlim*beta*material->GetDensity();
@@ -193,7 +188,7 @@ G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material,
G4double x1den = material->GetIonisation()->GetX1density();
// Ahlen's formula for nonconductors, [1]p157, f(5.7)
G4double dedx = log(2.0 * electron_mass_c2 * bg2 / eexc) - 0.5;
G4double dedx = std::log(2.0 * electron_mass_c2 * bg2 / eexc) - 0.5;
// Kazama et al. cross-section correction
G4double k = 0.406;
@@ -206,10 +201,10 @@ G4double G4mplIonisationModel::ComputeDEDXAhlen(const G4Material* material,
// density effect correction
G4double deltam;
G4double x = log(bg2) / twoln10;
G4double x = std::log(bg2) / twoln10;
if ( x >= x0den ) {
deltam = twoln10 * x - cden;
if ( x < x1den ) deltam += aden * pow((x1den-x), mden);
if ( x < x1den ) deltam += aden * std::pow((x1den-x), mden);
dedx -= 0.5 * deltam;
}
@@ -240,7 +235,7 @@ G4double G4mplIonisationModel::SampleFluctuations(
{
G4double siga = Dispersion(couple->GetMaterial(),dp,tmax,length);
G4double loss = meanLoss;
siga = sqrt(siga);
siga = std::sqrt(siga);
G4double twomeanLoss = meanLoss + meanLoss;
if(twomeanLoss < siga) {