Geant4 9.6.0
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)
 
virtual ~G4VEnergyLossProcess ()
 
virtual G4bool IsApplicable (const G4ParticleDefinition &p)=0
 
virtual void PrintInfo ()=0
 
void PreparePhysicsTable (const G4ParticleDefinition &)
 
void BuildPhysicsTable (const G4ParticleDefinition &)
 
G4PhysicsTableBuildDEDXTable (G4EmTableType tType=fRestricted)
 
G4PhysicsTableBuildLambdaTable (G4EmTableType tType=fRestricted)
 
void PrintInfoDefinition ()
 
void StartTracking (G4Track *)
 
G4double AlongStepGetPhysicalInteractionLength (const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
 
G4double PostStepGetPhysicalInteractionLength (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4VParticleChangeAlongStepDoIt (const G4Track &, const G4Step &)
 
G4double SampleSubCutSecondaries (std::vector< G4Track * > &, const G4Step &, G4VEmModel *model, G4int matIdx)
 
G4VParticleChangePostStepDoIt (const G4Track &, const G4Step &)
 
G4bool StorePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
 
G4bool RetrievePhysicsTable (const G4ParticleDefinition *, const G4String &directory, G4bool ascii)
 
G4double GetDEDXDispersion (const G4MaterialCutsCouple *couple, const G4DynamicParticle *dp, G4double length)
 
G4double CrossSectionPerVolume (G4double kineticEnergy, const G4MaterialCutsCouple *couple)
 
G4double MeanFreePath (const G4Track &track)
 
G4double ContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
 
G4VEmModelSelectModelForMaterial (G4double kinEnergy, size_t &idx) const
 
void AddEmModel (G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=0)
 
void UpdateEmModel (const G4String &, G4double, G4double)
 
void SetEmModel (G4VEmModel *, G4int index=1)
 
G4VEmModelEmModel (G4int index=1)
 
G4VEmModelGetModelByIndex (G4int idx=0, G4bool ver=false)
 
G4int NumberOfModels ()
 
void SetFluctModel (G4VEmFluctuationModel *)
 
G4VEmFluctuationModelFluctModel ()
 
void SetBaseParticle (const G4ParticleDefinition *p)
 
const G4ParticleDefinitionParticle () const
 
const G4ParticleDefinitionBaseParticle () const
 
const G4ParticleDefinitionSecondaryParticle () const
 
void ActivateSubCutoff (G4bool val, const G4Region *region=0)
 
void SetCrossSectionBiasingFactor (G4double f, G4bool flag=true)
 
void ActivateForcedInteraction (G4double length=0.0, const G4String &region="", G4bool flag=true)
 
void ActivateSecondaryBiasing (const G4String &region, G4double factor, G4double energyLimit)
 
void AddCollaborativeProcess (G4VEnergyLossProcess *)
 
void SetLossFluctuations (G4bool val)
 
void SetRandomStep (G4bool val)
 
void SetIntegral (G4bool val)
 
G4bool IsIntegral () const
 
void SetIonisation (G4bool val)
 
G4bool IsIonisationProcess () const
 
void SetLinearLossLimit (G4double val)
 
void SetMinSubRange (G4double val)
 
void SetLambdaFactor (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 SetSecondaryRangeTable (G4PhysicsTable *p)
 
void SetInverseRangeTable (G4PhysicsTable *p)
 
void SetLambdaTable (G4PhysicsTable *p)
 
void SetSubLambdaTable (G4PhysicsTable *p)
 
void SetDEDXBinning (G4int nbins)
 
void SetLambdaBinning (G4int nbins)
 
void SetDEDXBinningForCSDARange (G4int nbins)
 
void SetMinKinEnergy (G4double e)
 
G4double MinKinEnergy () const
 
void SetMaxKinEnergy (G4double e)
 
G4double MaxKinEnergy () const
 
void SetMaxKinEnergyForCSDARange (G4double e)
 
G4double CrossSectionBiasingFactor () const
 
G4double GetDEDX (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetDEDXForSubsec (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetRange (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetCSDARange (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetRangeForLoss (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4double GetKineticEnergy (G4double &range, const G4MaterialCutsCouple *)
 
G4double GetLambda (G4double &kineticEnergy, const G4MaterialCutsCouple *)
 
G4bool TablesAreBuilt () const
 
G4PhysicsTableDEDXTable () const
 
G4PhysicsTableDEDXTableForSubsec () const
 
G4PhysicsTableDEDXunRestrictedTable () const
 
G4PhysicsTableIonisationTable () const
 
G4PhysicsTableIonisationTableForSubsec () const
 
G4PhysicsTableCSDARangeTable () const
 
G4PhysicsTableRangeTableForLoss () const
 
G4PhysicsTableInverseRangeTable () const
 
G4PhysicsTableLambdaTable ()
 
G4PhysicsTableSubLambdaTable ()
 
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 ()
 
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 ()
 
G4int operator== (const G4VProcess &right) const
 
G4int 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 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
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Protected Member Functions

virtual void InitialiseEnergyLossProcess (const G4ParticleDefinition *, const G4ParticleDefinition *)=0
 
virtual G4double MinPrimaryEnergy (const G4ParticleDefinition *, const G4Material *, G4double cut)
 
G4double GetMeanFreePath (const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
 
G4double GetContinuousStepLimit (const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety)
 
G4PhysicsVectorLambdaPhysicsVector (const G4MaterialCutsCouple *, G4double cut)
 
size_t CurrentMaterialCutsCoupleIndex () const
 
G4double GetCurrentRange () 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 previousStepSize)
 
void ClearNumberOfInteractionLengthLeft ()
 

Protected Attributes

G4ParticleChangeForLoss fParticleChange
 
- Protected Attributes inherited from G4VProcess
const G4ProcessManageraProcessManager
 
G4VParticleChangepParticleChange
 
G4ParticleChange aParticleChange
 
G4double theNumberOfInteractionLengthLeft
 
G4double currentInteractionLength
 
G4double theInitialNumberOfInteractionLength
 
G4String theProcessName
 
G4String thePhysicsTableFileName
 
G4ProcessType theProcessType
 
G4int theProcessSubType
 
G4double thePILfactor
 
G4bool enableAtRestDoIt
 
G4bool enableAlongStepDoIt
 
G4bool enablePostStepDoIt
 
G4int verboseLevel
 

Additional Inherited Members

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

Detailed Description

Definition at line 121 of file G4VEnergyLossProcess.hh.

Constructor & Destructor Documentation

◆ G4VEnergyLossProcess()

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

Definition at line 157 of file G4VEnergyLossProcess.cc.

158 :
160 secondaryParticle(0),
161 nSCoffRegions(0),
162 idxSCoffRegions(0),
163 nProcesses(0),
164 theDEDXTable(0),
165 theDEDXSubTable(0),
166 theDEDXunRestrictedTable(0),
167 theIonisationTable(0),
168 theIonisationSubTable(0),
169 theRangeTableForLoss(0),
170 theCSDARangeTable(0),
171 theSecondaryRangeTable(0),
172 theInverseRangeTable(0),
173 theLambdaTable(0),
174 theSubLambdaTable(0),
175 theDensityFactor(0),
176 theDensityIdx(0),
177 baseParticle(0),
178 minSubRange(0.1),
179 lossFluctuationFlag(true),
180 rndmStepFlag(false),
181 tablesAreBuilt(false),
182 integral(true),
183 isIon(false),
184 isIonisation(true),
185 useSubCutoff(false),
186 useDeexcitation(false),
187 particle(0),
188 currentCouple(0),
189 nWarnings(0),
190 mfpKinEnergy(0.0)
191{
193
194 // low energy limit
195 lowestKinEnergy = 1.*eV;
196
197 // Size of tables assuming spline
198 minKinEnergy = 0.1*keV;
199 maxKinEnergy = 10.0*TeV;
200 nBins = 77;
201 maxKinEnergyCSDA = 1.0*GeV;
202 nBinsCSDA = 35;
203
204 // default linear loss limit for spline
205 linLossLimit = 0.01;
206
207 // default dRoverRange and finalRange
208 SetStepFunction(0.2, 1.0*mm);
209
210 // default lambda factor
211 lambdaFactor = 0.8;
212
213 // cross section biasing
214 biasFactor = 1.0;
215
216 // particle types
217 theElectron = G4Electron::Electron();
218 thePositron = G4Positron::Positron();
219 theGamma = G4Gamma::Gamma();
220 theGenericIon = 0;
221
222 // run time objects
225 modelManager = new G4EmModelManager();
227 ->GetSafetyHelper();
228 aGPILSelection = CandidateForSelection;
229
230 // initialise model
231 (G4LossTableManager::Instance())->Register(this);
232 fluctModel = 0;
233 atomDeexcitation = 0;
234
235 biasManager = 0;
236 biasFlag = false;
237 weightFlag = false;
238
239 scTracks.reserve(5);
240 secParticles.reserve(5);
241}
@ CandidateForSelection
static G4Electron * Electron()
Definition: G4Electron.cc:94
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4LossTableManager * Instance()
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4TransportationManager * GetTransportationManager()
G4SafetyHelper * GetSafetyHelper() const
G4ParticleChangeForLoss fParticleChange
void SetStepFunction(G4double v1, G4double v2)
void SetSecondaryWeightByProcess(G4bool)
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:408
G4VParticleChange * pParticleChange
Definition: G4VProcess.hh:283

◆ ~G4VEnergyLossProcess()

G4VEnergyLossProcess::~G4VEnergyLossProcess ( )
virtual

Definition at line 245 of file G4VEnergyLossProcess.cc.

246{
247 if(1 < verboseLevel) {
248 G4cout << "G4VEnergyLossProcess destruct " << GetProcessName()
249 << " " << this << " " << baseParticle << G4endl;
250 }
251 Clean();
252
253 if ( !baseParticle ) {
254 if(theDEDXTable) {
255 if(theIonisationTable == theDEDXTable) { theIonisationTable = 0; }
256 theDEDXTable->clearAndDestroy();
257 delete theDEDXTable;
258 if(theDEDXSubTable) {
259 if(theIonisationSubTable == theDEDXSubTable)
260 theIonisationSubTable = 0;
261 theDEDXSubTable->clearAndDestroy();
262 delete theDEDXSubTable;
263 }
264 }
265 if(theIonisationTable) {
266 theIonisationTable->clearAndDestroy();
267 delete theIonisationTable;
268 }
269 if(theIonisationSubTable) {
270 theIonisationSubTable->clearAndDestroy();
271 delete theIonisationSubTable;
272 }
273 if(theDEDXunRestrictedTable && theCSDARangeTable) {
274 theDEDXunRestrictedTable->clearAndDestroy();
275 delete theDEDXunRestrictedTable;
276 }
277 if(theCSDARangeTable) {
278 theCSDARangeTable->clearAndDestroy();
279 delete theCSDARangeTable;
280 }
281 if(theRangeTableForLoss) {
282 theRangeTableForLoss->clearAndDestroy();
283 delete theRangeTableForLoss;
284 }
285 if(theInverseRangeTable) {
286 theInverseRangeTable->clearAndDestroy();
287 delete theInverseRangeTable;
288 }
289 if(theLambdaTable) {
290 theLambdaTable->clearAndDestroy();
291 delete theLambdaTable;
292 }
293 if(theSubLambdaTable) {
294 theSubLambdaTable->clearAndDestroy();
295 delete theSubLambdaTable;
296 }
297 }
298
299 delete modelManager;
300 delete biasManager;
301 (G4LossTableManager::Instance())->DeRegister(this);
302}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void clearAndDestroy()
G4int verboseLevel
Definition: G4VProcess.hh:368
const G4String & GetProcessName() const
Definition: G4VProcess.hh:379

Member Function Documentation

◆ ActivateForcedInteraction()

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

Definition at line 2058 of file G4VEnergyLossProcess.cc.

2061{
2062 if(!biasManager) { biasManager = new G4EmBiasingManager(); }
2063 if(1 < verboseLevel) {
2064 G4cout << "### ActivateForcedInteraction: for "
2065 << " process " << GetProcessName()
2066 << " length(mm)= " << length/mm
2067 << " in G4Region <" << region
2068 << "> weightFlag= " << flag
2069 << G4endl;
2070 }
2071 weightFlag = flag;
2072 biasManager->ActivateForcedInteraction(length, region);
2073}
void ActivateForcedInteraction(G4double length=0.0, const G4String &r="")

Referenced by G4EmProcessOptions::ActivateForcedInteraction().

◆ ActivateSecondaryBiasing()

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

Definition at line 2078 of file G4VEnergyLossProcess.cc.

2081{
2082 if (0.0 <= factor) {
2083
2084 // Range cut can be applied only for e-
2085 if(0.0 == factor && secondaryParticle != G4Electron::Electron())
2086 { return; }
2087
2088 if(!biasManager) { biasManager = new G4EmBiasingManager(); }
2089 biasManager->ActivateSecondaryBiasing(region, factor, energyLimit);
2090 if(1 < verboseLevel) {
2091 G4cout << "### ActivateSecondaryBiasing: for "
2092 << " process " << GetProcessName()
2093 << " factor= " << factor
2094 << " in G4Region <" << region
2095 << "> energyLimit(MeV)= " << energyLimit/MeV
2096 << G4endl;
2097 }
2098 }
2099}
void ActivateSecondaryBiasing(const G4String &region, G4double factor, G4double energyLimit)

Referenced by G4EmProcessOptions::ActivateSecondaryBiasing().

◆ ActivateSubCutoff()

void G4VEnergyLossProcess::ActivateSubCutoff ( G4bool  val,
const G4Region region = 0 
)

Definition at line 847 of file G4VEnergyLossProcess.cc.

848{
850 const G4Region* reg = r;
851 if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
852
853 // the region is in the list
854 if (nSCoffRegions) {
855 for (G4int i=0; i<nSCoffRegions; ++i) {
856 if (reg == scoffRegions[i]) {
857 return;
858 }
859 }
860 }
861
862 // new region
863 if(val) {
864 useSubCutoff = true;
865 scoffRegions.push_back(reg);
866 ++nSCoffRegions;
867 } else {
868 useSubCutoff = false;
869 }
870}
int G4int
Definition: G4Types.hh:66
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const

Referenced by G4LossTableManager::Register().

◆ AddCollaborativeProcess()

void G4VEnergyLossProcess::AddCollaborativeProcess ( G4VEnergyLossProcess p)

Definition at line 1805 of file G4VEnergyLossProcess.cc.

1807{
1808 G4bool add = true;
1809 if(p->GetProcessName() != "eBrem") { add = false; }
1810 if(add && nProcesses > 0) {
1811 for(G4int i=0; i<nProcesses; ++i) {
1812 if(p == scProcesses[i]) {
1813 add = false;
1814 break;
1815 }
1816 }
1817 }
1818 if(add) {
1819 scProcesses.push_back(p);
1820 ++nProcesses;
1821 if (1 < verboseLevel) {
1822 G4cout << "### The process " << p->GetProcessName()
1823 << " is added to the list of collaborative processes of "
1824 << GetProcessName() << G4endl;
1825 }
1826 }
1827}
bool G4bool
Definition: G4Types.hh:67

◆ AddEmModel()

void G4VEnergyLossProcess::AddEmModel ( G4int  order,
G4VEmModel p,
G4VEmFluctuationModel fluc = 0,
const G4Region region = 0 
)

◆ AlongStepDoIt()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1038 of file G4VEnergyLossProcess.cc.

1040{
1042 // The process has range table - calculate energy loss
1043 if(!isIonisation || !currentModel->IsActive(preStepScaledEnergy)) {
1044 return &fParticleChange;
1045 }
1046
1047 // Get the actual (true) Step length
1048 G4double length = step.GetStepLength();
1049 if(length <= 0.0) { return &fParticleChange; }
1050 G4double eloss = 0.0;
1051
1052 /*
1053 if(1 < verboseLevel) {
1054 const G4ParticleDefinition* d = track.GetParticleDefinition();
1055 G4cout << "AlongStepDoIt for "
1056 << GetProcessName() << " and particle "
1057 << d->GetParticleName()
1058 << " eScaled(MeV)= " << preStepScaledEnergy/MeV
1059 << " range(mm)= " << fRange/mm
1060 << " s(mm)= " << length/mm
1061 << " rf= " << reduceFactor
1062 << " q^2= " << chargeSqRatio
1063 << " md= " << d->GetPDGMass()
1064 << " status= " << track.GetTrackStatus()
1065 << G4endl;
1066 }
1067 */
1068
1069 const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
1070
1071 // define new weight for primary and secondaries
1073 if(weightFlag) {
1074 weight /= biasFactor;
1076 }
1077
1078 // stopping
1079 if (length >= fRange) {
1080 eloss = preStepKinEnergy;
1081 if (useDeexcitation) {
1082 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
1083 eloss, currentCoupleIndex);
1084 if(scTracks.size() > 0) { FillSecondariesAlongStep(eloss, weight); }
1085 if(eloss < 0.0) { eloss = 0.0; }
1086 }
1089 return &fParticleChange;
1090 }
1091
1092 // Short step
1093 eloss = GetDEDXForScaledEnergy(preStepScaledEnergy)*length;
1094
1095 // Long step
1096 if(eloss > preStepKinEnergy*linLossLimit) {
1097
1098 //G4double x = GetScaledRangeForScaledEnergy(preStepScaledEnergy)
1099 // - length/reduceFactor;
1100 G4double x = (fRange - length)/reduceFactor;
1101 eloss = preStepKinEnergy - ScaledKinEnergyForLoss(x)/massRatio;
1102
1103 /*
1104 if(-1 < verboseLevel)
1105 G4cout << "Long STEP: rPre(mm)= "
1106 << GetScaledRangeForScaledEnergy(preStepScaledEnergy)/mm
1107 << " rPost(mm)= " << x/mm
1108 << " ePre(MeV)= " << preStepScaledEnergy/MeV
1109 << " eloss(MeV)= " << eloss/MeV
1110 << " eloss0(MeV)= "
1111 << GetDEDXForScaledEnergy(preStepScaledEnergy)*length/MeV
1112 << " lim(MeV)= " << preStepKinEnergy*linLossLimit/MeV
1113 << G4endl;
1114 */
1115 }
1116
1117 /*
1118 G4double eloss0 = eloss;
1119 if(-1 < verboseLevel ) {
1120 G4cout << "Before fluct: eloss(MeV)= " << eloss/MeV
1121 << " e-eloss= " << preStepKinEnergy-eloss
1122 << " step(mm)= " << length/mm
1123 << " range(mm)= " << fRange/mm
1124 << " fluct= " << lossFluctuationFlag
1125 << G4endl;
1126 }
1127 */
1128
1129 G4double cut = (*theCuts)[currentCoupleIndex];
1130 G4double esec = 0.0;
1131
1132 // SubCutOff
1133 if(useSubCutoff) {
1134 if(idxSCoffRegions[currentCoupleIndex]) {
1135
1136 G4bool yes = false;
1137 G4StepPoint* prePoint = step.GetPreStepPoint();
1138
1139 // Check boundary
1140 if(prePoint->GetStepStatus() == fGeomBoundary) { yes = true; }
1141
1142 // Check PrePoint
1143 else {
1144 G4double preSafety = prePoint->GetSafety();
1145 G4double rcut = currentCouple->GetProductionCuts()->GetProductionCut(1);
1146
1147 // recompute presafety
1148 if(preSafety < rcut) {
1149 preSafety = safetyHelper->ComputeSafety(prePoint->GetPosition());
1150 }
1151
1152 if(preSafety < rcut) { yes = true; }
1153
1154 // Check PostPoint
1155 else {
1156 G4double postSafety = preSafety - length;
1157 if(postSafety < rcut) {
1158 postSafety =
1159 safetyHelper->ComputeSafety(step.GetPostStepPoint()->GetPosition());
1160 if(postSafety < rcut) { yes = true; }
1161 }
1162 }
1163 }
1164
1165 // Decided to start subcut sampling
1166 if(yes) {
1167
1168 cut = (*theSubCuts)[currentCoupleIndex];
1169 eloss -= GetSubDEDXForScaledEnergy(preStepScaledEnergy)*length;
1170 esec = SampleSubCutSecondaries(scTracks, step,
1171 currentModel,currentCoupleIndex);
1172 // add bremsstrahlung sampling
1173 /*
1174 if(nProcesses > 0) {
1175 for(G4int i=0; i<nProcesses; ++i) {
1176 (scProcesses[i])->SampleSubCutSecondaries(
1177 scTracks, step, (scProcesses[i])->
1178 SelectModelForMaterial(preStepKinEnergy, currentCoupleIndex),
1179 currentCoupleIndex);
1180 }
1181 }
1182 */
1183 }
1184 }
1185 }
1186
1187 // Corrections, which cannot be tabulated
1188 if(isIon) {
1189 G4double eadd = 0.0;
1190 G4double eloss_before = eloss;
1191 currentModel->CorrectionsAlongStep(currentCouple, dynParticle,
1192 eloss, eadd, length);
1193 if(eloss < 0.0) { eloss = 0.5*eloss_before; }
1194 }
1195
1196 // Sample fluctuations
1197 if (lossFluctuationFlag) {
1198 G4VEmFluctuationModel* fluc = currentModel->GetModelOfFluctuations();
1199 if(fluc &&
1200 (eloss + esec + lowestKinEnergy) < preStepKinEnergy) {
1201
1202 G4double tmax =
1203 std::min(currentModel->MaxSecondaryKinEnergy(dynParticle),cut);
1204 G4double emean = eloss;
1205 eloss = fluc->SampleFluctuations(currentMaterial,dynParticle,
1206 tmax,length,emean);
1207 /*
1208 if(-1 < verboseLevel)
1209 G4cout << "After fluct: eloss(MeV)= " << eloss/MeV
1210 << " fluc= " << (eloss-eloss0)/MeV
1211 << " ChargeSqRatio= " << chargeSqRatio
1212 << " massRatio= " << massRatio
1213 << " tmax= " << tmax
1214 << G4endl;
1215 */
1216 }
1217 }
1218
1219 // deexcitation
1220 if (useDeexcitation) {
1221 G4double esecfluo = preStepKinEnergy - esec;
1222 G4double de = esecfluo;
1223 //G4double eloss0 = eloss;
1224 /*
1225 G4cout << "### 1: E(keV)= " << preStepKinEnergy/keV
1226 << " Efluomax(keV)= " << de/keV
1227 << " Eloss(keV)= " << eloss/keV << G4endl;
1228 */
1229 atomDeexcitation->AlongStepDeexcitation(scTracks, step,
1230 de, currentCoupleIndex);
1231
1232 // sum of de-excitation energies
1233 esecfluo -= de;
1234
1235 // subtracted from energy loss
1236 if(eloss >= esecfluo) {
1237 esec += esecfluo;
1238 eloss -= esecfluo;
1239 } else {
1240 esec += esecfluo;
1241 eloss = 0.0;
1242 }
1243 /*
1244 if(esecfluo > 0.0) {
1245 G4cout << "### 2: E(keV)= " << preStepKinEnergy/keV
1246 << " Esec(keV)= " << esec/keV
1247 << " Esecf(kV)= " << esecfluo/keV
1248 << " Eloss0(kV)= " << eloss0/keV
1249 << " Eloss(keV)= " << eloss/keV
1250 << G4endl;
1251 }
1252 */
1253 }
1254 if(scTracks.size() > 0) { FillSecondariesAlongStep(eloss, weight); }
1255
1256 // Energy balanse
1257 G4double finalT = preStepKinEnergy - eloss - esec;
1258 if (finalT <= lowestKinEnergy) {
1259 eloss += finalT;
1260 finalT = 0.0;
1261 } else if(isIon) {
1263 currentModel->GetParticleCharge(track.GetParticleDefinition(),
1264 currentMaterial,finalT));
1265 }
1266
1267 if(eloss < 0.0) { eloss = 0.0; }
1270
1271 if(1 < verboseLevel) {
1272 G4double del = finalT + eloss + esec - preStepKinEnergy;
1273 G4cout << "Final value eloss(MeV)= " << eloss/MeV
1274 << " preStepKinEnergy= " << preStepKinEnergy
1275 << " postStepKinEnergy= " << finalT
1276 << " de(keV)= " << del/keV
1277 << " lossFlag= " << lossFluctuationFlag
1278 << " status= " << track.GetTrackStatus()
1279 << G4endl;
1280 }
1281
1282 return &fParticleChange;
1283}
@ fGeomBoundary
Definition: G4StepStatus.hh:54
double G4double
Definition: G4Types.hh:64
G4ProductionCuts * GetProductionCuts() const
void InitializeForAlongStep(const G4Track &)
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void SetProposedCharge(G4double theCharge)
G4double GetProductionCut(G4int index) const
G4double ComputeSafety(const G4ThreeVector &pGlobalPoint, G4double maxRadius=DBL_MAX)
G4StepStatus GetStepStatus() const
G4double GetSafety() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPreStepPoint() const
G4double GetStepLength() const
G4StepPoint * GetPostStepPoint() const
G4TrackStatus GetTrackStatus() 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 G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length, G4double &meanLoss)=0
G4bool IsActive(G4double kinEnergy)
Definition: G4VEmModel.hh:613
virtual void CorrectionsAlongStep(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double &eloss, G4double &niel, G4double length)
Definition: G4VEmModel.cc:279
G4VEmFluctuationModel * GetModelOfFluctuations()
Definition: G4VEmModel.hh:501
virtual G4double GetParticleCharge(const G4ParticleDefinition *, const G4Material *, G4double kineticEnergy)
Definition: G4VEmModel.cc:271
G4double MaxSecondaryKinEnergy(const G4DynamicParticle *dynParticle)
Definition: G4VEmModel.hh:399
G4double SampleSubCutSecondaries(std::vector< G4Track * > &, const G4Step &, G4VEmModel *model, G4int matIdx)
G4double GetParentWeight() const
void ProposeWeight(G4double finalWeight)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)

◆ AlongStepGetPhysicalInteractionLength()

G4double G4VEnergyLossProcess::AlongStepGetPhysicalInteractionLength ( const G4Track ,
G4double  previousStepSize,
G4double  currentMinimumStep,
G4double currentSafety,
G4GPILSelection selection 
)
virtual

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 903 of file G4VEnergyLossProcess.cc.

906{
907 G4double x = DBL_MAX;
908 *selection = aGPILSelection;
909 if(isIonisation) {
910 fRange = GetScaledRangeForScaledEnergy(preStepScaledEnergy)*reduceFactor;
911
912 x = fRange;
913 G4double y = x*dRoverRange;
914 G4double finR = finalRange;
915 if(rndmStepFlag) {
916 finR = std::min(finR,currentCouple->GetProductionCuts()->GetProductionCut(1));
917 }
918 if(x > finR) { x = y + finR*(1.0 - dRoverRange)*(2.0 - finR/fRange); }
919 /*
920 if(particle->GetPDGMass() > 0.9*GeV)
921 G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy
922 <<" range= "<<fRange << " idx= " << basedCoupleIndex
923 << " y= " << y << " finR= " << finR
924 << " limit= " << x <<G4endl;
925 */
926 }
927 //G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy <<" stepLimit= "<<x<<G4endl;
928 return x;
929}
#define DBL_MAX
Definition: templates.hh:83

Referenced by ContinuousStepLimit().

◆ BaseParticle()

const G4ParticleDefinition * G4VEnergyLossProcess::BaseParticle ( ) const
inline

Definition at line 887 of file G4VEnergyLossProcess.hh.

888{
889 return baseParticle;
890}

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

◆ BuildDEDXTable()

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

Definition at line 612 of file G4VEnergyLossProcess.cc.

613{
614 if(1 < verboseLevel) {
615 G4cout << "G4VEnergyLossProcess::BuildDEDXTable() of type " << tType
616 << " for " << GetProcessName()
617 << " and particle " << particle->GetParticleName()
618 << G4endl;
619 }
620 G4PhysicsTable* table = 0;
621 G4double emax = maxKinEnergy;
622 G4int bin = nBins;
623
624 if(fTotal == tType) {
625 emax = maxKinEnergyCSDA;
626 bin = nBinsCSDA;
627 table = theDEDXunRestrictedTable;
628 } else if(fRestricted == tType) {
629 table = theDEDXTable;
630 if(theIonisationTable)
631 table = G4PhysicsTableHelper::PreparePhysicsTable(theIonisationTable);
632 } else if(fSubRestricted == tType) {
633 table = theDEDXSubTable;
634 if(theIonisationSubTable)
635 table = G4PhysicsTableHelper::PreparePhysicsTable(theIonisationSubTable);
636 } else {
637 G4cout << "G4VEnergyLossProcess::BuildDEDXTable WARNING: wrong type "
638 << tType << G4endl;
639 }
640
641 // Access to materials
642 const G4ProductionCutsTable* theCoupleTable=
644 size_t numOfCouples = theCoupleTable->GetTableSize();
645
646 if(1 < verboseLevel) {
647 G4cout << numOfCouples << " materials"
648 << " minKinEnergy= " << minKinEnergy
649 << " maxKinEnergy= " << emax
650 << " nbin= " << bin
651 << " EmTableType= " << tType
652 << " table= " << table << " " << this
653 << G4endl;
654 }
655 if(!table) return table;
656
657 G4LossTableBuilder* bld = (G4LossTableManager::Instance())->GetTableBuilder();
658 G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
659 G4PhysicsLogVector* aVector = 0;
660 G4PhysicsLogVector* bVector = 0;
661
662 for(size_t i=0; i<numOfCouples; ++i) {
663
664 if(1 < verboseLevel) {
665 G4cout << "G4VEnergyLossProcess::BuildDEDXVector flagTable= "
666 << table->GetFlag(i) << " Flag= " << bld->GetFlag(i) << G4endl;
667 }
668 if(bld->GetFlag(i)) {
669
670 // create physics vector and fill it
671 const G4MaterialCutsCouple* couple =
672 theCoupleTable->GetMaterialCutsCouple(i);
673 delete (*table)[i];
674 if(!bVector) {
675 aVector = new G4PhysicsLogVector(minKinEnergy, emax, bin);
676 bVector = aVector;
677 } else {
678 aVector = new G4PhysicsLogVector(*bVector);
679 }
680 aVector->SetSpline(splineFlag);
681
682 modelManager->FillDEDXVector(aVector, couple, tType);
683 if(splineFlag) { aVector->FillSecondDerivatives(); }
684
685 // Insert vector for this material into the table
687 }
688 }
689
690 if(1 < verboseLevel) {
691 G4cout << "G4VEnergyLossProcess::BuildDEDXTable(): table is built for "
692 << particle->GetParticleName()
693 << " and process " << GetProcessName()
694 << G4endl;
695 // if(2 < verboseLevel) G4cout << (*table) << G4endl;
696 }
697
698 return table;
699}
@ fSubRestricted
@ fTotal
@ fRestricted
void FillDEDXVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4EmTableType t=fRestricted)
G4bool GetFlag(size_t idx) const
const G4String & GetParticleName() const
static void SetPhysicsVector(G4PhysicsTable *physTable, size_t idx, G4PhysicsVector *vec)
static G4PhysicsTable * PreparePhysicsTable(G4PhysicsTable *physTable)
G4bool GetFlag(size_t i) const
void FillSecondDerivatives()
void SetSpline(G4bool)
const G4MaterialCutsCouple * GetMaterialCutsCouple(G4int i) const
static G4ProductionCutsTable * GetProductionCutsTable()

◆ BuildLambdaTable()

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

Definition at line 703 of file G4VEnergyLossProcess.cc.

704{
705 G4PhysicsTable* table = 0;
706
707 if(fRestricted == tType) {
708 table = theLambdaTable;
709 } else if(fSubRestricted == tType) {
710 table = theSubLambdaTable;
711 } else {
712 G4cout << "G4VEnergyLossProcess::BuildLambdaTable WARNING: wrong type "
713 << tType << G4endl;
714 }
715
716 if(1 < verboseLevel) {
717 G4cout << "G4VEnergyLossProcess::BuildLambdaTable() of type "
718 << tType << " for process "
719 << GetProcessName() << " and particle "
720 << particle->GetParticleName()
721 << " EmTableType= " << tType
722 << " table= " << table
723 << G4endl;
724 }
725 if(!table) {return table;}
726
727 // Access to materials
728 const G4ProductionCutsTable* theCoupleTable=
730 size_t numOfCouples = theCoupleTable->GetTableSize();
731
732 G4LossTableBuilder* bld = (G4LossTableManager::Instance())->GetTableBuilder();
733 G4bool splineFlag = (G4LossTableManager::Instance())->SplineFlag();
734 G4PhysicsLogVector* aVector = 0;
735 G4double scale = std::log(maxKinEnergy/minKinEnergy);
736
737 for(size_t i=0; i<numOfCouples; ++i) {
738
739 if (bld->GetFlag(i)) {
740
741 // create physics vector and fill it
742 const G4MaterialCutsCouple* couple =
743 theCoupleTable->GetMaterialCutsCouple(i);
744 delete (*table)[i];
745 G4double emin = MinPrimaryEnergy(particle,couple->GetMaterial(),(*theCuts)[i]);
746 if(0.0 >= emin) { emin = eV; }
747 else if(maxKinEnergy <= emin) { emin = 0.5*maxKinEnergy; }
748 G4int bin = G4int(nBins*std::log(maxKinEnergy/emin)/scale + 0.5);
749 if(bin < 3) { bin = 3; }
750 aVector = new G4PhysicsLogVector(emin, maxKinEnergy, bin);
751 aVector->SetSpline(splineFlag);
752
753 modelManager->FillLambdaVector(aVector, couple, true, tType);
754 if(splineFlag) { aVector->FillSecondDerivatives(); }
755
756 // Insert vector for this material into the table
758 }
759 }
760
761 if(1 < verboseLevel) {
762 G4cout << "Lambda table is built for "
763 << particle->GetParticleName()
764 << G4endl;
765 }
766
767 return table;
768}
void FillLambdaVector(G4PhysicsVector *, const G4MaterialCutsCouple *, G4bool startFromNull=true, G4EmTableType t=fRestricted)
const G4Material * GetMaterial() const
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition *, const G4Material *, G4double cut)

◆ BuildPhysicsTable()

void G4VEnergyLossProcess::BuildPhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 554 of file G4VEnergyLossProcess.cc.

555{
556 if(1 < verboseLevel) {
557 G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() for "
558 << GetProcessName()
559 << " and particle " << part.GetParticleName()
560 << "; local: " << particle->GetParticleName();
561 if(baseParticle) { G4cout << "; base: " << baseParticle->GetParticleName(); }
562 G4cout << " TablesAreBuilt= " << tablesAreBuilt
563 << " isIon= " << isIon << " " << this << G4endl;
564 }
565
566 if(&part == particle) {
567 if(!tablesAreBuilt) {
569 }
570 if(!baseParticle) {
571 // needs to be done only once
572 safetyHelper->InitialiseHelper();
573 }
574 }
575
576 // explicitly defined printout by particle name
577 G4String num = part.GetParticleName();
578 if(1 < verboseLevel ||
579 (0 < verboseLevel && (num == "e-" ||
580 num == "e+" || num == "mu+" ||
581 num == "mu-" || num == "proton"||
582 num == "pi+" || num == "pi-" ||
583 num == "kaon+" || num == "kaon-" ||
584 num == "alpha" || num == "anti_proton" ||
585 num == "GenericIon")))
586 {
587 particle = &part;
589 }
590
591 // Added tracking cut to avoid tracking artifacts
592 // identify deexcitation flag
593 if(isIonisation) {
594 fParticleChange.SetLowEnergyLimit(lowestKinEnergy);
595 atomDeexcitation = G4LossTableManager::Instance()->AtomDeexcitation();
596 if(atomDeexcitation) {
597 if(atomDeexcitation->IsPIXEActive()) { useDeexcitation = true; }
598 }
599 }
600
601 if(1 < verboseLevel) {
602 G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() done for "
603 << GetProcessName()
604 << " and particle " << part.GetParticleName();
605 if(isIonisation) { G4cout << " isIonisation flag = 1"; }
606 G4cout << G4endl;
607 }
608}
void BuildPhysicsTable(const G4ParticleDefinition *aParticle)
G4VAtomDeexcitation * AtomDeexcitation()
void SetLowEnergyLimit(G4double elimit)
void InitialiseHelper()

Referenced by G4ePolarizedIonisation::BuildPhysicsTable().

◆ ContinuousStepLimit()

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

Definition at line 1763 of file G4VEnergyLossProcess.cc.

1766{
1767 G4GPILSelection sel;
1768 return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);
1769}
G4GPILSelection
G4double AlongStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)

◆ CrossSectionBiasingFactor()

G4double G4VEnergyLossProcess::CrossSectionBiasingFactor ( ) const
inline

Definition at line 1048 of file G4VEnergyLossProcess.hh.

1049{
1050 return biasFactor;
1051}

◆ CrossSectionPerVolume()

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

Definition at line 1731 of file G4VEnergyLossProcess.cc.

1733{
1734 // Cross section per volume is calculated
1735 DefineMaterial(couple);
1736 G4double cross = 0.0;
1737 if(theLambdaTable) {
1738 cross = (*theDensityFactor)[currentCoupleIndex]*
1739 ((*theLambdaTable)[basedCoupleIndex])->Value(kineticEnergy);
1740 } else {
1741 SelectModel(kineticEnergy);
1742 cross = currentModel->CrossSectionPerVolume(currentMaterial,
1743 particle, kineticEnergy,
1744 (*theCuts)[currentCoupleIndex]);
1745 }
1746 if(cross < 0.0) { cross = 0.0; }
1747 return cross;
1748}
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy=0.0, G4double maxEnergy=DBL_MAX)
Definition: G4VEmModel.cc:186
void SelectModel(G4double kinEnergy)

◆ CSDARangeTable()

G4PhysicsTable * G4VEnergyLossProcess::CSDARangeTable ( ) const
inline

Definition at line 1101 of file G4VEnergyLossProcess.hh.

1102{
1103 return theCSDARangeTable;
1104}

◆ CurrentMaterialCutsCoupleIndex()

size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex ( ) const
inlineprotected

Definition at line 584 of file G4VEnergyLossProcess.hh.

585{
586 return currentCoupleIndex;
587}

Referenced by G4ePolarizedIonisation::GetMeanFreePath(), and G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength().

◆ DEDXTable()

G4PhysicsTable * G4VEnergyLossProcess::DEDXTable ( ) const
inline

Definition at line 1062 of file G4VEnergyLossProcess.hh.

1063{
1064 return theDEDXTable;
1065}

Referenced by G4EmCalculator::PrintDEDXTable().

◆ DEDXTableForSubsec()

G4PhysicsTable * G4VEnergyLossProcess::DEDXTableForSubsec ( ) const
inline

Definition at line 1069 of file G4VEnergyLossProcess.hh.

1070{
1071 return theDEDXSubTable;
1072}

◆ DEDXunRestrictedTable()

G4PhysicsTable * G4VEnergyLossProcess::DEDXunRestrictedTable ( ) const
inline

Definition at line 1076 of file G4VEnergyLossProcess.hh.

1077{
1078 return theDEDXunRestrictedTable;
1079}

◆ EmModel()

◆ FluctModel()

◆ GetContinuousStepLimit()

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

Implements G4VContinuousDiscreteProcess.

Definition at line 1785 of file G4VEnergyLossProcess.cc.

1788{
1789 return DBL_MAX;
1790}

◆ GetCSDARange()

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

Definition at line 771 of file G4VEnergyLossProcess.hh.

773{
774 DefineMaterial(couple);
775 G4double x = DBL_MAX;
776 if(theCSDARangeTable) {
777 x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
778 }
779 return x;
780}

Referenced by G4LossTableManager::GetCSDARange().

◆ GetCurrentElement()

const G4Element * G4VEnergyLossProcess::GetCurrentElement ( ) const

Definition at line 2031 of file G4VEnergyLossProcess.cc.

2032{
2033 const G4Element* elm = 0;
2034 if(currentModel) { elm = currentModel->GetCurrentElement(); }
2035 return elm;
2036}
const G4Element * GetCurrentElement() const
Definition: G4VEmModel.hh:391

◆ GetCurrentRange()

G4double G4VEnergyLossProcess::GetCurrentRange ( ) const
inlineprotected

Definition at line 591 of file G4VEnergyLossProcess.hh.

592{
593 return fRange;
594}

◆ GetDEDX()

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

Definition at line 732 of file G4VEnergyLossProcess.hh.

734{
735 DefineMaterial(couple);
736 return GetDEDXForScaledEnergy(kineticEnergy*massRatio);
737}

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

◆ GetDEDXDispersion()

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

Definition at line 1713 of file G4VEnergyLossProcess.cc.

1717{
1718 DefineMaterial(couple);
1719 G4double ekin = dp->GetKineticEnergy();
1720 SelectModel(ekin*massRatio);
1721 G4double tmax = currentModel->MaxSecondaryKinEnergy(dp);
1722 tmax = std::min(tmax,(*theCuts)[currentCoupleIndex]);
1723 G4double d = 0.0;
1724 G4VEmFluctuationModel* fm = currentModel->GetModelOfFluctuations();
1725 if(fm) { d = fm->Dispersion(currentMaterial,dp,tmax,length); }
1726 return d;
1727}
G4double GetKineticEnergy() const
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double &tmax, G4double &length)=0

Referenced by G4LossTableManager::GetDEDXDispersion().

◆ GetDEDXForSubsec()

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

Definition at line 742 of file G4VEnergyLossProcess.hh.

744{
745 DefineMaterial(couple);
746 return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
747}

Referenced by G4LossTableManager::GetSubDEDX().

◆ GetKineticEnergy()

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

Definition at line 801 of file G4VEnergyLossProcess.hh.

803{
804 DefineMaterial(couple);
805 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
806}

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

◆ GetLambda()

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

Definition at line 811 of file G4VEnergyLossProcess.hh.

813{
814 DefineMaterial(couple);
815 G4double x = 0.0;
816 if(theLambdaTable) { x = GetLambdaForScaledEnergy(kineticEnergy*massRatio); }
817 return x;
818}

◆ GetMeanFreePath()

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

Implements G4VContinuousDiscreteProcess.

Definition at line 1773 of file G4VEnergyLossProcess.cc.

1778{
1780 return MeanFreePath(track);
1781}
G4double condition(const G4ErrorSymMatrix &m)
@ NotForced
G4double MeanFreePath(const G4Track &track)

Referenced by G4ePolarizedIonisation::GetMeanFreePath().

◆ GetModelByIndex()

G4VEmModel * G4VEnergyLossProcess::GetModelByIndex ( G4int  idx = 0,
G4bool  ver = false 
)

Definition at line 367 of file G4VEnergyLossProcess.cc.

368{
369 return modelManager->GetModel(idx, ver);
370}
G4VEmModel * GetModel(G4int, G4bool ver=false)

◆ GetRange()

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

Definition at line 752 of file G4VEnergyLossProcess.hh.

754{
755 G4double x = fRange;
756 if(couple != currentCouple || kineticEnergy != preStepKinEnergy) {
757 DefineMaterial(couple);
758 if(theCSDARangeTable) {
759 x = GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)
760 * reduceFactor;
761 } else if(theRangeTableForLoss) {
762 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
763 }
764 }
765 return x;
766}

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

◆ GetRangeForLoss()

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

Definition at line 785 of file G4VEnergyLossProcess.hh.

787{
788 G4double x = fRange;
789 if(couple != currentCouple || kineticEnergy != preStepKinEnergy) {
790 DefineMaterial(couple);
791 x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
792 }
793 // G4cout << "Range from " << GetProcessName()
794 // << " e= " << kineticEnergy << " r= " << x << G4endl;
795 return x;
796}

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

◆ InitialiseEnergyLossProcess()

◆ InverseRangeTable()

G4PhysicsTable * G4VEnergyLossProcess::InverseRangeTable ( ) const
inline

Definition at line 1115 of file G4VEnergyLossProcess.hh.

1116{
1117 return theInverseRangeTable;
1118}

Referenced by G4EmCalculator::PrintInverseRangeTable().

◆ IonisationTable()

G4PhysicsTable * G4VEnergyLossProcess::IonisationTable ( ) const
inline

Definition at line 1083 of file G4VEnergyLossProcess.hh.

1084{
1085 G4PhysicsTable* t = theDEDXTable;
1086 if(theIonisationTable) { t = theIonisationTable; }
1087 return t;
1088}

◆ IonisationTableForSubsec()

G4PhysicsTable * G4VEnergyLossProcess::IonisationTableForSubsec ( ) const
inline

Definition at line 1092 of file G4VEnergyLossProcess.hh.

1093{
1094 G4PhysicsTable* t = theDEDXSubTable;
1095 if(theIonisationSubTable) { t = theIonisationSubTable; }
1096 return t;
1097}

◆ IsApplicable()

◆ IsIntegral()

G4bool G4VEnergyLossProcess::IsIntegral ( ) const
inline

Definition at line 922 of file G4VEnergyLossProcess.hh.

923{
924 return integral;
925}

◆ IsIonisationProcess()

G4bool G4VEnergyLossProcess::IsIonisationProcess ( ) const
inline

Definition at line 938 of file G4VEnergyLossProcess.hh.

939{
940 return isIonisation;
941}

Referenced by G4LossTableManager::BuildPhysicsTable().

◆ LambdaPhysicsVector()

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

Definition at line 1795 of file G4VEnergyLossProcess.cc.

1797{
1798 G4PhysicsVector* v = new G4PhysicsLogVector(minKinEnergy, maxKinEnergy, nBins);
1799 v->SetSpline((G4LossTableManager::Instance())->SplineFlag());
1800 return v;
1801}

Referenced by G4ePolarizedIonisation::BuildPhysicsTable().

◆ LambdaTable()

G4PhysicsTable * G4VEnergyLossProcess::LambdaTable ( )
inline

Definition at line 1122 of file G4VEnergyLossProcess.hh.

1123{
1124 return theLambdaTable;
1125}

◆ MaxKinEnergy()

◆ MeanFreePath()

G4double G4VEnergyLossProcess::MeanFreePath ( const G4Track track)

Definition at line 1752 of file G4VEnergyLossProcess.cc.

1753{
1754 DefineMaterial(track.GetMaterialCutsCouple());
1755 preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
1756 G4double x = DBL_MAX;
1757 if(0.0 < preStepLambda) { x = 1.0/preStepLambda; }
1758 return x;
1759}
G4double GetKineticEnergy() const
const G4MaterialCutsCouple * GetMaterialCutsCouple() const

Referenced by GetMeanFreePath().

◆ MinKinEnergy()

◆ MinPrimaryEnergy()

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

◆ NumberOfModels()

G4int G4VEnergyLossProcess::NumberOfModels ( )

Definition at line 374 of file G4VEnergyLossProcess.cc.

375{
376 return modelManager->NumberOfModels();
377}
G4int NumberOfModels() const

◆ NumberOfSubCutoffRegions()

G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions ( ) const
inline

Definition at line 984 of file G4VEnergyLossProcess.hh.

985{
986 return nSCoffRegions;
987}

◆ Particle()

const G4ParticleDefinition * G4VEnergyLossProcess::Particle ( ) const
inline

Definition at line 880 of file G4VEnergyLossProcess.hh.

881{
882 return particle;
883}

Referenced by G4LossTableManager::BuildPhysicsTable().

◆ PostStepDoIt()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 1410 of file G4VEnergyLossProcess.cc.

1412{
1413 // In all cases clear number of interaction lengths
1415 mfpKinEnergy = DBL_MAX;
1416
1418 G4double finalT = track.GetKineticEnergy();
1419 if(finalT <= lowestKinEnergy) { return &fParticleChange; }
1420
1421 G4double postStepScaledEnergy = finalT*massRatio;
1422
1423 if(!currentModel->IsActive(postStepScaledEnergy)) { return &fParticleChange; }
1424 /*
1425 if(-1 < verboseLevel) {
1426 G4cout << GetProcessName()
1427 << "::PostStepDoIt: E(MeV)= " << finalT/MeV
1428 << G4endl;
1429 }
1430 */
1431
1432 // forced process - should happen only once per track
1433 if(biasFlag) {
1434 if(biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
1435 biasFlag = false;
1436 }
1437 }
1438
1439 // Integral approach
1440 if (integral) {
1441 G4double lx = GetLambdaForScaledEnergy(postStepScaledEnergy);
1442 /*
1443 if(preStepLambda<lx && 1 < verboseLevel && nWarnings<200) {
1444 G4cout << "WARNING: for " << particle->GetParticleName()
1445 << " and " << GetProcessName()
1446 << " E(MeV)= " << finalT/MeV
1447 << " preLambda= " << preStepLambda
1448 << " < " << lx << " (postLambda) "
1449 << G4endl;
1450 ++nWarnings;
1451 }
1452 */
1453 if(lx <= 0.0) {
1454 return &fParticleChange;
1455 } else if(preStepLambda*G4UniformRand() > lx) {
1456 return &fParticleChange;
1457 }
1458 }
1459
1460 SelectModel(postStepScaledEnergy);
1461
1462 // define new weight for primary and secondaries
1464 if(weightFlag) {
1465 weight /= biasFactor;
1467 }
1468
1469 const G4DynamicParticle* dynParticle = track.GetDynamicParticle();
1470 G4double tcut = (*theCuts)[currentCoupleIndex];
1471
1472 // sample secondaries
1473 secParticles.clear();
1474 //G4cout << "Energy of primary: " << dynParticle->GetKineticEnergy()/MeV<<G4endl;
1475 currentModel->SampleSecondaries(&secParticles, currentCouple, dynParticle, tcut);
1476
1477 // bremsstrahlung splitting or Russian roulette
1478 if(biasManager) {
1479 if(biasManager->SecondaryBiasingRegion(currentCoupleIndex)) {
1480 G4double eloss = 0.0;
1481 weight *= biasManager->ApplySecondaryBiasing(secParticles,
1482 track, currentModel,
1483 &fParticleChange, eloss,
1484 currentCoupleIndex, tcut,
1485 step.GetPostStepPoint()->GetSafety());
1486 if(eloss > 0.0) {
1489 }
1490 }
1491 }
1492
1493 // save secondaries
1494 G4int num = secParticles.size();
1495 if(num > 0) {
1496
1498
1499 for (G4int i=0; i<num; ++i) {
1500 if(secParticles[i]) {
1501 G4Track* t = new G4Track(secParticles[i], track.GetGlobalTime(),
1502 track.GetPosition());
1504 t->SetWeight(weight);
1505 //G4cout << "Secondary(post step) has weight " << t->GetWeight()
1506 //<< ", kenergy " << t->GetKineticEnergy()/MeV << " MeV" <<G4endl;
1508 }
1509 }
1510 }
1511
1514 if(particle->GetProcessManager()->GetAtRestProcessVector()->size() > 0)
1517 }
1518
1519 /*
1520 if(-1 < verboseLevel) {
1521 G4cout << "::PostStepDoIt: Sample secondary; Efin= "
1522 << fParticleChange.GetProposedKineticEnergy()/MeV
1523 << " MeV; model= (" << currentModel->LowEnergyLimit()
1524 << ", " << currentModel->HighEnergyLimit() << ")"
1525 << " preStepLambda= " << preStepLambda
1526 << " dir= " << track.GetMomentumDirection()
1527 << " status= " << track.GetTrackStatus()
1528 << G4endl;
1529 }
1530 */
1531 return &fParticleChange;
1532}
@ fAlive
@ fStopAndKill
@ fStopButAlive
#define G4UniformRand()
Definition: Randomize.hh:53
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)
G4bool SecondaryBiasingRegion(G4int coupleIdx)
void InitializeForPostStep(const G4Track &)
G4double GetProposedKineticEnergy() const
G4ProcessManager * GetProcessManager() const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int size() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
const G4TouchableHandle & GetTouchableHandle() const
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:293

◆ PostStepGetPhysicalInteractionLength()

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

Reimplemented from G4VContinuousDiscreteProcess.

Definition at line 933 of file G4VEnergyLossProcess.cc.

937{
938 // condition is set to "Not Forced"
940 G4double x = DBL_MAX;
941
942 // initialisation of material, mass, charge, model at the beginning of the step
943 /*
944 if(!theDensityFactor || !theDensityIdx) {
945 G4cout << "G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength 1: "
946 << theDensityFactor << " " << theDensityIdx
947 << G4endl;
948 G4cout << track.GetDefinition()->GetParticleName()
949 << " e(MeV)= " << track.GetKineticEnergy()
950 << " mat " << track.GetMaterialCutsCouple()->GetMaterial()->GetName()
951 << G4endl;
952 }
953 */
954 DefineMaterial(track.GetMaterialCutsCouple());
955 preStepKinEnergy = track.GetKineticEnergy();
956 preStepScaledEnergy = preStepKinEnergy*massRatio;
957 SelectModel(preStepScaledEnergy);
958
959 if(!currentModel->IsActive(preStepScaledEnergy)) { return x; }
960
961 // change effective charge of an ion on fly
962 if(isIon) {
963 G4double q2 = currentModel->ChargeSquareRatio(track);
964 if(q2 != chargeSqRatio) {
965 chargeSqRatio = q2;
966 fFactor = q2*biasFactor*(*theDensityFactor)[currentCoupleIndex];
967 reduceFactor = 1.0/(fFactor*massRatio);
968 }
969 }
970 // if(particle->GetPDGMass() > 0.9*GeV)
971 //G4cout << "q2= " << chargeSqRatio << " massRatio= " << massRatio << G4endl;
972 // initialisation for sampling of the interaction length
973 //if(previousStepSize <= 0.0) { theNumberOfInteractionLengthLeft = -1.0; }
974 //if(theNumberOfInteractionLengthLeft < 0.0) { mfpKinEnergy = DBL_MAX; }
975
976 // forced biasing only for primary particles
977 if(biasManager) {
978 if(0 == track.GetParentID()) {
979 if(biasFlag && biasManager->ForcedInteractionRegion(currentCoupleIndex)) {
980 return biasManager->GetStepLimit(currentCoupleIndex, previousStepSize);
981 }
982 }
983 }
984
985 // compute mean free path
986 if(preStepScaledEnergy < mfpKinEnergy) {
987 if (integral) { ComputeLambdaForScaledEnergy(preStepScaledEnergy); }
988 else { preStepLambda = GetLambdaForScaledEnergy(preStepScaledEnergy); }
989
990 // zero cross section
991 if(preStepLambda <= 0.0) {
994 }
995 }
996
997 // non-zero cross section
998 if(preStepLambda > 0.0) {
1000
1001 // beggining of tracking (or just after DoIt of this process)
1003
1004 } else if(currentInteractionLength < DBL_MAX) {
1005
1006 // subtract NumberOfInteractionLengthLeft using previous step
1008 // SubtractNumberOfInteractionLengthLeft(previousStepSize);
1011 //theNumberOfInteractionLengthLeft = perMillion;
1012 }
1013 }
1014
1015 // new mean free path and step limit
1016 currentInteractionLength = 1.0/preStepLambda;
1018
1019#ifdef G4VERBOSE
1020 if (verboseLevel>2){
1021 // if(particle->GetPDGMass() > 0.9*GeV){
1022 G4cout << "G4VEnergyLossProcess::PostStepGetPhysicalInteractionLength ";
1023 G4cout << "[ " << GetProcessName() << "]" << G4endl;
1024 G4cout << " for " << track.GetDefinition()->GetParticleName()
1025 << " in Material " << currentMaterial->GetName()
1026 << " Ekin(MeV)= " << preStepKinEnergy/MeV
1027 <<G4endl;
1028 G4cout << "MeanFreePath = " << currentInteractionLength/cm << "[cm]"
1029 << "InteractionLength= " << x/cm <<"[cm] " <<G4endl;
1030 }
1031#endif
1032 }
1033 return x;
1034}
G4double GetStepLimit(G4int coupleIdx, G4double previousStep)
const G4String & GetName() const
Definition: G4Material.hh:177
G4ParticleDefinition * GetDefinition() const
G4int GetParentID() const
virtual G4double ChargeSquareRatio(const G4Track &)
Definition: G4VEmModel.cc:254
G4double currentInteractionLength
Definition: G4VProcess.hh:297
virtual void ResetNumberOfInteractionLengthLeft()
Definition: G4VProcess.cc:92

Referenced by G4ePolarizedIonisation::PostStepGetPhysicalInteractionLength().

◆ PreparePhysicsTable()

void G4VEnergyLossProcess::PreparePhysicsTable ( const G4ParticleDefinition part)
virtual

Reimplemented from G4VProcess.

Definition at line 382 of file G4VEnergyLossProcess.cc.

383{
384 if(1 < verboseLevel) {
385 G4cout << "G4VEnergyLossProcess::PreparePhysicsTable for "
386 << GetProcessName() << " for " << part.GetParticleName()
387 << " " << this << G4endl;
388 }
389
390 currentCouple = 0;
391 preStepLambda = 0.0;
392 mfpKinEnergy = DBL_MAX;
393 fRange = DBL_MAX;
394 preStepKinEnergy = 0.0;
395 chargeSqRatio = 1.0;
396 massRatio = 1.0;
397 reduceFactor = 1.0;
398 fFactor = 1.0;
399
401
402 // Are particle defined?
403 if( !particle ) { particle = &part; }
404
405 if(part.GetParticleType() == "nucleus") {
406
407 G4String pname = part.GetParticleName();
408 if(pname != "deuteron" && pname != "triton" &&
409 pname != "alpha+" && pname != "helium" &&
410 pname != "hydrogen") {
411
412 theGenericIon = G4GenericIon::GenericIon();
413 isIon = true;
414 // process is shared between all ions inheriting G4GenericIon
415 // for all excluding He3 and alpha
416 if(pname != "He3" && pname != "alpha") { particle = theGenericIon; }
417 }
418 }
419
420 if( particle != &part ) {
421 if(isIon) {
422 lManager->RegisterIon(&part, this);
423 } else {
424 lManager->RegisterExtraParticle(&part, this);
425 }
426 if(1 < verboseLevel) {
427 G4cout << "### G4VEnergyLossProcess::PreparePhysicsTable() interrupted for "
428 << part.GetParticleName() << " isIon= " << isIon
429 << " particle " << particle << " GenericIon " << theGenericIon
430 << G4endl;
431 }
432 return;
433 }
434
435 Clean();
436 lManager->PreparePhysicsTable(&part, this);
437 G4LossTableBuilder* bld = lManager->GetTableBuilder();
438
439 // Base particle and set of models can be defined here
440 InitialiseEnergyLossProcess(particle, baseParticle);
441
442 const G4ProductionCutsTable* theCoupleTable=
444 size_t n = theCoupleTable->GetTableSize();
445
446 theDEDXAtMaxEnergy.resize(n, 0.0);
447 theRangeAtMaxEnergy.resize(n, 0.0);
448 theEnergyOfCrossSectionMax.resize(n, 0.0);
449 theCrossSectionMax.resize(n, DBL_MAX);
450
451 // Tables preparation
452 if (!baseParticle) {
453
454 theDEDXTable = G4PhysicsTableHelper::PreparePhysicsTable(theDEDXTable);
455 bld->InitialiseBaseMaterials(theDEDXTable);
456
457 if (lManager->BuildCSDARange()) {
458 theDEDXunRestrictedTable =
459 G4PhysicsTableHelper::PreparePhysicsTable(theDEDXunRestrictedTable);
460 theCSDARangeTable =
462 }
463
464 theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
465 bld->InitialiseBaseMaterials(theLambdaTable);
466
467 if(isIonisation) {
468 theRangeTableForLoss =
469 G4PhysicsTableHelper::PreparePhysicsTable(theRangeTableForLoss);
470 theInverseRangeTable =
471 G4PhysicsTableHelper::PreparePhysicsTable(theInverseRangeTable);
472 }
473
474 if (nSCoffRegions) {
475 theDEDXSubTable =
477 theSubLambdaTable =
479 }
480 }
481
482 theDensityFactor = bld->GetDensityFactors();
483 theDensityIdx = bld->GetCoupleIndexes();
484
485 // forced biasing
486 if(biasManager) {
487 biasManager->Initialise(part,GetProcessName(),verboseLevel);
488 biasFlag = false;
489 }
490
491 G4double initialCharge = particle->GetPDGCharge();
492 G4double initialMass = particle->GetPDGMass();
493
494 if (baseParticle) {
495 massRatio = (baseParticle->GetPDGMass())/initialMass;
496 G4double q = initialCharge/baseParticle->GetPDGCharge();
497 chargeSqRatio = q*q;
498 if(chargeSqRatio > 0.0) { reduceFactor = 1.0/(chargeSqRatio*massRatio); }
499 }
500
501 // initialisation of models
502 G4int nmod = modelManager->NumberOfModels();
503 for(G4int i=0; i<nmod; ++i) {
504 G4VEmModel* mod = modelManager->GetModel(i);
505 if(mod->HighEnergyLimit() > maxKinEnergy) {
506 mod->SetHighEnergyLimit(maxKinEnergy);
507 }
508 }
509
510 theCuts = modelManager->Initialise(particle, secondaryParticle,
511 minSubRange, verboseLevel);
512
513 // Sub Cutoff
514 if (nSCoffRegions>0) {
515 theSubCuts = modelManager->SubCutoff();
516
517 if(nSCoffRegions>0) { idxSCoffRegions = new G4bool[n]; }
518 for (size_t j=0; j<n; ++j) {
519
520 const G4MaterialCutsCouple* couple =
521 theCoupleTable->GetMaterialCutsCouple(j);
522 const G4ProductionCuts* pcuts = couple->GetProductionCuts();
523
524 if(nSCoffRegions>0) {
525 G4bool reg = false;
526 for(G4int i=0; i<nSCoffRegions; ++i) {
527 if( pcuts == scoffRegions[i]->GetProductionCuts()) { reg = true; }
528 }
529 idxSCoffRegions[j] = reg;
530 }
531 }
532 }
533
534 if(1 < verboseLevel) {
535 G4cout << "G4VEnergyLossProcess::Initialise() is done "
536 << " for local " << particle->GetParticleName()
537 << " isIon= " << isIon;
538 if(baseParticle) { G4cout << "; base: " << baseParticle->GetParticleName(); }
539 G4cout << " chargeSqRatio= " << chargeSqRatio
540 << " massRatio= " << massRatio
541 << " reduceFactor= " << reduceFactor << G4endl;
542 if (nSCoffRegions) {
543 G4cout << " SubCutoff Regime is ON for regions: " << G4endl;
544 for (G4int i=0; i<nSCoffRegions; ++i) {
545 const G4Region* r = scoffRegions[i];
546 G4cout << " " << r->GetName() << G4endl;
547 }
548 }
549 }
550}
void Initialise(const G4ParticleDefinition &part, const G4String &procName, G4int verbose)
const G4DataVector * SubCutoff() const
const G4DataVector * Initialise(const G4ParticleDefinition *, const G4ParticleDefinition *, G4double, G4int)
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:92
const std::vector< G4double > * GetDensityFactors()
void InitialiseBaseMaterials(G4PhysicsTable *table)
const std::vector< G4int > * GetCoupleIndexes()
void RegisterIon(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
G4LossTableBuilder * GetTableBuilder()
G4bool BuildCSDARange() const
void PreparePhysicsTable(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
void RegisterExtraParticle(const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
const G4String & GetParticleType() const
G4double GetPDGCharge() const
const G4String & GetName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:585
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:522
virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition *, const G4ParticleDefinition *)=0

◆ PrintInfo()

◆ PrintInfoDefinition()

void G4VEnergyLossProcess::PrintInfoDefinition ( )

Definition at line 772 of file G4VEnergyLossProcess.cc.

773{
774 if(0 < verboseLevel) {
775 G4cout << G4endl << GetProcessName() << ": for "
776 << particle->GetParticleName()
777 << " SubType= " << GetProcessSubType()
778 << G4endl
779 << " dE/dx and range tables from "
780 << G4BestUnit(minKinEnergy,"Energy")
781 << " to " << G4BestUnit(maxKinEnergy,"Energy")
782 << " in " << nBins << " bins" << G4endl
783 << " Lambda tables from threshold to "
784 << G4BestUnit(maxKinEnergy,"Energy")
785 << " in " << nBins << " bins, spline: "
786 << (G4LossTableManager::Instance())->SplineFlag()
787 << G4endl;
788 if(theRangeTableForLoss && isIonisation) {
789 G4cout << " finalRange(mm)= " << finalRange/mm
790 << ", dRoverRange= " << dRoverRange
791 << ", integral: " << integral
792 << ", fluct: " << lossFluctuationFlag
793 << ", linLossLimit= " << linLossLimit
794 << G4endl;
795 }
796 PrintInfo();
797 modelManager->DumpModelList(verboseLevel);
798 if(theCSDARangeTable && isIonisation) {
799 G4cout << " CSDA range table up"
800 << " to " << G4BestUnit(maxKinEnergyCSDA,"Energy")
801 << " in " << nBinsCSDA << " bins" << G4endl;
802 }
803 if(nSCoffRegions>0 && isIonisation) {
804 G4cout << " Subcutoff sampling in " << nSCoffRegions
805 << " regions" << G4endl;
806 }
807 if(2 < verboseLevel) {
808 G4cout << " DEDXTable address= " << theDEDXTable << G4endl;
809 if(theDEDXTable && isIonisation) G4cout << (*theDEDXTable) << G4endl;
810 G4cout << "non restricted DEDXTable address= "
811 << theDEDXunRestrictedTable << G4endl;
812 if(theDEDXunRestrictedTable && isIonisation) {
813 G4cout << (*theDEDXunRestrictedTable) << G4endl;
814 }
815 if(theDEDXSubTable && isIonisation) {
816 G4cout << (*theDEDXSubTable) << G4endl;
817 }
818 G4cout << " CSDARangeTable address= " << theCSDARangeTable
819 << G4endl;
820 if(theCSDARangeTable && isIonisation) {
821 G4cout << (*theCSDARangeTable) << G4endl;
822 }
823 G4cout << " RangeTableForLoss address= " << theRangeTableForLoss
824 << G4endl;
825 if(theRangeTableForLoss && isIonisation) {
826 G4cout << (*theRangeTableForLoss) << G4endl;
827 }
828 G4cout << " InverseRangeTable address= " << theInverseRangeTable
829 << G4endl;
830 if(theInverseRangeTable && isIonisation) {
831 G4cout << (*theInverseRangeTable) << G4endl;
832 }
833 G4cout << " LambdaTable address= " << theLambdaTable << G4endl;
834 if(theLambdaTable && isIonisation) {
835 G4cout << (*theLambdaTable) << G4endl;
836 }
837 G4cout << " SubLambdaTable address= " << theSubLambdaTable << G4endl;
838 if(theSubLambdaTable && isIonisation) {
839 G4cout << (*theSubLambdaTable) << G4endl;
840 }
841 }
842 }
843}
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void DumpModelList(G4int verb)
virtual void PrintInfo()=0
G4int GetProcessSubType() const
Definition: G4VProcess.hh:397

Referenced by BuildPhysicsTable().

◆ RangeTableForLoss()

G4PhysicsTable * G4VEnergyLossProcess::RangeTableForLoss ( ) const
inline

Definition at line 1108 of file G4VEnergyLossProcess.hh.

1109{
1110 return theRangeTableForLoss;
1111}

Referenced by G4EmCalculator::PrintRangeTable().

◆ RetrievePhysicsTable()

G4bool G4VEnergyLossProcess::RetrievePhysicsTable ( const G4ParticleDefinition part,
const G4String directory,
G4bool  ascii 
)
virtual

Reimplemented from G4VProcess.

Definition at line 1596 of file G4VEnergyLossProcess.cc.

1599{
1600 G4bool res = true;
1601 const G4String particleName = part->GetParticleName();
1602
1603 if(1 < verboseLevel) {
1604 G4cout << "G4VEnergyLossProcess::RetrievePhysicsTable() for "
1605 << particleName << " and process " << GetProcessName()
1606 << "; tables_are_built= " << tablesAreBuilt
1607 << G4endl;
1608 }
1609 if(particle == part) {
1610
1611 if ( !baseParticle ) {
1612
1613 G4bool fpi = true;
1614 if(!RetrieveTable(part,theDEDXTable,ascii,directory,"DEDX",fpi))
1615 {fpi = false;}
1616
1617 // ionisation table keeps individual dEdx and not sum of sub-processes
1618 if(!RetrieveTable(part,theDEDXTable,ascii,directory,"Ionisation",false))
1619 {fpi = false;}
1620
1621 if(!RetrieveTable(part,theRangeTableForLoss,ascii,directory,"Range",fpi))
1622 {res = false;}
1623
1624 if(!RetrieveTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr",false))
1625 {res = false;}
1626
1627 if(!RetrieveTable(part,theCSDARangeTable,ascii,directory,"CSDARange",false))
1628 {res = false;}
1629
1630 if(!RetrieveTable(part,theInverseRangeTable,ascii,directory,"InverseRange",fpi))
1631 {res = false;}
1632
1633 if(!RetrieveTable(part,theLambdaTable,ascii,directory,"Lambda",true))
1634 {res = false;}
1635
1636 G4bool yes = false;
1637 if(nSCoffRegions > 0) {yes = true;}
1638
1639 if(!RetrieveTable(part,theDEDXSubTable,ascii,directory,"SubDEDX",yes))
1640 {res = false;}
1641
1642 if(!RetrieveTable(part,theSubLambdaTable,ascii,directory,"SubLambda",yes))
1643 {res = false;}
1644
1645 if(!fpi) yes = false;
1646 if(!RetrieveTable(part,theIonisationSubTable,ascii,directory,"SubIonisation",yes))
1647 {res = false;}
1648 }
1649 }
1650
1651 return res;
1652}

◆ SampleSubCutSecondaries()

G4double G4VEnergyLossProcess::SampleSubCutSecondaries ( std::vector< G4Track * > &  tracks,
const G4Step step,
G4VEmModel model,
G4int  matIdx 
)

Definition at line 1318 of file G4VEnergyLossProcess.cc.

1322{
1323 // Fast check weather subcutoff can work
1324 G4double esec = 0.0;
1325 G4double subcut = (*theSubCuts)[idx];
1326 G4double cut = (*theCuts)[idx];
1327 if(cut <= subcut) { return esec; }
1328
1329 const G4Track* track = step.GetTrack();
1330 const G4DynamicParticle* dp = track->GetDynamicParticle();
1331 G4double e = dp->GetKineticEnergy()*massRatio;
1332 G4double cross = (*theDensityFactor)[idx]*chargeSqRatio
1333 *(((*theSubLambdaTable)[(*theDensityIdx)[idx]])->Value(e));
1334 G4double length = step.GetStepLength();
1335
1336 // negligible probability to get any interaction
1337 if(length*cross < perMillion) { return esec; }
1338 /*
1339 if(-1 < verboseLevel)
1340 G4cout << "<<< Subcutoff for " << GetProcessName()
1341 << " cross(1/mm)= " << cross*mm << ">>>"
1342 << " e(MeV)= " << preStepScaledEnergy
1343 << " matIdx= " << currentCoupleIndex
1344 << G4endl;
1345 */
1346
1347 // Sample subcutoff secondaries
1348 G4StepPoint* preStepPoint = step.GetPreStepPoint();
1349 G4StepPoint* postStepPoint = step.GetPostStepPoint();
1350 G4ThreeVector prepoint = preStepPoint->GetPosition();
1351 G4ThreeVector dr = postStepPoint->GetPosition() - prepoint;
1352 G4double pretime = preStepPoint->GetGlobalTime();
1353 G4double dt = postStepPoint->GetGlobalTime() - pretime;
1354 //G4double dt = length/preStepPoint->GetVelocity();
1355 G4double fragment = 0.0;
1356
1357 do {
1358 G4double del = -std::log(G4UniformRand())/cross;
1359 fragment += del/length;
1360 if (fragment > 1.0) break;
1361
1362 // sample secondaries
1363 secParticles.clear();
1364 model->SampleSecondaries(&secParticles,track->GetMaterialCutsCouple(),
1365 dp,subcut,cut);
1366
1367 // position of subcutoff particles
1368 G4ThreeVector r = prepoint + fragment*dr;
1369 std::vector<G4DynamicParticle*>::iterator it;
1370 for(it=secParticles.begin(); it!=secParticles.end(); ++it) {
1371
1372 G4bool addSec = true;
1373 /*
1374 // do not track very low-energy delta-electrons
1375 if(theSecondaryRangeTable && (*it)->GetParticleDefinition() == theElectron) {
1376 G4double ekin = (*it)->GetKineticEnergy();
1377 G4double rg = ((*theSecondaryRangeTable)[idx]->Value(ekin));
1378 // if(rg < currentMinSafety) {
1379 if(rg < safetyHelper->ComputeSafety(r)) {
1380 extraEdep += ekin;
1381 delete (*it);
1382 addSec = false;
1383 }
1384 }
1385 */
1386 if(addSec) {
1387 G4Track* t = new G4Track((*it), pretime + fragment*dt, r);
1389 tracks.push_back(t);
1390 esec += t->GetKineticEnergy();
1391 if (t->GetParticleDefinition() == thePositron) {
1392 esec += 2.0*electron_mass_c2;
1393 }
1394
1395 /*
1396 if(-1 < verboseLevel)
1397 G4cout << "New track " << t->GetParticleDefinition()->GetParticleName()
1398 << " e(keV)= " << t->GetKineticEnergy()/keV
1399 << " fragment= " << fragment
1400 << G4endl;
1401 */
1402 }
1403 }
1404 } while (fragment <= 1.0);
1405 return esec;
1406}
G4double GetGlobalTime() const
G4Track * GetTrack() const

Referenced by AlongStepDoIt().

◆ SecondaryParticle()

const G4ParticleDefinition * G4VEnergyLossProcess::SecondaryParticle ( ) const
inline

Definition at line 894 of file G4VEnergyLossProcess.hh.

895{
896 return secondaryParticle;
897}

◆ SelectModel()

void G4VEnergyLossProcess::SelectModel ( G4double  kinEnergy)
inlineprotected

Definition at line 598 of file G4VEnergyLossProcess.hh.

599{
600 currentModel = modelManager->SelectModel(kinEnergy, currentCoupleIndex);
601 currentModel->SetCurrentCouple(currentCouple);
602}
G4VEmModel * SelectModel(G4double &energy, size_t &index)
void SetCurrentCouple(const G4MaterialCutsCouple *)
Definition: G4VEmModel.hh:370

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

◆ SelectModelForMaterial()

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

Definition at line 606 of file G4VEnergyLossProcess.hh.

608{
609 return modelManager->SelectModel(kinEnergy, idx);
610}

Referenced by G4ContinuousGainOfEnergy::GetContinuousStepLimit().

◆ SetBaseParticle()

◆ SetCrossSectionBiasingFactor()

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

Definition at line 2040 of file G4VEnergyLossProcess.cc.

2042{
2043 if(f > 0.0) {
2044 biasFactor = f;
2045 weightFlag = flag;
2046 if(1 < verboseLevel) {
2047 G4cout << "### SetCrossSectionBiasingFactor: for "
2048 << " process " << GetProcessName()
2049 << " biasFactor= " << f << " weightFlag= " << flag
2050 << G4endl;
2051 }
2052 }
2053}

Referenced by G4EmProcessOptions::SetProcessBiasingFactor().

◆ SetCSDARangeTable()

void G4VEnergyLossProcess::SetCSDARangeTable ( G4PhysicsTable pRange)

Definition at line 1892 of file G4VEnergyLossProcess.cc.

1893{
1894 if(theCSDARangeTable != p) { theCSDARangeTable = p; }
1895
1896 if(p) {
1897 size_t n = p->length();
1898 G4PhysicsVector* pv;
1899 G4double emax = maxKinEnergyCSDA;
1900
1901 for (size_t i=0; i<n; ++i) {
1902 pv = (*p)[i];
1903 G4double rmax = 0.0;
1904 if(pv) { rmax = pv->Value(emax); }
1905 else {
1906 pv = (*p)[(*theDensityIdx)[i]];
1907 if(pv) { rmax = pv->Value(emax)/(*theDensityFactor)[i]; }
1908 }
1909 theRangeAtMaxEnergy[i] = rmax;
1910 //G4cout << "i= " << i << " Emax(MeV)= " << emax/MeV << " Rmax= "
1911 //<< rmax<< G4endl;
1912 }
1913 }
1914}
G4double Value(G4double theEnergy)

◆ SetDEDXBinning()

void G4VEnergyLossProcess::SetDEDXBinning ( G4int  nbins)
inline

Definition at line 991 of file G4VEnergyLossProcess.hh.

992{
993 nBins = nbins;
994}

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

◆ SetDEDXBinningForCSDARange()

void G4VEnergyLossProcess::SetDEDXBinningForCSDARange ( G4int  nbins)
inline

Definition at line 1005 of file G4VEnergyLossProcess.hh.

1006{
1007 nBinsCSDA = nbins;
1008}

◆ SetDEDXTable()

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

Definition at line 1831 of file G4VEnergyLossProcess.cc.

1832{
1833 if(fTotal == tType && theDEDXunRestrictedTable != p && !baseParticle) {
1834 if(theDEDXunRestrictedTable) {
1835 theDEDXunRestrictedTable->clearAndDestroy();
1836 delete theDEDXunRestrictedTable;
1837 }
1838 theDEDXunRestrictedTable = p;
1839 if(p) {
1840 size_t n = p->length();
1841 G4PhysicsVector* pv = (*p)[0];
1842 G4double emax = maxKinEnergyCSDA;
1843
1844 for (size_t i=0; i<n; ++i) {
1845 G4double dedx = 0.0;
1846 pv = (*p)[i];
1847 if(pv) { dedx = pv->Value(emax); }
1848 else {
1849 pv = (*p)[(*theDensityIdx)[i]];
1850 if(pv) { dedx = pv->Value(emax)*(*theDensityFactor)[i]; }
1851 }
1852 theDEDXAtMaxEnergy[i] = dedx;
1853 //G4cout << "i= " << i << " emax(MeV)= " << emax/MeV<< " dedx= "
1854 //<< dedx << G4endl;
1855 }
1856 }
1857
1858 } else if(fRestricted == tType && theDEDXTable != p) {
1859 //G4cout << "G4VEnergyLossProcess::SetDEDXTable " << particle->GetParticleName()
1860 // << " old table " << theDEDXTable << " new table " << p
1861 // << " ion " << theIonisationTable << " bp " << baseParticle << G4endl;
1862 if(theDEDXTable && !baseParticle) {
1863 if(theDEDXTable == theIonisationTable) { theIonisationTable = 0; }
1864 theDEDXTable->clearAndDestroy();
1865 delete theDEDXTable;
1866 }
1867 theDEDXTable = p;
1868 } else if(fSubRestricted == tType && theDEDXSubTable != p) {
1869 if(theDEDXSubTable && !baseParticle) {
1870 if(theDEDXSubTable == theIonisationSubTable) { theIonisationSubTable = 0; }
1871 theDEDXSubTable->clearAndDestroy();
1872 delete theDEDXSubTable;
1873 }
1874 theDEDXSubTable = p;
1875 } else if(fIsIonisation == tType && theIonisationTable != p) {
1876 if(theIonisationTable && theIonisationTable != theDEDXTable && !baseParticle) {
1877 theIonisationTable->clearAndDestroy();
1878 delete theIonisationTable;
1879 }
1880 theIonisationTable = p;
1881 } else if(fIsSubIonisation == tType && theIonisationSubTable != p) {
1882 if(theIonisationSubTable && theIonisationSubTable != theDEDXSubTable && !baseParticle) {
1883 theIonisationSubTable->clearAndDestroy();
1884 delete theIonisationSubTable;
1885 }
1886 theIonisationSubTable = p;
1887 }
1888}
@ fIsSubIonisation
@ fIsIonisation
size_t length() const

◆ SetDynamicMassCharge()

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

Definition at line 630 of file G4VEnergyLossProcess.hh.

632{
633 massRatio = massratio;
634 fFactor *= charge2ratio/chargeSqRatio;
635 chargeSqRatio = charge2ratio;
636 reduceFactor = 1.0/(fFactor*massRatio);
637}

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

◆ SetEmModel()

◆ SetFluctModel()

◆ SetIntegral()

void G4VEnergyLossProcess::SetIntegral ( G4bool  val)
inline

Definition at line 915 of file G4VEnergyLossProcess.hh.

916{
917 integral = val;
918}

Referenced by G4LossTableManager::Register().

◆ SetInverseRangeTable()

void G4VEnergyLossProcess::SetInverseRangeTable ( G4PhysicsTable p)

Definition at line 1946 of file G4VEnergyLossProcess.cc.

1947{
1948 if(theInverseRangeTable != p) {
1949 theInverseRangeTable = p;
1950 if(1 < verboseLevel) {
1951 G4cout << "### Set InverseRange table " << p
1952 << " for " << particle->GetParticleName()
1953 << " and process " << GetProcessName() << G4endl;
1954 }
1955 }
1956}

◆ SetIonisation()

◆ SetLambdaBinning()

void G4VEnergyLossProcess::SetLambdaBinning ( G4int  nbins)
inline

Definition at line 998 of file G4VEnergyLossProcess.hh.

999{
1000 nBins = nbins;
1001}

◆ SetLambdaFactor()

void G4VEnergyLossProcess::SetLambdaFactor ( G4double  val)
inline

Definition at line 959 of file G4VEnergyLossProcess.hh.

960{
961 if(val > 0.0 && val <= 1.0) { lambdaFactor = val; }
962}

Referenced by G4EmProcessOptions::SetLambdaFactor().

◆ SetLambdaTable()

void G4VEnergyLossProcess::SetLambdaTable ( G4PhysicsTable p)

Definition at line 1960 of file G4VEnergyLossProcess.cc.

1961{
1962 if(1 < verboseLevel) {
1963 G4cout << "### Set Lambda table " << p
1964 << " for " << particle->GetParticleName()
1965 << " and process " << GetProcessName() << G4endl;
1966 }
1967 if(theLambdaTable != p) { theLambdaTable = p; }
1968 tablesAreBuilt = true;
1969
1970 if(theLambdaTable) {
1971 size_t n = theLambdaTable->length();
1972 G4PhysicsVector* pv = (*theLambdaTable)[0];
1973 G4double e, ss, smax, emax;
1974
1975 size_t i;
1976
1977 // first loop on existing vectors
1978 for (i=0; i<n; ++i) {
1979 pv = (*theLambdaTable)[i];
1980 if(pv) {
1981 size_t nb = pv->GetVectorLength();
1982 emax = DBL_MAX;
1983 smax = 0.0;
1984 if(nb > 0) {
1985 for (size_t j=0; j<nb; ++j) {
1986 e = pv->Energy(j);
1987 ss = (*pv)(j);
1988 if(ss > smax) {
1989 smax = ss;
1990 emax = e;
1991 }
1992 }
1993 }
1994 theEnergyOfCrossSectionMax[i] = emax;
1995 theCrossSectionMax[i] = smax;
1996 if(1 < verboseLevel) {
1997 G4cout << "For " << particle->GetParticleName()
1998 << " Max CS at i= " << i << " emax(MeV)= " << emax/MeV
1999 << " lambda= " << smax << G4endl;
2000 }
2001 }
2002 }
2003 // second loop using base materials
2004 for (i=0; i<n; ++i) {
2005 pv = (*theLambdaTable)[i];
2006 if(!pv){
2007 G4int j = (*theDensityIdx)[i];
2008 theEnergyOfCrossSectionMax[i] = theEnergyOfCrossSectionMax[j];
2009 theCrossSectionMax[i] = (*theDensityFactor)[i]*theCrossSectionMax[j];
2010 }
2011 }
2012 }
2013}
size_t GetVectorLength() const
G4double Energy(size_t index) const

◆ SetLinearLossLimit()

void G4VEnergyLossProcess::SetLinearLossLimit ( G4double  val)
inline

Definition at line 945 of file G4VEnergyLossProcess.hh.

946{
947 linLossLimit = val;
948}

Referenced by G4alphaIonisation::G4alphaIonisation(), and G4ionIonisation::G4ionIonisation().

◆ SetLossFluctuations()

void G4VEnergyLossProcess::SetLossFluctuations ( G4bool  val)
inline

Definition at line 901 of file G4VEnergyLossProcess.hh.

902{
903 lossFluctuationFlag = val;
904}

Referenced by G4LossTableManager::Register().

◆ SetLowestEnergyLimit()

void G4VEnergyLossProcess::SetLowestEnergyLimit ( G4double  val)
inline

Definition at line 977 of file G4VEnergyLossProcess.hh.

978{
979 lowestKinEnergy = val;
980}

◆ SetMaxKinEnergy()

void G4VEnergyLossProcess::SetMaxKinEnergy ( G4double  e)
inline

Definition at line 1026 of file G4VEnergyLossProcess.hh.

1027{
1028 maxKinEnergy = e;
1029 if(e < maxKinEnergyCSDA) { maxKinEnergyCSDA = e; }
1030}

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

◆ SetMaxKinEnergyForCSDARange()

void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange ( G4double  e)
inline

Definition at line 1041 of file G4VEnergyLossProcess.hh.

1042{
1043 maxKinEnergyCSDA = e;
1044}

◆ SetMinKinEnergy()

void G4VEnergyLossProcess::SetMinKinEnergy ( G4double  e)
inline

◆ SetMinSubRange()

void G4VEnergyLossProcess::SetMinSubRange ( G4double  val)
inline

Definition at line 952 of file G4VEnergyLossProcess.hh.

953{
954 minSubRange = val;
955}

◆ SetParticle()

void G4VEnergyLossProcess::SetParticle ( const G4ParticleDefinition p)
inlineprotected

Definition at line 859 of file G4VEnergyLossProcess.hh.

860{
861 particle = p;
862}

◆ SetRandomStep()

void G4VEnergyLossProcess::SetRandomStep ( G4bool  val)
inline

Definition at line 908 of file G4VEnergyLossProcess.hh.

909{
910 rndmStepFlag = val;
911}

Referenced by G4LossTableManager::Register().

◆ SetRangeTableForLoss()

void G4VEnergyLossProcess::SetRangeTableForLoss ( G4PhysicsTable p)

Definition at line 1918 of file G4VEnergyLossProcess.cc.

1919{
1920 if(theRangeTableForLoss != p) {
1921 theRangeTableForLoss = p;
1922 if(1 < verboseLevel) {
1923 G4cout << "### Set Range table " << p
1924 << " for " << particle->GetParticleName()
1925 << " and process " << GetProcessName() << G4endl;
1926 }
1927 }
1928}

◆ SetSecondaryParticle()

◆ SetSecondaryRangeTable()

void G4VEnergyLossProcess::SetSecondaryRangeTable ( G4PhysicsTable p)

Definition at line 1932 of file G4VEnergyLossProcess.cc.

1933{
1934 if(theSecondaryRangeTable != p) {
1935 theSecondaryRangeTable = p;
1936 if(1 < verboseLevel) {
1937 G4cout << "### Set SecondaryRange table " << p
1938 << " for " << particle->GetParticleName()
1939 << " and process " << GetProcessName() << G4endl;
1940 }
1941 }
1942}

◆ SetStepFunction()

◆ SetSubLambdaTable()

void G4VEnergyLossProcess::SetSubLambdaTable ( G4PhysicsTable p)

Definition at line 2017 of file G4VEnergyLossProcess.cc.

2018{
2019 if(theSubLambdaTable != p) {
2020 theSubLambdaTable = p;
2021 if(1 < verboseLevel) {
2022 G4cout << "### Set SebLambda table " << p
2023 << " for " << particle->GetParticleName()
2024 << " and process " << GetProcessName() << G4endl;
2025 }
2026 }
2027}

◆ StartTracking()

void G4VEnergyLossProcess::StartTracking ( G4Track track)
virtual

Reimplemented from G4VProcess.

Definition at line 874 of file G4VEnergyLossProcess.cc.

875{
876 // reset parameters for the new track
878 mfpKinEnergy = DBL_MAX;
879
880 // reset ion
881 if(isIon) {
882 chargeSqRatio = 0.5;
883
884 G4double newmass = track->GetDefinition()->GetPDGMass();
885 if(baseParticle) {
886 massRatio = baseParticle->GetPDGMass()/newmass;
887 } else {
888 massRatio = proton_mass_c2/newmass;
889 }
890 }
891 // forced biasing only for primary particles
892 if(biasManager) {
893 if(0 == track->GetParentID()) {
894 // primary particle
895 biasFlag = true;
896 biasManager->ResetForcedInteraction();
897 }
898 }
899}

◆ StorePhysicsTable()

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

Reimplemented from G4VProcess.

Definition at line 1536 of file G4VEnergyLossProcess.cc.

1539{
1540 G4bool res = true;
1541 if ( baseParticle || part != particle ) return res;
1542
1543 if(!StoreTable(part,theDEDXTable,ascii,directory,"DEDX"))
1544 {res = false;}
1545
1546 if(!StoreTable(part,theDEDXunRestrictedTable,ascii,directory,"DEDXnr"))
1547 {res = false;}
1548
1549 if(!StoreTable(part,theDEDXSubTable,ascii,directory,"SubDEDX"))
1550 {res = false;}
1551
1552 if(!StoreTable(part,theIonisationTable,ascii,directory,"Ionisation"))
1553 {res = false;}
1554
1555 if(!StoreTable(part,theIonisationSubTable,ascii,directory,"SubIonisation"))
1556 {res = false;}
1557
1558 if(isIonisation &&
1559 !StoreTable(part,theCSDARangeTable,ascii,directory,"CSDARange"))
1560 {res = false;}
1561
1562 if(isIonisation &&
1563 !StoreTable(part,theRangeTableForLoss,ascii,directory,"Range"))
1564 {res = false;}
1565
1566 if(isIonisation &&
1567 !StoreTable(part,theInverseRangeTable,ascii,directory,"InverseRange"))
1568 {res = false;}
1569
1570 if(!StoreTable(part,theLambdaTable,ascii,directory,"Lambda"))
1571 {res = false;}
1572
1573 if(!StoreTable(part,theSubLambdaTable,ascii,directory,"SubLambda"))
1574 {res = false;}
1575
1576 if ( res ) {
1577 if(0 < verboseLevel) {
1578 G4cout << "Physics tables are stored for " << particle->GetParticleName()
1579 << " and process " << GetProcessName()
1580 << " in the directory <" << directory
1581 << "> " << G4endl;
1582 }
1583 } else {
1584 G4cout << "Fail to store Physics Tables for "
1585 << particle->GetParticleName()
1586 << " and process " << GetProcessName()
1587 << " in the directory <" << directory
1588 << "> " << G4endl;
1589 }
1590 return res;
1591}

◆ SubLambdaTable()

G4PhysicsTable * G4VEnergyLossProcess::SubLambdaTable ( )
inline

Definition at line 1129 of file G4VEnergyLossProcess.hh.

1130{
1131 return theSubLambdaTable;
1132}

◆ TablesAreBuilt()

G4bool G4VEnergyLossProcess::TablesAreBuilt ( ) const
inline

Definition at line 1055 of file G4VEnergyLossProcess.hh.

1056{
1057 return tablesAreBuilt;
1058}

◆ UpdateEmModel()

void G4VEnergyLossProcess::UpdateEmModel ( const G4String nam,
G4double  emin,
G4double  emax 
)

Definition at line 341 of file G4VEnergyLossProcess.cc.

343{
344 modelManager->UpdateEmModel(nam, emin, emax);
345}
void UpdateEmModel(const G4String &, G4double, G4double)

Member Data Documentation

◆ fParticleChange

G4ParticleChangeForLoss G4VEnergyLossProcess::fParticleChange
protected

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