38#define CHAMPION_VERBOSE
57#ifdef CHAMPION_VERBOSE
60 G4cout <<
"Champion Elastic model is constructed "
90#ifdef CHAMPION_VERBOSE
93 G4cout <<
"Calling G4DNAChampionElasticModel::Initialise()" <<
G4endl;
99 G4Exception(
"G4DNAChampionElasticModel::Initialise",
102 "Model not applicable to particle type.");
109 G4cout <<
"G4DNAChampionElasticModel: low energy limit increased from "
117 G4cout <<
"G4DNAChampionElasticModel: high energy limit decreased from "
131 G4String fileElectron(
"dna/sigma_elastic_e_champion");
140 char *path = getenv(
"G4LEDATA");
147 "G4LEDATA environment variable not set.");
151 std::ostringstream eFullFileName;
152 eFullFileName << path <<
"/dna/sigmadiff_cumulated_elastic_e_champion_hp.dat";
153 std::ifstream eDiffCrossSection(eFullFileName.str().c_str());
155 if (!eDiffCrossSection)
158 errMsg <<
"Missing data file:/dna/sigmadiff_cumulated_elastic_e_champion_hp.dat; "
159 <<
"please use G4EMLOW6.36 and above.";
161 G4Exception(
"G4DNAChampionElasticModel::Initialise",
178 while(!eDiffCrossSection.eof())
182 eDiffCrossSection >> tDummy >> eDummy;
189 eVecm[tDummy].push_back(0.);
194 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"
260#ifdef CHAMPION_VERBOSE
263 G4cout <<
"__________________________________" <<
G4endl;
264 G4cout <<
"=== G4DNAChampionElasticModel - XS INFO START" <<
G4endl;
265 G4cout <<
"=== Kinetic energy(eV)=" << ekin/
eV <<
" particle : " << p->GetParticleName() <<
G4endl;
266 G4cout <<
"=== Cross section per water molecule (cm^2)=" << sigma/
cm/
cm <<
G4endl;
267 G4cout <<
"=== Cross section per water molecule (cm^-1)=" << sigma*waterDensity/(1./
cm) <<
G4endl;
268 G4cout <<
"=== G4DNAChampionElasticModel - XS INFO END" <<
G4endl;
272 return sigma*waterDensity;
284#ifdef CHAMPION_VERBOSE
287 G4cout <<
"Calling SampleSecondaries() of G4DNAChampionElasticModel" <<
G4endl;
301 G4double xDir = std::sqrt(1. - cosTheta*cosTheta);
303 xDir *= std::cos(phi);
304 yDir *= std::sin(phi);
306 G4ThreeVector zPrimeVers((xDir*xVers + yDir*yVers + cosTheta*zVers));
331 std::vector<G4double>::iterator t2 = std::upper_bound(
eTdummyVec.begin(),
333 std::vector<G4double>::iterator t1 = t2 - 1;
335 std::vector<G4double>::iterator e12 = std::upper_bound(
eVecm[(*t1)].begin(),
338 std::vector<G4double>::iterator e11 = e12 - 1;
340 std::vector<G4double>::iterator e22 = std::upper_bound(
eVecm[(*t2)].begin(),
343 std::vector<G4double>::iterator e21 = e22 - 1;
357 if (xs11 == 0 && xs12 == 0 && xs21 == 0 && xs22 == 0)
return (0.);
359 theta =
QuadInterpolator(valueE11, valueE12, valueE21, valueE22, xs11, xs12,
360 xs21, xs22, valueT1, valueT2, k, integrDiff);
401 G4double a = (std::log10(xs2) - std::log10(xs1))
402 / (std::log10(
e2) - std::log10(
e1));
403 G4double b = std::log10(xs2) - a * std::log10(
e2);
404 G4double sigma = a * std::log10(e) + b;
405 G4double value = (std::pow(10., sigma));
457 theta =
Theta(k /
eV, integrdiff);
459 cosTheta = std::cos(theta *
pi / 180);
469 errMsg <<
"The method G4DNAChampionElasticModel::SetKillBelowThreshold is deprecated";
471 G4Exception(
"G4DNAChampionElasticModel::SetKillBelowThreshold",
static const G4double e1[44]
static const G4double e2[44]
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.
static constexpr double eV
static constexpr double MeV
static constexpr double pi
static constexpr double cm
G4GLOB_DLL std::ostream G4cout
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
void SetKillBelowThreshold(G4double threshold)
G4double Theta(G4double k, G4double integrDiff)
TriDimensionMap eDiffCrossSectionData
std::vector< G4double > eTdummyVec
virtual G4double CrossSectionPerVolume(const G4Material *material, const G4ParticleDefinition *p, G4double ekin, G4double emin, G4double emax)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy)
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &)
G4double LinLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double LinLinInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
G4double LogLogInterpolate(G4double e1, G4double e2, G4double e, G4double xs1, G4double xs2)
virtual ~G4DNAChampionElasticModel()
G4DNAChampionElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAChampionElasticModel")
const std::vector< G4double > * fpMolWaterDensity
G4ParticleChangeForGamma * fParticleChangeForGamma
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)
G4double RandomizeCosTheta(G4double k)
G4DNACrossSectionDataSet * fpData
virtual G4double FindValue(G4double e, G4int componentId=0) const
virtual G4bool LoadData(const G4String &argFileName)
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)