65 :
G4VEmModel(nam),fParticleChange(0),isInitialised(false),
66 scatterFunctionData(0),
67 crossSectionHandler(0),fAtomDeexcitation(0)
69 lowEnergyLimit = 250 *
eV;
70 highEnergyLimit = 100 *
GeV;
80 if( verboseLevel>0 ) {
81 G4cout <<
"Livermore Modified Compton model is constructed " <<
G4endl
83 << lowEnergyLimit /
eV <<
" eV - "
84 << highEnergyLimit /
GeV <<
" GeV"
97 delete crossSectionHandler;
98 delete scatterFunctionData;
106 if (verboseLevel > 2) {
107 G4cout <<
"Calling G4LivermoreComptonModifiedModel::Initialise()" <<
G4endl;
110 if (crossSectionHandler)
112 crossSectionHandler->
Clear();
113 delete crossSectionHandler;
115 delete scatterFunctionData;
119 G4String crossSectionFile =
"comp/ce-cs-";
120 crossSectionHandler->
LoadData(crossSectionFile);
123 G4String scatterFile =
"comp/ce-sf-";
125 scatterFunctionData->
LoadData(scatterFile);
134 if (verboseLevel > 2) {
135 G4cout <<
"Loaded cross section files for Livermore Modified Compton model" <<
G4endl;
138 if(isInitialised) {
return; }
139 isInitialised =
true;
145 if( verboseLevel>0 ) {
146 G4cout <<
"Livermore Compton model is initialized " <<
G4endl
162 if (verboseLevel > 3) {
163 G4cout <<
"Calling ComputeCrossSectionPerAtom() of G4LivermoreComptonModifiedModel" <<
G4endl;
165 if (GammaEnergy < lowEnergyLimit || GammaEnergy > highEnergyLimit) {
return 0.0; }
195 if (verboseLevel > 3) {
196 G4cout <<
"G4LivermoreComptonModifiedModel::SampleSecondaries() E(MeV)= "
202 if (photonEnergy0 <= lowEnergyLimit)
218 G4double epsilon0Local = 1. / (1. + 2. * e0m);
219 G4double epsilon0Sq = epsilon0Local * epsilon0Local;
220 G4double alpha1 = -std::log(epsilon0Local);
221 G4double alpha2 = 0.5 * (1. - epsilon0Sq);
238 epsilonSq = epsilon * epsilon;
242 epsilonSq = epsilon0Sq + (1. - epsilon0Sq) *
G4UniformRand();
243 epsilon = std::sqrt(epsilonSq);
246 oneCosT = (1. - epsilon) / ( epsilon * e0m);
247 sinT2 = oneCosT * (2. - oneCosT);
248 G4double x = std::sqrt(oneCosT/2.) / (wlPhoton/
cm);
250 gReject = (1. - epsilon * sinT2 / (1. + epsilonSq)) * scatteringFunction;
255 G4double sinTheta = std::sqrt (sinT2);
257 G4double dirx = sinTheta * std::cos(phi);
258 G4double diry = sinTheta * std::sin(phi);
267 G4int maxDopplerIterations = 1000;
269 G4double photonEoriginal = epsilon * photonEnergy0;
276 G4double momentum_au_to_nat = 1.992851740*std::pow(10.,-24.);
277 G4double e_mass_kg = 9.10938188 * std::pow(10.,-31.);
302 }
while(Alpha >= (
pi/2.0));
304 ePAU = pSample / std::cos(Alpha);
308 G4double ePSI = ePAU * momentum_au_to_nat;
309 G4double u_temp = sqrt( ((ePSI*ePSI)*(vel_c*vel_c)) / ((e_mass_kg*e_mass_kg)*(vel_c*vel_c)+(ePSI*ePSI)))/vel_c;
313 systemE = eEIncident+photonEnergy0;
317 G4double pDoppler2 = pDoppler * pDoppler;
319 G4double var3 = var2*var2 - pDoppler2;
320 G4double var4 = var2 - pDoppler2 * cosTheta;
321 G4double var = var4*var4 - var3 + pDoppler2 * var3;
327 if (
G4UniformRand() < 0.5) { photonE = (var4 - varSqrt) * scale; }
328 else { photonE = (var4 + varSqrt) * scale; }
334 }
while ( iteration <= maxDopplerIterations &&
335 (photonE < 0. || photonE > eMax ) );
346 if(eKineticEnergy < 0.0) {
347 G4cout <<
"Error, kinetic energy of electron less than zero" <<
G4endl;
354 G4double E_num = photonEnergy0 - photonE*cosTheta;
355 G4double E_dom = sqrt(photonEnergy0*photonEnergy0 + photonE*photonE -2*photonEnergy0*photonE*cosTheta);
357 G4double sinThetaE = -sqrt((1. - cosThetaE) * (1. + cosThetaE));
359 eDirX = sinThetaE * std::cos(phi);
360 eDirY = sinThetaE * std::sin(phi);
364 eDirection.
rotateUz(photonDirection0);
366 eDirection,eKineticEnergy) ;
367 fvect->push_back(dp);
373 if (iteration >= maxDopplerIterations)
375 photonE = photonEoriginal;
382 photonDirection1.
rotateUz(photonDirection0);
387 if (photonEnergy1 > 0.)
391 if (iteration < maxDopplerIterations)
394 eDirection.
rotateUz(photonDirection0);
396 eDirection,eKineticEnergy) ;
397 fvect->push_back(dp);
409 if(fAtomDeexcitation && iteration < maxDopplerIterations) {
412 size_t nbefore = fvect->size();
416 size_t nafter = fvect->size();
417 if(nafter > nbefore) {
418 for (
size_t i=nbefore; i<nafter; ++i) {
419 bindingE -= ((*fvect)[i])->GetKineticEnergy();
424 if(bindingE < 0.0) { bindingE = 0.0; }