Changeset 1192 for trunk/source/processes/electromagnetic/lowenergy/include/G4IonDEDXScalingICRU73.hh
- Timestamp:
- Nov 19, 2009, 2:53:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/lowenergy/include/G4IonDEDXScalingICRU73.hh
r1066 r1192 37 37 // First implementation: 10. 05. 2009 38 38 // 39 // Modifications: 40 // 39 // Modifications: 12. 11. 2009 - Moved all decision logic concerning ICRU 73 40 // scaling for heavy ions into this class. 41 // Adapting ScalingFactorEnergy class according 42 // to changes in base class (AL). 41 43 // 42 44 // Class description: … … 53 55 #include "globals.hh" 54 56 #include "G4VIonDEDXScalingAlgorithm.hh" 57 #include "G4Material.hh" 58 #include "G4ParticleDefinition.hh" 55 59 #include <vector> 56 60 … … 59 63 60 64 public: 61 G4IonDEDXScalingICRU73(G4int minAtomicNumberIon, 62 G4int maxAtomicNumberIon, 63 G4int atomicNumberReference, 64 G4int massNumberReference); 65 G4IonDEDXScalingICRU73(G4int minAtomicNumberIon = 19, 66 G4int maxAtomicNumberIon = 102); 65 67 ~G4IonDEDXScalingICRU73(); 66 68 … … 68 70 // Returns scaling factor for a given ion. 69 71 G4double ScalingFactorEnergy( 70 const G4ParticleDefinition* particle); // Projectile (ion) 72 const G4ParticleDefinition* particle, // Projectile (ion) 73 const G4Material* material); // Target material 71 74 72 75 … … 87 90 const G4Material*); // Target material 88 91 89 void AddException(G4int atomicNumberIon);90 91 92 private: 92 void UpdateCache (93 void UpdateCacheParticle( 93 94 const G4ParticleDefinition* particle); // Projectile (ion) 94 95 95 void CreateReferenceParticle(); 96 void UpdateCacheMaterial( 97 const G4Material* material); // Target material 98 99 void CreateReferenceParticles(); 96 100 97 101 G4double EquilibriumCharge( … … 106 110 G4int maxAtomicNumber; 107 111 108 // Vector with atomic numbers excepted from scaling procedure 109 std::vector<G4int> excludedAtomicNumbers; 110 G4bool excludedIon; 111 112 // Some properties of reference particles are stored for faster access 113 G4ParticleDefinition* reference; 114 G4int atomicNumberRef; 115 G4int massNumberRef; 116 G4double atomicNumberRefPow23; 117 G4double chargeRef; 118 G4double massRef; 112 // Some properties of reference particle (Fe) are stored for faster access 113 G4ParticleDefinition* referenceFe; 114 G4int atomicNumberRefFe; 115 G4int massNumberRefFe; 116 G4double atomicNumberRefPow23Fe; 117 G4double chargeRefFe; 118 G4double massRefFe; 119 120 // Some properties of reference particle (Ar) are stored for faster access 121 G4ParticleDefinition* referenceAr; 122 G4int atomicNumberRefAr; 123 G4int massNumberRefAr; 124 G4double atomicNumberRefPow23Ar; 125 G4double chargeRefAr; 126 G4double massRefAr; 127 128 // Flag indicating the use of Fe ions as reference particles 129 G4bool useFe; 119 130 120 131 // Some properties of projectiles are stored for faster access … … 125 136 G4double cacheCharge; 126 137 G4double cacheMass; 138 139 // Material pointer 140 const G4Material* cacheMaterial; 127 141 }; 128 142 129 143 // ########################################################################### 130 144 131 inline void G4IonDEDXScalingICRU73::UpdateCache (132 const G4ParticleDefinition* particle) { 145 inline void G4IonDEDXScalingICRU73::UpdateCacheParticle ( 146 const G4ParticleDefinition* particle) { // Projectile (ion) 133 147 134 148 if(particle != cacheParticle) { … … 139 153 cacheCharge = particle -> GetPDGCharge(); 140 154 cacheMass = particle -> GetPDGMass(); 141 142 155 cacheAtomicNumberPow23 = std::pow(G4double(cacheAtomicNumber), 2./3.); 143 144 excludedIon = false; 145 size_t nmb = excludedAtomicNumbers.size(); 146 for(size_t i = 0; i < nmb; i++) { 147 148 if(cacheAtomicNumber == excludedAtomicNumbers[i]) 149 excludedIon = true; 150 } 156 } 157 } 158 159 // ########################################################################### 160 161 inline void G4IonDEDXScalingICRU73::UpdateCacheMaterial ( 162 const G4Material* material) { // Target material 163 164 if(cacheMaterial != material) { 165 166 cacheMaterial = material; 167 168 useFe = true; 169 170 size_t nmbElements = material -> GetNumberOfElements(); 171 if( nmbElements > 1 ) useFe = false; 172 173 if( material -> GetName() == "G4_WATER" ) useFe = true; 151 174 } 152 175 } … … 175 198 // ########################################################################### 176 199 177 inline void G4IonDEDXScalingICRU73::AddException(G4int atomicNumber) {178 179 if(atomicNumber >= minAtomicNumber &&180 atomicNumber <= maxAtomicNumber) {181 182 excludedAtomicNumbers.push_back( atomicNumber );183 }184 }185 186 // ###########################################################################187 188 200 #endif
Note: See TracChangeset
for help on using the changeset viewer.