39 #define CHAMPION_VERBOSE
58 #ifdef CHAMPION_VERBOSE
61 G4cout <<
"Champion Elastic model is constructed "
91 #ifdef CHAMPION_VERBOSE
94 G4cout <<
"Calling G4DNAChampionElasticModel::Initialise()" <<
G4endl;
100 G4Exception(
"G4DNAChampionElasticModel::Initialise",
103 "Model not applicable to particle type.");
110 G4cout <<
"G4DNAChampionElasticModel: low energy limit increased from "
118 G4cout <<
"G4DNAChampionElasticModel: high energy limit decreased from "
132 G4String fileElectron(
"dna/sigma_elastic_e_champion");
141 char *path = getenv(
"G4LEDATA");
148 "G4LEDATA environment variable not set.");
152 std::ostringstream eFullFileName;
153 eFullFileName << path <<
"/dna/sigmadiff_cumulated_elastic_e_champion_hp.dat";
154 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
156 if (!eDiffCrossSection)
159 errMsg <<
"Missing data file:/dna/sigmadiff_cumulated_elastic_e_champion_hp.dat; "
160 <<
"please use G4EMLOW6.36 and above.";
162 G4Exception(
"G4DNAChampionElasticModel::Initialise",
179 while(!eDiffCrossSection.eof())
183 eDiffCrossSection >> tDummy >> eDummy;
190 eVecm[tDummy].push_back(0.);
195 if (eDummy !=
eVecm[tDummy].back())
eVecm[tDummy].push_back(eDummy);
199 #ifdef CHAMPION_VERBOSE
204 G4cout <<
"Loaded cross section files for Champion Elastic model" <<
G4endl;
207 G4cout <<
"Champion Elastic model is initialized " <<
G4endl
240 #ifdef CHAMPION_VERBOSE
243 G4cout <<
"Calling CrossSectionPerVolume() of G4DNAChampionElasticModel"
253 if(waterDensity!= 0.0)
262 #ifdef CHAMPION_VERBOSE
265 G4cout <<
"__________________________________" <<
G4endl;
266 G4cout <<
"=== G4DNAChampionElasticModel - XS INFO START" <<
G4endl;
267 G4cout <<
"=== Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << p->GetParticleName() <<
G4endl;
268 G4cout <<
"=== Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
269 G4cout <<
"=== Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) << G4endl;
270 G4cout <<
"=== G4DNAChampionElasticModel - XS INFO END" <<
G4endl;
275 return sigma*waterDensity;
287 #ifdef CHAMPION_VERBOSE
290 G4cout <<
"Calling SampleSecondaries() of G4DNAChampionElasticModel" <<
G4endl;
306 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
308 xDir *= std::cos(phi);
309 yDir *= std::sin(phi);
311 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
340 std::vector<G4double>::iterator
t2 = std::upper_bound(
eTdummyVec.begin(),
342 std::vector<G4double>::iterator
t1 = t2 - 1;
344 std::vector<G4double>::iterator e12 = std::upper_bound(
eVecm[(*t1)].begin(),
347 std::vector<G4double>::iterator e11 = e12 - 1;
349 std::vector<G4double>::iterator e22 = std::upper_bound(
eVecm[(*t2)].begin(),
352 std::vector<G4double>::iterator e21 = e22 - 1;
367 if (xs11 == 0 && xs12 == 0 && xs21 == 0 && xs22 == 0)
return (0.);
369 theta =
QuadInterpolator(valueE11, valueE12, valueE21, valueE22, xs11, xs12,
370 xs21, xs22, valueT1, valueT2, k, integrDiff);
411 G4double a = (std::log10(xs2) - std::log10(xs1))
412 / (std::log10(e2) - std::log10(e1));
413 G4double b = std::log10(xs2) - a * std::log10(e2);
414 G4double sigma = a * std::log10(e) + b;
463 integrdiff = uniformRand;
470 cosTheta = std::cos(theta *
pi / 180);
480 errMsg <<
"The method G4DNAChampionElasticModel::SetKillBelowThreshold is deprecated";
482 G4Exception(
"G4DNAChampionElasticModel::SetKillBelowThreshold",
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual ~G4DNAChampionElasticModel()
TriDimensionMap eDiffCrossSectionData
virtual G4bool LoadData(const G4String &argFileName)
std::ostringstream G4ExceptionDescription
std::vector< ExP01TrackerHit * > a
G4ParticleChangeForGamma * fParticleChangeForGamma
static constexpr double MeV
void SetHighEnergyLimit(G4double)
const G4ThreeVector & GetMomentumDirection() const
G4double RandomizeCosTheta(G4double k)
const G4String & GetParticleName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
void SetKillBelowThreshold(G4double threshold)
G4double LowEnergyLimit() const
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
G4DNAChampionElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAChampionElasticModel")
const XML_Char int const XML_Char * value
static G4DNAMolecularMaterial * Instance()
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
const std::vector< G4double > * fpMolWaterDensity
static constexpr double eV
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
Hep3Vector cross(const Hep3Vector &) const
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
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)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
void SetLowEnergyLimit(G4double)
G4DNACrossSectionDataSet * fpData
G4double GetKineticEnergy() const
virtual G4double FindValue(G4double e, G4int componentId=0) const
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > eTdummyVec
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
Hep3Vector orthogonal() const
static constexpr double pi
G4ParticleChangeForGamma * GetParticleChangeForGamma()
G4double Theta(G4double k, G4double integrDiff)
G4double HighEnergyLimit() const