Import Geant4 5.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:28:22 +02:00
parent fbd4999cf7
commit 4aea781e80
5454 changed files with 223141 additions and 67347 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.2 2002/11/12 02:08:15 larazb Exp $
# $Id: GNUmakefile,v 1.3 2003/06/18 08:54:32 gcosmo Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
@@ -11,8 +11,6 @@ endif
include $(G4INSTALL)/config/architecture.gmk
G4TMPDIR = $(G4TMP)/$(G4SYSTEM)/$(name)
ifdef PRECOMPOUND_TEST
CPPFLAGS += -DPRECOMPOUND_TEST
endif
@@ -47,7 +47,7 @@ private:
G4double theEnergy;
public:
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* )
{
// decay the strong resonances
G4ReactionProductVector * theResult = new G4ReactionProductVector;
@@ -87,7 +87,7 @@ public:
delete secondaries;
}
}
G4std::for_each(result1->begin(), result1->end(), DeleteKineticTrack());
std::for_each(result1->begin(), result1->end(), DeleteKineticTrack());
delete result1;
// translate to ReactionProducts
@@ -102,7 +102,7 @@ public:
theResult->push_back(it);
}
G4std::for_each(result->begin(), result->end(), DeleteKineticTrack());
std::for_each(result->begin(), result->end(), DeleteKineticTrack());
delete result;
return theResult;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ExcitedString.hh,v 1.10 2002/12/12 19:17:56 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ExcitedString.hh,v 1.11 2003/06/16 17:09:32 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4ExcitedString_h
@@ -44,7 +44,7 @@
#include "G4Parton.hh"
#include "G4PartonVector.hh"
#include "G4KineticTrack.hh"
#include "g4std/algorithm"
#include <algorithm>
class G4ExcitedString
{
@@ -162,7 +162,7 @@ void G4ExcitedString::InsertParton(G4Parton *aParton, const G4Parton * addafter)
if ( addafter != NULL )
{
insert_index=G4std::find(thePartons.begin(), thePartons.end(), addafter);
insert_index=std::find(thePartons.begin(), thePartons.end(), addafter);
if (insert_index == thePartons.end()) // No object addafter in thePartons
{
G4Exception("G4ExcitedString::InsertParton called with invalid second argument");
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ExcitedStringVector.hh,v 1.7 2002/12/12 19:17:56 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ExcitedStringVector.hh,v 1.8 2003/06/16 17:09:33 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4ExcitedStringVector_h
#define G4ExcitedStringVector_h 1
@@ -35,9 +35,9 @@
// ------------------------------------------------------------
#include "G4ExcitedString.hh"
#include "g4std/vector"
#include <vector>
typedef G4std::vector<G4ExcitedString *> G4ExcitedStringVector;
typedef std::vector<G4ExcitedString *> G4ExcitedStringVector;
struct DeleteString { void operator()(G4ExcitedString* aS){delete aS;} };
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Fancy3DNucleus.hh,v 1.14 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Fancy3DNucleus.hh,v 1.15 2003/06/16 17:09:34 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4Fancy3DNucleus_h
#define G4Fancy3DNucleus_h 1
@@ -41,7 +41,7 @@
#include "G4Nucleon.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "g4std/vector"
#include <vector>
class G4Fancy3DNucleus : public G4V3DNucleus
{
@@ -68,7 +68,7 @@ class G4Fancy3DNucleus : public G4V3DNucleus
void Init(G4double theA, G4double theZ);
G4bool StartLoop();
G4Nucleon * GetNextNucleon();
const G4std::vector<G4Nucleon *> & GetNucleons();
const std::vector<G4Nucleon *> & GetNucleons();
G4int GetMassNumber();
G4double GetMass();
G4int GetCharge();
@@ -89,7 +89,7 @@ class G4Fancy3DNucleus : public G4V3DNucleus
G4int myA;
G4int myZ;
G4Nucleon * theNucleons;
G4std::vector<G4Nucleon *> theRWNucleons; // should not have two...
std::vector<G4Nucleon *> theRWNucleons; // should not have two...
struct DeleteNucleon{ void operator()(G4Nucleon *aN){delete aN;} };
G4int currentNucleon;
G4VNuclearDensity * theDensity;
@@ -22,7 +22,7 @@
//
//
// $Id: G4FermiMomentum.hh,v 1.7 2003/02/12 10:20:21 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4FermiMomentum_h
#define G4FermiMomentum_h 1
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Fragment.hh,v 1.15 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Fragment.hh,v 1.17 2003/06/16 17:09:35 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
@@ -31,8 +31,8 @@
#define G4Fragment_h 1
#include "G4ios.hh"
#include "g4std/iomanip"
#include "g4std/vector"
#include <iomanip>
#include <vector>
#include "globals.hh"
#include "G4LorentzVector.hh"
@@ -49,7 +49,7 @@
class G4ParticleDefinition;
class G4Fragment; // Forward deckaration
typedef G4std::vector<G4Fragment*> G4FragmentVector;
typedef std::vector<G4Fragment*> G4FragmentVector;
class G4Fragment
{
@@ -80,8 +80,8 @@ public:
G4bool operator==(const G4Fragment &right) const;
G4bool operator!=(const G4Fragment &right) const;
friend G4std::ostream& operator<<(G4std::ostream&, const G4Fragment*);
friend G4std::ostream& operator<<(G4std::ostream&, const G4Fragment&);
friend std::ostream& operator<<(std::ostream&, const G4Fragment*);
friend std::ostream& operator<<(std::ostream&, const G4Fragment&);
// ============= METHODS ==================
@@ -200,7 +200,7 @@ inline G4double G4Fragment::GetExcitationEnergy() const
return theExcitationEnergy;
}
inline void G4Fragment::SetExcitationEnergy(const G4double value)
inline void G4Fragment::SetExcitationEnergy(const G4double )
{
// theExcitationEnergy = value;
G4cout << "Warning: G4Fragment::SetExcitationEnergy() is a dummy method. Please, avoid to use it." << G4endl;
@@ -22,7 +22,7 @@
//
//
// $Id: G4FragmentVector.hh,v 1.5 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeneralPhaseSpaceDecay.hh,v 1.6 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
//$Id: G4GeneralPhaseSpaceDecay.hh,v 1.1 1997/05/21
// ----------------------------------------------------------------
@@ -40,6 +40,7 @@
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4VKineticNucleon.hh"
#include "G4Nucleon.hh"
#include "G4ParticleDefinition.hh"
#include "G4VDecayChannel.hh"
@@ -61,6 +62,9 @@ class G4KineticTrack : public G4VKineticNucleon
G4double aFormationTime,
G4ThreeVector aPosition,
G4LorentzVector& a4Momentum);
G4KineticTrack(G4Nucleon * nucleon,
G4ThreeVector aPosition,
G4LorentzVector& a4Momentum);
~G4KineticTrack();
@@ -84,9 +88,14 @@ class G4KineticTrack : public G4VKineticNucleon
void Update4Momentum(G4double aEnergy); // update E and p, not changing mass
void Update4Momentum(const G4ThreeVector & aMomentum); // idem
const G4LorentzVector& GetInitialCoordinates() const;
const G4LorentzVector& GetTrackingMomentum() const;
G4double SampleResidualLifetime();
void Hit();
void SetNucleon(G4Nucleon * aN) {theNucleon = aN;}
G4bool IsParticipant() const;
G4KineticTrackVector* Decay();
@@ -96,6 +105,12 @@ class G4KineticTrack : public G4VKineticNucleon
G4double GetActualMass() const;
G4int GetnChannels() const;
// position relativ to nucleus "state"
enum CascadeState {undefined, outside, going_in, inside, going_out, gone_out, miss_nucleus };
CascadeState SetState(const CascadeState new_state);
CascadeState GetState() const;
private:
@@ -113,8 +128,7 @@ class G4KineticTrack : public G4VKineticNucleon
G4double IntegrateCMMomentum(const G4double lowerLimit ,const G4double polemass) const;
G4double IntegrateCMMomentum2() const;
public:
G4double BrWig(const G4double Gamma,
@@ -144,25 +158,24 @@ public:
G4ThreeVector thePosition;
G4LorentzVector the4Momentum;
G4LorentzVector theFermi3Momentum;
G4LorentzVector theTotal4Momentum;
G4Nucleon * theNucleon;
G4LorentzVector theInitialCoordinates;
G4int nChannels;
G4double theActualMass;
G4double* theActualWidth;
private:
// Temporary storage for daughter masses and widths
// Temporary storage for daughter masses and widths
// (needed because Integrand Function cannot take > 1 argument)
G4double* theDaughterMass;
G4double* theDaughterWidth;
CascadeState theStateToNucleus;
};
@@ -204,15 +217,23 @@ inline void G4KineticTrack::SetPosition(const G4ThreeVector aPosition)
}
inline const G4LorentzVector& G4KineticTrack::Get4Momentum() const
{
return the4Momentum;
return theTotal4Momentum;
}
inline const G4LorentzVector& G4KineticTrack::GetTrackingMomentum() const
{
return the4Momentum;
}
inline void G4KineticTrack::Set4Momentum(const G4LorentzVector& a4Momentum)
{
the4Momentum = a4Momentum;
G4double m = a4Momentum.mag();
theTotal4Momentum=the4Momentum+theFermi3Momentum;
G4double p=theTotal4Momentum.vect().mag();
theTotal4Momentum.setE(sqrt(m*m+p*p));
}
inline void G4KineticTrack::Update4Momentum(G4double aEnergy)
@@ -225,23 +246,17 @@ inline void G4KineticTrack::Update4Momentum(G4double aEnergy)
{
aEnergy=GetActualMass();
}
the4Momentum = G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy);
Set4Momentum(G4LorentzVector(newP*the4Momentum.vect().unit(), aEnergy));
}
inline void G4KineticTrack::Update4Momentum(const G4ThreeVector & aMomentum)
{
G4double newE=sqrt(the4Momentum.mag2() + aMomentum.mag2());
the4Momentum = G4LorentzVector(aMomentum, newE);
Set4Momentum(G4LorentzVector(aMomentum, newE));
}
inline const G4LorentzVector& G4KineticTrack::GetInitialCoordinates() const
{
return theInitialCoordinates;
}
inline G4double G4KineticTrack::GetActualMass() const
{
@@ -320,6 +335,37 @@ inline G4double G4KineticTrack::BrWig(const G4double Gamma, const G4double rmass
G4double Norm = twopi;
return (Gamma/((mass-rmass)*(mass-rmass)+Gamma*Gamma/4.))/Norm;
}
inline
void G4KineticTrack::Hit()
{
if(theNucleon)
{
theNucleon->Hit(1);
}
}
inline
G4bool G4KineticTrack::IsParticipant() const
{
if(!theNucleon) return true;
return theNucleon->AreYouHit();
}
inline
G4KineticTrack::CascadeState G4KineticTrack::GetState() const
{
return theStateToNucleus;
}
inline
G4KineticTrack::CascadeState G4KineticTrack::SetState(const CascadeState new_state)
{
CascadeState old_state=theStateToNucleus;
theStateToNucleus=new_state;
return old_state;
}
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4KineticTrackVector.hh,v 1.7 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4KineticTrackVector.hh,v 1.8 2003/06/16 17:09:36 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
// Modified at 8-Oct-1998 by Maxim Komogorov. Methods BoostBeam,Boost,Shift
// were added.
@@ -32,9 +32,9 @@
#include "globals.hh"
#include "G4KineticTrack.hh"
#include "g4std/vector"
#include <vector>
class G4KineticTrackVector : public G4std::vector<G4KineticTrack *>
class G4KineticTrackVector : public std::vector<G4KineticTrack *>
{
public:
G4KineticTrackVector();
@@ -22,7 +22,7 @@
//
//
// $Id: G4NuclearFermiDensity.hh,v 1.8 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4NuclearFermiDensity_h
#define G4NuclearFermiDensity_h 1
@@ -22,7 +22,7 @@
//
//
// $Id: G4NuclearShellModelDensity.hh,v 1.7 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4NuclearShellModelDensity_h
#define G4NuclearShellModelDensity_h 1
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Nucleon.hh,v 1.6 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Nucleon.hh,v 1.9 2003/06/16 17:09:37 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4Nucleon_h
#define G4Nucleon_h 1
@@ -79,6 +79,11 @@ class G4Nucleon : public G4VKineticNucleon
void Boost(const G4LorentzVector & aMomentum);
inline void Hit(G4VSplitableHadron * aHit) { theSplitableHadron=aHit;}
inline void Hit(G4int )
{
theSplitableHadron=reinterpret_cast<G4VSplitableHadron *>(1111);
// G4cout << "$%$#%@%$#@%@%%% "<<theSplitableHadron<<G4endl;
}
inline G4VSplitableHadron * GetSplitableHadron() const { return theSplitableHadron;}
inline G4bool AreYouHit() const
@@ -99,7 +104,7 @@ class G4Nucleon : public G4VKineticNucleon
};
G4std::ostream & operator << (G4std::ostream &, const G4Nucleon&);
std::ostream & operator << (std::ostream &, const G4Nucleon&);
inline int G4Nucleon::operator==(const G4Nucleon &right) const
{
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Parton.hh,v 1.14 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Parton.hh,v 1.15 2003/06/16 17:09:38 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4Parton_h
@@ -39,7 +39,7 @@
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "g4std/iostream"
#include <iostream>
#include "G4ParticleTable.hh"
#include "Randomize.hh"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PartonVector.hh,v 1.7 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4PartonVector.hh,v 1.8 2003/06/16 17:09:39 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4PartonVector_h
#define G4PartonVector_h 1
@@ -35,9 +35,9 @@
// ------------------------------------------------------------
#include "G4Parton.hh"
#include "g4std/vector"
#include <vector>
typedef G4std::vector<G4Parton *> G4PartonVector;
typedef std::vector<G4Parton *> G4PartonVector;
struct DeleteParton{ void operator()(G4Parton*aP){delete aP;} };
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SampleResonance.hh,v 1.5 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4SampleResonance.hh,v 1.6 2003/06/16 17:09:40 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#ifndef G4SampleResonance_h
@@ -37,7 +37,7 @@
// ------------------------------------------------------------
#include "globals.hh"
#include "g4std/map"
#include <map>
#include "G4ParticleDefinition.hh"
@@ -65,8 +65,8 @@ private:
public:
typedef G4std::map<const G4ParticleDefinition*, G4double, G4std::less<const G4ParticleDefinition*> >::const_iterator minMassMapIterator;
typedef G4std::map<const G4ParticleDefinition*, G4double, G4std::less<const G4ParticleDefinition*> > minMassMapType;
typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> >::const_iterator minMassMapIterator;
typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> > minMassMapType;
private:
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ExcitedString.cc,v 1.7 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4ExcitedString.cc,v 1.8 2003/06/16 17:09:41 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// ------------------------------------------------------------
@@ -36,7 +36,7 @@
// G4ExcitedString
#include "G4ExcitedString.hh"
#include "g4std/algorithm"
#include <algorithm>
//G4ExcitedString::G4ExcitedString(const G4ExcitedString &right)
//{}
@@ -69,7 +69,7 @@ G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
G4ExcitedString::~G4ExcitedString()
{
G4std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Fancy3DNucleus.cc,v 1.26 2003/02/12 10:20:22 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Fancy3DNucleus.cc,v 1.28 2003/06/25 14:19:24 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -38,7 +38,7 @@
#include "G4NucleiPropertiesTable.hh"
#include "Randomize.hh"
#include "G4ios.hh"
#include "g4std/algorithm"
#include <algorithm>
G4Fancy3DNucleus::G4Fancy3DNucleus()
: nucleondistance(0.8*fermi)
@@ -84,7 +84,7 @@ void G4Fancy3DNucleus::Init(G4double theA, G4double theZ)
if(theNucleons!=NULL) delete [] theNucleons;
// this was delected already:
// G4std::for_each(theRWNucleons.begin(), theRWNucleons.end(), DeleteNucleon());
// std::for_each(theRWNucleons.begin(), theRWNucleons.end(), DeleteNucleon());
theRWNucleons.clear();
myZ = G4int(theZ);
@@ -135,7 +135,7 @@ G4Nucleon * G4Fancy3DNucleus::GetNextNucleon()
}
const G4std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
const std::vector<G4Nucleon *> & G4Fancy3DNucleus::GetNucleons()
{
if ( theRWNucleons.size()==0 )
{
@@ -432,13 +432,13 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
// find all possible changes in momentum, changing only the component parallel to sum
G4ThreeVector testDir=sum.unit();
G4std::vector<G4Fancy3DNucleusHelper> testSums; // Sorted on delta.mag()
std::vector<G4Fancy3DNucleusHelper> testSums; // Sorted on delta.mag()
for ( G4int aNucleon=0; aNucleon < myA-1; aNucleon++){
G4ThreeVector delta=2*((momentum[aNucleon]*testDir)* testDir);
testSums.push_back(G4Fancy3DNucleusHelper(delta,delta.mag(),aNucleon));
}
G4std::sort(testSums.begin(), testSums.end());
std::sort(testSums.begin(), testSums.end());
// reduce Momentum Sum until the next would be allowed.
G4int index=testSums.size();
@@ -508,6 +508,6 @@ G4bool G4Fancy3DNucleus::ReduceSum(G4ThreeVector * momentum, G4double *pFermiM)
G4double G4Fancy3DNucleus::CoulombBarrier()
{
G4double coulombBarrier = (1.44/1.14) * MeV * myZ / (1.0 + pow(myA,1./3.));
G4double coulombBarrier = (1.44/1.14) * MeV * myZ / (1.0 + pow(G4double(myA),1./3.));
return coulombBarrier;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4FermiMomentum.cc,v 1.5 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4FermiMomentum.hh"
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Fragment.cc,v 1.16 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Fragment.cc,v 1.19 2003/06/18 08:53:05 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
@@ -90,7 +90,7 @@ G4Fragment::G4Fragment(const G4int A, const G4int Z, const G4LorentzVector aMome
G4ParticleTable::GetParticleTable()->GetIonTable()
->GetIonMass( static_cast<G4int>(theZ), static_cast<G4int>(theA) );
if( theExcitationEnergy < 0.0 )
if( theExcitationEnergy > -10.0 * eV )
if( theExcitationEnergy > -10.0 * eV || 0==static_cast<G4int>(theA))
theExcitationEnergy = 0.0;
else
{
@@ -153,19 +153,15 @@ G4bool G4Fragment::operator!=(const G4Fragment &right) const
}
G4std::ostream& operator << (G4std::ostream &out, const G4Fragment *theFragment)
std::ostream& operator << (std::ostream &out, const G4Fragment *theFragment)
{
#ifdef G4USE_STD_NAMESPACE
G4std::ios::fmtflags old_floatfield = out.flags();
out.setf(G4std::ios::floatfield);
#else
long old_floatfield = out.setf(0,G4std::ios::floatfield);
#endif
std::ios::fmtflags old_floatfield = out.flags();
out.setf(std::ios::floatfield);
out
<< "Fragment: A = " << G4std::setprecision(3) << theFragment->theA
<< ", Z = " << G4std::setprecision(3) << theFragment->theZ ;
out.setf(G4std::ios::scientific,G4std::ios::floatfield);
<< "Fragment: A = " << std::setprecision(3) << theFragment->theA
<< ", Z = " << std::setprecision(3) << theFragment->theZ ;
out.setf(std::ios::scientific,std::ios::floatfield);
out
<< ", U = " << theFragment->GetExcitationEnergy()/MeV
<< " MeV" << G4endl
@@ -185,13 +181,13 @@ G4std::ostream& operator << (G4std::ostream &out, const G4Fragment *theFragment)
<< ", #Holes = " << theFragment->numberOfHoles
<< ", #Charged = " << theFragment->numberOfCharged;
}
out.setf(old_floatfield,G4std::ios::floatfield);
out.setf(old_floatfield,std::ios::floatfield);
return out;
}
G4std::ostream& operator << (G4std::ostream &out, const G4Fragment &theFragment)
std::ostream& operator << (std::ostream &out, const G4Fragment &theFragment)
{
out << &theFragment;
return out;
@@ -203,9 +199,9 @@ G4double G4Fragment::CalculateExcitationEnergy(const G4LorentzVector value) cons
{
G4double theMaxGroundStateMass = theZ*G4Proton::Proton()->GetPDGMass()+
(theA-theZ)*G4Neutron::Neutron()->GetPDGMass();
G4double U = value.m() - G4std::min(theMaxGroundStateMass, GetGroundStateMass());
G4double U = value.m() - std::min(theMaxGroundStateMass, GetGroundStateMass());
if( U < 0.0 )
if( U > -10.0 * eV )
if( U > -10.0 * eV || 0==static_cast<G4int>(theA))
U = 0.0;
else
{
@@ -22,7 +22,7 @@
//
//
// $Id: G4GeneralPhaseSpaceDecay.cc,v 1.6 2002/12/12 19:17:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
// $Id: G4GeneralSpaceDecay.cc,v 1.0 1998/05/21
// ----------------------------------------------------------------
@@ -61,15 +61,18 @@ static G4double G4KineticTrack_Gmass, G4KineticTrack_xmass1;
G4KineticTrack::G4KineticTrack() :
theDefinition(0),
theFormationTime(0.0),
thePosition(0.0, 0.0, 0.0),
the4Momentum(0.0,0.0,0.0,0.0),
theInitialCoordinates(0.0,0.0,0.0,0.0),
theFormationTime(0),
thePosition(0),
the4Momentum(0),
theFermi3Momentum(0),
theTotal4Momentum(0),
theNucleon(0),
nChannels(0),
theActualMass(0.0),
theActualMass(0),
theActualWidth(0),
theDaughterMass(0),
theDaughterWidth(0)
theDaughterWidth(0),
theStateToNucleus(undefined)
{
////////////////
// DEBUG //
@@ -88,14 +91,16 @@ G4KineticTrack::G4KineticTrack() :
// Copy constructor
//
G4KineticTrack::G4KineticTrack(const G4KineticTrack &right)
G4KineticTrack::G4KineticTrack(const G4KineticTrack &right) : G4VKineticNucleon()
{
G4int i;
theDefinition = right.GetDefinition();
theFormationTime = right.GetFormationTime();
thePosition = right.GetPosition();
the4Momentum = right.Get4Momentum();
theInitialCoordinates = right.GetInitialCoordinates();
the4Momentum = right.GetTrackingMomentum();
theFermi3Momentum = right.theFermi3Momentum;
theTotal4Momentum = right.theTotal4Momentum;
theNucleon=right.theNucleon;
nChannels = right.GetnChannels();
theActualMass = right.GetActualMass();
theActualWidth = new G4double[nChannels];
@@ -105,6 +110,7 @@ G4KineticTrack::G4KineticTrack(const G4KineticTrack &right)
}
theDaughterMass = 0;
theDaughterWidth = 0;
theStateToNucleus=right.theStateToNucleus;
////////////////
// DEBUG //
@@ -126,11 +132,15 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
G4double aFormationTime,
G4ThreeVector aPosition,
G4LorentzVector& a4Momentum) :
theFormationTime(aFormationTime),
theDefinition(aDefinition),
theFormationTime(aFormationTime),
thePosition(aPosition),
the4Momentum(a4Momentum)
the4Momentum(a4Momentum),
theFermi3Momentum(0),
theTotal4Momentum(a4Momentum),
theNucleon(0),
theStateToNucleus(undefined)
{
theDefinition = aDefinition;
if(G4KaonZero::KaonZero() == theDefinition ||
G4AntiKaonZero::AntiKaonZero() == theDefinition)
{
@@ -143,12 +153,6 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
theDefinition = G4KaonZeroLong::KaonZeroLong();
}
}
//
// Initialize the InitialCoordinates 4vector
//
theInitialCoordinates.setVect(thePosition);
theInitialCoordinates.setT(theFormationTime);
//
// Get the number of decay channels
@@ -398,6 +402,25 @@ G4KineticTrack::G4KineticTrack(G4ParticleDefinition* aDefinition,
}
G4KineticTrack::G4KineticTrack(G4Nucleon * nucleon,
G4ThreeVector aPosition,
G4LorentzVector& a4Momentum)
: theDefinition(nucleon->GetDefinition()),
theFormationTime(0),
thePosition(aPosition),
the4Momentum(a4Momentum),
theFermi3Momentum(nucleon->GetMomentum()),
theNucleon(nucleon),
nChannels(0),
theActualMass(nucleon->GetDefinition()->GetPDGMass()),
theActualWidth(0),
theDaughterMass(0),
theDaughterWidth(0),
theStateToNucleus(undefined)
{
theFermi3Momentum.setE(0);
Set4Momentum(a4Momentum);
}
G4KineticTrack::~G4KineticTrack()
@@ -416,8 +439,13 @@ const G4KineticTrack& G4KineticTrack::operator=(const G4KineticTrack& right)
{
theDefinition = right.GetDefinition();
theFormationTime = right.GetFormationTime();
thePosition = right.GetPosition();
the4Momentum = right.Get4Momentum();
// thePosition = right.GetPosition();
the4Momentum = right.the4Momentum;
the4Momentum = right.GetTrackingMomentum();
theFermi3Momentum = right.theFermi3Momentum;
theTotal4Momentum = right.theTotal4Momentum;
theNucleon=right.theNucleon;
theStateToNucleus=right.theStateToNucleus;
if (theActualWidth != 0) delete [] theActualWidth;
nChannels = right.GetnChannels();
theActualWidth = new G4double[nChannels];
@@ -534,18 +562,18 @@ G4KineticTrackVector* G4KineticTrack::Decay()
G4DynamicParticle* theDynamicParticle;
G4double theFormationTime = 0.0;
G4ThreeVector thePosition = this->GetPosition();
G4LorentzVector the4Momentum;
G4LorentzVector momentum;
G4KineticTrackVector* theDecayProductList = new G4KineticTrackVector;
G4int dEntries = theDecayProducts->entries();
for (G4int i=dEntries; i > 0; i--)
{
theDynamicParticle = theDecayProducts->PopProducts();
theDefinition = theDynamicParticle->GetDefinition();
the4Momentum = toMoving*theDynamicParticle->Get4Momentum();
momentum = toMoving*theDynamicParticle->Get4Momentum();
theDecayProductList->push_back(new G4KineticTrack (theDefinition,
theFormationTime,
thePosition,
the4Momentum));
momentum));
delete theDynamicParticle;
}
delete theDecayProducts;
@@ -566,7 +594,7 @@ G4double G4KineticTrack::IntegrandFunction1(G4double xmass) const
G4double gamma2 = theDaughterWidth[1];
G4double result = (1. / (2 * mass)) *
sqrt(G4std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
sqrt(std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
BrWig(gamma2, mass2, xmass);
return result;
@@ -579,7 +607,7 @@ G4double G4KineticTrack::IntegrandFunction2(G4double xmass) const
G4double mass2 = theDaughterMass[1];
G4double gamma2 = theDaughterWidth[1];
G4double result = (1. / (2 * mass)) *
sqrt(G4std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
sqrt(std::max((((mass * mass) - (mass1 + xmass) * (mass1 + xmass)) *
((mass * mass) - (mass1 - xmass) * (mass1 - xmass))),0.0)) *
BrWig(gamma2, mass2, xmass);
return result;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NuclearFermiDensity.cc,v 1.11 2002/12/12 19:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4NuclearFermiDensity.cc,v 1.12 2003/06/25 14:51:28 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4NuclearFermiDensity.hh"
@@ -34,7 +34,7 @@ G4NuclearFermiDensity::G4NuclearFermiDensity(G4double anA, G4double aZ)
const G4double r0=1.16 * ( 1. - 1.16 * pow(anA, -2./3.)) * fermi;
theA = G4int(anA);
theZ = G4int(aZ);
theR= r0 * pow(theA, 1./3. );
theR= r0 * pow(anA, 1./3. );
Setrho0(3./ (4. * pi * pow(r0,3.) * theA * ( 1. + sqr(a/theR)*pi2 )));
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NuclearShellModelDensity.cc,v 1.8 2002/12/12 19:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4NuclearShellModelDensity.cc,v 1.9 2003/06/25 14:44:13 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4NuclearShellModelDensity.hh"
@@ -32,7 +32,7 @@ G4NuclearShellModelDensity::G4NuclearShellModelDensity(G4double anA, G4double aZ
const G4double r0sq=0.8133*fermi*fermi;
theA = G4int(anA);
theZ = G4int(aZ);
theRsquare= r0sq * pow(theA, 2./3. );
theRsquare= r0sq * pow(G4double(theA), 2./3. );
Setrho0(pow(1./(pi*theRsquare),3./2.));
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Nucleon.cc,v 1.6 2002/12/12 19:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4Nucleon.cc,v 1.8 2003/06/16 17:09:45 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
#include "G4Nucleon.hh"
@@ -44,9 +44,7 @@ G4Nucleon::~G4Nucleon()
void G4Nucleon::Boost(const G4LorentzVector & aMomentum)
{
// see e.g. CERNLIB short writeup U101 for the algorithm
G4double mass=aMomentum.mag();
G4double factor=
( theMomentum.vect()*aMomentum.vect()/(aMomentum.e()+mass) - theMomentum.e() ) / mass;
@@ -55,8 +53,8 @@ void G4Nucleon::Boost(const G4LorentzVector & aMomentum)
theMomentum.setVect(factor*aMomentum.vect() + theMomentum.vect());
}
#include "g4std/iostream"
G4std::ostream & operator << (G4std::ostream &s, const G4Nucleon& nucleon)
#include <iostream>
std::ostream & operator << (std::ostream &s, const G4Nucleon& nucleon)
{
// s<< nucleon.GetDefinition()->GetParticleName()
// << " is " << nucleon.AreYouHit() ? " " : "not"
@@ -22,7 +22,7 @@
//
//
// $Id: G4Parton.cc,v 1.13 2002/12/12 19:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// GEANT4 tag $Name: geant4-05-02 $
//
// ------------------------------------------------------------
// GEANT 4 class implementation file
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SampleResonance.cc,v 1.5 2002/12/12 19:17:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-01 $
// $Id: G4SampleResonance.cc,v 1.6 2003/06/16 17:09:46 gunter Exp $
// GEANT4 tag $Name: geant4-05-02 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -34,7 +34,7 @@
#include "globals.hh"
#include "g4std/iostream"
#include <iostream>
#include "G4SampleResonance.hh"
#include "G4DecayTable.hh"
#include "Randomize.hh"
@@ -122,7 +122,7 @@ G4double G4SampleResonance::SampleMass(const G4double poleMass,
if ( gamma < DBL_EPSILON )
{
returnMass = G4std::max(minMass, G4std::min(maxMass, poleMass));
returnMass = std::max(minMass, std::min(maxMass, poleMass));
}
else
{