194{
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209 if (verboseLevel > 3)
210 G4cout <<
"Calling SamplingSecondaries() of G4PenelopePhotoElectricModel" <<
G4endl;
211
213
214
217
218 if (photonEnergy <= fIntrinsicLowEnergyLimit)
219 {
221 return ;
222 }
223
225
226
227 if (verboseLevel > 2)
229
230
234 if (verboseLevel > 2)
236
237
238
239
240
241
242
243 size_t shellIndex = SelectRandomShell(Z,photonEnergy);
244
245 if (verboseLevel > 2)
246 G4cout <<
"Selected shell " << shellIndex <<
" of element " << anElement->
GetName() <<
G4endl;
247
248
250
251
252
253
254
255
256
257 size_t numberOfShells = (size_t) transitionManager->
NumberOfShells(Z);
258 if (shellIndex >= numberOfShells)
259 shellIndex = numberOfShells-1;
260
263
264
265
266
267
268
269
270 if (shellIndex == 9)
272
273
276
277
279
280
281
282 if (eKineticEnergy > 0.)
283 {
284
285
286 cosTheta = SampleElectronDirection(eKineticEnergy);
287 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
289 G4double dirx = sinTheta * std::cos(phi);
290 G4double diry = sinTheta * std::sin(phi);
293 electronDirection.rotateUz(photonDirection);
295 electronDirection,
296 eKineticEnergy);
297 fvect->push_back(electron);
298 }
299 else
301
302
305
306
307
308
309 if (fAtomDeexcitation && shellIndex<9)
310 {
313 {
314 size_t nBefore = fvect->size();
316 size_t nAfter = fvect->size();
317
318 if (nAfter > nBefore)
319 {
320 for (size_t j=nBefore;j<nAfter;j++)
321 {
322 G4double itsEnergy = ((*fvect)[j])->GetKineticEnergy();
325 energyInFluorescence += itsEnergy;
327 energyInAuger += itsEnergy;
328
329 }
330 }
331
332 }
333 }
334
335
337
338 if (localEnergyDeposit < 0)
339 {
341 << "G4PenelopePhotoElectricModel::SampleSecondaries() - Negative energy deposit"
343 localEnergyDeposit = 0;
344 }
345
347
348 if (verboseLevel > 1)
349 {
350 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
351 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
352 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
354 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
355 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
356 if (eKineticEnergy)
357 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
358 if (energyInFluorescence)
359 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
360 if (energyInAuger)
361 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
362 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
363 G4cout <<
"Total final state: " <<
364 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
366 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
367 }
368 if (verboseLevel > 0)
369 {
371 std::fabs(eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger-photonEnergy);
372 if (energyDiff > 0.05*keV)
373 {
374 G4cout <<
"Warning from G4PenelopePhotoElectric: problem with energy conservation: " <<
375 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV
376 << " keV (final) vs. " <<
377 photonEnergy/keV <<
" keV (initial)" <<
G4endl;
378 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
379 G4cout <<
"Energy balance from G4PenelopePhotoElectric" <<
G4endl;
380 G4cout <<
"Selected shell: " << WriteTargetShell(shellIndex) <<
" of element " <<
382 G4cout <<
"Incoming photon energy: " << photonEnergy/keV <<
" keV" <<
G4endl;
383 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
384 if (eKineticEnergy)
385 G4cout <<
"Outgoing electron " << eKineticEnergy/keV <<
" keV" <<
G4endl;
386 if (energyInFluorescence)
387 G4cout <<
"Fluorescence x-rays: " << energyInFluorescence/keV <<
" keV" <<
G4endl;
388 if (energyInAuger)
389 G4cout <<
"Auger electrons: " << energyInAuger/keV <<
" keV" <<
G4endl;
390 G4cout <<
"Local energy deposit " << localEnergyDeposit/keV <<
" keV" <<
G4endl;
391 G4cout <<
"Total final state: " <<
392 (eKineticEnergy+energyInFluorescence+localEnergyDeposit+energyInAuger)/keV <<
394 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
395 }
396 }
397}
G4double BindingEnergy() const
G4AtomicShell * Shell(G4int Z, size_t shellIndex) const
G4int NumberOfShells(G4int Z) const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
static G4Electron * Definition()
static G4Electron * Electron()
const G4String & GetName() const
static G4Gamma * GammaDefinition()
static G4Gamma * Definition()
const G4Material * GetMaterial() const
const G4String & GetName() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4bool CheckDeexcitationActiveRegion(G4int coupleIndex)
void GenerateParticles(std::vector< G4DynamicParticle * > *secVect, const G4AtomicShell *, G4int Z, G4int coupleIndex)
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)