File indexing completed on 2025-02-23 09:20:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #include "G4ElectronCapture.hh"
0041 #include "G4SystemOfUnits.hh"
0042 #include "G4ParticleDefinition.hh"
0043 #include "G4Step.hh"
0044 #include "G4Track.hh"
0045 #include "G4Region.hh"
0046 #include "G4RegionStore.hh"
0047 #include "G4Electron.hh"
0048
0049
0050
0051 G4ElectronCapture::G4ElectronCapture(const G4String& regName, G4double ekinlim)
0052 : G4VDiscreteProcess("eCapture", fElectromagnetic), kinEnergyThreshold(ekinlim),
0053 regionName(regName), region(0)
0054 {
0055 if(regName == "" || regName == "world") {
0056 regionName = "DefaultRegionForTheWorld";
0057 }
0058 pParticleChange = &fParticleChange;
0059 }
0060
0061
0062
0063 G4ElectronCapture::~G4ElectronCapture()
0064 {}
0065
0066
0067
0068 void G4ElectronCapture::SetKinEnergyLimit(G4double val)
0069 {
0070 kinEnergyThreshold = val;
0071 if(verboseLevel > 0) {
0072 G4cout << "### G4ElectronCapture: Tracking cut E(MeV) = "
0073 << kinEnergyThreshold/MeV << G4endl;
0074 }
0075 }
0076
0077
0078 void G4ElectronCapture::BuildPhysicsTable(const G4ParticleDefinition&)
0079 {
0080 region = (G4RegionStore::GetInstance())->GetRegion(regionName);
0081 if(region && verboseLevel > 0) {
0082 G4cout << "### G4ElectronCapture: Tracking cut E(MeV) = "
0083 << kinEnergyThreshold/MeV << " is assigned to " << regionName
0084 << G4endl;
0085 }
0086 }
0087
0088
0089
0090 G4bool G4ElectronCapture::IsApplicable(const G4ParticleDefinition&)
0091 {
0092 return true;
0093 }
0094
0095 G4double
0096 G4ElectronCapture::PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
0097 G4double,
0098 G4ForceCondition* condition)
0099 {
0100
0101 *condition = NotForced;
0102
0103 G4double limit = DBL_MAX;
0104 if(region) {
0105 if(aTrack.GetVolume()->GetLogicalVolume()->GetRegion() == region &&
0106 aTrack.GetKineticEnergy() < kinEnergyThreshold) { limit = 0.0; }
0107 }
0108 return limit;
0109 }
0110
0111
0112
0113 G4VParticleChange* G4ElectronCapture::PostStepDoIt(const G4Track& aTrack,
0114 const G4Step&)
0115 {
0116 pParticleChange->Initialize(aTrack);
0117 pParticleChange->ProposeTrackStatus(fStopAndKill);
0118 pParticleChange->ProposeLocalEnergyDeposit(aTrack.GetKineticEnergy());
0119 fParticleChange.SetProposedKineticEnergy(0.0);
0120 return pParticleChange;
0121 }
0122
0123
0124
0125 G4double G4ElectronCapture::GetMeanFreePath(const G4Track&,G4double,
0126 G4ForceCondition*)
0127 {
0128 return DBL_MAX;
0129 }
0130
0131
0132
0133