Import Geant4 11.0.2 source tree

This commit is contained in:
Gabriele Cosmo
2022-05-25 15:50:57 +02:00
parent de4f28d823
commit b3bf75a2a1
341 changed files with 93127 additions and 39343 deletions
@@ -873,7 +873,7 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
G4double ImElasticAmpl0 = 0;
G4double ReElasticAmpl0 = 0;
G4double Tot1=0, exp1;
G4double exp1;
for(G4int i=1; i<=A; ++i) {
N *= (-Unucl*Rho2*(A-i+1)/(G4double)i);
@@ -892,14 +892,12 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
G4double dcos = N*std::cos(FiH*i);
ReElasticAmpl0 += Prod1*N*std::sin(FiH*i);
ImElasticAmpl0 += Prod1*dcos;
Tot1 += medTot*dcos;
if(std::abs(Prod1*N/ImElasticAmpl0) < 0.000001) break;
} // i
static const G4double pi25 = CLHEP::pi/2.568;
ImElasticAmpl0 *= pi25; // The amplitude in mB
ReElasticAmpl0 *= pi25; // The amplitude in mB
Tot1 *= 2*pi25;
G4double C1 = R13Ap*R13Ap*0.5*DDSec1p;
G4double C2 = 2*R23Ap*R13Ap*0.5*DDSec2p;
@@ -952,7 +950,6 @@ G4ElasticHadrNucleusHE::HadrNucDifferCrSec(G4int A, G4double aQ2)
(ImElasticAmpl0+Din1)*
(ImElasticAmpl0+Din1))/twopi;
Tot1 -= DTot1;
Dtot11 = DTot1;
aAIm = ImElasticAmpl0;
aDIm = Din1;
@@ -63,24 +63,21 @@ G4NeutrinoElectronNcModel::G4NeutrinoElectronNcModel(const G4String& name)
G4NeutrinoElectronNcModel::~G4NeutrinoElectronNcModel()
{}
void G4NeutrinoElectronNcModel::ModelDescription(std::ostream& outFile) const
{
outFile << "G4NeutrinoElectronNcModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
outFile << "G4NeutrinoElectronNcModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
}
/////////////////////////////////////////////////////////
G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
G4Nucleus & targetNucleus)
G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack, G4Nucleus&)
{
G4bool result = false;
G4String pName = aTrack.GetDefinition()->GetParticleName();
G4double minEnergy = 0., energy = aTrack.GetTotalEnergy();
G4double minEnergy = 0.;
G4double energy = aTrack.GetTotalEnergy();
if( fCutEnergy > 0. ) // min detected recoil electron energy
{
@@ -93,9 +90,6 @@ G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
}
@@ -104,7 +98,7 @@ G4bool G4NeutrinoElectronNcModel::IsApplicable(const G4HadProjectile & aTrack,
//
G4HadFinalState* G4NeutrinoElectronNcModel::ApplyYourself(
const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
const G4HadProjectile& aTrack, G4Nucleus&)
{
theParticleChange.Clear();
@@ -166,9 +160,6 @@ G4HadFinalState* G4NeutrinoElectronNcModel::ApplyYourself(
theParticleChange.SetEnergyChange( nuTkin );
theParticleChange.SetMomentumChange( aTrack.Get4Momentum().vect().unit() );
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return &theParticleChange;
}
@@ -69,7 +69,7 @@ G4NeutronElectronElModel::G4NeutronElectronElModel(const G4String& name)
fEnergyBin = 200;
fMinEnergy = 1.*MeV;
fMaxEnergy = 10000.*GeV;
fEnergyVector = new G4PhysicsLogVector(fMinEnergy, fMaxEnergy, fEnergyBin);
fEnergyVector = new G4PhysicsLogVector(fMinEnergy, fMaxEnergy, fEnergyBin, false);
fAngleBin = 500;
fAngleTable = 0;
@@ -86,7 +86,7 @@ G4NeutronElectronElModel::~G4NeutronElectronElModel()
if( fEnergyVector )
{
delete fEnergyVector;
fEnergyVector = 0;
fEnergyVector = nullptr;
}
if( fAngleTable )
{
@@ -100,36 +100,19 @@ G4NeutronElectronElModel::~G4NeutronElectronElModel()
void G4NeutronElectronElModel::ModelDescription(std::ostream& outFile) const
{
outFile << "G4NeutronElectronElModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
outFile << "G4NeutronElectronElModel is a neutrino-electron (neutral current) elastic scattering\n"
<< "model which uses the standard model \n"
<< "transfer parameterization. The model is fully relativistic\n";
}
/////////////////////////////////////////////////////////
G4bool G4NeutronElectronElModel::IsApplicable(const G4HadProjectile & aTrack,
G4Nucleus & targetNucleus)
G4bool G4NeutronElectronElModel::IsApplicable(const G4HadProjectile & aTrack, G4Nucleus&)
{
G4bool result = false;
G4String pName = aTrack.GetDefinition()->GetParticleName();
// G4double minEnergy = 0.;
G4double energy = aTrack.GetTotalEnergy();
if( fCutEnergy > 0. ) // min detected recoil electron energy
{
// minEnergy = 0.5*(fCutEnergy+sqrt(fCutEnergy*(fCutEnergy+2.*electron_mass_c2)));
}
if( pName == "neutron" &&
energy >= fMinEnergy && energy <= fMaxEnergy )
{
result = true;
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return result;
return (pName == "neutron" && energy >= fMinEnergy && energy <= fMaxEnergy);
}
////////////////////////////////////////////////////
@@ -180,7 +163,7 @@ G4double G4NeutronElectronElModel::SampleSin2HalfTheta(G4double Tkin)
for( iTkin = 0; iTkin < fEnergyBin; iTkin++)
{
if( Tkin < fEnergyVector->GetLowEdgeEnergy(iTkin) ) break;
if( Tkin < fEnergyVector->Energy(iTkin) ) break;
}
if ( iTkin >= fEnergyBin ) iTkin = fEnergyBin-1; // Tkin is more then theMaxEnergy
if ( iTkin < 0 ) iTkin = 0; // against negative index, Tkin < theMinEnergy
@@ -214,8 +197,7 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
if( iTransfer == 0 || iTransfer == fAngleBin-1 )
{
randTransfer = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer);
// iTransfer++;
randTransfer = (*fAngleTable)(iTkin)->Energy(iTransfer);
}
else
{
@@ -226,8 +208,8 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
y1 = (*(*fAngleTable)(iTkin))(iTransfer-1);
y2 = (*(*fAngleTable)(iTkin))(iTransfer);
x1 = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer-1);
x2 = (*fAngleTable)(iTkin)->GetLowEdgeEnergy(iTransfer);
x1 = (*fAngleTable)(iTkin)->Energy(iTransfer-1);
x2 = (*fAngleTable)(iTkin)->Energy(iTransfer);
delta = y2 - y1;
mean = y2 + y1;
@@ -235,8 +217,6 @@ G4NeutronElectronElModel:: GetTransfer( G4int iTkin, G4int iTransfer, G4double p
if ( x1 == x2 ) randTransfer = x2;
else
{
// if ( y1 == y2 )
if ( delta < epsilon*mean )
{
randTransfer = x1 + ( x2 - x1 )*G4UniformRand();
@@ -280,7 +260,7 @@ G4double G4NeutronElectronElModel::XscIntegrand(G4double x)
//
G4HadFinalState* G4NeutronElectronElModel::ApplyYourself(
const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
const G4HadProjectile& aTrack, G4Nucleus&)
{
theParticleChange.Clear();
@@ -363,9 +343,6 @@ G4HadFinalState* G4NeutronElectronElModel::ApplyYourself(
theParticleChange.SetEnergyChange( Tkin );
theParticleChange.SetMomentumChange( aTrack.Get4Momentum().vect().unit() );
}
G4int Z = targetNucleus.GetZ_asInt();
Z *= 1;
return &theParticleChange;
}