Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VEmModel.cc,v 1.20 2008/11/13 23:13:18 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4VEmModel.cc,v 1.30 2009/09/23 14:42:47 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -40,6 +40,7 @@
|
||||
// Modifications:
|
||||
// 25.10.2005 Set default highLimit=100.TeV (V.Ivanchenko)
|
||||
// 06.02.2006 add method ComputeMeanFreePath() (mma)
|
||||
// 16.02.2009 Move implementations of virtual methods to source (VI)
|
||||
//
|
||||
//
|
||||
// Class Description:
|
||||
@@ -52,14 +53,19 @@
|
||||
#include "G4VEmModel.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VEmModel::G4VEmModel(const G4String& nam):
|
||||
fluc(0), name(nam), lowLimit(0.1*keV), highLimit(100.0*TeV),
|
||||
eMinActive(0.0),eMaxActive(DBL_MAX),
|
||||
polarAngleLimit(0.0),secondaryThreshold(DBL_MAX),theLPMflag(false),
|
||||
pParticleChange(0),nuclearStopping(false),nsec(5)
|
||||
pParticleChange(0),nuclearStopping(false),
|
||||
currentCouple(0),currentElement(0),
|
||||
nsec(5),flagDeexcitation(false)
|
||||
{
|
||||
xsec.resize(nsec);
|
||||
nSelectors = 0;
|
||||
@@ -81,6 +87,88 @@ G4VEmModel::~G4VEmModel()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleChangeForLoss* G4VEmModel::GetParticleChangeForLoss()
|
||||
{
|
||||
G4ParticleChangeForLoss* p = 0;
|
||||
if (pParticleChange) {
|
||||
p = static_cast<G4ParticleChangeForLoss*>(pParticleChange);
|
||||
} else {
|
||||
p = new G4ParticleChangeForLoss();
|
||||
pParticleChange = p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ParticleChangeForGamma* G4VEmModel::GetParticleChangeForGamma()
|
||||
{
|
||||
G4ParticleChangeForGamma* p = 0;
|
||||
if (pParticleChange) {
|
||||
p = static_cast<G4ParticleChangeForGamma*>(pParticleChange);
|
||||
} else {
|
||||
p = new G4ParticleChangeForGamma();
|
||||
pParticleChange = p;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
{
|
||||
// initialise before run
|
||||
flagDeexcitation = false;
|
||||
|
||||
G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
|
||||
if(nbins < 3) nbins = 3;
|
||||
G4bool spline = G4LossTableManager::Instance()->SplineFlag();
|
||||
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
// prepare vector
|
||||
if(numOfCouples > nSelectors) elmSelectors.reserve(numOfCouples);
|
||||
|
||||
// initialise vector
|
||||
for(G4int i=0; i<numOfCouples; i++) {
|
||||
currentCouple = theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = currentCouple->GetMaterial();
|
||||
G4int idx = currentCouple->GetIndex();
|
||||
|
||||
// selector already exist check if should be deleted
|
||||
G4bool create = true;
|
||||
if(i < nSelectors) {
|
||||
if(elmSelectors[i]) {
|
||||
if(material == elmSelectors[i]->GetMaterial()) create = false;
|
||||
else delete elmSelectors[i];
|
||||
}
|
||||
} else {
|
||||
nSelectors++;
|
||||
elmSelectors.push_back(0);
|
||||
}
|
||||
if(create) {
|
||||
elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
|
||||
lowLimit,highLimit,spline);
|
||||
}
|
||||
elmSelectors[i]->Initialise(p, cuts[idx]);
|
||||
//elmSelectors[i]->Dump(p);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
|
||||
const G4ParticleDefinition*,
|
||||
G4double,G4double)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material,
|
||||
const G4ParticleDefinition* p,
|
||||
G4double ekin,
|
||||
@@ -106,59 +194,69 @@ G4double G4VEmModel::CrossSectionPerVolume(const G4Material* material,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* p,
|
||||
G4double ekin,
|
||||
const G4Material* material,
|
||||
G4double emin,
|
||||
G4double emax)
|
||||
G4double G4VEmModel::ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
|
||||
G4double, G4double, G4double,
|
||||
G4double, G4double)
|
||||
{
|
||||
G4double mfp = DBL_MAX;
|
||||
G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
|
||||
if (cross > DBL_MIN) mfp = 1./cross;
|
||||
return mfp;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::InitialiseElementSelectors(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
void G4VEmModel::DefineForRegion(const G4Region*)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
|
||||
const G4MaterialCutsCouple*)
|
||||
{
|
||||
G4int nbins = G4int(std::log10(highLimit/lowLimit) + 0.5);
|
||||
if(nbins < 3) nbins = 3;
|
||||
G4bool spline = G4LossTableManager::Instance()->SplineFlag();
|
||||
|
||||
G4ProductionCutsTable* theCoupleTable=
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
G4int numOfCouples = theCoupleTable->GetTableSize();
|
||||
|
||||
// prepare vector
|
||||
if(numOfCouples > nSelectors) {
|
||||
elmSelectors.resize(numOfCouples);
|
||||
nSelectors = numOfCouples;
|
||||
}
|
||||
|
||||
// initialise vector
|
||||
for(G4int i=0; i<numOfCouples; i++) {
|
||||
const G4MaterialCutsCouple* couple =
|
||||
theCoupleTable->GetMaterialCutsCouple(i);
|
||||
const G4Material* material = couple->GetMaterial();
|
||||
G4int idx = couple->GetIndex();
|
||||
|
||||
// selector already exist check if should be deleted
|
||||
G4bool create = true;
|
||||
if(elmSelectors[i]) {
|
||||
if(material == elmSelectors[i]->GetMaterial()) create = false;
|
||||
else delete elmSelectors[i];
|
||||
}
|
||||
if(create) {
|
||||
elmSelectors[i] = new G4EmElementSelector(this,material,nbins,
|
||||
lowLimit,highLimit,spline);
|
||||
}
|
||||
elmSelectors[i]->Initialise(p, cuts[idx]);
|
||||
//elmSelectors[i]->Dump(p);
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
G4double q = p->GetPDGCharge()/CLHEP::eplus;
|
||||
return q*q;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
|
||||
const G4Material*, G4double)
|
||||
{
|
||||
return p->GetPDGCharge();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
|
||||
const G4DynamicParticle*,
|
||||
G4double&,G4double&,G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::SampleDeexcitationAlongStep(const G4Material*,
|
||||
const G4Track&,
|
||||
G4double& )
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
|
||||
G4double kineticEnergy)
|
||||
{
|
||||
return kineticEnergy;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
|
||||
const G4Material*, G4double)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
Reference in New Issue
Block a user