52 killBelowEnergy = 100 *
eV;
53 lowEnergyLimit = 0 *
eV;
54 highEnergyLimit = 1 *
MeV;
68 G4cout <<
"Ion elastic model is constructed " <<
G4endl<<
"Energy range: "
69 << lowEnergyLimit /
eV <<
" eV - "
70 << highEnergyLimit /
MeV <<
" MeV"
74 fpMolWaterDensity = 0;
88 if(fpTableData)
delete fpTableData;
101 G4cout <<
"Calling G4DNAIonElasticModel::Initialise()" <<
G4endl;
108 G4cout <<
"G4DNAIonElasticModel: low energy limit increased from " <<
115 G4cout <<
"G4DNAIonElasticModel: high energy limit decreased from " <<
124 char *path = getenv(
"G4LEDATA");
128 G4Exception(
"G4IonElasticModel::Initialise",
"em0006",
134 std::ostringstream fullFileName;
147 (particleDefinition == protonDef && protonDef != 0)
149 (particleDefinition == hydrogenDef && hydrogenDef != 0)
154 totalXSFile =
"dna/sigma_elastic_proton_HTran";
157 fullFileName << path <<
"/dna/sigmadiff_cumulated_elastic_proton_HTran.dat";
161 (particleDefinition == instance->
GetIon(
"helium") && heliumDef)
163 (particleDefinition == instance->
GetIon(
"alpha+") && alphaplusDef)
165 (particleDefinition == instance->
GetIon(
"alpha++") && alphaplusplusDef)
170 totalXSFile =
"dna/sigma_elastic_alpha_HTran";
173 fullFileName << path <<
"/dna/sigmadiff_cumulated_elastic_alpha_HTran.dat";
178 std::ifstream diffCrossSection(fullFileName.str().c_str());
180 if (!diffCrossSection)
183 description <<
"Missing data file:"
184 <<fullFileName.str().c_str()<<
G4endl;
185 G4Exception(
"G4IonElasticModel::Initialise",
"em0003",
194 fDiffCrossSectionData.clear();
198 eTdummyVec.push_back(0.);
200 while(!diffCrossSection.eof())
204 diffCrossSection>>tDummy>>eDummy;
208 if (tDummy != eTdummyVec.back())
210 eTdummyVec.push_back(tDummy);
211 eVecm[tDummy].push_back(0.);
214 diffCrossSection>>fDiffCrossSectionData[tDummy][eDummy];
216 if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
223 if (verboseLevel > 2)
225 G4cout <<
"Loaded cross section files for ion elastic model" <<
G4endl;
242 isInitialised =
true;
254 G4cout <<
"Calling CrossSectionPerVolume() of G4DNAIonElasticModel"
264 if(waterDensity!= 0.0)
268 if (ekin < highEnergyLimit)
271 if (ekin < killBelowEnergy)
return DBL_MAX;
274 if (fpTableData != 0)
280 G4Exception(
"G4DNAIonElasticModel::ComputeCrossSectionPerVolume",
"em0002",
285 if (verboseLevel > 2)
287 G4cout <<
"__________________________________" <<
G4endl;
288 G4cout <<
"G4DNAIonElasticModel - XS INFO START" <<
G4endl;
289 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
290 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
291 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
292 G4cout <<
"G4DNAIonElasticModel - XS INFO END" <<
G4endl;
297 return sigma*waterDensity;
304 std::vector<G4DynamicParticle*>* ,
311 G4cout <<
"Calling SampleSecondaries() of G4DNAIonElasticModel" <<
G4endl;
316 if (particleEnergy0 < killBelowEnergy)
324 if (particleEnergy0>= killBelowEnergy && particleEnergy0 < highEnergyLimit)
333 /(fParticle_Mass/water_mass+std::cos(thetaCM*
CLHEP::pi/180)));
345 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
347 xDir *= std::cos(phi);
348 yDir *= std::sin(phi);
350 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
357 depositEnergyCM = 4. * particleEnergy0 * fParticle_Mass * water_mass *
359 / (2 * std::pow((fParticle_Mass+water_mass),2));
362 if (!statCode && (particleEnergy0 >= depositEnergyCM) )
390 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),
391 eTdummyVec.end(), k);
392 std::vector<double>::iterator
t1 = t2 - 1;
394 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),
397 std::vector<double>::iterator e11 = e12 - 1;
399 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),
402 std::vector<double>::iterator e21 = e22 - 1;
411 xs11 = fDiffCrossSectionData[valueT1][valueE11];
412 xs12 = fDiffCrossSectionData[valueT1][valueE12];
413 xs21 = fDiffCrossSectionData[valueT2][valueE21];
414 xs22 = fDiffCrossSectionData[valueT2][valueE22];
416 if(xs11 == 0 && xs12 == 0 && xs21 == 0 && xs22 == 0)
return (0.);
418 theta = QuadInterpolator(valueE11, valueE12, valueE21, valueE22, xs11, xs12,
419 xs21, xs22, valueT1, valueT2, k, integrDiff);
454 G4double a = (std::log10(xs2) - std::log10(xs1))
455 / (std::log10(e2) - std::log10(e1));
456 G4double b = std::log10(xs2) - a * std::log10(e2);
458 G4double value = (std::pow(10., sigma));
487 G4double interpolatedvalue1 = LinLinInterpolate(e11, e12, e, xs11, xs12);
488 G4double interpolatedvalue2 = LinLinInterpolate(e21, e22, e, xs21, xs22);
489 G4double value = LinLinInterpolate(t1, t2, t, interpolatedvalue1,
498 G4DNAIonElasticModel::RandomizeThetaCM (
502 return Theta(particleDefinition, k /
eV, integrdiff);
510 killBelowEnergy = threshold;
512 if(killBelowEnergy < 100 *
eV)
514 G4cout <<
"*** WARNING : the G4DNAIonElasticModel class is not "
515 "activated below 100 eV !"
G4double LowEnergyLimit() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
G4double HighEnergyLimit() const
std::vector< ExP01TrackerHit * > a
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
virtual G4bool LoadData(const G4String &argFileName)
G4ParticleDefinition * GetDefinition() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
void SetKillBelowThreshold(G4double threshold)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetHighEnergyLimit(G4double)
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
G4ParticleChangeForGamma * fParticleChangeForGamma
const G4ThreeVector & GetMomentumDirection() const
virtual void Initialise(const G4ParticleDefinition *particuleDefinition, const G4DataVector &)
static constexpr double cm
static constexpr double eV
static G4DNAGenericIonsManager * Instance(void)
virtual G4double FindValue(G4double e, G4int componentId=0) const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual ~G4DNAIonElasticModel()
static G4DNAMolecularMaterial * Instance()
static G4ParticleTable * GetParticleTable()
Hep3Vector orthogonal() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
static constexpr double MeV
static MCTruthManager * instance
Hep3Vector cross(const Hep3Vector &) const
void ProposeTrackStatus(G4TrackStatus status)
void SetLowEnergyLimit(G4double)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
static constexpr double pi
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4DNAIonElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAIonElasticModel")
G4ParticleDefinition * GetIon(const G4String &name)