286{
288 if (verboseLevel > 3) {
289 G4cout <<
"G4LivermorePhotoElectricModel::SampleSecondaries() Egamma(keV)= "
290 << gammaEnergy/keV <<
G4endl;
291 }
292
293
296
297
299 if(fWater && (material == fWater ||
301 if(gammaEnergy <= fWaterEnergyLimit) {
303 return;
304 }
305 }
306
307
309
310
313
314
315
316
317 if(
Z > maxZ) {
Z = maxZ; }
318
319
320 if(fCrossSection[
Z] ==
nullptr) {
322 return;
323 }
324
325
326 std::size_t shellIdx = 0;
327 std::size_t
nn = fNShellsUsed[
Z];
328 if(nn > 1)
329 {
330 if(gammaEnergy >= (*(fParamHigh[
Z]))[0])
331 {
337 std::size_t idx =
nn*7 - 5;
338
339
340
342 G4double cs0 = rand*( (*(fParamHigh[
Z]))[idx]
343 + x1*(*(fParamHigh[
Z]))[idx+1]
344 + x2*(*(fParamHigh[
Z]))[idx+2]
345 + x3*(*(fParamHigh[
Z]))[idx+3]
346 + x4*(*(fParamHigh[
Z]))[idx+4]
347 + x5*(*(fParamHigh[
Z]))[idx+5]);
348
349 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
350 {
351 idx = shellIdx*7 + 2;
352 if(gammaEnergy > (*(fParamHigh[
Z]))[idx-1])
353 {
355 (*(fParamHigh[
Z]))[idx]
356 + x1*(*(fParamHigh[
Z]))[idx+1]
357 + x2*(*(fParamHigh[
Z]))[idx+2]
358 + x3*(*(fParamHigh[
Z]))[idx+3]
359 + x4*(*(fParamHigh[
Z]))[idx+4]
360 + x5*(*(fParamHigh[
Z]))[idx+5];
361
362 if(cs >= cs0) { break; }
363 }
364 }
365 if(shellIdx >= nn) { shellIdx =
nn-1; }
366 }
367 else if(gammaEnergy >= (*(fParamLow[
Z]))[0])
368 {
374 std::size_t idx =
nn*7 - 5;
375
376
378 + x1*(*(fParamLow[
Z]))[idx+1]
379 + x2*(*(fParamLow[
Z]))[idx+2]
380 + x3*(*(fParamLow[
Z]))[idx+3]
381 + x4*(*(fParamLow[
Z]))[idx+4]
382 + x5*(*(fParamLow[
Z]))[idx+5]);
383 for(shellIdx=0; shellIdx<
nn; ++shellIdx)
384 {
385 idx = shellIdx*7 + 2;
386 if(gammaEnergy > (*(fParamLow[
Z]))[idx-1])
387 {
388 G4double cs = (*(fParamLow[
Z]))[idx] + x1*(*(fParamLow[
Z]))[idx+1]
389 + x2*(*(fParamLow[
Z]))[idx+2] + x3*(*(fParamLow[
Z]))[idx+3]
390 + x4*(*(fParamLow[
Z]))[idx+4]+ x5*(*(fParamLow[
Z]))[idx+5];
391 if(cs >= cs0) { break; }
392 }
393 }
394 if(shellIdx >= nn) {shellIdx =
nn-1;}
395 }
396 else
397 {
398
399
401
402 if(gammaEnergy >= (*(fParamHigh[
Z]))[1]) {
403
404 cs*= (fCrossSection[
Z])->
Value(gammaEnergy);
405 }
406 else
407 {
408
409 cs *= (fCrossSectionLE[
Z])->
Value(gammaEnergy);
410 }
411
413
415 if(gammaEnergy > (*(fParamLow[
Z]))[7*shellIdx+1]) {
417 }
418 if(cs <= 0.0 || j+1 == (
G4int)
nn) {
break;}
419 }
420 }
421 }
422
423
426
427
428 if(fDeexcitationActive && shellIdx + 1 < nn) {
431 }
432
433
434
435 if(gammaEnergy < bindingEnergy) {
437 return;
438 }
439
440
443
444
447 eKineticEnergy,
450
451
453 electronDirection,
454 eKineticEnergy);
455 fvect->push_back(electron);
456
457
458 if(shell) {
461 std::size_t nbefore = fvect->size();
462
464 std::size_t nafter = fvect->size();
465 if(nafter > nbefore) {
467 for (std::size_t j=nbefore; j<nafter; ++j) {
468
469 G4double e = ((*fvect)[j])->GetKineticEnergy();
470 if(esec + e > edep) {
471
472 e = edep - esec;
473 ((*fvect)[j])->SetKineticEnergy(e);
474 esec += e;
475
476 for (std::size_t jj=nafter-1; jj>j; --jj) {
477 delete (*fvect)[jj];
478 fvect->pop_back();
479 }
480 break;
481 }
482 esec += e;
483 }
484 edep -= esec;
485 }
486 }
487 }
488
489 if(edep > 0.0) {
491 }
492}
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4double GetValueForComponent(G4int Z, G4int idx, G4double kinEnergy)
G4int GetComponentID(G4int Z, G4int idx)
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
virtual const G4AtomicShell * GetAtomicShell(G4int Z, G4AtomicShellEnumerator shell)=0
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
virtual G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double finalTotalEnergy, G4int Z, const G4Material *)=0
G4VEmAngularDistribution * GetAngularDistribution()
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
G4double bindingEnergy(G4int A, G4int Z)