File indexing completed on 2025-01-18 09:58:31
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
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052 #ifndef G4IONDEDXSCALINGICRU73_HH
0053 #define G4IONDEDXSCALINGICRU73_HH
0054
0055 #include "globals.hh"
0056 #include "G4VIonDEDXScalingAlgorithm.hh"
0057 #include "G4Material.hh"
0058 #include "G4ParticleDefinition.hh"
0059 #include <vector>
0060 #include "G4Exp.hh"
0061
0062 class G4IonDEDXScalingICRU73 : public G4VIonDEDXScalingAlgorithm {
0063
0064 public:
0065 explicit G4IonDEDXScalingICRU73(G4int minAtomicNumberIon = 19,
0066 G4int maxAtomicNumberIon = 102);
0067 ~G4IonDEDXScalingICRU73();
0068
0069
0070
0071 G4double ScalingFactorEnergy(
0072 const G4ParticleDefinition* particle,
0073 const G4Material* material) override;
0074
0075
0076
0077
0078
0079 G4double ScalingFactorDEDX(
0080 const G4ParticleDefinition* particle,
0081 const G4Material*,
0082 G4double kineticEnergy) override;
0083
0084
0085
0086
0087
0088 G4int AtomicNumberBaseIon(
0089 G4int atomicNumberIon,
0090 const G4Material*) override;
0091
0092 private:
0093 void UpdateCacheParticle(
0094 const G4ParticleDefinition* particle);
0095
0096 void UpdateCacheMaterial(
0097 const G4Material* material);
0098
0099 void CreateReferenceParticles();
0100
0101 G4double EquilibriumCharge(
0102 G4double mass,
0103 G4double charge,
0104 G4double atomicNumberPow,
0105 G4double kineticEnergy);
0106
0107
0108
0109 G4int minAtomicNumber;
0110 G4int maxAtomicNumber;
0111
0112 G4bool referencePrepared;
0113
0114
0115
0116 G4int atomicNumberRefFe;
0117 G4int massNumberRefFe;
0118 G4double atomicNumberRefPow23Fe;
0119 G4double chargeRefFe;
0120 G4double massRefFe;
0121
0122
0123
0124 G4int atomicNumberRefAr;
0125 G4int massNumberRefAr;
0126 G4double atomicNumberRefPow23Ar;
0127 G4double chargeRefAr;
0128 G4double massRefAr;
0129
0130
0131 G4bool useFe;
0132
0133
0134 const G4ParticleDefinition* cacheParticle;
0135 G4int cacheMassNumber;
0136 G4int cacheAtomicNumber;
0137 G4double cacheAtomicNumberPow23;
0138 G4double cacheCharge;
0139 G4double cacheMass;
0140
0141
0142 const G4Material* cacheMaterial;
0143 };
0144
0145
0146
0147 inline void G4IonDEDXScalingICRU73::UpdateCacheParticle (
0148 const G4ParticleDefinition* particle) {
0149
0150 if(particle != cacheParticle) {
0151
0152 cacheParticle = particle;
0153 cacheAtomicNumber = particle -> GetAtomicNumber();
0154 cacheMassNumber = particle -> GetAtomicMass();
0155 cacheCharge = particle -> GetPDGCharge();
0156 cacheMass = particle -> GetPDGMass();
0157 cacheAtomicNumberPow23 = std::pow(G4double(cacheAtomicNumber), 2./3.);
0158 }
0159 }
0160
0161
0162
0163 inline void G4IonDEDXScalingICRU73::UpdateCacheMaterial (
0164 const G4Material* material) {
0165
0166 if(cacheMaterial != material) {
0167
0168 cacheMaterial = material;
0169
0170 useFe = true;
0171
0172 size_t nmbElements = material -> GetNumberOfElements();
0173 if( nmbElements > 1 ) useFe = false;
0174
0175 if( material -> GetName() == "G4_WATER" ) useFe = true;
0176 }
0177 }
0178
0179
0180
0181 inline G4double G4IonDEDXScalingICRU73::EquilibriumCharge(
0182 G4double mass,
0183 G4double charge,
0184 G4double atomicNumberPow,
0185 G4double kineticEnergy) {
0186
0187 G4double totalEnergy = kineticEnergy + mass;
0188 G4double betaSquared = kineticEnergy *
0189 (totalEnergy + mass) / (totalEnergy * totalEnergy);
0190
0191 G4double beta = std::sqrt( betaSquared );
0192
0193 G4double velOverBohrVel = beta / CLHEP::fine_structure_const;
0194
0195 G4double q1 = 1.0 - G4Exp(-velOverBohrVel / atomicNumberPow);
0196
0197 return q1 * charge;
0198 }
0199
0200
0201
0202 #endif