Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,33 +1,36 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the 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: G4EnergyLossTables.hh,v 1.5 1999/04/15 07:46:10 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4EnergyLossTables.hh,v 1.8.2.1 1999/12/07 20:51:20 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
#ifndef included_G4EnergyLossTables
|
||||
#define included_G4EnergyLossTables
|
||||
|
||||
#include "g4std/map"
|
||||
#include "globals.hh"
|
||||
#include <rw/tvhdict.h>
|
||||
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// A utility class, containing the energy loss tables
|
||||
// for each particle
|
||||
//
|
||||
// Energy loss processes have to register their tables with this
|
||||
// class. The responsibility of creating and deleting the tables
|
||||
// remains with the energy loss classes.
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// P. Urban, 06/04/1998
|
||||
// L. Urban, 27/05/1988 , modifications + new functions added
|
||||
@@ -37,12 +40,19 @@
|
||||
// L.Urban , 12/04/99 , bug fixed
|
||||
// don't use the helper class.
|
||||
// It can't be hidden for Rogue Wave uses it.
|
||||
// 10/11/99: moved from RWT hash dictionary to STL map, G.Barrand, M.Maire
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4EnergyLossTablesHelper {
|
||||
|
||||
friend class G4EnergyLossTables;
|
||||
// the only instances are within the class G4EnergyLossTables
|
||||
|
||||
public:
|
||||
G4EnergyLossTablesHelper();
|
||||
|
||||
private:
|
||||
G4EnergyLossTablesHelper(const G4PhysicsTable* aDEDXTable,
|
||||
const G4PhysicsTable* aRangeTable,
|
||||
@@ -65,6 +75,8 @@ private:
|
||||
G4int theNumberOfBins;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class G4EnergyLossTables {
|
||||
|
||||
public:
|
||||
@@ -140,10 +152,9 @@ public:
|
||||
typedef const G4ParticleDefinition* K;
|
||||
|
||||
private:
|
||||
static RWTValHashDictionary<K, G4EnergyLossTablesHelper> dict;
|
||||
typedef G4std::map<K,G4EnergyLossTablesHelper,less<K> > helper_map;
|
||||
static helper_map dict;
|
||||
|
||||
static unsigned HashFun(const K& particle);
|
||||
|
||||
static G4EnergyLossTablesHelper GetTables(const G4ParticleDefinition* p);
|
||||
|
||||
static G4EnergyLossTablesHelper t ;
|
||||
@@ -155,6 +166,8 @@ private:
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4EnergyLossTables.icc"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,27 +1,26 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the 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: G4EnergyLossTables.icc,v 1.6 1999/04/15 07:46:13 urban Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4EnergyLossTables.icc,v 1.7.2.1 1999/12/07 20:51:21 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// $Id:
|
||||
// Inline members of the G4EnergyLossTables class
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
// first version created by P.Urban , 06/04/1998
|
||||
// modified by L.Urban , 27/05/98
|
||||
// cache mechanism , L.Urban , 11/02/99
|
||||
// bug fixed , L.Urban , 12/04/99
|
||||
// 10/11/99: moved from RWT hash dictionary to STL map, G.Barrand, M.Maire
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
inline unsigned G4EnergyLossTables::HashFun(
|
||||
const G4EnergyLossTables::K& particle)
|
||||
{
|
||||
return particle->GetParticleName().hash();
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4EnergyLossTablesHelper::G4EnergyLossTablesHelper(
|
||||
const G4PhysicsTable* aDEDXTable,
|
||||
@@ -45,66 +44,76 @@ inline G4EnergyLossTablesHelper::G4EnergyLossTablesHelper(
|
||||
{
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4EnergyLossTablesHelper::G4EnergyLossTablesHelper()
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4PhysicsTable* G4EnergyLossTables::GetDEDXTable(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper v;
|
||||
G4bool found= dict.findValue(p, v);
|
||||
return found ? v.theDEDXTable : 0;
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) return 0;
|
||||
return (*it).second.theDEDXTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4PhysicsTable* G4EnergyLossTables::GetRangeTable(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper v;
|
||||
G4bool found= dict.findValue(p, v);
|
||||
return found ? v.theRangeTable : 0;
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) return 0;
|
||||
return (*it).second.theRangeTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4PhysicsTable* G4EnergyLossTables::GetInverseRangeTable(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper v;
|
||||
G4bool found= dict.findValue(p, v);
|
||||
return found ? v.theInverseRangeTable : 0;
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) return 0;
|
||||
return (*it).second.theInverseRangeTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4PhysicsTable* G4EnergyLossTables::GetLabTimeTable(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper v;
|
||||
G4bool found= dict.findValue(p, v);
|
||||
return found ? v.theLabTimeTable : 0;
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) return 0;
|
||||
return (*it).second.theLabTimeTable;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline const G4PhysicsTable* G4EnergyLossTables::GetProperTimeTable(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper v;
|
||||
G4bool found= dict.findValue(p, v);
|
||||
return found ? v.theProperTimeTable : 0;
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) return 0;
|
||||
return (*it).second.theProperTimeTable;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4EnergyLossTablesHelper G4EnergyLossTables::GetTables(
|
||||
const G4ParticleDefinition* p)
|
||||
{
|
||||
G4EnergyLossTablesHelper r;
|
||||
if (! dict.findValue(p, r)) {
|
||||
helper_map::iterator it;
|
||||
if((it=dict.find(p))==dict.end()) {
|
||||
G4Exception("G4EnergyLossTables::GetTables: table not found!");
|
||||
exit(1);
|
||||
}
|
||||
return r;
|
||||
return (*it).second;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetDEDX(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
@@ -147,6 +156,8 @@ inline G4double G4EnergyLossTables::GetDEDX(
|
||||
return dEdx*Chargesquare;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetLabTime(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
G4double KineticEnergy,
|
||||
@@ -187,6 +198,8 @@ inline G4double G4EnergyLossTables::GetLabTime(
|
||||
return time/t.theMassRatio ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetDeltaLabTime(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
G4double KineticEnergyStart,
|
||||
@@ -261,6 +274,7 @@ inline G4double G4EnergyLossTables::GetDeltaLabTime(
|
||||
return deltatime/t.theMassRatio ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetProperTime(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
@@ -302,6 +316,7 @@ inline G4double G4EnergyLossTables::GetProperTime(
|
||||
return time/t.theMassRatio ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetDeltaProperTime(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
@@ -377,6 +392,8 @@ inline G4double G4EnergyLossTables::GetDeltaProperTime(
|
||||
return deltatime/t.theMassRatio ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetRange(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
G4double KineticEnergy,
|
||||
@@ -421,6 +438,9 @@ inline G4double G4EnergyLossTables::GetRange(
|
||||
|
||||
return Range/(Chargesquare*t.theMassRatio);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
inline G4double G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
const G4ParticleDefinition *aParticle,
|
||||
G4double range,
|
||||
@@ -481,6 +501,7 @@ inline G4double G4EnergyLossTables::GetPreciseEnergyFromRange(
|
||||
return scaledKineticEnergy/t.theMassRatio ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user