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);
408 void ComputeLambdaForScaledEnergy(
G4double scaledKinE,
444 std::vector<const G4Region*>* scoffRegions =
nullptr;
445 std::vector<G4VEmModel*>* emModels =
nullptr;
446 const std::vector<G4int>* theDensityIdx =
nullptr;
447 const std::vector<G4double>* theDensityFactor =
nullptr;
450 std::vector<G4double>* theEnergyOfCrossSectionMax =
nullptr;
451 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 useCutAsFinalRange =
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); }
595 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->LogVectorValue(e,loge);
596 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
602inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(
G4double e)
605 fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e, idxIonisation);
606 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
612inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e)
620 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->Value(e, idxRange);
621 if (fRange < 0.0) { fRange = 0.0; }
622 else if (e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); }
631G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(
G4double e,
G4double loge)
639 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->LogVectorValue(e, loge);
640 if (fRange < 0.0) { fRange = 0.0; }
641 else if (e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); }
652G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e)
654 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->Value(e, idxCSDA);
655 if (x < 0.0) { x = 0.0; }
656 else if (e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
663G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
G4double e,
666 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->LogVectorValue(e, loge);
667 if (x < 0.0) { x = 0.0; }
668 else if (e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
682 if(r >= rmin) { e = v->
Value(r, idxInverseRange); }
685 e = minKinEnergy*x*x;
694 return fFactor*((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda);
702 return fFactor*((*theLambdaTable)[basedCoupleIndex])->LogVectorValue(e, loge);
707inline G4double G4VEnergyLossProcess::LogScaledEkin(
const G4Track& track)
718 DefineMaterial(couple);
719 return GetDEDXForScaledEnergy(kinEnergy*massRatio);
729 DefineMaterial(couple);
730 return GetDEDXForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
739 DefineMaterial(couple);
740 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio);
750 DefineMaterial(couple);
751 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
760 DefineMaterial(couple);
761 return (
nullptr == theCSDARangeTable) ?
DBL_MAX :
762 GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
771 DefineMaterial(couple);
772 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
781 DefineMaterial(couple);
782 return (
nullptr != theLambdaTable) ?
783 GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0;
793 DefineMaterial(couple);
794 return (
nullptr != theLambdaTable) ?
795 GetLambdaForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio)
825 secondaryParticle = p;
855 return secondaryParticle;
862 lossFluctuationFlag = val;
898 return nSCoffRegions;
926 return tablesAreBuilt;
940 return theDEDXunRestrictedTable;
947 return theIonisationTable;
954 return theCSDARangeTable;
961 return theRangeTableForLoss;
968 return theInverseRangeTable;
975 return theLambdaTable;
987inline std::vector<G4double>*
990 return theEnergyOfCrossSectionMax;
1004 return numberOfModels;
1011 return (index < emModels->size()) ? (*emModels)[index] :
nullptr;
G4double condition(const G4ErrorSymMatrix &m)
G4double GetLogKineticEnergy() const
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
const G4DynamicParticle * GetDynamicParticle() 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 *)
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
G4VEnergyLossProcess(const G4String &name="EnergyLoss", G4ProcessType type=fElectromagnetic)
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)
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