Import Geant4 9.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:58:43 +02:00
parent 96c8bcd0af
commit b79225fb37
7544 changed files with 245407 additions and 91099 deletions
@@ -14,6 +14,44 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
24 October 2008 Dennis Wright (hadr-mod-util-V09-01-07)
-------------------------------------------------------
- replace G4NucleiPropertiesTable::GetBindingEnergy with
G4NucleiProperties::GetBindingEnergy in G4Fancy3DNucleus
19 June 2008 G.Folger (hadr-mod-util-V09-01-06)
-----------------------------------------------
- Attempt to fix memory leak in G4Fancy3DNucleus::SortNucleonsInZ().
- remove debug introduced code by VU
19 June 2008 G. Cosmo (hadr-mod-util-V09-01-05)
-----------------------------------------------
- Fixed noisy compilation warning in G4ExcitedString.hh for
unnecessary const qualifier to function return argument.
19 June 2008 V. Uzhinsky (hadr-mod-util-V09-01-04)
-------------------------------------------------
- Update of include/G4ExcitedString.hh
18 June 2008 V. Uzhinsky (hadr-mod-util-V09-01-03)
--------------------------------------------------
- G4ExcitedString::GetTimeOfCreation() const;
- G4ExcitedString::SetTimeOfCreation(G4double aTime);
Two new methods for operations with Time of a string Creation
14 May 2008 G.Folger (hadr-mod-util-V09-01-02)
---------------------------------------------------
- G4Fancy3DNucleus::SortNucleonsInZ() new method to sort nucleons
using z-coordinate
5 May 2008 G.Folger (hadr-mod-util-V09-01-01)
---------------------------------------------------
- correct logic bug in CalculateExcitationEnergy() introduced by gcc-4.3 fix.
21 Mar 2008 Dennis Wright (hadr-mod-util-V09-01-00)
---------------------------------------------------
- fix gcc-4.3 compiler warnings for G4Fragment.cc
16 Nov 2007 Dennis Wright (hadr-mod-util-V09-00-02)
---------------------------------------------------
- remove initialization by random number of angular momentum vector
@@ -70,6 +70,10 @@ class G4ExcitedString
int operator!=(const G4ExcitedString &right) const;
G4double GetTimeOfCreation() const; // Uzhi 15.05.08
void SetTimeOfCreation(G4double aTime); // Uzhi 15.05.08
const G4ThreeVector & GetPosition() const;
void SetPosition(const G4ThreeVector &aPosition);
@@ -106,6 +110,7 @@ class G4ExcitedString
private:
G4int theDirection; // must be 1 or -1 (PROJECTILE or TARGET)
G4double theTimeOfCreation; // Uzhi 15.05.08
G4ThreeVector thePosition;
G4PartonVector thePartons; // would like initial capacity for 3 Partons.
G4KineticTrack* theTrack;
@@ -124,6 +129,18 @@ int G4ExcitedString::operator!=(const G4ExcitedString &right) const
return this != &right;
}
inline
G4double G4ExcitedString::GetTimeOfCreation() const // Uzhi 15.05.08
{
return theTimeOfCreation;
}
inline
void G4ExcitedString::SetTimeOfCreation(G4double aTime) // Uzhi 15.05.08
{
theTimeOfCreation=aTime; // Uzhi 15.05.08
}
inline
const G4ThreeVector & G4ExcitedString::GetPosition() const
{
@@ -84,6 +84,7 @@ class G4Fancy3DNucleus : public G4V3DNucleus
void CenterNucleons();
void DoTranslation(const G4ThreeVector & theShift);
const G4VNuclearDensity * GetNuclearDensity() const;
void SortNucleonsInZ();
private:
@@ -46,6 +46,7 @@ G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Dir
{
thePartons.push_back(Color);
thePartons.push_back(AntiColor);
theTimeOfCreation = 0.; // Uzhi 15.05.08
thePosition = Color->GetPosition();
theDirection = Direction;
theTrack=0;
@@ -56,6 +57,7 @@ G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon, G4Parton* An
thePartons.push_back(Color);
thePartons.push_back(Gluon);
thePartons.push_back(AntiColor);
theTimeOfCreation = 0.; // Uzhi 15.05.08
thePosition = Color->GetPosition();
theDirection = Direction;
theTrack=0;
@@ -63,6 +65,7 @@ G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon, G4Parton* An
G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
{
theTimeOfCreation = track->GetFormationTime(); // Uzhi 15.05.08
thePosition = track->GetPosition();
theTrack= track;
theDirection=0;
@@ -36,12 +36,13 @@
#include "G4Fancy3DNucleus.hh"
#include "G4NuclearFermiDensity.hh"
#include "G4NuclearShellModelDensity.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4NucleiProperties.hh"
#include "Randomize.hh"
#include "G4ios.hh"
#include <algorithm>
#include "G4HadronicException.hh"
G4Fancy3DNucleus::G4Fancy3DNucleus()
: nucleondistance(0.8*fermi)
{
@@ -130,11 +131,43 @@ const std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
return theRWNucleons;
}
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon* nuc1, const G4Nucleon* nuc2)
{
return nuc1->GetPosition().z() < nuc2->GetPosition().z();
}
void G4Fancy3DNucleus::SortNucleonsInZ()
{
GetNucleons(); // make sure theRWNucleons is initialised
if (theRWNucleons.size() < 2 ) return;
sort( theRWNucleons.begin(),theRWNucleons.end(),G4Fancy3DNucleusHelperForSortInZ);
// now copy sorted nucleons to theNucleons array. TheRWNucleons are pointers in theNucleons
// so we need to copy to new, and then swap.
G4Nucleon * sortedNucleons = new G4Nucleon[myA];
for ( unsigned int i=0; i<theRWNucleons.size(); i++ )
{
sortedNucleons[i]= *(theRWNucleons[i]);
}
theRWNucleons.clear(); // about to delete array these point to....
delete [] theNucleons;
theNucleons=sortedNucleons;
return;
}
G4double G4Fancy3DNucleus::BindingEnergy()
{
return G4NucleiPropertiesTable::GetBindingEnergy(myZ,myA);
return G4NucleiProperties::GetBindingEnergy(myA,myZ);
}
G4double G4Fancy3DNucleus::GetNuclearRadius()
{
return GetNuclearRadius(0.5);
@@ -260,7 +293,7 @@ void G4Fancy3DNucleus::ChoosePositions()
places.reserve(myA);
G4bool freeplace;
static G4double nd2 = sqr(nucleondistance);
G4double maxR=GetNuclearRadius(0.01); // there are no nucleons at a
G4double maxR=GetNuclearRadius(0.001); // there are no nucleons at a
// relative Density of 0.01
G4int jr=0;
G4int jx,jy;
@@ -91,16 +91,16 @@ G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4LorentzVector aMome
theExcitationEnergy = theMomentum.mag() -
G4ParticleTable::GetParticleTable()->GetIonTable()
->GetIonMass( G4lrint(theZ), G4lrint(theA) );
if( theExcitationEnergy < 0.0 )
if( theExcitationEnergy > -10.0 * eV || 0==G4lrint(theA))
if (theExcitationEnergy < 0.0) {
if (theExcitationEnergy > -10.0 * eV || 0 == G4lrint(theA)) {
theExcitationEnergy = 0.0;
else
{
} else {
G4cout << "A, Z, momentum, theExcitationEnergy"<<
A<<" "<<Z<<" "<<aMomentum<<" "<<theExcitationEnergy<<G4endl;
G4String text = "G4Fragment::G4Fragment Excitation Energy < 0.0!";
throw G4HadronicException(__FILE__, __LINE__, text);
}
}
}
@@ -200,28 +200,26 @@ std::ostream& operator << (std::ostream &out, const G4Fragment &theFragment)
G4double G4Fragment::CalculateExcitationEnergy(const G4LorentzVector value) const
{
static G4int errCount(0);
G4double theMaxGroundStateMass = theZ*G4Proton::Proton()->GetPDGMass()+
static G4int errCount(0);
G4double theMaxGroundStateMass = theZ*G4Proton::Proton()->GetPDGMass()+
(theA-theZ)*G4Neutron::Neutron()->GetPDGMass();
G4double U = value.m() - std::min(theMaxGroundStateMass, GetGroundStateMass());
if( U < 0.0 )
if( U > -10.0 * eV || 0==G4lrint(theA))
U = 0.0;
else
{
if ( errCount < 10 )
{
G4cerr << "G4Fragment::CalculateExcitationEnergy(): Excitation Energy ="
<<U << " for A = "<<theA<<" and Z= "<<theZ<<G4endl
<< ", mass= " << GetGroundStateMass() << " maxMass= "<<theMaxGroundStateMass<<G4endl; ;
errCount++;
if (errCount == 10 ) G4cerr << "G4Fragment::CalculateExcitationEnergy():"
<< " further warnings on negative excitation will be supressed" << G4endl;
}
U=0.0;
}
return U;
G4double U = value.m() - std::min(theMaxGroundStateMass, GetGroundStateMass());
if( U < 0.0 ) {
if( U > -10.0 * eV || 0==G4lrint(theA)){
U = 0.0;
} else {
if ( errCount < 10 ) {
G4cerr << "G4Fragment::CalculateExcitationEnergy(): Excitation Energy ="
<<U << " for A = "<<theA<<" and Z= "<<theZ<<G4endl
<< ", mass= " << GetGroundStateMass() << " maxMass= "<<theMaxGroundStateMass<<G4endl; ;
errCount++;
if (errCount == 10 ) G4cerr << "G4Fragment::CalculateExcitationEnergy():"
<< " further warnings on negative excitation will be supressed" << G4endl;
}
U=0.0;
}
}
return U;
}
G4ThreeVector G4Fragment::IsotropicRandom3Vector(const G4double Magnitude) const