Import Geant4 10.5.0.beta source tree
This commit is contained in:
+40
-7
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAOneStepThermalizationModel.hh 108498 2018-02-15 15:33:07Z gcosmo $
|
||||
// $Id: G4DNAOneStepThermalizationModel.hh 110873 2018-06-22 13:11:22Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#ifndef G4DNAOneStepThermalizationModel_hh
|
||||
#define G4DNAOneStepThermalizationModel_hh
|
||||
|
||||
#include <memory>
|
||||
#include "G4VEmModel.hh"
|
||||
|
||||
class G4ITNavigator;
|
||||
@@ -86,6 +87,21 @@ namespace DNA{
|
||||
static const double gEnergies_T1990[11];
|
||||
static const double gStdDev_T1990[11];
|
||||
};
|
||||
|
||||
//-----------------------
|
||||
/*
|
||||
* Article: Ritchie RH, Hamm RN, Turner JE, Bolch WE (1994) Interaction of
|
||||
* low-energy electrons with condensed matter: relevance for track
|
||||
* structure.
|
||||
* Computational approaches in molecular radiation biology, Plenum,
|
||||
* New York, Vol. 63, pp. 155–166
|
||||
* Note: also used in Ballarini et al., 2000
|
||||
*/
|
||||
struct Ritchie1994{
|
||||
static void GetPenetration(G4double energy,
|
||||
G4ThreeVector& displacement);
|
||||
static double GetRmean(double energy);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +118,7 @@ class G4TDNAOneStepThermalizationModel : public G4VEmModel
|
||||
public:
|
||||
typedef MODEL Model;
|
||||
G4TDNAOneStepThermalizationModel(const G4ParticleDefinition* p = 0,
|
||||
const G4String& nam =
|
||||
const G4String& nam =
|
||||
"DNAOneStepThermalizationModel");
|
||||
virtual ~G4TDNAOneStepThermalizationModel();
|
||||
|
||||
@@ -123,19 +139,19 @@ public:
|
||||
inline void SetVerbose(int flag){
|
||||
fVerboseLevel = flag;
|
||||
}
|
||||
|
||||
|
||||
void GetPenetration(G4double energy,
|
||||
G4ThreeVector& displacement);
|
||||
|
||||
|
||||
double GetRmean(double energy);
|
||||
|
||||
protected:
|
||||
const std::vector<G4double>* fpWaterDensity;
|
||||
|
||||
G4ParticleChangeForGamma* fParticleChangeForGamma;
|
||||
|
||||
G4ParticleChangeForGamma* fpParticleChangeForGamma;
|
||||
G4bool fIsInitialised;
|
||||
G4int fVerboseLevel;
|
||||
G4Navigator* fNavigator;
|
||||
std::unique_ptr<G4Navigator> fpNavigator;
|
||||
|
||||
private:
|
||||
G4TDNAOneStepThermalizationModel&
|
||||
@@ -151,4 +167,21 @@ typedef G4TDNAOneStepThermalizationModel<DNA::Penetration::Meesungnoen2002> G4DN
|
||||
// Note: if you use the above distribution, it would be
|
||||
// better to follow the electrons down to 6 eV and only then apply
|
||||
// the one step thermalization
|
||||
|
||||
class G4DNASolvationModelFactory
|
||||
{
|
||||
public:
|
||||
/// @param penetrationType Available options:
|
||||
/// Meesungnoen2002, Terrisol1990, Ritchie1994
|
||||
static G4VEmModel* Create(const G4String& penetrationModel);
|
||||
|
||||
/// \brief One step thermalization model can be chosen via macro using
|
||||
/// /process/dna/e-SolvationSubType Ritchie1994
|
||||
/// \return Create the model defined via the command macro
|
||||
/// /process/dna/e-SolvationSubType
|
||||
/// In case the command is unused, it returns the default model set in
|
||||
/// G4EmParameters.
|
||||
static G4VEmModel* GetMacroDefinedModel();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+14
-19
@@ -54,16 +54,15 @@
|
||||
template<typename MODEL>
|
||||
G4TDNAOneStepThermalizationModel<MODEL>::
|
||||
G4TDNAOneStepThermalizationModel(const G4ParticleDefinition*,
|
||||
const G4String& nam) :
|
||||
const G4String& nam) :
|
||||
G4VEmModel(nam), fIsInitialised(false)
|
||||
{
|
||||
fVerboseLevel = 0;
|
||||
SetLowEnergyLimit(0.);
|
||||
G4DNAWaterExcitationStructure exStructure;
|
||||
SetHighEnergyLimit(exStructure.ExcitationEnergy(0));
|
||||
fParticleChangeForGamma = 0;
|
||||
fpParticleChangeForGamma = 0;
|
||||
fpWaterDensity = 0;
|
||||
fNavigator = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -71,12 +70,8 @@ G4VEmModel(nam), fIsInitialised(false)
|
||||
template<typename MODEL>
|
||||
G4TDNAOneStepThermalizationModel<MODEL>::~G4TDNAOneStepThermalizationModel()
|
||||
{
|
||||
if(fNavigator)
|
||||
{
|
||||
// if(fNavigator->GetNavigatorState())
|
||||
// delete fNavigator->GetNavigatorState();
|
||||
delete fNavigator;
|
||||
}
|
||||
// if(fpNavigator && fpNavigator->GetNavigatorState())
|
||||
// delete fpNavigator->GetNavigatorState();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -104,19 +99,19 @@ Initialise(const G4ParticleDefinition* particleDefinition,
|
||||
if(!fIsInitialised)
|
||||
{
|
||||
fIsInitialised = true;
|
||||
fParticleChangeForGamma = GetParticleChangeForGamma();
|
||||
fpParticleChangeForGamma = GetParticleChangeForGamma();
|
||||
}
|
||||
|
||||
G4Navigator* navigator =
|
||||
G4TransportationManager::GetTransportationManager()->
|
||||
GetNavigatorForTracking();
|
||||
|
||||
fNavigator = new G4Navigator();
|
||||
fpNavigator.reset(new G4Navigator());
|
||||
|
||||
if(navigator){ // add these checks for testing mode
|
||||
auto world=navigator->GetWorldVolume();
|
||||
if(world){
|
||||
fNavigator->SetWorldVolume(world);
|
||||
fpNavigator->SetWorldVolume(world);
|
||||
//fNavigator->NewNavigatorState();
|
||||
}
|
||||
}
|
||||
@@ -188,8 +183,8 @@ SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
|
||||
if (k <= HighEnergyLimit())
|
||||
{
|
||||
fParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
|
||||
fParticleChangeForGamma->ProposeLocalEnergyDeposit(k);
|
||||
fpParticleChangeForGamma->ProposeTrackStatus(fStopAndKill);
|
||||
fpParticleChangeForGamma->ProposeLocalEnergyDeposit(k);
|
||||
|
||||
if(G4DNAChemistryManager::IsActivated())
|
||||
{
|
||||
@@ -198,10 +193,10 @@ SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
|
||||
//______________________________________________________________
|
||||
const G4Track * theIncomingTrack =
|
||||
fParticleChangeForGamma->GetCurrentTrack();
|
||||
fpParticleChangeForGamma->GetCurrentTrack();
|
||||
G4ThreeVector finalPosition(theIncomingTrack->GetPosition()+displacement);
|
||||
|
||||
fNavigator->SetWorldVolume(theIncomingTrack->GetTouchable()->
|
||||
fpNavigator->SetWorldVolume(theIncomingTrack->GetTouchable()->
|
||||
GetVolume(theIncomingTrack->GetTouchable()->
|
||||
GetHistoryDepth()));
|
||||
|
||||
@@ -229,12 +224,12 @@ SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
// }
|
||||
//--
|
||||
|
||||
fNavigator->ResetHierarchyAndLocate(theIncomingTrack->GetPosition(),
|
||||
fpNavigator->ResetHierarchyAndLocate(theIncomingTrack->GetPosition(),
|
||||
direction,
|
||||
*((G4TouchableHistory*)
|
||||
theIncomingTrack->GetTouchable()));
|
||||
|
||||
fNavigator->ComputeStep(theIncomingTrack->GetPosition(),
|
||||
fpNavigator->ComputeStep(theIncomingTrack->GetPosition(),
|
||||
displacement/displacementMag,
|
||||
displacementMag,
|
||||
safety);
|
||||
@@ -248,7 +243,7 @@ SampleSecondaries(std::vector<G4DynamicParticle*>*,
|
||||
G4DNAChemistryManager::Instance()->CreateSolvatedElectron(theIncomingTrack,
|
||||
&finalPosition);
|
||||
|
||||
fParticleChangeForGamma->SetProposedKineticEnergy(25.e-3*eV);
|
||||
fpParticleChangeForGamma->SetProposedKineticEnergy(25.e-3*eV);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+212
-146
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4DNAOneStepThermalizationModel.cc 101807 2016-11-30 13:42:28Z gunter $
|
||||
// $Id: G4DNAOneStepThermalizationModel.cc 110873 2018-06-22 13:11:22Z gcosmo $
|
||||
//
|
||||
// Author: Mathieu Karamitros
|
||||
//
|
||||
@@ -38,160 +38,226 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include "G4DNAOneStepThermalizationModel.hh"
|
||||
#include "globals.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include "G4RandomDirection.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DNA{ namespace Penetration{
|
||||
namespace DNA {
|
||||
namespace Penetration {
|
||||
|
||||
const double
|
||||
Meesungnoen2002::gCoeff[13] =
|
||||
{ -4.06217193e-08, 3.06848412e-06, -9.93217814e-05,
|
||||
1.80172797e-03, -2.01135480e-02, 1.42939448e-01,
|
||||
-6.48348714e-01, 1.85227848e+00, -3.36450378e+00,
|
||||
4.37785068e+00, -4.20557339e+00, 3.81679083e+00,
|
||||
-2.34069784e-01 };
|
||||
// fit from Meesungnoen, 2002
|
||||
|
||||
const double
|
||||
Terrisol1990::gEnergies_T1990[11] =
|
||||
{ 0.2, 0.5, 1, 2, 3, 4, 5, 6, 7,
|
||||
// The two last are not in the dataset
|
||||
8, 9}; // eV
|
||||
|
||||
const double
|
||||
Terrisol1990::gStdDev_T1990[11] =
|
||||
{ 17.68*CLHEP::angstrom,
|
||||
22.3*CLHEP::angstrom,
|
||||
28.49*CLHEP::angstrom,
|
||||
45.35*CLHEP::angstrom,
|
||||
70.03*CLHEP::angstrom,
|
||||
98.05*CLHEP::angstrom,
|
||||
120.56*CLHEP::angstrom,
|
||||
132.73*CLHEP::angstrom,
|
||||
142.60*CLHEP::angstrom,
|
||||
// the above value as given in the paper's table does not match
|
||||
// b=27.22 nm nor the mean value. 129.62*CLHEP::angstrom could be
|
||||
// a better fit.
|
||||
//
|
||||
// The two last are made up
|
||||
137.9*CLHEP::angstrom,
|
||||
120.7*CLHEP::angstrom
|
||||
}; // angstrom
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
double Meesungnoen2002::GetRmean(double k){
|
||||
G4double k_eV = k/eV;
|
||||
|
||||
if(k_eV>0.1){ // data until 0.2 eV
|
||||
G4double r_mean = 0;
|
||||
for(int8_t i=12; i!=-1 ; --i){
|
||||
r_mean+=gCoeff[12-i]*std::pow(k_eV,i);
|
||||
}
|
||||
r_mean*=CLHEP::nanometer;
|
||||
return r_mean;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Meesungnoen2002::GetPenetration(G4double k,
|
||||
G4ThreeVector& displacement){
|
||||
displacement=G4ThreeVector(0,0,0);
|
||||
G4double k_eV = k/eV;
|
||||
|
||||
if(k_eV>0.1){ // data until 0.2 eV
|
||||
G4double r_mean = 0;
|
||||
for(int8_t i=12; i!=-1 ; --i){
|
||||
r_mean+=gCoeff[12-i]*std::pow(k_eV,i);
|
||||
}
|
||||
|
||||
r_mean*=nanometer;
|
||||
|
||||
//G4cout << "rmean = " << r_mean << G4endl;
|
||||
|
||||
static constexpr double r2s=0.62665706865775006; //sqrt(CLHEP::pi)/pow(2,3./2.)
|
||||
|
||||
// Use r_mean to build a 3D gaussian
|
||||
double sigma3D = r_mean*r2s;
|
||||
double x = G4RandGauss::shoot(0,sigma3D);
|
||||
double y = G4RandGauss::shoot(0,sigma3D);
|
||||
double z = G4RandGauss::shoot(0,sigma3D);
|
||||
displacement=G4ThreeVector(x,y,z);
|
||||
}
|
||||
else{
|
||||
displacement=G4RandomDirection()*(1e-3*CLHEP::nanometer);
|
||||
// rare events:
|
||||
// prevent H2O and secondary electron to be at the spot
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
double Terrisol1990::Get3DStdDeviation(double energy){
|
||||
G4double k_eV = energy/eV;
|
||||
if(k_eV < 0.2) return 1e-3*CLHEP::nanometer;
|
||||
// rare events:
|
||||
// prevent H2O and secondary electron to be at the spot
|
||||
|
||||
if(k_eV == 9.) return gStdDev_T1990[10];
|
||||
// TODO if k_eV > 9
|
||||
const double
|
||||
Meesungnoen2002::gCoeff[13] =
|
||||
{ -4.06217193e-08, 3.06848412e-06, -9.93217814e-05,
|
||||
1.80172797e-03, -2.01135480e-02, 1.42939448e-01,
|
||||
-6.48348714e-01, 1.85227848e+00, -3.36450378e+00,
|
||||
4.37785068e+00, -4.20557339e+00, 3.81679083e+00,
|
||||
-2.34069784e-01 };
|
||||
// fit from Meesungnoen, 2002
|
||||
|
||||
size_t lowBin, upBin;
|
||||
|
||||
if(k_eV >= 1.){
|
||||
lowBin=std::floor(k_eV)+1;
|
||||
upBin=std::min(lowBin+1, size_t(10));
|
||||
const double
|
||||
Terrisol1990::gEnergies_T1990[11] =
|
||||
{ 0.2, 0.5, 1, 2, 3, 4, 5, 6, 7,
|
||||
// The two last are not in the dataset
|
||||
8, 9}; // eV
|
||||
|
||||
const double
|
||||
Terrisol1990::gStdDev_T1990[11] =
|
||||
{ 17.68*CLHEP::angstrom,
|
||||
22.3*CLHEP::angstrom,
|
||||
28.49*CLHEP::angstrom,
|
||||
45.35*CLHEP::angstrom,
|
||||
70.03*CLHEP::angstrom,
|
||||
98.05*CLHEP::angstrom,
|
||||
120.56*CLHEP::angstrom,
|
||||
132.73*CLHEP::angstrom,
|
||||
142.60*CLHEP::angstrom,
|
||||
// the above value as given in the paper's table does not match
|
||||
// b=27.22 nm nor the mean value. 129.62*CLHEP::angstrom could be
|
||||
// a better fit.
|
||||
//
|
||||
// The two last are made up
|
||||
137.9*CLHEP::angstrom,
|
||||
120.7*CLHEP::angstrom
|
||||
}; // angstrom
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
double Meesungnoen2002::GetRmean(double k){
|
||||
G4double k_eV = k/eV;
|
||||
|
||||
if(k_eV>0.1){ // data until 0.2 eV
|
||||
G4double r_mean = 0;
|
||||
for(int8_t i=12; i!=-1 ; --i){
|
||||
r_mean+=gCoeff[12-i]*std::pow(k_eV,i);
|
||||
}
|
||||
else{
|
||||
auto it=std::lower_bound(&gEnergies_T1990[0],
|
||||
&gEnergies_T1990[2],
|
||||
k_eV);
|
||||
lowBin = it-&gEnergies_T1990[0];
|
||||
upBin = lowBin+1;
|
||||
}
|
||||
|
||||
double lowE = gEnergies_T1990[lowBin];
|
||||
double upE = gEnergies_T1990[upBin];
|
||||
|
||||
// G4cout << lowE << " " << upE << G4endl;
|
||||
|
||||
double lowS = gStdDev_T1990[lowBin];
|
||||
double upS = gStdDev_T1990[upBin];
|
||||
|
||||
double tanA = (lowS-upS)/(lowE-upE);
|
||||
double sigma3D = lowS + (k_eV-lowE)*tanA;
|
||||
return sigma3D;
|
||||
}
|
||||
|
||||
double Terrisol1990::GetRmean(double energy){
|
||||
double sigma3D=Get3DStdDeviation(energy);
|
||||
|
||||
static constexpr double s2r=1.595769121605731;
|
||||
// pow(2,3./2.)/sqrt(CLHEP::pi)
|
||||
|
||||
double r_mean=sigma3D*s2r;
|
||||
r_mean*=CLHEP::nanometer;
|
||||
return r_mean;
|
||||
}
|
||||
|
||||
void Terrisol1990::GetPenetration(G4double energy,
|
||||
G4ThreeVector& displacement){
|
||||
double sigma3D=Get3DStdDeviation(energy);
|
||||
// G4cout << "sigma3D = " << sigma3D/CLHEP::nanometer << G4endl;
|
||||
|
||||
static constexpr double factor = 2.20496999539;
|
||||
// 1./(3. - 8./CLHEP::pi);
|
||||
|
||||
double sigma1D = std::sqrt(std::pow(sigma3D, 2.)*factor);
|
||||
|
||||
// G4cout << "sigma1D = " << sigma1D/CLHEP::nanometer << G4endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
double x = G4RandGauss::shoot(0.,sigma1D);
|
||||
double y = G4RandGauss::shoot(0.,sigma1D);
|
||||
double z = G4RandGauss::shoot(0.,sigma1D);
|
||||
displacement=G4ThreeVector(x,y,z);
|
||||
// G4cout << "displacement[nm]: "
|
||||
// << displacement.mag()/CLHEP::nanometer << G4endl;
|
||||
void GetGaussianPenetrationFromRmean3D(G4double r_mean,
|
||||
G4ThreeVector& displacement)
|
||||
{
|
||||
if(r_mean == 0)
|
||||
{
|
||||
// rare events:
|
||||
// prevent H2O and secondary electron from being placed at the same position
|
||||
displacement = G4RandomDirection() * (1e-3*CLHEP::nanometer);
|
||||
return;
|
||||
}
|
||||
}}
|
||||
|
||||
static constexpr double convertRmean3DToSigma1D = 0.62665706865775006;
|
||||
// = sqrt(CLHEP::pi)/pow(2,3./2.)
|
||||
|
||||
// Use r_mean to build a 3D gaussian
|
||||
const double sigma1D = r_mean * convertRmean3DToSigma1D;
|
||||
displacement = G4ThreeVector(G4RandGauss::shoot(0, sigma1D),
|
||||
G4RandGauss::shoot(0, sigma1D),
|
||||
G4RandGauss::shoot(0, sigma1D));
|
||||
}
|
||||
|
||||
void Meesungnoen2002::GetPenetration(G4double k,
|
||||
G4ThreeVector& displacement)
|
||||
{
|
||||
GetGaussianPenetrationFromRmean3D(GetRmean(k), displacement);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
void Ritchie1994::GetPenetration(G4double k,
|
||||
G4ThreeVector& displacement)
|
||||
{
|
||||
GetGaussianPenetrationFromRmean3D(k/eV * 1.8 * nm, // r_mean
|
||||
displacement);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
double Terrisol1990::Get3DStdDeviation(double energy){
|
||||
G4double k_eV = energy/eV;
|
||||
if(k_eV < 0.2){
|
||||
// rare events:
|
||||
// prevent H2O and secondary electron to be at the spot
|
||||
return 1e-3*CLHEP::nanometer;
|
||||
}
|
||||
else if(k_eV == 9.){
|
||||
return gStdDev_T1990[10];
|
||||
}
|
||||
else if(k_eV > 9.){
|
||||
G4ExceptionDescription description;
|
||||
description << "Terrisol1990 is not tabulated for energies greater than 9eV";
|
||||
G4Exception("Terrisol1990::Get3DStdDeviation",
|
||||
"INVALID_ARGUMENT",
|
||||
FatalErrorInArgument,
|
||||
description);
|
||||
}
|
||||
|
||||
size_t lowBin, upBin;
|
||||
|
||||
if(k_eV >= 1.){
|
||||
lowBin=std::floor(k_eV)+1;
|
||||
upBin=std::min(lowBin+1, size_t(10));
|
||||
}
|
||||
else{
|
||||
auto it=std::lower_bound(&gEnergies_T1990[0],
|
||||
&gEnergies_T1990[2],
|
||||
k_eV);
|
||||
lowBin = it-&gEnergies_T1990[0];
|
||||
upBin = lowBin+1;
|
||||
}
|
||||
|
||||
double lowE = gEnergies_T1990[lowBin];
|
||||
double upE = gEnergies_T1990[upBin];
|
||||
|
||||
double lowS = gStdDev_T1990[lowBin];
|
||||
double upS = gStdDev_T1990[upBin];
|
||||
|
||||
double tanA = (lowS-upS)/(lowE-upE);
|
||||
double sigma3D = lowS + (k_eV-lowE)*tanA;
|
||||
return sigma3D;
|
||||
}
|
||||
|
||||
double Terrisol1990::GetRmean(double energy){
|
||||
double sigma3D=Get3DStdDeviation(energy);
|
||||
|
||||
static constexpr double s2r=1.595769121605731; // = pow(2,3./2.)/sqrt(CLHEP::pi)
|
||||
|
||||
double r_mean=sigma3D*s2r;
|
||||
return r_mean;
|
||||
}
|
||||
|
||||
void Terrisol1990::GetPenetration(G4double energy,
|
||||
G4ThreeVector& displacement){
|
||||
double sigma3D = Get3DStdDeviation(energy);
|
||||
|
||||
static constexpr double factor = 2.20496999539; // = 1./(3. - 8./CLHEP::pi);
|
||||
|
||||
double sigma1D = std::sqrt(std::pow(sigma3D, 2.)*factor);
|
||||
|
||||
displacement = G4ThreeVector(G4RandGauss::shoot(0, sigma1D),
|
||||
G4RandGauss::shoot(0, sigma1D),
|
||||
G4RandGauss::shoot(0, sigma1D));
|
||||
}
|
||||
|
||||
} // Penetration
|
||||
} // DNA
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
G4VEmModel* G4DNASolvationModelFactory::Create(const G4String& penetrationModel)
|
||||
{
|
||||
G4String modelNamePrefix("DNAOneStepThermalizationModel_");
|
||||
|
||||
if(penetrationModel == "Terrisol1990")
|
||||
{
|
||||
return new G4TDNAOneStepThermalizationModel<DNA::Penetration::Terrisol1990>(G4Electron::Definition(), modelNamePrefix + penetrationModel);
|
||||
}
|
||||
else if(penetrationModel == "Meesungnoen2002")
|
||||
{
|
||||
return new G4TDNAOneStepThermalizationModel<DNA::Penetration::Meesungnoen2002>(G4Electron::Definition(), modelNamePrefix + penetrationModel);
|
||||
}
|
||||
else if(penetrationModel == "Ritchie1994")
|
||||
{
|
||||
return new G4TDNAOneStepThermalizationModel<DNA::Penetration::Ritchie1994>(G4Electron::Definition(), modelNamePrefix + penetrationModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4ExceptionDescription description;
|
||||
description << penetrationModel + " is not a valid model name.";
|
||||
G4Exception("G4DNASolvationModelFactory::Create",
|
||||
"INVALID_ARGUMENT",
|
||||
FatalErrorInArgument,
|
||||
description,
|
||||
"Options are: Terrisol1990, Meesungnoen2002, Ritchie1994.");
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
G4VEmModel* G4DNASolvationModelFactory::GetMacroDefinedModel()
|
||||
{
|
||||
auto dnaSubType = G4EmParameters::Instance()->DNAeSolvationSubType();
|
||||
|
||||
switch(dnaSubType)
|
||||
{
|
||||
case fRitchie1994eSolvation:
|
||||
return Create("Ritchie1994");
|
||||
case fTerrisol1990eSolvation:
|
||||
return Create("Terrisol1990");
|
||||
case fMeesungnoen2002eSolvation:
|
||||
case fDNAUnknownModel:
|
||||
return Create("Meesungnoen2002");
|
||||
default:
|
||||
G4Exception("G4DNASolvationModelFactory::GetMacroDefinedModel",
|
||||
"DnaSubType",
|
||||
FatalErrorInArgument,
|
||||
"The solvation parameter stored in G4EmParameters is unknown. Supported types are: fRitchie1994eSolvation, fTerrisol1990eSolvation, fMeesungnoen2002eSolvation.");
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ void G4LEPTSDiffXS::readDXS( ) {
|
||||
//G4cout << "Reading2 " << fileName << G4endl;
|
||||
|
||||
//NumAng = 181;
|
||||
fscanf(fp, "%d %d %s", &NumAng, &NumEn, DXSTypeName);
|
||||
(void) fscanf(fp, "%d %d %s", &NumAng, &NumEn, DXSTypeName);
|
||||
if( !strcmp(DXSTypeName, "KTC") ) DXSType = 2; // read DXS & calculate KT
|
||||
else if( !strcmp(DXSTypeName, "KT") ) DXSType = 1; // read DXS & KT
|
||||
else DXSType = 0;
|
||||
@@ -77,7 +77,7 @@ void G4LEPTSDiffXS::readDXS( ) {
|
||||
// << "DXSType " << DXSTypeName << " " << DXSType << G4endl;
|
||||
|
||||
for (G4int eBin=1; eBin<=NumEn; eBin++){
|
||||
fscanf(fp,"%f ",&data);
|
||||
(void) fscanf(fp,"%f ",&data);
|
||||
Eb[eBin] = (G4double)data;
|
||||
}
|
||||
|
||||
@@ -87,10 +87,10 @@ void G4LEPTSDiffXS::readDXS( ) {
|
||||
if(DXSType==1) {
|
||||
G4cout << "DXSTYpe 1" << G4endl;
|
||||
for (G4int aBin=0;aBin<NumAng;aBin++){
|
||||
fscanf(fp,"%f ",&data);
|
||||
(void) fscanf(fp,"%f ",&data);
|
||||
DXS[0][aBin]=(G4double)data;
|
||||
for (G4int eBin=1;eBin<=NumEn;eBin++){
|
||||
fscanf(fp,"%f %f ",&data2, &data);
|
||||
(void) fscanf(fp,"%f %f ",&data2, &data);
|
||||
DXS[eBin][aBin]=(G4double)data;
|
||||
KT[eBin][aBin]=(G4double)data2;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ void G4LEPTSDiffXS::readDXS( ) {
|
||||
else {
|
||||
for(G4int aBin=0; aBin<NumAng; aBin++){
|
||||
for(G4int eBin=0; eBin<=NumEn; eBin++){
|
||||
fscanf(fp,"%f ",&data);
|
||||
(void) fscanf(fp,"%f ",&data);
|
||||
DXS[eBin][aBin] = (G4double)data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,21 +52,21 @@ void G4LEPTSElossDistr::ReadFile()
|
||||
G4int nEnergies;
|
||||
G4int nAngles;
|
||||
G4int nData;
|
||||
fscanf(fp,"%i \n",&nEnergies);
|
||||
(void) fscanf(fp,"%i \n",&nEnergies);
|
||||
for( G4int ie = 0; ie < nEnergies; ie++ ){
|
||||
float energySep;
|
||||
fscanf(fp,"%f \n",&energySep);
|
||||
fscanf(fp,"%i \n",&nAngles);
|
||||
(void) fscanf(fp,"%f \n",&energySep);
|
||||
(void) fscanf(fp,"%i \n",&nAngles);
|
||||
for( G4int ia = 0; ia < nAngles; ia++ ){
|
||||
float angleSep;
|
||||
fscanf(fp,"%f \n",&angleSep);
|
||||
(void) fscanf(fp,"%f \n",&angleSep);
|
||||
G4LEPTSDistribution* dist = new G4LEPTSDistribution();
|
||||
theNDistributions ++;
|
||||
mddist angleDist;
|
||||
angleDist[angleSep] = dist;
|
||||
theDistributions[energySep] = angleDist;
|
||||
|
||||
fscanf(fp,"%i \n",&nData);
|
||||
(void) fscanf(fp,"%i \n",&nData);
|
||||
if( dist->ReadFile( fp, nData ) ) {
|
||||
G4Exception("G4LEPTSElossDistr",
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user