Import Geant4 10.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2016-06-30 14:12:05 +02:00
parent a654a7ab1f
commit 4ec577e5c4
2021 changed files with 100995 additions and 78277 deletions
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EnergyLossForExtrapolator.cc 87062 2014-11-24 11:45:21Z gcosmo $
// $Id: G4EnergyLossForExtrapolator.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
//---------------------------------------------------------------------------
//
@@ -62,13 +62,13 @@
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4TablesForExtrapolator* G4EnergyLossForExtrapolator::tables = 0;
G4TablesForExtrapolator* G4EnergyLossForExtrapolator::tables = nullptr;
G4EnergyLossForExtrapolator::G4EnergyLossForExtrapolator(G4int verb)
: maxEnergyTransfer(DBL_MAX), verbose(verb)
{
currentParticle = 0;
currentMaterial = 0;
currentParticle = nullptr;
currentMaterial = nullptr;
linLossLimit = 0.01;
emin = 1.*MeV;
@@ -86,7 +86,7 @@ G4EnergyLossForExtrapolator::G4EnergyLossForExtrapolator(G4int verb)
= idxInvRangeElectron = idxInvRangePositron = idxInvRangeMuon
= idxInvRangeProton = idxMscElectron = 0;
electron = positron = proton = muonPlus = muonMinus = 0;
electron = positron = proton = muonPlus = muonMinus = nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -220,7 +220,7 @@ G4EnergyLossForExtrapolator::SetupKinematics(const G4ParticleDefinition* part,
const G4ParticleDefinition*
G4EnergyLossForExtrapolator::FindParticle(const G4String& name)
{
const G4ParticleDefinition* p = 0;
const G4ParticleDefinition* p = nullptr;
if(name != currentParticleName) {
p = G4ParticleTable::GetParticleTable()->FindParticle(name);
if(!p) {
@@ -307,8 +307,8 @@ void G4EnergyLossForExtrapolator::Initialisation()
if(verbose>1) {
G4cout << "### G4EnergyLossForExtrapolator::Initialisation" << G4endl;
}
currentParticle = 0;
currentMaterial = 0;
currentParticle = nullptr;
currentMaterial = nullptr;
kineticEnergy = 0.0;
electron = G4Electron::Electron();
@@ -347,7 +347,7 @@ G4EnergyLossForExtrapolator::~G4EnergyLossForExtrapolator()
{
G4AutoLock l(&G4EnergyLossForExtrapolatorMutex);
delete tables;
tables = 0;
tables = nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuBetheBlochModel.cc 91743 2015-08-04 11:49:58Z gcosmo $
// $Id: G4MuBetheBlochModel.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -79,17 +79,17 @@ using namespace std;
G4MuBetheBlochModel::G4MuBetheBlochModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
particle(nullptr),
limitKinEnergy(100.*keV),
logLimitKinEnergy(G4Log(limitKinEnergy)),
twoln10(2.0*G4Log(10.0)),
bg2lim(0.0169),
taulim(8.4146e-3),
//bg2lim(0.0169),
//taulim(8.4146e-3),
alphaprime(fine_structure_const/twopi)
{
theElectron = G4Electron::Electron();
corr = G4LossTableManager::Instance()->EmCorrections();
fParticleChange = 0;
fParticleChange = nullptr;
// initial initialisation of memeber should be overwritten
// by SetParticle
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuBremsstrahlung.cc 85023 2014-10-23 09:56:39Z gcosmo $
// $Id: G4MuBremsstrahlung.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -116,7 +116,7 @@ void G4MuBremsstrahlung::InitialiseEnergyLossProcess(
if (!EmModel()) { SetEmModel(new G4MuBremsstrahlungModel()); }
G4VEmFluctuationModel* fm = 0;
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
EmModel()->SetLowEnergyLimit(param->MinKinEnergy());
EmModel()->SetHighEnergyLimit(param->MaxKinEnergy());
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuBremsstrahlungModel.cc 91743 2015-08-04 11:49:58Z gcosmo $
// $Id: G4MuBremsstrahlungModel.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -91,13 +91,13 @@ G4double G4MuBremsstrahlungModel::fDN[] = {0.0};
G4MuBremsstrahlungModel::G4MuBremsstrahlungModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
particle(nullptr),
sqrte(sqrt(G4Exp(1.))),
bh(202.4),
bh1(446.),
btf(183.),
btf1(1429.),
fParticleChange(0),
fParticleChange(nullptr),
lowestKinEnergy(1.0*GeV),
minThreshold(0.9*keV)
{
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuIonisation.cc 85023 2014-10-23 09:56:39Z gcosmo $
// $Id: G4MuIonisation.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -98,8 +98,8 @@ using namespace std;
G4MuIonisation::G4MuIonisation(const G4String& name)
: G4VEnergyLossProcess(name),
theParticle(0),
theBaseParticle(0),
theParticle(nullptr),
theBaseParticle(nullptr),
isInitialised(false)
{
mass = ratio = 0;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuMultipleScattering.cc 88678 2015-03-05 08:34:20Z gcosmo $
// $Id: G4MuMultipleScattering.cc 97740 2016-06-08 09:23:36Z gcosmo $
//
// -----------------------------------------------------------------------------
//
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuPairProduction.cc 85023 2014-10-23 09:56:39Z gcosmo $
// $Id: G4MuPairProduction.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -83,7 +83,7 @@ using namespace std;
G4MuPairProduction::G4MuPairProduction(const G4String& name)
: G4VEnergyLossProcess(name),
theParticle(0),
theParticle(nullptr),
lowestKinEnergy(1.*GeV),
isInitialised(false)
{
@@ -124,16 +124,17 @@ void G4MuPairProduction::InitialiseEnergyLossProcess(
theParticle = part;
if (!EmModel()) { SetEmModel(new G4MuPairProductionModel(part)); }
G4MuPairProductionModel* mod = new G4MuPairProductionModel(part);
SetEmModel(mod, 1);
G4double limit = part->GetPDGMass()*8;
if(limit > lowestKinEnergy) { lowestKinEnergy = limit; }
lowestKinEnergy = std::max(lowestKinEnergy, part->GetPDGMass()*8.0);
mod->SetLowestKineticEnergy(lowestKinEnergy);
G4VEmFluctuationModel* fm = 0;
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
EmModel()->SetLowEnergyLimit(param->MinKinEnergy());
EmModel()->SetHighEnergyLimit(param->MaxKinEnergy());
AddEmModel(1, EmModel(), fm);
mod->SetLowEnergyLimit(param->MinKinEnergy());
mod->SetHighEnergyLimit(param->MaxKinEnergy());
AddEmModel(1, mod, fm);
}
}
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4MuPairProductionModel.cc 91743 2015-08-04 11:49:58Z gcosmo $
// $Id: G4MuPairProductionModel.cc 97392 2016-06-02 10:10:32Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -90,12 +90,14 @@
// static members
//
const G4int G4MuPairProductionModel::zdat[]={1, 4, 13, 29, 92};
const G4double G4MuPairProductionModel::adat[]={1.01, 9.01,26.98, 63.55, 238.03};
const G4double G4MuPairProductionModel::xgi[]={ 0.0199, 0.1017, 0.2372, 0.4083,
0.5917, 0.7628, 0.8983, 0.9801 };
const G4double G4MuPairProductionModel::wgi[]={ 0.0506, 0.1112, 0.1569, 0.1813,
0.1813, 0.1569, 0.1112, 0.0506 };
static const G4double ak1 = 6.9;
static const G4double ak2 = 1.0;
static const G4int zdat[5] = {1, 4, 13, 29, 92};
const G4double G4MuPairProductionModel::xgi[] =
{ 0.0199, 0.1017, 0.2372, 0.4083, 0.5917, 0.7628, 0.8983, 0.9801 };
const G4double G4MuPairProductionModel::wgi[8] =
{ 0.0506, 0.1112, 0.1569, 0.1813, 0.1813, 0.1569, 0.1112, 0.0506 };
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -104,12 +106,12 @@ using namespace std;
G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4VEmModel(nam),
particle(0),
particle(nullptr),
factorForCross(4.*fine_structure_const*fine_structure_const
*classic_electr_radius*classic_electr_radius/(3.*pi)),
sqrte(sqrt(G4Exp(1.))),
currentZ(0),
fParticleChange(0),
fParticleChange(nullptr),
minPairEnergy(4.*electron_mass_c2),
lowestKinEnergy(1.0*GeV),
nzdat(5),
@@ -124,16 +126,15 @@ G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
theElectron = G4Electron::Electron();
thePositron = G4Positron::Positron();
particleMass = lnZ = z13 = z23 = 0;
particleMass = lnZ = z13 = z23 = 0.;
// setup lowest limit dependent on particle mass
if(p) {
SetParticle(p);
G4double limit = p->GetPDGMass()*8;
if(limit > lowestKinEnergy) { lowestKinEnergy = limit; }
lowestKinEnergy = std::max(lowestKinEnergy,p->GetPDGMass()*8.0);
}
emin = lowestKinEnergy;
emax = 10*TeV;
emax = 10.*TeV;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -216,7 +217,7 @@ G4double G4MuPairProductionModel::ComputeDEDXPerVolume(
G4double loss = ComputMuPairLoss(Z, kineticEnergy, cutEnergy, tmax);
dedx += loss*theAtomicNumDensityVector[i];
}
if (dedx < 0.) { dedx = 0.; }
dedx = std::max(dedx, 0.0);
return dedx;
}
@@ -234,8 +235,6 @@ G4double G4MuPairProductionModel::ComputMuPairLoss(G4double Z,
// calculate the rectricted loss
// numerical integration in log(PairEnergy)
G4double ak1=6.9;
G4double ak2=1.0;
G4double aaa = G4Log(minPairEnergy);
G4double bbb = G4Log(cut);
@@ -257,7 +256,7 @@ G4double G4MuPairProductionModel::ComputMuPairLoss(G4double Z,
x += hhh;
}
loss *= hhh;
if (loss < 0.) loss = 0.;
loss = std::max(loss, 0.0);
return loss;
}
@@ -273,8 +272,8 @@ G4double G4MuPairProductionModel::ComputeMicroscopicCrossSection(
G4double cut = std::max(cutEnergy, minPairEnergy);
if (tmax <= cut) { return cross; }
G4double ak1=6.9 ;
G4double ak2=1.0 ;
// G4double ak1=6.9 ;
// G4double ak2=1.0 ;
G4double aaa = G4Log(cut);
G4double bbb = G4Log(tmax);
G4int kkk = (G4int)((bbb-aaa)/ak1 + ak2);
@@ -295,7 +294,7 @@ G4double G4MuPairProductionModel::ComputeMicroscopicCrossSection(
}
cross *= hhh;
if(cross < 0.0) { cross = 0.0; }
cross = std::max(cross, 0.0);
return cross;
}
@@ -305,9 +304,9 @@ G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection(
G4double tkin,
G4double Z,
G4double pairEnergy)
// Calculates the differential (D) microscopic cross section
// using the cross section formula of R.P. Kokoulin (18/01/98)
// Code modified by R.P. Kokoulin, V.N. Ivanchenko (27/01/04)
// Calculates the differential (D) microscopic cross section
// using the cross section formula of R.P. Kokoulin (18/01/98)
// Code modified by R.P. Kokoulin, V.N. Ivanchenko (27/01/04)
{
static const G4double bbbtf= 183. ;
static const G4double bbbh = 202.4 ;
@@ -318,8 +317,8 @@ G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection(
G4double totalEnergy = tkin + particleMass;
G4double residEnergy = totalEnergy - pairEnergy;
G4double massratio = particleMass/electron_mass_c2 ;
G4double massratio2 = massratio*massratio ;
G4double massratio = particleMass/electron_mass_c2;
G4double massratio2 = massratio*massratio;
G4double cross = 0.;
G4double c3 = 0.75*sqrte*particleMass;
@@ -408,7 +407,7 @@ G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection(
}
cross = -tmn*sum*factorForCross*z2*residEnergy/(totalEnergy*pairEnergy);
if(cross < 0.0) { cross = 0.0; }
cross = std::max(cross, 0.0);
return cross;
}
@@ -119,7 +119,7 @@ G4TablesForExtrapolator:: ~G4TablesForExtrapolator()
const G4PhysicsTable*
G4TablesForExtrapolator::GetPhysicsTable(ExtTableType type) const
{
const G4PhysicsTable* table = 0;
const G4PhysicsTable* table = nullptr;
switch (type)
{
case fDedxElectron:
@@ -171,7 +171,7 @@ void G4TablesForExtrapolator::Initialisation()
if(verbose>1) {
G4cout << "### G4TablesForExtrapolator::Initialisation" << G4endl;
}
currentParticle = 0;
currentParticle = nullptr;
electron = G4Electron::Electron();
positron = G4Positron::Positron();
@@ -0,0 +1,141 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4ePairProduction.cc 84953 2014-10-22 15:08:57Z vnivanch $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4ePairProduction
//
// Author: Vladimir Ivanchenko
//
// Creation date: 17.03.2016
//
// Modifications:
//
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4ePairProduction.hh"
#include "G4SystemOfUnits.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4VEmModel.hh"
#include "G4VEmFluctuationModel.hh"
#include "G4MuPairProductionModel.hh"
#include "G4ElementData.hh"
#include "G4EmParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
using namespace std;
G4ePairProduction::G4ePairProduction(const G4String& name)
: G4VEnergyLossProcess(name),
theParticle(nullptr),
lowestKinEnergy(100.*MeV),
isInitialised(false)
{
SetProcessSubType(fPairProdByCharged);
SetSecondaryParticle(G4Positron::Positron());
SetIonisation(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4ePairProduction::~G4ePairProduction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool G4ePairProduction::IsApplicable(const G4ParticleDefinition& p)
{
return (G4Electron::Electron() == &p || G4Positron::Positron() == &p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4ePairProduction::MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*,
G4double)
{
return lowestKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ePairProduction::InitialiseEnergyLossProcess(
const G4ParticleDefinition* part,
const G4ParticleDefinition*)
{
if (!isInitialised) {
isInitialised = true;
theParticle = part;
G4MuPairProductionModel* mod = new G4MuPairProductionModel(part);
SetEmModel(mod, 1);
lowestKinEnergy = std::max(lowestKinEnergy, part->GetPDGMass()*8.0);
mod->SetLowestKineticEnergy(lowestKinEnergy);
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
mod->SetLowEnergyLimit(param->MinKinEnergy());
mod->SetHighEnergyLimit(param->MaxKinEnergy());
AddEmModel(1, mod, fm);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4ePairProduction::PrintInfo()
{
G4ElementData* ed = EmModel(1)->GetElementData();
if(ed) {
for(G4int Z=1; Z<93; ++Z) {
G4Physics2DVector* pv = ed->GetElement2DData(Z);
if(pv) {
G4cout << " Sampling table " << pv->GetLengthY()
<< "x" << pv->GetLengthX() << "; from "
<< G4Exp(pv->GetY(0))/GeV << " GeV to "
<< G4Exp(pv->GetY(pv->GetLengthY()-1))/TeV
<< " TeV " << G4endl;
break;
}
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....