Geant4 11.1.1
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 PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
virtual G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
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
 
virtual G4VParticleChangePostStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAlongStepDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4VParticleChangeAtRestDoIt (const G4Track &track, const G4Step &stepData)=0
 
virtual G4double AlongStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)=0
 
virtual G4double AtRestGetPhysicalInteractionLength (const G4Track &track, G4ForceCondition *condition)=0
 
virtual G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
 
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 &)
 
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
 
virtual void PreparePhysicsTable (const G4ParticleDefinition &)
 
virtual G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
virtual G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &, G4bool)
 
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 StartTracking (G4Track *)
 
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
 
virtual void ProcessDescription (std::ostream &outfile) 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
virtual G4double GetMeanFreePath (const G4Track &aTrack, G4double previousStepSize, G4ForceCondition *condition)=0
 
virtual G4double GetContinuousStepLimit (const G4Track &aTrack, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)=0
 
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 preStepLogKinEnergy = LOG_EKIN_MIN
 
G4double preStepScaledEnergy = 0.0
 
G4double preStepLogScaledEnergy = LOG_EKIN_MIN
 
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)
Definition: G4VProcess.hh:416
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:325

◆ ~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 1357 of file G4VEnergyLossProcess.cc.

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

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ ActivateSecondaryBiasing()

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

Definition at line 1377 of file G4VEnergyLossProcess.cc.

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

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ ActivateSubCutoff()

void G4VEnergyLossProcess::ActivateSubCutoff ( const G4Region region)

Definition at line 511 of file G4VEnergyLossProcess.cc.

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

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)
Definition: G4VEmModel.cc:390

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

◆ AlongStepDoIt()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 776 of file G4VEnergyLossProcess.cc.

778{
780 // The process has range table - calculate energy loss
781 if(!isIonisation || !currentModel->IsActive(preStepScaledEnergy)) {
782 return &fParticleChange;
783 }
784
785 // Get the actual (true) Step length
786 G4double length = step.GetStepLength();
787 if(length <= 0.0) { return &fParticleChange; }
788 G4double eloss = 0.0;
789
790 /*
791 if(-1 < verboseLevel) {
792 const G4ParticleDefinition* d = track.GetParticleDefinition();
793 G4cout << "AlongStepDoIt for "
794 << GetProcessName() << " and particle " << d->GetParticleName()
795 << " eScaled(MeV)=" << preStepScaledEnergy/MeV
796 << " range(mm)=" << fRange/mm << " s(mm)=" << length/mm
797 << " rf=" << reduceFactor << " q^2=" << chargeSqRatio
798 << " md=" << d->GetPDGMass() << " status=" << track.GetTrackStatus()
799 << " " << track.GetMaterial()->GetName() << G4endl;
800 }
801 */
802 const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
803
804 // define new weight for primary and secondaries
806 if(weightFlag) {
807 weight /= biasFactor;
809 }
810
811 // stopping
812 if (length >= fRange || preStepKinEnergy <= lowestKinEnergy) {
813 eloss = preStepKinEnergy;
814 if (useDeexcitation) {
815 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
816 eloss, (G4int)currentCoupleIndex);
817 if(scTracks.size() > 0) { FillSecondariesAlongStep(weight); }
818 eloss = std::max(eloss, 0.0);
819 }
822 return &fParticleChange;
823 }
824 // Short step
825 eloss = length*GetDEDXForScaledEnergy(preStepScaledEnergy,
827 //G4cout << "Short STEP: eloss= " << eloss << G4endl;
828
829 // Long step
830 if(eloss > preStepKinEnergy*linLossLimit) {
831
832 G4double x = (fRange - length)/reduceFactor;
833 //G4cout << "x= " << x << " " << theInverseRangeTable << G4endl;
834 eloss = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
835
836 /*
837 if(-1 < verboseLevel)
838 G4cout << "Long STEP: rPre(mm)= "
839 << GetScaledRangeForScaledEnergy(preStepScaledEnergy)/mm
840 << " rPost(mm)= " << x/mm
841 << " ePre(MeV)= " << preStepScaledEnergy/MeV
842 << " eloss(MeV)= " << eloss/MeV << " eloss0(MeV)= "
843 << GetDEDXForScaledEnergy(preStepScaledEnergy)*length/MeV
844 << " lim(MeV)= " << preStepKinEnergy*linLossLimit/MeV
845 << G4endl;
846 */
847 }
848
849 /*
850 if(-1 < verboseLevel ) {
851 G4cout << "Before fluct: eloss(MeV)= " << eloss/MeV
852 << " e-eloss= " << preStepKinEnergy-eloss
853 << " step(mm)= " << length/mm << " range(mm)= " << fRange/mm
854 << " fluct= " << lossFluctuationFlag << G4endl;
855 }
856 */
857
858 const G4double cut = (*theCuts)[currentCoupleIndex];
859 G4double esec = 0.0;
860
861 // Corrections, which cannot be tabulated
862 if(isIon) {
863 currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
864 length, eloss);
865 eloss = std::max(eloss, 0.0);
866 }
867
868 // Sample fluctuations if not full energy loss
869 if(eloss >= preStepKinEnergy) {
870 eloss = preStepKinEnergy;
871
872 } else if (lossFluctuationFlag) {
873 const G4double tmax = currentModel->MaxSecondaryKinEnergy(dynParticle);
874 const G4double tcut = std::min(cut, tmax);
875 G4VEmFluctuationModel* fluc = currentModel->GetModelOfFluctuations();
876 eloss = fluc->SampleFluctuations(currentCouple,dynParticle,
877 tcut, tmax, length, eloss);
878 /*
879 if(-1 < verboseLevel)
880 G4cout << "After fluct: eloss(MeV)= " << eloss/MeV
881 << " fluc= " << (eloss-eloss0)/MeV
882 << " ChargeSqRatio= " << chargeSqRatio
883 << " massRatio= " << massRatio << " tmax= " << tmax << G4endl;
884 */
885 }
886
887 // deexcitation
888 if (useDeexcitation) {
889 G4double esecfluo = preStepKinEnergy;
890 G4double de = esecfluo;
891 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
893
894 // sum of de-excitation energies
895 esecfluo -= de;
896
897 // subtracted from energy loss
898 if(eloss >= esecfluo) {
899 esec += esecfluo;
900 eloss -= esecfluo;
901 } else {
902 esec += esecfluo;
903 eloss = 0.0;
904 }
905 }
906 if(nullptr != subcutProducer && IsRegionForCubcutProcessor(track)) {
907 subcutProducer->SampleSecondaries(step, scTracks, eloss, cut);
908 }
909 // secondaries from atomic de-excitation and subcut
910 if(!scTracks.empty()) { FillSecondariesAlongStep(weight); }
911
912 // Energy balance
913 G4double finalT = preStepKinEnergy - eloss - esec;
914 if (finalT <= lowestKinEnergy) {
915 eloss += finalT;
916 finalT = 0.0;
917 } else if(isIon) {
919 currentModel->GetParticleCharge(track.GetParticleDefinition(),
920 currentMaterial,finalT));
921 }
922 eloss = std::max(eloss, 0.0);
923
926 /*
927 if(-1 < verboseLevel) {
928 G4double del = finalT + eloss + esec - preStepKinEnergy;
929 G4cout << "Final value eloss(MeV)= " << eloss/MeV
930 << " preStepKinEnergy= " << preStepKinEnergy
931 << " postStepKinEnergy= " << finalT
932 << " de(keV)= " << del/keV
933 << " lossFlag= " << lossFluctuationFlag
934 << " status= " << track.GetTrackStatus()
935 << G4endl;
936 }
937 */
938 return &fParticleChange;
939}
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()
Definition: G4VEmModel.hh:593
virtual G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:334
G4bool IsActive(G4double kinEnergy) const
Definition: G4VEmModel.hh:774
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, const G4double &length, G4double &eloss)
Definition: G4VEmModel.cc:342
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:501
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 ,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety,
G4GPILSelection selection 
)
overridevirtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 573 of file G4VEnergyLossProcess.cc.

576{
577 G4double x = DBL_MAX;
578 *selection = aGPILSelection;
579 if(isIonisation && currentModel->IsActive(preStepScaledEnergy)) {
580 GetScaledRangeForScaledEnergy(preStepScaledEnergy, preStepLogScaledEnergy);
581 const G4double finR = (rndmStepFlag) ? std::min(finalRange,
583 x = (fRange > finR) ?
584 fRange*dRoverRange + finR*(1.0-dRoverRange)*(2.0-finR/fRange) : fRange;
585 }
586 //G4cout<<"AlongStepGPIL: " << GetProcessName()<<": e= "<<preStepKinEnergy
587 //<<" stepLimit= "<<x<<G4endl;
588 return x;
589}
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 412 of file G4VEnergyLossProcess.cc.

413{
414 G4PhysicsTable* table = nullptr;
415 G4double emax = maxKinEnergy;
416 G4int bin = nBins;
417
418 if(fTotal == tType) {
419 emax = maxKinEnergyCSDA;
420 bin = nBinsCSDA;
421 table = theDEDXunRestrictedTable;
422 } else if(fRestricted == tType) {
423 table = theDEDXTable;
424 } else {
425 G4cout << "G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
426 << tType << G4endl;
427 }
428 if(1 < verboseLevel) {
429 G4cout << "G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
430 << " for " << GetProcessName()
431 << " and " << particle->GetParticleName() << G4endl;
432 }
433 if(nullptr == table) { return table; }
434
435 G4LossTableBuilder* bld = lManager->GetTableBuilder();
436 G4EmTableUtil::BuildDEDXTable(this, particle, modelManager, bld,
437 table, minKinEnergy, emax, bin,
438 verboseLevel, tType, spline);
439 return table;
440}
@ 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 444 of file G4VEnergyLossProcess.cc.

445{
446 if(nullptr == theLambdaTable) { return theLambdaTable; }
447
448 G4double scale = theParameters->MaxKinEnergy()/theParameters->MinKinEnergy();
449 G4int nbin =
450 theParameters->NumberOfBinsPerDecade()*G4lrint(std::log10(scale));
451 scale = nbin/G4Log(scale);
452
453 G4LossTableBuilder* bld = lManager->GetTableBuilder();
454 G4EmTableUtil::BuildLambdaTable(this, particle, modelManager,
455 bld, theLambdaTable, theCuts,
456 minKinEnergy, maxKinEnergy, scale,
457 verboseLevel, spline);
458 return theLambdaTable;
459}
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 343 of file G4VEnergyLossProcess.cc.

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

Referenced by G4PolarizedIonisation::BuildPhysicsTable().

◆ ContinuousStepLimit()

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

Definition at line 1198 of file G4VEnergyLossProcess.cc.

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

◆ CrossSectionBiasingFactor()

G4double G4VEnergyLossProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 904 of file G4VEnergyLossProcess.hh.

905{
906 return biasFactor;
907}

◆ 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 1165 of file G4VEnergyLossProcess.cc.

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

◆ CrossSectionType()

G4CrossSectionType G4VEnergyLossProcess::CrossSectionType ( ) const
inline

Definition at line 869 of file G4VEnergyLossProcess.hh.

870{
871 return fXSType;
872}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ CSDARangeTable()

G4PhysicsTable * G4VEnergyLossProcess::CSDARangeTable ( ) const
inline

Definition at line 939 of file G4VEnergyLossProcess.hh.

940{
941 return theCSDARangeTable;
942}

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 925 of file G4VEnergyLossProcess.hh.

926{
927 return theDEDXunRestrictedTable;
928}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ EmModel()

◆ EnergyOfCrossSectionMax()

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

Definition at line 975 of file G4VEnergyLossProcess.hh.

976{
977 return theEnergyOfCrossSectionMax;
978}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ FluctModel()

◆ GetContinuousStepLimit()

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

Implements G4VContinuousDiscreteProcess.

Definition at line 1219 of file G4VEnergyLossProcess.cc.

1222{
1223 return DBL_MAX;
1224}

◆ GetCSDADEDX()

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

◆ GetCSDARange()

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

Definition at line 744 of file G4VEnergyLossProcess.hh.

746{
747 DefineMaterial(couple);
748 return (nullptr == theCSDARangeTable) ? DBL_MAX :
749 GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
750}

Referenced by G4LossTableManager::GetCSDARange().

◆ GetCurrentElement()

const G4Element * G4VEnergyLossProcess::GetCurrentElement ( ) const

Definition at line 1332 of file G4VEnergyLossProcess.cc.

1333{
1334 return (nullptr != currentModel)
1335 ? currentModel->GetCurrentElement(currentMaterial) : nullptr;
1336}
const G4Element * GetCurrentElement(const G4Material *mat=nullptr) const
Definition: G4VEmModel.cc:242

◆ GetDEDX() [1/2]

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

Definition at line 702 of file G4VEnergyLossProcess.hh.

704{
705 DefineMaterial(couple);
706 return GetDEDXForScaledEnergy(kinEnergy*massRatio);
707}

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

◆ GetDEDX() [2/2]

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

Definition at line 712 of file G4VEnergyLossProcess.hh.

715{
716 DefineMaterial(couple);
717 return GetDEDXForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
718}

◆ GetDEDXDispersion()

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

Definition at line 1146 of file G4VEnergyLossProcess.cc.

1150{
1151 DefineMaterial(couple);
1152 G4double ekin = dp->GetKineticEnergy();
1153 SelectModel(ekin*massRatio);
1154 G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
1155 G4double tcut = std::min(tmax,(*theCuts)[currentCoupleIndex]);
1156 G4double d = 0.0;
1157 G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
1158 if(nullptr != fm) { d = fm->Dispersion(currentMaterial,dp,tcut,tmax,length); }
1159 return d;
1160}
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 755 of file G4VEnergyLossProcess.hh.

757{
758 DefineMaterial(couple);
759 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
760}

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

◆ GetLambda() [1/2]

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

Definition at line 765 of file G4VEnergyLossProcess.hh.

767{
768 DefineMaterial(couple);
769 return (nullptr != theLambdaTable) ?
770 GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0;
771}

◆ GetLambda() [2/2]

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

Definition at line 776 of file G4VEnergyLossProcess.hh.

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

◆ GetMeanFreePath()

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

Implements G4VContinuousDiscreteProcess.

Definition at line 1207 of file G4VEnergyLossProcess.cc.

1212{
1214 return MeanFreePath(track);
1215}
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 1004 of file G4VEnergyLossProcess.hh.

1005{
1006 return modelManager->GetModel((G4int)idx, ver);
1007}
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 723 of file G4VEnergyLossProcess.hh.

725{
726 DefineMaterial(couple);
727 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio);
728}

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

◆ GetRange() [2/2]

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

Definition at line 733 of file G4VEnergyLossProcess.hh.

736{
737 DefineMaterial(couple);
738 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio);
739}

◆ InitialiseEnergyLossProcess()

◆ InverseRangeTable()

G4PhysicsTable * G4VEnergyLossProcess::InverseRangeTable ( ) const
inline

Definition at line 953 of file G4VEnergyLossProcess.hh.

954{
955 return theInverseRangeTable;
956}

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

◆ IonisationTable()

G4PhysicsTable * G4VEnergyLossProcess::IonisationTable ( ) const
inline

Definition at line 932 of file G4VEnergyLossProcess.hh.

933{
934 return theIonisationTable;
935}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ IsIonisationProcess()

G4bool G4VEnergyLossProcess::IsIonisationProcess ( ) const
inline

◆ LambdaPhysicsVector()

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

Definition at line 1229 of file G4VEnergyLossProcess.cc.

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

◆ LambdaTable()

G4PhysicsTable * G4VEnergyLossProcess::LambdaTable ( ) const
inline

Definition at line 960 of file G4VEnergyLossProcess.hh.

961{
962 return theLambdaTable;
963}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ MaxKinEnergy()

G4double G4VEnergyLossProcess::MaxKinEnergy ( ) const
inline

Definition at line 897 of file G4VEnergyLossProcess.hh.

898{
899 return maxKinEnergy;
900}

◆ MeanFreePath()

G4double G4VEnergyLossProcess::MeanFreePath ( const G4Track track)

Definition at line 1186 of file G4VEnergyLossProcess.cc.

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

Referenced by GetMeanFreePath().

◆ MinKinEnergy()

G4double G4VEnergyLossProcess::MinKinEnergy ( ) const
inline

Definition at line 890 of file G4VEnergyLossProcess.hh.

891{
892 return minKinEnergy;
893}

◆ MinPrimaryEnergy()

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

◆ NumberOfModels()

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

Definition at line 989 of file G4VEnergyLossProcess.hh.

990{
991 return numberOfModels;
992}

◆ NumberOfSubCutoffRegions()

G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions ( ) const
inline

Definition at line 883 of file G4VEnergyLossProcess.hh.

884{
885 return nSCoffRegions;
886}

◆ operator=()

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

◆ Particle()

const G4ParticleDefinition * G4VEnergyLossProcess::Particle ( ) const
inline

Definition at line 825 of file G4VEnergyLossProcess.hh.

826{
827 return particle;
828}

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

◆ PostStepDoIt()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 972 of file G4VEnergyLossProcess.cc.

974{
975 // clear number of interaction lengths in any case
978
980 const G4double finalT = track.GetKineticEnergy();
981
982 const G4double postStepScaledEnergy = finalT*massRatio;
983 SelectModel(postStepScaledEnergy);
984
985 if(!currentModel->IsActive(postStepScaledEnergy)) {
986 return &fParticleChange;
987 }
988 /*
989 if(1 < verboseLevel) {
990 G4cout<<GetProcessName()<<" PostStepDoIt: E(MeV)= "<< finalT/MeV<< G4endl;
991 }
992 */
993 // forced process - should happen only once per track
994 if(biasFlag) {
996 biasFlag = false;
997 }
998 }
999 const G4DynamicParticle* dp = track.GetDynamicParticle();
1000
1001 // Integral approach
1002 if (fXSType != fEmNoIntegral) {
1003 const G4double logFinalT = dp->GetLogKineticEnergy();
1004 G4double lx = GetLambdaForScaledEnergy(postStepScaledEnergy,
1005 logFinalT + logMassRatio);
1006 lx = std::max(lx, 0.0);
1007
1008 // if both lg and lx are zero then no interaction
1009 if(preStepLambda*G4UniformRand() >= lx) {
1010 return &fParticleChange;
1011 }
1012 }
1013
1014 // define new weight for primary and secondaries
1016 if(weightFlag) {
1017 weight /= biasFactor;
1019 }
1020
1021 const G4double tcut = (*theCuts)[currentCoupleIndex];
1022
1023 // sample secondaries
1024 secParticles.clear();
1025 currentModel->SampleSecondaries(&secParticles, currentCouple, dp, tcut);
1026
1027 const G4int num0 = (G4int)secParticles.size();
1028
1029 // bremsstrahlung splitting or Russian roulette
1030 if(biasManager) {
1032 G4double eloss = 0.0;
1033 weight *= biasManager->ApplySecondaryBiasing(
1034 secParticles,
1035 track, currentModel,
1036 &fParticleChange, eloss,
1037 (G4int)currentCoupleIndex, tcut,
1038 step.GetPostStepPoint()->GetSafety());
1039 if(eloss > 0.0) {
1042 }
1043 }
1044 }
1045
1046 // save secondaries
1047 const G4int num = (G4int)secParticles.size();
1048 if(num > 0) {
1049
1051 G4double time = track.GetGlobalTime();
1052
1053 G4int n1(0), n2(0);
1054 if(num0 > mainSecondaries) {
1055 currentModel->FillNumberOfSecondaries(n1, n2);
1056 }
1057
1058 for (G4int i=0; i<num; ++i) {
1059 if(nullptr != secParticles[i]) {
1060 G4Track* t = new G4Track(secParticles[i], time, track.GetPosition());
1062 if (biasManager) {
1063 t->SetWeight(weight * biasManager->GetWeight(i));
1064 } else {
1065 t->SetWeight(weight);
1066 }
1067 if(i < num0) {
1068 t->SetCreatorModelID(secID);
1069 } else if(i < num0 + n1) {
1070 t->SetCreatorModelID(tripletID);
1071 } else {
1072 t->SetCreatorModelID(biasID);
1073 }
1074
1075 //G4cout << "Secondary(post step) has weight " << t->GetWeight()
1076 // << ", kenergy " << t->GetKineticEnergy()/MeV << " MeV"
1077 // << " time= " << time/ns << " ns " << G4endl;
1079 }
1080 }
1081 }
1082
1085 if(particle->GetProcessManager()->GetAtRestProcessVector()->size() > 0)
1088 }
1089
1090 /*
1091 if(-1 < verboseLevel) {
1092 G4cout << "::PostStepDoIt: Sample secondary; Efin= "
1093 << fParticleChange.GetProposedKineticEnergy()/MeV
1094 << " MeV; model= (" << currentModel->LowEnergyLimit()
1095 << ", " << currentModel->HighEnergyLimit() << ")"
1096 << " preStepLambda= " << preStepLambda
1097 << " dir= " << track.GetMomentumDirection()
1098 << " status= " << track.GetTrackStatus()
1099 << G4endl;
1100 }
1101 */
1102 return &fParticleChange;
1103}
@ 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 &)
G4double GetProposedKineticEnergy() const
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)
Definition: G4VEmModel.cc:308
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
Definition: G4VProcess.hh:335

◆ PostStepGetPhysicalInteractionLength()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 593 of file G4VEnergyLossProcess.cc.

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

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

◆ ProcessDescription()

◆ RangeTableForLoss()

G4PhysicsTable * G4VEnergyLossProcess::RangeTableForLoss ( ) const
inline

Definition at line 946 of file G4VEnergyLossProcess.hh.

947{
948 return theRangeTableForLoss;
949}

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 1131 of file G4VEnergyLossProcess.cc.

1133{
1134 if (!isMaster || nullptr != baseParticle || part != particle ) return true;
1135 for(std::size_t i=0; i<7; ++i) {
1136 if(!G4EmTableUtil::RetrieveTable(this, part, theData->Table(i), dir, tnames[i],
1137 verboseLevel, ascii, spline)) {
1138 return false;
1139 }
1140 }
1141 return true;
1142}
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 840 of file G4VEnergyLossProcess.hh.

841{
842 return secondaryParticle;
843}

◆ 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 *)
Definition: G4VEmModel.hh:468

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 818 of file G4VEnergyLossProcess.hh.

819{
820 baseParticle = p;
821}

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

◆ SetCrossSectionBiasingFactor()

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

Definition at line 1340 of file G4VEnergyLossProcess.cc.

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

Referenced by G4EmExtraParameters::DefineRegParamForLoss().

◆ SetCrossSectionType()

void G4VEnergyLossProcess::SetCrossSectionType ( G4CrossSectionType  val)
inline

Definition at line 862 of file G4VEnergyLossProcess.hh.

863{
864 fXSType = val;
865}

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

◆ SetCSDARangeTable()

void G4VEnergyLossProcess::SetCSDARangeTable ( G4PhysicsTable pRange)

Definition at line 1266 of file G4VEnergyLossProcess.cc.

1267{
1268 theCSDARangeTable = p;
1269}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetDEDXBinning()

void G4VEnergyLossProcess::SetDEDXBinning ( G4int  nbins)

Definition at line 1440 of file G4VEnergyLossProcess.cc.

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

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

◆ SetDEDXTable()

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

Definition at line 1240 of file G4VEnergyLossProcess.cc.

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

1319{
1320 theEnergyOfCrossSectionMax = p;
1321}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetFluctModel()

◆ SetInverseRangeTable()

void G4VEnergyLossProcess::SetInverseRangeTable ( G4PhysicsTable p)

Definition at line 1280 of file G4VEnergyLossProcess.cc.

1281{
1282 theInverseRangeTable = p;
1283}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetIonisation()

◆ SetLambdaTable()

void G4VEnergyLossProcess::SetLambdaTable ( G4PhysicsTable p)

Definition at line 1287 of file G4VEnergyLossProcess.cc.

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

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetLinearLossLimit()

void G4VEnergyLossProcess::SetLinearLossLimit ( G4double  val)

Definition at line 1409 of file G4VEnergyLossProcess.cc.

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

Referenced by G4ionIonisation::G4ionIonisation().

◆ SetLossFluctuations()

void G4VEnergyLossProcess::SetLossFluctuations ( G4bool  val)
inline

Definition at line 847 of file G4VEnergyLossProcess.hh.

848{
849 lossFluctuationFlag = val;
850 actLossFluc = true;
851}

◆ SetLowestEnergyLimit()

void G4VEnergyLossProcess::SetLowestEnergyLimit ( G4double  val)

Definition at line 1432 of file G4VEnergyLossProcess.cc.

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

◆ SetMaxKinEnergy()

void G4VEnergyLossProcess::SetMaxKinEnergy ( G4double  e)

Definition at line 1463 of file G4VEnergyLossProcess.cc.

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

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

◆ SetMinKinEnergy()

void G4VEnergyLossProcess::SetMinKinEnergy ( G4double  e)

Definition at line 1453 of file G4VEnergyLossProcess.cc.

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

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

◆ SetParticle()

void G4VEnergyLossProcess::SetParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 802 of file G4VEnergyLossProcess.hh.

803{
804 particle = p;
805}

◆ SetRangeTableForLoss()

void G4VEnergyLossProcess::SetRangeTableForLoss ( G4PhysicsTable p)

Definition at line 1273 of file G4VEnergyLossProcess.cc.

1274{
1275 theRangeTableForLoss = p;
1276}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ SetSecondaryParticle()

◆ SetSpline()

void G4VEnergyLossProcess::SetSpline ( G4bool  val)
inline

◆ SetStepFunction()

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

Definition at line 1419 of file G4VEnergyLossProcess.cc.

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

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

◆ SetTwoPeaksXS()

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

Definition at line 1325 of file G4VEnergyLossProcess.cc.

1326{
1327 fXSpeaks = ptr;
1328}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ StartTracking()

void G4VEnergyLossProcess::StartTracking ( G4Track track)
overridevirtual

Reimplemented from G4VProcess.

Definition at line 541 of file G4VEnergyLossProcess.cc.

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

◆ StorePhysicsTable()

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

Reimplemented from G4VProcess.

Definition at line 1107 of file G4VEnergyLossProcess.cc.

1109{
1110 if (!isMaster || nullptr != baseParticle || part != particle ) return true;
1111 for(std::size_t i=0; i<7; ++i) {
1112 if(nullptr != theData->Table(i)) {
1113 if(1 < verboseLevel) {
1114 G4cout << "G4VEnergyLossProcess::StorePhysicsTable i=" << i
1115 << " " << particle->GetParticleName()
1116 << " " << GetProcessName()
1117 << " " << tnames[i] << " " << theData->Table(i) << G4endl;
1118 }
1119 if(!G4EmTableUtil::StoreTable(this, part, theData->Table(i),
1120 dir, tnames[i], verboseLevel, ascii)) {
1121 return false;
1122 }
1123 }
1124 }
1125 return true;
1126}
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 G4ePairProduction, G4MuPairProduction, G4eBremsstrahlung, and G4ionIonisation.

Definition at line 98 of file G4VEnergyLossProcess.hh.

98{};

◆ TablesAreBuilt()

G4bool G4VEnergyLossProcess::TablesAreBuilt ( ) const
inline

Definition at line 911 of file G4VEnergyLossProcess.hh.

912{
913 return tablesAreBuilt;
914}

◆ TwoPeaksXS()

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

Definition at line 982 of file G4VEnergyLossProcess.hh.

983{
984 return fXSpeaks;
985}

Referenced by G4EmTableUtil::BuildLocalElossProcess().

◆ UseBaseMaterial()

G4bool G4VEnergyLossProcess::UseBaseMaterial ( ) const
inline

Definition at line 967 of file G4VEnergyLossProcess.hh.

968{
969 return baseMat;
970}

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 413 of file G4VEnergyLossProcess.hh.

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

◆ mfpKinEnergy

G4double G4VEnergyLossProcess::mfpKinEnergy = 0.0
protected

Definition at line 478 of file G4VEnergyLossProcess.hh.

Referenced by PostStepDoIt(), and StartTracking().

◆ preStepKinEnergy

G4double G4VEnergyLossProcess::preStepKinEnergy = 0.0
protected

Definition at line 474 of file G4VEnergyLossProcess.hh.

Referenced by AlongStepDoIt(), and PostStepGetPhysicalInteractionLength().

◆ preStepLambda

G4double G4VEnergyLossProcess::preStepLambda = 0.0
protected

Definition at line 473 of file G4VEnergyLossProcess.hh.

Referenced by PostStepDoIt(), and PostStepGetPhysicalInteractionLength().

◆ preStepLogKinEnergy

G4double G4VEnergyLossProcess::preStepLogKinEnergy = LOG_EKIN_MIN
protected

Definition at line 475 of file G4VEnergyLossProcess.hh.

Referenced by PostStepGetPhysicalInteractionLength().

◆ preStepLogScaledEnergy

G4double G4VEnergyLossProcess::preStepLogScaledEnergy = LOG_EKIN_MIN
protected

◆ preStepScaledEnergy

G4double G4VEnergyLossProcess::preStepScaledEnergy = 0.0
protected

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