Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Static Public Member Functions
G4EnergyLossTables Class Reference

#include <G4EnergyLossTables.hh>

Public Types

typedef const
G4ParticleDefinition
K
 

Static Public Member Functions

static const G4PhysicsTableGetDEDXTable (const G4ParticleDefinition *p)
 
static const G4PhysicsTableGetRangeTable (const G4ParticleDefinition *p)
 
static const G4PhysicsTableGetInverseRangeTable (const G4ParticleDefinition *p)
 
static const G4PhysicsTableGetLabTimeTable (const G4ParticleDefinition *p)
 
static const G4PhysicsTableGetProperTimeTable (const G4ParticleDefinition *p)
 
static G4double GetDEDX (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetRange (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetLabTime (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetDeltaLabTime (const G4ParticleDefinition *aParticle, G4double KineticEnergyStart, G4double KineticEnergyEnd, const G4Material *aMaterial)
 
static G4double GetProperTime (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetDeltaProperTime (const G4ParticleDefinition *aParticle, G4double KineticEnergyStart, G4double KineticEnergyEnd, const G4Material *aMaterial)
 
static G4double GetPreciseDEDX (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetPreciseRangeFromEnergy (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4Material *aMaterial)
 
static G4double GetPreciseEnergyFromRange (const G4ParticleDefinition *aParticle, G4double range, const G4Material *aMaterial)
 
static G4double GetDEDX (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4MaterialCutsCouple *couple, G4bool check=true)
 
static G4double GetRange (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4MaterialCutsCouple *couple, G4bool check=true)
 
static G4double GetPreciseDEDX (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4MaterialCutsCouple *couple)
 
static G4double GetPreciseRangeFromEnergy (const G4ParticleDefinition *aParticle, G4double KineticEnergy, const G4MaterialCutsCouple *couple)
 
static G4double GetPreciseEnergyFromRange (const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple, G4bool check=true)
 
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)
 

Detailed Description

Definition at line 105 of file G4EnergyLossTables.hh.

Member Typedef Documentation

Definition at line 203 of file G4EnergyLossTables.hh.

Member Function Documentation

G4double G4EnergyLossTables::GetDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 220 of file G4EnergyLossTables.cc.

References G4Material::GetIndex(), and G4ParticleDefinition::GetPDGCharge().

Referenced by G4hImpactIonisation::ComputeDEDX().

224 {
225  if (!t) t = new G4EnergyLossTablesHelper;
226 
227  CPRWarning();
228  if(aParticle != (const G4ParticleDefinition*) lastParticle)
229  {
230  *t= GetTables(aParticle);
231  lastParticle = (G4ParticleDefinition*) aParticle ;
232  Chargesquare = (aParticle->GetPDGCharge())*
233  (aParticle->GetPDGCharge())/
234  QQPositron ;
235  oldIndex = -1 ;
236  }
237  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
238  if (!dEdxTable) {
239  ParticleHaveNoLoss(aParticle,"dEdx");
240  return 0.0;
241  }
242 
243  G4int materialIndex = aMaterial->GetIndex();
244  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
245  G4double dEdx;
246  G4bool isOut;
247 
248  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
249 
250  dEdx =(*dEdxTable)(materialIndex)->GetValue(
251  t->theLowestKineticEnergy,isOut)
252  *std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy);
253 
254  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
255 
256  dEdx = (*dEdxTable)(materialIndex)->GetValue(
257  t->theHighestKineticEnergy,isOut);
258 
259  } else {
260 
261  dEdx = (*dEdxTable)(materialIndex)->GetValue(
262  scaledKineticEnergy,isOut);
263 
264  }
265 
266  return dEdx*Chargesquare;
267 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 773 of file G4EnergyLossTables.cc.

References G4LossTableManager::GetDEDX(), G4MaterialCutsCouple::GetIndex(), G4ParticleDefinition::GetPDGCharge(), and G4LossTableManager::Instance().

778 {
779  if (!t) t = new G4EnergyLossTablesHelper;
780 
781  if(aParticle != (const G4ParticleDefinition*) lastParticle)
782  {
783  *t= GetTables(aParticle);
784  lastParticle = (G4ParticleDefinition*) aParticle ;
785  Chargesquare = (aParticle->GetPDGCharge())*
786  (aParticle->GetPDGCharge())/
787  QQPositron ;
788  oldIndex = -1 ;
789  }
790  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
791 
792  if (!dEdxTable ) {
793  if (check) return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
794  else ParticleHaveNoLoss(aParticle, "dEdx");
795  return 0.0;
796  }
797 
798  G4int materialIndex = couple->GetIndex();
799  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
800  G4double dEdx;
801  G4bool isOut;
802 
803  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
804 
805  dEdx =(*dEdxTable)(materialIndex)->GetValue(
806  t->theLowestKineticEnergy,isOut)
807  *std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy);
808 
809  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
810 
811  dEdx = (*dEdxTable)(materialIndex)->GetValue(
812  t->theHighestKineticEnergy,isOut);
813 
814  } else {
815 
816  dEdx = (*dEdxTable)(materialIndex)->GetValue(
817  scaledKineticEnergy,isOut);
818 
819  }
820 
821  return dEdx*Chargesquare;
822 }
static G4LossTableManager * Instance()
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
const G4PhysicsTable * G4EnergyLossTables::GetDEDXTable ( const G4ParticleDefinition p)
static

Definition at line 150 of file G4EnergyLossTables.cc.

152 {
153  if (!dict) dict = new G4EnergyLossTables::helper_map;
154  helper_map::iterator it;
155  if((it=dict->find(p))==dict->end()) return 0;
156  return (*it).second.theDEDXTable;
157 }
G4double G4EnergyLossTables::GetDeltaLabTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergyStart,
G4double  KineticEnergyEnd,
const G4Material aMaterial 
)
static

Definition at line 321 of file G4EnergyLossTables.cc.

References G4Material::GetIndex().

326 {
327  if (!t) t = new G4EnergyLossTablesHelper;
328 
329  CPRWarning();
330  if(aParticle != (const G4ParticleDefinition*) lastParticle)
331  {
332  *t= GetTables(aParticle);
333  lastParticle = (G4ParticleDefinition*) aParticle ;
334  oldIndex = -1 ;
335  }
336  const G4PhysicsTable* labtimeTable= t->theLabTimeTable;
337  if (!labtimeTable) {
338  ParticleHaveNoLoss(aParticle,"LabTime");
339  return 0.0;
340  }
341 
342  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
343  const G4double dToverT = 0.05 , facT = 1. -dToverT ;
344  G4double timestart,timeend,deltatime,dTT;
345  G4bool isOut;
346 
347  G4int materialIndex = aMaterial->GetIndex();
348  G4double scaledKineticEnergy = KineticEnergyStart*t->theMassRatio;
349 
350  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
351 
352  timestart = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
353  (*labtimeTable)(materialIndex)->GetValue(
354  t->theLowestKineticEnergy,isOut);
355 
356 
357  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
358 
359  timestart = (*labtimeTable)(materialIndex)->GetValue(
360  t->theHighestKineticEnergy,isOut);
361 
362  } else {
363 
364  timestart = (*labtimeTable)(materialIndex)->GetValue(
365  scaledKineticEnergy,isOut);
366 
367  }
368 
369  dTT = (KineticEnergyStart - KineticEnergyEnd)/KineticEnergyStart ;
370 
371  if( dTT < dToverT )
372  scaledKineticEnergy = facT*KineticEnergyStart*t->theMassRatio;
373  else
374  scaledKineticEnergy = KineticEnergyEnd*t->theMassRatio;
375 
376  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
377 
378  timeend = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
379  (*labtimeTable)(materialIndex)->GetValue(
380  t->theLowestKineticEnergy,isOut);
381 
382 
383  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
384 
385  timeend = (*labtimeTable)(materialIndex)->GetValue(
386  t->theHighestKineticEnergy,isOut);
387 
388  } else {
389 
390  timeend = (*labtimeTable)(materialIndex)->GetValue(
391  scaledKineticEnergy,isOut);
392 
393  }
394 
395  deltatime = timestart - timeend ;
396 
397  if( dTT < dToverT )
398  deltatime *= dTT/dToverT;
399 
400  return deltatime/t->theMassRatio ;
401 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double G4EnergyLossTables::GetDeltaProperTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergyStart,
G4double  KineticEnergyEnd,
const G4Material aMaterial 
)
static

Definition at line 455 of file G4EnergyLossTables.cc.

References G4Material::GetIndex().

460 {
461  if (!t) t = new G4EnergyLossTablesHelper;
462 
463  CPRWarning();
464  if(aParticle != (const G4ParticleDefinition*) lastParticle)
465  {
466  *t= GetTables(aParticle);
467  lastParticle = (G4ParticleDefinition*) aParticle ;
468  oldIndex = -1 ;
469  }
470  const G4PhysicsTable* propertimeTable= t->theProperTimeTable;
471  if (!propertimeTable) {
472  ParticleHaveNoLoss(aParticle,"ProperTime");
473  return 0.0;
474  }
475 
476  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
477  const G4double dToverT = 0.05 , facT = 1. -dToverT ;
478  G4double timestart,timeend,deltatime,dTT;
479  G4bool isOut;
480 
481  G4int materialIndex = aMaterial->GetIndex();
482  G4double scaledKineticEnergy = KineticEnergyStart*t->theMassRatio;
483 
484  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
485 
486  timestart = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
487  (*propertimeTable)(materialIndex)->GetValue(
488  t->theLowestKineticEnergy,isOut);
489 
490 
491  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
492 
493  timestart = (*propertimeTable)(materialIndex)->GetValue(
494  t->theHighestKineticEnergy,isOut);
495 
496  } else {
497 
498  timestart = (*propertimeTable)(materialIndex)->GetValue(
499  scaledKineticEnergy,isOut);
500 
501  }
502 
503  dTT = (KineticEnergyStart - KineticEnergyEnd)/KineticEnergyStart ;
504 
505  if( dTT < dToverT )
506  scaledKineticEnergy = facT*KineticEnergyStart*t->theMassRatio;
507  else
508  scaledKineticEnergy = KineticEnergyEnd*t->theMassRatio;
509 
510  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
511 
512  timeend = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
513  (*propertimeTable)(materialIndex)->GetValue(
514  t->theLowestKineticEnergy,isOut);
515 
516 
517  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
518 
519  timeend = (*propertimeTable)(materialIndex)->GetValue(
520  t->theHighestKineticEnergy,isOut);
521 
522  } else {
523 
524  timeend = (*propertimeTable)(materialIndex)->GetValue(
525  scaledKineticEnergy,isOut);
526 
527  }
528 
529  deltatime = timestart - timeend ;
530 
531  if( dTT < dToverT )
532  deltatime *= dTT/dToverT ;
533 
534  return deltatime/t->theMassRatio ;
535 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
const G4PhysicsTable * G4EnergyLossTables::GetInverseRangeTable ( const G4ParticleDefinition p)
static

Definition at line 172 of file G4EnergyLossTables.cc.

174 {
175  if (!dict) dict = new G4EnergyLossTables::helper_map;
176  helper_map::iterator it;
177  if((it=dict->find(p))==dict->end()) return 0;
178  return (*it).second.theInverseRangeTable;
179 }
G4double G4EnergyLossTables::GetLabTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 271 of file G4EnergyLossTables.cc.

References G4Material::GetIndex().

275 {
276  if (!t) t = new G4EnergyLossTablesHelper;
277 
278  CPRWarning();
279  if(aParticle != (const G4ParticleDefinition*) lastParticle)
280  {
281  *t= GetTables(aParticle);
282  lastParticle = (G4ParticleDefinition*) aParticle ;
283  oldIndex = -1 ;
284  }
285  const G4PhysicsTable* labtimeTable= t->theLabTimeTable;
286  if (!labtimeTable) {
287  ParticleHaveNoLoss(aParticle,"LabTime");
288  return 0.0;
289  }
290 
291  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
292  G4int materialIndex = aMaterial->GetIndex();
293  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
294  G4double time;
295  G4bool isOut;
296 
297  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
298 
299  time = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
300  (*labtimeTable)(materialIndex)->GetValue(
301  t->theLowestKineticEnergy,isOut);
302 
303 
304  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
305 
306  time = (*labtimeTable)(materialIndex)->GetValue(
307  t->theHighestKineticEnergy,isOut);
308 
309  } else {
310 
311  time = (*labtimeTable)(materialIndex)->GetValue(
312  scaledKineticEnergy,isOut);
313 
314  }
315 
316  return time/t->theMassRatio ;
317 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
const G4PhysicsTable * G4EnergyLossTables::GetLabTimeTable ( const G4ParticleDefinition p)
static

Definition at line 183 of file G4EnergyLossTables.cc.

185 {
186  if (!dict) dict = new G4EnergyLossTables::helper_map;
187  helper_map::iterator it;
188  if((it=dict->find(p))==dict->end()) return 0;
189  return (*it).second.theLabTimeTable;
190 }
G4double G4EnergyLossTables::GetPreciseDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 663 of file G4EnergyLossTables.cc.

References G4Material::GetIndex(), and G4ParticleDefinition::GetPDGCharge().

667 {
668  if (!t) t = new G4EnergyLossTablesHelper;
669 
670  CPRWarning();
671  if( aParticle != (const G4ParticleDefinition*) lastParticle)
672  {
673  *t= GetTables(aParticle);
674  lastParticle = (G4ParticleDefinition*) aParticle;
675  Chargesquare = (aParticle->GetPDGCharge())*
676  (aParticle->GetPDGCharge())/
677  QQPositron ;
678  oldIndex = -1 ;
679  }
680  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
681  if (!dEdxTable) {
682  ParticleHaveNoLoss(aParticle,"dEdx");
683  return 0.0;
684  }
685 
686  G4int materialIndex = aMaterial->GetIndex();
687  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
688  G4double dEdx;
689  G4bool isOut;
690 
691  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
692 
693  dEdx = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)
694  *(*dEdxTable)(materialIndex)->GetValue(
695  t->theLowestKineticEnergy,isOut);
696 
697  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
698 
699  dEdx = (*dEdxTable)(materialIndex)->GetValue(
700  t->theHighestKineticEnergy,isOut);
701 
702  } else {
703 
704  dEdx = (*dEdxTable)(materialIndex)->GetValue(
705  scaledKineticEnergy,isOut) ;
706 
707  }
708 
709  return dEdx*Chargesquare;
710 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetPreciseDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple 
)
static

Definition at line 953 of file G4EnergyLossTables.cc.

References G4LossTableManager::GetDEDX(), G4MaterialCutsCouple::GetIndex(), G4ParticleDefinition::GetPDGCharge(), and G4LossTableManager::Instance().

957 {
958  if (!t) t = new G4EnergyLossTablesHelper;
959 
960  if( aParticle != (const G4ParticleDefinition*) lastParticle)
961  {
962  *t= GetTables(aParticle);
963  lastParticle = (G4ParticleDefinition*) aParticle;
964  Chargesquare = (aParticle->GetPDGCharge())*
965  (aParticle->GetPDGCharge())/
966  QQPositron ;
967  oldIndex = -1 ;
968  }
969  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
970  if ( !dEdxTable )
971  return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
972 
973  G4int materialIndex = couple->GetIndex();
974  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
975  G4double dEdx;
976  G4bool isOut;
977 
978  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
979 
980  dEdx = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)
981  *(*dEdxTable)(materialIndex)->GetValue(
982  t->theLowestKineticEnergy,isOut);
983 
984  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
985 
986  dEdx = (*dEdxTable)(materialIndex)->GetValue(
987  t->theHighestKineticEnergy,isOut);
988 
989  } else {
990 
991  dEdx = (*dEdxTable)(materialIndex)->GetValue(
992  scaledKineticEnergy,isOut) ;
993 
994  }
995 
996  return dEdx*Chargesquare;
997 }
static G4LossTableManager * Instance()
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetPreciseEnergyFromRange ( const G4ParticleDefinition aParticle,
G4double  range,
const G4Material aMaterial 
)
static

Definition at line 594 of file G4EnergyLossTables.cc.

References G4Material::GetIndex(), and G4ParticleDefinition::GetPDGCharge().

Referenced by G4eLowEnergyLoss::AlongStepDoIt(), and G4hImpactIonisation::AlongStepDoIt().

599 {
600  if (!t) t = new G4EnergyLossTablesHelper;
601 
602  CPRWarning();
603  if( aParticle != (const G4ParticleDefinition*) lastParticle)
604  {
605  *t= GetTables(aParticle);
606  lastParticle = (G4ParticleDefinition*) aParticle;
607  Chargesquare = (aParticle->GetPDGCharge())*
608  (aParticle->GetPDGCharge())/
609  QQPositron ;
610  oldIndex = -1 ;
611  }
612  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
613  const G4PhysicsTable* inverseRangeTable= t->theInverseRangeTable;
614  if (!inverseRangeTable) {
615  ParticleHaveNoLoss(aParticle,"InverseRange");
616  return 0.0;
617  }
618 
619  G4double scaledrange,scaledKineticEnergy ;
620  G4bool isOut ;
621 
622  G4int materialIndex = aMaterial->GetIndex() ;
623 
624  if(materialIndex != oldIndex)
625  {
626  oldIndex = materialIndex ;
627  rmin = (*inverseRangeTable)(materialIndex)->
628  GetLowEdgeEnergy(0) ;
629  rmax = (*inverseRangeTable)(materialIndex)->
630  GetLowEdgeEnergy(t->theNumberOfBins-2) ;
631  Thigh = (*inverseRangeTable)(materialIndex)->
632  GetValue(rmax,isOut) ;
633  }
634 
635  scaledrange = range*Chargesquare*t->theMassRatio ;
636 
637  if(scaledrange < rmin)
638  {
639  scaledKineticEnergy = t->theLowestKineticEnergy*
640  scaledrange*scaledrange/(rmin*rmin) ;
641  }
642  else
643  {
644  if(scaledrange < rmax)
645  {
646  scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
647  GetValue( scaledrange,isOut) ;
648  }
649  else
650  {
651  scaledKineticEnergy = Thigh +
652  (scaledrange-rmax)*
653  (*dEdxTable)(materialIndex)->
654  GetValue(Thigh,isOut) ;
655  }
656  }
657 
658  return scaledKineticEnergy/t->theMassRatio ;
659 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetPreciseEnergyFromRange ( const G4ParticleDefinition aParticle,
G4double  range,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 882 of file G4EnergyLossTables.cc.

References DBL_MAX, G4LossTableManager::GetEnergy(), G4MaterialCutsCouple::GetIndex(), G4ParticleDefinition::GetPDGCharge(), and G4LossTableManager::Instance().

888 {
889  if (!t) t = new G4EnergyLossTablesHelper;
890 
891  if( aParticle != (const G4ParticleDefinition*) lastParticle)
892  {
893  *t= GetTables(aParticle);
894  lastParticle = (G4ParticleDefinition*) aParticle;
895  Chargesquare = (aParticle->GetPDGCharge())*
896  (aParticle->GetPDGCharge())/
897  QQPositron ;
898  oldIndex = -1 ;
899  }
900  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
901  const G4PhysicsTable* inverseRangeTable= t->theInverseRangeTable;
902 
903  if (!inverseRangeTable) {
904  if(check) return G4LossTableManager::Instance()->GetEnergy(aParticle,range,couple);
905  else return DBL_MAX;
906  // else ParticleHaveNoLoss(aParticle,"InverseRange");
907  }
908 
909  G4double scaledrange,scaledKineticEnergy ;
910  G4bool isOut ;
911 
912  G4int materialIndex = couple->GetIndex() ;
913 
914  if(materialIndex != oldIndex)
915  {
916  oldIndex = materialIndex ;
917  rmin = (*inverseRangeTable)(materialIndex)->
918  GetLowEdgeEnergy(0) ;
919  rmax = (*inverseRangeTable)(materialIndex)->
920  GetLowEdgeEnergy(t->theNumberOfBins-2) ;
921  Thigh = (*inverseRangeTable)(materialIndex)->
922  GetValue(rmax,isOut) ;
923  }
924 
925  scaledrange = range*Chargesquare*t->theMassRatio ;
926 
927  if(scaledrange < rmin)
928  {
929  scaledKineticEnergy = t->theLowestKineticEnergy*
930  scaledrange*scaledrange/(rmin*rmin) ;
931  }
932  else
933  {
934  if(scaledrange < rmax)
935  {
936  scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
937  GetValue( scaledrange,isOut) ;
938  }
939  else
940  {
941  scaledKineticEnergy = Thigh +
942  (scaledrange-rmax)*
943  (*dEdxTable)(materialIndex)->
944  GetValue(Thigh,isOut) ;
945  }
946  }
947 
948  return scaledKineticEnergy/t->theMassRatio ;
949 }
static G4LossTableManager * Instance()
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
G4double GetEnergy(const G4ParticleDefinition *aParticle, G4double range, const G4MaterialCutsCouple *couple)
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
#define DBL_MAX
Definition: templates.hh:83
G4double G4EnergyLossTables::GetPreciseRangeFromEnergy ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 714 of file G4EnergyLossTables.cc.

References G4Material::GetIndex(), and G4ParticleDefinition::GetPDGCharge().

718 {
719  if (!t) t = new G4EnergyLossTablesHelper;
720 
721  CPRWarning();
722  if( aParticle != (const G4ParticleDefinition*) lastParticle)
723  {
724  *t= GetTables(aParticle);
725  lastParticle = (G4ParticleDefinition*) aParticle;
726  Chargesquare = (aParticle->GetPDGCharge())*
727  (aParticle->GetPDGCharge())/
728  QQPositron ;
729  oldIndex = -1 ;
730  }
731  const G4PhysicsTable* rangeTable= t->theRangeTable;
732  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
733  if (!rangeTable) {
734  ParticleHaveNoLoss(aParticle,"Range");
735  return 0.0;
736  }
737  G4int materialIndex = aMaterial->GetIndex();
738 
739  G4double Thighr = t->theHighestKineticEnergy*t->theLowestKineticEnergy/
740  (*rangeTable)(materialIndex)->
741  GetLowEdgeEnergy(1) ;
742 
743  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
744  G4double Range;
745  G4bool isOut;
746 
747  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
748 
749  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
750  (*rangeTable)(materialIndex)->GetValue(
751  t->theLowestKineticEnergy,isOut);
752 
753  } else if (scaledKineticEnergy>Thighr) {
754 
755  Range = (*rangeTable)(materialIndex)->GetValue(
756  Thighr,isOut)+
757  (scaledKineticEnergy-Thighr)/
758  (*dEdxTable)(materialIndex)->GetValue(
759  Thighr,isOut);
760 
761  } else {
762 
763  Range = (*rangeTable)(materialIndex)->GetValue(
764  scaledKineticEnergy,isOut) ;
765 
766  }
767 
768  return Range/(Chargesquare*t->theMassRatio);
769 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetPreciseRangeFromEnergy ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple 
)
static

Definition at line 1001 of file G4EnergyLossTables.cc.

References G4LossTableManager::GetDEDX(), G4MaterialCutsCouple::GetIndex(), G4ParticleDefinition::GetPDGCharge(), and G4LossTableManager::Instance().

1005 {
1006  if (!t) t = new G4EnergyLossTablesHelper;
1007 
1008  if( aParticle != (const G4ParticleDefinition*) lastParticle)
1009  {
1010  *t= GetTables(aParticle);
1011  lastParticle = (G4ParticleDefinition*) aParticle;
1012  Chargesquare = (aParticle->GetPDGCharge())*
1013  (aParticle->GetPDGCharge())/
1014  QQPositron ;
1015  oldIndex = -1 ;
1016  }
1017  const G4PhysicsTable* rangeTable= t->theRangeTable;
1018  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
1019  if ( !dEdxTable || !rangeTable)
1020  return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
1021 
1022  G4int materialIndex = couple->GetIndex();
1023 
1024  G4double Thighr = t->theHighestKineticEnergy*t->theLowestKineticEnergy/
1025  (*rangeTable)(materialIndex)->
1026  GetLowEdgeEnergy(1) ;
1027 
1028  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
1029  G4double Range;
1030  G4bool isOut;
1031 
1032  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
1033 
1034  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
1035  (*rangeTable)(materialIndex)->GetValue(
1036  t->theLowestKineticEnergy,isOut);
1037 
1038  } else if (scaledKineticEnergy>Thighr) {
1039 
1040  Range = (*rangeTable)(materialIndex)->GetValue(
1041  Thighr,isOut)+
1042  (scaledKineticEnergy-Thighr)/
1043  (*dEdxTable)(materialIndex)->GetValue(
1044  Thighr,isOut);
1045 
1046  } else {
1047 
1048  Range = (*rangeTable)(materialIndex)->GetValue(
1049  scaledKineticEnergy,isOut) ;
1050 
1051  }
1052 
1053  return Range/(Chargesquare*t->theMassRatio);
1054 }
static G4LossTableManager * Instance()
G4double GetDEDX(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetProperTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 405 of file G4EnergyLossTables.cc.

References G4Material::GetIndex().

409 {
410  if (!t) t = new G4EnergyLossTablesHelper;
411 
412  CPRWarning();
413  if(aParticle != (const G4ParticleDefinition*) lastParticle)
414  {
415  *t= GetTables(aParticle);
416  lastParticle = (G4ParticleDefinition*) aParticle ;
417  oldIndex = -1 ;
418  }
419  const G4PhysicsTable* propertimeTable= t->theProperTimeTable;
420  if (!propertimeTable) {
421  ParticleHaveNoLoss(aParticle,"ProperTime");
422  return 0.0;
423  }
424 
425  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
426  G4int materialIndex = aMaterial->GetIndex();
427  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
428  G4double time;
429  G4bool isOut;
430 
431  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
432 
433  time = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
434  (*propertimeTable)(materialIndex)->GetValue(
435  t->theLowestKineticEnergy,isOut);
436 
437 
438  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
439 
440  time = (*propertimeTable)(materialIndex)->GetValue(
441  t->theHighestKineticEnergy,isOut);
442 
443  } else {
444 
445  time = (*propertimeTable)(materialIndex)->GetValue(
446  scaledKineticEnergy,isOut);
447 
448  }
449 
450  return time/t->theMassRatio ;
451 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
const G4PhysicsTable * G4EnergyLossTables::GetProperTimeTable ( const G4ParticleDefinition p)
static

Definition at line 194 of file G4EnergyLossTables.cc.

196 {
197  if (!dict) dict = new G4EnergyLossTables::helper_map;
198  helper_map::iterator it;
199  if((it=dict->find(p))==dict->end()) return 0;
200  return (*it).second.theProperTimeTable;
201 }
G4double G4EnergyLossTables::GetRange ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 539 of file G4EnergyLossTables.cc.

References G4Material::GetIndex(), and G4ParticleDefinition::GetPDGCharge().

Referenced by G4RDRangeTest::Escape(), and G4MinEkineCuts::PostStepGetPhysicalInteractionLength().

543 {
544  if (!t) t = new G4EnergyLossTablesHelper;
545 
546  CPRWarning();
547  if(aParticle != (const G4ParticleDefinition*) lastParticle)
548  {
549  *t= GetTables(aParticle);
550  lastParticle = (G4ParticleDefinition*) aParticle ;
551  Chargesquare = (aParticle->GetPDGCharge())*
552  (aParticle->GetPDGCharge())/
553  QQPositron ;
554  oldIndex = -1 ;
555  }
556  const G4PhysicsTable* rangeTable= t->theRangeTable;
557  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
558  if (!rangeTable) {
559  ParticleHaveNoLoss(aParticle,"Range");
560  return 0.0;
561  }
562 
563  G4int materialIndex = aMaterial->GetIndex();
564  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
565  G4double Range;
566  G4bool isOut;
567 
568  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
569 
570  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
571  (*rangeTable)(materialIndex)->GetValue(
572  t->theLowestKineticEnergy,isOut);
573 
574  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
575 
576  Range = (*rangeTable)(materialIndex)->GetValue(
577  t->theHighestKineticEnergy,isOut)+
578  (scaledKineticEnergy-t->theHighestKineticEnergy)/
579  (*dEdxTable)(materialIndex)->GetValue(
580  t->theHighestKineticEnergy,isOut);
581 
582  } else {
583 
584  Range = (*rangeTable)(materialIndex)->GetValue(
585  scaledKineticEnergy,isOut);
586 
587  }
588 
589  return Range/(Chargesquare*t->theMassRatio);
590 }
size_t GetIndex() const
Definition: G4Material.hh:260
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
G4double G4EnergyLossTables::GetRange ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 826 of file G4EnergyLossTables.cc.

References DBL_MAX, G4MaterialCutsCouple::GetIndex(), G4ParticleDefinition::GetPDGCharge(), G4LossTableManager::GetRange(), and G4LossTableManager::Instance().

831 {
832  if (!t) t = new G4EnergyLossTablesHelper;
833 
834  if(aParticle != (const G4ParticleDefinition*) lastParticle)
835  {
836  *t= GetTables(aParticle);
837  lastParticle = (G4ParticleDefinition*) aParticle ;
838  Chargesquare = (aParticle->GetPDGCharge())*
839  (aParticle->GetPDGCharge())/
840  QQPositron ;
841  oldIndex = -1 ;
842  }
843  const G4PhysicsTable* rangeTable= t->theRangeTable;
844  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
845  if (!rangeTable) {
846  if(check) return G4LossTableManager::Instance()->GetRange(aParticle,KineticEnergy,couple);
847  else return DBL_MAX;
848  //ParticleHaveNoLoss(aParticle,"Range");
849  }
850 
851  G4int materialIndex = couple->GetIndex();
852  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
853  G4double Range;
854  G4bool isOut;
855 
856  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
857 
858  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
859  (*rangeTable)(materialIndex)->GetValue(
860  t->theLowestKineticEnergy,isOut);
861 
862  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
863 
864  Range = (*rangeTable)(materialIndex)->GetValue(
865  t->theHighestKineticEnergy,isOut)+
866  (scaledKineticEnergy-t->theHighestKineticEnergy)/
867  (*dEdxTable)(materialIndex)->GetValue(
868  t->theHighestKineticEnergy,isOut);
869 
870  } else {
871 
872  Range = (*rangeTable)(materialIndex)->GetValue(
873  scaledKineticEnergy,isOut);
874 
875  }
876 
877  return Range/(Chargesquare*t->theMassRatio);
878 }
static G4LossTableManager * Instance()
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
#define DBL_MAX
Definition: templates.hh:83
G4double GetRange(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4MaterialCutsCouple *couple)
const G4PhysicsTable * G4EnergyLossTables::GetRangeTable ( const G4ParticleDefinition p)
static

Definition at line 161 of file G4EnergyLossTables.cc.

163 {
164  if (!dict) dict = new G4EnergyLossTables::helper_map;
165  helper_map::iterator it;
166  if((it=dict->find(p))==dict->end()) return 0;
167  return (*it).second.theRangeTable;
168 }
void G4EnergyLossTables::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

Definition at line 118 of file G4EnergyLossTables.cc.

References G4ParticleDefinition::GetPDGCharge().

Referenced by G4eLowEnergyLoss::BuildDEDXTable(), G4hRDEnergyLoss::BuildDEDXTable(), and G4hImpactIonisation::BuildPhysicsTable().

129 {
130  if (!dict) dict = new G4EnergyLossTables::helper_map;
131  if (!null_loss) null_loss = new G4EnergyLossTablesHelper;
132  if (!t) t = new G4EnergyLossTablesHelper;
133 
134  (*dict)[p]= G4EnergyLossTablesHelper(tDEDX, tRange,tInverseRange,
135  tLabTime,tProperTime,lowestKineticEnergy,
136  highestKineticEnergy, massRatio,NumberOfBins);
137 
138  *t = GetTables(p) ; // important for cache !!!!!
139  lastParticle = (G4ParticleDefinition*) p ;
140  Chargesquare = (p->GetPDGCharge())*(p->GetPDGCharge())/
141  QQPositron ;
142  if (first_loss ) {
143  *null_loss = G4EnergyLossTablesHelper(0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0);
144  first_loss = false;
145  }
146 }
const char * p
Definition: xmltok.h:285
G4double GetPDGCharge() const

The documentation for this class was generated from the following files: