Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 207 of file G4EnergyLossTables.cc.

211 {
212  if (!t) t = new G4EnergyLossTablesHelper;
213 
214  CPRWarning();
215  if(aParticle != (const G4ParticleDefinition*) lastParticle)
216  {
217  *t= GetTables(aParticle);
218  lastParticle = (G4ParticleDefinition*) aParticle ;
219  Chargesquare = (aParticle->GetPDGCharge())*
220  (aParticle->GetPDGCharge())/
221  QQPositron ;
222  oldIndex = -1 ;
223  }
224  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
225  if (!dEdxTable) {
226  ParticleHaveNoLoss(aParticle,"dEdx");
227  return 0.0;
228  }
229 
230  G4int materialIndex = aMaterial->GetIndex();
231  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
232  G4double dEdx;
233  G4bool isOut;
234 
235  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
236 
237  dEdx =(*dEdxTable)(materialIndex)->GetValue(
238  t->theLowestKineticEnergy,isOut)
239  *std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy);
240 
241  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
242 
243  dEdx = (*dEdxTable)(materialIndex)->GetValue(
244  t->theHighestKineticEnergy,isOut);
245 
246  } else {
247 
248  dEdx = (*dEdxTable)(materialIndex)->GetValue(
249  scaledKineticEnergy,isOut);
250 
251  }
252 
253  return dEdx*Chargesquare;
254 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossTables::GetDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 760 of file G4EnergyLossTables.cc.

765 {
766  if (!t) t = new G4EnergyLossTablesHelper;
767 
768  if(aParticle != (const G4ParticleDefinition*) lastParticle)
769  {
770  *t= GetTables(aParticle);
771  lastParticle = (G4ParticleDefinition*) aParticle ;
772  Chargesquare = (aParticle->GetPDGCharge())*
773  (aParticle->GetPDGCharge())/
774  QQPositron ;
775  oldIndex = -1 ;
776  }
777  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
778 
779  if (!dEdxTable ) {
780  if (check) return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
781  else ParticleHaveNoLoss(aParticle, "dEdx");
782  return 0.0;
783  }
784 
785  G4int materialIndex = couple->GetIndex();
786  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
787  G4double dEdx;
788  G4bool isOut;
789 
790  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
791 
792  dEdx =(*dEdxTable)(materialIndex)->GetValue(
793  t->theLowestKineticEnergy,isOut)
794  *std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy);
795 
796  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
797 
798  dEdx = (*dEdxTable)(materialIndex)->GetValue(
799  t->theHighestKineticEnergy,isOut);
800 
801  } else {
802 
803  dEdx = (*dEdxTable)(materialIndex)->GetValue(
804  scaledKineticEnergy,isOut);
805 
806  }
807 
808  return dEdx*Chargesquare;
809 }
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

Here is the call graph for this function:

const G4PhysicsTable * G4EnergyLossTables::GetDEDXTable ( const G4ParticleDefinition p)
static

Definition at line 137 of file G4EnergyLossTables.cc.

139 {
140  if (!dict) dict = new G4EnergyLossTables::helper_map;
141  helper_map::iterator it;
142  if((it=dict->find(p))==dict->end()) return 0;
143  return (*it).second.theDEDXTable;
144 }
G4double G4EnergyLossTables::GetDeltaLabTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergyStart,
G4double  KineticEnergyEnd,
const G4Material aMaterial 
)
static

Definition at line 308 of file G4EnergyLossTables.cc.

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

Here is the call graph for this function:

G4double G4EnergyLossTables::GetDeltaProperTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergyStart,
G4double  KineticEnergyEnd,
const G4Material aMaterial 
)
static

Definition at line 442 of file G4EnergyLossTables.cc.

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

Here is the call graph for this function:

const G4PhysicsTable * G4EnergyLossTables::GetInverseRangeTable ( const G4ParticleDefinition p)
static

Definition at line 159 of file G4EnergyLossTables.cc.

161 {
162  if (!dict) dict = new G4EnergyLossTables::helper_map;
163  helper_map::iterator it;
164  if((it=dict->find(p))==dict->end()) return 0;
165  return (*it).second.theInverseRangeTable;
166 }
G4double G4EnergyLossTables::GetLabTime ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4Material aMaterial 
)
static

Definition at line 258 of file G4EnergyLossTables.cc.

262 {
263  if (!t) t = new G4EnergyLossTablesHelper;
264 
265  CPRWarning();
266  if(aParticle != (const G4ParticleDefinition*) lastParticle)
267  {
268  *t= GetTables(aParticle);
269  lastParticle = (G4ParticleDefinition*) aParticle ;
270  oldIndex = -1 ;
271  }
272  const G4PhysicsTable* labtimeTable= t->theLabTimeTable;
273  if (!labtimeTable) {
274  ParticleHaveNoLoss(aParticle,"LabTime");
275  return 0.0;
276  }
277 
278  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
279  G4int materialIndex = aMaterial->GetIndex();
280  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
281  G4double time;
282  G4bool isOut;
283 
284  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
285 
286  time = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
287  (*labtimeTable)(materialIndex)->GetValue(
288  t->theLowestKineticEnergy,isOut);
289 
290 
291  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
292 
293  time = (*labtimeTable)(materialIndex)->GetValue(
294  t->theHighestKineticEnergy,isOut);
295 
296  } else {
297 
298  time = (*labtimeTable)(materialIndex)->GetValue(
299  scaledKineticEnergy,isOut);
300 
301  }
302 
303  return time/t->theMassRatio ;
304 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

const G4PhysicsTable * G4EnergyLossTables::GetLabTimeTable ( const G4ParticleDefinition p)
static

Definition at line 170 of file G4EnergyLossTables.cc.

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

Definition at line 650 of file G4EnergyLossTables.cc.

654 {
655  if (!t) t = new G4EnergyLossTablesHelper;
656 
657  CPRWarning();
658  if( aParticle != (const G4ParticleDefinition*) lastParticle)
659  {
660  *t= GetTables(aParticle);
661  lastParticle = (G4ParticleDefinition*) aParticle;
662  Chargesquare = (aParticle->GetPDGCharge())*
663  (aParticle->GetPDGCharge())/
664  QQPositron ;
665  oldIndex = -1 ;
666  }
667  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
668  if (!dEdxTable) {
669  ParticleHaveNoLoss(aParticle,"dEdx");
670  return 0.0;
671  }
672 
673  G4int materialIndex = aMaterial->GetIndex();
674  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
675  G4double dEdx;
676  G4bool isOut;
677 
678  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
679 
680  dEdx = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)
681  *(*dEdxTable)(materialIndex)->GetValue(
682  t->theLowestKineticEnergy,isOut);
683 
684  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
685 
686  dEdx = (*dEdxTable)(materialIndex)->GetValue(
687  t->theHighestKineticEnergy,isOut);
688 
689  } else {
690 
691  dEdx = (*dEdxTable)(materialIndex)->GetValue(
692  scaledKineticEnergy,isOut) ;
693 
694  }
695 
696  return dEdx*Chargesquare;
697 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

G4double G4EnergyLossTables::GetPreciseDEDX ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple 
)
static

Definition at line 940 of file G4EnergyLossTables.cc.

944 {
945  if (!t) t = new G4EnergyLossTablesHelper;
946 
947  if( aParticle != (const G4ParticleDefinition*) lastParticle)
948  {
949  *t= GetTables(aParticle);
950  lastParticle = (G4ParticleDefinition*) aParticle;
951  Chargesquare = (aParticle->GetPDGCharge())*
952  (aParticle->GetPDGCharge())/
953  QQPositron ;
954  oldIndex = -1 ;
955  }
956  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
957  if ( !dEdxTable )
958  return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
959 
960  G4int materialIndex = couple->GetIndex();
961  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
962  G4double dEdx;
963  G4bool isOut;
964 
965  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
966 
967  dEdx = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)
968  *(*dEdxTable)(materialIndex)->GetValue(
969  t->theLowestKineticEnergy,isOut);
970 
971  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
972 
973  dEdx = (*dEdxTable)(materialIndex)->GetValue(
974  t->theHighestKineticEnergy,isOut);
975 
976  } else {
977 
978  dEdx = (*dEdxTable)(materialIndex)->GetValue(
979  scaledKineticEnergy,isOut) ;
980 
981  }
982 
983  return dEdx*Chargesquare;
984 }
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

Here is the call graph for this function:

G4double G4EnergyLossTables::GetPreciseEnergyFromRange ( const G4ParticleDefinition aParticle,
G4double  range,
const G4Material aMaterial 
)
static

Definition at line 581 of file G4EnergyLossTables.cc.

586 {
587  if (!t) t = new G4EnergyLossTablesHelper;
588 
589  CPRWarning();
590  if( aParticle != (const G4ParticleDefinition*) lastParticle)
591  {
592  *t= GetTables(aParticle);
593  lastParticle = (G4ParticleDefinition*) aParticle;
594  Chargesquare = (aParticle->GetPDGCharge())*
595  (aParticle->GetPDGCharge())/
596  QQPositron ;
597  oldIndex = -1 ;
598  }
599  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
600  const G4PhysicsTable* inverseRangeTable= t->theInverseRangeTable;
601  if (!inverseRangeTable) {
602  ParticleHaveNoLoss(aParticle,"InverseRange");
603  return 0.0;
604  }
605 
606  G4double scaledrange,scaledKineticEnergy ;
607  G4bool isOut ;
608 
609  G4int materialIndex = aMaterial->GetIndex() ;
610 
611  if(materialIndex != oldIndex)
612  {
613  oldIndex = materialIndex ;
614  rmin = (*inverseRangeTable)(materialIndex)->
615  GetLowEdgeEnergy(0) ;
616  rmax = (*inverseRangeTable)(materialIndex)->
617  GetLowEdgeEnergy(t->theNumberOfBins-2) ;
618  Thigh = (*inverseRangeTable)(materialIndex)->
619  GetValue(rmax,isOut) ;
620  }
621 
622  scaledrange = range*Chargesquare*t->theMassRatio ;
623 
624  if(scaledrange < rmin)
625  {
626  scaledKineticEnergy = t->theLowestKineticEnergy*
627  scaledrange*scaledrange/(rmin*rmin) ;
628  }
629  else
630  {
631  if(scaledrange < rmax)
632  {
633  scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
634  GetValue( scaledrange,isOut) ;
635  }
636  else
637  {
638  scaledKineticEnergy = Thigh +
639  (scaledrange-rmax)*
640  (*dEdxTable)(materialIndex)->
641  GetValue(Thigh,isOut) ;
642  }
643  }
644 
645  return scaledKineticEnergy/t->theMassRatio ;
646 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossTables::GetPreciseEnergyFromRange ( const G4ParticleDefinition aParticle,
G4double  range,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 869 of file G4EnergyLossTables.cc.

875 {
876  if (!t) t = new G4EnergyLossTablesHelper;
877 
878  if( aParticle != (const G4ParticleDefinition*) lastParticle)
879  {
880  *t= GetTables(aParticle);
881  lastParticle = (G4ParticleDefinition*) aParticle;
882  Chargesquare = (aParticle->GetPDGCharge())*
883  (aParticle->GetPDGCharge())/
884  QQPositron ;
885  oldIndex = -1 ;
886  }
887  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
888  const G4PhysicsTable* inverseRangeTable= t->theInverseRangeTable;
889 
890  if (!inverseRangeTable) {
891  if(check) return G4LossTableManager::Instance()->GetEnergy(aParticle,range,couple);
892  else return DBL_MAX;
893  // else ParticleHaveNoLoss(aParticle,"InverseRange");
894  }
895 
896  G4double scaledrange,scaledKineticEnergy ;
897  G4bool isOut ;
898 
899  G4int materialIndex = couple->GetIndex() ;
900 
901  if(materialIndex != oldIndex)
902  {
903  oldIndex = materialIndex ;
904  rmin = (*inverseRangeTable)(materialIndex)->
905  GetLowEdgeEnergy(0) ;
906  rmax = (*inverseRangeTable)(materialIndex)->
907  GetLowEdgeEnergy(t->theNumberOfBins-2) ;
908  Thigh = (*inverseRangeTable)(materialIndex)->
909  GetValue(rmax,isOut) ;
910  }
911 
912  scaledrange = range*Chargesquare*t->theMassRatio ;
913 
914  if(scaledrange < rmin)
915  {
916  scaledKineticEnergy = t->theLowestKineticEnergy*
917  scaledrange*scaledrange/(rmin*rmin) ;
918  }
919  else
920  {
921  if(scaledrange < rmax)
922  {
923  scaledKineticEnergy = (*inverseRangeTable)(materialIndex)->
924  GetValue( scaledrange,isOut) ;
925  }
926  else
927  {
928  scaledKineticEnergy = Thigh +
929  (scaledrange-rmax)*
930  (*dEdxTable)(materialIndex)->
931  GetValue(Thigh,isOut) ;
932  }
933  }
934 
935  return scaledKineticEnergy/t->theMassRatio ;
936 }
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

Here is the call graph for this function:

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

Definition at line 701 of file G4EnergyLossTables.cc.

705 {
706  if (!t) t = new G4EnergyLossTablesHelper;
707 
708  CPRWarning();
709  if( aParticle != (const G4ParticleDefinition*) lastParticle)
710  {
711  *t= GetTables(aParticle);
712  lastParticle = (G4ParticleDefinition*) aParticle;
713  Chargesquare = (aParticle->GetPDGCharge())*
714  (aParticle->GetPDGCharge())/
715  QQPositron ;
716  oldIndex = -1 ;
717  }
718  const G4PhysicsTable* rangeTable= t->theRangeTable;
719  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
720  if (!rangeTable) {
721  ParticleHaveNoLoss(aParticle,"Range");
722  return 0.0;
723  }
724  G4int materialIndex = aMaterial->GetIndex();
725 
726  G4double Thighr = t->theHighestKineticEnergy*t->theLowestKineticEnergy/
727  (*rangeTable)(materialIndex)->
728  GetLowEdgeEnergy(1) ;
729 
730  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
731  G4double Range;
732  G4bool isOut;
733 
734  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
735 
736  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
737  (*rangeTable)(materialIndex)->GetValue(
738  t->theLowestKineticEnergy,isOut);
739 
740  } else if (scaledKineticEnergy>Thighr) {
741 
742  Range = (*rangeTable)(materialIndex)->GetValue(
743  Thighr,isOut)+
744  (scaledKineticEnergy-Thighr)/
745  (*dEdxTable)(materialIndex)->GetValue(
746  Thighr,isOut);
747 
748  } else {
749 
750  Range = (*rangeTable)(materialIndex)->GetValue(
751  scaledKineticEnergy,isOut) ;
752 
753  }
754 
755  return Range/(Chargesquare*t->theMassRatio);
756 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

G4double G4EnergyLossTables::GetPreciseRangeFromEnergy ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple 
)
static

Definition at line 988 of file G4EnergyLossTables.cc.

992 {
993  if (!t) t = new G4EnergyLossTablesHelper;
994 
995  if( aParticle != (const G4ParticleDefinition*) lastParticle)
996  {
997  *t= GetTables(aParticle);
998  lastParticle = (G4ParticleDefinition*) aParticle;
999  Chargesquare = (aParticle->GetPDGCharge())*
1000  (aParticle->GetPDGCharge())/
1001  QQPositron ;
1002  oldIndex = -1 ;
1003  }
1004  const G4PhysicsTable* rangeTable= t->theRangeTable;
1005  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
1006  if ( !dEdxTable || !rangeTable)
1007  return G4LossTableManager::Instance()->GetDEDX(aParticle,KineticEnergy,couple);
1008 
1009  G4int materialIndex = couple->GetIndex();
1010 
1011  G4double Thighr = t->theHighestKineticEnergy*t->theLowestKineticEnergy/
1012  (*rangeTable)(materialIndex)->
1013  GetLowEdgeEnergy(1) ;
1014 
1015  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
1016  G4double Range;
1017  G4bool isOut;
1018 
1019  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
1020 
1021  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
1022  (*rangeTable)(materialIndex)->GetValue(
1023  t->theLowestKineticEnergy,isOut);
1024 
1025  } else if (scaledKineticEnergy>Thighr) {
1026 
1027  Range = (*rangeTable)(materialIndex)->GetValue(
1028  Thighr,isOut)+
1029  (scaledKineticEnergy-Thighr)/
1030  (*dEdxTable)(materialIndex)->GetValue(
1031  Thighr,isOut);
1032 
1033  } else {
1034 
1035  Range = (*rangeTable)(materialIndex)->GetValue(
1036  scaledKineticEnergy,isOut) ;
1037 
1038  }
1039 
1040  return Range/(Chargesquare*t->theMassRatio);
1041 }
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

Here is the call graph for this function:

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

Definition at line 392 of file G4EnergyLossTables.cc.

396 {
397  if (!t) t = new G4EnergyLossTablesHelper;
398 
399  CPRWarning();
400  if(aParticle != (const G4ParticleDefinition*) lastParticle)
401  {
402  *t= GetTables(aParticle);
403  lastParticle = (G4ParticleDefinition*) aParticle ;
404  oldIndex = -1 ;
405  }
406  const G4PhysicsTable* propertimeTable= t->theProperTimeTable;
407  if (!propertimeTable) {
408  ParticleHaveNoLoss(aParticle,"ProperTime");
409  return 0.0;
410  }
411 
412  const G4double parlowen=0.4 , ppar=0.5-parlowen ;
413  G4int materialIndex = aMaterial->GetIndex();
414  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
415  G4double time;
416  G4bool isOut;
417 
418  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
419 
420  time = std::exp(ppar*std::log(scaledKineticEnergy/t->theLowestKineticEnergy))*
421  (*propertimeTable)(materialIndex)->GetValue(
422  t->theLowestKineticEnergy,isOut);
423 
424 
425  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
426 
427  time = (*propertimeTable)(materialIndex)->GetValue(
428  t->theHighestKineticEnergy,isOut);
429 
430  } else {
431 
432  time = (*propertimeTable)(materialIndex)->GetValue(
433  scaledKineticEnergy,isOut);
434 
435  }
436 
437  return time/t->theMassRatio ;
438 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

const G4PhysicsTable * G4EnergyLossTables::GetProperTimeTable ( const G4ParticleDefinition p)
static

Definition at line 181 of file G4EnergyLossTables.cc.

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

Definition at line 526 of file G4EnergyLossTables.cc.

530 {
531  if (!t) t = new G4EnergyLossTablesHelper;
532 
533  CPRWarning();
534  if(aParticle != (const G4ParticleDefinition*) lastParticle)
535  {
536  *t= GetTables(aParticle);
537  lastParticle = (G4ParticleDefinition*) aParticle ;
538  Chargesquare = (aParticle->GetPDGCharge())*
539  (aParticle->GetPDGCharge())/
540  QQPositron ;
541  oldIndex = -1 ;
542  }
543  const G4PhysicsTable* rangeTable= t->theRangeTable;
544  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
545  if (!rangeTable) {
546  ParticleHaveNoLoss(aParticle,"Range");
547  return 0.0;
548  }
549 
550  G4int materialIndex = aMaterial->GetIndex();
551  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
552  G4double Range;
553  G4bool isOut;
554 
555  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
556 
557  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
558  (*rangeTable)(materialIndex)->GetValue(
559  t->theLowestKineticEnergy,isOut);
560 
561  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
562 
563  Range = (*rangeTable)(materialIndex)->GetValue(
564  t->theHighestKineticEnergy,isOut)+
565  (scaledKineticEnergy-t->theHighestKineticEnergy)/
566  (*dEdxTable)(materialIndex)->GetValue(
567  t->theHighestKineticEnergy,isOut);
568 
569  } else {
570 
571  Range = (*rangeTable)(materialIndex)->GetValue(
572  scaledKineticEnergy,isOut);
573 
574  }
575 
576  return Range/(Chargesquare*t->theMassRatio);
577 }
size_t GetIndex() const
Definition: G4Material.hh:262
int G4int
Definition: G4Types.hh:78
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4EnergyLossTables::GetRange ( const G4ParticleDefinition aParticle,
G4double  KineticEnergy,
const G4MaterialCutsCouple couple,
G4bool  check = true 
)
static

Definition at line 813 of file G4EnergyLossTables.cc.

818 {
819  if (!t) t = new G4EnergyLossTablesHelper;
820 
821  if(aParticle != (const G4ParticleDefinition*) lastParticle)
822  {
823  *t= GetTables(aParticle);
824  lastParticle = (G4ParticleDefinition*) aParticle ;
825  Chargesquare = (aParticle->GetPDGCharge())*
826  (aParticle->GetPDGCharge())/
827  QQPositron ;
828  oldIndex = -1 ;
829  }
830  const G4PhysicsTable* rangeTable= t->theRangeTable;
831  const G4PhysicsTable* dEdxTable= t->theDEDXTable;
832  if (!rangeTable) {
833  if(check) return G4LossTableManager::Instance()->GetRange(aParticle,KineticEnergy,couple);
834  else return DBL_MAX;
835  //ParticleHaveNoLoss(aParticle,"Range");
836  }
837 
838  G4int materialIndex = couple->GetIndex();
839  G4double scaledKineticEnergy = KineticEnergy*t->theMassRatio;
840  G4double Range;
841  G4bool isOut;
842 
843  if (scaledKineticEnergy<t->theLowestKineticEnergy) {
844 
845  Range = std::sqrt(scaledKineticEnergy/t->theLowestKineticEnergy)*
846  (*rangeTable)(materialIndex)->GetValue(
847  t->theLowestKineticEnergy,isOut);
848 
849  } else if (scaledKineticEnergy>t->theHighestKineticEnergy) {
850 
851  Range = (*rangeTable)(materialIndex)->GetValue(
852  t->theHighestKineticEnergy,isOut)+
853  (scaledKineticEnergy-t->theHighestKineticEnergy)/
854  (*dEdxTable)(materialIndex)->GetValue(
855  t->theHighestKineticEnergy,isOut);
856 
857  } else {
858 
859  Range = (*rangeTable)(materialIndex)->GetValue(
860  scaledKineticEnergy,isOut);
861 
862  }
863 
864  return Range/(Chargesquare*t->theMassRatio);
865 }
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)

Here is the call graph for this function:

const G4PhysicsTable * G4EnergyLossTables::GetRangeTable ( const G4ParticleDefinition p)
static

Definition at line 148 of file G4EnergyLossTables.cc.

150 {
151  if (!dict) dict = new G4EnergyLossTables::helper_map;
152  helper_map::iterator it;
153  if((it=dict->find(p))==dict->end()) return 0;
154  return (*it).second.theRangeTable;
155 }
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 105 of file G4EnergyLossTables.cc.

116 {
117  if (!dict) dict = new G4EnergyLossTables::helper_map;
118  if (!null_loss) null_loss = new G4EnergyLossTablesHelper;
119  if (!t) t = new G4EnergyLossTablesHelper;
120 
121  (*dict)[p]= G4EnergyLossTablesHelper(tDEDX, tRange,tInverseRange,
122  tLabTime,tProperTime,lowestKineticEnergy,
123  highestKineticEnergy, massRatio,NumberOfBins);
124 
125  *t = GetTables(p) ; // important for cache !!!!!
126  lastParticle = (G4ParticleDefinition*) p ;
127  Chargesquare = (p->GetPDGCharge())*(p->GetPDGCharge())/
128  QQPositron ;
129  if (first_loss ) {
130  *null_loss = G4EnergyLossTablesHelper(0, 0, 0, 0, 0, 0.0, 0.0, 0.0, 0);
131  first_loss = false;
132  }
133 }
const char * p
Definition: xmltok.h:285
G4double GetPDGCharge() const

Here is the call graph for this function:

Here is the caller graph for this function:


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