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
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
//
@@ -64,7 +63,6 @@
#include "G4ExcitationHandler.hh"
#include "G4SystemOfUnits.hh"
#include "G4LorentzVector.hh"
#include "G4NistManager.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleTypes.hh"
#include "G4Ions.hh"
@@ -83,25 +81,31 @@
#include "G4Pow.hh"
G4ExcitationHandler::G4ExcitationHandler()
: maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),
fVerbose(1),isInitialised(false),isEvapLocal(true)
: icID(0),maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),
fVerbose(1),fWarnings(0),minEForMultiFrag(1.*CLHEP::TeV),
minExcitation(1.*CLHEP::eV),maxExcitation(100.*CLHEP::MeV),
isInitialised(false),isEvapLocal(true),isActive(true)
{
theTableOfIons = G4ParticleTable::GetParticleTable()->GetIonTable();
nist = G4NistManager::Instance();
theMultiFragmentation = nullptr;
theFermiModel = nullptr;
G4Pow::GetInstance();
theEvaporation = new G4Evaporation();
thePhotonEvaporation = theEvaporation->GetPhotonEvaporation();
theEvaporation = nullptr;
thePhotonEvaporation = nullptr;
theResults.reserve(60);
results.reserve(30);
theEvapList.reserve(30);
thePhotoEvapList.reserve(10);
SetParameters();
electron = G4Electron::Electron();
G4Pow::GetInstance();
theElectron = G4Electron::Electron();
theNeutron = G4Neutron::NeutronDefinition();
theProton = G4Proton::ProtonDefinition();
theDeuteron = G4Deuteron::DeuteronDefinition();
theTriton = G4Triton::TritonDefinition();
theHe3 = G4He3::He3Definition();
theAlpha = G4Alpha::AlphaDefinition();;
if(fVerbose > 1) { G4cout << "### New handler " << this << G4endl; }
}
@@ -115,21 +119,26 @@ G4ExcitationHandler::~G4ExcitationHandler()
void G4ExcitationHandler::SetParameters()
{
G4DeexPrecoParameters* param =
G4NuclearLevelData::GetInstance()->GetParameters();
if(fVerbose > 1) {
G4cout << "G4ExcitationHandler::SetParameters() started " << this << G4endl;
}
auto param = G4NuclearLevelData::GetInstance()->GetParameters();
isActive = true;
if(fDummy == param->GetDeexChannelsType()) { isActive = false; }
minEForMultiFrag = param->GetMinExPerNucleounForMF();
minExcitation = param->GetMinExcitation();
maxExcitation = param->GetPrecoHighEnergy();
icID = param->GetInternalConversionID();
fVerbose = param->GetVerbose();
if(isActive) {
if(!thePhotonEvaporation) {
SetPhotonEvaporation(new G4PhotonEvaporation());
}
if(!theFermiModel) { SetFermiModel(new G4FermiBreakUpVI()); }
if(!thePhotonEvaporation) { SetPhotonEvaporation(new G4PhotonEvaporation()); }
if(!theEvaporation) {
SetEvaporation(new G4Evaporation(thePhotonEvaporation), true);
}
if(!theFermiModel) { SetFermiModel(new G4FermiBreakUpVI()); }
if(!theMultiFragmentation) { SetMultiFragmentation(new G4StatMF()); }
}
theFermiModel->SetVerbose(fVerbose);
}
void G4ExcitationHandler::Initialise()
@@ -154,9 +163,12 @@ void G4ExcitationHandler::SetEvaporation(G4VEvaporation* ptr, G4bool flag)
if(ptr && ptr != theEvaporation) {
delete theEvaporation;
theEvaporation = ptr;
thePhotonEvaporation = ptr->GetPhotonEvaporation();
SetPhotonEvaporation(ptr->GetPhotonEvaporation());
theEvaporation->SetFermiBreakUp(theFermiModel);
isEvapLocal = flag;
if(fVerbose > 1) {
G4cout << "G4ExcitationHandler::SetEvaporation() for " << this << G4endl;
}
}
}
@@ -174,7 +186,7 @@ void G4ExcitationHandler::SetFermiModel(G4VFermiBreakUp* ptr)
if(ptr && ptr != theFermiModel) {
delete theFermiModel;
theFermiModel = ptr;
theEvaporation->SetFermiBreakUp(theFermiModel);
if(theEvaporation) { theEvaporation->SetFermiBreakUp(theFermiModel); }
}
}
@@ -182,14 +194,23 @@ void
G4ExcitationHandler::SetPhotonEvaporation(G4VEvaporationChannel* ptr)
{
if(ptr && ptr != thePhotonEvaporation) {
delete thePhotonEvaporation;
thePhotonEvaporation = ptr;
theEvaporation->SetPhotonEvaporation(ptr);
if(theEvaporation) { theEvaporation->SetPhotonEvaporation(ptr); }
if(fVerbose > 1) {
G4cout << "G4ExcitationHandler::SetPhotonEvaporation() " << ptr
<< " for handler " << this << G4endl;
}
}
}
void G4ExcitationHandler::SetDeexChannelsType(G4DeexChannelType val)
{
G4Evaporation* evap = static_cast<G4Evaporation*>(theEvaporation);
if(fVerbose > 1) {
G4cout << "G4ExcitationHandler::SetDeexChannelsType " << val
<< " for " << this << G4endl;
}
if(val == fDummy) {
isActive = false;
return;
@@ -201,6 +222,8 @@ void G4ExcitationHandler::SetDeexChannelsType(G4DeexChannelType val)
evap->SetCombinedChannel();
} else if(val == fGEM) {
evap->SetGEMChannel();
} else if(val == fGEMVI) {
evap->SetGEMVIChannel();
}
evap->InitialiseChannels();
if(fVerbose > 1) {
@@ -213,12 +236,36 @@ void G4ExcitationHandler::SetDeexChannelsType(G4DeexChannelType val)
}
}
G4VEvaporation* G4ExcitationHandler::GetEvaporation()
{
if(!theEvaporation) { SetParameters(); }
return theEvaporation;
}
G4VMultiFragmentation* G4ExcitationHandler::GetMultiFragmentation()
{
if(!theMultiFragmentation) { SetParameters(); }
return theMultiFragmentation;
}
G4VFermiBreakUp* G4ExcitationHandler::GetFermiModel()
{
if(!theFermiModel) { SetParameters(); }
return theFermiModel;
}
G4VEvaporationChannel* G4ExcitationHandler::GetPhotonEvaporation()
{
if(!thePhotonEvaporation) { SetParameters(); }
return thePhotonEvaporation;
}
G4ReactionProductVector *
G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
{
// Variables existing until end of method
G4Fragment * theInitialStatePtr = new G4Fragment(theInitialState);
if(fVerbose > 2) {
if(fVerbose > 1) {
G4cout << "@@@@@@@@@@ Start G4Excitation Handler @@@@@@@@@@@@@ " << G4endl;
G4cout << theInitialState << G4endl;
}
@@ -228,13 +275,23 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
G4FragmentVector * theTempResult = nullptr;
theResults.clear();
thePhotoEvapList.clear();
theEvapList.clear();
// Variables to describe the excited configuration
G4double exEnergy = theInitialState.GetExcitationEnergy();
G4int A = theInitialState.GetA_asInt();
G4int Z = theInitialState.GetZ_asInt();
// too much excitation
if(exEnergy > A*maxExcitation && A > 0) {
++fWarnings;
if(fWarnings < 0) {
G4ExceptionDescription ed;
ed << "High excitation Fragment Z= " << Z << " A= " << A
<< " Eex/A(MeV)= " << exEnergy/A;
G4Exception("G4ExcitationHandler::BreakItUp()","had0034",JustWarning,ed,"");
}
}
// In case A <= 1 the fragment will not perform any nucleon emission
if (A <= 1 || !isActive) {
@@ -266,33 +323,9 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
// secondary are produced - sort out secondary fragments
} else {
G4bool deletePrimary = true;
G4FragmentVector::iterator j;
for (j = theTempResult->begin(); j != theTempResult->end(); ++j) {
if((*j) == theInitialStatePtr) { deletePrimary = false; }
A = (*j)->GetA_asInt();
// gamma, p, n
if(A <= 1) {
theResults.push_back(*j);
// Analyse fragment A > 1
} else {
G4double exEnergy1 = (*j)->GetExcitationEnergy();
// cold fragments
if(exEnergy1 < minExcitation) {
Z = (*j)->GetZ_asInt();
if(nist->GetIsotopeAbundance(Z, A) > 0.0) {
theResults.push_back(*j); // stable fragment
} else {
theEvapList.push_back(*j);
}
// hot fragments are unstable
} else {
theEvapList.push_back(*j);
}
}
for (auto ptr : *theTempResult) {
if(ptr == theInitialStatePtr) { deletePrimary = false; }
SortSecondaryFragment(ptr);
}
if( deletePrimary ) { delete theInitialStatePtr; }
}
@@ -303,7 +336,6 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
if(fVerbose > 2) {
G4cout << "## After first step of handler " << theEvapList.size()
<< " for evap; "
<< thePhotoEvapList.size() << " for photo-evap; "
<< theResults.size() << " results. " << G4endl;
}
// -----------------------------------
@@ -311,10 +343,9 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
// -----------------------------------
static const G4int countmax = 1000;
G4Fragment* frag;
size_t kk;
for (kk=0; kk<theEvapList.size(); ++kk) {
frag = theEvapList[kk];
G4Fragment* frag = theEvapList[kk];
if(fVerbose > 3) {
G4cout << "Next evaporate: " << G4endl;
G4cout << *frag << G4endl;
@@ -332,118 +363,68 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
A = frag->GetA_asInt();
Z = frag->GetZ_asInt();
results.clear();
if(fVerbose > 2) {
G4cout << "G4ExcitationHandler# " << kk << " Z= " << Z << " A= " << A
<< " Eex(MeV)= " << frag->GetExcitationEnergy() << G4endl;
}
// Fermi Break-Up
if(theFermiModel->IsApplicable(Z, A, frag->GetExcitationEnergy())) {
theFermiModel->BreakFragment(&results, frag);
size_t nsec = results.size();
if(fVerbose > 3) { G4cout << "FermiBreakUp Nsec= " << nsec << G4endl; }
if(fVerbose > 2) { G4cout << "FermiBreakUp Nsec= " << nsec << G4endl; }
// FBU takes care to delete input fragment or add it to the results
// The secondary may be excited - photo-evaporation should be applied
for(size_t j=0; j<nsec; ++j) {
exEnergy = results[j]->GetExcitationEnergy();
if(exEnergy < minExcitation) { theResults.push_back(results[j]); }
else { thePhotoEvapList.push_back(results[j]); }
if(1 < nsec) {
for(auto & res : results) {
SortSecondaryFragment(res);
}
continue;
}
continue;
// evaporation will be applied
}
// apply Evaporation, residual nucleus is always added to the results
// photon evaporation is possible
theEvaporation->BreakFragment(&results, frag);
size_t nsec = results.size();
if(fVerbose > 3) { G4cout << "Evaporation Nsec= " << nsec << G4endl; }
// no evaporation
if(1 >= nsec) {
if(fVerbose > 3) {
G4cout << "Evaporation Nsec= " << results.size() << G4endl;
}
if(0 == results.size()) {
theResults.push_back(frag);
continue;
} else {
SortSecondaryFragment(frag);
}
// Sort out secondary fragments
for (size_t j = 0; j<nsec; ++j) {
for (auto & res : results) {
if(fVerbose > 4) {
G4cout << "Evaporated product #" << j << G4endl;
G4cout << results[j] << G4endl;
}
A = results[j]->GetA_asInt();
if(A <= 1) {
theResults.push_back(results[j]); // gamma, p, n
continue;
}
exEnergy = results[j]->GetExcitationEnergy();
// hot fragment
if(exEnergy >= minExcitation) {
theEvapList.push_back(results[j]);
// cold fragment
} else {
Z = results[j]->GetZ_asInt();
// natural isotope
if(nist->GetIsotopeAbundance(Z, A) > 0.0) {
theResults.push_back(results[j]); // stable fragment
} else {
theEvapList.push_back(results[j]);
}
G4cout << "Evaporated product #" << *res << G4endl;
}
SortSecondaryFragment(res);
} // end of loop on secondary
} // end of the loop over theEvapList
if(fVerbose > 2) {
G4cout << "## After 2nd step of handler " << theEvapList.size()
<< " was evap; "
<< thePhotoEvapList.size() << " for photo-evap; "
<< theResults.size() << " results. " << G4endl;
}
// -----------------------
// Photon-Evaporation loop
// -----------------------
// at this point only photon evaporation is possible
size_t kkmax = thePhotoEvapList.size();
for (kk=0; kk<kkmax; ++kk) {
frag = thePhotoEvapList[kk];
if(fVerbose > 4) {
G4cout << "Next photon evaporate: " << thePhotonEvaporation << G4endl;
G4cout << *frag << G4endl;
}
exEnergy = frag->GetExcitationEnergy();
// photon de-excitation only for hot fragments
if(exEnergy > minExcitation) {
thePhotonEvaporation->BreakUpChain(&theResults, frag);
}
// primary fragment is kept
theResults.push_back(frag);
} // end of photon-evaporation loop
if(fVerbose > 2) {
G4cout << "## After 3d step " << theEvapList.size() << " was evap; "
<< thePhotoEvapList.size() << " was photo-evap; "
<< theResults.size() << " results. " << G4endl;
}
G4ReactionProductVector * theReactionProductVector =
new G4ReactionProductVector();
// MAC (24/07/08)
// To optimise the storing speed, we reserve space in memory for the vector
// To optimise the storing speed, we reserve space
// in memory for the vector
theReactionProductVector->reserve( theResults.size() );
G4int theFragmentA, theFragmentZ;
if(fVerbose > 2) {
G4cout << "### ExcitationHandler provides " << theResults.size()
<< " evaporated products:" << G4endl;
}
kkmax = theResults.size();
for (kk=0; kk<kkmax; ++kk) {
frag = theResults[kk];
for (auto & frag : theResults) {
// in the case of dummy de-excitation, excitation energy is transfered
// into kinetic energy
if(!isActive && 0 == kk) {
// into kinetic energy of output ion
if(!isActive) {
G4double mass = frag->GetGroundStateMass();
G4double ptot = (frag->GetMomentum()).vect().mag();
G4double etot = (frag->GetMomentum()).e();
@@ -455,33 +436,32 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
frag->SetMomentum(lv);
}
if(fVerbose > 3) {
G4cout << kk << "-th fragment " << frag;
G4cout << *frag;
if(frag->NuclearPolarization()) {
G4cout << " " << frag->NuclearPolarization();
}
G4cout << G4endl;
G4cout << *frag << G4endl;
}
theFragmentA = frag->GetA_asInt();
theFragmentZ = frag->GetZ_asInt();
G4int fragmentA = frag->GetA_asInt();
G4int fragmentZ = frag->GetZ_asInt();
G4double etot= frag->GetMomentum().e();
G4double eexc = 0.0;
const G4ParticleDefinition* theKindOfFragment = nullptr;
if (theFragmentA == 0) { // photon or e-
if (fragmentA == 0) { // photon or e-
theKindOfFragment = frag->GetParticleDefinition();
} else if (theFragmentA == 1 && theFragmentZ == 0) { // neutron
theKindOfFragment = G4Neutron::NeutronDefinition();
} else if (theFragmentA == 1 && theFragmentZ == 1) { // proton
theKindOfFragment = G4Proton::ProtonDefinition();
} else if (theFragmentA == 2 && theFragmentZ == 1) { // deuteron
theKindOfFragment = G4Deuteron::DeuteronDefinition();
} else if (theFragmentA == 3 && theFragmentZ == 1) { // triton
theKindOfFragment = G4Triton::TritonDefinition();
} else if (theFragmentA == 3 && theFragmentZ == 2) { // helium3
theKindOfFragment = G4He3::He3Definition();
} else if (theFragmentA == 4 && theFragmentZ == 2) { // alpha
theKindOfFragment = G4Alpha::AlphaDefinition();;
} else if (fragmentA == 1 && fragmentZ == 0) { // neutron
theKindOfFragment = theNeutron;
} else if (fragmentA == 1 && fragmentZ == 1) { // proton
theKindOfFragment = theProton;
} else if (fragmentA == 2 && fragmentZ == 1) { // deuteron
theKindOfFragment = theDeuteron;
} else if (fragmentA == 3 && fragmentZ == 1) { // triton
theKindOfFragment = theTriton;
} else if (fragmentA == 3 && fragmentZ == 2) { // helium3
theKindOfFragment = theHe3;
} else if (fragmentA == 4 && fragmentZ == 2) { // alpha
theKindOfFragment = theAlpha;
} else {
// fragment
@@ -492,13 +472,13 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
idxf = 0;
}
theKindOfFragment = theTableOfIons->GetIon(theFragmentZ,theFragmentA,eexc,
theKindOfFragment = theTableOfIons->GetIon(fragmentZ,fragmentA,eexc,
G4Ions::FloatLevelBase(idxf));
if(fVerbose > 3) {
G4cout << "### EXCH: Find ion Z= " << theFragmentZ
<< " A= " << theFragmentA
G4cout << "### EXCH: Find ion Z= " << fragmentZ
<< " A= " << fragmentA
<< " Eexc(MeV)= " << eexc/MeV << " idx= " << idxf
<< " " << theKindOfFragment << G4endl;
<< G4endl;
}
}
// fragment identified
@@ -507,13 +487,13 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
theNew->SetMomentum(frag->GetMomentum().vect());
theNew->SetTotalEnergy(etot);
theNew->SetFormationTime(frag->GetCreationTime());
if(theKindOfFragment == electron) { theNew->SetCreatorModel(icID); }
if(theKindOfFragment == theElectron) { theNew->SetCreatorModel(icID); }
theReactionProductVector->push_back(theNew);
// fragment not found out ground state is created
} else {
theKindOfFragment =
theTableOfIons->GetIon(theFragmentZ,theFragmentA,0.0,noFloat,0);
theTableOfIons->GetIon(fragmentZ,fragmentA,0.0,noFloat,0);
if(theKindOfFragment) {
G4ThreeVector mom(0.0,0.0,0.0);
G4double ionmass = theKindOfFragment->GetPDGMass();
@@ -529,17 +509,12 @@ G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState)
theNew->SetFormationTime(frag->GetCreationTime());
theReactionProductVector->push_back(theNew);
if(fVerbose > 3) {
G4cout << "### Find ion Z= " << theFragmentZ
<< " A= " << theFragmentA
<< " ground state, energy corrected E(MeV)= "
G4cout << " ground state, energy corrected E(MeV)= "
<< etot << G4endl;
}
}
}
delete frag;
if(fVerbose > 3) {
G4cout << "G4Fragment #" << kk << " is deleted" << G4endl;
}
}
if(fVerbose > 3) {
G4cout << "@@@@@@@@@@ End G4Excitation Handler "<< G4endl;
@@ -560,6 +535,3 @@ void G4ExcitationHandler::ModelDescription(std::ostream& outFile) const