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
@@ -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: