194{
195
196
197
198
199
200
201
202
203
204
205
206
207 if (verboseLevel > 3)
208 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeGammaConversionModel" <<
G4endl;
209
211
212
215
216 if (photonEnergy <= fIntrinsicLowEnergyLimit)
217 {
219 return ;
220 }
221
224
225
226 if (!fEffectiveCharge->count(mat))
227 InitializeScreeningFunctions(mat);
228 if (!fEffectiveCharge->count(mat))
229 {
231 ed << "Unable to allocate the EffectiveCharge data for " <<
233 G4Exception(
"G4PenelopeGammaConversion::SampleSecondaries()",
235 }
236
237
239 G4double eki = electron_mass_c2/photonEnergy;
240
241
242 if (photonEnergy < fSmallEnergy)
244 else
245 {
246
247 G4double effC = fEffectiveCharge->find(mat)->second;
248 G4double alz = effC*fine_structure_const;
250 G4double F00=(-1.774-1.210e1*alz+1.118e1*alz*alz)*T
251 +(8.523+7.326e1*alz-4.441e1*alz*alz)*T*T
252 -(1.352e1+1.211e2*alz-9.641e1*alz*alz)*T*T*T
253 +(8.946+6.205e1*alz-6.341e1*alz*alz)*T*T*T*T;
254
255 G4double F0b = fScreeningFunction->find(mat)->second.second;
257 G4double invRad = fMaterialInvScreeningRadius->find(mat)->second;
259 std::pair<G4double,G4double> scree = GetScreeningFunctions(bmin);
267
269
270 do{
271 loopAgain = false;
273 {
275 if (ru2m1 < 0)
276 eps = 0.5-xr*std::pow(std::abs(ru2m1),1./3.);
277 else
278 eps = 0.5+xr*std::pow(ru2m1,1./3.);
279 G4double B = eki/(invRad*eps*(1.0-eps));
280 scree = GetScreeningFunctions(B);
281 g1 = scree.first;
282 g1 = std::max(g1+g0,0.);
284 loopAgain = true;
285 }
286 else
287 {
289 G4double B = eki/(invRad*eps*(1.0-eps));
290 scree = GetScreeningFunctions(B);
291 g2 = scree.second;
292 g2 = std::max(g2+g0,0.);
294 loopAgain = true;
295 }
296 }while(loopAgain);
297
298 }
299 if (verboseLevel > 4)
301
302 G4double electronTotEnergy = eps*photonEnergy;
303 G4double positronTotEnergy = (1.0-eps)*photonEnergy;
304
305
306
307
308 G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
310 G4double kk = std::sqrt(electronKineEnergy*(electronKineEnergy+2.*electron_mass_c2));
311 costheta_el = (costheta_el*electronTotEnergy+kk)/(electronTotEnergy+costheta_el*kk);
313 G4double dirX_el = std::sqrt(1.-costheta_el*costheta_el) * std::cos(phi_el);
314 G4double dirY_el = std::sqrt(1.-costheta_el*costheta_el) * std::sin(phi_el);
316
317
318 G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
320 kk = std::sqrt(positronKineEnergy*(positronKineEnergy+2.*electron_mass_c2));
321 costheta_po = (costheta_po*positronTotEnergy+kk)/(positronTotEnergy+costheta_po*kk);
323 G4double dirX_po = std::sqrt(1.-costheta_po*costheta_po) * std::cos(phi_po);
324 G4double dirY_po = std::sqrt(1.-costheta_po*costheta_po) * std::sin(phi_po);
326
327
328
329
331
332 if (electronKineEnergy > 0.0)
333 {
334 G4ThreeVector electronDirection ( dirX_el, dirY_el, dirZ_el);
335 electronDirection.rotateUz(photonDirection);
337 electronDirection,
338 electronKineEnergy);
339 fvect->push_back(electron);
340 }
341 else
342 {
343 localEnergyDeposit += electronKineEnergy;
344 electronKineEnergy = 0;
345 }
346
347
348
349 if (positronKineEnergy < 0.0)
350 {
351 localEnergyDeposit += positronKineEnergy;
352 positronKineEnergy = 0;
353 }
355 positronDirection.rotateUz(photonDirection);
357 positronDirection, positronKineEnergy);
358 fvect->push_back(positron);
359
360
362
363 if (verboseLevel > 1)
364 {
365 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
366 G4cout <<
"Energy balance from G4PenelopeGammaConversion" <<
G4endl;
367 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
368 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
369 if (electronKineEnergy)
370 G4cout <<
"Electron (explicitely produced) " << electronKineEnergy/keV <<
" keV"
372 if (positronKineEnergy)
373 G4cout <<
"Positron (not at rest) " << positronKineEnergy/keV <<
" keV" <<
G4endl;
374 G4cout <<
"Rest masses of e+/- " << 2.0*electron_mass_c2/keV <<
" keV" <<
G4endl;
375 if (localEnergyDeposit)
376 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
377 G4cout <<
"Total final state: " << (electronKineEnergy+positronKineEnergy+
378 localEnergyDeposit+2.0*electron_mass_c2)/keV <<
380 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
381 }
382 if (verboseLevel > 0)
383 {
384 G4double energyDiff = std::fabs(electronKineEnergy+positronKineEnergy+
385 localEnergyDeposit+2.0*electron_mass_c2-photonEnergy);
386 if (energyDiff > 0.05*keV)
387 G4cout <<
"Warning from G4PenelopeGammaConversion: problem with energy conservation: "
388 << (electronKineEnergy+positronKineEnergy+
389 localEnergyDeposit+2.0*electron_mass_c2)/keV
390 <<
" keV (final) vs. " << photonEnergy/keV <<
" keV (initial)" <<
G4endl;
391 }
392}
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
const G4Material * GetMaterial() const
const G4String & GetName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Positron * Positron()
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)