80 theDEDXTable(aDEDXTable), theRangeTable(aRangeTable),
81 theInverseRangeTable(anInverseRangeTable),
82 theLabTimeTable(aLabTimeTable),
83 theProperTimeTable(aProperTimeTable),
84 theLowestKineticEnergy(aLowestKineticEnergy),
85 theHighestKineticEnergy(aHighestKineticEnergy),
86 theMassRatio(aMassRatio),
87 theNumberOfBins(aNumberOfBins)
121 tLabTime,tProperTime,lowestKineticEnergy,
122 highestKineticEnergy, massRatio,NumberOfBins);
140 helper_map::iterator it;
141 if((it=
dict->find(p))==
dict->end())
return 0;
142 return (*it).second.theDEDXTable;
151 helper_map::iterator it;
152 if((it=
dict->find(p))==
dict->end())
return 0;
153 return (*it).second.theRangeTable;
162 helper_map::iterator it;
163 if((it=
dict->find(p))==
dict->end())
return 0;
164 return (*it).second.theInverseRangeTable;
173 helper_map::iterator it;
174 if((it=
dict->find(p))==
dict->end())
return 0;
175 return (*it).second.theLabTimeTable;
184 helper_map::iterator it;
185 if((it=
dict->find(p))==
dict->end())
return 0;
186 return (*it).second.theProperTimeTable;
197 helper_map::iterator it;
198 if ((it=
dict->find(p))==
dict->end()) {
234 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
236 dEdx =(*dEdxTable)(materialIndex)->GetValue(
242 dEdx = (*dEdxTable)(materialIndex)->GetValue(
247 dEdx = (*dEdxTable)(materialIndex)->GetValue(
248 scaledKineticEnergy,isOut);
277 const G4double parlowen=0.4 , ppar=0.5-parlowen ;
283 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
286 (*labtimeTable)(materialIndex)->GetValue(
292 time = (*labtimeTable)(materialIndex)->GetValue(
297 time = (*labtimeTable)(materialIndex)->GetValue(
298 scaledKineticEnergy,isOut);
328 const G4double parlowen=0.4 , ppar=0.5-parlowen ;
329 const G4double dToverT = 0.05 , facT = 1. -dToverT ;
330 G4double timestart,timeend,deltatime,dTT;
336 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
339 (*labtimeTable)(materialIndex)->GetValue(
345 timestart = (*labtimeTable)(materialIndex)->GetValue(
350 timestart = (*labtimeTable)(materialIndex)->GetValue(
351 scaledKineticEnergy,isOut);
355 dTT = (KineticEnergyStart - KineticEnergyEnd)/KineticEnergyStart ;
358 scaledKineticEnergy = facT*KineticEnergyStart*
t->
theMassRatio;
362 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
365 (*labtimeTable)(materialIndex)->GetValue(
371 timeend = (*labtimeTable)(materialIndex)->GetValue(
376 timeend = (*labtimeTable)(materialIndex)->GetValue(
377 scaledKineticEnergy,isOut);
381 deltatime = timestart - timeend ;
384 deltatime *= dTT/dToverT;
406 if (!propertimeTable) {
411 const G4double parlowen=0.4 , ppar=0.5-parlowen ;
417 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
420 (*propertimeTable)(materialIndex)->GetValue(
426 time = (*propertimeTable)(materialIndex)->GetValue(
431 time = (*propertimeTable)(materialIndex)->GetValue(
432 scaledKineticEnergy,isOut);
457 if (!propertimeTable) {
462 const G4double parlowen=0.4 , ppar=0.5-parlowen ;
463 const G4double dToverT = 0.05 , facT = 1. -dToverT ;
464 G4double timestart,timeend,deltatime,dTT;
470 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
473 (*propertimeTable)(materialIndex)->GetValue(
479 timestart = (*propertimeTable)(materialIndex)->GetValue(
484 timestart = (*propertimeTable)(materialIndex)->GetValue(
485 scaledKineticEnergy,isOut);
489 dTT = (KineticEnergyStart - KineticEnergyEnd)/KineticEnergyStart ;
492 scaledKineticEnergy = facT*KineticEnergyStart*
t->
theMassRatio;
496 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
499 (*propertimeTable)(materialIndex)->GetValue(
505 timeend = (*propertimeTable)(materialIndex)->GetValue(
510 timeend = (*propertimeTable)(materialIndex)->GetValue(
511 scaledKineticEnergy,isOut);
515 deltatime = timestart - timeend ;
518 deltatime *= dTT/dToverT ;
554 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
557 (*rangeTable)(materialIndex)->GetValue(
562 Range = (*rangeTable)(materialIndex)->GetValue(
565 (*dEdxTable)(materialIndex)->GetValue(
570 Range = (*rangeTable)(materialIndex)->GetValue(
571 scaledKineticEnergy,isOut);
600 if (!inverseRangeTable) {
605 G4double scaledrange,scaledKineticEnergy ;
613 rmin = (*inverseRangeTable)(materialIndex)->
614 GetLowEdgeEnergy(0) ;
615 rmax = (*inverseRangeTable)(materialIndex)->
617 Thigh = (*inverseRangeTable)(materialIndex)->
618 GetValue(
rmax,isOut) ;
623 if(scaledrange <
rmin)
626 scaledrange*scaledrange/(
rmin*
rmin) ;
630 if(scaledrange <
rmax)
632 scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
633 GetValue( scaledrange,isOut) ;
637 scaledKineticEnergy =
Thigh +
639 (*dEdxTable)(materialIndex)->
640 GetValue(
Thigh,isOut) ;
677 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
680 *(*dEdxTable)(materialIndex)->GetValue(
685 dEdx = (*dEdxTable)(materialIndex)->GetValue(
690 dEdx = (*dEdxTable)(materialIndex)->GetValue(
691 scaledKineticEnergy,isOut) ;
726 (*rangeTable)(materialIndex)->
727 GetLowEdgeEnergy(1) ;
733 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
736 (*rangeTable)(materialIndex)->GetValue(
739 }
else if (scaledKineticEnergy>Thighr) {
741 Range = (*rangeTable)(materialIndex)->GetValue(
743 (scaledKineticEnergy-Thighr)/
744 (*dEdxTable)(materialIndex)->GetValue(
749 Range = (*rangeTable)(materialIndex)->GetValue(
750 scaledKineticEnergy,isOut) ;
789 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
791 dEdx =(*dEdxTable)(materialIndex)->GetValue(
797 dEdx = (*dEdxTable)(materialIndex)->GetValue(
802 dEdx = (*dEdxTable)(materialIndex)->GetValue(
803 scaledKineticEnergy,isOut);
842 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
845 (*rangeTable)(materialIndex)->GetValue(
850 Range = (*rangeTable)(materialIndex)->GetValue(
853 (*dEdxTable)(materialIndex)->GetValue(
858 Range = (*rangeTable)(materialIndex)->GetValue(
859 scaledKineticEnergy,isOut);
889 if (!inverseRangeTable) {
895 G4double scaledrange,scaledKineticEnergy ;
903 rmin = (*inverseRangeTable)(materialIndex)->
904 GetLowEdgeEnergy(0) ;
905 rmax = (*inverseRangeTable)(materialIndex)->
907 Thigh = (*inverseRangeTable)(materialIndex)->
908 GetValue(
rmax,isOut) ;
913 if(scaledrange <
rmin)
916 scaledrange*scaledrange/(
rmin*
rmin) ;
920 if(scaledrange <
rmax)
922 scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
923 GetValue( scaledrange,isOut) ;
927 scaledKineticEnergy =
Thigh +
929 (*dEdxTable)(materialIndex)->
930 GetValue(
Thigh,isOut) ;
964 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
967 *(*dEdxTable)(materialIndex)->GetValue(
972 dEdx = (*dEdxTable)(materialIndex)->GetValue(
977 dEdx = (*dEdxTable)(materialIndex)->GetValue(
978 scaledKineticEnergy,isOut) ;
1005 if ( !dEdxTable || !rangeTable)
1011 (*rangeTable)(materialIndex)->
1012 GetLowEdgeEnergy(1) ;
1018 if (scaledKineticEnergy<t->theLowestKineticEnergy) {
1021 (*rangeTable)(materialIndex)->GetValue(
1024 }
else if (scaledKineticEnergy>Thighr) {
1026 Range = (*rangeTable)(materialIndex)->GetValue(
1028 (scaledKineticEnergy-Thighr)/
1029 (*dEdxTable)(materialIndex)->GetValue(
1034 Range = (*rangeTable)(materialIndex)->GetValue(
1035 scaledKineticEnergy,isOut) ;
1049 G4cout <<
"##### G4EnergyLossTable WARNING: The obsolete interface is used!" <<
G4endl;
1050 G4cout <<
"##### RESULTS ARE NOT GARANTEED!" <<
G4endl;
1051 G4cout <<
"##### Please, substitute G4Material by G4MaterialCutsCouple" <<
G4endl;
1052 G4cout <<
"##### Obsolete interface will be removed soon" <<
G4endl;
1058 G4cout <<
"##### G4EnergyLossTable WARNING closed" <<
G4endl;
G4GLOB_DLL std::ostream G4cout
G4double theHighestKineticEnergy
G4EnergyLossTablesHelper()
const G4PhysicsTable * theProperTimeTable
G4double theLowestKineticEnergy
const G4PhysicsTable * theInverseRangeTable
const G4PhysicsTable * theDEDXTable
const G4PhysicsTable * theRangeTable
const G4PhysicsTable * theLabTimeTable
std::map< K, G4EnergyLossTablesHelper, std::less< K > > helper_map
static G4double GetRange(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static const G4PhysicsTable * GetLabTimeTable(const G4ParticleDefinition *p)
static void Register(const G4ParticleDefinition *p, const G4PhysicsTable *tDEDX, const G4PhysicsTable *tRange, const G4PhysicsTable *tInverseRange, const G4PhysicsTable *tLabTime, const G4PhysicsTable *tProperTime, G4double lowestKineticEnergy, G4double highestKineticEnergy, G4double massRatio, G4int NumberOfBins)
static G4EnergyLossTablesHelper GetTables(const G4ParticleDefinition *p)
static G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static G4double GetDeltaProperTime(const G4ParticleDefinition *aParticle, G4double KineticEnergyStart, G4double KineticEnergyEnd, const G4Material *aMaterial)
static G4double GetLabTime(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static G4double QQPositron
static G4double GetPreciseDEDX(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static G4double GetPreciseEnergyFromRange(const G4ParticleDefinition *aParticle, G4double range, const G4Material *aMaterial)
static const G4PhysicsTable * GetDEDXTable(const G4ParticleDefinition *p)
static const G4PhysicsTable * GetRangeTable(const G4ParticleDefinition *p)
static const G4PhysicsTable * GetInverseRangeTable(const G4ParticleDefinition *p)
static G4int let_max_num_warnings
static G4double GetDeltaLabTime(const G4ParticleDefinition *aParticle, G4double KineticEnergyStart, G4double KineticEnergyEnd, const G4Material *aMaterial)
static G4EnergyLossTablesHelper * null_loss
static G4double GetPreciseRangeFromEnergy(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static G4double GetProperTime(const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
static void ParticleHaveNoLoss(const G4ParticleDefinition *aParticle, const G4String &)
static const G4PhysicsTable * GetProperTimeTable(const G4ParticleDefinition *p)
static G4ParticleDefinition * lastParticle
static G4double Chargesquare
static G4EnergyLossTablesHelper * t
static G4LossTableManager * Instance()
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4double GetPDGCharge() const