Import Geant4 5.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:15:15 +02:00
parent 37fff30d2e
commit fbd4999cf7
4396 changed files with 56662 additions and 52446 deletions
@@ -28,15 +28,22 @@
//
// File name: G4EmModelManager
//
// Author: Vladimir Ivanchenko
//
// Author: Vladimir Ivanchenko
//
// Creation date: 07.05.2002
//
// Modifications: 03.12.2002 V.Ivanchenko fix a bug in model selection
// Modifications:
//
// Class Description:
// 03-12-02 V.Ivanchenko fix a bug in model selection
// 20-01-03 Migrade to cut per region (V.Ivanchenko)
// 27-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 The set of models is defined for region (V.Ivanchenko)
// 26-03-03 Add GetDEDXDispersion (V.Ivanchenko)
// 13-04-03 Add startFromNull (V.Ivanchenko)
//
// It is the unified energy loss process it calculates the continuous
// Class Description:
//
// It is the unified energy loss process it calculates the continuous
// energy loss for charged particles using a set of Energy Loss
// models valid for different energy regions. There are a possibility
// to create and access to dE/dx and range tables, or to calculate
@@ -49,21 +56,60 @@
#ifndef G4EmModelManager_h
#define G4EmModelManager_h 1
#include "globals.hh"
#include "G4Material.hh"
#include "G4Track.hh"
#include "G4PhysicsTable.hh"
#include "G4PhysicsVector.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4Step;
#include "globals.hh"
#include "G4DataVector.hh"
class G4RegionModels
{
friend class G4EmModelManager;
public:
private:
G4RegionModels(G4int nMod, G4std::vector<G4int>& list, G4DataVector& lowE);
~G4RegionModels();
G4int SelectIndex(G4double e) const {
G4int idx = 0;
if (nModelsForRegion>1) {
idx = nModelsForRegion;
do {idx--;} while (idx && e <= lowKineticEnergy[idx]);
}
return theListOfModelIndexes[idx];
};
G4int ModelIndex(G4int n) const {
return theListOfModelIndexes[n];
};
G4int NumberOfModels() const {
return nModelsForRegion;
};
G4int nModelsForRegion;
G4int* theListOfModelIndexes;
G4double* lowKineticEnergy;
};
#include "G4VEmModel.hh"
#include "G4VEmFluctuationModel.hh"
#include "G4DynamicParticle.hh"
class G4Region;
class G4ParticleDefinition;
class G4VEmModel;
class G4DataVector;
class G4VParticleChange;
class G4PhysicsVector;
class G4MaterialCutsCouple;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4EmModelManager
class G4EmModelManager
{
public:
@@ -73,7 +119,7 @@ public:
void Clear();
const G4DataVector* Initialise(const G4ParticleDefinition*,
const G4DataVector* Initialise(const G4ParticleDefinition*,
const G4ParticleDefinition*,
G4double,
G4int);
@@ -82,19 +128,35 @@ public:
const G4DataVector* SubCutoff() const;
void FillDEDXVector(G4PhysicsVector*, const G4Material*);
void FillDEDXVector(G4PhysicsVector*, const G4MaterialCutsCouple*);
void FillLambdaVector(G4PhysicsVector*, const G4Material*);
void FillLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4bool startFromNull = true);
void FillSubLambdaVector(G4PhysicsVector*, const G4Material*);
void FillSubLambdaVector(G4PhysicsVector*, const G4MaterialCutsCouple*,
G4bool startFromNull = true);
G4VEmModel* SelectModel(G4double energy);
G4VEmModel* SelectModel(G4double& energy, size_t& index);
void AddEmModel(G4VEmModel*, G4int);
G4double SampleFluctuations(const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& length,
G4double& eloss,
G4double& preStepKinEnergy,
size_t& index);
G4double GetDEDXDispersion( const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& length,
size_t& index);
void AddEmModel(G4int, G4VEmModel*, G4VEmFluctuationModel*, const G4Region*);
private:
// hide assignment operator
// hide assignment operator
G4EmModelManager(G4EmModelManager &);
G4EmModelManager & operator=(const G4EmModelManager &right);
@@ -106,40 +168,75 @@ private:
G4DataVector theCuts;
G4DataVector theSubCuts;
G4VEmModel* emModels[5];
G4int nEmModels;
G4int nmax;
G4std::vector<G4VEmModel*> models;
G4std::vector<G4VEmFluctuationModel*> flucModels;
G4std::vector<const G4Region*> regions;
G4std::vector<G4int> orderOfModels;
G4DataVector upperEkin;
G4int order[5];
G4double upperEkin[5];
G4bool orderIsChanged;
G4int nEmModels;
G4int nRegions;
G4int nCouples;
G4std::vector<G4int> idxOfRegionModels;
G4std::vector<G4RegionModels*> setOfRegionModels;
G4double minSubRange;
const G4ParticleDefinition* particle;
const G4ParticleDefinition* secondaryParticle;
G4int verboseLevel;
G4int verboseLevel;
// cash
G4VEmModel* currentModel;
G4int currentIdx;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4EmModelManager::SelectModel(G4double energy)
inline G4VEmModel* G4EmModelManager::SelectModel(G4double& kinEnergy, size_t& index)
{
if(nEmModels == 4 && energy > upperEkin[2]) {
currentModel = emModels[3];
} else if(nEmModels >= 3 && energy > upperEkin[1]) {
currentModel = emModels[2];
} else if(nEmModels >= 2 && energy > upperEkin[0]) {
currentModel = emModels[1];
} else {
currentModel = emModels[0];
}
return currentModel;
currentIdx = (setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
return models[currentIdx];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4EmModelManager::SampleFluctuations(
const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& length,
G4double& eloss,
G4double& kinEnergy,
size_t& index)
{
currentIdx = (setOfRegionModels[idxOfRegionModels[index]])->SelectIndex(kinEnergy);
G4VEmFluctuationModel* fm = flucModels[currentIdx];
G4double x = eloss;
if(fm) x = fm->SampleFluctuations(material,dp,tmax,length,eloss);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4EmModelManager::GetDEDXDispersion(
const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& length,
size_t& index)
{
currentIdx = (setOfRegionModels[idxOfRegionModels[index]])
->SelectIndex(dp->GetKineticEnergy());
G4VEmFluctuationModel* fm = flucModels[currentIdx];
G4double x = 0.0;
if(fm) x = fm->Dispersion(material,dp,tmax,length);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -159,6 +256,4 @@ inline const G4DataVector* G4EmModelManager::SubCutoff() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif