38#define CHAMPION_VERBOSE
57#ifdef CHAMPION_VERBOSE
60 G4cout <<
"Champion Elastic model is constructed "
70 fpMolWaterDensity = 0;
79 if(fpData)
delete fpData;
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 "
123 if (isInitialised) {
return; }
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",
172 eDiffCrossSectionData.clear();
176 eTdummyVec.push_back(0.);
178 while(!eDiffCrossSection.eof())
182 eDiffCrossSection >> tDummy >> eDummy;
186 if (tDummy != eTdummyVec.back())
188 eTdummyVec.push_back(tDummy);
189 eVecm[tDummy].push_back(0.);
192 eDiffCrossSection >> eDiffCrossSectionData[tDummy][eDummy];
194 if (eDummy != eVecm[tDummy].back()) eVecm[tDummy].push_back(eDummy);
199#ifdef CHAMPION_VERBOSE
202 if (verboseLevel > 2)
204 G4cout <<
"Loaded cross section files for Champion Elastic model" <<
G4endl;
207 G4cout <<
"Champion Elastic model is initialized " <<
G4endl
222 isInitialised =
true;
240#ifdef CHAMPION_VERBOSE
241 if (verboseLevel > 3)
243 G4cout <<
"Calling CrossSectionPerVolume() of G4DNAChampionElasticModel"
260#ifdef CHAMPION_VERBOSE
261 if (verboseLevel > 2)
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
285 if (verboseLevel > 3)
287 G4cout <<
"Calling SampleSecondaries() of G4DNAChampionElasticModel" <<
G4endl;
293 G4double cosTheta = RandomizeCosTheta(electronEnergy0);
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(),
332 eTdummyVec.end(), k);
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;
352 xs11 = eDiffCrossSectionData[valueT1][valueE11];
353 xs12 = eDiffCrossSectionData[valueT1][valueE12];
354 xs21 = eDiffCrossSectionData[valueT2][valueE21];
355 xs22 = eDiffCrossSectionData[valueT2][valueE22];
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);
375 G4double value =
G4Exp(d1 + (d2 - d1) * (e - e1) / (e2 - e1));
389 G4double value = (d1 + (d2 - d1) * (e - e1) / (e2 - e1));
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));
438 G4double interpolatedvalue1 = LinLinInterpolate(e11, e12, e, xs11, xs12);
439 G4double interpolatedvalue2 = LinLinInterpolate(e21, e22, e, xs21, xs22);
440 G4double value = LinLinInterpolate(t1, t2, t, interpolatedvalue1,
453 integrdiff = uniformRand;
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",
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
void SetKillBelowThreshold(G4double threshold)
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 &)
virtual ~G4DNAChampionElasticModel()
G4DNAChampionElasticModel(const G4ParticleDefinition *p=0, const G4String &nam="DNAChampionElasticModel")
G4ParticleChangeForGamma * fParticleChangeForGamma
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)