Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,197 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ExcitedString.hh,v 1.10 1998/12/16 14:59:35 gugu Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4ExcitedString_h
#define G4ExcitedString_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4ExcitedString ----------------
// by Gunter Folger, June 1998.
// class for an excited string used by Parton String Models
// ------------------------------------------------------------
#include "G4ios.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
#include "G4Parton.hh"
#include "G4PartonVector.hh"
class G4ExcitedString
{
public:
enum {
PROJECTILE = 1,
TARGET = -1
};
G4ExcitedString(G4Parton* Color, G4Parton* Gluon, G4Parton* AntiColor, G4int Direction=PROJECTILE);
G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction=PROJECTILE);
G4ExcitedString(const G4ExcitedString &right);
~G4ExcitedString();
int operator==(const G4ExcitedString &right) const;
int operator!=(const G4ExcitedString &right) const;
const G4ThreeVector & GetPosition() const;
void SetPosition(const G4ThreeVector &aPosition);
const G4PartonVector * GetPartonList() const;
G4LorentzVector Get4Momentum() const;
void LorentzRotate(const G4LorentzRotation & rotation);
void InsertParton(G4Parton * aParton, const G4Parton * addafter = NULL);
G4LorentzRotation TransformToCenterOfMass();
G4LorentzRotation TransformToAlignedCms();
void Boost(G4ThreeVector& Velocity);
G4Parton* GetColorParton(void) const;
G4Parton* GetGluon(void) const;
G4Parton* GetAntiColorParton(void) const;
G4Parton* GetGluon(G4int GluonPos) const;
G4Parton* GetLeftParton(void) const;
G4Parton* GetRightParton(void) const;
G4bool IsItKinkyString(void) const;
G4int GetDirection(void) const;
private:
G4int theDirection; // must be 1 or -1 (PROJECTILE or TARGET)
G4ThreeVector thePosition;
G4PartonVector thePartons; // would like initial capacity for 3 Partons.
// G4LorentzVector theMomenta; this member nowhere uses
};
inline
int G4ExcitedString::operator==(const G4ExcitedString &right) const
{
return this == &right;
}
inline
int G4ExcitedString::operator!=(const G4ExcitedString &right) const
{
return this != &right;
}
inline
const G4ThreeVector & G4ExcitedString::GetPosition() const
{
return thePosition;
}
inline
void G4ExcitedString::SetPosition(const G4ThreeVector &aPosition)
{
thePosition= aPosition;
}
inline
G4LorentzVector G4ExcitedString::Get4Momentum() const
{
G4LorentzVector momentum;
for ( G4int index=0; index < thePartons.entries() ; index++ )
{
momentum += thePartons[index]->Get4Momentum();
}
return momentum;
}
inline
void G4ExcitedString::LorentzRotate(const G4LorentzRotation & rotation)
{
for ( G4int index=0; index < thePartons.entries() ; index++ )
{
thePartons[index]->Set4Momentum(rotation*thePartons[index]->Get4Momentum());
}
}
inline
void G4ExcitedString::InsertParton(G4Parton *aParton, const G4Parton * addafter)
{
G4int insert_index=1;
if ( addafter != NULL )
{
insert_index=thePartons.index(addafter);
if (insert_index == RW_NPOS) // No object addafter in thePartons
{
G4Exception("G4ExcitedString::InsertParton called with invalid second argument");
}
}
thePartons.insertAt(insert_index+1, aParton);
}
inline
G4LorentzRotation G4ExcitedString::TransformToCenterOfMass()
{
G4LorentzVector momentum=Get4Momentum();
G4LorentzRotation toCms(-1*momentum.boostVector());
for ( G4int index=0; index < thePartons.entries() ; index++ )
{
momentum=toCms * thePartons[index]->Get4Momentum();
thePartons[index]->Set4Momentum(momentum);
}
return toCms;
}
inline
G4LorentzRotation G4ExcitedString::TransformToAlignedCms()
{
G4LorentzVector momentum=Get4Momentum();
G4LorentzRotation toAlignedCms(-1*momentum.boostVector());
momentum= toAlignedCms* thePartons[0]->Get4Momentum();
toAlignedCms.rotateZ(-1*momentum.phi());
toAlignedCms.rotateY(-1*momentum.theta());
for ( G4int index=0; index < thePartons.entries() ; index++ )
{
momentum=toAlignedCms * thePartons[index]->Get4Momentum();
thePartons[index]->Set4Momentum(momentum);
}
return toAlignedCms;
}
inline
const G4PartonVector * G4ExcitedString::GetPartonList() const
{
return &thePartons;
}
#endif
@@ -0,0 +1,28 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ExcitedStringVector.hh,v 1.1 1998/08/22 08:57:49 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4ExcitedStringVector_h
#define G4ExcitedStringPartonVector_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4ExcitedStringVector ----------------
// by Gunter Folger, June 1998.
// ------------------------------------------------------------
#include "G4ExcitedString.hh"
#include <rw/tpordvec.h>
typedef RWTPtrOrderedVector<G4ExcitedString> G4ExcitedStringVector;
#endif
@@ -0,0 +1,94 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Fancy3DNucleus.hh,v 1.4 1998/10/30 16:38:40 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4Fancy3DNucleus_h
#define G4Fancy3DNucleus_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4Fancy3DNucleus ----------------
// by Gunter Folger, May 1998.
// class for a 3D nucleus, arranging nucleons in space and momentum.
// ------------------------------------------------------------
#include "globals.hh"
#include "G4DynamicParticle.hh"
#include "G4V3DNucleus.hh"
#include "G4Nucleon.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include <rw/tpordvec.h>
class G4Fancy3DNucleus : public G4V3DNucleus
{
public:
G4Fancy3DNucleus();
~G4Fancy3DNucleus();
private:
G4Fancy3DNucleus(const G4Fancy3DNucleus &right);
const G4Fancy3DNucleus & operator=(const G4Fancy3DNucleus &right);
int operator==(const G4Fancy3DNucleus &right) const;
int operator!=(const G4Fancy3DNucleus &right) const;
// Implementation
void ChooseNucleons();
void ChoosePositions();
void ChooseFermiMomenta();
G4double BindingEnergy();
public:
void Init(G4double theA, G4double theZ);
G4bool StartLoop();
G4Nucleon * GetNextNucleon();
const RWTPtrOrderedVector<G4Nucleon> & GetNucleons();
G4int GetMassNumber();
G4double GetMass();
G4int GetCharge();
G4double GetNuclearRadius();
G4double GetNuclearRadius(const G4double maxRelativeDensity);
G4double GetOuterRadius();
void DoLorentzBoost(const G4LorentzVector & theBoost);
void DoLorentzBoost(const G4ThreeVector & theBeta);
void DoLorentzContraction(const G4LorentzVector & theBoost);
void DoLorentzContraction(const G4ThreeVector & theBeta);
void CenterNucleons();
void DoTranslation(const G4ThreeVector & theShift);
private:
G4int myA;
G4int myZ;
G4Nucleon * theNucleons;
RWTPtrOrderedVector<G4Nucleon> theRWNucleons; // should not have two...
G4int currentNucleon;
G4VNuclearDensity * theDensity;
G4FermiMomentum theFermi;
const G4double nucleondistance;
};
inline G4int G4Fancy3DNucleus::GetCharge()
{
return myZ;
}
inline G4int G4Fancy3DNucleus::GetMassNumber()
{
return myA;
}
#endif
@@ -0,0 +1,56 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FermiMomentum.hh,v 1.2 1998/10/30 16:40:09 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4FermiMomentum_h
#define G4FermiMomentum_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "Randomize.hh"
class G4FermiMomentum
{
public:
G4FermiMomentum();
~G4FermiMomentum();
inline void Init(G4double anA, G4double aZ) {theA = anA; theZ = aZ;}
inline G4double GetFermiMomentum(G4double density)
{
return constofpmax * cbrt(density * theA);
}
inline G4ThreeVector GetMomentum(G4double density)
{
G4ThreeVector p;
do {
p=G4ThreeVector(2.*G4UniformRand()-1.,
2.*G4UniformRand()-1.,
2.*G4UniformRand()-1.);
} while ( p.mag() > 1. );
return p*GetFermiMomentum(density);
}
private:
G4double theA;
G4double theZ;
// pmax= hbar * c * ( 3* pi**2 * rho )**(1/3) =
// hbar * c * ( 3* pi**2 )**(1/3) * rho**(1/3)=
// constofpmax * rho**(1/3)
G4double constofpmax;
};
#endif
@@ -0,0 +1,219 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Fragment.hh,v 1.10 1998/12/16 11:46:47 larazb Exp $
// GEANT4 tag $Name: geant4-00 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
#ifndef G4Fragment_h
#define G4Fragment_h 1
#include "G4ios.hh"
#include <iomanip.h>
#include <rw/tpordvec.h>
#include "globals.hh"
#include "G4LorentzVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4ThreeVector.hh"
#include "G4NucleiProperties.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
class G4ParticleDefinition;
class G4Fragment; // Forward deckaration
typedef RWTPtrOrderedVector<G4Fragment> G4FragmentVector;
class G4Fragment
{
public:
G4Fragment();
~G4Fragment();
G4Fragment(const G4Fragment &right);
G4Fragment(const G4int A, const G4int Z, const G4LorentzVector aMomentum);
G4Fragment(const G4LorentzVector aMomentum, G4ParticleDefinition * aParticleDefinition);
G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy, const G4LorentzVector aMomentum,
const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons, const G4int aNumberOfHoles,
const G4int aNumberOfCharged);
G4Fragment(const G4int A, const G4int Z, const G4double anExEnergy,
const G4LorentzVector aMomentum,
const G4ThreeVector anAngularMomentum, const G4int aNumberOfExcitons,
const G4int aNumberOfHoles, const G4int aNumberOfCharged,
G4ParticleDefinition * aParticleDefinition);
const G4Fragment & operator=(const G4Fragment &right);
G4bool operator==(const G4Fragment &right) const;
G4bool operator!=(const G4Fragment &right) const;
friend ostream& operator<<(ostream&, const G4Fragment*);
friend ostream& operator<<(ostream&, const G4Fragment&);
inline G4double GetA(void) const;
void SetA(const G4double value);
G4double GetZ(void) const;
void SetZ(const G4double value);
G4double GetExcitationEnergy(void) const;
void SetExcitationEnergy(const G4double value);
const G4LorentzVector GetMomentum(void) const;
void SetMomentum(const G4LorentzVector value);
const G4ThreeVector GetAngularMomentum(void) const;
void SetAngularMomentum(const G4ThreeVector value);
G4int GetNumberOfExcitons(void) const;
void SetNumberOfExcitons(const G4int value);
G4int GetNumberOfHoles(void) const;
void SetNumberOfHoles(const G4int value);
G4int GetNumberOfCharged(void) const;
void SetNumberOfCharged(const G4int value);
G4int GetNumberOfParticles(void) const;
inline G4ParticleDefinition * GetParticleDefinition(void) const;
void SetParticleDefinition(G4ParticleDefinition * aParticleDefinition);
void DumpInfo() const;
private:
G4double theA;
G4double theZ;
G4double theExcitationEnergy;
G4LorentzVector theMomentum;
G4ThreeVector theAngularMomentum;
G4int numberOfExcitons;
G4int numberOfHoles;
G4int numberOfCharged;
G4ParticleDefinition * theParticleDefinition;
};
// Class G4Fragment
inline G4double G4Fragment::GetA() const
{
return theA;
}
inline void G4Fragment::SetA(const G4double value)
{
theA = value;
}
inline G4double G4Fragment::GetZ() const
{
return theZ;
}
inline void G4Fragment::SetZ(const G4double value)
{
theZ = value;
}
inline G4double G4Fragment::GetExcitationEnergy() const
{
return theExcitationEnergy;
}
inline void G4Fragment::SetExcitationEnergy(const G4double value)
{
theExcitationEnergy = value;
}
inline const G4LorentzVector G4Fragment::GetMomentum() const
{
return theMomentum;
}
inline void G4Fragment::SetMomentum(const G4LorentzVector value)
{
theMomentum = value;
}
inline const G4ThreeVector G4Fragment::GetAngularMomentum() const
{
return theAngularMomentum;
}
inline void G4Fragment::SetAngularMomentum(const G4ThreeVector value)
{
theAngularMomentum = value;
}
inline G4int G4Fragment::GetNumberOfExcitons() const
{
return numberOfExcitons;
}
inline void G4Fragment::SetNumberOfExcitons(const G4int value)
{
numberOfExcitons = value;
}
inline G4int G4Fragment::GetNumberOfHoles() const
{
return numberOfHoles;
}
inline void G4Fragment::SetNumberOfHoles(const G4int value)
{
numberOfHoles = value;
}
inline G4int G4Fragment::GetNumberOfCharged() const
{
return numberOfCharged;
}
inline void G4Fragment::SetNumberOfCharged(const G4int value)
{
numberOfCharged = value;
}
inline G4int G4Fragment::GetNumberOfParticles() const
{
return numberOfExcitons - numberOfHoles;
}
inline G4ParticleDefinition * G4Fragment::GetParticleDefinition(void) const
{
return theParticleDefinition;
}
inline void G4Fragment::SetParticleDefinition(G4ParticleDefinition * aParticleDefinition)
{
theParticleDefinition = aParticleDefinition;
}
inline void G4Fragment::DumpInfo() const
{
G4cout << this;
}
#endif
@@ -0,0 +1,19 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4FragmentVector.hh,v 1.1 1998/08/22 08:57:51 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
// Hadronic Process: Nuclear De-excitations
// by V. Lara (May 1998)
#ifndef G4FragmentVector_h
#define G4FragmentVector_h 1
#include "G4Fragment.hh"
#endif
@@ -0,0 +1,93 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4GeneralPhaseSpaceDecay.hh,v 1.2 1998/11/18 18:23:23 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//$Id: G4GeneralPhaseSpaceDecay.hh,v 1.1 1997/05/21
// ----------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, A. Feliciello, 20th May 1998
//
// Note: this class is a generalization of the
// G4PhaseSpaceDecayChannel one
// ----------------------------------------------------------------
#ifndef G4GeneralPhaseSpaceDecay_h
#define G4GeneralPhaseSpaceDecay_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VDecayChannel.hh"
class G4GeneralPhaseSpaceDecay : public G4VDecayChannel
{
public:
//Constructors
G4GeneralPhaseSpaceDecay(G4int Verbose = 1);
G4GeneralPhaseSpaceDecay(const G4String& theParentName,
G4double theBR,
G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
G4GeneralPhaseSpaceDecay(const G4String& theParentName,
G4double theParentMass,
G4double theBR,
G4int theNumberOfDaughters,
const G4String& theDaughterName1,
const G4String& theDaughterName2 = "",
const G4String& theDaughterName3 = "");
// Destructor
virtual ~G4GeneralPhaseSpaceDecay();
public:
G4double GetParentMass() const;
void SetParentMass(const G4double aParentMass);
virtual G4DecayProducts* DecayIt(G4double mass=0.0);
static G4double Pmx(G4double e, G4double p1, G4double p2);
private:
G4DecayProducts* OneBodyDecayIt();
G4DecayProducts* TwoBodyDecayIt();
G4DecayProducts* ThreeBodyDecayIt();
G4DecayProducts* ManyBodyDecayIt();
private:
G4double parentmass;
};
inline G4double G4GeneralPhaseSpaceDecay::GetParentMass() const
{
return parentmass;
}
inline void G4GeneralPhaseSpaceDecay::SetParentMass(const G4double aParentMass)
{
parentmass = aParentMass;
}
inline
G4double G4GeneralPhaseSpaceDecay::Pmx(G4double e, G4double p1, G4double p2)
{
// calculate momentum of daughter particles in two-body decay
G4double ppp = (e+p1+p2)*(e+p1-p2)*(e-p1+p2)*(e-p1-p2)/(4.0*e*e);
if (ppp>0) return sqrt(ppp);
else return -1.;
}
#endif
@@ -0,0 +1,271 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4KineticTrack.hh,v 1.1 1998/08/22 08:57:54 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
// $Id: G4KineticTrack.hh,v 1.0 1998/05/20
// -----------------------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// History: first implementation, A. Feliciello, 20th May 1998
// -----------------------------------------------------------------------------
#ifndef G4KineticTrack_h
#define G4KineticTrack_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "Randomize.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4VKineticNucleon.hh"
#include "G4ParticleDefinition.hh"
#include "G4VDecayChannel.hh"
class G4KineticTrackVector;
G4double G4KineticTrackIntegrandFunction1 (G4double xmass);
G4double G4KineticTrackIntegrandFunction2 (G4double xmass);
class G4KineticTrack : public G4VKineticNucleon
{
public:
G4KineticTrack();
G4KineticTrack(const G4KineticTrack& right);
G4KineticTrack(G4ParticleDefinition* aDefinition,
G4double aFormationTime,
G4ThreeVector aPosition,
G4LorentzVector& a4Momentum);
~G4KineticTrack();
const G4KineticTrack& operator=(const G4KineticTrack& right);
G4int operator==(const G4KineticTrack& right) const;
G4int operator!=(const G4KineticTrack& right) const;
G4ParticleDefinition* GetDefinition() const;
void SetDefinition(G4ParticleDefinition* aDefinition);
G4double GetFormationTime() const;
void SetFormationTime(G4double aFormationTime);
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector aPosition);
const G4LorentzVector& Get4Momentum() const;
void Set4Momentum(const G4LorentzVector& a4Momentum);
const G4LorentzVector& GetInitialCoordinates() const;
G4double SampleResidualLifetime();
G4KineticTrackVector* Decay();
private:
G4int GetnChannels() const;
void SetnChannels(const G4int aChannel);
G4double GetActualMass() const;
G4double* GetActualWidth() const;
void SetActualWidth(G4double* anActualWidth);
G4double EvaluateTotalActualWidth();
G4double EvaluateCMMomentum (const G4double mass,
const G4double* m_ij) const;
G4double IntegrateCMMomentum() const;
G4double IntegrateCMMomentum(const G4double polemass) const;
public:
friend G4double G4KineticTrackIntegrandFunction1 (G4double xmass);
friend G4double G4KineticTrackIntegrandFunction2 (G4double xmass);
private:
G4ParticleDefinition* theDefinition;
G4double theFormationTime;
G4ThreeVector thePosition;
G4LorentzVector the4Momentum;
G4LorentzVector theInitialCoordinates;
G4int nChannels;
G4double theActualMass;
G4double* theActualWidth;
private:
// Temporary storage for daughter masses and widths
// (needed because Integrand Function cannot take > 1 argument)
G4double* theDaughterMass;
G4double* theDaughterWidth;
};
// Class G4KineticTrack
inline G4ParticleDefinition* G4KineticTrack::GetDefinition() const
{
return theDefinition;
}
inline void G4KineticTrack::SetDefinition(G4ParticleDefinition* aDefinition)
{
theDefinition = aDefinition;
}
inline G4double G4KineticTrack::GetFormationTime() const
{
return theFormationTime;
}
inline void G4KineticTrack::SetFormationTime(G4double aFormationTime)
{
theFormationTime = aFormationTime;
}
inline const G4ThreeVector& G4KineticTrack::GetPosition() const
{
return thePosition;
}
inline void G4KineticTrack::SetPosition(const G4ThreeVector aPosition)
{
thePosition = aPosition;
}
inline const G4LorentzVector& G4KineticTrack::Get4Momentum() const
{
return the4Momentum;
}
inline void G4KineticTrack::Set4Momentum(const G4LorentzVector& a4Momentum)
{
the4Momentum = a4Momentum;
}
inline const G4LorentzVector& G4KineticTrack::GetInitialCoordinates() const
{
return theInitialCoordinates;
}
inline G4double G4KineticTrack::GetActualMass() const
{
G4ThreeVector theMomentum = the4Momentum.vect();
G4double theMomentum2 = theMomentum.mag2();
G4double theTotalEnergy = the4Momentum.e();
G4double theMass = sqrt(theTotalEnergy * theTotalEnergy - theMomentum2);
return theMass;
}
inline G4int G4KineticTrack::GetnChannels() const
{
return nChannels;
}
inline void G4KineticTrack::SetnChannels(const G4int numberOfChannels)
{
nChannels = numberOfChannels;
}
inline G4double* G4KineticTrack::GetActualWidth() const
{
return theActualWidth;
}
inline void G4KineticTrack::SetActualWidth(G4double* anActualWidth)
{
theActualWidth = anActualWidth;
}
inline G4double G4KineticTrack::EvaluateTotalActualWidth()
{
G4int index;
G4double theTotalActualWidth = 0.0;
for (index = nChannels - 1; index >= 0; index--)
{
theTotalActualWidth += theActualWidth[index];
}
return theTotalActualWidth;
}
inline G4double G4KineticTrack::SampleResidualLifetime()
{
G4double theTotalActualWidth = this->EvaluateTotalActualWidth();
G4double tau = hbar_Planck * (-1.0 / theTotalActualWidth);
G4double theResidualLifetime = tau * log(G4UniformRand());
return theResidualLifetime;
}
inline G4double G4KineticTrack::EvaluateCMMomentum(const G4double m,
const G4double* m_ij) const
{
G4double theCMMomentum = 1 / (2 * m) *
sqrt (((m * m) - (m_ij[0] + m_ij[1]) * (m_ij[0] + m_ij[1])) *
((m * m) - (m_ij[0] - m_ij[1]) * (m_ij[0] - m_ij[1])));
return theCMMomentum;
}
#endif
@@ -0,0 +1,33 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4KineticTrackVector.hh,v 1.2 1998/10/09 13:46:50 maxim Exp $
// GEANT4 tag $Name: geant4-00 $
// Modified at 8-Oct-1998 by Maxim Komogorov. Methods BoostBeam,Boost,Shift
// were added.
#ifndef G4KineticTrackVector_h
#define G4KineticTrackVector_h 1
#include "globals.hh"
#include "G4KineticTrack.hh"
#include <rw/tpordvec.h>
class G4KineticTrackVector : public RWTPtrOrderedVector<G4KineticTrack>
{
public:
G4KineticTrackVector();
public:
void BoostBeam(G4ThreeVector& BeamMom);
void Boost(G4ThreeVector& Velocity);
void Shift(G4ThreeVector& Pos);
};
#endif
@@ -0,0 +1,41 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NuclearFermiDensity.hh,v 1.1 1998/08/22 08:57:55 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4NuclearFermiDensity_h
#define G4NuclearFermiDensity_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4VNuclearDensity.hh"
#include <CLHEP/Units/PhysicalConstants.h> // pi, fermi,..
#include <math.h> // pow
class G4NuclearFermiDensity : public G4VNuclearDensity
{
public:
G4NuclearFermiDensity(G4double anA, G4double aZ);
~G4NuclearFermiDensity();
G4double GetRelativeDensity(G4ThreeVector aPosition);
G4double GetRadius(const G4double maxRelativeDenisty);
private:
G4int theA;
G4int theZ;
G4double theR; // Nuclear Radius
const G4double a; // Determines the nuclear surface thickness
};
#endif
@@ -0,0 +1,39 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NuclearShellModelDensity.hh,v 1.1 1998/08/22 08:57:55 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4NuclearShellModelDensity_h
#define G4NuclearShellModelDensity_h 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4VNuclearDensity.hh"
#include <CLHEP/Units/PhysicalConstants.h> // pi, fermi,..
#include <math.h> // pow,..
class G4NuclearShellModelDensity : public G4VNuclearDensity
{
public:
G4NuclearShellModelDensity(G4double anA, G4double aZ);
~G4NuclearShellModelDensity();
G4double GetRelativeDensity(G4ThreeVector aPosition);
G4double GetRadius(const G4double maxRelativeDenisty);
private:
G4int theA;
G4int theZ;
G4double theRsquare;
};
#endif
@@ -0,0 +1,111 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Nucleon.hh,v 1.1 1998/08/22 08:57:56 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4Nucleon_h
#define G4Nucleon_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4Nucleon ----------------
// by Gunter Folger, May 1998.
// class for a nucleon (inside a 3D Nucleus)
// ------------------------------------------------------------
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4VKineticNucleon.hh"
//#include "G4VSplitableHadron.hh"
class G4VSplitableHadron;
class G4Nucleon : public G4VKineticNucleon
{
public:
G4Nucleon();
~G4Nucleon();
inline int operator==(const G4Nucleon &right) const;
inline int operator!=(const G4Nucleon &right) const;
const G4Nucleon& operator=(const G4Nucleon& right);
public:
inline void SetPosition(G4ThreeVector & aPosition) {thePosition = aPosition;}
virtual inline const G4ThreeVector & GetPosition() const {return thePosition;}
inline void SetMomentum(G4LorentzVector & aMomentum) {theMomentum = aMomentum;}
inline const G4LorentzVector& GetMomentum() const {return theMomentum;}
virtual inline const G4LorentzVector & Get4Momentum() const {return theMomentum;}
inline void SetBindingEnergy(G4double anEnergy) {theBindingE = anEnergy;}
inline G4double GetBindingEnergy() const {return theBindingE;}
inline void SetParticleType(G4Proton * aProton) {theParticleType = aProton;}
inline void SetParticleType(G4Neutron *aNeutron){theParticleType = aNeutron;}
inline G4ParticleDefinition * GetParticleType() const {return theParticleType;}
virtual G4ParticleDefinition* GetDefinition() const {return theParticleType;}
inline void Boost(const G4ThreeVector & beta){ theMomentum.boost(beta); }
void Boost(const G4LorentzVector & aMomentum);
inline void Hit(G4VSplitableHadron * aHit) { theSplitableHadron=aHit;}
inline G4VSplitableHadron * GetSplitableHadron() const { return theSplitableHadron;}
inline G4bool AreYouHit()
{
G4bool result = true;
if (theSplitableHadron==NULL) result = false;
return result;
}
private:
G4ThreeVector thePosition;
G4LorentzVector theMomentum;
G4double theBindingE;
G4ParticleDefinition * theParticleType;
G4VSplitableHadron * theSplitableHadron;
};
inline int G4Nucleon::operator==(const G4Nucleon &right) const
{
return this==&right;
}
inline int G4Nucleon::operator!=(const G4Nucleon &right) const
{
return this!=&right;
}
inline const G4Nucleon& G4Nucleon::operator=(const G4Nucleon& right)
{
thePosition=right.GetPosition();
theMomentum=right.Get4Momentum();
theBindingE=right.GetBindingEnergy();
theParticleType=right.GetDefinition();
theSplitableHadron=right.GetSplitableHadron();
return *this;
}
#endif
@@ -0,0 +1,106 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Parton.hh,v 1.1 1998/08/22 08:57:56 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4Parton_h
#define G4Parton_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4Parton ----------------
// by Gunter Folger, June 1998.
// class for Parton (inside a string) used by Parton String Models
// ------------------------------------------------------------
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
class G4Parton
{
public:
G4Parton(G4int PDGencoding);
G4Parton(const G4Parton &right);
~G4Parton();
const G4Parton & operator=(const G4Parton &right);
int operator==(const G4Parton &right) const;
int operator!=(const G4Parton &right) const;
G4int GetPDGcode() const;
const G4ThreeVector & GetPosition()const;
void SetPosition(const G4ThreeVector &aPosition);
const G4LorentzVector & Get4Momentum() const;
void Set4Momentum(const G4LorentzVector & aMomentum);
private:
G4int PDGencoding;
G4LorentzVector theMomentum;
G4ThreeVector thePosition;
};
inline int G4Parton::operator==(const G4Parton &right) const
{
return this==&right;
}
inline int G4Parton::operator!=(const G4Parton &right) const
{
return this!=&right;
}
inline G4int G4Parton::GetPDGcode() const
{
return PDGencoding;
}
inline const G4ThreeVector & G4Parton::GetPosition() const
{
return thePosition;
}
inline void G4Parton::SetPosition(const G4ThreeVector &aPosition)
{
thePosition=aPosition;
}
inline const G4LorentzVector & G4Parton::Get4Momentum() const
{
return theMomentum;
}
inline void G4Parton::Set4Momentum(const G4LorentzVector & aMomentum)
{
theMomentum=aMomentum;
}
inline const G4Parton & G4Parton::operator=(const G4Parton &right)
{
PDGencoding=right.GetPDGcode();
theMomentum=right.Get4Momentum();
thePosition=right.GetPosition();
return *this;
}
#endif
@@ -0,0 +1,28 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PartonVector.hh,v 1.1 1998/08/22 08:57:57 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4PartonVector_h
#define G4PartonVector_h 1
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4PartonVector ----------------
// by Gunter Folger, May 1998.
// ------------------------------------------------------------
#include "G4Parton.hh"
#include <rw/tpordvec.h>
typedef RWTPtrOrderedVector<G4Parton> G4PartonVector;
#endif
@@ -0,0 +1,65 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VKineticNucleon.hh,v 1.1 1998/08/22 08:57:57 hpw Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4VKineticNucleon_h
#define G4VKineticNucleon_h 1
#include "G4ThreeVector.hh"
#include "G4LorentzVector.hh"
#include "G4ParticleDefinition.hh"
class G4KineticTrackVector;
class G4VKineticNucleon
{
public:
G4VKineticNucleon();
G4VKineticNucleon(const G4VKineticNucleon &right);
virtual ~G4VKineticNucleon();
const G4VKineticNucleon& operator=(const G4VKineticNucleon& right);
int operator==(const G4VKineticNucleon& right) const;
int operator!=(const G4VKineticNucleon& right) const;
virtual G4KineticTrackVector* Decay();
virtual const G4LorentzVector& Get4Momentum() const =0;
virtual G4ParticleDefinition* GetDefinition()const =0;
virtual const G4ThreeVector& GetPosition() const =0;
protected:
private:
};
// Class G4VKineticNucleon
inline G4KineticTrackVector* G4VKineticNucleon::Decay()
{
return NULL;
}
inline const G4VKineticNucleon& G4VKineticNucleon::operator=(const G4VKineticNucleon& right)
{
return *this;
}
#endif