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
@@ -271,7 +271,7 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
G4Nucleus & aNucleus)
//----------------------------------------------------------------------------
{
if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction starts ######### "<< G4endl;
if(std::getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction starts ######### "<< G4endl;
G4LorentzVector initial4Momentum = aTrack.Get4Momentum();
const G4ParticleDefinition * definition = aTrack.GetDefinition();
@@ -290,7 +290,7 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
G4KineticTrackVector * secondaries;// = new G4KineticTrackVector;
G4ThreeVector initialPosition(0., 0., 0.); // will be set later
if(!getenv("I_Am_G4BinaryCascade_Developer") )
if(!std::getenv("I_Am_G4BinaryCascade_Developer") )
{
if(definition!=G4Neutron::NeutronDefinition() &&
definition!=G4Proton::ProtonDefinition() &&
@@ -380,7 +380,7 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
} else { // no interaction, return primary
if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction void, return intial state ######### "<< G4endl;
if(std::getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction void, return intial state ######### "<< G4endl;
theParticleChange.SetStatusChange(isAlive);
theParticleChange.SetEnergyChange(aTrack.GetKineticEnergy());
theParticleChange.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
@@ -395,7 +395,7 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
delete the3DNucleus;
the3DNucleus = NULL;
if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction ends ######### "<< G4endl;
if(std::getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction ends ######### "<< G4endl;
return &theParticleChange;
}
@@ -82,7 +82,7 @@ G4BinaryLightIonReaction::G4BinaryLightIonReaction(G4VPreCompoundModel* ptr)
}
debug_G4BinaryLightIonReactionResults=getenv("debug_G4BinaryLightIonReactionResults")!=0;
debug_G4BinaryLightIonReactionResults=std::getenv("debug_G4BinaryLightIonReactionResults")!=0;
}
G4BinaryLightIonReaction::~G4BinaryLightIonReaction()
@@ -106,7 +106,7 @@ struct ReactionProduct4Mom
G4HadFinalState *G4BinaryLightIonReaction::
ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus & targetNucleus )
{
if(getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction starts ######### " << G4endl;
if(std::getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction starts ######### " << G4endl;
G4ping debug("debug_G4BinaryLightIonReaction");
pA=aTrack.GetDefinition()->GetBaryonNumber();
pZ=G4lrint(aTrack.GetDefinition()->GetPDGCharge()/eplus);
@@ -358,7 +358,7 @@ ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus & targetNucleus )
<< " 3mom.mag() " << (aTrack.Get4Momentum()+ G4LorentzVector(m_nucl) - ptot).vect().mag() << G4endl;
#endif
if(getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction number ends ######### " << G4endl;
if(std::getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction number ends ######### " << G4endl;
return &theResult;
}
@@ -76,7 +76,7 @@
//#define debugPrecoInt
G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(G4VPreCompoundModel* preModel)
: CaptureThreshold(70*MeV) // Uzhi 1.05.2015 10 ->70
: CaptureThreshold(70*MeV), DeltaM(5.0*MeV), DeltaR(0.0)
{
proton = G4Proton::Proton();
neutron = G4Neutron::Neutron();
@@ -149,24 +149,23 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
G4double mass = (*iter)->Get4Momentum().mag();
G4ThreeVector mom = (*iter)->Get4Momentum().vect();
if((part != proton && part != neutron) ||
// Uzhi 2.05.2015 (e > mass + CaptureThreshold) ||
((*iter)->GetPosition().mag() > R)) {
G4ReactionProduct * theNew = new G4ReactionProduct(part);
theNew->SetMomentum(mom);
theNew->SetTotalEnergy(e);
theTotalResult->push_back(theNew);
Secondary4Momentum += (*iter)->Get4Momentum(); // Uzhi 29 April
Secondary4Momentum += (*iter)->Get4Momentum();
#ifdef debugPrecoInt
G4cout<<"Secondary 4Mom "<<part->GetParticleName()<<" "<<(*iter)->Get4Momentum()<<" "
<<(*iter)->Get4Momentum().mag()<<G4endl;
#endif
} else {
if( e-mass > -CaptureThreshold*G4Log( G4UniformRand()) ) { // Added by Uzhi 2.05.2015
if( e-mass > -CaptureThreshold*G4Log( G4UniformRand()) ) {
G4ReactionProduct * theNew = new G4ReactionProduct(part);
theNew->SetMomentum(mom);
theNew->SetTotalEnergy(e);
theTotalResult->push_back(theNew);
Secondary4Momentum += (*iter)->Get4Momentum(); // Uzhi 29 April
Secondary4Momentum += (*iter)->Get4Momentum();
#ifdef debugPrecoInt
G4cout<<"Secondary 4Mom "<<part->GetParticleName()<<" "<<(*iter)->Get4Momentum()<<" "
<<(*iter)->Get4Momentum().mag()<<G4endl;
@@ -240,7 +239,7 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
if(anA == 0) return theTotalResult;
G4LorentzVector exciton4Momentum(0.,0.,0.,0.); // Uzhi 29 April
G4LorentzVector exciton4Momentum(0.,0.,0.,0.);
if(anA >= aZ)
{
if(!QGSM)
@@ -251,13 +250,13 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
exciton4Momentum = Residual4Momentum + captured4Momentum;
//exciton4Momentum.setE(std::sqrt(exciton4Momentum.vect().mag2()+sqr(fMass)));
G4double ActualMass = exciton4Momentum.mag();
if(ActualMass <= fMass ) { //E*<=0, Uzhi 5.05.2015
exciton4Momentum.setE(std::sqrt(exciton4Momentum.vect().mag2()+sqr(fMass))); // Uzhi 13.05.2015
if(ActualMass <= fMass ) {
exciton4Momentum.setE(std::sqrt(exciton4Momentum.vect().mag2()+sqr(fMass)));
}
#ifdef debugPrecoInt
G4double exEnergy = 0.0;
if(ActualMass <= fMass ) {exEnergy = 0.;} // Uzhi 5.05.2015
if(ActualMass <= fMass ) {exEnergy = 0.;}
else {exEnergy = ActualMass - fMass;}
G4cout<<"Ground state residual Mass "<<fMass<<" E* "<<exEnergy<<G4endl;
#endif
@@ -344,7 +343,7 @@ void G4GeneratorPrecompoundInterface::PropagateModelDescription(std::ostream& ou
}
// Uzhi Nov. 2012 ------------------------------------------------
G4ReactionProductVector* G4GeneratorPrecompoundInterface::
PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus,
G4V3DNucleus* theProjectileNucleus)
@@ -445,6 +444,9 @@ PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus
// decay the strong resonances
G4ReactionProductVector * theTotalResult = new G4ReactionProductVector;
G4DecayKineticTracks decay(theSecondaries);
MakeCoalescence(theSecondaries);
#ifdef debugPrecoInt
G4cout<<"Secondary stable particles number "<<theSecondaries->size()<<G4endl;
#endif
@@ -644,24 +646,21 @@ PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus
if(0!=anAb)
{
// G4ThreeVector bstToCM =Projectile4Momentum.findBoostToCM(); // Uzhi Apr. 2015
// Projectile4Momentum.boost(bstToCM); // Uzhi Apr. 2015
G4double fMass = G4NucleiProperties::GetNuclearMass(anAb, aZb);
G4double RemnMass=Projectile4Momentum.mag();
if(RemnMass < fMass)
{
RemnMass=fMass + exEnergyB;
Projectile4Momentum.setE(std::sqrt(Projectile4Momentum.vect().mag2() + // Uzhi 8.05.2015
RemnMass*RemnMass)); // Uzhi 8.05.2015
Projectile4Momentum.setE(std::sqrt(Projectile4Momentum.vect().mag2() +
RemnMass*RemnMass));
} else
{ exEnergyB=RemnMass-fMass;}
if( exEnergyB < 0.) exEnergyB=0.;
G4ThreeVector bstToCM =Projectile4Momentum.findBoostToCM(); // Uzhi Apr. 2015
Projectile4Momentum.boost(bstToCM); // Uzhi Apr. 2015
G4ThreeVector bstToCM =Projectile4Momentum.findBoostToCM();
Projectile4Momentum.boost(bstToCM);
// Need to de-excite the remnant nucleus
G4Fragment anInitialState(anAb, aZb, Projectile4Momentum);
@@ -679,11 +678,11 @@ PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus
// fill pre-compound part into the result, and return
for(unsigned int ll=0; ll<aPrecoResult->size(); ++ll)
{
G4LorentzVector tmp=G4LorentzVector(aPrecoResult->operator[](ll)->GetMomentum(), // Uzhi 2015
aPrecoResult->operator[](ll)->GetTotalEnergy());// Uzhi 2015
tmp.boost(-bstToCM); // Transformation to the system of original remnant // Uzhi 2015
aPrecoResult->operator[](ll)->SetMomentum(tmp.vect()); // Uzhi 2015
aPrecoResult->operator[](ll)->SetTotalEnergy(tmp.e()); // Uzhi 2015
G4LorentzVector tmp=G4LorentzVector(aPrecoResult->operator[](ll)->GetMomentum(),
aPrecoResult->operator[](ll)->GetTotalEnergy());
tmp.boost(-bstToCM); // Transformation to the system of original remnant
aPrecoResult->operator[](ll)->SetMomentum(tmp.vect());
aPrecoResult->operator[](ll)->SetTotalEnergy(tmp.e());
if(ProjectileIsAntiNucleus)
{
@@ -707,7 +706,7 @@ PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus
<<aPrecoResult->operator[](ll)->GetTotalEnergy()<<" "
<<aPrecoResult->operator[](ll)->GetMass()<<G4endl;
#endif
//Uzhi
theTotalResult->push_back(aPrecoResult->operator[](ll));
}
@@ -718,3 +717,49 @@ PropagateNuclNucl(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus
}
void G4GeneratorPrecompoundInterface::MakeCoalescence(G4KineticTrackVector *tracks) {
if (!tracks) return;
G4double MassCut = deuteron->GetPDGMass() + DeltaM; // In MeV
for ( size_t i = 0; i < tracks->size(); ++i ) { // search for protons
G4KineticTrack* trackP = (*tracks)[i];
if ( ! trackP ) continue;
if (trackP->GetDefinition() != proton) continue;
G4LorentzVector Prot4Mom = trackP->Get4Momentum();
G4LorentzVector ProtSPposition = G4LorentzVector(trackP->GetPosition(), trackP->GetFormationTime());
for ( size_t j = 0; j < tracks->size(); ++j ) { // search for neutron
G4KineticTrack* trackN = (*tracks)[j];
if (! trackN ) continue;
if (trackN->GetDefinition() != neutron) continue;
G4LorentzVector Neut4Mom = trackN->Get4Momentum();
G4LorentzVector NeutSPposition = G4LorentzVector( trackN->GetPosition(), trackN->GetFormationTime()*hbarc/fermi);
G4double EffMass = (Prot4Mom + Neut4Mom).mag();
if ( EffMass <= MassCut ) { // && (EffDistance <= SpaceCut)) { // Create deuteron
G4KineticTrack* aDeuteron =
new G4KineticTrack( deuteron,
(trackP->GetFormationTime() + trackN->GetFormationTime())/2.0,
(trackP->GetPosition() + trackN->GetPosition() )/2.0,
( Prot4Mom + Neut4Mom ));
tracks->push_back(aDeuteron);
delete trackP; delete trackN;
(*tracks)[i] = nullptr; (*tracks)[j] = nullptr;
break;
}
}
}
// Find and remove null pointers created by decays above
for ( int jj = tracks->size()-1; jj >= 0; --jj ) {
if ( ! (*tracks)[jj] ) tracks->erase(tracks->begin()+jj);
}
}