94 #ifndef G4VEnergyLossProcess_h
95 #define G4VEnergyLossProcess_h 1
459 inline G4double GetLimitScaledRangeForScaledEnergy(
G4double scaledKinEnergy);
462 inline void ComputeLambdaForScaledEnergy(
G4double scaledKinEnergy);
484 std::vector<G4VEmModel*> emModels;
487 std::vector<const G4Region*> scoffRegions;
491 std::vector<G4VEnergyLossProcess*> scProcesses;
507 std::vector<G4double> theDEDXAtMaxEnergy;
508 std::vector<G4double> theRangeAtMaxEnergy;
509 std::vector<G4double> theEnergyOfCrossSectionMax;
510 std::vector<G4double> theCrossSectionMax;
512 const std::vector<G4double>* theDensityFactor;
513 const std::vector<G4int>* theDensityIdx;
535 G4bool lossFluctuationFlag;
554 std::vector<G4DynamicParticle*> secParticles;
555 std::vector<G4Track*> scTracks;
562 size_t currentCoupleIndex;
563 size_t basedCoupleIndex;
586 return currentCoupleIndex;
600 currentModel = modelManager->
SelectModel(kinEnergy, currentCoupleIndex);
607 G4double kinEnergy,
size_t& idx)
const
617 if(couple != currentCouple) {
618 currentCouple = couple;
620 currentCoupleIndex = couple->
GetIndex();
621 basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex];
622 fFactor = chargeSqRatio*biasFactor*(*theDensityFactor)[currentCoupleIndex];
623 reduceFactor = 1.0/(fFactor*massRatio);
633 massRatio = massratio;
634 fFactor *= charge2ratio/chargeSqRatio;
635 chargeSqRatio = charge2ratio;
636 reduceFactor = 1.0/(fFactor*massRatio);
645 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->Value(e);
646 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
654 G4double x = fFactor*(*theDEDXSubTable)[basedCoupleIndex]->Value(e);
655 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
661 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(
G4double e)
663 G4double x = fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e);
664 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
673 G4double x = fFactor*(*theIonisationSubTable)[basedCoupleIndex]->Value(e);
674 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
680 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e)
684 G4double x = ((*theRangeTableForLoss)[basedCoupleIndex])->Value(e);
685 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
692 G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e)
695 if (e < maxKinEnergyCSDA) {
696 x = ((*theCSDARangeTable)[basedCoupleIndex])->Value(e);
697 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
699 x = theRangeAtMaxEnergy[basedCoupleIndex] +
700 (e - maxKinEnergyCSDA)/theDEDXAtMaxEnergy[basedCoupleIndex];
714 if(r >= rmin) { e = v->
Value(r); }
717 e = minKinEnergy*x*
x;
726 return fFactor*((*theLambdaTable)[basedCoupleIndex])->Value(e);
735 DefineMaterial(couple);
736 return GetDEDXForScaledEnergy(kineticEnergy*massRatio);
745 DefineMaterial(couple);
746 return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
756 if(couple != currentCouple || kineticEnergy != preStepKinEnergy) {
757 DefineMaterial(couple);
758 if(theCSDARangeTable) {
759 x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
761 }
else if(theRangeTableForLoss) {
762 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
774 DefineMaterial(couple);
776 if(theCSDARangeTable) {
777 x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
789 if(couple != currentCouple || kineticEnergy != preStepKinEnergy) {
790 DefineMaterial(couple);
791 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
804 DefineMaterial(couple);
805 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
814 DefineMaterial(couple);
816 if(theLambdaTable) { x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); }
822 inline void G4VEnergyLossProcess::ComputeLambdaForScaledEnergy(
G4double e)
824 mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex];
825 if (e <= mfpKinEnergy) {
826 preStepLambda = GetLambdaForScaledEnergy(e);
830 if(e1 > mfpKinEnergy) {
831 preStepLambda = GetLambdaForScaledEnergy(e);
832 G4double preStepLambda1 = GetLambdaForScaledEnergy(e1);
833 if(preStepLambda1 > preStepLambda) {
835 preStepLambda = preStepLambda1;
838 preStepLambda = fFactor*theCrossSectionMax[currentCoupleIndex];
868 secondaryParticle =
p;
896 return secondaryParticle;
903 lossFluctuationFlag = val;
961 if(val > 0.0 && val <= 1.0) { lambdaFactor = val; }
970 if (dRoverRange > 0.999) { dRoverRange = 1.0; }
979 lowestKinEnergy = val;
986 return nSCoffRegions;
1021 return minKinEnergy;
1029 if(e < maxKinEnergyCSDA) { maxKinEnergyCSDA =
e; }
1036 return maxKinEnergy;
1043 maxKinEnergyCSDA =
e;
1057 return tablesAreBuilt;
1064 return theDEDXTable;
1071 return theDEDXSubTable;
1078 return theDEDXunRestrictedTable;
1086 if(theIonisationTable) { t = theIonisationTable; }
1095 if(theIonisationSubTable) { t = theIonisationSubTable; }
1103 return theCSDARangeTable;
1110 return theRangeTableForLoss;
1117 return theInverseRangeTable;
1124 return theLambdaTable;
1131 return theSubLambdaTable;