Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VEnergyLossProcess Class Referenceabstract

#include <G4VEnergyLossProcess.hh>

+ Inheritance diagram for G4VEnergyLossProcess:

Public Member Functions

 G4VEnergyLossProcess (const G4String &name="EnergyLoss", G4ProcessType type=fElectromagnetic)
 
 ~G4VEnergyLossProcess () override
 
virtual G4double MinPrimaryEnergy (const G4ParticleDefinition *, const G4Material *, G4double cut)
 
void ProcessDescription (std::ostream &outFile) const override
 
void PreparePhysicsTable (const G4ParticleDefinition &) override
 
void BuildPhysicsTable (const G4ParticleDefinition &) override
 
G4PhysicsTableBuildDEDXTable (G4EmTableType tType=fRestricted)
 
G4PhysicsTableBuildLambdaTable (G4EmTableType tType=fRestricted)
 
void StartTracking (G4Track *) override
 
G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection) override
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &) override
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &) override
 
G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false) override
 
G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii) override
 
G4double GetDEDXDispersion (const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
 
G4double CrossSectionPerVolume (G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double CrossSectionPerVolume (G4double kineticEnergy, const G4MaterialCutsCouple *couple, G4double logKineticEnergy)
 
G4double MeanFreePath (const G4Track &track)
 
G4double ContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
 
G4VEmModelSelectModelForMaterial (G4double kinEnergy, std::size_t &idxCouple) const
 
void AddEmModel (G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
 
void SetEmModel (G4VEmModel *, G4int index=0)
 
std::size_t NumberOfModels () const
 
G4VEmModelEmModel (std::size_t index=0) const
 
G4VEmModelGetModelByIndex (std::size_t idx=0, G4bool ver=false) const
 
void SetFluctModel (G4VEmFluctuationModel *)
 
G4VEmFluctuationModelFluctModel () const
 
void SetBaseParticle (const G4ParticleDefinition *p)
 
const G4ParticleDefinitionParticle () const
 
const G4ParticleDefinitionBaseParticle () const
 
const G4ParticleDefinitionSecondaryParticle () const
 
 G4VEnergyLossProcess (G4VEnergyLossProcess &)=delete
 
G4VEnergyLossProcessoperator= (const G4VEnergyLossProcess &right)=delete
 
void ActivateSubCutoff (const G4Region *region)
 
void SetCrossSectionBiasingFactor (G4double f, G4bool flag=true)
 
void ActivateForcedInteraction (G4double length, const G4String &region, G4bool flag=true)
 
void ActivateSecondaryBiasing (const G4String &region, G4double factor, G4double energyLimit)
 
void SetLossFluctuations (G4bool val)
 
void SetSpline (G4bool val)
 
void SetCrossSectionType (G4CrossSectionType val)
 
G4CrossSectionType CrossSectionType () const
 
void SetIonisation (G4bool val)
 
G4bool IsIonisationProcess () const
 
void SetLinearLossLimit (G4double val)
 
void SetStepFunction (G4double v1, G4double v2)
 
void SetLowestEnergyLimit (G4double)
 
G4int NumberOfSubCutoffRegions () const
 
void SetDEDXTable (G4PhysicsTable *p, G4EmTableType tType)
 
void SetCSDARangeTable (G4PhysicsTable *pRange)
 
void SetRangeTableForLoss (G4PhysicsTable *p)
 
void SetInverseRangeTable (G4PhysicsTable *p)
 
void SetLambdaTable (G4PhysicsTable *p)
 
void SetTwoPeaksXS (std::vector< G4TwoPeaksXS * > *)
 
void SetEnergyOfCrossSectionMax (std::vector< G4double > *)
 
void SetDEDXBinning (G4int nbins)
 
void SetMinKinEnergy (G4double e)
 
G4double MinKinEnergy () const
 
void SetMaxKinEnergy (G4double e)
 
G4double MaxKinEnergy () const
 
G4double CrossSectionBiasingFactor () const
 
G4double GetDEDX (G4double kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetCSDADEDX (G4double kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetDEDX (G4double kineticEnergy, const G4MaterialCutsCouple *, G4double logKineticEnergy)
 
G4double GetRange (G4double kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetRange (G4double kineticEnergy, const G4MaterialCutsCouple *, G4double logKineticEnergy)
 
G4double GetCSDARange (G4double kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetKineticEnergy (G4double range, const G4MaterialCutsCouple *)
 
G4double GetLambda (G4double kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetLambda (G4double kineticEnergy, const G4MaterialCutsCouple *, G4double logKineticEnergy)
 
G4bool TablesAreBuilt () const
 
G4PhysicsTableDEDXTable () const
 
G4PhysicsTableDEDXunRestrictedTable () const
 
G4PhysicsTableIonisationTable () const
 
G4PhysicsTableCSDARangeTable () const
 
G4PhysicsTableRangeTableForLoss () const
 
G4PhysicsTableInverseRangeTable () const
 
G4PhysicsTableLambdaTable () const
 
std::vector< G4TwoPeaksXS * > * TwoPeaksXS () const
 
std::vector< G4double > * EnergyOfCrossSectionMax () const
 
G4bool UseBaseMaterial () const
 
const G4ElementGetCurrentElement () const
 
void SetDynamicMassCharge (G4double massratio, G4double charge2ratio)
 
- Public Member Functions inherited from G4VContinuousDiscreteProcess
 G4VContinuousDiscreteProcess (const G4String &, G4ProcessType aType=fNotDefined)
 
 G4VContinuousDiscreteProcess (G4VContinuousDiscreteProcess &)
 
virtual ~G4VContinuousDiscreteProcess ()
 
G4VContinuousDiscreteProcessoperator= (const G4VContinuousDiscreteProcess &)=delete
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &, G4ForceCondition *)
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &, const G4Step &)
 
- Public Member Functions inherited from G4VProcess
 G4VProcess (const G4String &aName="NoName", G4ProcessType aType=fNotDefined)
 
 G4VProcess (const G4VProcess &right)
 
virtual ~G4VProcess ()
 
G4VProcessoperator= (const G4VProcess &)=delete
 
G4bool operator== (const G4VProcess &right) const
 
G4bool operator!= (const G4VProcess &right) const
 
G4double GetCurrentInteractionLength () const
 
void SetPILfactor (G4double value)
 
G4double GetPILfactor () const
 
G4double AlongStepGPIL (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
 
G4double AtRestGPIL (const G4Track &track, G4ForceCondition *condition)
 
G4double PostStepGPIL (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4bool IsApplicable (const G4ParticleDefinition &)
 
const G4StringGetPhysicsTableFileName (const G4ParticleDefinition *, const G4String &directory, const G4String &tableName, G4bool ascii=false)
 
const G4StringGetProcessName () const
 
G4ProcessType GetProcessType () const
 
void SetProcessType (G4ProcessType)
 
G4int GetProcessSubType () const
 
void SetProcessSubType (G4int)
 
virtual const G4VProcessGetCreatorProcess () const
 
virtual void EndTracking ()
 
virtual void SetProcessManager (const G4ProcessManager *)
 
virtual const G4ProcessManagerGetProcessManager ()
 
virtual void ResetNumberOfInteractionLengthLeft ()
 
G4double GetNumberOfInteractionLengthLeft () const
 
G4double GetTotalNumberOfInteractionLengthTraversed () const
 
G4bool isAtRestDoItIsEnabled () const
 
G4bool isAlongStepDoItIsEnabled () const
 
G4bool isPostStepDoItIsEnabled () const
 
virtual void DumpInfo () const
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
virtual void SetMasterProcess (G4VProcess *masterP)
 
const G4VProcessGetMasterProcess () const
 
virtual void BuildWorkerPhysicsTable (const G4ParticleDefinition &part)
 
virtual void PrepareWorkerPhysicsTable (const G4ParticleDefinition &)
 

Protected Member Functions

virtual void StreamProcessInfo (std::ostream &) const
 
virtual void InitialiseEnergyLossProcess (const G4ParticleDefinition *, const G4ParticleDefinition *)=0
 
G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition) override
 
G4double GetContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety) override
 
G4PhysicsVectorLambdaPhysicsVector (const G4MaterialCutsCouple *, G4double cut)
 
std::size_t CurrentMaterialCutsCoupleIndex () const
 
void SelectModel (G4double kinEnergy)
 
void SetParticle (const G4ParticleDefinition *p)
 
void SetSecondaryParticle (const G4ParticleDefinition *p)
 
- Protected Member Functions inherited from G4VContinuousDiscreteProcess
void SetGPILSelection (G4GPILSelection selection)
 
G4GPILSelection GetGPILSelection () const
 
- Protected Member Functions inherited from G4VProcess
void SubtractNumberOfInteractionLengthLeft (G4double prevStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4ParticleChangeForLoss fParticleChange
 
const G4MaterialcurrentMaterial = nullptr
 
const G4MaterialCutsCouplecurrentCouple = nullptr
 
G4double preStepLambda = 0.0
 
G4double preStepKinEnergy = 0.0
 
G4double preStepScaledEnergy = 0.0
 
G4double mfpKinEnergy = 0.0
 
std::size_t currentCoupleIndex = 0
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager = nullptr
 
G4VParticleChangepParticleChange = nullptr
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft = -1.0
 
G4double currentInteractionLength = -1.0
 
G4double theInitialNumberOfInteractionLength = -1.0
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType = fNotDefined
 
G4int theProcessSubType = -1
 
G4double thePILfactor = 1.0
 
G4int verboseLevel = 0
 
G4bool enableAtRestDoIt = true
 
G4bool enableAlongStepDoIt = true
 
G4bool enablePostStepDoIt = true
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VProcess
static const G4StringGetProcessTypeName (G4ProcessType)
 

Detailed Description

Definition at line 82 of file G4VEnergyLossProcess.hh.

Constructor & Destructor Documentation

◆ G4VEnergyLossProcess() [1/2]

G4VEnergyLossProcess::G4VEnergyLossProcess ( const G4String & name = "EnergyLoss",
G4ProcessType type = fElectromagnetic )

Definition at line 93 of file G4VEnergyLossProcess.cc.

94 :
96{
97 theParameters = G4EmParameters::Instance();
99
100 // low energy limit
101 lowestKinEnergy = theParameters->LowestElectronEnergy();
102
103 // Size of tables
104 minKinEnergy = 0.1*CLHEP::keV;
105 maxKinEnergy = 100.0*CLHEP::TeV;
106 maxKinEnergyCSDA = 1.0*CLHEP::GeV;
107 nBins = 84;
108 nBinsCSDA = 35;
109
110 invLambdaFactor = 1.0/lambdaFactor;
111
112 // default linear loss limit
113 finalRange = 1.*CLHEP::mm;
114
115 // run time objects
118 modelManager = new G4EmModelManager();
120 ->GetSafetyHelper();
121 aGPILSelection = CandidateForSelection;
122
123 // initialise model
124 lManager = G4LossTableManager::Instance();
125 lManager->Register(this);
126 isMaster = lManager->IsMaster();
127
128 G4LossTableBuilder* bld = lManager->GetTableBuilder();
129 theDensityFactor = bld->GetDensityFactors();
130 theDensityIdx = bld->GetCoupleIndexes();
131
132 scTracks.reserve(10);
133 secParticles.reserve(12);
134 emModels = new std::vector<G4VEmModel*>;
135}
@ CandidateForSelection
static G4EmParameters * Instance()
G4double LowestElectronEnergy() const
const std::vector< G4double > * GetDensityFactors() const
const std::vector< G4int > * GetCoupleIndexes() const
static G4LossTableManager * Instance()
G4LossTableBuilder * GetTableBuilder()
void Register(G4VEnergyLossProcess *p)
static G4TransportationManager * GetTransportationManager()
G4SafetyHelper * GetSafetyHelper() const
G4ParticleChangeForLoss fParticleChange
void SetSecondaryWeightByProcess(G4bool)
void SetVerboseLevel(G4int value)
G4VParticleChange * pParticleChange

◆ ~G4VEnergyLossProcess()

G4VEnergyLossProcess::~G4VEnergyLossProcess ( )
override

Definition at line 139 of file G4VEnergyLossProcess.cc.

140{
141 if (isMaster) {
142 if(nullptr == baseParticle) { delete theData; }
143 delete theEnergyOfCrossSectionMax;
144 if(nullptr != fXSpeaks) {
145 for(auto const & v : *fXSpeaks) { delete v; }
146 delete fXSpeaks;
147 }
148 }
149 delete modelManager;
150 delete biasManager;
151 delete scoffRegions;
152 delete emModels;
153 lManager->DeRegister(this);
154}
void DeRegister(G4VEnergyLossProcess *p)

◆ G4VEnergyLossProcess() [2/2]

G4VEnergyLossProcess::G4VEnergyLossProcess ( G4VEnergyLossProcess & )
delete

Member Function Documentation

◆ ActivateForcedInteraction()

void G4VEnergyLossProcess::ActivateForcedInteraction ( G4double length,
const G4String & region,
G4bool flag = true )

Definition at line 1358 of file G4VEnergyLossProcess.cc.

1361{
1362 if(nullptr == biasManager) { biasManager = new G4EmBiasingManager(); }
1363 if(1 < verboseLevel) {
1364 G4cout << "### ActivateForcedInteraction: for "
1365 << " process " << GetProcessName()
1366 << " length(mm)= " << length/mm
1367 << " in G4Region <" << region
1368 << "> weightFlag= " << flag
1369 << G4endl;
1370 }
1371 weightFlag = flag;
1372 biasManager->ActivateForcedInteraction(length, region);
1373}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")
G4int verboseLevel
const G4String & GetProcessName() const

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ ActivateSecondaryBiasing()

void G4VEnergyLossProcess::ActivateSecondaryBiasing ( const G4String & region,
G4double factor,
G4double energyLimit )

Definition at line 1378 of file G4VEnergyLossProcess.cc.

1381{
1382 if (0.0 <= factor) {
1383 // Range cut can be applied only for e-
1384 if(0.0 == factor && secondaryParticle != G4Electron::Electron())
1385 { return; }
1386
1387 if(nullptr == biasManager) { biasManager = new G4EmBiasingManager(); }
1388 biasManager->ActivateSecondaryBiasing(region, factor, energyLimit);
1389 if(1 < verboseLevel) {
1390 G4cout << "### ActivateSecondaryBiasing: for "
1391 << " process " << GetProcessName()
1392 << " factor= " << factor
1393 << " in G4Region <" << region
1394 << "> energyLimit(MeV)= " << energyLimit/MeV
1395 << G4endl;
1396 }
1397 }
1398}
static G4Electron * Electron()
Definition G4Electron.cc:91
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ ActivateSubCutoff()

void G4VEnergyLossProcess::ActivateSubCutoff ( const G4Region * region)

Definition at line 514 of file G4VEnergyLossProcess.cc.

515{
516 if(nullptr == scoffRegions) {
517 scoffRegions = new std::vector<const G4Region*>;
518 }
519 // the region is in the list
520 if(!scoffRegions->empty()) {
521 for (auto & reg : *scoffRegions) {
522 if (reg == r) { return; }
523 }
524 }
525 // new region
526 scoffRegions->push_back(r);
527 ++nSCoffRegions;
528}

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ AddEmModel()

void G4VEnergyLossProcess::AddEmModel ( G4int order,
G4VEmModel * ptr,
G4VEmFluctuationModel * fluc = nullptr,
const G4Region * region = nullptr )

Definition at line 167 of file G4VEnergyLossProcess.cc.

170{
171 if(nullptr == ptr) { return; }
172 G4VEmFluctuationModel* afluc = (nullptr == fluc) ? fluctModel : fluc;
173 modelManager->AddEmModel(order, ptr, afluc, region);
175}
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fm, const G4Region *r)
void SetParticleChange(G4VParticleChange *, G4VEmFluctuationModel *f=nullptr)

Referenced by LBE::ConstructEM(), G4EmLivermorePhysics::ConstructProcess(), G4EmLowEPPhysics::ConstructProcess(), G4EmPenelopePhysics::ConstructProcess(), G4EmStandardPhysics_option4::ConstructProcess(), G4eBremsstrahlung::InitialiseEnergyLossProcess(), G4eIonisation::InitialiseEnergyLossProcess(), G4ePairProduction::InitialiseEnergyLossProcess(), G4hhIonisation::InitialiseEnergyLossProcess(), G4hIonisation::InitialiseEnergyLossProcess(), G4ionIonisation::InitialiseEnergyLossProcess(), G4mplIonisation::InitialiseEnergyLossProcess(), G4MuBremsstrahlung::InitialiseEnergyLossProcess(), G4MuIonisation::InitialiseEnergyLossProcess(), G4MuonToMuonPairProduction::InitialiseEnergyLossProcess(), G4MuPairProduction::InitialiseEnergyLossProcess(), G4PolarizedBremsstrahlung::InitialiseEnergyLossProcess(), G4PolarizedIonisation::InitialiseEnergyLossProcess(), and G4EmConfigurator::PrepareModels().

◆ AlongStepDoIt()

G4VParticleChange * G4VEnergyLossProcess::AlongStepDoIt ( const G4Track & track,
const G4Step & step )
overridevirtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 772 of file G4VEnergyLossProcess.cc.

774{
776 // The process has range table - calculate energy loss
777 if(!isIonisation || !currentModel->IsActive(preStepScaledEnergy)) {
778 return &fParticleChange;
779 }
780
781 G4double length = step.GetStepLength();
782 G4double eloss = 0.0;
783
784 /*
785 if(-1 < verboseLevel) {
786 const G4ParticleDefinition* d = track.GetParticleDefinition();
787 G4cout << "AlongStepDoIt for "
788 << GetProcessName() << " and particle " << d->GetParticleName()
789 << " eScaled(MeV)=" << preStepScaledEnergy/MeV
790 << " range(mm)=" << fRange/mm << " s(mm)=" << length/mm
791 << " rf=" << reduceFactor << " q^2=" << chargeSqRatio
792 << " md=" << d->GetPDGMass() << " status=" << track.GetTrackStatus()
793 << " " << track.GetMaterial()->GetName() << G4endl;
794 }
795 */
796 const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
797
798 // define new weight for primary and secondaries
800 if(weightFlag) {
801 weight /= biasFactor;
803 }
804
805 // stopping, check actual range and kinetic energy
806 if (length >= fRange || preStepKinEnergy <= lowestKinEnergy) {
807 eloss = preStepKinEnergy;
808 if (useDeexcitation) {
809 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
810 eloss, (G4int)currentCoupleIndex);
811 if(scTracks.size() > 0) { FillSecondariesAlongStep(weight); }
812 eloss = std::max(eloss, 0.0);
813 }
816 return &fParticleChange;
817 }
818 // zero step length with non-zero range
819 if(length <= 0.0) { return &fParticleChange; }
820
821 // Short step
822 eloss = length*GetDEDXForScaledEnergy(preStepScaledEnergy,
823 LogScaledEkin(track));
824 /*
825 G4cout << "##### Short STEP: eloss= " << eloss
826 << " Escaled=" << preStepScaledEnergy
827 << " R=" << fRange
828 << " L=" << length
829 << " fFactor=" << fFactor << " minE=" << minKinEnergy
830 << " idxBase=" << basedCoupleIndex << G4endl;
831 */
832 // Long step
833 if(eloss > preStepKinEnergy*linLossLimit) {
834
835 const G4double x = (fRange - length)/reduceFactor;
836 const G4double de = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
837 if(de > 0.0) { eloss = de; }
838 /*
839 if(-1 < verboseLevel)
840 G4cout << " Long STEP: rPre(mm)="
841 << GetScaledRangeForScaledEnergy(preStepScaledEnergy)/mm
842 << " x(mm)=" << x/mm
843 << " eloss(MeV)=" << eloss/MeV
844 << " rFactor=" << reduceFactor
845 << " massRatio=" << massRatio
846 << G4endl;
847 */
848 }
849
850 /*
851 if(-1 < verboseLevel ) {
852 G4cout << "Before fluct: eloss(MeV)= " << eloss/MeV
853 << " e-eloss= " << preStepKinEnergy-eloss
854 << " step(mm)= " << length/mm << " range(mm)= " << fRange/mm
855 << " fluct= " << lossFluctuationFlag << G4endl;
856 }
857 */
858
859 const G4double cut = (*theCuts)[currentCoupleIndex];
860 G4double esec = 0.0;
861
862 // Corrections, which cannot be tabulated
863 if(isIon) {
864 currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
865 length, eloss);
866 eloss = std::max(eloss, 0.0);
867 }
868
869 // Sample fluctuations if not full energy loss
870 if(eloss >= preStepKinEnergy) {
871 eloss = preStepKinEnergy;
872
873 } else if (lossFluctuationFlag) {
874 const G4double tmax = currentModel->MaxSecondaryKinEnergy(dynParticle);
875 const G4double tcut = std::min(cut, tmax);
876 G4VEmFluctuationModel* fluc = currentModel->GetModelOfFluctuations();
877 eloss = fluc->SampleFluctuations(currentCouple,dynParticle,
878 tcut, tmax, length, eloss);
879 /*
880 if(-1 < verboseLevel)
881 G4cout << "After fluct: eloss(MeV)= " << eloss/MeV
882 << " fluc= " << (eloss-eloss0)/MeV
883 << " ChargeSqRatio= " << chargeSqRatio
884 << " massRatio= " << massRatio << " tmax= " << tmax << G4endl;
885 */
886 }
887
888 // deexcitation
889 if (useDeexcitation) {
890 G4double esecfluo = preStepKinEnergy;
891 G4double de = esecfluo;
892 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
894
895 // sum of de-excitation energies
896 esecfluo -= de;
897
898 // subtracted from energy loss
899 if(eloss >= esecfluo) {
900 esec += esecfluo;
901 eloss -= esecfluo;
902 } else {
903 esec += esecfluo;
904 eloss = 0.0;
905 }
906 }
907 if(nullptr != subcutProducer && IsRegionForCubcutProcessor(track)) {
908 subcutProducer->SampleSecondaries(step, scTracks, eloss, cut);
909 }
910 // secondaries from atomic de-excitation and subcut
911 if(!scTracks.empty()) { FillSecondariesAlongStep(weight); }
912
913 // Energy balance
914 G4double finalT = preStepKinEnergy - eloss - esec;
915 if (finalT <= lowestKinEnergy) {
916 eloss += finalT;
917 finalT = 0.0;
918 } else if(isIon) {
920 currentModel->GetParticleCharge(track.GetParticleDefinition(),
921 currentMaterial,finalT));
922 }
923 eloss = std::max(eloss, 0.0);
924
927 /*
928 if(-1 < verboseLevel) {
929 G4double del = finalT + eloss + esec - preStepKinEnergy;
930 G4cout << "Final value eloss(MeV)= " << eloss/MeV
931 << " preStepKinEnergy= " << preStepKinEnergy
932 << " postStepKinEnergy= " << finalT
933 << " de(keV)= " << del/keV
934 << " lossFlag= " << lossFluctuationFlag
935 << " status= " << track.GetTrackStatus()
936 << G4endl;
937 }
938 */
939 return &fParticleChange;
940}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
void InitializeForAlongStep(const G4Track &)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedCharge(G4double theCharge)
G4double GetStepLength() const
const G4ParticleDefinition * GetParticleDefinition() const
const G4DynamicParticle * GetDynamicParticle() const
void AlongStepDeexcitation(std::vector< G4Track * > &tracks, const G4Step &step, G4double &eLoss, G4int coupleIndex)
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length, const G4double meanLoss)=0
G4VEmFluctuationModel * GetModelOfFluctuations()
virtual G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
G4bool IsActive(G4double kinEnergy) const
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
const G4MaterialCutsCouple * currentCouple
const G4Material * currentMaterial
G4double GetParentWeight() const
void ProposeWeight(G4double finalWeight)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
virtual void SampleSecondaries(const G4Step &step, std::vector< G4Track * > &tracks, G4double &eloss, G4double cut) const =0

◆ AlongStepGetPhysicalInteractionLength()

G4double G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength ( const G4Track & track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double & currentSafety,
G4GPILSelection * selection )
overridevirtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 570 of file G4VEnergyLossProcess.cc.

573{
574 G4double x = DBL_MAX;
575 *selection = aGPILSelection;
576 if(isIonisation && currentModel->IsActive(preStepScaledEnergy)) {
577 GetScaledRangeForScaledEnergy(preStepScaledEnergy, LogScaledEkin(track));
578 x = (useCutAsFinalRange) ? std::min(finalRange,
580 x = (fRange > x) ? fRange*dRoverRange + x*(1.0 - dRoverRange)*(2.0 - x/fRange)
581 : fRange;
582 /*
583 G4cout<<"AlongStepGPIL: " << GetProcessName()<<": e="<<preStepKinEnergy
584 << " fRange=" << fRange << " finR=" << finR <<" stepLimit="<<x<<G4endl;
585 */
586 }
587 return x;
588}
G4ProductionCuts * GetProductionCuts() const
G4double GetProductionCut(G4int index) const
#define DBL_MAX
Definition templates.hh:62

Referenced by ContinuousStepLimit().

◆ BaseParticle()

const G4ParticleDefinition * G4VEnergyLossProcess::BaseParticle ( ) const
inline

◆ BuildDEDXTable()

G4PhysicsTable * G4VEnergyLossProcess::BuildDEDXTable ( G4EmTableType tType = fRestricted)

Definition at line 414 of file G4VEnergyLossProcess.cc.

415{
416 G4PhysicsTable* table = nullptr;
417 G4double emax = maxKinEnergy;
418 G4int bin = nBins;
419
420 if(fTotal == tType) {
421 emax = maxKinEnergyCSDA;
422 bin = nBinsCSDA;
423 table = theDEDXunRestrictedTable;
424 } else if(fRestricted == tType) {
425 table = theDEDXTable;
426 } else {
427 G4cout << "G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
428 << tType << G4endl;
429 }
430 if(1 < verboseLevel) {
431 G4cout << "G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
432 << " for " << GetProcessName()
433 << " and " << particle->GetParticleName()
434 << "spline=" << spline << G4endl;
435 }
436 if(nullptr == table) { return table; }
437
438 G4LossTableBuilder* bld = lManager->GetTableBuilder();
439 G4EmTableUtil::BuildDEDXTable(this, particle, modelManager, bld,
440 table, minKinEnergy, emax, bin,
441 verboseLevel, tType, spline);
442 return table;
443}
@ fTotal
@ fRestricted
static void BuildDEDXTable(G4VEnergyLossProcess *proc, const G4ParticleDefinition *part, G4EmModelManager *modelManager, G4LossTableBuilder *bld, G4PhysicsTable *table, const G4double minKinEnergy, const G4double maxKinEnergy, const G4int nbins, const G4int verbose, const G4EmTableType tType, const G4bool splineFlag)
const G4String & GetParticleName() const

◆ BuildLambdaTable()

G4PhysicsTable * G4VEnergyLossProcess::BuildLambdaTable ( G4EmTableType tType = fRestricted)

Definition at line 447 of file G4VEnergyLossProcess.cc.

448{
449 if(nullptr == theLambdaTable) { return theLambdaTable; }
450
451 G4double scale = theParameters->MaxKinEnergy()/theParameters->MinKinEnergy();
452 G4int nbin =
453 theParameters->NumberOfBinsPerDecade()*G4lrint(std::log10(scale));
454 scale = nbin/G4Log(scale);
455
456 G4LossTableBuilder* bld = lManager->GetTableBuilder();
457 G4EmTableUtil::BuildLambdaTable(this, particle, modelManager,
458 bld, theLambdaTable, theCuts,
459 minKinEnergy, maxKinEnergy, scale,
460 verboseLevel, spline);
461 return theLambdaTable;
462}
G4double G4Log(G4double x)
Definition G4Log.hh:227
G4double MinKinEnergy() const
G4int NumberOfBinsPerDecade() const
G4double MaxKinEnergy() const
static void BuildLambdaTable(G4VEmProcess *proc, const G4ParticleDefinition *part, G4EmModelManager *modelManager, G4LossTableBuilder *bld, G4PhysicsTable *theLambdaTable, G4PhysicsTable *theLambdaTablePrim, const G4double minKinEnergy, const G4double minKinEnergyPrim, const G4double maxKinEnergy, const G4double scale, const G4int verbose, const G4bool startFromNull, const G4bool splineFlag)
int G4lrint(double ad)
Definition templates.hh:134

◆ BuildPhysicsTable()

void G4VEnergyLossProcess::BuildPhysicsTable ( const G4ParticleDefinition & part)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 345 of file G4VEnergyLossProcess.cc.

346{
347 if(1 < verboseLevel) {
348 G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() for "
349 << GetProcessName()
350 << " and particle " << part.GetParticleName()
351 << "; the first particle " << particle->GetParticleName();
352 if(baseParticle) {
353 G4cout << "; base: " << baseParticle->GetParticleName();
354 }
355 G4cout << G4endl;
356 G4cout << " TablesAreBuilt= " << tablesAreBuilt << " isIon= " << isIon
357 << " spline=" << spline << " ptr: " << this << G4endl;
358 }
359
360 if(&part == particle) {
361 if(isMaster) {
362 lManager->BuildPhysicsTable(particle, this);
363
364 } else {
365 const auto masterProcess =
366 static_cast<const G4VEnergyLossProcess*>(GetMasterProcess());
367
368 numberOfModels = modelManager->NumberOfModels();
369 G4EmTableUtil::BuildLocalElossProcess(this, masterProcess,
370 particle, numberOfModels);
371 tablesAreBuilt = true;
372 baseMat = masterProcess->UseBaseMaterial();
373 lManager->LocalPhysicsTables(particle, this);
374 }
375
376 // needs to be done only once
377 safetyHelper->InitialiseHelper();
378 }
379 // Added tracking cut to avoid tracking artifacts
380 // and identified deexcitation flag
381 if(isIonisation) {
382 atomDeexcitation = lManager->AtomDeexcitation();
383 if(nullptr != atomDeexcitation) {
384 if(atomDeexcitation->IsPIXEActive()) { useDeexcitation = true; }
385 }
386 }
387
388 // protection against double printout
389 if(theParameters->IsPrintLocked()) { return; }
390
391 // explicitly defined printout by particle name
392 G4String num = part.GetParticleName();
393 if(1 < verboseLevel ||
394 (0 < verboseLevel && (num == "e-" ||
395 num == "e+" || num == "mu+" ||
396 num == "mu-" || num == "proton"||
397 num == "pi+" || num == "pi-" ||
398 num == "kaon+" || num == "kaon-" ||
399 num == "alpha" || num == "anti_proton" ||
400 num == "GenericIon"|| num == "alpha+" ))) {
401 StreamInfo(G4cout, part);
402 }
403 if(1 < verboseLevel) {
404 G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() done for "
405 << GetProcessName()
406 << " and particle " << part.GetParticleName();
407 if(isIonisation) { G4cout << " isIonisation flag=1"; }
408 G4cout << " baseMat=" << baseMat << G4endl;
409 }
410}
G4int NumberOfModels() const
G4bool IsPrintLocked() const
static void BuildLocalElossProcess(G4VEnergyLossProcess *proc, const G4VEnergyLossProcess *masterProc, const G4ParticleDefinition *part, const G4int nModels)
void LocalPhysicsTables(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
G4VAtomDeexcitation * AtomDeexcitation()
const G4VProcess * GetMasterProcess() const

Referenced by G4PolarizedIonisation::BuildPhysicsTable().

◆ ContinuousStepLimit()

G4double G4VEnergyLossProcess::ContinuousStepLimit ( const G4Track & track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double & currentSafety )

Definition at line 1199 of file G4VEnergyLossProcess.cc.

1202{
1203 return AlongStepGetPhysicalInteractionLength(track, x, y, z, &aGPILSelection);
1204}
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection) override

◆ CrossSectionBiasingFactor()

G4double G4VEnergyLossProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 917 of file G4VEnergyLossProcess.hh.

918{
919 return biasFactor;
920}

◆ CrossSectionPerVolume() [1/2]

G4double G4VEnergyLossProcess::CrossSectionPerVolume ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple )

◆ CrossSectionPerVolume() [2/2]

G4double G4VEnergyLossProcess::CrossSectionPerVolume ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple,
G4double logKineticEnergy )

Definition at line 1166 of file G4VEnergyLossProcess.cc.

1169{
1170 // Cross section per volume is calculated
1171 DefineMaterial(couple);
1172 G4double cross = 0.0;
1173 if (nullptr != theLambdaTable) {
1174 cross = GetLambdaForScaledEnergy(kineticEnergy * massRatio,
1175 logKineticEnergy + logMassRatio);
1176 } else {
1177 SelectModel(kineticEnergy*massRatio);
1178 cross = (!baseMat) ? biasFactor : biasFactor*(*theDensityFactor)[currentCoupleIndex];
1179 cross *= (currentModel->CrossSectionPerVolume(currentMaterial, particle, kineticEnergy,
1180 (*theCuts)[currentCoupleIndex]));
1181 }
1182 return std::max(cross, 0.0);
1183}
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
void SelectModel(G4double kinEnergy)

◆ CrossSectionType()

G4CrossSectionType G4VEnergyLossProcess::CrossSectionType ( ) const
inline

Definition at line 882 of file G4VEnergyLossProcess.hh.

883{
884 return fXSType;
885}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ CSDARangeTable()

G4PhysicsTable * G4VEnergyLossProcess::CSDARangeTable ( ) const
inline

Definition at line 952 of file G4VEnergyLossProcess.hh.

953{
954 return theCSDARangeTable;
955}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ CurrentMaterialCutsCoupleIndex()

std::size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex ( ) const
inlineprotected

Definition at line 530 of file G4VEnergyLossProcess.hh.

531{
532 return currentCoupleIndex;
533}

◆ DEDXTable()

G4PhysicsTable * G4VEnergyLossProcess::DEDXTable ( ) const
inline

◆ DEDXunRestrictedTable()

G4PhysicsTable * G4VEnergyLossProcess::DEDXunRestrictedTable ( ) const
inline

Definition at line 938 of file G4VEnergyLossProcess.hh.

939{
940 return theDEDXunRestrictedTable;
941}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ EmModel()

◆ EnergyOfCrossSectionMax()

std::vector< G4double > * G4VEnergyLossProcess::EnergyOfCrossSectionMax ( ) const
inline

Definition at line 988 of file G4VEnergyLossProcess.hh.

989{
990 return theEnergyOfCrossSectionMax;
991}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ FluctModel()

◆ GetContinuousStepLimit()

G4double G4VEnergyLossProcess::GetContinuousStepLimit ( const G4Track & track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double & currentSafety )
overrideprotectedvirtual

Implements G4VContinuousDiscreteProcess.

Definition at line 1220 of file G4VEnergyLossProcess.cc.

1223{
1224 return DBL_MAX;
1225}

◆ GetCSDADEDX()

G4double G4VEnergyLossProcess::GetCSDADEDX ( G4double kineticEnergy,
const G4MaterialCutsCouple *  )
inline

◆ GetCSDARange()

G4double G4VEnergyLossProcess::GetCSDARange ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple )
inline

Definition at line 757 of file G4VEnergyLossProcess.hh.

759{
760 DefineMaterial(couple);
761 return (nullptr == theCSDARangeTable) ? DBL_MAX :
762 GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
763}

Referenced by G4LossTableManager::GetCSDARange().

◆ GetCurrentElement()

const G4Element * G4VEnergyLossProcess::GetCurrentElement ( ) const

Definition at line 1333 of file G4VEnergyLossProcess.cc.

1334{
1335 return (nullptr != currentModel)
1336 ? currentModel->GetCurrentElement(currentMaterial) : nullptr;
1337}
const G4Element * GetCurrentElement(const G4Material *mat=nullptr) const

◆ GetDEDX() [1/2]

G4double G4VEnergyLossProcess::GetDEDX ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple )
inline

Definition at line 715 of file G4VEnergyLossProcess.hh.

717{
718 DefineMaterial(couple);
719 return GetDEDXForScaledEnergy(kinEnergy*massRatio);
720}

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4TransportationWithMsc::AlongStepGetPhysicalInteractionLength(), G4LossTableManager::GetDEDX(), G4VMscModel::GetDEDX(), and G4VMscModel::GetDEDX().

◆ GetDEDX() [2/2]

G4double G4VEnergyLossProcess::GetDEDX ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple,
G4double logKineticEnergy )
inline

Definition at line 725 of file G4VEnergyLossProcess.hh.

728{
729 DefineMaterial(couple);
730 return GetDEDXForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
731}

◆ GetDEDXDispersion()

G4double G4VEnergyLossProcess::GetDEDXDispersion ( const G4MaterialCutsCouple * couple,
const G4DynamicParticle * dp,
G4double length )

Definition at line 1147 of file G4VEnergyLossProcess.cc.

1151{
1152 DefineMaterial(couple);
1153 G4double ekin = dp->GetKineticEnergy();
1154 SelectModel(ekin*massRatio);
1155 G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
1156 G4double tcut = std::min(tmax,(*theCuts)[currentCoupleIndex]);
1157 G4double d = 0.0;
1158 G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
1159 if(nullptr != fm) { d = fm->Dispersion(currentMaterial,dp,tcut,tmax,length); }
1160 return d;
1161}
G4double GetKineticEnergy() const
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, const G4double tcut, const G4double tmax, const G4double length)=0

Referenced by G4LossTableManager::GetDEDXDispersion().

◆ GetKineticEnergy()

G4double G4VEnergyLossProcess::GetKineticEnergy ( G4double range,
const G4MaterialCutsCouple * couple )
inline

Definition at line 768 of file G4VEnergyLossProcess.hh.

770{
771 DefineMaterial(couple);
772 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
773}

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4LossTableManager::GetEnergy(), and G4VMscModel::GetEnergy().

◆ GetLambda() [1/2]

G4double G4VEnergyLossProcess::GetLambda ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple )
inline

Definition at line 778 of file G4VEnergyLossProcess.hh.

780{
781 DefineMaterial(couple);
782 return (nullptr != theLambdaTable) ?
783 GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0;
784}

◆ GetLambda() [2/2]

G4double G4VEnergyLossProcess::GetLambda ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple,
G4double logKineticEnergy )
inline

Definition at line 789 of file G4VEnergyLossProcess.hh.

792{
793 DefineMaterial(couple);
794 return (nullptr != theLambdaTable) ?
795 GetLambdaForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio)
796 : 0.0;
797}

◆ GetMeanFreePath()

G4double G4VEnergyLossProcess::GetMeanFreePath ( const G4Track & track,
G4double previousStepSize,
G4ForceCondition * condition )
overrideprotectedvirtual

Implements G4VContinuousDiscreteProcess.

Definition at line 1208 of file G4VEnergyLossProcess.cc.

1213{
1215 return MeanFreePath(track);
1216}
G4double condition(const G4ErrorSymMatrix &m)
@ NotForced
G4double MeanFreePath(const G4Track &track)

Referenced by G4PolarizedIonisation::GetMeanFreePath().

◆ GetModelByIndex()

G4VEmModel * G4VEnergyLossProcess::GetModelByIndex ( std::size_t idx = 0,
G4bool ver = false ) const
inline

Definition at line 1017 of file G4VEnergyLossProcess.hh.

1018{
1019 return modelManager->GetModel((G4int)idx, ver);
1020}
G4VEmModel * GetModel(G4int idx, G4bool ver=false) const

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ GetRange() [1/2]

G4double G4VEnergyLossProcess::GetRange ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple )
inline

Definition at line 736 of file G4VEnergyLossProcess.hh.

738{
739 DefineMaterial(couple);
740 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio);
741}

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), G4ContinuousGainOfEnergy::GetContinuousStepLimit(), G4LossTableManager::GetRange(), G4VMscModel::GetRange(), G4VMscModel::GetRange(), and G4LossTableManager::GetRangeFromRestricteDEDX().

◆ GetRange() [2/2]

G4double G4VEnergyLossProcess::GetRange ( G4double kineticEnergy,
const G4MaterialCutsCouple * couple,
G4double logKineticEnergy )
inline

Definition at line 746 of file G4VEnergyLossProcess.hh.

749{
750 DefineMaterial(couple);
751 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
752}

◆ InitialiseEnergyLossProcess()

◆ InverseRangeTable()

G4PhysicsTable * G4VEnergyLossProcess::InverseRangeTable ( ) const
inline

Definition at line 966 of file G4VEnergyLossProcess.hh.

967{
968 return theInverseRangeTable;
969}

Referenced by G4EmTableUtil::BuildLocalElossProcess(), G4LossTableManager::LocalPhysicsTables(), and G4EmCalculator::PrintInverseRangeTable().

◆ IonisationTable()

G4PhysicsTable * G4VEnergyLossProcess::IonisationTable ( ) const
inline

Definition at line 945 of file G4VEnergyLossProcess.hh.

946{
947 return theIonisationTable;
948}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ IsIonisationProcess()

G4bool G4VEnergyLossProcess::IsIonisationProcess ( ) const
inline

◆ LambdaPhysicsVector()

G4PhysicsVector * G4VEnergyLossProcess::LambdaPhysicsVector ( const G4MaterialCutsCouple * couple,
G4double cut )
protected

Definition at line 1230 of file G4VEnergyLossProcess.cc.

1232{
1233 DefineMaterial(couple);
1234 G4PhysicsVector* v = (*theLambdaTable)[basedCoupleIndex];
1235 return new G4PhysicsVector(*v);
1236}

◆ LambdaTable()

G4PhysicsTable * G4VEnergyLossProcess::LambdaTable ( ) const
inline

Definition at line 973 of file G4VEnergyLossProcess.hh.

974{
975 return theLambdaTable;
976}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ MaxKinEnergy()

G4double G4VEnergyLossProcess::MaxKinEnergy ( ) const
inline

Definition at line 910 of file G4VEnergyLossProcess.hh.

911{
912 return maxKinEnergy;
913}

◆ MeanFreePath()

G4double G4VEnergyLossProcess::MeanFreePath ( const G4Track & track)

Definition at line 1187 of file G4VEnergyLossProcess.cc.

1188{
1189 DefineMaterial(track.GetMaterialCutsCouple());
1190 const G4double kinEnergy = track.GetKineticEnergy();
1191 const G4double logKinEnergy = track.GetDynamicParticle()->GetLogKineticEnergy();
1192 const G4double cs = GetLambdaForScaledEnergy(kinEnergy * massRatio,
1193 logKinEnergy + logMassRatio);
1194 return (0.0 < cs) ? 1.0/cs : DBL_MAX;
1195}
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const

Referenced by GetMeanFreePath().

◆ MinKinEnergy()

G4double G4VEnergyLossProcess::MinKinEnergy ( ) const
inline

Definition at line 903 of file G4VEnergyLossProcess.hh.

904{
905 return minKinEnergy;
906}

◆ MinPrimaryEnergy()

G4double G4VEnergyLossProcess::MinPrimaryEnergy ( const G4ParticleDefinition * ,
const G4Material * ,
G4double cut )
virtual

◆ NumberOfModels()

std::size_t G4VEnergyLossProcess::NumberOfModels ( ) const
inline

Definition at line 1002 of file G4VEnergyLossProcess.hh.

1003{
1004 return numberOfModels;
1005}

◆ NumberOfSubCutoffRegions()

G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions ( ) const
inline

Definition at line 896 of file G4VEnergyLossProcess.hh.

897{
898 return nSCoffRegions;
899}

◆ operator=()

G4VEnergyLossProcess & G4VEnergyLossProcess::operator= ( const G4VEnergyLossProcess & right)
delete

◆ Particle()

const G4ParticleDefinition * G4VEnergyLossProcess::Particle ( ) const
inline

Definition at line 838 of file G4VEnergyLossProcess.hh.

839{
840 return particle;
841}

Referenced by G4LossTableManager::BuildPhysicsTable(), and G4LossTableManager::LocalPhysicsTables().

◆ PostStepDoIt()

G4VParticleChange * G4VEnergyLossProcess::PostStepDoIt ( const G4Track & track,
const G4Step & step )
overridevirtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 973 of file G4VEnergyLossProcess.cc.

975{
976 // clear number of interaction lengths in any case
979
981 const G4double finalT = track.GetKineticEnergy();
982
983 const G4double postStepScaledEnergy = finalT*massRatio;
984 SelectModel(postStepScaledEnergy);
985
986 if(!currentModel->IsActive(postStepScaledEnergy)) {
987 return &fParticleChange;
988 }
989 /*
990 if(1 < verboseLevel) {
991 G4cout<<GetProcessName()<<" PostStepDoIt: E(MeV)= "<< finalT/MeV<< G4endl;
992 }
993 */
994 // forced process - should happen only once per track
995 if(biasFlag) {
997 biasFlag = false;
998 }
999 }
1000 const G4DynamicParticle* dp = track.GetDynamicParticle();
1001
1002 // Integral approach
1003 if (fXSType != fEmNoIntegral) {
1004 const G4double logFinalT = dp->GetLogKineticEnergy();
1005 G4double lx = GetLambdaForScaledEnergy(postStepScaledEnergy,
1006 logFinalT + logMassRatio);
1007 lx = std::max(lx, 0.0);
1008
1009 // if both lg and lx are zero then no interaction
1010 if(preStepLambda*G4UniformRand() >= lx) {
1011 return &fParticleChange;
1012 }
1013 }
1014
1015 // define new weight for primary and secondaries
1017 if(weightFlag) {
1018 weight /= biasFactor;
1020 }
1021
1022 const G4double tcut = (*theCuts)[currentCoupleIndex];
1023
1024 // sample secondaries
1025 secParticles.clear();
1026 currentModel->SampleSecondaries(&secParticles, currentCouple, dp, tcut);
1027
1028 const G4int num0 = (G4int)secParticles.size();
1029
1030 // bremsstrahlung splitting or Russian roulette
1031 if(biasManager) {
1033 G4double eloss = 0.0;
1034 weight *= biasManager->ApplySecondaryBiasing(
1035 secParticles,
1036 track, currentModel,
1037 &fParticleChange, eloss,
1038 (G4int)currentCoupleIndex, tcut,
1039 step.GetPostStepPoint()->GetSafety());
1040 if(eloss > 0.0) {
1043 }
1044 }
1045 }
1046
1047 // save secondaries
1048 const G4int num = (G4int)secParticles.size();
1049 if(num > 0) {
1050
1052 G4double time = track.GetGlobalTime();
1053
1054 G4int n1(0), n2(0);
1055 if(num0 > mainSecondaries) {
1056 currentModel->FillNumberOfSecondaries(n1, n2);
1057 }
1058
1059 for (G4int i=0; i<num; ++i) {
1060 if(nullptr != secParticles[i]) {
1061 G4Track* t = new G4Track(secParticles[i], time, track.GetPosition());
1063 if (biasManager) {
1064 t->SetWeight(weight * biasManager->GetWeight(i));
1065 } else {
1066 t->SetWeight(weight);
1067 }
1068 if(i < num0) {
1069 t->SetCreatorModelID(secID);
1070 } else if(i < num0 + n1) {
1071 t->SetCreatorModelID(tripletID);
1072 } else {
1073 t->SetCreatorModelID(biasID);
1074 }
1075
1076 //G4cout << "Secondary(post step) has weight " << t->GetWeight()
1077 // << ", kenergy " << t->GetKineticEnergy()/MeV << " MeV"
1078 // << " time= " << time/ns << " ns " << G4endl;
1080 }
1081 }
1082 }
1083
1086 if(particle->GetProcessManager()->GetAtRestProcessVector()->size() > 0)
1089 }
1090
1091 /*
1092 if(-1 < verboseLevel) {
1093 G4cout << "::PostStepDoIt: Sample secondary; Efin= "
1094 << fParticleChange.GetProposedKineticEnergy()/MeV
1095 << " MeV; model= (" << currentModel->LowEnergyLimit()
1096 << ", " << currentModel->HighEnergyLimit() << ")"
1097 << " preStepLambda= " << preStepLambda
1098 << " dir= " << track.GetMomentumDirection()
1099 << " status= " << track.GetTrackStatus()
1100 << G4endl;
1101 }
1102 */
1103 return &fParticleChange;
1104}
@ fEmNoIntegral
@ fAlive
@ fStopAndKill
@ fStopButAlive
#define G4UniformRand()
Definition Randomize.hh:52
G4bool ForcedInteractionRegion(G4int coupleIdx)
G4double ApplySecondaryBiasing(std::vector< G4DynamicParticle * > &, const G4Track &track, G4VEmModel *currentModel, G4ParticleChangeForGamma *pParticleChange, G4double &eloss, G4int coupleIdx, G4double tcut, G4double safety=0.0)
G4double GetWeight(G4int i)
G4bool SecondaryBiasingRegion(G4int coupleIdx)
void InitializeForPostStep(const G4Track &)
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
std::size_t size() const
G4double GetSafety() const
G4StepPoint * GetPostStepPoint() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
const G4TouchableHandle & GetTouchableHandle() const
void SetCreatorModelID(const G4int id)
virtual void FillNumberOfSecondaries(G4int &numberOfTriplets, G4int &numberOfRecoil)
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin=0.0, G4double tmax=DBL_MAX)=0
void ProposeTrackStatus(G4TrackStatus status)
G4double GetLocalEnergyDeposit() const
void AddSecondary(G4Track *aSecondary)
void SetNumberOfSecondaries(G4int totSecondaries)
G4TrackStatus GetTrackStatus() const
G4double theNumberOfInteractionLengthLeft

◆ PostStepGetPhysicalInteractionLength()

G4double G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ( const G4Track & track,
G4double previousStepSize,
G4ForceCondition * condition )
overridevirtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 592 of file G4VEnergyLossProcess.cc.

596{
597 // condition is set to "Not Forced"
599 G4double x = DBL_MAX;
600
601 // initialisation of material, mass, charge, model
602 // at the beginning of the step
603 DefineMaterial(track.GetMaterialCutsCouple());
607
608 if(!currentModel->IsActive(preStepScaledEnergy)) {
611 preStepLambda = 0.0;
613 return x;
614 }
615
616 // change effective charge of a charged particle on fly
617 if(isIon) {
618 const G4double q2 = currentModel->ChargeSquareRatio(track);
619 fFactor = q2*biasFactor;
620 if(baseMat) { fFactor *= (*theDensityFactor)[currentCoupleIndex]; }
621 reduceFactor = 1.0/(fFactor*massRatio);
622 if (lossFluctuationFlag) {
623 auto fluc = currentModel->GetModelOfFluctuations();
624 fluc->SetParticleAndCharge(track.GetDefinition(), q2);
625 }
626 }
627
628 // forced biasing only for primary particles
629 if(biasManager) {
630 if(0 == track.GetParentID() && biasFlag &&
632 return biasManager->GetStepLimit((G4int)currentCoupleIndex, previousStepSize);
633 }
634 }
635
636 ComputeLambdaForScaledEnergy(preStepScaledEnergy, track);
637
638 // zero cross section
639 if(preStepLambda <= 0.0) {
642 } else {
643
644 // non-zero cross section
646
647 // beggining of tracking (or just after DoIt of this process)
650
651 } else if(currentInteractionLength < DBL_MAX) {
652
653 // subtract NumberOfInteractionLengthLeft using previous step
655 previousStepSize/currentInteractionLength;
656
659 }
660
661 // new mean free path and step limit
664 }
665#ifdef G4VERBOSE
666 if (verboseLevel>2) {
667 G4cout << "G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ";
668 G4cout << "[ " << GetProcessName() << "]" << G4endl;
669 G4cout << " for " << track.GetDefinition()->GetParticleName()
670 << " in Material " << currentMaterial->GetName()
671 << " Ekin(MeV)= " << preStepKinEnergy/MeV
672 << " track material: " << track.GetMaterial()->GetName()
673 <<G4endl;
674 G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]"
675 << "InteractionLength= " << x/cm <<"[cm] " <<G4endl;
676 }
677#endif
678 return x;
679}
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
const G4String & GetName() const
G4Material * GetMaterial() const
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
virtual void SetParticleAndCharge(const G4ParticleDefinition *, G4double q2)
virtual G4double ChargeSquareRatio(const G4Track &)
G4double currentInteractionLength
G4double theInitialNumberOfInteractionLength

Referenced by G4PolarizedIonisation::PostStepGetPhysicalInteractionLength().

◆ PreparePhysicsTable()

void G4VEnergyLossProcess::PreparePhysicsTable ( const G4ParticleDefinition & part)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 204 of file G4VEnergyLossProcess.cc.

205{
206 particle = G4EmTableUtil::CheckIon(this, &part, particle,
207 verboseLevel, isIon);
208
209 if( particle != &part ) {
210 if(!isIon) { lManager->RegisterExtraParticle(&part, this); }
211 if(1 < verboseLevel) {
212 G4cout << "### G4VEnergyLossProcess::PreparePhysicsTable()"
213 << " interrupted for " << GetProcessName() << " and "
214 << part.GetParticleName() << " isIon=" << isIon
215 << " spline=" << spline << G4endl;
216 }
217 return;
218 }
219
220 tablesAreBuilt = false;
221
222 G4LossTableBuilder* bld = lManager->GetTableBuilder();
223 lManager->PreparePhysicsTable(&part, this);
224
225 // Base particle and set of models can be defined here
226 InitialiseEnergyLossProcess(particle, baseParticle);
227
228 // parameters of the process
229 if(!actLossFluc) { lossFluctuationFlag = theParameters->LossFluctuation(); }
230 useCutAsFinalRange = theParameters->UseCutAsFinalRange();
231 if(!actMinKinEnergy) { minKinEnergy = theParameters->MinKinEnergy(); }
232 if(!actMaxKinEnergy) { maxKinEnergy = theParameters->MaxKinEnergy(); }
233 if(!actBinning) { nBins = theParameters->NumberOfBins(); }
234 maxKinEnergyCSDA = theParameters->MaxEnergyForCSDARange();
235 nBinsCSDA = theParameters->NumberOfBinsPerDecade()
236 *G4lrint(std::log10(maxKinEnergyCSDA/minKinEnergy));
237 if(!actLinLossLimit) { linLossLimit = theParameters->LinearLossLimit(); }
238 lambdaFactor = theParameters->LambdaFactor();
239 invLambdaFactor = 1.0/lambdaFactor;
240 if(isMaster) { SetVerboseLevel(theParameters->Verbose()); }
241 else { SetVerboseLevel(theParameters->WorkerVerbose()); }
242 // integral option may be disabled
243 if(!theParameters->Integral()) { fXSType = fEmNoIntegral; }
244
245 theParameters->DefineRegParamForLoss(this);
246
247 fRangeEnergy = 0.0;
248
249 G4double initialCharge = particle->GetPDGCharge();
250 G4double initialMass = particle->GetPDGMass();
251
252 theParameters->FillStepFunction(particle, this);
253
254 // parameters for scaling from the base particle
255 if (nullptr != baseParticle) {
256 massRatio = (baseParticle->GetPDGMass())/initialMass;
257 logMassRatio = G4Log(massRatio);
258 G4double q = initialCharge/baseParticle->GetPDGCharge();
259 chargeSqRatio = q*q;
260 if(chargeSqRatio > 0.0) { reduceFactor = 1.0/(chargeSqRatio*massRatio); }
261 }
262 lowestKinEnergy = (initialMass < CLHEP::MeV)
263 ? theParameters->LowestElectronEnergy()
264 : theParameters->LowestMuHadEnergy();
265
266 // Tables preparation
267 if (isMaster && nullptr == baseParticle) {
268 if(nullptr == theData) { theData = new G4EmDataHandler(7); }
269
270 if(nullptr != theDEDXTable && isIonisation) {
271 if(nullptr != theIonisationTable && theDEDXTable != theIonisationTable) {
272 theData->CleanTable(0);
273 theDEDXTable = theIonisationTable;
274 theIonisationTable = nullptr;
275 }
276 }
277
278 theDEDXTable = theData->MakeTable(theDEDXTable, 0);
279 bld->InitialiseBaseMaterials(theDEDXTable);
280 theData->UpdateTable(theIonisationTable, 1);
281
282 if (theParameters->BuildCSDARange()) {
283 theDEDXunRestrictedTable = theData->MakeTable(2);
284 if(isIonisation) { theCSDARangeTable = theData->MakeTable(3); }
285 }
286
287 theLambdaTable = theData->MakeTable(4);
288 if(isIonisation) {
289 theRangeTableForLoss = theData->MakeTable(5);
290 theInverseRangeTable = theData->MakeTable(6);
291 }
292 }
293
294 // forced biasing
295 if(nullptr != biasManager) {
296 biasManager->Initialise(part,GetProcessName(),verboseLevel);
297 biasFlag = false;
298 }
299 baseMat = bld->GetBaseMaterialFlag();
300 numberOfModels = modelManager->NumberOfModels();
301 currentModel = modelManager->GetModel(0);
302 G4EmTableUtil::UpdateModels(this, modelManager, maxKinEnergy,
303 numberOfModels, secID, biasID,
304 mainSecondaries, baseMat, isMaster,
305 theParameters->UseAngularGeneratorForIonisation());
306 theCuts = modelManager->Initialise(particle, secondaryParticle,
308 // subcut processor
309 if(isIonisation) {
310 subcutProducer = lManager->SubCutProducer();
311 }
312 if(1 == nSCoffRegions) {
313 if((*scoffRegions)[0]->GetName() == "DefaultRegionForTheWorld") {
314 delete scoffRegions;
315 scoffRegions = nullptr;
316 nSCoffRegions = 0;
317 }
318 }
319
320 if(1 < verboseLevel) {
321 G4cout << "G4VEnergyLossProcess::PrepearPhysicsTable() is done "
322 << " for " << GetProcessName() << " and " << particle->GetParticleName()
323 << " isIon= " << isIon << " spline=" << spline;
324 if(baseParticle) {
325 G4cout << "; base: " << baseParticle->GetParticleName();
326 }
327 G4cout << G4endl;
328 G4cout << " chargeSqRatio= " << chargeSqRatio
329 << " massRatio= " << massRatio
330 << " reduceFactor= " << reduceFactor << G4endl;
331 if (nSCoffRegions > 0) {
332 G4cout << " SubCut secondary production is ON for regions: " << G4endl;
333 for (G4int i=0; i<nSCoffRegions; ++i) {
334 const G4Region* r = (*scoffRegions)[i];
335 G4cout << " " << r->GetName() << G4endl;
336 }
337 } else if(nullptr != subcutProducer) {
338 G4cout << " SubCut secondary production is ON for all regions" << G4endl;
339 }
340 }
341}
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
void CleanTable(size_t idx)
G4PhysicsTable * MakeTable(size_t idx)
void UpdateTable(G4PhysicsTable *, size_t idx)
const G4DataVector * Initialise(const G4ParticleDefinition *part, const G4ParticleDefinition *secPart, G4int verb)
void DefineRegParamForLoss(G4VEnergyLossProcess *) const
void FillStepFunction(const G4ParticleDefinition *, G4VEnergyLossProcess *) const
G4int NumberOfBins() const
G4bool BuildCSDARange() const
G4bool LossFluctuation() const
G4bool UseCutAsFinalRange() const
G4int Verbose() const
G4int WorkerVerbose() const
G4bool Integral() const
G4double MaxEnergyForCSDARange() const
G4bool UseAngularGeneratorForIonisation() const
G4double LinearLossLimit() const
G4double LowestMuHadEnergy() const
G4double LambdaFactor() const
static void UpdateModels(G4VEnergyLossProcess *proc, G4EmModelManager *modelManager, const G4double maxKinEnergy, const G4int nModels, G4int &secID, G4int &biasID, G4int &mainSecondaries, const G4bool baseMat, const G4bool isMaster, const G4bool useAGen)
static const G4ParticleDefinition * CheckIon(G4VEnergyLossProcess *proc, const G4ParticleDefinition *part, const G4ParticleDefinition *particle, const G4int verboseLevel, G4bool &isIon)
void InitialiseBaseMaterials(const G4PhysicsTable *table=nullptr)
G4VSubCutProducer * SubCutProducer()
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
const G4String & GetName() const
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0

◆ ProcessDescription()

◆ RangeTableForLoss()

G4PhysicsTable * G4VEnergyLossProcess::RangeTableForLoss ( ) const
inline

Definition at line 959 of file G4VEnergyLossProcess.hh.

960{
961 return theRangeTableForLoss;
962}

Referenced by G4EmTableUtil::BuildLocalElossProcess(), G4LossTableManager::LocalPhysicsTables(), and G4EmCalculator::PrintRangeTable().

◆ RetrievePhysicsTable()

G4bool G4VEnergyLossProcess::RetrievePhysicsTable ( const G4ParticleDefinition * part,
const G4String & directory,
G4bool ascii )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 1132 of file G4VEnergyLossProcess.cc.

1134{
1135 if (!isMaster || nullptr != baseParticle || part != particle ) return true;
1136 for(std::size_t i=0; i<7; ++i) {
1137 if(!G4EmTableUtil::RetrieveTable(this, part, theData->Table(i), dir, tnames[i],
1138 verboseLevel, ascii, spline)) {
1139 return false;
1140 }
1141 }
1142 return true;
1143}
G4PhysicsTable * Table(size_t idx) const
static G4bool RetrieveTable(G4VProcess *ptr, const G4ParticleDefinition *part, G4PhysicsTable *aTable, const G4String &dir, const G4String &tname, const G4int verb, const G4bool ascii, const G4bool spline)

◆ SecondaryParticle()

const G4ParticleDefinition * G4VEnergyLossProcess::SecondaryParticle ( ) const
inline

Definition at line 853 of file G4VEnergyLossProcess.hh.

854{
855 return secondaryParticle;
856}

◆ SelectModel()

void G4VEnergyLossProcess::SelectModel ( G4double kinEnergy)
inlineprotected

Definition at line 537 of file G4VEnergyLossProcess.hh.

538{
539 currentModel = modelManager->SelectModel(kinEnergy, currentCoupleIndex);
540 currentModel->SetCurrentCouple(currentCouple);
541}
G4VEmModel * SelectModel(G4double energy, std::size_t index)
void SetCurrentCouple(const G4MaterialCutsCouple *)

Referenced by CrossSectionPerVolume(), GetDEDXDispersion(), PostStepDoIt(), and PostStepGetPhysicalInteractionLength().

◆ SelectModelForMaterial()

G4VEmModel * G4VEnergyLossProcess::SelectModelForMaterial ( G4double kinEnergy,
std::size_t & idxCouple ) const
inline

Definition at line 545 of file G4VEnergyLossProcess.hh.

547{
548 return modelManager->SelectModel(kinEnergy, idx);
549}

Referenced by G4ContinuousGainOfEnergy::GetContinuousStepLimit().

◆ SetBaseParticle()

void G4VEnergyLossProcess::SetBaseParticle ( const G4ParticleDefinition * p)
inline

Definition at line 831 of file G4VEnergyLossProcess.hh.

832{
833 baseParticle = p;
834}

Referenced by G4hIonisation::InitialiseEnergyLossProcess(), and G4ionIonisation::InitialiseEnergyLossProcess().

◆ SetCrossSectionBiasingFactor()

void G4VEnergyLossProcess::SetCrossSectionBiasingFactor ( G4double f,
G4bool flag = true )

Definition at line 1341 of file G4VEnergyLossProcess.cc.

1343{
1344 if(f > 0.0) {
1345 biasFactor = f;
1346 weightFlag = flag;
1347 if(1 < verboseLevel) {
1348 G4cout << "### SetCrossSectionBiasingFactor: for "
1349 << " process " << GetProcessName()
1350 << " biasFactor= " << f << " weightFlag= " << flag
1351 << G4endl;
1352 }
1353 }
1354}

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ SetCrossSectionType()

void G4VEnergyLossProcess::SetCrossSectionType ( G4CrossSectionType val)
inline

Definition at line 875 of file G4VEnergyLossProcess.hh.

876{
877 fXSType = val;
878}

Referenced by G4EmTableUtil::BuildLocalElossProcess(), and G4eBremsstrahlung::G4eBremsstrahlung().

◆ SetCSDARangeTable()

void G4VEnergyLossProcess::SetCSDARangeTable ( G4PhysicsTable * pRange)

Definition at line 1267 of file G4VEnergyLossProcess.cc.

1268{
1269 theCSDARangeTable = p;
1270}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetDEDXBinning()

void G4VEnergyLossProcess::SetDEDXBinning ( G4int nbins)

Definition at line 1441 of file G4VEnergyLossProcess.cc.

1442{
1443 if(2 < n && n < 1000000000) {
1444 nBins = n;
1445 actBinning = true;
1446 } else {
1447 G4double e = (G4double)n;
1448 PrintWarning("SetDEDXBinning", e);
1449 }
1450}

Referenced by G4hhIonisation::InitialiseEnergyLossProcess(), and G4mplIonisation::InitialiseEnergyLossProcess().

◆ SetDEDXTable()

void G4VEnergyLossProcess::SetDEDXTable ( G4PhysicsTable * p,
G4EmTableType tType )

Definition at line 1241 of file G4VEnergyLossProcess.cc.

1242{
1243 if(1 < verboseLevel) {
1244 G4cout << "### Set DEDX table " << p << " " << theDEDXTable
1245 << " " << theDEDXunRestrictedTable << " " << theIonisationTable
1246 << " for " << particle->GetParticleName()
1247 << " and process " << GetProcessName()
1248 << " type=" << tType << " isIonisation:" << isIonisation << G4endl;
1249 }
1250 if(fTotal == tType) {
1251 theDEDXunRestrictedTable = p;
1252 } else if(fRestricted == tType) {
1253 theDEDXTable = p;
1254 if(isMaster && nullptr == baseParticle) {
1255 theData->UpdateTable(theDEDXTable, 0);
1256 }
1257 } else if(fIsIonisation == tType) {
1258 theIonisationTable = p;
1259 if(isMaster && nullptr == baseParticle) {
1260 theData->UpdateTable(theIonisationTable, 1);
1261 }
1262 }
1263}
@ fIsIonisation

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetDynamicMassCharge()

void G4VEnergyLossProcess::SetDynamicMassCharge ( G4double massratio,
G4double charge2ratio )

Definition at line 190 of file G4VEnergyLossProcess.cc.

192{
193 massRatio = massratio;
194 logMassRatio = G4Log(massRatio);
195 fFactor = charge2ratio*biasFactor;
196 if(baseMat) { fFactor *= (*theDensityFactor)[currentCoupleIndex]; }
197 chargeSqRatio = charge2ratio;
198 reduceFactor = 1.0/(fFactor*massRatio);
199}

Referenced by G4ContinuousGainOfEnergy::AlongStepDoIt(), and G4ContinuousGainOfEnergy::GetContinuousStepLimit().

◆ SetEmModel()

◆ SetEnergyOfCrossSectionMax()

void G4VEnergyLossProcess::SetEnergyOfCrossSectionMax ( std::vector< G4double > * p)

Definition at line 1319 of file G4VEnergyLossProcess.cc.

1320{
1321 theEnergyOfCrossSectionMax = p;
1322}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetFluctModel()

◆ SetInverseRangeTable()

void G4VEnergyLossProcess::SetInverseRangeTable ( G4PhysicsTable * p)

Definition at line 1281 of file G4VEnergyLossProcess.cc.

1282{
1283 theInverseRangeTable = p;
1284}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetIonisation()

void G4VEnergyLossProcess::SetIonisation ( G4bool val)

◆ SetLambdaTable()

void G4VEnergyLossProcess::SetLambdaTable ( G4PhysicsTable * p)

Definition at line 1288 of file G4VEnergyLossProcess.cc.

1289{
1290 if(1 < verboseLevel) {
1291 G4cout << "### Set Lambda table " << p << " " << theLambdaTable
1292 << " for " << particle->GetParticleName()
1293 << " and process " << GetProcessName() << G4endl;
1294 }
1295 theLambdaTable = p;
1296 tablesAreBuilt = true;
1297
1298 if(isMaster && nullptr != p) {
1299 delete theEnergyOfCrossSectionMax;
1300 theEnergyOfCrossSectionMax = nullptr;
1301 if(fEmTwoPeaks == fXSType) {
1302 if(nullptr != fXSpeaks) {
1303 for(auto & ptr : *fXSpeaks) { delete ptr; }
1304 delete fXSpeaks;
1305 }
1306 G4LossTableBuilder* bld = lManager->GetTableBuilder();
1307 fXSpeaks = G4EmUtility::FillPeaksStructure(p, bld);
1308 if(nullptr == fXSpeaks) { fXSType = fEmOnePeak; }
1309 }
1310 if(fXSType == fEmOnePeak) {
1311 theEnergyOfCrossSectionMax = G4EmUtility::FindCrossSectionMax(p);
1312 if(nullptr == theEnergyOfCrossSectionMax) { fXSType = fEmIncreasing; }
1313 }
1314 }
1315}
@ fEmOnePeak
@ fEmTwoPeaks
@ fEmIncreasing
static std::vector< G4TwoPeaksXS * > * FillPeaksStructure(G4PhysicsTable *, G4LossTableBuilder *)
static std::vector< G4double > * FindCrossSectionMax(G4PhysicsTable *)

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetLinearLossLimit()

void G4VEnergyLossProcess::SetLinearLossLimit ( G4double val)

Definition at line 1410 of file G4VEnergyLossProcess.cc.

1411{
1412 if(0.0 < val && val < 1.0) {
1413 linLossLimit = val;
1414 actLinLossLimit = true;
1415 } else { PrintWarning("SetLinearLossLimit", val); }
1416}

Referenced by G4ionIonisation::G4ionIonisation().

◆ SetLossFluctuations()

void G4VEnergyLossProcess::SetLossFluctuations ( G4bool val)
inline

Definition at line 860 of file G4VEnergyLossProcess.hh.

861{
862 lossFluctuationFlag = val;
863 actLossFluc = true;
864}

◆ SetLowestEnergyLimit()

void G4VEnergyLossProcess::SetLowestEnergyLimit ( G4double val)

Definition at line 1433 of file G4VEnergyLossProcess.cc.

1434{
1435 if(1.e-18 < val && val < 1.e+50) { lowestKinEnergy = val; }
1436 else { PrintWarning("SetLowestEnergyLimit", val); }
1437}

◆ SetMaxKinEnergy()

void G4VEnergyLossProcess::SetMaxKinEnergy ( G4double e)

Definition at line 1464 of file G4VEnergyLossProcess.cc.

1465{
1466 if(minKinEnergy < e && e < 1.e+50) {
1467 maxKinEnergy = e;
1468 actMaxKinEnergy = true;
1469 if(e < maxKinEnergyCSDA) { maxKinEnergyCSDA = e; }
1470 } else { PrintWarning("SetMaxKinEnergy", e); }
1471}

Referenced by G4hhIonisation::InitialiseEnergyLossProcess(), and G4mplIonisation::InitialiseEnergyLossProcess().

◆ SetMinKinEnergy()

void G4VEnergyLossProcess::SetMinKinEnergy ( G4double e)

Definition at line 1454 of file G4VEnergyLossProcess.cc.

1455{
1456 if(1.e-18 < e && e < maxKinEnergy) {
1457 minKinEnergy = e;
1458 actMinKinEnergy = true;
1459 } else { PrintWarning("SetMinKinEnergy", e); }
1460}

Referenced by G4hhIonisation::InitialiseEnergyLossProcess(), and G4mplIonisation::InitialiseEnergyLossProcess().

◆ SetParticle()

void G4VEnergyLossProcess::SetParticle ( const G4ParticleDefinition * p)
inlineprotected

Definition at line 815 of file G4VEnergyLossProcess.hh.

816{
817 particle = p;
818}

◆ SetRangeTableForLoss()

void G4VEnergyLossProcess::SetRangeTableForLoss ( G4PhysicsTable * p)

Definition at line 1274 of file G4VEnergyLossProcess.cc.

1275{
1276 theRangeTableForLoss = p;
1277}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetSecondaryParticle()

◆ SetSpline()

void G4VEnergyLossProcess::SetSpline ( G4bool val)
inline

Definition at line 868 of file G4VEnergyLossProcess.hh.

869{
870 spline = val;
871}

Referenced by G4ePairProduction::G4ePairProduction().

◆ SetStepFunction()

void G4VEnergyLossProcess::SetStepFunction ( G4double v1,
G4double v2 )

Definition at line 1420 of file G4VEnergyLossProcess.cc.

1421{
1422 if(0.0 < v1 && 0.0 < v2) {
1423 dRoverRange = std::min(1.0, v1);
1424 finalRange = std::min(v2, 1.e+50);
1425 } else {
1426 PrintWarning("SetStepFunctionV1", v1);
1427 PrintWarning("SetStepFunctionV2", v2);
1428 }
1429}

Referenced by LBE::ConstructEM(), and G4EmExtraParameters::FillStepFunction().

◆ SetTwoPeaksXS()

void G4VEnergyLossProcess::SetTwoPeaksXS ( std::vector< G4TwoPeaksXS * > * ptr)

Definition at line 1326 of file G4VEnergyLossProcess.cc.

1327{
1328 fXSpeaks = ptr;
1329}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ StartTracking()

void G4VEnergyLossProcess::StartTracking ( G4Track * track)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 544 of file G4VEnergyLossProcess.cc.

545{
546 // reset parameters for the new track
549 preStepLambda = 0.0;
550 currentCouple = nullptr;
551
552 // reset ion
553 if(isIon) {
554 const G4double newmass = track->GetDefinition()->GetPDGMass();
555 massRatio = (nullptr == baseParticle) ? CLHEP::proton_mass_c2/newmass
556 : baseParticle->GetPDGMass()/newmass;
557 logMassRatio = G4Log(massRatio);
558 }
559 // forced biasing only for primary particles
560 if(nullptr != biasManager) {
561 if(0 == track->GetParentID()) {
562 biasFlag = true;
563 biasManager->ResetForcedInteraction();
564 }
565 }
566}

◆ StorePhysicsTable()

G4bool G4VEnergyLossProcess::StorePhysicsTable ( const G4ParticleDefinition * part,
const G4String & directory,
G4bool ascii = false )
overridevirtual

Reimplemented from G4VProcess.

Definition at line 1108 of file G4VEnergyLossProcess.cc.

1110{
1111 if (!isMaster || nullptr != baseParticle || part != particle ) return true;
1112 for(std::size_t i=0; i<7; ++i) {
1113 if(nullptr != theData->Table(i)) {
1114 if(1 < verboseLevel) {
1115 G4cout << "G4VEnergyLossProcess::StorePhysicsTable i=" << i
1116 << " " << particle->GetParticleName()
1117 << " " << GetProcessName()
1118 << " " << tnames[i] << " " << theData->Table(i) << G4endl;
1119 }
1120 if(!G4EmTableUtil::StoreTable(this, part, theData->Table(i),
1121 dir, tnames[i], verboseLevel, ascii)) {
1122 return false;
1123 }
1124 }
1125 }
1126 return true;
1127}
static G4bool StoreTable(G4VProcess *, const G4ParticleDefinition *, G4PhysicsTable *, const G4String &dir, const G4String &tname, G4int verb, G4bool ascii)

◆ StreamProcessInfo()

virtual void G4VEnergyLossProcess::StreamProcessInfo ( std::ostream & ) const
inlineprotectedvirtual

Reimplemented in G4eBremsstrahlung, G4ePairProduction, and G4MuPairProduction.

Definition at line 98 of file G4VEnergyLossProcess.hh.

98{};

◆ TablesAreBuilt()

G4bool G4VEnergyLossProcess::TablesAreBuilt ( ) const
inline

Definition at line 924 of file G4VEnergyLossProcess.hh.

925{
926 return tablesAreBuilt;
927}

◆ TwoPeaksXS()

std::vector< G4TwoPeaksXS * > * G4VEnergyLossProcess::TwoPeaksXS ( ) const
inline

Definition at line 995 of file G4VEnergyLossProcess.hh.

996{
997 return fXSpeaks;
998}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ UseBaseMaterial()

G4bool G4VEnergyLossProcess::UseBaseMaterial ( ) const
inline

Definition at line 980 of file G4VEnergyLossProcess.hh.

981{
982 return baseMat;
983}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

Member Data Documentation

◆ currentCouple

const G4MaterialCutsCouple* G4VEnergyLossProcess::currentCouple = nullptr
protected

◆ currentCoupleIndex

◆ currentMaterial

const G4Material* G4VEnergyLossProcess::currentMaterial = nullptr
protected

◆ fParticleChange

G4ParticleChangeForLoss G4VEnergyLossProcess::fParticleChange
protected

Definition at line 415 of file G4VEnergyLossProcess.hh.

Referenced by AlongStepDoIt(), G4VEnergyLossProcess(), and PostStepDoIt().

◆ mfpKinEnergy

G4double G4VEnergyLossProcess::mfpKinEnergy = 0.0
protected

◆ preStepKinEnergy

G4double G4VEnergyLossProcess::preStepKinEnergy = 0.0
protected

Definition at line 476 of file G4VEnergyLossProcess.hh.

Referenced by AlongStepDoIt(), and PostStepGetPhysicalInteractionLength().

◆ preStepLambda

G4double G4VEnergyLossProcess::preStepLambda = 0.0
protected

◆ preStepScaledEnergy

G4double G4VEnergyLossProcess::preStepScaledEnergy = 0.0
protected

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