Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DalitzDecayChannel.hh,v 1.2.4.1 1999/12/07 20:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DalitzDecayChannel.hh,v 1.3 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayProducts.hh,v 1.4.4.1 1999/12/07 20:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayProducts.hh,v 1.5 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTable.hh,v 1.3.2.1 1999/12/07 20:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayTable.hh,v 1.5 2000/02/25 07:36:14 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -16,22 +16,30 @@
// CERN, CN Division, ASD group
// History: first implementation, based on object model of
// 7 July 1996 H.Kurashige
// 14 June 1997 H.Kurashige
//
// ----------------------------------------
// implementation for STL 14 Feb. 2000 H.Kurashige
//
// ------------------------------------------------------------
#ifndef G4DecayTable_h
#define G4DecayTable_h 1
#include "G4ios.hh"
#include "g4rw/tpsrtvec.h"
#include "g4std/vector"
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#include "G4VDecayChannel.hh"
class G4DecayTable
{
// Class Description
// G4DecayTable is the table of pointer to G4VDecayChannel.
// Decay channels inside is sorted by using decay branching ratio
//
public:
typedef G4RWTPtrSortedVector<G4VDecayChannel> G4VDecayChannelVector;
typedef G4std::vector<G4VDecayChannel*> G4VDecayChannelVector;
//constructors
public:
@@ -49,14 +57,22 @@ class G4DecayTable
G4int operator==(const G4DecayTable &right) const {return (this == &right);};
G4int operator!=(const G4DecayTable &right) const {return (this != &right);};
public:
public: // With Description
void Insert( G4VDecayChannel* aChannel);
G4int entries() const;
// Insert a decay channel at proper position
// (i.e. sorted by using branching ratio )
public:
G4int entries() const;
// Returns number of decay channels inside
public: // With Description
G4VDecayChannel* SelectADecayChannel();
// A decay channel is selected at random according to the branching ratio
G4VDecayChannel* GetDecayChannel(G4int index) const;
G4VDecayChannel* operator[](G4int index);
// Get index-th Decay channel
void DumpInfo() const;
private:
@@ -67,21 +83,22 @@ class G4DecayTable
inline
G4int G4DecayTable::entries() const
{
return channels->entries();
return channels->size();
}
inline
G4VDecayChannel* G4DecayTable::operator[](G4int index)
{
return (*channels)(index);
return (*channels)[index];
}
inline
G4VDecayChannel* G4DecayTable::GetDecayChannel(G4int index) const
{
G4VDecayChannel* selectedChannel = 0;
if ( (index>=0) && (index<channels->entries()) ){
selectedChannel = (*channels)(index);
if ( (index>=0) && (index<channels->size()) ){
selectedChannel = (*channels)[index];
}
return selectedChannel;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTableMessenger.hh,v 1.3.4.1 1999/12/07 20:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayTableMessenger.hh,v 1.4 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticle.hh,v 1.5.4.1 1999/12/07 20:49:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DynamicParticle.hh,v 1.6 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticle.icc,v 1.2.4.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DynamicParticle.icc,v 1.3 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticleFastVector.hh,v 1.1.10.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DynamicParticleFastVector.hh,v 1.2 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ElectronOccupancy.hh,v 1.3.4.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ElectronOccupancy.hh,v 1.4 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonTable.hh,v 1.13.2.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4IonTable.hh,v 1.15 2000/02/25 07:36:14 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -31,11 +31,7 @@
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#ifdef G4USE_STL
#include "g4std/vector"
#else
#include "g4rw/tpordvec.h"
#endif
class G4ParticleTable;
class G4VIsotopeTable;
@@ -49,13 +45,8 @@ class G4IonTable
//
public:
#ifdef G4USE_STL
// Use STL Vector as list of ions
typedef G4std::vector<G4ParticleDefinition*> G4IonList;
#else
// Use G4RWTPtrOrderedVector as list of ions
typedef G4RWTPtrOrderedVector<G4ParticleDefinition> G4IonList;
#endif
public:
// constructor
@@ -169,24 +160,16 @@ class G4IonTable
inline G4bool G4IonTable::Contains(const G4ParticleDefinition* particle) const
{
#ifdef G4USE_STL
G4IonList::iterator i;
for (i = fIonList->begin(); i!= fIonList->end(); ++i) {
if (**i==*particle) return true;
}
return false;
#else
return fIonList->contains(particle);
#endif
}
inline G4int G4IonTable::Entries() const
{
#ifdef G4USE_STL
return fIonList->size();
#else
return fIonList->entries();
#endif
}
inline G4ParticleDefinition* G4IonTable::GetParticle(G4int index) const
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Ions.hh,v 1.5.4.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4Ions.hh,v 1.6 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4IsotopeProperty.hh,v 1.2 1999/10/28 23:24:10 kurasige Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4KL3DecayChannel.hh,v 1.2.4.1 1999/12/07 20:49:50 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4KL3DecayChannel.hh,v 1.3 1999/12/15 14:51:10 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MuonDecayChannel.hh,v 1.2.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4MuonDecayChannel.hh,v 1.4 2000/02/25 07:36:15 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -26,6 +26,13 @@
class G4MuonDecayChannel :public G4VDecayChannel
{
// Class Decription
// This class describes muon decay kinemtics.
// This version neglects muon polarization
// assumes the pure V-A coupling
// gives incorrect energy spectrum for neutrinos
//
public: // With Description
//Constructors
G4MuonDecayChannel(const G4String& theParentName,
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiProperties.hh,v 1.8.4.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NucleiProperties.hh,v 1.10 2000/02/04 03:05:09 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -32,18 +32,19 @@
class G4NucleiProperties
{
private:
// Class Description
// G4NucleiProperties is an utility class to provide mass formula of nuclei
// (i.e. it has static member function only)
// Default constructor (singleton)
G4NucleiProperties();
static G4NucleiProperties theInstance;
public:
public:
// Destructor
~G4NucleiProperties() { };
// Default constructor ()
G4NucleiProperties(){};
public: // With Description
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiPropertiesTable.hh,v 1.7.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NucleiPropertiesTable.hh,v 1.8 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PDGCodeChecker.hh,v 1.4.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PDGCodeChecker.hh,v 1.5 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleDefinition.hh,v 1.5.4.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleDefinition.hh,v 1.7 2000/02/25 07:36:15 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -28,6 +28,7 @@
// 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
// added sub-type H.Kurashige 15 Feb. 2000
// ------------------------------------------------------------
#ifndef G4ParticleDefinition_h
@@ -116,7 +117,8 @@ class G4ParticleDefinition
G4int GetPDGiIsospin3() const { return thePDGiIsospin3; }
G4int GetPDGiGParity() const { return thePDGiGParity; }
G4String GetParticleType() const { return theParticleType; }
const G4String& GetParticleType() const { return theParticleType; }
const G4String& GetParticleSubType() const { return theParticleSubType; }
G4int GetLeptonNumber() const { return theLeptonNumber; }
G4int GetBaryonNumber() const { return theBaryonNumber; }
@@ -166,6 +168,8 @@ class G4ParticleDefinition
// It means error if the return value is deffernt from
// this->thePDGEncoding.
void SetParticleSubType(const G4String& subtype);
public:
void SetVerboseLevel(G4int value);
G4int GetVerboseLevel() const;
@@ -242,6 +246,10 @@ class G4ParticleDefinition
G4String theParticleType;
// More general textual type description of the particle.
G4String theParticleSubType;
// Textual type description of the particle
// eg. pion, lamda etc.
G4int thePDGEncoding;
// The Particle Data Group integer identifier of this particle
@@ -373,6 +381,11 @@ G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
}
}
inline void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
{
theParticleSubType = subtype;
}
inline void G4ParticleDefinition::ResetCuts(){}
inline void G4ParticleDefinition::SetCuts(G4double ){}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleMessenger.hh,v 1.3.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleMessenger.hh,v 1.4 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleMomentum.hh,v 1.3.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleMomentum.hh,v 1.4 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticlePropertyMessenger.hh,v 1.3.4.1 1999/12/07 20:49:51 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticlePropertyMessenger.hh,v 1.4 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleTable.hh,v 1.12.2.1 1999/12/07 20:49:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleTable.hh,v 1.14 2000/02/25 07:36:15 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -35,12 +35,9 @@
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#ifdef G4USE_STL
#include "g4std/map"
#include "G4ParticleTableIterator.hh"
#else
#include "g4rw/tphdict.h"
#endif
class G4UImessenger;
class G4ParticleMessenger;
@@ -58,17 +55,11 @@ class G4ParticleTable
//
public:
#ifdef G4USE_STL
typedef G4ParticleTableIterator<G4String, G4ParticleDefinition*>::Map G4PTblDictionary;
typedef G4ParticleTableIterator<G4String, G4ParticleDefinition*> G4PTblDicIterator;
typedef G4ParticleTableIterator<G4int, G4ParticleDefinition*>::Map G4PTblEncodingDictionary;
typedef G4ParticleTableIterator<G4int, G4ParticleDefinition*> G4PTblEncodingDicIterator;
#else
typedef G4RWTPtrHashDictionary<G4String,G4ParticleDefinition> G4PTblDictionary;
typedef G4RWTPtrHashDictionaryIterator<G4String,G4ParticleDefinition> G4PTblDicIterator;
typedef G4RWTPtrHashDictionary<G4int,G4ParticleDefinition> G4PTblEncodingDictionary;
typedef G4RWTPtrHashDictionaryIterator<G4int,G4ParticleDefinition> G4PTblEncodingDicIterator;
#endif
protected:
G4ParticleTable();
@@ -174,13 +165,6 @@ class G4ParticleTable
// remove all particles from G4ParticleTable and
// delete them if they were created dynamically (i.e. not static objects)
#ifndef G4USE_STL
protected:
static unsigned HashFun(const G4String& particle_name);
static unsigned EncodingHashFun(const G4int& aEndcoding);
// hash functions
#endif
private:
G4int verboseLevel;
// controle flag for output message
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleTable.icc,v 1.5.4.1 1999/12/07 20:49:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleTable.icc,v 1.7 2000/02/25 07:36:15 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -64,16 +64,12 @@ inline
inline
G4ParticleDefinition* G4ParticleTable::FindParticle(const G4String &particle_name)
{
#ifdef G4USE_STL
G4PTblDictionary::iterator it = fDictionary->find(particle_name);
if (it != fDictionary->end()) {
return (*it).second;
}else {
return 0;
}
#else
return fDictionary -> findValue(&particle_name);
#endif
}
@@ -100,12 +96,8 @@ inline
inline
G4bool G4ParticleTable::contains(const G4String& particle_name)
{
#ifdef G4USE_STL
G4PTblDictionary::iterator it = fDictionary->find(particle_name);
return (it != fDictionary->end());
#else
return fDictionary -> contains(&particle_name);
#endif
}
inline
@@ -128,35 +120,12 @@ inline
inline
G4int G4ParticleTable::entries() const
{
#ifdef G4USE_STL
return fDictionary->size();
#else
return fDictionary -> entries();
#endif
}
inline
G4int G4ParticleTable::size() const
{
#ifdef G4USE_STL
return fDictionary->size();
#else
return fDictionary -> entries();
#endif
}
#ifndef G4USE_STL
inline unsigned G4ParticleTable::HashFun(const G4String& particle_name)
{
return particle_name.hash();
}
inline
unsigned G4ParticleTable::EncodingHashFun(const G4int& aEncoding)
{
G4int temp = aEncoding;
if (aEncoding <0) temp *= -1;
G4int value = ( temp & 0x0FFF)*( temp & 0x0FFF)/2;
return value;
}
#endif
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleTableIterator.hh,v 1.2.4.1.2.1 1999/12/09 10:28:49 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleTableIterator.hh,v 1.3 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleWithCuts.hh,v 1.4.4.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleWithCuts.hh,v 1.5 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhaseSpaceDecayChannel.hh,v 1.2.4.1 1999/12/07 20:49:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PhaseSpaceDecayChannel.hh,v 1.3 1999/12/15 14:51:11 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ShortLivedTable.hh,v 1.7.2.1 1999/12/07 20:49:52 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ShortLivedTable.hh,v 1.9 2000/02/25 07:36:15 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -26,12 +26,7 @@
#include "globals.hh"
#include "G4ParticleDefinition.hh"
#ifdef G4USE_STL
#include "g4std/vector"
#else
#include "g4rw/tpordvec.h"
#endif
class G4ParticleTable;
@@ -43,13 +38,8 @@ class G4ShortLivedTable
//
public:
#ifdef G4USE_STL
// Use STL Vector as list of shortlives
typedef G4std::vector<G4ParticleDefinition*> G4ShortLivedList;
#else
// Use G4RWTPtrOrderedVector as list of shortlives
typedef G4RWTPtrOrderedVector<G4ParticleDefinition> G4ShortLivedList;
#endif
public:
G4ShortLivedTable();
@@ -57,7 +47,7 @@ class G4ShortLivedTable
protected:
G4ShortLivedTable(const G4ShortLivedTable &right);
public:
public: // With Description
virtual ~G4ShortLivedTable();
G4bool IsShortLived(G4ParticleDefinition*) const;
@@ -82,28 +72,21 @@ class G4ShortLivedTable
inline G4bool G4ShortLivedTable::Contains(const G4ParticleDefinition* particle) const
{
#ifdef G4USE_STL
G4ShortLivedList::iterator i;
for (i = fShortLivedList->begin(); i!= fShortLivedList->end(); ++i) {
if (**i==*particle) return true;
}
return false;
#else
return fShortLivedList->contains(particle);
#endif
}
inline G4int G4ShortLivedTable::Entries() const
{
#ifdef G4USE_STL
return fShortLivedList->size();
#else
return fShortLivedList->entries();
#endif
}
inline G4ParticleDefinition* G4ShortLivedTable::GetParticle(G4int index) const
inline
G4ParticleDefinition* G4ShortLivedTable::GetParticle(G4int index) const
{
if ( (index >=0 ) && (index < Entries()) ) {
return (*fShortLivedList)[index];
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VDecayChannel.hh,v 1.5.4.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4VDecayChannel.hh,v 1.7 2000/03/23 16:43:41 hweber Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -17,6 +17,7 @@
// History: first implementation, based on object model of
// 27 July 1996 H.Kurashige
// 30 May 1997 H.Kurashige
// 23 Mar. 2000 H.Weber : add GetAngularMomentum()
// ------------------------------------------------------------
#ifndef G4VDecayChannel_h
#define G4VDecayChannel_h 1
@@ -78,6 +79,8 @@ class G4VDecayChannel
//get the pointer to a daughter particle
G4ParticleDefinition * GetDaughter(G4int anIndex);
//get the angular momentum of the decay
G4int GetAngularMomentum();
//get the name of the parent particle
const G4String& GetParentName() const;
//get the name of a daughter particle
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VIsotopeTable.hh,v 1.2 1999/10/28 23:24:14 kurasige Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4VIsotopeTable.hh,v 1.3 2000/01/26 10:52:04 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -40,6 +40,7 @@ class G4VIsotopeTable
public: // With Description
// pure virtual method
virtual G4bool FindIsotope(G4IsotopeProperty* property) = 0;
virtual G4IsotopeProperty* GetIsotope(G4int Z, G4int A, G4double E) = 0;
// Search the isotope in the G4VIsotopeTable.
// The isotope is desingated by
// G4int Z: number of proton (Atomic number)
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DalitzDecayChannel.cc,v 1.3.8.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DalitzDecayChannel.cc,v 1.4 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayProducts.cc,v 1.4.8.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayProducts.cc,v 1.5 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
+39 -28
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTable.cc,v 1.4.8.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayTable.cc,v 1.6 2000/02/25 07:36:23 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -15,8 +15,9 @@
// For information related to this code contact:
// CERN, CN Division, ASD group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// 27 July 1996 H.Kurashige
// ----------------------------------------
// implementation for STL 14 Feb. 2000 H.Kurashige
// ------------------------------------------------------------
#include "globals.hh"
@@ -30,8 +31,14 @@ G4DecayTable::G4DecayTable():parent(0)
G4DecayTable::~G4DecayTable()
{
channels->clearAndDestroy();
delete channels;
// remove and delete all contents
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
delete (*i);
}
channels->clear();
delete channels;
channels = 0;
}
void G4DecayTable::Insert( G4VDecayChannel * aChannel){
@@ -43,43 +50,47 @@ void G4DecayTable::Insert( G4VDecayChannel * aChannel){
G4cout << " input:" << aChannel->GetParent()->GetParticleName() << G4endl;
#endif
} else {
channels->insert(aChannel);
G4double r = aChannel->GetBR();
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
if (r > (*i)->GetBR()) {
channels->insert(i,aChannel);
return;
}
}
channels->push_back(aChannel);
}
}
G4VDecayChannel *G4DecayTable::SelectADecayChannel()
{
// make cumlative table for branching ratio
G4double sumBR = 0.0;
G4int index;
G4int numberofchannels = channels->entries();
G4double *cumBR = new G4double[numberofchannels];
for (index=numberofchannels-1; index >=0 ; index--) {
sumBR += ((*channels)(index))->GetBR();
cumBR[index] = sumBR;
}
// check if contents exist
if (channels->size()<1) return 0;
// select decay channel
G4double r = sumBR* G4UniformRand();
G4VDecayChannel *channel;
for (index= numberofchannels-1; index >=0 ; index--) {
if (r < cumBR[index]) {
channel = (*channels)(index);
break;
while (1) {
G4double sumBR = 0.0;
G4double r= G4UniformRand();
// select decay channel
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
sumBR += (*i)->GetBR();
if (r < sumBR) {
return (*i);
}
}
}
delete [] cumBR;
return channel;
return 0;
}
void G4DecayTable::DumpInfo() const
{
G4cout << "G4DecayTable: " << parent->GetParticleName() << G4endl;
G4int numberofchannels = channels->entries();
for (G4int index= numberofchannels -1; index >=0 ; index -=1)
{
G4int index =0;
G4VDecayChannelVector::iterator i;
for (i = channels->begin(); i!= channels->end(); ++i) {
G4cout << index << ": ";
((*channels)(index))->DumpInfo();
(*i)->DumpInfo();
index +=1;
}
G4cout << G4endl;
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DecayTableMessenger.cc,v 1.2.8.1.2.3 1999/12/14 07:08:14 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DecayTableMessenger.cc,v 1.3 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4DynamicParticle.cc,v 1.5.6.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4DynamicParticle.cc,v 1.6 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ElectronOccupancy.cc,v 1.4.6.1.2.1 1999/12/08 17:34:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ElectronOccupancy.cc,v 1.5 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ----------------------------------------------------------------------
+10 -47
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IonTable.cc,v 1.22.4.6 1999/12/14 09:16:47 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4IonTable.cc,v 1.25 2000/02/25 07:36:23 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -61,15 +61,9 @@ G4IonTable::~G4IonTable()
// delete ion objects
G4ParticleDefinition* particle;
#ifdef G4USE_STL
G4IonList::reverse_iterator i;
for (i = fIonList->rbegin(); i!= fIonList->rend(); ++i) {
particle = *i;
#else
G4int idx;
for (idx=(fIonList->entries()-1); idx >=0 ; idx--) {
particle = (*fIonList)(idx);
#endif
if ( !IsLightIon(particle) ) {
// delete if not static objects
@@ -114,6 +108,7 @@ G4ParticleDefinition* G4IonTable::CreateIon(G4int Z, G4int A, G4double E, G4int
G4double life = -1.0;
G4DecayTable* decayTable =0;
G4bool stable = true;
G4IsotopeProperty* fProperty = FindIsotope(Z, A, E, J);
if (fProperty !=0 ){
@@ -122,7 +117,7 @@ G4ParticleDefinition* G4IonTable::CreateIon(G4int Z, G4int A, G4double E, G4int
life = fProperty->GetLifeTime();
decayTable = fProperty->GetDecayTable();
}
stable = (life <= 0.);
G4double mass = GetNucleusMass(Z, A)+ E;
G4double charge = G4double(Z)*eplus;
@@ -133,7 +128,10 @@ G4ParticleDefinition* G4IonTable::CreateIon(G4int Z, G4int A, G4double E, G4int
J, +1, 0,
0, 0, 0,
"nucleus", 0, A, 0,
true, life, decayTable);
stable, life, decayTable);
// Set Excitation Energy
((G4Ions*)(ion))->SetExcitationEnergy(E);
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
@@ -209,15 +207,9 @@ G4ParticleDefinition* G4IonTable::FindIon(G4int Z, G4int A, G4double E, G4int J)
G4bool isFound = false;
// -- loop over all particles in Ion table
#ifdef G4USE_STL
G4IonList::iterator idx;
for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
ion = *idx;
#else
G4int idx;
for (idx= 0; idx < fIonList->entries() ; ++idx) {
ion = (*fIonList)(idx);
#endif
// Z = Atomic Number
G4int anAtomicNumber = 0;
@@ -373,11 +365,7 @@ G4double G4IonTable::GetIonMass(G4int Z, G4int A) const
void G4IonTable::Insert(G4ParticleDefinition* particle)
{
if (IsIon(particle)) {
#ifdef G4USE_STL
fIonList->push_back(particle);
#else
fIonList->insert(particle);
#endif
} else {
//#ifdef G4VERBOSE
//if (GetVerboseLevel()>0) {
@@ -392,17 +380,12 @@ void G4IonTable::Insert(G4ParticleDefinition* particle)
void G4IonTable::Remove(G4ParticleDefinition* particle)
{
if (IsIon(particle)) {
#ifdef G4USE_STL
G4IonList::iterator idx;
for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
if ( particle == *idx) {
fIonList->erase(idx);
}
}
#else
fIonList->remove(particle);
#endif
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
@@ -422,14 +405,9 @@ void G4IonTable::Remove(G4ParticleDefinition* particle)
void G4IonTable::DumpTable(const G4String &particle_name) const
{
G4ParticleDefinition* ion;
#ifdef G4USE_STL
G4IonList::iterator idx;
for (idx = fIonList->begin(); idx!= fIonList->end(); ++idx) {
ion = *idx;
#else
for (G4int idx= 0; idx < fIonList->entries() ; idx++) {
ion = (*fIonList)(idx);
#endif
if (( particle_name == "ALL" ) || (particle_name == "all")){
ion->DumpTable();
} else if ( particle_name == ion->GetParticleName() ) {
@@ -543,25 +521,10 @@ G4VIsotopeTable* G4IonTable::GetIsotopeTable() const
////////////////////
G4IsotopeProperty* G4IonTable::FindIsotope(G4int Z, G4int A, G4double E, G4int J)
{
G4IsotopeProperty* fProperty = new G4IsotopeProperty();
// Set Isotope Property
fProperty->SetAtomicNumber(Z);
fProperty->SetAtomicMass(A);
fProperty->SetEnergy(E);
fProperty->SetiSpin(J);
fProperty->SetLifeTime(-1.0);
fProperty->SetDecayTable(0);
if (fIsotopeTable ==0) return 0;
// ask IsotopeTable
if (fIsotopeTable->FindIsotope(fProperty)) {
return fProperty;
} else {
delete fProperty;
return 0;
}
// ask IsotopeTable // ask IsotopeTable
return fIsotopeTable->GetIsotope(Z,A,E);
}
+2 -2
View File
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4Ions.cc,v 1.3.6.1.2.2 1999/12/14 07:08:14 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4Ions.cc,v 1.4 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ----------------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4IsotopeProperty.cc,v 1.1.8.4 1999/12/14 07:08:14 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4IsotopeProperty.cc,v 1.2 1999/12/15 14:51:12 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ----------------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4KL3DecayChannel.cc,v 1.3.8.1.2.1 1999/12/08 17:34:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4KL3DecayChannel.cc,v 1.4 1999/12/15 14:51:13 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4MuonDecayChannel.cc,v 1.4.8.1.2.1 1999/12/08 17:34:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4MuonDecayChannel.cc,v 1.6 2000/02/25 07:36:24 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -32,13 +32,6 @@ G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
G4double theBR)
:G4VDecayChannel("Muon Decay",1)
{
//#ifdef G4VERBOSE
//if (GetVerboseLevel()>1) {
// G4cout << "G4MuonDecayChannel:: constructor ";
// G4cout << "addr[" << this << "]" << G4endl;
//}
//#endif
// set names for daughter particles
if (theParentName == "mu+") {
SetBR(theBR);
@@ -55,13 +48,13 @@ G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
SetDaughter(1, "anti_nu_e");
SetDaughter(2, "nu_mu");
} else {
//#ifdef G4VERBOSE
// if (GetVerboseLevel()>0) {
// G4cout << "G4MuonDecayChannel:: constructor :";
// G4cout << " parent particle is not muon but ";
// G4cout << theParentName << G4endl;
// }
//#endif
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4MuonDecayChannel:: constructor :";
G4cout << " parent particle is not muon but ";
G4cout << theParentName << G4endl;
}
#endif
}
}
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiProperties.cc,v 1.5.6.1.2.1 1999/12/08 17:34:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NucleiProperties.cc,v 1.6 1999/12/15 14:51:13 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiPropertiesTableA.cc,v 1.4.6.1 1999/12/07 20:49:56 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NucleiPropertiesTableA.cc,v 1.5 1999/12/15 14:51:13 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4NucleiPropertiesTableB.cc,v 1.3.6.1 1999/12/07 20:49:57 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4NucleiPropertiesTableB.cc,v 1.4 1999/12/15 14:51:14 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// -------------------------------------------------------------------
// GEANT 4 class file --- Copyright CERN 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PDGCodeChecker.cc,v 1.2.6.1.2.3 1999/12/14 07:08:15 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PDGCodeChecker.cc,v 1.3 1999/12/15 14:51:14 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ----------------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleDefinition.cc,v 1.6.6.1.2.1 1999/12/08 17:34:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleDefinition.cc,v 1.9 2000/02/27 06:44:29 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -72,6 +72,7 @@ G4ParticleDefinition::G4ParticleDefinition(
thePDGIsospin(iIsospin*0.5),
thePDGIsospin3(iIsospin3*0.5),
theParticleType(pType),
theParticleSubType(""),
theLeptonNumber(lepton),
theBaryonNumber(baryon),
thePDGEncoding(encoding),
@@ -214,7 +215,8 @@ void G4ParticleDefinition::DumpTable() const
G4cout << ", " << theAntiQuarkContent[5] << G4endl;
G4cout << " Lepton number : " << theLeptonNumber;
G4cout << " Baryon number : " << theBaryonNumber << G4endl;
G4cout << " Particle type : " << theParticleType << G4endl;
G4cout << " Particle type : " << theParticleType ;
G4cout << " [" << theParticleSubType << "]" << G4endl;
if ( fShortLivedFlag ){
G4cout << " ShortLived : ON" << G4endl;
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleMessenger.cc,v 1.3.6.1.2.3 1999/12/14 07:08:15 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleMessenger.cc,v 1.4 1999/12/15 14:51:14 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticlePropertyMessenger.cc,v 1.2.8.1.2.3 1999/12/14 07:08:15 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticlePropertyMessenger.cc,v 1.3 1999/12/15 14:51:14 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
//---------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleTable.cc,v 1.14.4.1.2.1 1999/12/08 17:34:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleTable.cc,v 1.16 2000/02/25 07:36:24 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
// class G4ParticleTable
//
@@ -37,24 +37,13 @@
#include "G4IonTable.hh"
#include "G4ShortLivedTable.hh"
#ifndef G4USE_STL
const G4int G4ParticleTableDefaultBucket = 32;
const G4int G4ParticleTableMaxInABucket = 64;
#endif
////////////////////
G4ParticleTable::G4ParticleTable():verboseLevel(0),fParticleMessenger(0),noName(" ")
{
#ifdef G4USE_STL
fDictionary = new G4PTblDictionary();
fIterator = new G4PTblDicIterator( *fDictionary );
fEncodingDictionary = new G4PTblEncodingDictionary();
#else
DictionaryBucketSize = G4ParticleTableDefaultBucket;
fDictionary = new G4PTblDictionary(G4ParticleTable::HashFun,DictionaryBucketSize);
fIterator = new G4PTblDicIterator( *fDictionary );
fEncodingDictionary = new G4PTblEncodingDictionary(G4ParticleTable::EncodingHashFun,DictionaryBucketSize);
#endif
// Ion Table
fIonTable = new G4IonTable();
@@ -211,29 +200,13 @@ G4ParticleDefinition* G4ParticleTable::Insert(G4ParticleDefinition *particle)
G4PTblDictionary *pdic = fDictionary;
G4PTblEncodingDictionary *pedic = fEncodingDictionary;
#ifdef G4USE_STL
(*pdic)[GetKey(particle)] = particle;
// insert into EncodingDictionary
G4int code = particle->GetPDGEncoding();
if (code !=0 ) {
(*pedic)[code] = particle;
}
#else
pdic -> insertKeyAndValue(new G4String(GetKey(particle)), particle);
// if HashDictionary get too big, rehash all of the key
if (pdic -> entries() > G4ParticleTableMaxInABucket*DictionaryBucketSize) {
DictionaryBucketSize *= 2;
pdic -> resize(DictionaryBucketSize);
G4PTblDicIterator *piter = fIterator;
piter -> reset();
}
// insert into EncodingDictionary
G4int code = particle->GetPDGEncoding();
if (code !=0 ) {
pedic -> insertKeyAndValue(new G4int(code), particle);
}
#endif
// insert it in IonTable if "nucleus"
if (fIonTable->IsIon(particle) ){
fIonTable->Insert(particle);
@@ -253,8 +226,6 @@ G4ParticleDefinition* G4ParticleTable::Insert(G4ParticleDefinition *particle)
////////////////////
G4ParticleDefinition* G4ParticleTable::Remove(G4ParticleDefinition* particle)
{
#ifdef G4USE_STL
G4PTblDictionary::iterator it = fDictionary->find(GetKey(particle));
if (it != fDictionary->end()) {
fDictionary->erase(it);
@@ -266,20 +237,7 @@ G4ParticleDefinition* G4ParticleTable::Remove(G4ParticleDefinition* particle)
} else {
return 0;
}
#else
if (! contains(particle) ) return 0;
G4String particle_name = GetKey(particle);
fDictionary->remove(&particle_name );
// remove from EncodingDictionary
G4int code = particle->GetPDGEncoding();
if (code !=0 ) {
G4PTblEncodingDictionary *pedic = fEncodingDictionary;
pedic -> remove(&code);
}
#endif
// remove it from IonTable if "nucleus"
if (fIonTable->IsIon(particle) ){
fIonTable->Remove(particle);
@@ -361,14 +319,11 @@ G4ParticleDefinition* G4ParticleTable::FindParticle(G4int aPDGEncoding )
G4PTblEncodingDictionary *pedic = fEncodingDictionary;
G4ParticleDefinition* particle =0;
#ifdef G4USE_STL
G4PTblEncodingDictionary::iterator it = pedic->find(aPDGEncoding );
if (it != pedic->end()) {
particle = (*it).second;
}
#else
particle = pedic -> findValue( &aPDGEncoding );
#endif
#ifdef G4VERBOSE
if ((particle == 0) && (verboseLevel>0) ){
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ParticleWithCuts.cc,v 1.5.8.1.2.5 1999/12/14 09:16:48 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ParticleWithCuts.cc,v 1.6 1999/12/15 14:51:14 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.3.8.1.2.1 1999/12/08 17:34:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4PhaseSpaceDecayChannel.cc,v 1.4 1999/12/15 14:51:15 gunter Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4ShortLivedTable.cc,v 1.7.4.1.2.5 1999/12/14 09:16:48 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4ShortLivedTable.cc,v 1.9 2000/02/25 07:36:24 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// --------------------------------------------------------------
@@ -37,15 +37,11 @@ G4ShortLivedTable::~G4ShortLivedTable()
{
if (fShortLivedList ==0) return;
// remove all contents in the short lived List and delete all particles
#ifdef G4USE_STL
G4ShortLivedList::iterator i;
for (i = fShortLivedList->begin(); i!= fShortLivedList->end(); ++i) {
delete (*i);
}
fShortLivedList->clear();
#else
fShortLivedList->clearAndDestroy();
#endif
delete fShortLivedList;
fShortLivedList =0;
}
@@ -63,35 +59,19 @@ G4bool G4ShortLivedTable::IsShortLived(G4ParticleDefinition* particle) const
void G4ShortLivedTable::Insert(G4ParticleDefinition* particle)
{
if (IsShortLived(particle)) {
#ifdef G4USE_STL
fShortLivedList->push_back(particle);
#else
fShortLivedList->insert(particle);
#endif
} else {
//#ifdef G4VERBOSE
//if (GetVerboseLevel()>0) {
// G4cout << "G4ShortLivedTable::Insert :" << particle->GetParticleName() ;
// G4cout << " is not short lived" << G4endl;
//}
//#endif
}
}
}
void G4ShortLivedTable::Remove(G4ParticleDefinition* particle)
{
if (IsShortLived(particle)) {
#ifdef G4USE_STL
G4ShortLivedList::iterator idx;
for (idx = fShortLivedList->begin(); idx!= fShortLivedList->end(); ++idx) {
if ( particle == *idx) {
fShortLivedList->erase(idx);
}
}
#else
fShortLivedList->remove(particle);
#endif
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
@@ -107,15 +87,9 @@ void G4ShortLivedTable::DumpTable(const G4String &particle_name) const
{
G4ParticleDefinition* particle;
#ifdef G4USE_STL
G4ShortLivedList::iterator idx;
for (idx = fShortLivedList->begin(); idx!= fShortLivedList->end(); ++idx) {
particle = *idx;
#else
for (G4int idx= 0; idx < fShortLivedList->entries() ; idx++) {
particle = (*fShortLivedList)(idx);
#endif
if (( particle_name == "ALL" ) || (particle_name == "all")){
particle->DumpTable();
} else if ( particle_name == particle->GetParticleName() ) {
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4VDecayChannel.cc,v 1.5.6.1.2.1 1999/12/08 17:34:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4VDecayChannel.cc,v 1.8 2000/05/29 01:30:52 kurasige Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// ------------------------------------------------------------
@@ -17,6 +17,7 @@
// History: first implementation, based on object model of
// 27 July 1996 H.Kurashige
// 30 May 1997 H.Kurashige
// 23 Mar. 2000 H.Weber : add GetAngularMomentum
// ------------------------------------------------------------
#include "G4ParticleDefinition.hh"
@@ -360,6 +361,59 @@ void G4VDecayChannel::SetParent(const G4ParticleDefinition * parent_type)
if (parent_type != 0) SetParent(parent_type->GetParticleName());
}
G4int G4VDecayChannel::GetAngularMomentum()
{
// determine angular momentum
// fill pointers to daughter particles if not yet set
if (daughters == 0) FillDaughters();
const G4int PiSpin = parent->GetPDGiSpin();
const G4int PParity = parent->GetPDGiParity();
if (2==numberOfDaughters) { // up to now we can only handle two particle decays
const G4int D1iSpin = daughters[0]->GetPDGiSpin();
const G4int D1Parity = daughters[0]->GetPDGiParity();
const G4int D2iSpin = daughters[1]->GetPDGiSpin();
const G4int D2Parity = daughters[1]->GetPDGiParity();
const G4int MiniSpin = abs (D1iSpin - D2iSpin);
const G4int MaxiSpin = D1iSpin + D2iSpin;
const G4int lMax = (PiSpin+D1iSpin+D2iSpin)/2; // l is allways int
G4int lMin;
#ifdef G4VERBOSE
if (verboseLevel>1) {
G4cout << "iSpin: " << PiSpin << " -> " << D1iSpin << " + " << D2iSpin << G4endl;
G4cout << "2*jmin, 2*jmax, lmax " << MiniSpin << " " << MaxiSpin << " " << lMax << G4endl;
}
#endif
for (G4int j=MiniSpin; j<=MaxiSpin; j+=2){ // loop over all possible spin couplings
lMin = abs(PiSpin-j)/2;
#ifdef G4VERBOSE
if (verboseLevel>1)
G4cout << "-> checking 2*j=" << j << G4endl;
#endif
for (G4int l=lMin; l<=lMax; l++) {
#ifdef G4VERBOSE
if (verboseLevel>1)
G4cout << " checking l=" << l << G4endl;
#endif
if (l%2==0) {
if (PParity == D1Parity*D2Parity) { // check parity for this l
return l;
}
} else {
if (PParity == -1*D1Parity*D2Parity) { // check parity for this l
return l;
}
}
}
}
} else {
G4Exception ("G4VDecayChannel::GetAngularMomentum: Sorry, can't handle 3 particle decays (up to now)");
}
G4Exception ("G4VDecayChannel::GetAngularMomentum: Can't find angular momentum for this decay!");
return 0;
}
void G4VDecayChannel::DumpInfo()
{
G4cout << " BR: " << rbranch << " [" << kinematics_name << "]";
@@ -375,9 +429,3 @@ void G4VDecayChannel::DumpInfo()
G4cout << G4endl;
}