Import Geant4 11.1.0.beta source tree
This commit is contained in:
@@ -351,7 +351,7 @@ static const G4float e73[78] = { 18.11f, 23.3f, 27.86f, 31.99f, 35.83f, 42.84f,
|
||||
|
||||
void G4ASTARStopping::AddData(const G4float* stop, const G4Material* mat)
|
||||
{
|
||||
G4PhysicsFreeVector* v = new G4PhysicsFreeVector(78, true);
|
||||
auto v = new G4PhysicsFreeVector(78, true);
|
||||
for(size_t i=0; i<78; ++i) {
|
||||
v->PutValues(i, T0[i], stop[i]*fac);
|
||||
}
|
||||
|
||||
@@ -100,8 +100,7 @@ G4AtimaEnergyLossModel::G4AtimaEnergyLossModel(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4AtimaEnergyLossModel::~G4AtimaEnergyLossModel()
|
||||
{}
|
||||
G4AtimaEnergyLossModel::~G4AtimaEnergyLossModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -387,8 +386,7 @@ void G4AtimaEnergyLossModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
|
||||
<< G4endl;
|
||||
*/
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
vdp->push_back(delta);
|
||||
|
||||
|
||||
@@ -101,8 +101,7 @@ G4AtimaFluctuations::G4AtimaFluctuations(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4AtimaFluctuations::~G4AtimaFluctuations()
|
||||
{}
|
||||
G4AtimaFluctuations::~G4AtimaFluctuations() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ G4BetheBlochIonGasModel::G4BetheBlochIonGasModel(const G4ParticleDefinition* p,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4BetheBlochIonGasModel::~G4BetheBlochIonGasModel()
|
||||
{}
|
||||
G4BetheBlochIonGasModel::~G4BetheBlochIonGasModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -88,8 +88,7 @@ G4BetheBlochModel::G4BetheBlochModel(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4BetheBlochModel::~G4BetheBlochModel()
|
||||
{}
|
||||
G4BetheBlochModel::~G4BetheBlochModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -468,8 +467,7 @@ void G4BetheBlochModel::SampleSecondaries(vector<G4DynamicParticle*>* vdp,
|
||||
<< G4endl;
|
||||
*/
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
vdp->push_back(delta);
|
||||
|
||||
|
||||
@@ -105,8 +105,6 @@
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4Gamma.hh"
|
||||
#include "G4MuonPlus.hh"
|
||||
#include "G4MuonMinus.hh"
|
||||
#include "G4IonTable.hh"
|
||||
#include "G4NucleiProperties.hh"
|
||||
|
||||
@@ -132,7 +130,7 @@ G4BetheHeitler5DModel::G4BetheHeitler5DModel(const G4ParticleDefinition* pd,
|
||||
const G4String& nam)
|
||||
: G4PairProductionRelModel(pd, nam),
|
||||
fLepton1(G4Electron::Definition()),fLepton2(G4Positron::Definition()),
|
||||
fTheMuPlus(G4MuonPlus::Definition()),fTheMuMinus(G4MuonMinus::Definition()),
|
||||
fTheMuPlus(nullptr),fTheMuMinus(nullptr),
|
||||
fVerbose(1),
|
||||
fConversionType(0),
|
||||
fConvMode(kEPair),
|
||||
@@ -145,8 +143,7 @@ G4BetheHeitler5DModel::G4BetheHeitler5DModel(const G4ParticleDefinition* pd,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4BetheHeitler5DModel::~G4BetheHeitler5DModel()
|
||||
{}
|
||||
G4BetheHeitler5DModel::~G4BetheHeitler5DModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -175,18 +172,6 @@ void G4BetheHeitler5DModel::Initialise(const G4ParticleDefinition* part,
|
||||
//Q: Do we need this on Model
|
||||
// The Leptons defined via SetLeptonPair(..) method
|
||||
SetLowEnergyLimit(2*CLHEP::electron_mass_c2);
|
||||
|
||||
if (fConvMode == kEPair) {
|
||||
assert(fLepton1->GetPDGEncoding() == fTheElectron->GetPDGEncoding()) ;
|
||||
if (fVerbose > 3)
|
||||
G4cout << "BH5DModel::Initialise conversion to e+ e-" << G4endl;
|
||||
}
|
||||
|
||||
if (fConvMode == kMuPair) {
|
||||
assert(fLepton1->GetPDGEncoding() == fTheMuMinus->GetPDGEncoding()) ;
|
||||
if (fVerbose > 3)
|
||||
G4cout << "BH5DModel::Initialise conversion to mu+ mu-" << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -194,66 +179,43 @@ void G4BetheHeitler5DModel::Initialise(const G4ParticleDefinition* part,
|
||||
void G4BetheHeitler5DModel::SetLeptonPair(const G4ParticleDefinition* p1,
|
||||
const G4ParticleDefinition* p2)
|
||||
{
|
||||
// Lepton1 - nagative charged particle
|
||||
if ( p1->GetPDGEncoding() < 0 ){
|
||||
if ( p1->GetPDGEncoding() ==
|
||||
G4Positron::Definition()->GetPDGEncoding() ) {
|
||||
SetConversionMode(kEPair);
|
||||
fLepton1 = p2;
|
||||
fLepton2 = p1;
|
||||
// if (fVerbose)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to e+ e-"
|
||||
<< G4endl;
|
||||
} else if ( p1->GetPDGEncoding() ==
|
||||
G4MuonPlus::Definition()->GetPDGEncoding() ) {
|
||||
SetConversionMode(kMuPair);
|
||||
fLepton1 = p2;
|
||||
fLepton2 = p1;
|
||||
// if (fVerbose)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to mu+ mu-"
|
||||
<< G4endl;
|
||||
} else {
|
||||
// Exception
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Model not applicable to particle(s) "
|
||||
<< p1->GetParticleName() << ", "
|
||||
<< p2->GetParticleName();
|
||||
G4Exception("G4BetheHeitler5DModel::SetLeptonPair","em0002",
|
||||
FatalException, ed);
|
||||
}
|
||||
} else {
|
||||
if ( p1->GetPDGEncoding() ==
|
||||
G4Electron::Definition()->GetPDGEncoding() ) {
|
||||
SetConversionMode(kEPair);
|
||||
fLepton1 = p1;
|
||||
fLepton2 = p2;
|
||||
// if (fVerbose)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to e+ e-"
|
||||
<< G4endl;
|
||||
} else if ( p1->GetPDGEncoding() ==
|
||||
G4MuonMinus::Definition()->GetPDGEncoding() ) {
|
||||
SetConversionMode(kMuPair);
|
||||
fLepton1 = p1;
|
||||
fLepton2 = p2;
|
||||
// if (fVerbose)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to mu+ mu-"
|
||||
<< G4endl;
|
||||
} else {
|
||||
// Exception
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Model not applicable to particle(s) "
|
||||
<< p1->GetParticleName() << ", "
|
||||
<< p2->GetParticleName();
|
||||
G4Exception("G4BetheHeitler5DModel::SetLeptonPair","em0002",
|
||||
FatalException, ed);
|
||||
}
|
||||
}
|
||||
if ( fLepton1->GetPDGEncoding() != fLepton2->GetAntiPDGEncoding() ) {
|
||||
G4int pdg1 = p1->GetPDGEncoding();
|
||||
G4int pdg2 = p2->GetPDGEncoding();
|
||||
G4int pdg = std::abs(pdg1);
|
||||
if ( pdg1 != -pdg2 || (pdg != 11 && pdg != 13) ) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << " Wrong pair of leptons: " << p1->GetParticleName()
|
||||
<< " and " << p1->GetParticleName();
|
||||
G4Exception("G4BetheHeitler5DModel::SetLeptonPair","em0007",
|
||||
FatalErrorInArgument, "pair must be particle, antiparticle ");
|
||||
G4cerr << "BH5DModel::SetLeptonPair BAD paricle/anti particle pair"
|
||||
<< fLepton1->GetParticleName() << ", "
|
||||
<< fLepton2->GetParticleName() << G4endl;
|
||||
FatalErrorInArgument, ed, "");
|
||||
} else {
|
||||
if ( pdg == 11 ) {
|
||||
SetConversionMode(kEPair);
|
||||
if( pdg1 == 11 ) {
|
||||
fLepton1 = p1;
|
||||
fLepton2 = p2;
|
||||
} else {
|
||||
fLepton1 = p2;
|
||||
fLepton2 = p1;
|
||||
}
|
||||
if (fVerbose > 0)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to e+ e-"
|
||||
<< G4endl;
|
||||
} else {
|
||||
SetConversionMode(kMuPair);
|
||||
if( pdg1 == 13 ) {
|
||||
fLepton1 = p1;
|
||||
fLepton2 = p2;
|
||||
} else {
|
||||
fLepton1 = p2;
|
||||
fLepton2 = p1;
|
||||
}
|
||||
fTheMuPlus = fLepton2;
|
||||
fTheMuMinus= fLepton1;
|
||||
if (fVerbose > 0)
|
||||
G4cout << "G4BetheHeitler5DModel::SetLeptonPair conversion to mu+ mu-"
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,8 +628,8 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
}
|
||||
|
||||
// Create secondaries
|
||||
G4DynamicParticle* aParticle1 = new G4DynamicParticle(fLepton1,LeptonMinus);
|
||||
G4DynamicParticle* aParticle2 = new G4DynamicParticle(fLepton2,LeptonPlus);
|
||||
auto aParticle1 = new G4DynamicParticle(fLepton1,LeptonMinus);
|
||||
auto aParticle2 = new G4DynamicParticle(fLepton2,LeptonPlus);
|
||||
|
||||
// create G4DynamicParticle object for the particle3 ( recoil )
|
||||
G4ParticleDefinition* RecoilPart;
|
||||
@@ -677,7 +639,7 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
} else{
|
||||
RecoilPart = theIonTable->GetIon(Z, A, 0);
|
||||
}
|
||||
G4DynamicParticle* aParticle3 = new G4DynamicParticle(RecoilPart,Recoil);
|
||||
auto aParticle3 = new G4DynamicParticle(RecoilPart,Recoil);
|
||||
|
||||
// Fill output vector
|
||||
fvect->push_back(aParticle1);
|
||||
|
||||
@@ -281,11 +281,9 @@ void G4BetheHeitlerModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
eKinEnergy, pKinEnergy,
|
||||
eDirection, pDirection);
|
||||
// create G4DynamicParticle object for the particle1
|
||||
G4DynamicParticle* aParticle1= new G4DynamicParticle(
|
||||
fTheElectron,eDirection,eKinEnergy);
|
||||
auto aParticle1= new G4DynamicParticle(fTheElectron,eDirection,eKinEnergy);
|
||||
// create G4DynamicParticle object for the particle2
|
||||
G4DynamicParticle* aParticle2= new G4DynamicParticle(
|
||||
fThePositron,pDirection,pKinEnergy);
|
||||
auto aParticle2= new G4DynamicParticle(fThePositron,pDirection,pKinEnergy);
|
||||
// Fill output vector
|
||||
fvect->push_back(aParticle1);
|
||||
fvect->push_back(aParticle2);
|
||||
@@ -310,7 +308,7 @@ void G4BetheHeitlerModel::InitialiseElementData()
|
||||
if (!gElementData[iz]) { // create it if doesn't exist yet
|
||||
G4double FZLow = 8.*elem->GetIonisation()->GetlogZ3();
|
||||
G4double FZHigh = FZLow + 8.*elem->GetfCoulomb();
|
||||
ElementData* elD = new ElementData();
|
||||
auto elD = new ElementData();
|
||||
elD->fDeltaMaxLow = G4Exp((42.038 - FZLow )/8.29) - 0.958;
|
||||
elD->fDeltaMaxHigh = G4Exp((42.038 - FZHigh)/8.29) - 0.958;
|
||||
gElementData[iz] = elD;
|
||||
|
||||
@@ -58,8 +58,7 @@ G4BraggIonGasModel::G4BraggIonGasModel(const G4ParticleDefinition* p,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4BraggIonGasModel::~G4BraggIonGasModel()
|
||||
{}
|
||||
G4BraggIonGasModel::~G4BraggIonGasModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -369,8 +369,7 @@ void G4BraggIonModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
}
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
vdp->push_back(delta);
|
||||
|
||||
|
||||
@@ -323,8 +323,7 @@ void G4BraggModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
}
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
// Change kinematics of primary particle
|
||||
kineticEnergy -= deltaKinEnergy;
|
||||
|
||||
@@ -56,8 +56,7 @@ G4ComptonScattering::G4ComptonScattering(const G4String& processName,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ComptonScattering::~G4ComptonScattering()
|
||||
{}
|
||||
G4ComptonScattering::~G4ComptonScattering() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -71,8 +71,7 @@ G4CoulombScattering::G4CoulombScattering(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4CoulombScattering::~G4CoulombScattering()
|
||||
{}
|
||||
G4CoulombScattering::~G4CoulombScattering() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -66,8 +66,7 @@ G4DeltaAngle::G4DeltaAngle(const G4String&)
|
||||
prob.resize(nprob,0.0);
|
||||
}
|
||||
|
||||
G4DeltaAngle::~G4DeltaAngle()
|
||||
{}
|
||||
G4DeltaAngle::~G4DeltaAngle() = default;
|
||||
|
||||
G4ThreeVector&
|
||||
G4DeltaAngle::SampleDirectionForShell(const G4DynamicParticle* dp,
|
||||
|
||||
@@ -56,8 +56,7 @@ G4DeltaAngleFreeScat::G4DeltaAngleFreeScat(const G4String&)
|
||||
: G4VEmAngularDistribution("deltaFree")
|
||||
{}
|
||||
|
||||
G4DeltaAngleFreeScat::~G4DeltaAngleFreeScat()
|
||||
{}
|
||||
G4DeltaAngleFreeScat::~G4DeltaAngleFreeScat() = default;
|
||||
|
||||
G4ThreeVector&
|
||||
G4DeltaAngleFreeScat::SampleDirection(const G4DynamicParticle* dp,
|
||||
|
||||
@@ -65,8 +65,7 @@ G4DipBustGenerator::G4DipBustGenerator(const G4String&)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4DipBustGenerator::~G4DipBustGenerator()
|
||||
{}
|
||||
G4DipBustGenerator::~G4DipBustGenerator() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ G4double G4ESTARStopping::GetElectronicDEDX(G4int i, G4double energy)
|
||||
|
||||
void G4ESTARStopping::Initialise()
|
||||
{
|
||||
dirPath = std::getenv("G4LEDATA");
|
||||
dirPath = G4FindDataDir("G4LEDATA");
|
||||
if(!dirPath) {
|
||||
G4Exception("G4ESTARStopping()","em0006",FatalException,
|
||||
"Environment variable G4LEDATA not defined");
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
// File name: G4EmStandUtil
|
||||
//
|
||||
// Author: Vladimir Ivanchenko
|
||||
//
|
||||
// Creation date: 29.05.2022
|
||||
//
|
||||
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "G4EmStandUtil.hh"
|
||||
#include "G4UniversalFluctuation.hh"
|
||||
#include "G4UrbanFluctuation.hh"
|
||||
#include "G4LossFluctuationDummy.hh"
|
||||
#include "G4IonFluctuations.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4VEmFluctuationModel* G4EmStandUtil::ModelOfFluctuations(G4bool isIon)
|
||||
{
|
||||
G4VEmFluctuationModel* f = nullptr;
|
||||
auto ftype = G4EmParameters::Instance()->FluctuationType();
|
||||
if (ftype == fDummyFluctuation) {
|
||||
f = new G4LossFluctuationDummy();
|
||||
} else if (isIon) {
|
||||
f = new G4IonFluctuations();
|
||||
} else if (ftype == fUrbanFluctuation) {
|
||||
f = new G4UrbanFluctuation();
|
||||
} else {
|
||||
f = new G4UniversalFluctuation();
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -257,12 +257,12 @@ void G4GSMottCorrection::LoadMCDataElement(const G4Element *elem) {
|
||||
if (izet>gMaxZet) {
|
||||
izet = gMaxZet;
|
||||
}
|
||||
DataPerMaterial *perElem = new DataPerMaterial();
|
||||
auto perElem = new DataPerMaterial();
|
||||
AllocateDataPerMaterial(perElem);
|
||||
fMCDataPerElement[izet] = perElem;
|
||||
//
|
||||
// load data from file
|
||||
char* tmppath = std::getenv("G4LEDATA");
|
||||
const char* tmppath = G4FindDataDir("G4LEDATA");
|
||||
if (!tmppath) {
|
||||
G4Exception("G4GSMottCorrection::LoadMCDataElement()","em0006",
|
||||
FatalException,
|
||||
@@ -354,7 +354,7 @@ void G4GSMottCorrection::InitMCDataMaterial(const G4Material *mat) {
|
||||
G4double constFactor = CLHEP::electron_mass_c2*CLHEP::fine_structure_const/0.88534;
|
||||
constFactor *= constFactor; // (mc^2)^2\alpha^2/( C_{TF}^2)
|
||||
// allocate memory
|
||||
DataPerMaterial *perMat = new DataPerMaterial();
|
||||
auto perMat = new DataPerMaterial();
|
||||
AllocateDataPerMaterial(perMat);
|
||||
fMCDataPerMaterial[mat->GetIndex()] = perMat;
|
||||
//
|
||||
@@ -506,10 +506,10 @@ void G4GSMottCorrection::InitMCDataMaterial(const G4Material *mat) {
|
||||
void G4GSMottCorrection::AllocateDataPerMaterial(DataPerMaterial *data) {
|
||||
data->fDataPerEkin = new DataPerEkin*[gNumEkin]();
|
||||
for (G4int iek=0; iek<gNumEkin; ++iek) {
|
||||
DataPerEkin *perEkin = new DataPerEkin();
|
||||
auto perEkin = new DataPerEkin();
|
||||
perEkin->fDataPerDelta = new DataPerDelta*[gNumDelta]();
|
||||
for (G4int idel=0; idel<gNumDelta; ++idel) {
|
||||
DataPerDelta *perDelta = new DataPerDelta();
|
||||
auto perDelta = new DataPerDelta();
|
||||
perDelta->fRejFuntion = new double[gNumAngle]();
|
||||
perEkin->fDataPerDelta[idel] = perDelta;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ void G4GSPWACorrections::LoadDataElement(const G4Element *elem) {
|
||||
izet = gMaxZet;
|
||||
}
|
||||
// load data from file
|
||||
char* tmppath = std::getenv("G4LEDATA");
|
||||
const char* tmppath = G4FindDataDir("G4LEDATA");
|
||||
if (!tmppath) {
|
||||
G4Exception("G4GSPWACorrection::LoadDataElement()","em0006",
|
||||
FatalException,
|
||||
@@ -201,7 +201,7 @@ void G4GSPWACorrections::LoadDataElement(const G4Element *elem) {
|
||||
return;
|
||||
}
|
||||
// allocate data structure
|
||||
DataPerMaterial *perElem = new DataPerMaterial();
|
||||
auto perElem = new DataPerMaterial();
|
||||
perElem->fCorScreening.resize(gNumEkin,0.0);
|
||||
perElem->fCorFirstMoment.resize(gNumEkin,0.0);
|
||||
perElem->fCorSecondMoment.resize(gNumEkin,0.0);
|
||||
@@ -225,7 +225,7 @@ void G4GSPWACorrections::InitDataMaterial(const G4Material *mat) {
|
||||
G4double constFactor = CLHEP::electron_mass_c2*CLHEP::fine_structure_const/0.88534;
|
||||
constFactor *= constFactor; // (mc^2)^2\alpha^2/( C_{TF}^2)
|
||||
// allocate memory
|
||||
DataPerMaterial *perMat = new DataPerMaterial();
|
||||
auto perMat = new DataPerMaterial();
|
||||
perMat->fCorScreening.resize(gNumEkin,0.0);
|
||||
perMat->fCorFirstMoment.resize(gNumEkin,0.0);
|
||||
perMat->fCorSecondMoment.resize(gNumEkin,0.0);
|
||||
|
||||
@@ -54,8 +54,7 @@ G4GammaConversion::G4GammaConversion(const G4String& processName,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4GammaConversion::~G4GammaConversion()
|
||||
{}
|
||||
G4GammaConversion::~G4GammaConversion() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ G4GoudsmitSaundersonMscModel::G4GoudsmitSaundersonMscModel(const G4String& nam)
|
||||
tlimit = 1.e+10*mm;
|
||||
presafety = 0.*mm;
|
||||
//
|
||||
particle = 0;
|
||||
particle = nullptr;
|
||||
theManager = G4LossTableManager::Instance();
|
||||
firstStep = true;
|
||||
currentKinEnergy = 0.0;
|
||||
|
||||
@@ -435,7 +435,7 @@ G4GoudsmitSaundersonTable::GSMSCAngularDtr* G4GoudsmitSaundersonTable::GetGSAngu
|
||||
|
||||
|
||||
void G4GoudsmitSaundersonTable::LoadMSCData() {
|
||||
char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (!path) {
|
||||
G4Exception("G4GoudsmitSaundersonTable::LoadMSCData()","em0006",
|
||||
FatalException,
|
||||
@@ -455,7 +455,7 @@ void G4GoudsmitSaundersonTable::LoadMSCData() {
|
||||
return;
|
||||
}
|
||||
for (G4int iq=0; iq<gQNUM1; ++iq) {
|
||||
GSMSCAngularDtr *gsd = new GSMSCAngularDtr();
|
||||
auto gsd = new GSMSCAngularDtr();
|
||||
infile >> gsd->fNumData;
|
||||
gsd->fUValues = new G4double[gsd->fNumData]();
|
||||
gsd->fParamA = new G4double[gsd->fNumData]();
|
||||
@@ -488,7 +488,7 @@ void G4GoudsmitSaundersonTable::LoadMSCData() {
|
||||
G4int numData;
|
||||
infile >> numData;
|
||||
if (numData>1) {
|
||||
GSMSCAngularDtr *gsd = new GSMSCAngularDtr();
|
||||
auto gsd = new GSMSCAngularDtr();
|
||||
gsd->fNumData = numData;
|
||||
gsd->fUValues = new G4double[gsd->fNumData]();
|
||||
gsd->fParamA = new G4double[gsd->fNumData]();
|
||||
|
||||
@@ -57,15 +57,17 @@
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
#include "G4Pow.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4double G4ICRU49NuclearStoppingModel::Z23[] = {0.0};
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4ICRU49NuclearStoppingModel::ICRU49NuclearMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
namespace
|
||||
{
|
||||
G4Mutex ICRU49NuclearMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4ICRU49NuclearStoppingModel::G4ICRU49NuclearStoppingModel(const G4String& nam)
|
||||
: G4VEmModel(nam)
|
||||
@@ -77,8 +79,7 @@ G4ICRU49NuclearStoppingModel::G4ICRU49NuclearStoppingModel(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4ICRU49NuclearStoppingModel::~G4ICRU49NuclearStoppingModel()
|
||||
{}
|
||||
G4ICRU49NuclearStoppingModel::~G4ICRU49NuclearStoppingModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -90,20 +91,15 @@ void G4ICRU49NuclearStoppingModel::Initialise(const G4ParticleDefinition*,
|
||||
|
||||
void G4ICRU49NuclearStoppingModel::InitialiseArray()
|
||||
{
|
||||
if(0.0 != Z23[1]) { return; }
|
||||
G4AutoLock l(&ICRU49NuclearMutex);
|
||||
if(0.0 == Z23[1]) {
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4ICRU49NuclearStoppingModel::ICRU49NuclearMutex);
|
||||
if(0.0 == Z23[1]) {
|
||||
#endif
|
||||
for(G4int i=2; i<100; ++i) {
|
||||
Z23[i] = g4calc->powZ(i, 0.23);
|
||||
}
|
||||
Z23[1] = 1.0;
|
||||
#ifdef G4MULTITHREADED
|
||||
for(G4int i=2; i<100; ++i) {
|
||||
Z23[i] = g4calc->powZ(i, 0.23);
|
||||
}
|
||||
G4MUTEXUNLOCK(&G4ICRU49NuclearStoppingModel::ICRU49NuclearMutex);
|
||||
#endif
|
||||
Z23[1] = 1.0;
|
||||
}
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -468,8 +468,7 @@ void G4ICRU73QOModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
deltaDirection.rotateUz(direction);
|
||||
}
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
// Change kinematics of primary particle
|
||||
kineticEnergy -= deltaKinEnergy;
|
||||
|
||||
@@ -113,12 +113,12 @@ G4InitXscPAI::G4InitXscPAI( const G4MaterialCutsCouple* matCC)
|
||||
|
||||
G4InitXscPAI::~G4InitXscPAI()
|
||||
{
|
||||
if(fPAIxscVector) delete fPAIxscVector;
|
||||
if(fPAIdEdxVector) delete fPAIdEdxVector;
|
||||
if(fPAIphotonVector) delete fPAIphotonVector;
|
||||
if(fPAIelectronVector) delete fPAIelectronVector;
|
||||
if(fChCosSqVector) delete fChCosSqVector;
|
||||
if(fChWidthVector) delete fChWidthVector;
|
||||
delete fPAIxscVector;
|
||||
delete fPAIdEdxVector;
|
||||
delete fPAIphotonVector;
|
||||
delete fPAIelectronVector;
|
||||
delete fChCosSqVector;
|
||||
delete fChWidthVector;
|
||||
delete fSandia;
|
||||
delete fMatSandiaMatrix;
|
||||
}
|
||||
@@ -601,7 +601,7 @@ void G4InitXscPAI::IntegralPAIxSection(G4double bg2, G4double Tmax)
|
||||
fBetaGammaSq = bg2;
|
||||
fTmax = Tmax;
|
||||
|
||||
if(fPAIxscVector) delete fPAIxscVector;
|
||||
delete fPAIxscVector;
|
||||
|
||||
fPAIxscVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
|
||||
fPAIxscVector->PutValue(fPAIbin-1,result);
|
||||
@@ -682,7 +682,7 @@ void G4InitXscPAI::IntegralPAIdEdx(G4double bg2, G4double Tmax)
|
||||
fBetaGammaSq = bg2;
|
||||
fTmax = Tmax;
|
||||
|
||||
if(fPAIdEdxVector) delete fPAIdEdxVector;
|
||||
delete fPAIdEdxVector;
|
||||
|
||||
fPAIdEdxVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
|
||||
fPAIdEdxVector->PutValue(fPAIbin-1,result);
|
||||
@@ -763,9 +763,9 @@ void G4InitXscPAI::IntegralCherenkov(G4double bg2, G4double Tmax)
|
||||
fTmax = Tmax;
|
||||
beta2 = bg2/(1+bg2);
|
||||
|
||||
if(fPAIphotonVector) delete fPAIphotonVector;
|
||||
if(fChCosSqVector) delete fChCosSqVector;
|
||||
if(fChWidthVector) delete fChWidthVector;
|
||||
delete fPAIphotonVector;
|
||||
delete fChCosSqVector;
|
||||
delete fChWidthVector;
|
||||
|
||||
fPAIphotonVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
|
||||
fChCosSqVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
|
||||
@@ -858,7 +858,7 @@ void G4InitXscPAI::IntegralPlasmon(G4double bg2, G4double Tmax)
|
||||
fBetaGammaSq = bg2;
|
||||
fTmax = Tmax;
|
||||
|
||||
if(fPAIelectronVector) delete fPAIelectronVector;
|
||||
delete fPAIelectronVector;
|
||||
|
||||
fPAIelectronVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
|
||||
fPAIelectronVector->PutValue(fPAIbin-1,result);
|
||||
|
||||
@@ -75,7 +75,7 @@ G4IonCoulombCrossSection::G4IonCoulombCrossSection():
|
||||
fNistManager = G4NistManager::Instance();
|
||||
fG4pow = G4Pow::GetInstance();
|
||||
theProton = G4Proton::Proton();
|
||||
particle=0;
|
||||
particle = nullptr;
|
||||
|
||||
G4double p0 = electron_mass_c2*classic_electr_radius;
|
||||
coeff = twopi*p0*p0;
|
||||
@@ -89,10 +89,6 @@ G4IonCoulombCrossSection::G4IonCoulombCrossSection():
|
||||
|
||||
targetZ = targetMass = screenZ = ScreenRSquare = etag = 0.0;
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4IonCoulombCrossSection::~G4IonCoulombCrossSection()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ G4IonCoulombScatteringModel::G4IonCoulombScatteringModel(const G4String& nam)
|
||||
|
||||
recoilThreshold = 0.*eV;
|
||||
heavycorr =0;
|
||||
particle = 0;
|
||||
particle = nullptr;
|
||||
mass=0;
|
||||
currentMaterialIndex = -1;
|
||||
|
||||
@@ -109,7 +109,7 @@ void G4IonCoulombScatteringModel::Initialise(const G4ParticleDefinition* p,
|
||||
const G4DataVector& cuts)
|
||||
{
|
||||
SetupParticle(p);
|
||||
currentCouple = 0;
|
||||
currentCouple = nullptr;
|
||||
currentMaterialIndex = -1;
|
||||
ioncross->Initialise(p,cosThetaMin);
|
||||
|
||||
@@ -228,7 +228,7 @@ void G4IonCoulombScatteringModel::SampleSecondaries(
|
||||
G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
|
||||
newDirection = v0.vect().unit();
|
||||
newDirection.rotateUz(dir);
|
||||
G4DynamicParticle* newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
auto newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
fvect->push_back(newdp);
|
||||
} else if(trec > 0.0) {
|
||||
edep = trec;
|
||||
|
||||
@@ -83,8 +83,7 @@ G4IonFluctuations::G4IonFluctuations(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4IonFluctuations::~G4IonFluctuations()
|
||||
{}
|
||||
G4IonFluctuations::~G4IonFluctuations() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ void G4IonICRU73Data::Initialise()
|
||||
{
|
||||
// fill directory path
|
||||
if(fDataDirectory.empty()) {
|
||||
char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (nullptr != path) {
|
||||
std::ostringstream ost;
|
||||
ost << path << "/ion_stopping_data/";
|
||||
@@ -239,8 +239,7 @@ void G4IonICRU73Data::ReadElementData(const G4Material* mat, G4bool useICRU90)
|
||||
fMatData[Z]->push_back(v2);
|
||||
continue;
|
||||
}
|
||||
G4PhysicsLogVector* v =
|
||||
new G4PhysicsLogVector(fEmin, fEmax, fNbins, fSpline);
|
||||
auto v = new G4PhysicsLogVector(fEmin, fEmax, fNbins, fSpline);
|
||||
for(G4int i=0; i<=fNbins; ++i) {
|
||||
G4double dedx = 0;
|
||||
for(G4int j=0; j<nelm; ++j) {
|
||||
|
||||
@@ -73,8 +73,7 @@ G4KleinNishinaCompton::G4KleinNishinaCompton(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4KleinNishinaCompton::~G4KleinNishinaCompton()
|
||||
{}
|
||||
G4KleinNishinaCompton::~G4KleinNishinaCompton() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -242,7 +241,7 @@ void G4KleinNishinaCompton::SampleSecondaries(
|
||||
eDirection = eDirection.unit();
|
||||
|
||||
// create G4DynamicParticle object for the electron.
|
||||
G4DynamicParticle* dp = new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
|
||||
auto dp = new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
|
||||
fvect->push_back(dp);
|
||||
} else {
|
||||
edep += eKinEnergy;
|
||||
|
||||
@@ -81,8 +81,7 @@ G4KleinNishinaModel::G4KleinNishinaModel(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4KleinNishinaModel::~G4KleinNishinaModel()
|
||||
{}
|
||||
G4KleinNishinaModel::~G4KleinNishinaModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -325,8 +324,7 @@ void G4KleinNishinaModel::SampleSecondaries(
|
||||
if(eKinEnergy > lowestSecondaryEnergy) {
|
||||
G4ThreeVector eDirection = lv2.vect().unit();
|
||||
eDirection.rotateUz(direction);
|
||||
G4DynamicParticle* dp =
|
||||
new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
|
||||
auto dp = new G4DynamicParticle(theElectron,eDirection,eKinEnergy);
|
||||
fvect->push_back(dp);
|
||||
} else { eKinEnergy = 0.0; }
|
||||
|
||||
@@ -339,7 +337,7 @@ void G4KleinNishinaModel::SampleSecondaries(
|
||||
G4int index = couple->GetIndex();
|
||||
if(fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
|
||||
G4int Z = elm->GetZasInt();
|
||||
G4AtomicShellEnumerator as = G4AtomicShellEnumerator(i);
|
||||
auto as = (G4AtomicShellEnumerator)(i);
|
||||
const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
|
||||
G4int nbefore = fvect->size();
|
||||
fAtomDeexcitation->GenerateParticles(fvect, shell, Z, index);
|
||||
|
||||
@@ -81,8 +81,7 @@ G4LindhardSorensenIonModel::G4LindhardSorensenIonModel(const G4ParticleDefinitio
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4LindhardSorensenIonModel::~G4LindhardSorensenIonModel()
|
||||
{}
|
||||
G4LindhardSorensenIonModel::~G4LindhardSorensenIonModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -399,8 +398,7 @@ void G4LindhardSorensenIonModel::SampleSecondaries(
|
||||
<< G4endl;
|
||||
*/
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
|
||||
vdp->push_back(delta);
|
||||
|
||||
|
||||
@@ -53,8 +53,7 @@ G4LossFluctuationDummy::G4LossFluctuationDummy(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4LossFluctuationDummy::~G4LossFluctuationDummy()
|
||||
{}
|
||||
G4LossFluctuationDummy::~G4LossFluctuationDummy() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -68,8 +68,7 @@ G4ModifiedTsai::G4ModifiedTsai(const G4String&)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4ModifiedTsai::~G4ModifiedTsai()
|
||||
{}
|
||||
G4ModifiedTsai::~G4ModifiedTsai() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -88,8 +88,7 @@ G4MollerBhabhaModel::G4MollerBhabhaModel(const G4ParticleDefinition* p,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4MollerBhabhaModel::~G4MollerBhabhaModel()
|
||||
{}
|
||||
G4MollerBhabhaModel::~G4MollerBhabhaModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -377,8 +376,7 @@ G4MollerBhabhaModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
}
|
||||
|
||||
// create G4DynamicParticle object for delta ray
|
||||
G4DynamicParticle* delta =
|
||||
new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
auto delta = new G4DynamicParticle(theElectron,deltaDirection,deltaKinEnergy);
|
||||
vdp->push_back(delta);
|
||||
|
||||
// primary change
|
||||
|
||||
@@ -64,8 +64,7 @@ G4NuclearStopping::G4NuclearStopping(const G4String& processName)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4NuclearStopping::~G4NuclearStopping()
|
||||
{}
|
||||
G4NuclearStopping::~G4NuclearStopping() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ void G4PAIModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
|
||||
G4int Z = G4lrint(anElement->GetZ());
|
||||
|
||||
G4DynamicParticle* deltaRay = new G4DynamicParticle(fElectron,
|
||||
auto deltaRay = new G4DynamicParticle(fElectron,
|
||||
GetAngularDistribution()->SampleDirection(dp, deltaTkin,
|
||||
Z, matCC->GetMaterial()),
|
||||
deltaTkin);
|
||||
|
||||
@@ -113,9 +113,9 @@ void G4PAIModelData::Initialise(const G4MaterialCutsCouple* couple,
|
||||
const G4Material* mat = couple->GetMaterial();
|
||||
fSandia.Initialize(const_cast<G4Material*>(mat));
|
||||
|
||||
G4PhysicsTable* PAItransferTable = new G4PhysicsTable(fTotBin+1);
|
||||
G4PhysicsTable* PAIdEdxTable = new G4PhysicsTable(fTotBin+1);
|
||||
G4PhysicsLogVector* dEdxMeanVector =
|
||||
auto PAItransferTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto PAIdEdxTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto dEdxMeanVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
@@ -150,8 +150,8 @@ void G4PAIModelData::Initialise(const G4MaterialCutsCouple* couple,
|
||||
}
|
||||
n -= kmin;
|
||||
|
||||
G4PhysicsFreeVector* transferVector = new G4PhysicsFreeVector(n);
|
||||
G4PhysicsFreeVector* dEdxVector = new G4PhysicsFreeVector(n);
|
||||
auto transferVector = new G4PhysicsFreeVector(n);
|
||||
auto dEdxVector = new G4PhysicsFreeVector(n);
|
||||
|
||||
//G4double tr0 = 0.0;
|
||||
G4double tr = 0.0;
|
||||
@@ -301,7 +301,7 @@ G4double G4PAIModelData::SampleAlongStepTransfer(G4int coupleIndex,
|
||||
G4double meanN22 = 0.0;
|
||||
|
||||
G4PhysicsVector* v1 = (*(fPAIxscBank[coupleIndex]))(iPlace);
|
||||
G4PhysicsVector* v2 = 0;
|
||||
G4PhysicsVector* v2 = nullptr;
|
||||
|
||||
G4double e1 = v1->Energy(0);
|
||||
G4double e2 = std::min(tmax, v1->GetMaxEnergy());
|
||||
|
||||
@@ -102,22 +102,22 @@ G4PAIPhotData::~G4PAIPhotData()
|
||||
{
|
||||
fPAIxscBank[i]->clearAndDestroy();
|
||||
delete fPAIxscBank[i];
|
||||
fPAIxscBank[i] = 0;
|
||||
fPAIxscBank[i] = nullptr;
|
||||
}
|
||||
if(fPAIdEdxBank[i])
|
||||
{
|
||||
fPAIdEdxBank[i]->clearAndDestroy();
|
||||
delete fPAIdEdxBank[i];
|
||||
fPAIdEdxBank[i]= 0;
|
||||
fPAIdEdxBank[i] = nullptr;
|
||||
}
|
||||
delete fdEdxTable[i];
|
||||
delete fdNdxCutTable[i];
|
||||
fdEdxTable[i] = 0;
|
||||
fdNdxCutTable[i] = 0;
|
||||
fdEdxTable[i] = nullptr;
|
||||
fdNdxCutTable[i] = nullptr;
|
||||
}
|
||||
}
|
||||
delete fParticleEnergyVector;
|
||||
fParticleEnergyVector = 0;
|
||||
fParticleEnergyVector = nullptr;
|
||||
//G4cout << "G4PAIPhotData::~G4PAIPhotData() done for " << this << G4endl;
|
||||
}
|
||||
|
||||
@@ -148,20 +148,20 @@ void G4PAIPhotData::Initialise(const G4MaterialCutsCouple* couple,
|
||||
|
||||
// if( deltaCutInKineticEnergyNow != cut ) deltaCutInKineticEnergyNow = cut; // exception??
|
||||
|
||||
G4PhysicsLogVector* dEdxCutVector =
|
||||
auto dEdxCutVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
|
||||
G4PhysicsLogVector* dNdxCutVector =
|
||||
auto dNdxCutVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
G4PhysicsLogVector* dNdxCutPhotonVector =
|
||||
auto dNdxCutPhotonVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
G4PhysicsLogVector* dNdxCutPlasmonVector =
|
||||
auto dNdxCutPlasmonVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
@@ -169,12 +169,12 @@ void G4PAIPhotData::Initialise(const G4MaterialCutsCouple* couple,
|
||||
const G4Material* mat = couple->GetMaterial();
|
||||
fSandia.Initialize(const_cast<G4Material*>(mat));
|
||||
|
||||
G4PhysicsTable* PAItransferTable = new G4PhysicsTable(fTotBin+1);
|
||||
G4PhysicsTable* PAIphotonTable = new G4PhysicsTable(fTotBin+1);
|
||||
G4PhysicsTable* PAIplasmonTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto PAItransferTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto PAIphotonTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto PAIplasmonTable = new G4PhysicsTable(fTotBin+1);
|
||||
|
||||
G4PhysicsTable* PAIdEdxTable = new G4PhysicsTable(fTotBin+1);
|
||||
G4PhysicsLogVector* dEdxMeanVector =
|
||||
auto PAIdEdxTable = new G4PhysicsTable(fTotBin+1);
|
||||
auto dEdxMeanVector =
|
||||
new G4PhysicsLogVector(fLowestKineticEnergy,
|
||||
fHighestKineticEnergy,
|
||||
fTotBin);
|
||||
@@ -201,11 +201,11 @@ void G4PAIPhotData::Initialise(const G4MaterialCutsCouple* couple,
|
||||
|
||||
G4int n = fPAIxSection.GetSplineSize();
|
||||
|
||||
G4PhysicsFreeVector* transferVector = new G4PhysicsFreeVector(n);
|
||||
G4PhysicsFreeVector* photonVector = new G4PhysicsFreeVector(n);
|
||||
G4PhysicsFreeVector* plasmonVector = new G4PhysicsFreeVector(n);
|
||||
auto transferVector = new G4PhysicsFreeVector(n);
|
||||
auto photonVector = new G4PhysicsFreeVector(n);
|
||||
auto plasmonVector = new G4PhysicsFreeVector(n);
|
||||
|
||||
G4PhysicsFreeVector* dEdxVector = new G4PhysicsFreeVector(n);
|
||||
auto dEdxVector = new G4PhysicsFreeVector(n);
|
||||
|
||||
for( G4int k = 0; k < n; k++ )
|
||||
{
|
||||
@@ -451,7 +451,7 @@ G4double G4PAIPhotData::SampleAlongStepTransfer(G4int coupleIndex,
|
||||
|
||||
G4PhysicsLogVector* vcut = fdNdxCutTable[coupleIndex];
|
||||
G4PhysicsVector* v1 = (*(fPAIxscBank[coupleIndex]))(iPlace);
|
||||
G4PhysicsVector* v2 = 0;
|
||||
G4PhysicsVector* v2 = nullptr;
|
||||
|
||||
dNdxCut1 = (*vcut)[iPlace];
|
||||
G4double e1 = v1->Energy(0);
|
||||
@@ -543,7 +543,7 @@ G4double G4PAIPhotData::SampleAlongStepPhotonTransfer(G4int coupleIndex,
|
||||
|
||||
G4PhysicsLogVector* vcut = fdNdxCutPhotonTable[coupleIndex];
|
||||
G4PhysicsVector* v1 = (*(fPAIphotonBank[coupleIndex]))(iPlace);
|
||||
G4PhysicsVector* v2 = 0;
|
||||
G4PhysicsVector* v2 = nullptr;
|
||||
|
||||
dNdxCut1 = (*vcut)[iPlace];
|
||||
G4double e1 = v1->Energy(0);
|
||||
@@ -635,7 +635,7 @@ G4double G4PAIPhotData::SampleAlongStepPlasmonTransfer(G4int coupleIndex,
|
||||
|
||||
G4PhysicsLogVector* vcut = fdNdxCutPlasmonTable[coupleIndex];
|
||||
G4PhysicsVector* v1 = (*(fPAIplasmonBank[coupleIndex]))(iPlace);
|
||||
G4PhysicsVector* v2 = 0;
|
||||
G4PhysicsVector* v2 = nullptr;
|
||||
|
||||
dNdxCut1 = (*vcut)[iPlace];
|
||||
G4double e1 = v1->Energy(0);
|
||||
|
||||
@@ -287,7 +287,7 @@ void G4PAIPhotModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
dp->GetLogKineticEnergy());
|
||||
G4int Z = G4lrint(anElement->GetZ());
|
||||
|
||||
G4DynamicParticle* deltaRay = new G4DynamicParticle(fElectron,
|
||||
auto deltaRay = new G4DynamicParticle(fElectron,
|
||||
GetAngularDistribution()->SampleDirection(dp, deltaTkin,
|
||||
Z, matCC->GetMaterial()),
|
||||
deltaTkin);
|
||||
@@ -351,7 +351,7 @@ void G4PAIPhotModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
}
|
||||
// create G4DynamicParticle object for photon ray
|
||||
|
||||
G4DynamicParticle* photonRay = new G4DynamicParticle;
|
||||
auto photonRay = new G4DynamicParticle;
|
||||
photonRay->SetDefinition( G4Gamma::Gamma() );
|
||||
photonRay->SetKineticEnergy( deltaTkin );
|
||||
photonRay->SetMomentumDirection(deltaDirection);
|
||||
|
||||
@@ -89,8 +89,8 @@ const G4int G4PAIxSection::fMaxSplineSize = 1000; // Max size of output spline
|
||||
|
||||
G4PAIxSection::G4PAIxSection()
|
||||
{
|
||||
fSandia = 0;
|
||||
fMatSandiaMatrix = 0;
|
||||
fSandia = nullptr;
|
||||
fMatSandiaMatrix = nullptr;
|
||||
fDensity = fElectronDensity = fNormalizationCof = fLowEnergyCof = 0.0;
|
||||
fIntervalNumber = fSplineNumber = 0;
|
||||
fVerbose = 0;
|
||||
@@ -160,8 +160,8 @@ G4PAIxSection::G4PAIxSection(G4MaterialCutsCouple* matCC)
|
||||
G4PAIxSection::G4PAIxSection(G4int materialIndex,
|
||||
G4double maxEnergyTransfer)
|
||||
{
|
||||
fSandia = 0;
|
||||
fMatSandiaMatrix = 0;
|
||||
fSandia = nullptr;
|
||||
fMatSandiaMatrix = nullptr;
|
||||
fVerbose = 0;
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
G4int i, j;
|
||||
@@ -275,7 +275,7 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
G4double** photoAbsCof,
|
||||
G4int intNumber )
|
||||
{
|
||||
fSandia = 0;
|
||||
fSandia = nullptr;
|
||||
fDensity = fElectronDensity = fNormalizationCof = fLowEnergyCof = 0.0;
|
||||
fIntervalNumber = fSplineNumber = 0;
|
||||
fVerbose = 0;
|
||||
@@ -301,8 +301,8 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
for( G4int j = 0; j < 112; ++j ) fPAItable[i][j] = 0.0;
|
||||
}
|
||||
|
||||
fSandia = 0;
|
||||
fMatSandiaMatrix = 0;
|
||||
fSandia = nullptr;
|
||||
fMatSandiaMatrix = nullptr;
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
G4int i, j;
|
||||
|
||||
@@ -434,8 +434,8 @@ G4PAIxSection::G4PAIxSection( G4int materialIndex,
|
||||
G4double maxEnergyTransfer,
|
||||
G4double betaGammaSq )
|
||||
{
|
||||
fSandia = 0;
|
||||
fMatSandiaMatrix = 0;
|
||||
fSandia = nullptr;
|
||||
fMatSandiaMatrix = nullptr;
|
||||
fVerbose = 0;
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ const G4int G4PAIySection::fMaxSplineSize = 500; // Max size of output spline
|
||||
|
||||
G4PAIySection::G4PAIySection()
|
||||
{
|
||||
fSandia = 0;
|
||||
fSandia = nullptr;
|
||||
fDensity = fElectronDensity = fNormalizationCof = fLowEnergyCof = 0.0;
|
||||
fIntervalNumber = fSplineNumber = 0;
|
||||
fVerbose = 0;
|
||||
|
||||
@@ -80,8 +80,7 @@ G4PEEffectFluoModel::G4PEEffectFluoModel(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4PEEffectFluoModel::~G4PEEffectFluoModel()
|
||||
{}
|
||||
G4PEEffectFluoModel::~G4PEEffectFluoModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -190,7 +189,7 @@ G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
G4int index = couple->GetIndex();
|
||||
if(fAtomDeexcitation->CheckDeexcitationActiveRegion(index)) {
|
||||
G4int Z = G4lrint(anElement->GetZ());
|
||||
G4AtomicShellEnumerator as = G4AtomicShellEnumerator(i);
|
||||
auto as = (G4AtomicShellEnumerator)(i);
|
||||
const G4AtomicShell* shell = fAtomDeexcitation->GetAtomicShell(Z, as);
|
||||
G4double eshell = shell->BindingEnergy();
|
||||
if(eshell > bindingEnergy && eshell <= energy) {
|
||||
@@ -233,7 +232,7 @@ G4PEEffectFluoModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
//
|
||||
G4double elecKineEnergy = energy - bindingEnergy;
|
||||
if (elecKineEnergy > fminimalEnergy) {
|
||||
G4DynamicParticle* aParticle = new G4DynamicParticle(theElectron,
|
||||
auto aParticle = new G4DynamicParticle(theElectron,
|
||||
GetAngularDistribution()->SampleDirection(aDynamicPhoton,
|
||||
elecKineEnergy,
|
||||
i, couple->GetMaterial()),
|
||||
|
||||
@@ -352,8 +352,7 @@ void G4PSTARStopping::FindData(G4int j, const G4Material* mat)
|
||||
|
||||
void G4PSTARStopping::AddData(const G4float* stop, const G4Material* mat)
|
||||
{
|
||||
G4PhysicsFreeVector* v =
|
||||
new G4PhysicsFreeVector(60, T0[0], T0[59], true);
|
||||
auto v = new G4PhysicsFreeVector(60, T0[0], T0[59], true);
|
||||
for(size_t i=0; i<60; ++i) {
|
||||
v->PutValues(i, T0[i], ((G4double)stop[i])*fac);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4ModifiedTsai.hh"
|
||||
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Pow.hh"
|
||||
|
||||
const G4int G4PairProductionRelModel::gMaxZet = 120;
|
||||
|
||||
@@ -481,12 +482,10 @@ G4PairProductionRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fve
|
||||
GetAngularDistribution()->SamplePairDirections(aDynamicGamma,
|
||||
eKinEnergy, pKinEnergy, eDirection, pDirection);
|
||||
// create G4DynamicParticle object for the particle1
|
||||
G4DynamicParticle* aParticle1= new G4DynamicParticle(
|
||||
fTheElectron,eDirection,eKinEnergy);
|
||||
auto aParticle1 = new G4DynamicParticle(fTheElectron,eDirection,eKinEnergy);
|
||||
|
||||
// create G4DynamicParticle object for the particle2
|
||||
G4DynamicParticle* aParticle2= new G4DynamicParticle(
|
||||
fThePositron,pDirection,pKinEnergy);
|
||||
auto aParticle2 = new G4DynamicParticle(fThePositron,pDirection,pKinEnergy);
|
||||
// Fill output vector
|
||||
fvect->push_back(aParticle1);
|
||||
fvect->push_back(aParticle2);
|
||||
@@ -523,7 +522,7 @@ void G4PairProductionRelModel::InitialiseElementData()
|
||||
Fel = G4Log(184.) - logZ13;
|
||||
Finel = G4Log(1194.) - 2.*logZ13;
|
||||
}
|
||||
ElementData* elD = new ElementData();
|
||||
auto elD = new ElementData();
|
||||
elD->fLogZ13 = logZ13;
|
||||
elD->fCoulomb = fc;
|
||||
elD->fLradEl = Fel;
|
||||
|
||||
@@ -53,8 +53,7 @@ G4PhotoElectricEffect::G4PhotoElectricEffect(const G4String& processName,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4PhotoElectricEffect::~G4PhotoElectricEffect()
|
||||
{}
|
||||
G4PhotoElectricEffect::~G4PhotoElectricEffect() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -333,7 +333,7 @@ void G4SBBremTable::InitSamplingTables() {
|
||||
|
||||
// should be called only from LoadSamplingTables(G4int) and once
|
||||
void G4SBBremTable::LoadSTGrid() {
|
||||
char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (!path) {
|
||||
G4Exception("G4SBBremTable::LoadSTGrid()","em0006",
|
||||
FatalException, "Environment variable G4LEDATA not defined");
|
||||
@@ -391,7 +391,7 @@ void G4SBBremTable::LoadSamplingTables(G4int iz) {
|
||||
}
|
||||
// load data for a given Z only once
|
||||
iz = std::max(std::min(fMaxZet, iz),1);
|
||||
char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (!path) {
|
||||
G4Exception("G4SBBremTable::LoadSamplingTables()","em0006",
|
||||
FatalException, "Environment variable G4LEDATA not defined");
|
||||
|
||||
@@ -49,8 +49,8 @@ G4SauterGavrilaAngularDistribution::G4SauterGavrilaAngularDistribution()
|
||||
: G4VEmAngularDistribution("SauterGavrila")
|
||||
{}
|
||||
|
||||
G4SauterGavrilaAngularDistribution::~G4SauterGavrilaAngularDistribution()
|
||||
{}
|
||||
G4SauterGavrilaAngularDistribution::~G4SauterGavrilaAngularDistribution()
|
||||
= default;
|
||||
|
||||
G4ThreeVector& G4SauterGavrilaAngularDistribution::SampleDirection(
|
||||
const G4DynamicParticle* dp, G4double, G4int, const G4Material*)
|
||||
|
||||
@@ -113,8 +113,7 @@ G4ScreeningMottCrossSection::G4ScreeningMottCrossSection():
|
||||
|
||||
//....Ooooo0ooooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4ScreeningMottCrossSection::~G4ScreeningMottCrossSection()
|
||||
{}
|
||||
G4ScreeningMottCrossSection::~G4ScreeningMottCrossSection() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -61,11 +61,12 @@
|
||||
#include "G4ModifiedTsai.hh"
|
||||
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
|
||||
#include "G4Physics2DVector.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Log.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
@@ -78,9 +79,10 @@ G4SBBremTable* G4SeltzerBergerModel::gSBSamplingTable = nullptr;
|
||||
G4double G4SeltzerBergerModel::gYLimitData[] = { 0.0 };
|
||||
G4String G4SeltzerBergerModel::gDataDirectory = "";
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4SeltzerBergerModel::theSBMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
namespace
|
||||
{
|
||||
G4Mutex theSBMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
static const G4double kMC2 = CLHEP::electron_mass_c2;
|
||||
static const G4double kAlpha = CLHEP::twopi*CLHEP::fine_structure_const;
|
||||
@@ -160,7 +162,7 @@ const G4String& G4SeltzerBergerModel::FindDirectoryPath()
|
||||
// check environment variable
|
||||
// build the complete string identifying the file with the data set
|
||||
if(gDataDirectory.empty()) {
|
||||
const char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (path) {
|
||||
std::ostringstream ost;
|
||||
ost << path << "/brem_SB/br";
|
||||
@@ -178,41 +180,37 @@ void G4SeltzerBergerModel::ReadData(G4int Z) {
|
||||
// return if it has been already loaded
|
||||
if (gSBDCSData[Z] != nullptr) return;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&theSBMutex);
|
||||
if (gSBDCSData[Z] != nullptr) return;
|
||||
#endif
|
||||
|
||||
std::ostringstream ost;
|
||||
ost << FindDirectoryPath() << Z;
|
||||
std::ifstream fin(ost.str().c_str());
|
||||
if (!fin.is_open()) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Bremsstrahlung data file <" << ost.str().c_str()
|
||||
<< "> is not opened!";
|
||||
G4Exception("G4SeltzerBergerModel::ReadData()","em0003",FatalException,
|
||||
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
|
||||
return;
|
||||
G4AutoLock l(&theSBMutex);
|
||||
if (gSBDCSData[Z] == nullptr) {
|
||||
std::ostringstream ost;
|
||||
ost << FindDirectoryPath() << Z;
|
||||
std::ifstream fin(ost.str().c_str());
|
||||
if (!fin.is_open()) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Bremsstrahlung data file <" << ost.str().c_str()
|
||||
<< "> is not opened!";
|
||||
G4Exception("G4SeltzerBergerModel::ReadData()","em0003",FatalException,
|
||||
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
|
||||
return;
|
||||
}
|
||||
//G4cout << "G4SeltzerBergerModel read from <" << ost.str().c_str()
|
||||
// << ">" << G4endl;
|
||||
auto v = new G4Physics2DVector();
|
||||
if (v->Retrieve(fin)) {
|
||||
v->SetBicubicInterpolation(fIsUseBicubicInterpolation);
|
||||
static const G4double emaxlog = 4*G4Log(10.);
|
||||
gYLimitData[Z] = v->Value(0.97, emaxlog, fIndx, fIndy);
|
||||
gSBDCSData[Z] = v;
|
||||
} else {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Bremsstrahlung data file <" << ost.str().c_str()
|
||||
<< "> is not retrieved!";
|
||||
G4Exception("G4SeltzerBergerModel::ReadData()","em0005",FatalException,
|
||||
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
|
||||
delete v;
|
||||
}
|
||||
}
|
||||
//G4cout << "G4SeltzerBergerModel read from <" << ost.str().c_str()
|
||||
// << ">" << G4endl;
|
||||
G4Physics2DVector* v = new G4Physics2DVector();
|
||||
if (v->Retrieve(fin)) {
|
||||
v->SetBicubicInterpolation(fIsUseBicubicInterpolation);
|
||||
static const G4double emaxlog = 4*G4Log(10.);
|
||||
gYLimitData[Z] = v->Value(0.97, emaxlog, fIndx, fIndy);
|
||||
gSBDCSData[Z] = v;
|
||||
} else {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Bremsstrahlung data file <" << ost.str().c_str()
|
||||
<< "> is not retrieved!";
|
||||
G4Exception("G4SeltzerBergerModel::ReadData()","em0005",FatalException,
|
||||
ed,"G4LEDATA version should be G4EMLOW6.23 or later.");
|
||||
delete v;
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXUNLOCK(&theSBMutex);
|
||||
#endif
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
G4double G4SeltzerBergerModel::ComputeDXSectionPerAtom(G4double gammaEnergy)
|
||||
@@ -297,8 +295,7 @@ G4SeltzerBergerModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
G4ThreeVector gamDir = GetAngularDistribution()->SampleDirection(dp,
|
||||
fPrimaryTotalEnergy-gammaEnergy, fCurrentIZ, couple->GetMaterial());
|
||||
// create G4DynamicParticle object for the emitted Gamma
|
||||
G4DynamicParticle* gamma = new G4DynamicParticle(fGammaParticle, gamDir,
|
||||
gammaEnergy);
|
||||
auto gamma = new G4DynamicParticle(fGammaParticle, gamDir, gammaEnergy);
|
||||
vdp->push_back(gamma);
|
||||
//
|
||||
// compute post-interaction kinematics of the primary e-/e+
|
||||
@@ -318,7 +315,7 @@ G4SeltzerBergerModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
|
||||
if (gammaEnergy > SecondaryThreshold()) {
|
||||
fParticleChange->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChange->SetProposedKineticEnergy(0.0);
|
||||
G4DynamicParticle* el = new G4DynamicParticle(
|
||||
auto el = new G4DynamicParticle(
|
||||
const_cast<G4ParticleDefinition*>(fPrimaryParticle), dir, finalE);
|
||||
vdp->push_back(el);
|
||||
} else { // continue tracking the primary e-/e+ otherwise
|
||||
|
||||
@@ -58,8 +58,7 @@ G4UrbanFluctuation::G4UrbanFluctuation(const G4String& nam)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4UrbanFluctuation::~G4UrbanFluctuation()
|
||||
{}
|
||||
G4UrbanFluctuation::~G4UrbanFluctuation() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -58,19 +58,16 @@
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4ParticleChangeForMSC.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
|
||||
#include "G4Poisson.hh"
|
||||
#include "G4Pow.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Log.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Threading.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -109,7 +106,6 @@ G4UrbanMscModel::G4UrbanMscModel(const G4String& nam)
|
||||
particle = nullptr;
|
||||
|
||||
positron = G4Positron::Positron();
|
||||
theManager = G4LossTableManager::Instance();
|
||||
rndmEngineMod = G4Random::getTheEngine();
|
||||
|
||||
firstStep = true;
|
||||
@@ -462,7 +458,7 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
lambda0 = GetTransportMeanFreePath(particle,currentKinEnergy,
|
||||
currentLogKinEnergy);
|
||||
tPathLength = std::min(tPathLength,currentRange);
|
||||
/*
|
||||
/*
|
||||
G4cout << "G4Urban::StepLimit tPathLength= " << tPathLength
|
||||
<< " range= " <<currentRange<< " lambda= "<<lambda0
|
||||
<<G4endl;
|
||||
@@ -481,7 +477,8 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
// for muons, hadrons
|
||||
: currentRange*msc[idx]->doverrb;
|
||||
|
||||
presafety = sp->GetSafety();
|
||||
presafety = (stepStatus == fGeomBoundary) ? sp->GetSafety()
|
||||
: ComputeSafety(sp->GetPosition(),tPathLength);
|
||||
/*
|
||||
G4cout << "G4Urban::StepLimit tPathLength= "
|
||||
<<tPathLength<<" safety= " << presafety
|
||||
@@ -496,8 +493,8 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
}
|
||||
|
||||
latDisplasment = latDisplasmentbackup;
|
||||
// standard version
|
||||
//
|
||||
// ----------------------------------------------------------------
|
||||
// distance to boundary
|
||||
if (steppingAlgorithm == fUseDistanceToBoundary)
|
||||
{
|
||||
//compute geomlimit and presafety
|
||||
@@ -593,19 +590,11 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
? std::min(tPathLength, Randomizetlimit())
|
||||
: std::min(tPathLength, tlimit);
|
||||
}
|
||||
// for 'normal' simulation with or without magnetic field
|
||||
// there no small step/single scattering at boundaries
|
||||
// ----------------------------------------------------------------
|
||||
// for simulation with or without magnetic field
|
||||
// there no small step/single scattering at boundaries
|
||||
else if(steppingAlgorithm == fUseSafety)
|
||||
{
|
||||
if(stepStatus != fGeomBoundary) {
|
||||
presafety = ComputeSafety(sp->GetPosition(),tPathLength);
|
||||
}
|
||||
/*
|
||||
G4cout << "presafety= " << presafety
|
||||
<< " firstStep= " << firstStep
|
||||
<< " stepStatus= " << stepStatus
|
||||
<< G4endl;
|
||||
*/
|
||||
// is far from boundary
|
||||
if(distance < presafety)
|
||||
{
|
||||
@@ -616,7 +605,7 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
if(firstStep || (stepStatus == fGeomBoundary)) {
|
||||
rangeinit = currentRange;
|
||||
fr = facrange;
|
||||
// 9.1 like stepping for e+/e- only (not for muons,hadrons)
|
||||
// stepping for e+/e- only (not for muons,hadrons)
|
||||
if(mass < masslimite)
|
||||
{
|
||||
rangeinit = std::max(rangeinit, lambda0);
|
||||
@@ -640,18 +629,11 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
tPathLength = (tlimit < tPathLength) ?
|
||||
std::min(tPathLength, Randomizetlimit()) : tPathLength;
|
||||
}
|
||||
// new stepping mode UseSafetyPlus
|
||||
// ----------------------------------------------------------------
|
||||
// for simulation with or without magnetic field
|
||||
// there is small step/single scattering at boundaries
|
||||
else if(steppingAlgorithm == fUseSafetyPlus)
|
||||
{
|
||||
if(stepStatus != fGeomBoundary) {
|
||||
presafety = ComputeSafety(sp->GetPosition(),tPathLength);
|
||||
}
|
||||
/*
|
||||
G4cout << "presafety= " << presafety
|
||||
<< " firstStep= " << firstStep
|
||||
<< " stepStatus= " << stepStatus
|
||||
<< G4endl;
|
||||
*/
|
||||
// is far from boundary
|
||||
if(distance < presafety)
|
||||
{
|
||||
@@ -702,6 +684,7 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
std::min(tPathLength, Randomizetlimit()) : tPathLength;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// simple step limitation
|
||||
else
|
||||
{
|
||||
@@ -715,6 +698,8 @@ G4double G4UrbanMscModel::ComputeTruePathLengthLimit(
|
||||
tPathLength = (tlimit < tPathLength) ?
|
||||
std::min(tPathLength, Randomizetlimit()) : tPathLength;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
firstStep = false;
|
||||
return ConvertTrueToGeom(tPathLength, currentMinimalStep);
|
||||
}
|
||||
@@ -749,13 +734,13 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
|
||||
zPathLength = std::min(tPathLength, lambda0);
|
||||
|
||||
} else if (tPathLength < currentRange*dtrl) {
|
||||
if(tau < taulim) zPathLength = tPathLength*(1.-0.5*tau) ;
|
||||
if(tau < taulim) zPathLength = tPathLength*(1.-0.5*tau);
|
||||
else zPathLength = lambda0*(1.-G4Exp(-tau));
|
||||
|
||||
} else if(currentKinEnergy < mass || tPathLength == currentRange) {
|
||||
par1 = 1./currentRange ;
|
||||
par2 = 1./(par1*lambda0) ;
|
||||
par3 = 1.+par2 ;
|
||||
par1 = 1./currentRange;
|
||||
par2 = currentRange/lambda0;
|
||||
par3 = 1.+par2;
|
||||
if(tPathLength < currentRange) {
|
||||
zPathLength =
|
||||
(1.-G4Exp(par3*G4Log(1.-tPathLength/currentRange)))/(par1*par3);
|
||||
@@ -771,7 +756,7 @@ G4double G4UrbanMscModel::ComputeGeomPathLength(G4double)
|
||||
par1 = (lambda0-lambda1)/(lambda0*tPathLength);
|
||||
//G4cout << "par1= " << par1 << " L1= " << lambda1 << G4endl;
|
||||
par2 = 1./(par1*lambda0);
|
||||
par3 = 1.+par2 ;
|
||||
par3 = 1.+par2;
|
||||
zPathLength = (1.-G4Exp(par3*G4Log(lambda1/lambda0)))/(par1*par3);
|
||||
}
|
||||
|
||||
@@ -840,8 +825,8 @@ G4UrbanMscModel::SampleScattering(const G4ThreeVector& oldDirection,
|
||||
currentLogKinEnergy);
|
||||
}
|
||||
|
||||
if((kinEnergy <= CLHEP::eV) || (tPathLength <= tlimitminfix) ||
|
||||
(tPathLength < tausmall*lambda0)) { return fDisplacement; }
|
||||
if((tPathLength <= tlimitminfix) || (tPathLength < tausmall*lambda0) ||
|
||||
(kinEnergy <= CLHEP::eV)) { return fDisplacement; }
|
||||
|
||||
G4double cth = SampleCosineTheta(tPathLength,kinEnergy);
|
||||
|
||||
@@ -878,11 +863,12 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
G4double cth = 1.0;
|
||||
G4double tau = trueStepLength/lambda0;
|
||||
|
||||
G4double lambda1 = GetTransportMeanFreePath(particle, kinEnergy);
|
||||
if(std::abs(lambda1 - lambda0) > lambda0*0.01 && lambda1 > 0.)
|
||||
{
|
||||
// mean tau value
|
||||
tau = trueStepLength*G4Log(lambda0/lambda1)/(lambda0-lambda1);
|
||||
// mean tau value
|
||||
if(currentKinEnergy != kinEnergy) {
|
||||
G4double lambda1 = GetTransportMeanFreePath(particle, kinEnergy);
|
||||
if(std::abs(lambda1 - lambda0) > lambda0*0.01 && lambda1 > 0.) {
|
||||
tau = trueStepLength*G4Log(lambda0/lambda1)/(lambda0-lambda1);
|
||||
}
|
||||
}
|
||||
|
||||
currentTau = tau;
|
||||
@@ -893,7 +879,6 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
else if (tau >= tausmall) {
|
||||
static const G4double numlim = 0.01;
|
||||
static const G4double onethird = 1./3.;
|
||||
G4double xmeanth, x2meanth;
|
||||
if(tau < numlim) {
|
||||
xmeanth = 1.0 - tau*(1.0 - 0.5*tau);
|
||||
x2meanth= 1.0 - tau*(5.0 - 6.25*tau)*onethird;
|
||||
@@ -906,7 +891,7 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
G4double relloss = 1. - kinEnergy/currentKinEnergy;
|
||||
static const G4double rellossmax= 0.50;
|
||||
if(relloss > rellossmax) {
|
||||
return SimpleScattering(xmeanth,x2meanth);
|
||||
return SimpleScattering();
|
||||
}
|
||||
// is step extreme small ?
|
||||
G4bool extremesmallstep = false;
|
||||
@@ -930,9 +915,7 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
|
||||
if(theta2 < tausmall) { return cth; }
|
||||
|
||||
if(theta0 > theta0max) {
|
||||
return SimpleScattering(xmeanth,x2meanth);
|
||||
}
|
||||
if(theta0 > theta0max) { return SimpleScattering(); }
|
||||
|
||||
G4double x = theta2*(1.0 - theta2/12.);
|
||||
if(theta2 > numlim) {
|
||||
@@ -941,7 +924,7 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
}
|
||||
|
||||
// parameter for tail
|
||||
G4double ltau= G4Log(tau);
|
||||
G4double ltau = G4Log(tau);
|
||||
G4double u = !extremesmallstep ? G4Exp(ltau*onesixth)
|
||||
: G4Exp(G4Log(tsmall/lambda0)*onesixth);
|
||||
|
||||
@@ -975,9 +958,8 @@ G4double G4UrbanMscModel::SampleCosineTheta(G4double trueStepLength,
|
||||
|
||||
// G4cout << " xmean1= " << xmean1 << " xmeanth= " << xmeanth << G4endl;
|
||||
|
||||
if(xmean1 <= 0.999*xmeanth) {
|
||||
return SimpleScattering(xmeanth,x2meanth);
|
||||
}
|
||||
if(xmean1 <= 0.999*xmeanth) { return SimpleScattering(); }
|
||||
|
||||
//from continuity of derivatives
|
||||
G4double b = 1.+(c-xsi)*x;
|
||||
|
||||
@@ -1039,7 +1021,6 @@ G4double G4UrbanMscModel::ComputeTheta0(G4double trueStepLength,
|
||||
|
||||
if(particle == positron)
|
||||
{
|
||||
G4double Zeff = msc[idx]->Zeff;
|
||||
static const G4double xl= 0.6;
|
||||
static const G4double xh= 0.9;
|
||||
static const G4double e = 113.0;
|
||||
@@ -1047,10 +1028,10 @@ G4double G4UrbanMscModel::ComputeTheta0(G4double trueStepLength,
|
||||
|
||||
G4double tau = std::sqrt(currentKinEnergy*kinEnergy)/mass;
|
||||
G4double x = std::sqrt(tau*(tau+2.)/((tau+1.)*(tau+1.)));
|
||||
G4double a = 0.994-4.08e-3*Zeff;
|
||||
G4double b = 7.16+(52.6+365./Zeff)/Zeff;
|
||||
G4double c = 1.000-4.47e-3*Zeff;
|
||||
G4double d = 1.21e-3*Zeff;
|
||||
G4double a = msc[idx]->posa;
|
||||
G4double b = msc[idx]->posb;
|
||||
G4double c = msc[idx]->posc;
|
||||
G4double d = msc[idx]->posd;
|
||||
if(x < xl) {
|
||||
corr = a*(1.-G4Exp(-b*x));
|
||||
} else if(x > xh) {
|
||||
@@ -1063,7 +1044,7 @@ G4double G4UrbanMscModel::ComputeTheta0(G4double trueStepLength,
|
||||
corr = y0*x+y1;
|
||||
}
|
||||
//==================================================================
|
||||
y *= corr*(1.+Zeff*(1.84035e-4*Zeff-1.86427e-2)+0.41125);
|
||||
y *= corr*msc[idx]->pose;
|
||||
}
|
||||
|
||||
static const G4double c_highland = 13.6*CLHEP::MeV;
|
||||
@@ -1173,7 +1154,6 @@ void G4UrbanMscModel::SampleDisplacementNew(G4double, G4double phi)
|
||||
G4double v, rej;
|
||||
|
||||
static const G4double peps = 1.e-4;
|
||||
static const G4double Pi = CLHEP::pi;
|
||||
static const G4double palpha[10] = {2.300e+0,2.490e+0,2.610e+0,2.820e+0,2.710e+0,
|
||||
2.750e+0,2.910e+0,3.400e+0,4.150e+0,5.400e+0};
|
||||
static const G4double palpha1[10]= {4.600e-2,1.245e-1,2.610e-1,2.820e-1,2.710e-1,
|
||||
@@ -1194,16 +1174,16 @@ void G4UrbanMscModel::SampleDisplacementNew(G4double, G4double phi)
|
||||
G4Exp(-palpha1[4]*peps),G4Exp(-palpha1[5]*peps),
|
||||
G4Exp(-palpha1[6]*peps),G4Exp(-palpha1[7]*peps),
|
||||
G4Exp(-palpha1[8]*peps),G4Exp(-palpha1[9]*peps)};
|
||||
static const G4double pw2[10] = {pw1[0]-G4Exp(-palpha1[0]*(Pi-peps)),
|
||||
pw1[1]-G4Exp(-palpha1[1]*(Pi-peps)),
|
||||
pw1[2]-G4Exp(-palpha1[2]*(Pi-peps)),
|
||||
pw1[3]-G4Exp(-palpha1[3]*(Pi-peps)),
|
||||
pw1[4]-G4Exp(-palpha1[4]*(Pi-peps)),
|
||||
pw1[5]-G4Exp(-palpha1[5]*(Pi-peps)),
|
||||
pw1[6]-G4Exp(-palpha1[6]*(Pi-peps)),
|
||||
pw1[7]-G4Exp(-palpha1[7]*(Pi-peps)),
|
||||
pw1[8]-G4Exp(-palpha1[8]*(Pi-peps)),
|
||||
pw1[9]-G4Exp(-palpha1[9]*(Pi-peps))};
|
||||
static const G4double pw2[10] = {pw1[0]-G4Exp(-palpha1[0]*(CLHEP::pi-peps)),
|
||||
pw1[1]-G4Exp(-palpha1[1]*(CLHEP::pi-peps)),
|
||||
pw1[2]-G4Exp(-palpha1[2]*(CLHEP::pi-peps)),
|
||||
pw1[3]-G4Exp(-palpha1[3]*(CLHEP::pi-peps)),
|
||||
pw1[4]-G4Exp(-palpha1[4]*(CLHEP::pi-peps)),
|
||||
pw1[5]-G4Exp(-palpha1[5]*(CLHEP::pi-peps)),
|
||||
pw1[6]-G4Exp(-palpha1[6]*(CLHEP::pi-peps)),
|
||||
pw1[7]-G4Exp(-palpha1[7]*(CLHEP::pi-peps)),
|
||||
pw1[8]-G4Exp(-palpha1[8]*(CLHEP::pi-peps)),
|
||||
pw1[9]-G4Exp(-palpha1[9]*(CLHEP::pi-peps))};
|
||||
|
||||
G4int iphi = (G4int)(u*10.);
|
||||
if(iphi < 0) { iphi = 0; }
|
||||
@@ -1248,12 +1228,11 @@ void G4UrbanMscModel::InitialiseModelCache()
|
||||
msc[j] = new mscData();
|
||||
msc[j]->ecut = cut;
|
||||
G4double Zeff = aCouple->GetMaterial()->GetIonisation()->GetZeffective();
|
||||
msc[j]->Zeff = Zeff;
|
||||
msc[j]->sqrtZ = std::sqrt(Zeff);
|
||||
G4double lnZ = G4Log(Zeff);
|
||||
// correction in theta0 formula
|
||||
G4double w = G4Exp(lnZ/6.);
|
||||
G4double facz = 0.990395+w*(-0.168386+w*0.093286) ;
|
||||
G4double facz = 0.990395+w*(-0.168386+w*0.093286);
|
||||
msc[j]->coeffth1 = facz*(1. - 8.7780e-2/Zeff);
|
||||
msc[j]->coeffth2 = facz*(4.0780e-2 + 1.7315e-4*Zeff);
|
||||
|
||||
@@ -1274,8 +1253,14 @@ void G4UrbanMscModel::InitialiseModelCache()
|
||||
|
||||
// 06.10.2020
|
||||
// msc[j]->doverra = 7.7024e-1 - 6.7878e-2*msc[j]->sqrtZ + 3.5015e-3*Zeff;
|
||||
|
||||
msc[j]->doverrb = 1.15 - 9.76e-4*Zeff;
|
||||
|
||||
// corrections for e+
|
||||
msc[j]->posa = 0.994-4.08e-3*Zeff;
|
||||
msc[j]->posb = 7.16+(52.6+365./Zeff)/Zeff;
|
||||
msc[j]->posc = 1.000-4.47e-3*Zeff;
|
||||
msc[j]->posd = 1.21e-3*Zeff;
|
||||
msc[j]->pose = 1.+Zeff*(1.84035e-4*Zeff-1.86427e-2)+0.41125;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,8 +62,7 @@ G4WaterStopping::G4WaterStopping(G4EmCorrections* corr, G4bool splineFlag)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4WaterStopping::~G4WaterStopping()
|
||||
{}
|
||||
G4WaterStopping::~G4WaterStopping() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -90,7 +89,7 @@ void G4WaterStopping::AddData(const G4double* energy,
|
||||
const G4double* stoppower,
|
||||
G4double factor)
|
||||
{
|
||||
G4PhysicsFreeVector* pv =
|
||||
auto pv =
|
||||
new G4PhysicsFreeVector(53,energy[0]*CLHEP::MeV,energy[52]*CLHEP::MeV,spline);
|
||||
dedx.push_back(pv);
|
||||
for(G4int i=0; i<53; ++i) {
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4Log.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -61,9 +62,10 @@ G4double G4WentzelOKandVIxSection::ScreenRSquareElec[] = {0.0};
|
||||
G4double G4WentzelOKandVIxSection::ScreenRSquare[] = {0.0};
|
||||
G4double G4WentzelOKandVIxSection::FormFactor[] = {0.0};
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4WentzelOKandVIxSection::WentzelOKandVIxSectionMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
namespace
|
||||
{
|
||||
G4Mutex theWOKVIMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
const G4double alpha2 = CLHEP::fine_structure_const*CLHEP::fine_structure_const;
|
||||
const G4double factB1= 0.5*CLHEP::pi*CLHEP::fine_structure_const;
|
||||
@@ -133,10 +135,9 @@ void G4WentzelOKandVIxSection::InitialiseA()
|
||||
{
|
||||
// Thomas-Fermi screening radii
|
||||
// Formfactors from A.V. Butkevich et al., NIM A 488 (2002) 282
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4WentzelOKandVIxSection::WentzelOKandVIxSectionMutex);
|
||||
if(0.0 != ScreenRSquare[0]) { return; }
|
||||
G4AutoLock l(&theWOKVIMutex);
|
||||
if(0.0 == ScreenRSquare[0]) {
|
||||
#endif
|
||||
const G4double invmev2 = 1./(CLHEP::MeV*CLHEP::MeV);
|
||||
G4double a0 = CLHEP::electron_mass_c2/0.88534;
|
||||
G4double constn = 6.937e-6*invmev2;
|
||||
@@ -155,15 +156,8 @@ void G4WentzelOKandVIxSection::InitialiseA()
|
||||
x = fNistManager->GetA27(j);
|
||||
FormFactor[j] = constn*x*x;
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
}
|
||||
G4MUTEXUNLOCK(&G4WentzelOKandVIxSection::WentzelOKandVIxSectionMutex);
|
||||
#endif
|
||||
|
||||
//G4cout << "G4WentzelOKandVIxSection::Initialise mass= " << mass
|
||||
// << " " << p->GetParticleName()
|
||||
// << " cosThetaMax= " << cosThetaMax << G4endl;
|
||||
|
||||
}
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -61,27 +61,28 @@
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4NistManager.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4AutoLock.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
std::vector<G4double> G4WentzelVIRelModel::effMass;
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
G4Mutex G4WentzelVIRelModel::WentzelVIRelModelMutex = G4MUTEX_INITIALIZER;
|
||||
#endif
|
||||
namespace
|
||||
{
|
||||
G4Mutex theWVIRelMutex = G4MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
G4WentzelVIRelModel::G4WentzelVIRelModel() :
|
||||
G4WentzelVIModel(true, "WentzelVIRel")
|
||||
{
|
||||
fNistManager = G4NistManager::Instance();
|
||||
G4WentzelVIRelXSection* ptr = new G4WentzelVIRelXSection();
|
||||
auto ptr = new G4WentzelVIRelXSection();
|
||||
SetWVICrossSection(static_cast<G4WentzelOKandVIxSection*>(ptr));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4WentzelVIRelModel::~G4WentzelVIRelModel()
|
||||
{}
|
||||
G4WentzelVIRelModel::~G4WentzelVIRelModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -154,10 +155,10 @@ void G4WentzelVIRelModel::ComputeEffectiveMass()
|
||||
const G4ProductionCutsTable* theCoupleTable =
|
||||
G4ProductionCutsTable::GetProductionCutsTable();
|
||||
size_t ncouples = theCoupleTable->GetTableSize();
|
||||
#ifdef G4MULTITHREADED
|
||||
G4MUTEXLOCK(&G4WentzelVIRelModel::WentzelVIRelModelMutex);
|
||||
if(ncouples == effMass.size()) { return; }
|
||||
|
||||
G4AutoLock l(&theWVIRelMutex);
|
||||
if(ncouples != effMass.size()) {
|
||||
#endif
|
||||
effMass.resize(ncouples, 0.0);
|
||||
for(size_t i=0; i<ncouples; ++i) {
|
||||
const G4Material* mat =
|
||||
@@ -175,10 +176,8 @@ void G4WentzelVIRelModel::ComputeEffectiveMass()
|
||||
}
|
||||
effMass[i] = sum/norm;
|
||||
}
|
||||
#ifdef G4MULTITHREADED
|
||||
}
|
||||
G4MUTEXUNLOCK(&G4WentzelVIRelModel::WentzelVIRelModelMutex);
|
||||
#endif
|
||||
l.unlock();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -49,13 +49,11 @@
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4WentzelVIRelXSection::G4WentzelVIRelXSection()
|
||||
{}
|
||||
G4WentzelVIRelXSection::G4WentzelVIRelXSection() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4WentzelVIRelXSection::~G4WentzelVIRelXSection()
|
||||
{}
|
||||
G4WentzelVIRelXSection::~G4WentzelVIRelXSection() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ G4XrayRayleighModel::G4XrayRayleighModel(const G4ParticleDefinition*,
|
||||
const G4String& nam)
|
||||
:G4VEmModel(nam),isInitialised(false)
|
||||
{
|
||||
fParticleChange = 0;
|
||||
fParticleChange = nullptr;
|
||||
lowEnergyLimit = 250*eV;
|
||||
highEnergyLimit = 10.*MeV;
|
||||
fFormFactor = 0.0;
|
||||
@@ -76,10 +76,7 @@ G4XrayRayleighModel::G4XrayRayleighModel(const G4ParticleDefinition*,
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4XrayRayleighModel::~G4XrayRayleighModel()
|
||||
{
|
||||
|
||||
}
|
||||
G4XrayRayleighModel::~G4XrayRayleighModel() = default;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -131,9 +131,7 @@ void G4eBremParametrizedModel::InitialiseConstants()
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eBremParametrizedModel::~G4eBremParametrizedModel()
|
||||
{
|
||||
}
|
||||
G4eBremParametrizedModel::~G4eBremParametrizedModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -525,8 +523,7 @@ void G4eBremParametrizedModel::SampleSecondaries(
|
||||
couple->GetMaterial());
|
||||
|
||||
// create G4DynamicParticle object for the Gamma
|
||||
G4DynamicParticle* gamma = new G4DynamicParticle(theGamma,gammaDirection,
|
||||
gammaEnergy);
|
||||
auto gamma = new G4DynamicParticle(theGamma,gammaDirection, gammaEnergy);
|
||||
vdp->push_back(gamma);
|
||||
|
||||
G4double totMomentum = sqrt(kineticEnergy*(totalEnergy + electron_mass_c2));
|
||||
@@ -540,7 +537,7 @@ void G4eBremParametrizedModel::SampleSecondaries(
|
||||
if(gammaEnergy > SecondaryThreshold()) {
|
||||
fParticleChange->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChange->SetProposedKineticEnergy(0.0);
|
||||
G4DynamicParticle* el =
|
||||
auto el =
|
||||
new G4DynamicParticle(const_cast<G4ParticleDefinition*>(particle),
|
||||
direction, finalE);
|
||||
vdp->push_back(el);
|
||||
|
||||
@@ -69,8 +69,7 @@ G4eBremsstrahlung::G4eBremsstrahlung(const G4String& name):
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eBremsstrahlung::~G4eBremsstrahlung()
|
||||
{}
|
||||
G4eBremsstrahlung::~G4eBremsstrahlung() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -88,20 +87,20 @@ G4eBremsstrahlung::InitialiseEnergyLossProcess(const G4ParticleDefinition*,
|
||||
if(!isInitialised) {
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
|
||||
G4double emin = param->MinKinEnergy();
|
||||
G4double emax = param->MaxKinEnergy();
|
||||
G4VEmFluctuationModel* fm = nullptr;
|
||||
|
||||
if (nullptr == EmModel(0)) { SetEmModel(new G4SeltzerBergerModel()); }
|
||||
EmModel(0)->SetLowEnergyLimit(emin);
|
||||
G4double energyLimit = std::min(EmModel(0)->HighEnergyLimit(), GeV);
|
||||
G4double energyLimit = std::min(EmModel(0)->HighEnergyLimit(), CLHEP::GeV);
|
||||
EmModel(0)->SetHighEnergyLimit(energyLimit);
|
||||
EmModel(0)->SetSecondaryThreshold(param->BremsstrahlungTh());
|
||||
EmModel(0)->SetLPMFlag(false);
|
||||
AddEmModel(1, EmModel(0), fm);
|
||||
|
||||
if(emax > energyLimit) {
|
||||
if (nullptr == EmModel(1)) { SetEmModel(new G4eBremsstrahlungRelModel()); }
|
||||
if (nullptr == EmModel(1)) {
|
||||
SetEmModel(new G4eBremsstrahlungRelModel());
|
||||
}
|
||||
EmModel(1)->SetLowEnergyLimit(energyLimit);
|
||||
EmModel(1)->SetHighEnergyLimit(emax);
|
||||
EmModel(1)->SetSecondaryThreshold(param->BremsstrahlungTh());
|
||||
|
||||
@@ -68,7 +68,8 @@
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4ParticleChangeForLoss.hh"
|
||||
#include "G4ModifiedTsai.hh"
|
||||
//#include "G4DipBustGenerator.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4Log.hh"
|
||||
|
||||
const G4int G4eBremsstrahlungRelModel::gMaxZet = 120;
|
||||
|
||||
@@ -253,10 +254,9 @@ G4eBremsstrahlungRelModel::ComputeDEDXPerVolume(const G4Material* material,
|
||||
// the restricted dE/dx by numerical integration of the dependent part of DCS
|
||||
for (size_t ie = 0; ie < numberOfElements; ++ie) {
|
||||
G4VEmModel::SetCurrentElement((*theElemVector)[ie]);
|
||||
//SetCurrentElement((*theElementVector)[i]->GetZasInt());
|
||||
const G4double zet = (*theElemVector)[ie]->GetZ();
|
||||
fCurrentIZ = std::min(G4lrint(zet), gMaxZet);
|
||||
dedx += theAtomNumDensVector[ie]*zet*zet*ComputeBremLoss(tmax);
|
||||
G4int zet = (*theElemVector)[ie]->GetZasInt();
|
||||
fCurrentIZ = std::min(zet, gMaxZet);
|
||||
dedx += (zet*zet)*theAtomNumDensVector[ie]*ComputeBremLoss(tmax);
|
||||
}
|
||||
// apply the constant factor C/Z = 16\alpha r_0^2/3
|
||||
dedx *= gBremFactor;
|
||||
@@ -332,7 +332,7 @@ G4double G4eBremsstrahlungRelModel::ComputeCrossSectionPerAtom(
|
||||
if (tmin >= tmax) {
|
||||
return crossSection;
|
||||
}
|
||||
fCurrentIZ = std::min(G4lrint(Z), gMaxZet);
|
||||
fCurrentIZ = std::min(G4lrint(Z), gMaxZet);
|
||||
// integrate numerically (dependent part of) the DCS between the kin. limits:
|
||||
// a. integrate between tmin and kineticEnergy of the e-
|
||||
crossSection = ComputeXSectionPerAtom(tmin);
|
||||
@@ -592,8 +592,7 @@ G4eBremsstrahlungRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vd
|
||||
GetAngularDistribution()->SampleDirection(dp,fPrimaryTotalEnergy-gammaEnergy,
|
||||
fCurrentIZ, couple->GetMaterial());
|
||||
// create G4DynamicParticle object for the Gamma
|
||||
G4DynamicParticle* gamma = new G4DynamicParticle(fGammaParticle, gamDir,
|
||||
gammaEnergy);
|
||||
auto gamma = new G4DynamicParticle(fGammaParticle, gamDir, gammaEnergy);
|
||||
vdp->push_back(gamma);
|
||||
// compute post-interaction kinematics of primary e-/e+ based on
|
||||
// energy-momentum conservation
|
||||
@@ -608,7 +607,7 @@ G4eBremsstrahlungRelModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vd
|
||||
if (gammaEnergy > SecondaryThreshold()) {
|
||||
fParticleChange->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChange->SetProposedKineticEnergy(0.0);
|
||||
G4DynamicParticle* el = new G4DynamicParticle(
|
||||
auto el = new G4DynamicParticle(
|
||||
const_cast<G4ParticleDefinition*>(fPrimaryParticle), dir, finalE);
|
||||
vdp->push_back(el);
|
||||
} else { // continue tracking the primary e-/e+ otherwise
|
||||
@@ -631,7 +630,7 @@ void G4eBremsstrahlungRelModel::InitialiseElementData()
|
||||
const G4double zet = elem->GetZ();
|
||||
const G4int izet = std::min(G4lrint(zet),gMaxZet);
|
||||
if (!gElementData[izet]) {
|
||||
ElementData *elemData = new ElementData();
|
||||
auto elemData = new ElementData();
|
||||
const G4double fc = elem->GetfCoulomb();
|
||||
G4double Fel = 1.;
|
||||
G4double Finel = 1.;
|
||||
|
||||
@@ -295,7 +295,7 @@ void G4eCoulombScatteringModel::SampleSecondaries(
|
||||
G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
|
||||
G4ThreeVector dir = (direction*sqrt(mom2) -
|
||||
newDirection*sqrt(finalT*(2*mass + finalT))).unit();
|
||||
G4DynamicParticle* newdp = new G4DynamicParticle(ion, dir, trec);
|
||||
auto newdp = new G4DynamicParticle(ion, dir, trec);
|
||||
fvect->push_back(newdp);
|
||||
} else {
|
||||
edep = trec;
|
||||
|
||||
@@ -90,9 +90,7 @@ void G4eDPWACoulombScatteringModel::Initialise(const G4ParticleDefinition* pdef,
|
||||
fIsMixedModel = (fMuMin > 0.0);
|
||||
if(IsMaster()) {
|
||||
// clean the G4eDPWAElasticDCS object if any
|
||||
if (fTheDCS) {
|
||||
delete fTheDCS;
|
||||
}
|
||||
delete fTheDCS;
|
||||
fTheDCS = new G4eDPWAElasticDCS(pdef==G4Electron::Electron(), fIsMixedModel);
|
||||
// init only for the elements that are used in the geometry
|
||||
G4ProductionCutsTable* theCpTable = G4ProductionCutsTable::GetProductionCutsTable();
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#include "G4Physics2DVector.hh"
|
||||
|
||||
#include "zlib.h"
|
||||
|
||||
//
|
||||
// Global variables:
|
||||
//
|
||||
@@ -181,7 +183,7 @@ void G4eDPWAElasticDCS::LoadDCSForZ(G4int iz) {
|
||||
// load the high energy part firt:
|
||||
// - with gNumThetas2 theta and gNumEnergies-gIndxEnergyLim energy values
|
||||
const std::size_t hNumEnergries = gNumEnergies-gIndxEnergyLim;
|
||||
G4Physics2DVector* v2DHigh = new G4Physics2DVector(gNumThetas2, hNumEnergries);
|
||||
auto v2DHigh = new G4Physics2DVector(gNumThetas2, hNumEnergries);
|
||||
v2DHigh->SetBicubicInterpolation(true);
|
||||
for (std::size_t it=0; it<gNumThetas2; ++it) {
|
||||
v2DHigh->PutX(it, gTheMus2[it]);
|
||||
@@ -205,7 +207,7 @@ void G4eDPWAElasticDCS::LoadDCSForZ(G4int iz) {
|
||||
// - with gNumThetas1 theta and gIndxEnergyLim+1 energy values (the +1 is
|
||||
// for including the firts DCS from the higher part above for being
|
||||
// able to perform interpolation between the high and low energy DCS set)
|
||||
G4Physics2DVector* v2DLow = new G4Physics2DVector(gNumThetas1, gIndxEnergyLim+1);
|
||||
auto v2DLow = new G4Physics2DVector(gNumThetas1, gIndxEnergyLim+1);
|
||||
v2DLow->SetBicubicInterpolation(true);
|
||||
for (std::size_t it=0; it<gNumThetas1; ++it) {
|
||||
v2DLow->PutX(it, gTheMus1[it]);
|
||||
@@ -236,7 +238,7 @@ void G4eDPWAElasticDCS::LoadDCSForZ(G4int iz) {
|
||||
fDCS[iz] = v2DHigh;
|
||||
} else {
|
||||
// e+
|
||||
G4Physics2DVector* v2D= new G4Physics2DVector(gNumThetas2, gNumEnergies);
|
||||
auto v2D= new G4Physics2DVector(gNumThetas2, gNumEnergies);
|
||||
v2D->SetBicubicInterpolation(true);
|
||||
for (std::size_t it=0; it<gNumThetas2; ++it) {
|
||||
v2D->PutX(it, gTheMus2[it]);
|
||||
@@ -322,7 +324,7 @@ void G4eDPWAElasticDCS::ComputeCSPerAtom(G4int iz, G4double ekin, G4double& elcs
|
||||
// when restricted interval sampling is needed. This is controlled by
|
||||
// the fIsRestrictedSamplingRequired flag (false by default).
|
||||
struct OneSamplingTable {
|
||||
OneSamplingTable () {}
|
||||
OneSamplingTable () = default;
|
||||
void SetSize(std::size_t nx, G4bool useAlias) {
|
||||
fN = nx;
|
||||
// Alias
|
||||
@@ -353,7 +355,7 @@ void G4eDPWAElasticDCS::BuildSmplingTableForZ(G4int iz) {
|
||||
if (fSamplingTables[iz]) return;
|
||||
// Do it otherwise:
|
||||
// allocate space
|
||||
std::vector<OneSamplingTable>* sTables = new std::vector<OneSamplingTable>(gNumEnergies);
|
||||
auto sTables = new std::vector<OneSamplingTable>(gNumEnergies);
|
||||
// read compressed sampling table data
|
||||
std::ostringstream oss;
|
||||
const G4String fname = fIsElectron ? "stables/el/" : "stables/pos/";
|
||||
@@ -406,7 +408,7 @@ G4eDPWAElasticDCS::SampleCosineTheta(std::size_t iz, G4double lekin, G4double r1
|
||||
// determine the discrete ekin sampling table to be used:
|
||||
// - statistical interpolation (i.e. linear) on log energy scale
|
||||
const G4double rem = (lekin-gLogMinEkin)*gInvDelLogEkin;
|
||||
const std::size_t k = (std::size_t)rem;
|
||||
const auto k = (std::size_t)rem;
|
||||
const std::size_t iekin = (r1 < rem-k) ? k+1 : k;
|
||||
// sample the mu(t)=0.5(1-cos(t))
|
||||
const double mu = SampleMu(iz, iekin, r2, r3);
|
||||
@@ -431,7 +433,7 @@ G4eDPWAElasticDCS::SampleCosineThetaRestricted(std::size_t iz, G4double lekin,
|
||||
// determine the discrete ekin sampling table to be used:
|
||||
// - statistical interpolation (i.e. linear) on log energy scale
|
||||
const G4double rem = (lekin-gLogMinEkin)*gInvDelLogEkin;
|
||||
const std::size_t k = (size_t)rem;
|
||||
const auto k = (size_t)rem;
|
||||
const std::size_t iekin = (r1 < rem-k) ? k : k+1;
|
||||
// sample the mu(t)=0.5(1-cos(t))
|
||||
const G4double mu = SampleMu(iz, iekin, r2, 0.5*(1.0-costMax), 0.5*(1.0-costMin));
|
||||
@@ -445,7 +447,7 @@ G4eDPWAElasticDCS::SampleMu(std::size_t izet, std::size_t ie, G4double r1, G4dou
|
||||
OneSamplingTable& rtn = (*fSamplingTables[izet])[ie];
|
||||
// get the lower index of the bin by using the alias part
|
||||
const G4double rest = r1 * (rtn.fN - 1);
|
||||
std::size_t indxl = (std::size_t)rest;
|
||||
auto indxl = (std::size_t)rest;
|
||||
const G4double dum0 = rest - indxl;
|
||||
if (rtn.fW[indxl] < dum0) indxl = rtn.fI[indxl];
|
||||
// sample value within the selected bin by using ratin based numerical inversion
|
||||
@@ -500,7 +502,7 @@ G4double G4eDPWAElasticDCS::SampleMu(std::size_t izet, std::size_t ie, G4double
|
||||
const G4String& G4eDPWAElasticDCS::FindDirectoryPath() {
|
||||
// check environment variable
|
||||
if (gDataDirectory.empty()) {
|
||||
const char* path = std::getenv("G4LEDATA");
|
||||
const char* path = G4FindDataDir("G4LEDATA");
|
||||
if (path) {
|
||||
std::ostringstream ost;
|
||||
ost << path << "/dpwa/";
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
@@ -45,9 +44,8 @@
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4MollerBhabhaModel.hh"
|
||||
#include "G4UniversalFluctuation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4EmStandUtil.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -63,8 +61,7 @@ G4eIonisation::G4eIonisation(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eIonisation::~G4eIonisation()
|
||||
{}
|
||||
G4eIonisation::~G4eIonisation() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -96,8 +93,9 @@ void G4eIonisation::InitialiseEnergyLossProcess(
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
EmModel(0)->SetLowEnergyLimit(param->MinKinEnergy());
|
||||
EmModel(0)->SetHighEnergyLimit(param->MaxKinEnergy());
|
||||
if (nullptr == FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
|
||||
|
||||
if (nullptr == FluctModel()) {
|
||||
SetFluctModel(G4EmStandUtil::ModelOfFluctuations());
|
||||
}
|
||||
AddEmModel(1, EmModel(), FluctModel());
|
||||
isInitialised = true;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,7 @@ G4eMultipleScattering::G4eMultipleScattering(const G4String& processName)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4eMultipleScattering::~G4eMultipleScattering()
|
||||
{}
|
||||
G4eMultipleScattering::~G4eMultipleScattering() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ void G4eSingleCoulombScatteringModel::SampleSecondaries(
|
||||
G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
|
||||
newDirection = v0.vect().unit();
|
||||
newDirection.rotateUz(dir);
|
||||
G4DynamicParticle* newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
auto newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
fvect->push_back(newdp);
|
||||
} else if(trec > 0.0) {
|
||||
edep = trec;
|
||||
|
||||
@@ -98,8 +98,7 @@ G4eeToTwoGammaModel::G4eeToTwoGammaModel(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eeToTwoGammaModel::~G4eeToTwoGammaModel()
|
||||
{}
|
||||
G4eeToTwoGammaModel::~G4eeToTwoGammaModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -82,8 +82,7 @@ G4eplusAnnihilation::G4eplusAnnihilation(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eplusAnnihilation::~G4eplusAnnihilation()
|
||||
{}
|
||||
G4eplusAnnihilation::~G4eplusAnnihilation() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -81,8 +81,7 @@ G4eplusTo2GammaOKVIModel::G4eplusTo2GammaOKVIModel(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eplusTo2GammaOKVIModel::~G4eplusTo2GammaOKVIModel()
|
||||
{}
|
||||
G4eplusTo2GammaOKVIModel::~G4eplusTo2GammaOKVIModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ G4eplusTo3GammaOKVIModel::G4eplusTo3GammaOKVIModel(const G4ParticleDefinition*,
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4eplusTo3GammaOKVIModel::~G4eplusTo3GammaOKVIModel()
|
||||
{}
|
||||
G4eplusTo3GammaOKVIModel::~G4eplusTo3GammaOKVIModel() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ void G4hCoulombScatteringModel::SampleSecondaries(
|
||||
G4ParticleDefinition* ion = theIonTable->GetIon(iz, ia, 0);
|
||||
newDirection = v0.vect().unit();
|
||||
newDirection.rotateUz(dir);
|
||||
G4DynamicParticle* newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
auto newdp = new G4DynamicParticle(ion, newDirection, trec);
|
||||
fvect->push_back(newdp);
|
||||
} else if(trec > 0.0) {
|
||||
edep = trec;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
// GEANT4 Class file
|
||||
@@ -37,7 +36,6 @@
|
||||
//
|
||||
// Modified by Laszlo Urban, Michel Maire and Vladimir Ivanchenko
|
||||
//
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -51,9 +49,7 @@
|
||||
#include "G4AntiProton.hh"
|
||||
#include "G4BraggModel.hh"
|
||||
#include "G4BetheBlochModel.hh"
|
||||
#include "G4IonFluctuations.hh"
|
||||
#include "G4UniversalFluctuation.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4EmStandUtil.hh"
|
||||
#include "G4PionPlus.hh"
|
||||
#include "G4PionMinus.hh"
|
||||
#include "G4KaonPlus.hh"
|
||||
@@ -76,8 +72,7 @@ G4hIonisation::G4hIonisation(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4hIonisation::~G4hIonisation()
|
||||
{}
|
||||
G4hIonisation::~G4hIonisation() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -143,13 +138,11 @@ void G4hIonisation::InitialiseEnergyLossProcess(
|
||||
|
||||
G4EmParameters* param = G4EmParameters::Instance();
|
||||
G4double emin = std::min(param->MinKinEnergy(), 0.1*eth);
|
||||
G4double emax = std::max(param->MaxKinEnergy(), 100*eth);
|
||||
G4double emax = std::max(param->MaxKinEnergy(), 10*eth);
|
||||
|
||||
if(emin != param->MinKinEnergy() || emax != param->MaxKinEnergy()) {
|
||||
SetMinKinEnergy(emin);
|
||||
SetMaxKinEnergy(emax);
|
||||
G4int bin = G4lrint(param->NumberOfBinsPerDecade()*std::log10(emax/emin));
|
||||
SetDEDXBinning(bin);
|
||||
}
|
||||
|
||||
if (nullptr == EmModel(0)) {
|
||||
@@ -158,9 +151,12 @@ void G4hIonisation::InitialiseEnergyLossProcess(
|
||||
}
|
||||
EmModel(0)->SetLowEnergyLimit(emin);
|
||||
EmModel(0)->SetHighEnergyLimit(eth);
|
||||
AddEmModel(1, EmModel(0), new G4IonFluctuations());
|
||||
|
||||
if (nullptr == FluctModel()) { SetFluctModel(new G4UniversalFluctuation()); }
|
||||
|
||||
if (nullptr == FluctModel()) {
|
||||
G4bool ion = (pname == "GenericIon" || pname == "alpha");
|
||||
SetFluctModel(G4EmStandUtil::ModelOfFluctuations(ion));
|
||||
}
|
||||
AddEmModel(1, EmModel(0), FluctModel());
|
||||
|
||||
if (nullptr == EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
|
||||
EmModel(1)->SetLowEnergyLimit(eth);
|
||||
|
||||
@@ -59,8 +59,7 @@ G4hMultipleScattering::G4hMultipleScattering(const G4String& processName)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4hMultipleScattering::~G4hMultipleScattering()
|
||||
{}
|
||||
G4hMultipleScattering::~G4hMultipleScattering() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
@@ -64,18 +64,15 @@
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4GenericIon.hh"
|
||||
#include "G4Alpha.hh"
|
||||
#include "G4BraggModel.hh"
|
||||
#include "G4BraggIonModel.hh"
|
||||
#include "G4BetheBlochModel.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4LossTableManager.hh"
|
||||
#include "G4WaterStopping.hh"
|
||||
#include "G4EmCorrections.hh"
|
||||
#include "G4IonFluctuations.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4EmStandUtil.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -94,8 +91,7 @@ G4ionIonisation::G4ionIonisation(const G4String& name)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4ionIonisation::~G4ionIonisation()
|
||||
{}
|
||||
G4ionIonisation::~G4ionIonisation() = default;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -151,11 +147,14 @@ void G4ionIonisation::InitialiseEnergyLossProcess(
|
||||
*part->GetPDGMass()/CLHEP::proton_mass_c2;
|
||||
EmModel(0)->SetHighEnergyLimit(eth);
|
||||
|
||||
if (nullptr == FluctModel()) { SetFluctModel(new G4IonFluctuations()); }
|
||||
if (nullptr == FluctModel()) {
|
||||
SetFluctModel(G4EmStandUtil::ModelOfFluctuations(true));
|
||||
}
|
||||
AddEmModel(1, EmModel(0), FluctModel());
|
||||
|
||||
// an extra high-energy model is needed or not?
|
||||
G4double emax = param->MaxKinEnergy();
|
||||
if(eth < 0.99*emax) {
|
||||
if(eth*1.01 < emax) {
|
||||
if (nullptr == EmModel(1)) { SetEmModel(new G4BetheBlochModel()); }
|
||||
EmModel(1)->SetLowEnergyLimit(eth);
|
||||
EmModel(1)->SetHighEnergyLimit(emax);
|
||||
@@ -170,6 +169,7 @@ void G4ionIonisation::InitialiseEnergyLossProcess(
|
||||
corr->SetIonisationModels(EmModel(0),EmModel(1));
|
||||
}
|
||||
} else {
|
||||
// to avoid numerical problem
|
||||
EmModel(0)->SetHighEnergyLimit(emax);
|
||||
}
|
||||
isInitialised = true;
|
||||
|
||||
Reference in New Issue
Block a user