Import Geant4 0.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:09:25 +02:00
parent b97f8d0df7
commit aaa409b6ee
2922 changed files with 55107 additions and 81674 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DalitzDecayChannel.hh,v 2.2 1998/11/18 09:45:58 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DalitzDecayChannel.hh,v 1.1 1999/01/07 16:10:27 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayProducts.hh,v 2.1 1998/07/13 17:17:47 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DecayProducts.hh,v 1.3 1999/04/13 07:58:22 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -55,11 +55,11 @@ class G4DecayProducts
// theParentPaticle is used to get information of parent particle
// when decay products are filled
// new G4DynamicParticle object is created in set methods
G4DynamicParticle* GetParentParticle() const {return theParentParticle;};
const G4DynamicParticle* GetParentParticle() const {return theParentParticle;};
void SetParentParticle(const G4DynamicParticle &aParticle);
// boost all products
void Boost(G4double totalEnergy, const G4ParticleMomentum &momentumDirection);
void Boost(G4double totalEnergy, const G4ThreeVector &momentumDirection);
void Boost(G4double betax, G4double betay, G4double betaz);
// push-pop methods for decay products pointer
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTable.hh,v 2.1 1998/07/13 17:17:50 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DecayTable.hh,v 1.2 1999/04/13 07:58:23 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -39,6 +39,8 @@ class G4DecayTable
~G4DecayTable();
private:
// hide copy constructor and assignment operator by declaring "private"
// (Implementation does not make sense )
G4DecayTable(const G4DecayTable &){};
G4DecayTable & operator=(const G4DecayTable &){return *this;};
@@ -77,7 +79,7 @@ inline
inline
G4VDecayChannel* G4DecayTable::GetDecayChannel(G4int index) const
{
G4VDecayChannel* selectedChannel = NULL;
G4VDecayChannel* selectedChannel = 0;
if ( (index>=0) && (index<channels->entries()) ){
selectedChannel = (*channels)(index);
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTableMessenger.hh,v 2.2 1998/07/12 03:43:08 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DecayTableMessenger.hh,v 1.2 1999/04/13 07:58:24 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -49,11 +49,11 @@ class G4UIcmdWithADouble;
class G4DecayTableMessenger: public G4UImessenger
{
public:
G4DecayTableMessenger(G4ParticleTable* pTable = NULL);
~G4DecayTableMessenger();
G4DecayTableMessenger(G4ParticleTable* pTable = 0);
virtual ~G4DecayTableMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
virtual G4String GetCurrentValue(G4UIcommand * command);
private:
G4DecayTableMessenger(const G4DecayTableMessenger&){};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticle.hh,v 2.2 1998/11/13 17:01:08 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DynamicParticle.hh,v 1.3 1999/04/13 07:58:25 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -43,9 +43,13 @@
#include "G4ParticleDefinition.hh"
#include "G4Allocator.hh"
#include "G4ParticleMomentum.hh"
#include "G4LorentzVector.hh"
#include "G4ParticleMomentum.hh"
// G4ParticleMomentum is "momentum direction" not "momentum vector"
// The name is miss-leading so you should not use G4ParticleMomentum
// and you are recommended to use G4ThreeVector instead
class G4VProcess;
class G4DecayProducts;
@@ -61,7 +65,7 @@ class G4DynamicParticle
G4DynamicParticle();
G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
const G4ParticleMomentum& aMomentumDirection,
const G4ThreeVector& aMomentumDirection,
G4double aKineticEnergy);
G4DynamicParticle(G4ParticleDefinition * aParticleDefinition,
const G4ThreeVector& aParticleMomentum);
@@ -89,10 +93,10 @@ class G4DynamicParticle
// set/get dynamical mass
// the dynamical mass is set to PDG mass in default
const G4ParticleMomentum& GetMomentumDirection() const;
const G4ThreeVector& GetMomentumDirection() const;
// Returns the normalized direction of the momentum
void SetMomentumDirection(const G4ParticleMomentum &aDirection);
void SetMomentumDirection(const G4ThreeVector &aDirection);
// Sets the normalized direction of the momentum
void SetMomentumDirection(G4double px, G4double py, G4double pz);
@@ -133,13 +137,13 @@ class G4DynamicParticle
void SetKineticEnergy(G4double aEnergy);
// Sets the kinetic energy of a particle
G4DecayProducts *GetPreAssignedDecayProducts() const;
G4DecayProducts *GetPreAssignedDecayProducts();
void SetPreAssignedDecayProducts(G4DecayProducts *aDecayProducts);
private:
G4double theDynamicalMass;
G4ParticleMomentum theMomentumDirection;
G4ThreeVector theMomentumDirection;
// The normalized momentum vector
G4ParticleDefinition *theParticleDefinition;
@@ -198,7 +202,7 @@ inline void G4DynamicParticle::SetMass(G4double newMass)
theDynamicalMass = newMass;
}
inline const G4ParticleMomentum& G4DynamicParticle::GetMomentumDirection() const
inline const G4ThreeVector& G4DynamicParticle::GetMomentumDirection() const
{
return theMomentumDirection;
}
@@ -256,7 +260,7 @@ inline G4double G4DynamicParticle::GetKineticEnergy() const
return theKineticEnergy;
}
inline void G4DynamicParticle::SetMomentumDirection(const G4ParticleMomentum &aDirection)
inline void G4DynamicParticle::SetMomentumDirection(const G4ThreeVector &aDirection)
{
theMomentumDirection = aDirection;
}
@@ -291,7 +295,7 @@ inline void G4DynamicParticle::SetProperTime(G4double atime)
theProperTime = atime;
}
inline G4DecayProducts* G4DynamicParticle::GetPreAssignedDecayProducts() const
inline G4DecayProducts* G4DynamicParticle::GetPreAssignedDecayProducts()
{
return thePreAssignedDecayProducts;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticleFastVector.hh,v 2.1 1998/07/13 17:17:53 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4DynamicParticleFastVector.hh,v 1.1 1999/01/07 16:10:28 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonTable.hh,v 2.4 1998/11/18 09:45:59 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4IonTable.hh,v 1.5 1999/05/06 16:37:36 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -19,6 +19,7 @@
// ------------------------------------------------------------
// modified GetIon 02 Aug., 98 H.Kurashige
// added Remove() 06 Nov.,98 H.Kurashige
// add GetNucleusMass 15 Mar. 99 H.Kurashige
#ifndef G4IonTable_h
#define G4IonTable_h 1
@@ -51,7 +52,11 @@ class G4IonTable
G4ParticleDefinition* GetIon(G4int Z, G4int A, G4int J, G4int Q);
// get a pointer to the ion with A,Z,J,Q
// The ion will be created if not exist yet
// Z: Atomic Number
// A: Atomic Mass
// J: Total Angular momentum
// Q: Total charge
G4bool IsIon(G4ParticleDefinition*) const;
// return true if the particle is ion
@@ -60,7 +65,12 @@ class G4IonTable
G4String GetIonName(G4int Z, G4int A, G4int J, G4int Q) const;
// get ion name
G4double GetIonMass(G4int Z, G4int A) const;
G4double GetNucleusMass(G4int Z, G4int A) const;
// These two methods returns Nucleus (i.e. full ionized atom) mass
// ,where Z is Atomic Number (number of protons) and
// A is Atomic Number (number of nucleons)
G4int Entries() const;
G4bool Contains(const G4ParticleDefinition *particle) const;
@@ -74,8 +84,7 @@ class G4IonTable
private:
G4IonList* fIonList;
G4double electronMass, protonMass, neutronMass;
enum { numberOfElements = 110};
static const G4String elementName[numberOfElements];
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Ions.hh,v 2.1 1998/07/13 17:17:58 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4Ions.hh,v 1.2 1999/04/13 07:58:28 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -48,12 +48,14 @@ class G4Ions : public G4ParticleWithCuts
G4bool stable, G4double lifetime,
G4DecayTable *decaytable
);
G4Ions* IonsDefinition(){return this;};
G4Ions* Ions(){return this;};
G4double GetCuts() {return theIonsLengthCut;}
G4double* GetCutsInEnergy() {return theIonsKineticEnergyCuts;};
virtual ~G4Ions(){};
G4Ions* IonsDefinition(){return this;};
G4Ions* Ions(){return this;};
void SetCuts(G4double aCut);
virtual G4double GetCuts() {return theIonsLengthCut;}
virtual const G4double* GetCutsInEnergy() {return theIonsKineticEnergyCuts;};
virtual void SetCuts(G4double aCut);
};
inline void G4Ions::SetCuts(G4double aCut)
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4KL3DecayChannel.hh,v 2.2 1998/11/18 09:46:00 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4KL3DecayChannel.hh,v 1.1 1999/01/07 16:10:28 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MuonDecayChannel.hh,v 2.2 1998/11/18 09:46:02 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4MuonDecayChannel.hh,v 1.1 1999/01/07 16:10:29 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiProperties.hh,v 2.4 1998/12/09 14:35:19 larazb Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4NucleiProperties.hh,v 1.4 1999/05/26 16:22:10 larazb Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -17,6 +17,8 @@
// ------------------------------------------------------------
// Hadronic Process: Nuclear De-excitations by V. Lara (Oct 1998)
// Migrate into particles category by H.Kurashige (17 Nov. 98)
// Added Shell-Pairing corrections to the Cameron mass
// excess formula by V.Lara (9 May 99)
//
#ifndef G4NucleiProperties_h
#define G4NucleiProperties_h 1
@@ -40,57 +42,71 @@ public:
// Destructor
~G4NucleiProperties() { };
enum { NTZ = 130, NTAZ = 200 };
private:
// Calculate Mass Excess according to Cameron's liquid drop formula
// (shell corrections are not included)
static G4double CameronMassExcess(const G4int A, const G4int Z);
// (shell corrections are included)
static G4double PSCorrectedCameronMassExcess( const G4int A, const G4int Z );
static G4double AtomicMass(G4double Z, G4double A);
public:
// Calculate Mass Excess of nucleus A,Z
static G4double GetMassExcess(const G4int A, const G4int Z)
{
if (A < 1 || Z < 0 || Z > A) {
G4cerr << "G4NucleiProperties::GetMassExccess: Wrong values for A = " << A
<< " and Z = " << Z << endl;
return 0.0;
} else {
if (G4NucleiPropertiesTable::IsInTable(Z,A))
return G4NucleiPropertiesTable::GetMassExcess(Z,A);
// else if (Z >= NTZ || A - Z >= NTAZ) return PSCorrectedCameronMassExcess(A,Z)*MeV;
else return CameronMassExcess(A,Z)*MeV;
}
}
static G4double GetAtomicMass(const G4double A, const G4double Z)
{
if (Z < 0 || Z > A) {
G4cerr << "G4NucleiProperties::GetAtomicMass: Wrong values for A = " << A
<< " and Z = " << Z << endl; return 0.0;
} else if (abs(A - G4int(A)) > 1.e-10) {
return AtomicMass(Z,A);
} else {
if (G4NucleiPropertiesTable::IsInTable(Z,A))
return G4NucleiPropertiesTable::GetAtomicMass(Z,A);
else return AtomicMass(Z,A);
}
}
// Calculate Mass Excess of nucleus A,Z
static G4double GetMassExcess(const G4int A, const G4int Z)
{
if (A < 1 || Z < 0 || Z > A) {
G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = " << A
<< " and Z = " << Z << endl;
return 0.0;
} else {
if (G4NucleiPropertiesTable::IsInTable(Z,A)) return G4NucleiPropertiesTable::GetMassExcess(Z,A);
else return MassExcess(A,Z);
}
}
static G4double GetAtomicMass(const G4double A, const G4double Z)
{
if (Z < 0 || Z > A) {
G4cout << "G4NucleiProperties::GetAtomicMass: Wrong values for A = " << A
<< " and Z = " << Z << endl; return 0.0;
} else if (abs(A - G4int(A)) > 1.e-10) {
return AtomicMass(Z,A);
} else {
if (G4NucleiPropertiesTable::IsInTable(Z,A))
return G4NucleiPropertiesTable::GetAtomicMass(Z,A);
else return AtomicMass(Z,A);
}
}
static G4double GetBindingEnergy(const G4int A, const G4int Z)
{
if (A < 1 || Z < 0 || Z > A) {
G4cout << "G4NucleiProperties::GetMassExccess: Wrong values for A = " << A
<< " and Z = " << Z << endl;
return 0.0;
} else {
if (G4NucleiPropertiesTable::IsInTable(Z,A)) return G4NucleiPropertiesTable::GetBindingEnergy(Z,A);
else return BindingEnergy(A,Z);
}
}
static G4double GetNuclearMass(const G4double A, const G4double Z);
private:
static const G4double daTZ[NTZ];
// Calculate Mass Excess according to Cameron's liquid drop formula
// static G4double CameronMassExcess(const G4int A, const G4int Z);
static const G4double daTAZ[NTAZ];
static G4double AtomicMass(G4double Z, G4double A);
static G4double BindingEnergy(G4double A, G4double Z);
static G4double MassExcess(G4double A, G4double Z)
{return GetNuclearMass(A,Z) - A*amu_c2;}
//private:
// enum { TableSize = 200 };
// static const G4double SPZTable[TableSize];
// static const G4double SPNTable[TableSize];
};
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiPropertiesTable.hh,v 2.1 1998/11/18 09:46:04 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4NucleiPropertiesTable.hh,v 1.5 1999/05/26 14:05:15 larazb Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -28,6 +28,7 @@
//
// Migrate into particles category by H.Kurashige (17 Nov. 98)
// Subtract electron mass by H.Kurashige
// Avoid substraction of electron mass in Atomic masses by V.Lara (12 May 99)
// -------------------------------------------------------------------
#include "globals.hh"
@@ -65,61 +66,26 @@ public:
// Other Operations
// Operation: GetMassExcess
static inline G4double GetMassExcess(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) {
return MassExcess[i]*keV;
} else {
return 0.0;
}
}
static G4double GetMassExcess(G4int Z, G4int A);
// Operation: GetNuclearMass
static G4double GetNuclearMass(G4int Z, G4int A);
// Operation: GetBindingEnergy
static inline G4double GetBindingEnergy(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) return BindingEnergy[i]*keV;
else return 0.0;
}
static G4double GetBindingEnergy(G4int Z, G4int A);
// Operation: GetBetaDecayEnergy
static inline G4double GetBetaDecayEnergy(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) return BetaEnergy[i]*keV;
else return 0.0;
}
static G4double GetBetaDecayEnergy(G4int Z, G4int A);
// Operation: GetAtomicMass .. in Geant4 Energy units!
// subtract electron mass by H.K
static inline G4double GetAtomicMass(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) {
return AtomicMass[i]*amu_c2-Z*electron_mass_c2;
} else {
return 0.0;
}
}
static G4double GetAtomicMass(G4int Z, G4int A);
// Operation: GetName
static inline G4String GetName(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) return Name[i];
else return " ";
}
static const char*& GetName(G4int Z, G4int A);
// Is the nucleus (A,Z) in table?
static inline G4bool IsInTable(G4int Z, G4int A)
{
if (Z <= A && A >= 1 && A <= 273 && GetIndex(Z, A) >= 0) return true;
else return false;
}
static G4bool IsInTable(G4int Z, G4int A);
static G4int MaxZ(G4int A);
static G4int MinZ(G4int A);
@@ -160,7 +126,8 @@ private:
// Chemical Symbol
static G4String Name[nEntries];
static const char* Name[nEntries];
static const char* noName;
// Table of Z (number of protons) and A (number of nucleons)
@@ -176,8 +143,67 @@ private:
};
inline G4double G4NucleiPropertiesTable::GetMassExcess(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) {
return MassExcess[i]*keV;
} else {
return 0.0;
}
}
inline G4double G4NucleiPropertiesTable::GetBindingEnergy(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0){
return BindingEnergy[i]*keV;
} else {
return 0.0;
}
}
inline G4double G4NucleiPropertiesTable::GetBetaDecayEnergy(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0){
return BetaEnergy[i]*keV;
} else {
return 0.0;
}
}
inline G4double G4NucleiPropertiesTable::GetAtomicMass(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0) {
return AtomicMass[i]*amu_c2;
} else {
return 0.0;
}
}
inline const char*& G4NucleiPropertiesTable::GetName(G4int Z, G4int A)
{
G4int i=GetIndex(Z, A);
if (i >= 0){
return Name[i];
} else {
return noName;
}
}
inline G4bool G4NucleiPropertiesTable::IsInTable(G4int Z, G4int A)
{
return (Z <= A && A >= 1 && A <= 273 && GetIndex(Z, A) >= 0);
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleDefinition.hh,v 2.3 1998/10/28 01:21:11 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleDefinition.hh,v 1.3 1999/04/14 10:28:17 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -27,6 +27,7 @@
// change SetProcessManager as public H.Kurashige 06 June 1998
// added GetEnergyThreshold H.Kurashige 08 June 1998
// added ShortLived flag and ApplyCuts flag H.Kurashige 27 June 1998
// fixed some improper codings H.Kurashige 08 Apr. 1999
// ------------------------------------------------------------
#ifndef G4ParticleDefinition_h
@@ -93,8 +94,7 @@ class G4ParticleDefinition
void DumpTable() const;
// Prints information of data members.
G4ParticleTable *GetParticleTable() const
{ return theParticleTable; }
G4ParticleTable* GetParticleTable();
// get pointer to the particle table
public:
@@ -102,13 +102,12 @@ class G4ParticleDefinition
// to invoke corresponding methods for each particle type.
// Actual implementation can be seen in the class
// G4ParticleWithCuts
virtual void ResetCuts(){}
virtual void SetCuts(G4double ){}
virtual void ReCalcCuts(){}
virtual G4double GetLengthCuts() const {return -1.0;}
virtual G4double* GetEnergyCuts() const {return NULL;}
virtual G4double GetEnergyThreshold(const G4Material* ) const
{ return -1.0 * eV; }
virtual void ResetCuts();
virtual void SetCuts(G4double );
virtual void ReCalcCuts();
virtual G4double GetLengthCuts() const;
virtual G4double* GetEnergyCuts() const;
virtual G4double GetEnergyThreshold(const G4Material* ) const;
// applyCuts flag
G4bool GetApplyCutsFlag() const;
@@ -118,7 +117,7 @@ class G4ParticleDefinition
// By these following Getxxxx methods, you can get values
// for members which can not be changed
//
G4String GetParticleName() const { return theParticleName; }
const G4String& GetParticleName() const { return theParticleName; }
G4double GetPDGMass() const { return thePDGMass; }
G4double GetPDGWidth() const { return thePDGWidth; }
@@ -157,13 +156,16 @@ class G4ParticleDefinition
G4double GetPDGLifeTime() const { return thePDGLifeTime; }
void SetPDGLifeTime(G4double aLifeTime) { thePDGLifeTime = aLifeTime; }
public:
G4DecayTable* GetDecayTable() const { return theDecayTable; }
void SetDecayTable(G4DecayTable* aDecayTable)
{ theDecayTable=aDecayTable; }
G4DecayTable* GetDecayTable();
void SetDecayTable(G4DecayTable* aDecayTable);
// Set/Get Decay Table
// !! Decay Table can be modified !!
public:
G4ProcessManager* GetProcessManager() const;
void SetProcessManager(G4ProcessManager* aProcessManager);
// Set/Get Process Manager
// !! Process Manager can be modified !!
private:
// Values following can not be changed
@@ -285,6 +287,24 @@ class G4ParticleDefinition
G4int GetVerboseLevel() const;
};
inline
G4ParticleTable* G4ParticleDefinition::GetParticleTable()
{
return theParticleTable;
}
inline
G4DecayTable* G4ParticleDefinition::GetDecayTable()
{
return theDecayTable;
}
inline
void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
{
theDecayTable = aDecayTable;
}
inline
void G4ParticleDefinition::SetApplyCutsFlag(G4bool flag)
{
@@ -297,8 +317,6 @@ G4bool G4ParticleDefinition::GetApplyCutsFlag() const
return fApplyCutsFlag;
}
inline
void G4ParticleDefinition::SetVerboseLevel(G4int value)
{
@@ -310,6 +328,7 @@ G4int G4ParticleDefinition::GetVerboseLevel() const
{
return verboseLevel;
}
inline
G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
{
@@ -329,8 +348,8 @@ G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
return theQuarkContent[flavor-1];
}else {
if (verboseLevel >0) {
G4cerr << "Invalid Quark Flavor for G4ParticleDefinition::GetQuarkContent";
G4cerr << ": flavor=" << flavor <<endl;
G4cout << "Invalid Quark Flavor for G4ParticleDefinition::GetQuarkContent";
G4cout << ": flavor=" << flavor <<endl;
}
return 0;
}
@@ -343,13 +362,29 @@ G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
return theAntiQuarkContent[flavor-1];
}else {
if (verboseLevel >0) {
G4cerr <<"Invalid Quark Flavor for G4ParticleDefinition::GetAntiQuarkContent";
G4cerr << ": flavor=" << flavor <<endl;
G4cout <<"Invalid Quark Flavor for G4ParticleDefinition::GetAntiQuarkContent";
G4cout << ": flavor=" << flavor <<endl;
}
return 0;
}
}
inline void G4ParticleDefinition::ResetCuts(){}
inline void G4ParticleDefinition::SetCuts(G4double ){}
inline void G4ParticleDefinition::ReCalcCuts(){}
inline G4double G4ParticleDefinition::GetLengthCuts() const {return -1.0;}
inline G4double* G4ParticleDefinition::GetEnergyCuts() const {return 0;}
inline G4double G4ParticleDefinition::GetEnergyThreshold(const G4Material* ) const
{
return -1.0 * eV;
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleMessenger.hh,v 2.3 1998/11/25 13:58:47 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleMessenger.hh,v 1.2 1999/04/13 07:58:31 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -69,7 +69,7 @@ class G4UIcmdWithAnInteger;
class G4ParticleMessenger: public G4UImessenger
{
public:
G4ParticleMessenger(G4ParticleTable* pTable = NULL);
G4ParticleMessenger(G4ParticleTable* pTable = 0);
virtual ~G4ParticleMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleMomentum.hh,v 2.1 1998/07/13 17:18:10 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleMomentum.hh,v 1.2 1999/02/06 10:10:08 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -17,18 +17,26 @@
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// ------------------------------------------------------------
//
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// G4ParticleMomentum is "momentum direction" not "momentum vector"
// The name is miss-leading so you should not use G4ParticleMomentum
// and you are recommended to use G4ThreeVector instead
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#ifndef G4ParticleMomentum_h
#define G4ParticleMomentum_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
typedef G4ThreeVector G4ParticleMomentum;
// Is a three vector containing the momentum.
// Is a three vector containing the momentum direction.
// The momentum components are in global reference system.
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticlePropertyMessenger.hh,v 2.2 1998/07/12 03:43:10 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticlePropertyMessenger.hh,v 1.2 1999/04/13 07:58:32 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
//---------------------------------------------------------------
@@ -28,6 +28,7 @@
// 13 June 1997, H. Kurashige : The 1st version created.
// 13 Nov. 1997, H. Kurashige : fix bugs
// 08 Jan. 1998, H. Kurashige : new UIcommand
// 08 Apr. 1999, H. Kurashige : fix some improper codings
//
//---------------------------------------------------------------
@@ -50,11 +51,11 @@ class G4UIcmdWithAnInteger;
class G4ParticlePropertyMessenger: public G4UImessenger
{
public:
G4ParticlePropertyMessenger(G4ParticleTable* pTable = NULL);
~G4ParticlePropertyMessenger();
G4ParticlePropertyMessenger(G4ParticleTable* pTable = 0);
virtual ~G4ParticlePropertyMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
virtual G4String GetCurrentValue(G4UIcommand * command);
private:
G4ParticlePropertyMessenger(const G4ParticlePropertyMessenger&){};
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleTable.hh,v 2.7 1998/11/09 07:36:34 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleTable.hh,v 1.3 1999/04/23 00:48:01 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
// modified FindIon 02 Aug., 98 H.Kurashige
// added dictionary for encoding 24 Sep., 98 H.Kurashige
// added RemoveAllParticles() 8 Nov., 98 H.Kurashige
// fixed some improper codings 08 Apr., 99 H.Kurashige
#ifndef G4ParticleTable_h
#define G4ParticleTable_h 1
@@ -58,19 +58,15 @@ class G4ParticleTable
public:
virtual ~G4ParticleTable();
void RemoveAllParticles();
// remove all particles from G4ParticleTable and
// delete them if they were created dynamically (i.e. not static objects)
static G4ParticleTable* GetParticleTable();
// return the pointer to G4ParticleTable object
// G4ParticleTable is a "singleton" and can get its pointer by this function
// At the first time of calling this function, the G4ParticleTable object
// is instantiated
G4bool contains(const G4ParticleDefinition *particle) const;
G4bool contains(const G4String &particle_name) const;
G4bool contains(const G4ParticleDefinition *particle);
G4bool contains(const G4String &particle_name);
// returns TRUE if the ParticleTable contains
G4int entries() const;
@@ -80,18 +76,18 @@ class G4ParticleTable
// returns a pointer to i-th particles in the ParticleTable
// 0<= index < entries()
G4String GetParticleName(G4int index);
const G4String& GetParticleName(G4int index);
// returns name of i-th particles in the ParticleTable
G4ParticleDefinition* FindParticle(G4int PDGEncoding ) const;
G4ParticleDefinition* FindParticle(const G4String &particle_name) const;
G4ParticleDefinition* FindParticle(const G4ParticleDefinition *particle) const;
// returns a pointer to the particle (NULL if not contained)
G4ParticleDefinition* FindParticle(G4int PDGEncoding );
G4ParticleDefinition* FindParticle(const G4String &particle_name);
G4ParticleDefinition* FindParticle(const G4ParticleDefinition *particle);
// returns a pointer to the particle (0 if not contained)
G4ParticleDefinition* FindAntiParticle(G4int PDGEncoding ) const;
G4ParticleDefinition* FindAntiParticle(const G4String &particle_name) const;
G4ParticleDefinition* FindAntiParticle(const G4ParticleDefinition *particle) const;
// returns a pointer to its anti-particle (NULL if not contained)
G4ParticleDefinition* FindAntiParticle(G4int PDGEncoding );
G4ParticleDefinition* FindAntiParticle(const G4String &particle_name);
G4ParticleDefinition* FindAntiParticle(const G4ParticleDefinition *particle);
// returns a pointer to its anti-particle (0 if not contained)
G4ParticleDefinition* FindIon( G4int atomicNumber,
G4int atomicMass,
@@ -107,33 +103,44 @@ class G4ParticleTable
// insert the particle into ParticleTable
// return value is same as particle if successfully inserted
// or pointer to another G4ParticleDefinition object which has same name of particle
// or NULL if fail to insert by another reason
// or 0 if fail to insert by another reason
G4ParticleDefinition* Remove(G4ParticleDefinition *particle);
// Remove Particle
void DumpTable(const G4String &particle_name = "ALL") const;
void DumpTable(const G4String &particle_name = "ALL");
// dump information of particles specified by name
public:
G4String GetKey(const G4ParticleDefinition *particle) const;
G4PTblDictionary* GetDictionary() const;
G4PTblDicIterator* GetIterator() const;
G4PTblEncodingDictionary* GetEncodingDictionary() const;
const G4String& GetKey(const G4ParticleDefinition *particle) const;
G4IonTable* GetIonTable() const;
G4PTblDictionary* GetDictionary();
G4PTblDicIterator* GetIterator();
const G4PTblEncodingDictionary* GetEncodingDictionary();
// return the pointer to EncodingDictionary
const G4IonTable* GetIonTable();
// return the pointer to G4IonTable object
G4ShortLivedTable* GetShortLivedTable() const;
const G4ShortLivedTable* GetShortLivedTable();
// return the pointer to G4ShortLivedTable object
public:
G4UImessenger* CreateMessenger();
void DeleteMessenger();
G4UImessenger* CreateMessenger();
void DeleteMessenger();
// create/delete messenger for the particle table
protected:
void RemoveAllParticles();
// remove all particles from G4ParticleTable and
// delete them if they were created dynamically (i.e. not static objects)
protected:
static unsigned HashFun(const G4String& particle_name);
static unsigned EncodingHashFun(const G4int& aEndcoding);
// hash functions
private:
G4int verboseLevel;
// controle flag for output message
@@ -158,95 +165,114 @@ class G4ParticleTable
G4ShortLivedTable* fShortLivedTable;
};
inline G4ShortLivedTable* G4ParticleTable::GetShortLivedTable() const
inline
const G4ShortLivedTable* G4ParticleTable::GetShortLivedTable()
{
return fShortLivedTable;
}
inline G4IonTable* G4ParticleTable::GetIonTable() const
inline
const G4IonTable* G4ParticleTable::GetIonTable()
{
return fIonTable;
}
inline void G4ParticleTable::SetVerboseLevel(G4int value )
inline
void G4ParticleTable::SetVerboseLevel(G4int value )
{
verboseLevel = value;
}
inline G4int G4ParticleTable::GetVerboseLevel() const
inline
G4int G4ParticleTable::GetVerboseLevel() const
{
return verboseLevel;
}
inline G4ParticleTable::G4PTblDictionary* G4ParticleTable::GetDictionary() const
inline
G4ParticleTable::G4PTblDictionary* G4ParticleTable::GetDictionary()
{
return fDictionary;
}
inline G4ParticleTable::G4PTblDicIterator* G4ParticleTable::GetIterator() const
inline
G4ParticleTable::G4PTblDicIterator* G4ParticleTable::GetIterator()
{
return fIterator;
}
inline G4ParticleTable::G4PTblEncodingDictionary* G4ParticleTable::GetEncodingDictionary() const
inline
const G4ParticleTable::G4PTblEncodingDictionary* G4ParticleTable::GetEncodingDictionary()
{
return fEncodingDictionary;
}
inline G4String G4ParticleTable::GetKey(const G4ParticleDefinition *particle) const
inline
const G4String& G4ParticleTable::GetKey(const G4ParticleDefinition *particle) const
{
return particle->GetParticleName();
}
inline G4ParticleDefinition* G4ParticleTable::FindParticle(const G4String &particle_name) const
inline
G4ParticleDefinition* G4ParticleTable::FindParticle(const G4String &particle_name)
{
return GetDictionary() -> findValue(&particle_name);
return fDictionary -> findValue(&particle_name);
}
inline G4ParticleDefinition* G4ParticleTable::FindParticle(const G4ParticleDefinition *particle) const
inline
G4ParticleDefinition* G4ParticleTable::FindParticle(const G4ParticleDefinition *particle)
{
G4String key = GetKey(particle);
return GetDictionary() -> findValue( &key );
return fDictionary -> findValue( &key );
}
inline G4ParticleDefinition* G4ParticleTable::FindAntiParticle(G4int aPDGEncoding) const
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(G4int aPDGEncoding)
{
return FindParticle( FindParticle(aPDGEncoding)->GetAntiPDGEncoding() );
}
inline G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4String &particle_name) const
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4String& particle_name)
{
G4int pcode = FindParticle(particle_name) -> GetAntiPDGEncoding();
return FindParticle(pcode);
}
inline G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4ParticleDefinition *particle) const
inline
G4ParticleDefinition* G4ParticleTable::FindAntiParticle(const G4ParticleDefinition *particle)
{
G4int pcode = particle -> GetAntiPDGEncoding();
return FindParticle(pcode);
}
inline G4bool G4ParticleTable::contains(const G4String &particle_name) const
inline
G4bool G4ParticleTable::contains(const G4String& particle_name)
{
return GetDictionary() -> contains(&particle_name);
return fDictionary -> contains(&particle_name);
}
inline G4bool G4ParticleTable::contains(const G4ParticleDefinition *particle) const
inline G4bool G4ParticleTable::contains(const G4ParticleDefinition *particle)
{
G4String key = GetKey(particle);
return GetDictionary() -> contains(&key);
return fDictionary -> contains(&key);
}
inline G4String G4ParticleTable::GetParticleName(G4int index)
inline
const G4String& G4ParticleTable::GetParticleName(G4int index)
{
static G4String noName = "";
G4ParticleDefinition* aParticle =GetParticle(index);
G4String name = "";
if (aParticle != NULL) name = aParticle->GetParticleName();
return name;
if (aParticle != 0) {
return aParticle->GetParticleName();
} else {
return noName;
}
}
inline G4int G4ParticleTable::entries() const
{
return GetDictionary() -> entries();
return fDictionary -> entries();
}
@@ -255,10 +281,13 @@ inline unsigned G4ParticleTable::HashFun(const G4String& particle_name)
return particle_name.hash();
}
inline unsigned G4ParticleTable::EncodingHashFun(const G4int& aEncoding)
inline
unsigned G4ParticleTable::EncodingHashFun(const G4int& aEncoding)
{
if (aEncoding >0 ) return aEncoding*2;
else return abs(aEncoding)*2+1;
G4int temp = aEncoding;
if (aEncoding <0) temp *= -1;
G4int value = ( temp & 0x0FFF)*( temp & 0x0FFF)/2;
return value;
}
#endif
@@ -1,129 +0,0 @@
// 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: G4ParticleTypes.hh,v 2.2 1998/12/05 07:16:16 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// History: first implementation, based on object model of
// 4-th April 1996, G.Cosmo
// ----------------- G4ParticleTypes.hh -----------------
// Files including all existing particle definitions GEANT4 classes
// ****************************************************************
// Created, G.Cosmo, 19 September 1996
// Modified H.Kurashige 8 Mar. 1997
// Modified H.Kurashige 18 June 1997
// Moved from global/management, G.Cosmo, 1 December 1998
// ----------------------------------------------------------------
#ifndef G4ParticleTypes_h
#define G4ParticleTypes_h 1
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
// Leptons
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4TauMinus.hh"
#include "G4TauPlus.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4NeutrinoTau.hh"
#include "G4AntiNeutrinoTau.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
// Mesons
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4Eta.hh"
#include "G4EtaPrime.hh"
#include "G4RhoZero.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZero.hh"
#include "G4AntiKaonZero.hh"
#include "G4KaonZeroLong.hh"
#include "G4KaonZeroShort.hh"
#include "G4DMesonPlus.hh"
#include "G4DMesonMinus.hh"
#include "G4DMesonZero.hh"
#include "G4AntiDMesonZero.hh"
#include "G4DsMesonPlus.hh"
#include "G4DsMesonMinus.hh"
#include "G4JPsi.hh"
#include "G4BMesonPlus.hh"
#include "G4BMesonMinus.hh"
#include "G4BMesonZero.hh"
#include "G4AntiBMesonZero.hh"
#include "G4BsMesonZero.hh"
#include "G4AntiBsMesonZero.hh"
// Barions
#include "G4Proton.hh"
#include "G4AntiProton.hh"
#include "G4Neutron.hh"
#include "G4AntiNeutron.hh"
#include "G4Lambda.hh"
#include "G4SigmaPlus.hh"
#include "G4SigmaZero.hh"
#include "G4SigmaMinus.hh"
#include "G4XiMinus.hh"
#include "G4XiZero.hh"
#include "G4OmegaMinus.hh"
#include "G4AntiLambda.hh"
#include "G4AntiSigmaPlus.hh"
#include "G4AntiSigmaZero.hh"
#include "G4AntiSigmaMinus.hh"
#include "G4AntiXiMinus.hh"
#include "G4AntiXiZero.hh"
#include "G4AntiOmegaMinus.hh"
#include "G4LambdacPlus.hh"
#include "G4SigmacPlusPlus.hh"
#include "G4SigmacPlus.hh"
#include "G4SigmacZero.hh"
#include "G4XicPlus.hh"
#include "G4XicZero.hh"
#include "G4OmegacZero.hh"
#include "G4AntiLambdacPlus.hh"
#include "G4AntiSigmacPlusPlus.hh"
#include "G4AntiSigmacPlus.hh"
#include "G4AntiSigmacZero.hh"
#include "G4AntiXicPlus.hh"
#include "G4AntiXicZero.hh"
#include "G4AntiOmegacZero.hh"
// Nuclei
#include "G4Alpha.hh"
#include "G4Deuteron.hh"
#include "G4He3.hh"
#include "G4Triton.hh"
//ions
#include "G4GenericIon.hh"
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleWithCuts.hh,v 2.2 1998/07/13 17:18:15 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ParticleWithCuts.hh,v 1.3 1999/04/14 10:28:18 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -103,12 +103,12 @@ class G4ParticleWithCuts : public G4ParticleDefinition
virtual void SetCuts(G4double aCut);
// Set cut values in energy derived from the cut range of aCut
virtual G4double GetLengthCuts() const {return theCutInMaxInteractionLength;};
virtual G4double* GetEnergyCuts() const {return theKineticEnergyCuts;};
virtual G4double GetLengthCuts() const;
virtual G4double* GetEnergyCuts() const;
virtual G4double GetEnergyThreshold(const G4Material* aMaterial) const;
virtual G4double GetEnergyThreshold(const G4Material* aMaterial) const;
static void SetEnergyRange(G4double, G4double);
static void SetEnergyRange(G4double, G4double);
protected:
virtual void CalcEnergyCuts(G4double aCut);
@@ -167,10 +167,20 @@ class G4ParticleWithCuts : public G4ParticleDefinition
);
};
inline G4double G4ParticleWithCuts::GetLengthCuts() const
{
return theCutInMaxInteractionLength;
}
inline G4double* G4ParticleWithCuts::GetEnergyCuts() const
{
return theKineticEnergyCuts;
}
inline void G4ParticleWithCuts::ResetCuts()
{
if(theKineticEnergyCuts) delete [] theKineticEnergyCuts;
theKineticEnergyCuts = NULL;
theKineticEnergyCuts = 0;
}
inline void G4ParticleWithCuts::ReCalcCuts()
@@ -179,8 +189,8 @@ inline void G4ParticleWithCuts::ReCalcCuts()
CalcEnergyCuts(theCutInMaxInteractionLength);
} else {
if (GetVerboseLevel()>0) {
G4cerr << "G4ParticleWithCuts::ReCalcCuts() :";
G4cerr << "theCutInMaxInteractionLength is not defined " << endl;
G4cout << "G4ParticleWithCuts::ReCalcCuts() :";
G4cout << "theCutInMaxInteractionLength is not defined " << endl;
}
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhaseSpaceDecayChannel.hh,v 2.4 1998/11/18 09:46:05 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4PhaseSpaceDecayChannel.hh,v 1.1 1999/01/07 16:10:31 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ShortLivedTable.hh,v 2.2 1998/11/06 08:26:25 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4ShortLivedTable.hh,v 1.1 1999/01/07 16:10:31 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VDecayChannel.hh,v 2.4 1998/11/18 09:46:06 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
// $Id: G4VDecayChannel.hh,v 1.2 1999/04/13 07:58:35 kurasige Exp $
// GEANT4 tag $Name: geant4-00-01 $
//
//
// ------------------------------------------------------------
@@ -76,9 +76,9 @@ class G4VDecayChannel
G4ParticleDefinition * GetDaughter(G4int anIndex);
//get the name of the parent particle
G4String GetParentName() const;
G4String& GetParentName() const;
//get the name of a daughter particle
G4String GetDaughterName(G4int anIndex) const;
G4String& GetDaughterName(G4int anIndex) const;
// get mass of parent
G4double GetParentMass() const;
@@ -155,7 +155,7 @@ inline
G4ParticleDefinition* G4VDecayChannel::GetDaughter(G4int anIndex)
{
//pointers to daughter particles are filled, if they are not set yet
if (daughters == NULL) FillDaughters();
if (daughters == 0) FillDaughters();
//get the pointer to a daughter particle
if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
@@ -163,13 +163,14 @@ inline
} else {
if (verboseLevel>0)
G4cout << "G4VDecayChannel::GetDaughter index out of range "<<anIndex<<endl;
return NULL;
return 0;
}
}
inline
G4String G4VDecayChannel::GetDaughterName(G4int anIndex) const
G4String& G4VDecayChannel::GetDaughterName(G4int anIndex) const
{
static G4String noName = "";
if ( (anIndex>=0) && (anIndex<numberOfDaughters) ) {
return *daughters_name[anIndex];
} else {
@@ -177,7 +178,7 @@ inline
G4cout << "G4VDecayChannel::GetDaughterName ";
G4cout << "index out of range " << anIndex << endl;
}
return "";
return noName;
}
}
@@ -199,13 +200,13 @@ inline
G4ParticleDefinition* G4VDecayChannel::GetParent()
{
//the pointer to the parent particle is filled, if it is not set yet
if (parent == NULL) FillParent();
if (parent == 0) FillParent();
//get the pointer to the parent particle
return parent;
}
inline
G4String G4VDecayChannel::GetParentName() const
G4String& G4VDecayChannel::GetParentName() const
{
return *parent_name;
}
@@ -220,9 +221,9 @@ inline
inline
void G4VDecayChannel::SetParent(const G4String &particle_name)
{
if (parent_name != NULL) delete parent_name;
if (parent_name != 0) delete parent_name;
parent_name = new G4String(particle_name);
parent = NULL;
parent = 0;
}
inline