428{
429 CPRWarning();
430 if(aParticle != lastParticle)
431 {
432 t= GetTables(aParticle);
433 lastParticle = aParticle ;
434 oldIndex = -1 ;
435 }
437 if (!propertimeTable) {
438 ParticleHaveNoLoss(aParticle,"ProperTime");
439 return 0.0;
440 }
441
442 const G4double parlowen=0.4 , ppar=0.5-parlowen ;
443 const G4double dToverT = 0.05 , facT = 1. -dToverT ;
444 G4double timestart,timeend,deltatime,dTT;
446
448 G4double scaledKineticEnergy = KineticEnergyStart*t.theMassRatio;
449
450 if (scaledKineticEnergy<t.theLowestKineticEnergy) {
451
452 timestart = std::exp(ppar*std::log(scaledKineticEnergy/t.theLowestKineticEnergy))*
453 (*propertimeTable)(materialIndex)->GetValue(
454 t.theLowestKineticEnergy,isOut);
455
456
457 } else if (scaledKineticEnergy>t.theHighestKineticEnergy) {
458
459 timestart = (*propertimeTable)(materialIndex)->GetValue(
460 t.theHighestKineticEnergy,isOut);
461
462 } else {
463
464 timestart = (*propertimeTable)(materialIndex)->GetValue(
465 scaledKineticEnergy,isOut);
466
467 }
468
469 dTT = (KineticEnergyStart - KineticEnergyEnd)/KineticEnergyStart ;
470
471 if( dTT < dToverT )
472 scaledKineticEnergy = facT*KineticEnergyStart*t.theMassRatio;
473 else
474 scaledKineticEnergy = KineticEnergyEnd*t.theMassRatio;
475
476 if (scaledKineticEnergy<t.theLowestKineticEnergy) {
477
478 timeend = std::exp(ppar*std::log(scaledKineticEnergy/t.theLowestKineticEnergy))*
479 (*propertimeTable)(materialIndex)->GetValue(
480 t.theLowestKineticEnergy,isOut);
481
482
483 } else if (scaledKineticEnergy>t.theHighestKineticEnergy) {
484
485 timeend = (*propertimeTable)(materialIndex)->GetValue(
486 t.theHighestKineticEnergy,isOut);
487
488 } else {
489
490 timeend = (*propertimeTable)(materialIndex)->GetValue(
491 scaledKineticEnergy,isOut);
492
493 }
494
495 deltatime = timestart - timeend ;
496
497 if( dTT < dToverT )
498 deltatime *= dTT/dToverT ;
499
500 return deltatime/t.theMassRatio ;
501}