77 G4cout <<
"CPA100 Elastic model is constructed " <<
G4endl
99 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
119 #ifdef UEHARA_VERBOSE
121 G4cout <<
"Calling G4DNACPA100ElasticModel::Initialise()" <<
G4endl;
126 G4Exception(
"*** WARNING: the G4DNACPA100ElasticModel is "
127 "not intented to be used with another particle than the electron",
135 G4cout <<
"G4DNACPA100ElasticModel: low energy limit increased from " <<
142 G4cout <<
"G4DNACPA100ElasticModel: high energy limit decreased from " <<
152 G4String fileElectron(
"dna/sigma_elastic_e_cpa100");
181 char *path = getenv(
"G4LEDATA");
185 G4Exception(
"G4DNACPA100ElasticModel::Initialise",
"em0006",
190 std::ostringstream eFullFileName;
192 eFullFileName << path
193 <<
"/dna/sigmadiff_cumulated_elastic_e_cpa100.dat";
194 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
196 if (!eDiffCrossSection)
197 G4Exception(
"G4DNACPA100ElasticModel::Initialise",
"em0003",
199 "Missing data file:/dna/sigmadiff_cumulated_elastic_e_cpa100.dat");
212 while(!eDiffCrossSection.eof())
216 eDiffCrossSection>>tDummy>>eDummy;
223 eVecm[tDummy].push_back(0.);
228 if (eDummy !=
eVecm[tDummy].back())
eVecm[tDummy].push_back(eDummy);
234 #ifdef UEHARA_VERBOSE
236 G4cout <<
"Loaded cross section files for CPA100 Elastic model" <<
G4endl;
239 #ifdef UEHARA_VERBOSE
242 G4cout <<
"CPA100 Elastic model is initialized " << G4endl
270 #ifdef UEHARA_VERBOSE
271 if (verboseLevel > 3)
273 "Calling CrossSectionPerVolume() of G4DNACPA100ElasticModel" <<
G4endl;
282 if(waterDensity!= 0.0)
286 if (ekin < HighEnergyLimit() && ekin >= LowEnergyLimit())
291 std::map< G4String,G4DNACrossSectionDataSet*,std::less<G4String> >::iterator
pos;
292 pos = tableData.find(particleName);
294 if (pos != tableData.end())
335 G4Exception(
"G4DNACPA100ElasticModel::ComputeCrossSectionPerVolume",
342 #ifdef UEHARA_VERBOSE
343 if (verboseLevel > 2)
345 G4cout <<
"__________________________________" <<
G4endl;
346 G4cout <<
"G4DNACPA100ElasticModel - XS INFO START" <<
G4endl;
347 G4cout <<
"Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << particleName <<
G4endl;
348 G4cout <<
"Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
349 G4cout <<
"Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
352 G4cout <<
"G4DNACPA100ElasticModel - XS INFO END" <<
G4endl;
358 return sigma*waterDensity;
369 #ifdef UEHARA_VERBOSE
371 G4cout <<
"Calling SampleSecondaries() of G4DNACPA100ElasticModel" <<
G4endl;
391 G4double CT1, ST1, CF1, SF1, CT2, ST2, CF2, SF2;
392 G4double sinTheta = std::sqrt (1-cosTheta*cosTheta);
404 ST1=std::sqrt(1.-CT1*CT1);
406 if (ST1!=0) CF1 = zVers.
x()/ST1;
else CF1 = std::cos(2. *
pi *
G4UniformRand());
407 if (ST1!=0) SF1 = zVers.
y()/ST1;
else SF1 = std::sqrt(1.-CF1*CF1);
416 A3 = sinTheta*std::cos(phi);
417 A4 = A3*CT1 + ST1*cosTheta;
418 A5 = sinTheta * std::sin(phi);
419 A2 = A4 * SF1 + A5 * CF1;
420 A1 = A4 * CF1 - A5 * SF1;
422 CT2 = CT1*cosTheta - ST1*A3;
423 ST2 = std::sqrt(1.-CT2*CT2);
425 if (ST2==0) ST2=1
E-6;
455 (electronEnergy0-1.214
E-4*(1.-cosTheta)*electronEnergy0);
485 std::vector<G4double>::iterator
t2 = std::upper_bound(eTdummyVec.begin(),eTdummyVec.end(), k);
486 std::vector<G4double>::iterator
t1 = t2-1;
488 std::vector<G4double>::iterator e12 = std::upper_bound(eVecm[(*t1)].begin(),eVecm[(*t1)].end(),
490 std::vector<G4double>::iterator e11 = e12-1;
492 std::vector<G4double>::iterator e22 = std::upper_bound(eVecm[(*t2)].begin(),eVecm[(*t2)].end(),
494 std::vector<G4double>::iterator e21 = e22-1;
503 xs11 = eDiffCrossSectionData[valueT1][valueE11];
504 xs12 = eDiffCrossSectionData[valueT1][valueE12];
505 xs21 = eDiffCrossSectionData[valueT2][valueE21];
506 xs22 = eDiffCrossSectionData[valueT2][valueE22];
513 if (xs11==0 && xs12==0 && xs21==0 && xs22==0)
return (0.);
518 theta = QuadInterpolator ( valueE11, valueE12,
542 G4double value = std::exp(d1 + (d2 - d1)*(e - e1)/ (e2 - e1));
568 G4double a = (std::log10(xs2)-std::log10(xs1)) / (std::log10(e2)-std::log10(e1));
569 G4double b = std::log10(xs2) - a*std::log10(e2);
570 G4double sigma = a*std::log10(e) + b;
613 integrdiff = uniformRand;
virtual G4bool LoadData(const G4String &argFileName)
std::vector< ExP01TrackerHit * > a
static const G4double pos
void SetHighEnergyLimit(G4double)
G4ParticleChangeForGamma * fParticleChangeForGamma
static constexpr double keV
const G4ThreeVector & GetMomentumDirection() const
const G4String & GetParticleName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
G4double LowEnergyLimit() const
const std::vector< double > * GetNumMolPerVolTableFor(const G4Material *) const
Retrieve a table of molecular densities (number of molecules per unit volume) in the G4 unit system f...
G4double RandomizeCosTheta(G4double k)
static constexpr double m
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
const XML_Char int const XML_Char * value
static G4DNAMolecularMaterial * Instance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual ~G4DNACPA100ElasticModel()
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
static constexpr double eV
G4double QuadInterpolator(G4double e11, G4double e12, G4double e21, G4double e22, G4double x11, G4double x12, G4double x21, G4double x22, G4double t1, G4double t2, G4double t, G4double e)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
static G4Electron * ElectronDefinition()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetLowEnergyLimit(G4double)
std::vector< G4double > eTdummyVec
G4DNACPA100ElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNACPA100ElasticModel")
const std::vector< G4double > * fpMolWaterDensity
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double GetKineticEnergy() const
virtual G4double FindValue(G4double e, G4int componentId=0) const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
G4double Theta(G4ParticleDefinition *aParticleDefinition, G4double k, G4double integrDiff)
static constexpr double pi
G4ParticleChangeForGamma * GetParticleChangeForGamma()
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double HighEnergyLimit() const
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
TriDimensionMap eDiffCrossSectionData