273{
274
275
276
277
278
279
280
281
282
283
284
285 if (verboseLevel > 1) {
286 G4cout <<
"Calling SampleSecondaries() of G4LivermoreGammaConversionModelRC"
288 }
289
292
294 G4double epsilon0Local = electron_mass_c2 / photonEnergy ;
295
299
300
301
302 if (photonEnergy < smallEnergy )
303 {
306 {
307 electronTotEnergy = (1. -
epsilon) * photonEnergy;
308 positronTotEnergy =
epsilon * photonEnergy;
309 }
310 else
311 {
312 positronTotEnergy = (1. -
epsilon) * photonEnergy;
313 electronTotEnergy =
epsilon * photonEnergy;
314 }
315 }
316 else
317 {
318
319
322
323 if (element == 0)
324 {
325 G4cout <<
"G4LivermoreGammaConversionModelRC::SampleSecondaries - element = 0"
327 return;
328 }
330 if (ionisation == 0)
331 {
332 G4cout <<
"G4LivermoreGammaConversionModelRC::SampleSecondaries - ionisation = 0"
334 return;
335 }
336
337
339 if (photonEnergy > 50. * MeV) fZ += 8. * (element->
GetfCoulomb());
340
341
344 G4double screenMin = std::min(4.*screenFactor,screenMax) ;
345
346
347 G4double epsilon1 = 0.5 - 0.5 * std::sqrt(1. - screenMin / screenMax) ;
348 G4double epsilonMin = std::max(epsilon0Local,epsilon1);
349 G4double epsilonRange = 0.5 - epsilonMin ;
350
351
354
355 G4double f10 = ScreenFunction1(screenMin) - fZ;
356 G4double f20 = ScreenFunction2(screenMin) - fZ;
357 G4double normF1 = std::max(f10 * epsilonRange * epsilonRange,0.);
358 G4double normF2 = std::max(1.5 * f20,0.);
359
360
361
362 G4double a=393.3750918, b=115.3070201, c=810.6428451, d=19.96497475, e=1016.874592, f=1.936685510,
363 gLocal=751.2140962, h=0.099751048, i=299.9466339, j=0.002057250, k=49.81034926;
364 G4double aa=-18.6371131, bb=-1729.95248, cc=9450.971186, dd=106336.0145, ee=55143.09287, ff=-117602.840,
365 gg=-721455.467, hh=693957.8635, ii=156266.1085, jj=533209.9347;
367 G4double logepsMin = log(epsilonMin);
368 G4double NormaRC = a + b*logepsMin + c/logepsMin + d*pow(logepsMin,2.) + e/pow(logepsMin,2.) + f*pow(logepsMin,3.) +
369 gLocal/pow(logepsMin,3.) + h*pow(logepsMin,4.) + i/pow(logepsMin,4.) + j*pow(logepsMin,5.) +
370 k/pow(logepsMin,5.);
371
372 G4double HardPhotonThreshold = 0.08;
373 G4double r1, r2, r3, beta=0, gbeta, sigt = 582.068, sigh, rejet;
374
376
378 sigh = 1028.58*
G4Exp(-HardPhotonThreshold/0.09033) + 136.63;
379
380
381 if (r1 > 1.- sigh/sigt) {
383 rejet = 0.;
384 while (r2 > rejet) {
386 beta = (-2./11.)*log(
G4Exp(-0.08*11./2.)-r3*11./(2.*cg));
387 gbeta =
G4Exp(-11.*beta/2.);
388 rejet = fbeta(beta)/(8000.*gbeta);
389 }
390 HardPhotonEnergy = beta * photonEnergy;
391 }
392 else{
393 HardPhotonEnergy = 0.;
394 }
395
396 photonEnergy -= HardPhotonEnergy;
397
398 do
399 {
400 do
401 {
403 {
406 gReject = (ScreenFunction1(screen) - fZ) / f10 ;
407 }
408 else
409 {
412 gReject = (ScreenFunction2(screen) - fZ) / f20 ;
413 }
415
416
417
419
421 G4double deltaP_R1 = 1. + (a + b*logepsilon + c/logepsilon + d*pow(logepsilon,2.) + e/pow(logepsilon,2.) +
422 f*pow(logepsilon,3.) + gLocal/pow(logepsilon,3.) + h*pow(logepsilon,4.) + i/pow(logepsilon,4.) +
423 j*pow(logepsilon,5.) + k/pow(logepsilon,5.))/100.;
424 G4double deltaP_R2 = 1.+((aa + cc*logepsilon + ee*pow(logepsilon,2.) + gg*pow(logepsilon,3.) + ii*pow(logepsilon,4.))
425 / (1. + bb*logepsilon + dd*pow(logepsilon,2.) + ff*pow(logepsilon,3.) + hh*pow(logepsilon,4.)
426 + jj*pow(logepsilon,5.) ))/100.;
427
429 {
430 Rechazo = deltaP_R1/NormaRC;
431 }
432 else
433 {
434 Rechazo = deltaP_R2/NormaRC;
435 }
436
437
439
440 electronTotEnergy = (1. -
epsilon) * photonEnergy;
441 positronTotEnergy =
epsilon * photonEnergy;
442
443 }
444
445
446
447
448
449
450
451
455
456
457
459 {
461 }
462 else
463 {
465 }
466
467 G4double thetaEle = u*electron_mass_c2/electronTotEnergy;
468 G4double thetaPos = u*electron_mass_c2/positronTotEnergy;
470
471 G4double dxEle= std::sin(thetaEle)*std::cos(phi),dyEle= std::sin(thetaEle)*std::sin(phi),dzEle=std::cos(thetaEle);
472 G4double dxPos=-std::sin(thetaPos)*std::cos(phi),dyPos=-std::sin(thetaPos)*std::sin(phi),dzPos=std::cos(thetaPos);
473
474
475
476
477
478
479 G4double electronKineEnergy = std::max(0.,electronTotEnergy - electron_mass_c2) ;
480
482 electronDirection.rotateUz(photonDirection);
483
485 electronDirection,
486 electronKineEnergy);
487
488
489 G4double positronKineEnergy = std::max(0.,positronTotEnergy - electron_mass_c2) ;
490
492 positronDirection.rotateUz(photonDirection);
493
494
496 positronDirection,
497 positronKineEnergy);
498
499 fvect->push_back(particle1);
500 fvect->push_back(particle2);
501
502 if (HardPhotonEnergy > 0.)
503 {
504 G4double thetaHardPhoton = u*electron_mass_c2/HardPhotonEnergy;
506 G4double dxHardP= std::sin(thetaHardPhoton)*std::cos(phi);
507 G4double dyHardP= std::sin(thetaHardPhoton)*std::sin(phi);
508 G4double dzHardP =std::cos(thetaHardPhoton);
509
510 G4ThreeVector hardPhotonDirection (dxHardP, dyHardP, dzHardP);
511 hardPhotonDirection.rotateUz(photonDirection);
513 hardPhotonDirection,
514 HardPhotonEnergy);
515 fvect->push_back(particle3);
516 }
517
518
521
522}
double epsilon(double density, double temperature)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4double G4Log(G4double x)
const G4ThreeVector & GetMomentumDirection() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4Electron * Electron()
G4double GetfCoulomb() const
G4IonisParamElm * GetIonisation() const
G4double GetlogZ3() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
static G4Positron * Positron()
const G4Element * SelectRandomAtom(const G4MaterialCutsCouple *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void ProposeTrackStatus(G4TrackStatus status)