94 #ifndef G4VEnergyLossProcess_h
95 #define G4VEnergyLossProcess_h 1
216 G4bool ascii =
false)
override;
463 inline G4double GetLimitScaledRangeForScaledEnergy(
G4double scaledKinEnergy);
466 inline void ComputeLambdaForScaledEnergy(
G4double scaledKinEnergy);
488 std::vector<G4VEmModel*> emModels;
492 std::vector<const G4Region*> scoffRegions;
496 std::vector<G4VEnergyLossProcess*> scProcesses;
514 size_t idxDEDXunRestricted;
515 size_t idxIonisation;
516 size_t idxIonisationSub;
520 size_t idxInverseRange;
524 std::vector<G4double> theDEDXAtMaxEnergy;
525 std::vector<G4double> theRangeAtMaxEnergy;
526 std::vector<G4double> theEnergyOfCrossSectionMax;
527 std::vector<G4double> theCrossSectionMax;
529 const std::vector<G4double>* theDensityFactor;
530 const std::vector<G4int>* theDensityIdx;
551 G4bool lossFluctuationFlag;
578 std::vector<G4DynamicParticle*> secParticles;
579 std::vector<G4Track*> scTracks;
586 size_t currentCoupleIndex;
587 size_t basedCoupleIndex;
614 return currentCoupleIndex;
621 currentModel = modelManager->
SelectModel(kinEnergy, currentCoupleIndex);
628 G4double kinEnergy,
size_t& idx)
const
638 if(couple != currentCouple) {
639 currentCouple = couple;
641 currentCoupleIndex = couple->
GetIndex();
642 basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex];
643 fFactor = chargeSqRatio*biasFactor*(*theDensityFactor)[currentCoupleIndex];
644 reduceFactor = 1.0/(fFactor*massRatio);
646 idxLambda = idxSubLambda = 0;
655 massRatio = massratio;
656 fFactor = charge2ratio*biasFactor*(*theDensityFactor)[currentCoupleIndex];
657 chargeSqRatio = charge2ratio;
658 reduceFactor = 1.0/(fFactor*massRatio);
670 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->Value(e, idxDEDX);
671 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
680 fFactor*(*theDEDXSubTable)[basedCoupleIndex]->Value(e, idxDEDXSub);
681 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
687 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(
G4double e)
690 fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e, idxIonisation);
691 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
701 (*theIonisationSubTable)[basedCoupleIndex]->Value(e, idxIonisationSub);
702 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
708 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e)
713 if(basedCoupleIndex != lastIdx || preStepRangeEnergy != e) {
714 lastIdx = basedCoupleIndex;
715 preStepRangeEnergy = e;
717 ((*theRangeTableForLoss)[basedCoupleIndex])->Value(e, idxRange);
718 if(e < minKinEnergy) { computedRange *= std::sqrt(e/minKinEnergy); }
724 return computedRange;
730 G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e)
733 if (e < maxKinEnergyCSDA) {
734 x = ((*theCSDARangeTable)[basedCoupleIndex])->Value(e, idxCSDA);
735 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
737 x = theRangeAtMaxEnergy[basedCoupleIndex] +
738 (e - maxKinEnergyCSDA)/theDEDXAtMaxEnergy[basedCoupleIndex];
753 if(r >= rmin) { e = v->
Value(r, idxInverseRange); }
756 e = minKinEnergy*x*x;
765 return fFactor*((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda);
774 DefineMaterial(couple);
775 return GetDEDXForScaledEnergy(kineticEnergy*massRatio);
784 DefineMaterial(couple);
785 return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
795 DefineMaterial(couple);
796 if(theCSDARangeTable) {
797 x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
799 }
else if(theRangeTableForLoss) {
800 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
811 DefineMaterial(couple);
813 if(theCSDARangeTable) {
814 x=GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
826 DefineMaterial(couple);
828 GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
840 DefineMaterial(couple);
841 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
850 DefineMaterial(couple);
853 x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
860 inline void G4VEnergyLossProcess::ComputeLambdaForScaledEnergy(
G4double e)
862 mfpKinEnergy = theEnergyOfCrossSectionMax[currentCoupleIndex];
863 if (e <= mfpKinEnergy) {
864 preStepLambda = GetLambdaForScaledEnergy(e);
868 if(e1 > mfpKinEnergy) {
869 preStepLambda = GetLambdaForScaledEnergy(e);
870 G4double preStepLambda1 = GetLambdaForScaledEnergy(e1);
871 if(preStepLambda1 > preStepLambda) {
873 preStepLambda = preStepLambda1;
876 preStepLambda = fFactor*theCrossSectionMax[currentCoupleIndex];
907 secondaryParticle =
p;
937 return secondaryParticle;
944 lossFluctuationFlag = val;
974 return nSCoffRegions;
1002 return tablesAreBuilt;
1009 return theDEDXTable;
1016 return theDEDXSubTable;
1023 return theDEDXunRestrictedTable;
1030 return theIonisationTable;
1037 return theIonisationSubTable;
1044 return theCSDARangeTable;
1051 return theSecondaryRangeTable;
1058 return theRangeTableForLoss;
1065 return theInverseRangeTable;
1072 return theLambdaTable;
1079 return theSubLambdaTable;
G4double GetKineticEnergy(G4double &range, const G4MaterialCutsCouple *)
G4VEnergyLossProcess(const G4String &name="EnergyLoss", G4ProcessType type=fElectromagnetic)
G4double condition(const G4ErrorSymMatrix &m)
void SetDEDXTable(G4PhysicsTable *p, G4EmTableType tType)
void SetIntegral(G4bool val)
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
void PrintInfoDefinition(const G4ParticleDefinition &part)
void SetIonisation(G4bool val)
virtual void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double GetDEDX(G4double &kineticEnergy, const G4MaterialCutsCouple *)
G4PhysicsTable * SubLambdaTable() const
virtual G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety) override
G4PhysicsTable * RangeTableForLoss() const
G4PhysicsTable * SecondaryRangeTable() const
G4double GetRangeForLoss(G4double &kineticEnergy, const G4MaterialCutsCouple *)
void AddCollaborativeProcess(G4VEnergyLossProcess *)
void SetLinearLossLimit(G4double val)
G4PhysicsTable * CSDARangeTable() const
G4ParticleChangeForLoss fParticleChange
G4double GetCSDARange(G4double &kineticEnergy, const G4MaterialCutsCouple *)
virtual G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void SelectModel(G4double kinEnergy)
G4VEmModel * GetModelByIndex(G4int idx=0, G4bool ver=false) const
G4int NumberOfModels() const
virtual G4bool IsApplicable(const G4ParticleDefinition &p) override=0
G4PhysicsTable * IonisationTableForSubsec() const
G4double GetDEDXForSubsec(G4double &kineticEnergy, const G4MaterialCutsCouple *)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &) override
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
void SetFluctModel(G4VEmFluctuationModel *)
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *, G4double cut)
G4PhysicsTable * IonisationTable() const
G4PhysicsTable * BuildLambdaTable(G4EmTableType tType=fRestricted)
void SetStepFunction(G4double v1, G4double v2, G4bool lock=true)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=nullptr)
G4PhysicsTable * LambdaTable() const
void SetInverseRangeTable(G4PhysicsTable *p)
const G4ParticleDefinition * SecondaryParticle() const
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
G4VEmFluctuationModel * FluctModel()
G4double SampleSubCutSecondaries(std::vector< G4Track * > &, const G4Step &, G4VEmModel *model, G4int matIdx)
G4PhysicsTable * DEDXTable() const
const G4Element * GetCurrentElement() const
void SetLossFluctuations(G4bool val)
void ActivateForcedInteraction(G4double length, const G4String ®ion, G4bool flag=true)
virtual ~G4VEnergyLossProcess()
G4int NumberOfSubCutoffRegions() const
G4bool IsIntegral() const
void SetMaxKinEnergy(G4double e)
G4double GetLambda(G4double &kineticEnergy, const G4MaterialCutsCouple *)
const G4ParticleDefinition * BaseParticle() const
virtual void ProcessDescription(std::ostream &outFile) const
G4PhysicsTable * DEDXTableForSubsec() const
G4double Energy(size_t index) const
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetSecondaryParticle(const G4ParticleDefinition *p)
void SetLambdaTable(G4PhysicsTable *p)
virtual void PrintInfo()=0
G4PhysicsTable * InverseRangeTable() const
G4double CrossSectionBiasingFactor() const
virtual void StartTracking(G4Track *) override
const G4ParticleDefinition * Particle() const
void SetCurrentCouple(const G4MaterialCutsCouple *)
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
G4double MeanFreePath(const G4Track &track)
void UpdateEmModel(const G4String &, G4double, G4double)
G4bool TablesAreBuilt() const
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection) override
virtual void PreparePhysicsTable(const G4ParticleDefinition &) override
void SetEmModel(G4VEmModel *, G4int index=1)
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety)
G4double MinKinEnergy() const
G4double MaxKinEnergy() const
G4VEmModel * SelectModel(G4double &energy, size_t &index)
void SetCSDARangeTable(G4PhysicsTable *pRange)
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
void SetSecondaryRangeTable(G4PhysicsTable *p)
G4PhysicsTable * DEDXunRestrictedTable() const
void ActivateSubCutoff(G4bool val, const G4Region *region=nullptr)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void SetLowestEnergyLimit(G4double)
void SetSubLambdaTable(G4PhysicsTable *p)
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)
void SetRangeTableForLoss(G4PhysicsTable *p)
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
const XML_Char XML_Content * model
void SetParticle(const G4ParticleDefinition *p)
void SetBaseParticle(const G4ParticleDefinition *p)
G4PhysicsTable * BuildDEDXTable(G4EmTableType tType=fRestricted)
G4VEmModel * EmModel(G4int index=1) const
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, size_t &idx) const
void SetDEDXBinning(G4int nbins)
G4double GetRange(G4double &kineticEnergy, const G4MaterialCutsCouple *)
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0
const G4Material * GetMaterial() const
size_t CurrentMaterialCutsCoupleIndex() const
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
G4bool IsIonisationProcess() const
void SetMinKinEnergy(G4double e)