51#ifndef G4VEnergyLossProcess_h
52#define G4VEnergyLossProcess_h 1
151 G4bool ascii =
false)
override;
224 std::size_t& idxCouple)
const;
362 inline std::vector<G4TwoPeaksXS*>*
TwoPeaksXS()
const;
379 void FillSecondariesAlongStep(
G4double weight);
406 void ComputeLambdaForScaledEnergy(
G4double scaledKinE,
442 std::vector<const G4Region*>* scoffRegions =
nullptr;
443 std::vector<G4VEmModel*>* emModels =
nullptr;
444 const std::vector<G4int>* theDensityIdx =
nullptr;
445 const std::vector<G4double>* theDensityFactor =
nullptr;
448 std::vector<G4double>* theEnergyOfCrossSectionMax =
nullptr;
449 std::vector<G4TwoPeaksXS*>* fXSpeaks =
nullptr;
486 G4int numberOfModels = 0;
487 G4int nSCoffRegions = 0;
491 G4int mainSecondaries = 1;
493 std::size_t basedCoupleIndex = 0;
494 std::size_t coupleIdxRange = 0;
495 std::size_t idxDEDX = 0;
496 std::size_t idxDEDXunRestricted = 0;
497 std::size_t idxIonisation = 0;
498 std::size_t idxRange = 0;
499 std::size_t idxCSDA = 0;
500 std::size_t idxSecRange = 0;
501 std::size_t idxInverseRange = 0;
502 std::size_t idxLambda = 0;
507 G4bool lossFluctuationFlag =
true;
508 G4bool rndmStepFlag =
false;
509 G4bool tablesAreBuilt =
false;
512 G4bool isIonisation =
true;
513 G4bool useDeexcitation =
false;
515 G4bool weightFlag =
false;
518 G4bool actLinLossLimit =
false;
519 G4bool actLossFluc =
false;
520 G4bool actBinning =
false;
521 G4bool actMinKinEnergy =
false;
522 G4bool actMaxKinEnergy =
false;
524 std::vector<G4DynamicParticle*> secParticles;
525 std::vector<G4Track*> scTracks;
546 G4double kinEnergy, std::size_t& idx)
const
560 fFactor = chargeSqRatio*biasFactor;
567 reduceFactor = 1.0/(fFactor*massRatio);
580 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->Value(e, idxDEDX);
581 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
593 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->LogVectorValue(e,loge);
594 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
600inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(
G4double e)
603 fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e, idxIonisation);
604 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
610inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e)
618 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->Value(e, idxRange);
619 if(e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); }
628G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e,
G4double loge)
636 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->LogVectorValue(e, loge);
637 if(e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); }
648G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e)
650 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->Value(e, idxCSDA);
651 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
658G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e,
661 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->LogVectorValue(e, loge);
662 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
676 if(r >= rmin) { e = v->
Value(r, idxInverseRange); }
679 e = minKinEnergy*x*x;
688 return fFactor*((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda);
696 return fFactor*((*theLambdaTable)[basedCoupleIndex])->LogVectorValue(e, loge);
705 DefineMaterial(couple);
706 return GetDEDXForScaledEnergy(kinEnergy*massRatio);
716 DefineMaterial(couple);
717 return GetDEDXForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
726 DefineMaterial(couple);
727 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio);
737 DefineMaterial(couple);
738 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
747 DefineMaterial(couple);
748 return (
nullptr == theCSDARangeTable) ?
DBL_MAX :
749 GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
758 DefineMaterial(couple);
759 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
768 DefineMaterial(couple);
769 return (
nullptr != theLambdaTable) ?
770 GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0;
780 DefineMaterial(couple);
781 return (
nullptr != theLambdaTable) ?
782 GetLambdaForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio)
812 secondaryParticle = p;
842 return secondaryParticle;
849 lossFluctuationFlag = val;
885 return nSCoffRegions;
913 return tablesAreBuilt;
927 return theDEDXunRestrictedTable;
934 return theIonisationTable;
941 return theCSDARangeTable;
948 return theRangeTableForLoss;
955 return theInverseRangeTable;
962 return theLambdaTable;
974inline std::vector<G4double>*
977 return theEnergyOfCrossSectionMax;
991 return numberOfModels;
998 return (index < emModels->size()) ? (*emModels)[index] :
nullptr;
G4double condition(const G4ErrorSymMatrix &m)
G4VEmModel * SelectModel(G4double energy, std::size_t index)
G4VEmModel * GetModel(G4int idx, G4bool ver=false) const
const G4Material * GetMaterial() const
G4double Energy(const std::size_t index) const
G4double Value(const G4double energy, std::size_t &lastidx) const
void SetCurrentCouple(const G4MaterialCutsCouple *)
const G4ParticleDefinition * BaseParticle() const
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
G4PhysicsTable * RangeTableForLoss() const
G4bool UseBaseMaterial() const
G4double GetContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety) override
void SetMaxKinEnergy(G4double e)
G4ParticleChangeForLoss fParticleChange
void PreparePhysicsTable(const G4ParticleDefinition &) override
std::vector< G4double > * EnergyOfCrossSectionMax() const
G4double GetCSDADEDX(G4double kineticEnergy, const G4MaterialCutsCouple *)
G4PhysicsTable * InverseRangeTable() const
G4double MeanFreePath(const G4Track &track)
void SetFluctModel(G4VEmFluctuationModel *)
G4double preStepLogScaledEnergy
G4VEnergyLossProcess(G4VEnergyLossProcess &)=delete
G4double GetKineticEnergy(G4double range, const G4MaterialCutsCouple *)
G4PhysicsTable * CSDARangeTable() const
void SetSpline(G4bool val)
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0
void SelectModel(G4double kinEnergy)
void SetRangeTableForLoss(G4PhysicsTable *p)
G4int NumberOfSubCutoffRegions() const
G4PhysicsVector * LambdaPhysicsVector(const G4MaterialCutsCouple *, G4double cut)
void ProcessDescription(std::ostream &outFile) const override
std::size_t NumberOfModels() const
G4VEmModel * EmModel(std::size_t index=0) const
G4VEmModel * GetModelByIndex(std::size_t idx=0, G4bool ver=false) const
G4PhysicsTable * BuildDEDXTable(G4EmTableType tType=fRestricted)
void SetTwoPeaksXS(std::vector< G4TwoPeaksXS * > *)
const G4MaterialCutsCouple * currentCouple
G4double MaxKinEnergy() const
std::size_t CurrentMaterialCutsCoupleIndex() const
G4bool TablesAreBuilt() const
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)
G4double preStepScaledEnergy
void ActivateSecondaryBiasing(const G4String ®ion, G4double factor, G4double energyLimit)
G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
const G4Element * GetCurrentElement() const
void SetDEDXBinning(G4int nbins)
void SetStepFunction(G4double v1, G4double v2)
G4double GetLambda(G4double kineticEnergy, const G4MaterialCutsCouple *)
void SetEmModel(G4VEmModel *, G4int index=0)
void SetCrossSectionBiasingFactor(G4double f, G4bool flag=true)
const G4Material * currentMaterial
G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right)=delete
G4double GetMeanFreePath(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
G4double ContinuousStepLimit(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety)
std::vector< G4TwoPeaksXS * > * TwoPeaksXS() const
void SetParticle(const G4ParticleDefinition *p)
void SetLossFluctuations(G4bool val)
void SetCrossSectionType(G4CrossSectionType val)
const G4ParticleDefinition * Particle() const
void SetInverseRangeTable(G4PhysicsTable *p)
G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
void ActivateForcedInteraction(G4double length, const G4String ®ion, G4bool flag=true)
G4CrossSectionType CrossSectionType() const
void SetDynamicMassCharge(G4double massratio, G4double charge2ratio)
G4double MinKinEnergy() const
void SetBaseParticle(const G4ParticleDefinition *p)
G4double CrossSectionBiasingFactor() const
G4bool IsIonisationProcess() const
void SetEnergyOfCrossSectionMax(std::vector< G4double > *)
G4double CrossSectionPerVolume(G4double kineticEnergy, const G4MaterialCutsCouple *couple)
void SetDEDXTable(G4PhysicsTable *p, G4EmTableType tType)
G4PhysicsTable * BuildLambdaTable(G4EmTableType tType=fRestricted)
G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
~G4VEnergyLossProcess() override
G4double GetCSDARange(G4double kineticEnergy, const G4MaterialCutsCouple *)
void SetIonisation(G4bool val)
G4double GetDEDX(G4double kineticEnergy, const G4MaterialCutsCouple *)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double ¤tSafety, G4GPILSelection *selection) override
G4VEmFluctuationModel * FluctModel() const
void SetLinearLossLimit(G4double val)
void SetLowestEnergyLimit(G4double)
void SetLambdaTable(G4PhysicsTable *p)
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4double preStepKinEnergy
G4VParticleChange * AlongStepDoIt(const G4Track &, const G4Step &) override
G4double GetRange(G4double kineticEnergy, const G4MaterialCutsCouple *)
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
G4PhysicsTable * IonisationTable() const
void ActivateSubCutoff(const G4Region *region)
G4VEmModel * SelectModelForMaterial(G4double kinEnergy, std::size_t &idxCouple) const
void SetSecondaryParticle(const G4ParticleDefinition *p)
G4PhysicsTable * LambdaTable() const
void SetCSDARangeTable(G4PhysicsTable *pRange)
G4double preStepLogKinEnergy
G4PhysicsTable * DEDXunRestrictedTable() const
std::size_t currentCoupleIndex
virtual void StreamProcessInfo(std::ostream &) const
G4PhysicsTable * DEDXTable() const
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
void StartTracking(G4Track *) override
void SetMinKinEnergy(G4double e)
const G4ParticleDefinition * SecondaryParticle() const