Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -14,6 +14,44 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
10 December 2009 Gunter Folger hadr-mod-util-V09-02-07
|
||||
- G4NuclearFermiDensity.hh: chnage value of prtection in GetDeriv() to lower
|
||||
value
|
||||
|
||||
09 December 2009 Gunter Folger hadr-mod-util-V09-02-06
|
||||
--------------------------------------------------------
|
||||
- G4NuclearFermiDensity.hh: Protect GetDeriv(pos) for positions far
|
||||
outside the nucleus causing an FP overflow in exp.
|
||||
|
||||
09 December 2009 Gunter Folger hadr-mod-util-V09-02-05
|
||||
--------------------------------------------------------
|
||||
- G4WilsonRadius.cc change provided by M.Mendenhall via P.Truscott:
|
||||
Data vector r[] made static const
|
||||
|
||||
19 November 2009 Gunter Folger hadr-mod-util-V09-02-04
|
||||
--------------------------------------------------------
|
||||
- Restore methods storing/retrieving G4SplitableHadron*,
|
||||
now in use in FTF
|
||||
|
||||
13-November 2009 Gunter Folger hadr-mod-util-V09-02-03
|
||||
--------------------------------------------------------
|
||||
- Correct use of G4ThreeVector, ie. avoid vector=0;
|
||||
|
||||
19 December 2008 V, Uzhinsky (hadr-mod-util-V09-02-02)
|
||||
--------------------------------------------------------
|
||||
New method (SortNucleonsDecZ()) for sorting nucleons on decreasing Z-coordanates
|
||||
is inserted in G4Fancy3DNucleus class. It is needed for nucleus-nucleus collision.
|
||||
SortNucleonsInc() is re-named in SortNucleonsIncZ().
|
||||
|
||||
12 December 2008 Gunter Folger (hadr-mod-util-V09-02-01)
|
||||
-------------------------------------------------------
|
||||
- Correct G4Nucleon: typo, and ctor need to init isHit
|
||||
|
||||
10 December 2008 Gunter Folger (hadr-mod-util-V09-02-00)
|
||||
-------------------------------------------------------
|
||||
- G4Nucleon.hh: Hit was storing G4SplitableHadron*, but this is no
|
||||
longer used. Can use bool isHit instead. Avoids confusing reinterpret_cast.
|
||||
|
||||
24 October 2008 Dennis Wright (hadr-mod-util-V09-01-07)
|
||||
-------------------------------------------------------
|
||||
- replace G4NucleiPropertiesTable::GetBindingEnergy with
|
||||
|
||||
@@ -84,7 +84,8 @@ class G4Fancy3DNucleus : public G4V3DNucleus
|
||||
void CenterNucleons();
|
||||
void DoTranslation(const G4ThreeVector & theShift);
|
||||
const G4VNuclearDensity * GetNuclearDensity() const;
|
||||
void SortNucleonsInZ();
|
||||
void SortNucleonsIncZ(); // on increased Z-coordinates Uzhi 29.08.08
|
||||
void SortNucleonsDecZ(); // on decreased Z-coordinates Uzhi 29.08.08
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -55,7 +55,9 @@ class G4NuclearFermiDensity : public G4VNuclearDensity
|
||||
|
||||
G4double GetDeriv(const G4ThreeVector & aPosition) const
|
||||
{
|
||||
return -std::exp((aPosition.mag()-theR)/a) * sqr(GetDensity(aPosition)) / (a*Getrho0());
|
||||
G4double currentR=aPosition.mag();
|
||||
if (currentR > 40*theR ) {return 0;}
|
||||
else return -std::exp((currentR-theR)/a) * sqr(GetDensity(aPosition)) / (a*Getrho0());
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -79,21 +79,15 @@ class G4Nucleon : public G4VKineticNucleon
|
||||
inline void Boost(const G4ThreeVector & beta){ theMomentum.boost(beta); }
|
||||
void Boost(const G4LorentzVector & aMomentum);
|
||||
|
||||
inline void Hit(G4VSplitableHadron * aHit) { theSplitableHadron=aHit;}
|
||||
inline void Hit(G4VSplitableHadron *aHit) { theSplitableHadron=aHit;}
|
||||
// inline void Hit(G4int ) { isHit=true;}
|
||||
inline void Hit(G4int )
|
||||
{
|
||||
theSplitableHadron=reinterpret_cast<G4VSplitableHadron *>(1111);
|
||||
// G4cout << "$%$#%@%$#@%@%%% "<<theSplitableHadron<<G4endl;
|
||||
}
|
||||
inline G4VSplitableHadron * GetSplitableHadron() const { return theSplitableHadron;}
|
||||
|
||||
inline G4bool AreYouHit() const
|
||||
{
|
||||
G4bool result = true;
|
||||
if (theSplitableHadron==NULL) result = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
inline G4bool AreYouHit() const { return theSplitableHadron!=0;}
|
||||
|
||||
private:
|
||||
|
||||
G4ThreeVector thePosition;
|
||||
|
||||
@@ -67,8 +67,6 @@ void G4Fancy3DNucleus::Init(G4double theA, G4double theZ)
|
||||
currentNucleon=-1;
|
||||
if(theNucleons) delete [] theNucleons;
|
||||
|
||||
// this was delected already:
|
||||
// std::for_each(theRWNucleons.begin(), theRWNucleons.end(), DeleteNucleon());
|
||||
theRWNucleons.clear();
|
||||
|
||||
myZ = G4int(theZ);
|
||||
@@ -118,7 +116,6 @@ G4Nucleon * G4Fancy3DNucleus::GetNextNucleon()
|
||||
theNucleons+currentNucleon++ : 0;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
|
||||
{
|
||||
if ( theRWNucleons.size()==0 )
|
||||
@@ -131,12 +128,15 @@ const std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
|
||||
return theRWNucleons;
|
||||
}
|
||||
|
||||
//void G4Fancy3DNucleus::SortNucleonsIncZ() // on increased Z-coordinates Uzhi 29.08.08
|
||||
|
||||
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon* nuc1, const G4Nucleon* nuc2)
|
||||
{
|
||||
return nuc1->GetPosition().z() < nuc2->GetPosition().z();
|
||||
}
|
||||
|
||||
void G4Fancy3DNucleus::SortNucleonsInZ()
|
||||
//void G4Fancy3DNucleus::SortNucleonsInZ()
|
||||
void G4Fancy3DNucleus::SortNucleonsIncZ() // on increased Z-coordinates Uzhi 29.08.08
|
||||
{
|
||||
|
||||
GetNucleons(); // make sure theRWNucleons is initialised
|
||||
@@ -161,6 +161,27 @@ void G4Fancy3DNucleus::SortNucleonsInZ()
|
||||
return;
|
||||
}
|
||||
|
||||
void G4Fancy3DNucleus::SortNucleonsDecZ() // on decreased Z-coordinates Uzhi 29.08.08
|
||||
{
|
||||
G4Nucleon * sortedNucleons = new G4Nucleon[myA];
|
||||
|
||||
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.
|
||||
for ( unsigned int i=0; i<theRWNucleons.size(); i++ )
|
||||
{
|
||||
sortedNucleons[i]= *(theRWNucleons[myA-1-i]); // Uzhi 29.08.08
|
||||
}
|
||||
theRWNucleons.clear(); // about to delete array elements these point to....
|
||||
delete [] theNucleons;
|
||||
theNucleons=sortedNucleons;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
G4double G4Fancy3DNucleus::BindingEnergy()
|
||||
{
|
||||
@@ -299,12 +320,10 @@ void G4Fancy3DNucleus::ChoosePositions()
|
||||
G4int jx,jy;
|
||||
G4double arand[600];
|
||||
G4double *prand=arand;
|
||||
// G4int Attempt=0;
|
||||
while ( i < myA )
|
||||
{
|
||||
do
|
||||
{
|
||||
// ++Attempt;
|
||||
if ( jr < 3 )
|
||||
{
|
||||
jr=std::min(600,9*(myA - i));
|
||||
@@ -349,7 +368,6 @@ void G4Fancy3DNucleus::ChoosePositions()
|
||||
}
|
||||
}
|
||||
}
|
||||
// G4cout << "Att " << myA << " " << Attempt << G4endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -383,7 +401,7 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
} else
|
||||
{
|
||||
G4cerr << "G4Fancy3DNucleus: difficulty finding proton momentum" << G4endl;
|
||||
mom=0;
|
||||
mom=G4ThreeVector(0,0,0);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -400,7 +418,6 @@ void G4Fancy3DNucleus::ChooseFermiMomenta()
|
||||
// ;
|
||||
// G4cout << "final sum / mag() " << sum << " / " << sum.mag() << G4endl;
|
||||
|
||||
|
||||
G4double energy;
|
||||
for ( i=0; i< myA ; i++ )
|
||||
{
|
||||
@@ -530,11 +547,6 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
|
||||
|
||||
// Now we have a nucleon with a bigger Fermi Momentum.
|
||||
// Exchange with last nucleon.. and iterate.
|
||||
// G4cout << " Nucleon to swap with : " << swapit << G4endl;
|
||||
// G4cout << " Fermi momentum test, and better.. " << PFermi << " / "
|
||||
// << theFermi.GetFermiMomentum(density) << G4endl;
|
||||
// cout << theNucleons[swapit]<< G4endl << theNucleons[myA-1] << G4endl;
|
||||
// cout << momentum[swapit] << G4endl << momentum[myA-1] << G4endl;
|
||||
G4Nucleon swap= theNucleons[swapit];
|
||||
G4ThreeVector mom_swap=momentum[swapit];
|
||||
G4double pf=pFermiM[swapit];
|
||||
@@ -544,8 +556,6 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
|
||||
theNucleons[myA-1]=swap;
|
||||
momentum[myA-1]=mom_swap;
|
||||
pFermiM[myA-1]=pf;
|
||||
// cout << "after swap" <<G4endl<< theNucleons[swapit] << G4endl << theNucleons[myA-1] << G4endl;
|
||||
// cout << momentum[swapit] << G4endl << momentum[myA-1] << G4endl;
|
||||
return ReduceSum(momentum,pFermiM);
|
||||
}
|
||||
|
||||
|
||||
@@ -486,10 +486,12 @@ G4KineticTrackVector* G4KineticTrack::Decay()
|
||||
//
|
||||
// Select a possible decay channel
|
||||
//
|
||||
// G4int index1;
|
||||
// for (index1 = nChannels - 1; index1 >= 0; index1--)
|
||||
// cout << "DECAY Actual Width IND/ActualW " << index1 << " " << theActualWidth[index1] << G4endl;
|
||||
// cout << "DECAY Actual Mass " << theActualMass << G4endl;
|
||||
/*
|
||||
G4int index1;
|
||||
for (index1 = nChannels - 1; index1 >= 0; index1--)
|
||||
G4cout << "DECAY Actual Width IND/ActualW " << index1 << " " << theActualWidth[index1] << G4endl;
|
||||
G4cout << "DECAY Actual Mass " << theActualMass << G4endl;
|
||||
*/
|
||||
|
||||
G4int chargeBalance = G4lrint(theDefinition->GetPDGCharge() );
|
||||
G4int baryonBalance = G4lrint(theDefinition->GetBaryonNumber() );
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
// ------------------------------------------------------------
|
||||
|
||||
G4Nucleon::G4Nucleon()
|
||||
: theBindingE(0.) , theParticleType(NULL), theSplitableHadron(NULL)
|
||||
: theBindingE(0.) , theParticleType(0), theSplitableHadron(0)
|
||||
{}
|
||||
|
||||
G4Nucleon::~G4Nucleon()
|
||||
|
||||
@@ -83,7 +83,10 @@ G4double G4WilsonRadius::GetWilsonRMSRadius (G4double A)
|
||||
radius = factor * (0.84*std::pow(A,third) + 0.55);
|
||||
else
|
||||
{
|
||||
G4double r[27] = {0.0, 0.85, 2.095, 1.976, 1.671, 1.986,
|
||||
// this was changed from just G4double to static const G4double
|
||||
// to make sure that time wasn't being wasted on every call reloading a stack variable
|
||||
// by MHM 20050119
|
||||
static const G4double r[27] = {0.0, 0.85, 2.095, 1.976, 1.671, 1.986,
|
||||
2.57, 2.41, 2.23, 2.519, 2.45,
|
||||
2.42, 2.471, 2.440, 2.58, 2.611,
|
||||
2.730, 2.662, 2.727, 2.9, 3.040,
|
||||
|
||||
Reference in New Issue
Block a user