61 G4cout <<
"ELSEPA Elastic model is constructed "
71 fpMolWaterDensity = 0;
80 if(fpData)
delete fpData;
94 G4cout <<
"Calling G4DNAELSEPAElasticModel::Initialise()" <<
G4endl;
103 "Model not applicable to particle type.");
110 G4cout <<
"G4DNAELSEPAElasticModel: low energy limit increased from "
118 G4cout <<
"G4DNAELSEPAElasticModel: high energy limit decreased from "
124 if (isInitialised) {
return; }
132 G4String fileElectron(
"dna/sigma_elastic_e_elsepa_muffin");
143 char *path = getenv(
"G4LEDATA");
150 "G4LEDATA environment variable not set.");
154 std::ostringstream eFullFileName;
159 eFullFileName << path <<
"/dna/sigmadiff_cumulated_elastic_e_elsepa_muffin.dat";
160 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
162 if (!eDiffCrossSection)
165 errMsg <<
"Missing data file:/dna/sigmadiff_cumulated_elastic_e_elsepa_muffin.dat; "
166 <<
"please use G4EMLOW7.8 and above.";
179 eDiffCrossSectionData.clear();
183 eTdummyVec.push_back(0.);
185 while(!eDiffCrossSection.eof())
189 eDiffCrossSection >> tDummy >> eDummy;
193 if (tDummy != eTdummyVec.back())
195 eTdummyVec.push_back(tDummy);
196 eVecm[tDummy].push_back(0.);
199 eDiffCrossSection >> eDiffCrossSectionData[tDummy][eDummy];
201 if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
208 if (verboseLevel > 2)
210 G4cout <<
"Loaded cross section files for ELSEPA Elastic model" <<
G4endl;
213 G4cout <<
"ELSEPA Elastic model is initialized " <<
G4endl
228 isInitialised =
true;
247 if (verboseLevel > 3)
249 G4cout <<
"Calling CrossSectionPerVolume() of G4DNAELSEPAElasticModel"
259 if(waterDensity!= 0.0)
269 if (verboseLevel > 2)
271 G4cout <<
"__________________________________" <<
G4endl;
272 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO START" <<
G4endl;
273 G4cout <<
"=== Kinetic energy(eV)=" << ekin/eV <<
" particle : " << p->GetParticleName() <<
G4endl;
274 G4cout <<
"=== Cross section per water molecule (cm^2)=" << sigma/cm/cm <<
G4endl;
275 G4cout <<
"=== Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./cm) <<
G4endl;
276 G4cout <<
"=== G4DNAELSEPAElasticModel - XS INFO END" <<
G4endl;
281 return sigma*waterDensity;
295 if (verboseLevel > 3)
297 G4cout <<
"Calling SampleSecondaries() of G4DNAELSEPAElasticModel" <<
G4endl;
305 G4double cosTheta = RandomizeCosTheta(electronEnergy0);
313 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
315 xDir *= std::cos(phi);
316 yDir *= std::sin(phi);
318 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
329G4double G4DNAELSEPAElasticModel::Theta(
347 std::vector<double>::iterator t2 = std::upper_bound(eTdummyVec.begin(),
348 eTdummyVec.end(), k);
349 std::vector<double>::iterator t1 = t2 - 1;
351 std::vector<double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),
354 std::vector<double>::iterator e11 = e12 - 1;
356 std::vector<double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),
359 std::vector<double>::iterator e21 = e22 - 1;
368 xs11 = eDiffCrossSectionData[valueT1][valueE11];
369 xs12 = eDiffCrossSectionData[valueT1][valueE12];
370 xs21 = eDiffCrossSectionData[valueT2][valueE21];
371 xs22 = eDiffCrossSectionData[valueT2][valueE22];
374 if (xs11 == 0 && xs12 == 0 && xs21 == 0 && xs22 == 0)
return (0.);
376 theta = QuadInterpolator(valueE11, valueE12, valueE21, valueE22, xs11, xs12,
377 xs21, xs22, valueT1, valueT2, k, integrDiff);
392 G4double value =
G4Exp(d1 + (d2 - d1) * (e - e1) / (e2 - e1));
406 G4double value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
418 G4double a = (std::log10(xs2) - std::log10(xs1))
419 / (std::log10(e2) - std::log10(e1));
420 G4double b = std::log10(xs2) - a * std::log10(e2);
421 G4double sigma = a * std::log10(e) + b;
422 G4double value = (std::pow(10., sigma));
455 G4double interpolatedvalue1 = LinLinInterpolate(e11, e12, e, xs11, xs12);
456 G4double interpolatedvalue2 = LinLinInterpolate(e21, e22, e, xs21, xs22);
457 G4double value = LinLinInterpolate(t1, t2, t, interpolatedvalue1,
470 integrdiff = uniformRand;
477 cosTheta = std::cos(theta * pi / 180);
487 errMsg <<
"The method G4DNAELSEPAElasticModel::SetKillBelowThreshold is deprecated";
489 G4Exception(
"G4DNAELSEPAElasticModel::SetKillBelowThreshold",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual G4bool LoadData(const G4String &argFileName)
virtual ~G4DNAELSEPAElasticModel()
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
G4DNAELSEPAElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAELSEPAElasticModel")
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
void SetKillBelowThreshold(G4double threshold)
G4ParticleChangeForGamma * fParticleChangeForGamma
static G4DNAMolecularMaterial * Instance()
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetLowEnergyLimit(G4double)