Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // 27 // 27 // 28 // =========================================== 28 // =========================================================================== 29 // GEANT4 class source file 29 // GEANT4 class source file 30 // 30 // 31 // Class: G4IonDEDXScalingICRU7 31 // Class: G4IonDEDXScalingICRU73 32 // 32 // 33 // Base class: G4VIonDEDXScalingAlgo 33 // Base class: G4VIonDEDXScalingAlgorithm 34 // 34 // 35 // Author: Anton Lechner (Anton. 35 // Author: Anton Lechner (Anton.Lechner@cern.ch) 36 // 36 // 37 // First implementation: 10. 05. 2009 37 // First implementation: 10. 05. 2009 38 // 38 // 39 // Modifications: 06. 08. 2009 - Minor bug fix 39 // Modifications: 06. 08. 2009 - Minor bug fix (initialization of cache) AL 40 // 12. 11. 2009 - Moved all dec 40 // 12. 11. 2009 - Moved all decision logic concerning ICRU 73 41 // scaling for h 41 // scaling for heavy ions into this class. 42 // Adapting Scal 42 // Adapting ScalingFactorEnergy class according 43 // to changes in 43 // to changes in base class (AL). 44 // 44 // 45 // Class description: 45 // Class description: 46 // dE/dx scaling algorithm applied on top o 46 // dE/dx scaling algorithm applied on top of ICRU 73 data (for ions not 47 // covered by the ICRU 73 report) 47 // covered by the ICRU 73 report) 48 // 48 // 49 // Comments: 49 // Comments: 50 // 50 // 51 // =========================================== 51 // =========================================================================== 52 52 53 #include "G4IonDEDXScalingICRU73.hh" 53 #include "G4IonDEDXScalingICRU73.hh" 54 #include "G4ParticleDefinition.hh" 54 #include "G4ParticleDefinition.hh" 55 #include "G4ParticleTable.hh" 55 #include "G4ParticleTable.hh" 56 #include "G4IonTable.hh" << 57 #include "G4Material.hh" 56 #include "G4Material.hh" 58 57 59 58 60 // ########################################### 59 // ########################################################################### 61 60 62 G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73 61 G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73( 63 G4int minAtomicNumbe 62 G4int minAtomicNumberIon, 64 G4int maxAtomicNumbe 63 G4int maxAtomicNumberIon) : 65 minAtomicNumber( minAtomicNumberIon ), 64 minAtomicNumber( minAtomicNumberIon ), 66 maxAtomicNumber( maxAtomicNumberIon ), 65 maxAtomicNumber( maxAtomicNumberIon ), 67 referencePrepared( false ), << 66 referenceFe( 0 ), 68 atomicNumberRefFe( 26 ), 67 atomicNumberRefFe( 26 ), 69 massNumberRefFe( 56 ), 68 massNumberRefFe( 56 ), 70 atomicNumberRefPow23Fe( 0 ), 69 atomicNumberRefPow23Fe( 0 ), 71 chargeRefFe( 0 ), 70 chargeRefFe( 0 ), 72 massRefFe( 0 ), 71 massRefFe( 0 ), >> 72 referenceAr( 0 ), 73 atomicNumberRefAr( 18 ), 73 atomicNumberRefAr( 18 ), 74 massNumberRefAr( 40 ), 74 massNumberRefAr( 40 ), 75 atomicNumberRefPow23Ar( 0 ), 75 atomicNumberRefPow23Ar( 0 ), 76 chargeRefAr( 0 ), 76 chargeRefAr( 0 ), 77 massRefAr( 0 ), 77 massRefAr( 0 ), 78 useFe( true ), 78 useFe( true ), 79 cacheParticle( 0 ), 79 cacheParticle( 0 ), 80 cacheMassNumber( 0 ), 80 cacheMassNumber( 0 ), 81 cacheAtomicNumber( 0 ), 81 cacheAtomicNumber( 0 ), 82 cacheAtomicNumberPow23( 0 ), 82 cacheAtomicNumberPow23( 0 ), 83 cacheCharge( 0 ), 83 cacheCharge( 0 ), 84 cacheMass( 0 ), 84 cacheMass( 0 ), 85 cacheMaterial( 0 ) { 85 cacheMaterial( 0 ) { 86 86 87 } 87 } 88 88 89 // ########################################### 89 // ########################################################################### 90 90 91 G4IonDEDXScalingICRU73::~G4IonDEDXScalingICRU7 91 G4IonDEDXScalingICRU73::~G4IonDEDXScalingICRU73() { >> 92 92 } 93 } 93 94 94 // ########################################### 95 // ########################################################################### 95 96 96 void G4IonDEDXScalingICRU73::CreateReferencePa 97 void G4IonDEDXScalingICRU73::CreateReferenceParticles() { 97 << 98 98 G4IonTable* ionTable = G4IonTable::GetIonTab << 99 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); 99 100 100 massRefFe = ionTable->GetIonMass(atomicNumbe << 101 G4double excitationEnergy = 0.0; 101 massRefAr = ionTable->GetIonMass(atomicNumbe << 102 102 103 chargeRefFe = G4double(atomicNumberRefFe)*CL << 103 referenceFe = particleTable -> GetIon(atomicNumberRefFe, massNumberRefFe, 104 chargeRefAr = G4double(atomicNumberRefAr)*CL << 104 excitationEnergy); >> 105 referenceAr = particleTable -> GetIon(atomicNumberRefAr, massNumberRefAr, >> 106 excitationEnergy); >> 107 >> 108 massRefFe = referenceFe -> GetPDGMass(); >> 109 massRefAr = referenceAr -> GetPDGMass(); >> 110 >> 111 chargeRefFe = referenceFe -> GetPDGCharge(); >> 112 chargeRefAr = referenceAr -> GetPDGCharge(); 105 113 106 atomicNumberRefPow23Fe = std::pow(G4double(a 114 atomicNumberRefPow23Fe = std::pow(G4double(atomicNumberRefFe), 2./3.); 107 atomicNumberRefPow23Ar = std::pow(G4double(a 115 atomicNumberRefPow23Ar = std::pow(G4double(atomicNumberRefAr), 2./3.); 108 << 109 referencePrepared = true; << 110 } 116 } 111 117 112 118 113 // ########################################### 119 // ########################################################################### 114 120 115 121 116 G4double G4IonDEDXScalingICRU73::ScalingFactor 122 G4double G4IonDEDXScalingICRU73::ScalingFactorEnergy ( 117 const G4ParticleDefinition* partic 123 const G4ParticleDefinition* particle, // Projectile (ion) 118 const G4Material* material) { 124 const G4Material* material) { // Target material 119 125 120 G4double factor = 1.0; 126 G4double factor = 1.0; 121 127 122 UpdateCacheParticle(particle); 128 UpdateCacheParticle(particle); 123 UpdateCacheMaterial(material); 129 UpdateCacheMaterial(material); 124 130 125 if(cacheAtomicNumber >= minAtomicNumber && 131 if(cacheAtomicNumber >= minAtomicNumber && 126 cacheAtomicNumber <= maxAtomicNumber && 132 cacheAtomicNumber <= maxAtomicNumber && 127 cacheAtomicNumber != atomicNumberRefFe && 133 cacheAtomicNumber != atomicNumberRefFe && 128 cacheAtomicNumber != atomicNumberRefAr) { 134 cacheAtomicNumber != atomicNumberRefAr) { 129 135 130 if(!referencePrepared) CreateReferencePar << 136 if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles(); 131 137 132 if( useFe ) 138 if( useFe ) 133 factor = cacheMassNumber * (massRefFe 139 factor = cacheMassNumber * (massRefFe / cacheMass) / massNumberRefFe; 134 else 140 else 135 factor = cacheMassNumber * (massRefAr 141 factor = cacheMassNumber * (massRefAr / cacheMass) / massNumberRefAr; 136 } 142 } 137 143 138 return factor; 144 return factor; 139 } 145 } 140 146 141 // ########################################### 147 // ########################################################################### 142 148 143 G4double G4IonDEDXScalingICRU73::ScalingFactor 149 G4double G4IonDEDXScalingICRU73::ScalingFactorDEDX( 144 const G4ParticleDefinition* parti 150 const G4ParticleDefinition* particle, // Projectile (ion) 145 const G4Material* material, 151 const G4Material* material, // Target material 146 G4double kineticEnergy) { 152 G4double kineticEnergy) { // Kinetic energy 147 153 148 G4double factor = 1.0; 154 G4double factor = 1.0; 149 155 150 UpdateCacheParticle(particle); 156 UpdateCacheParticle(particle); 151 UpdateCacheMaterial(material); 157 UpdateCacheMaterial(material); 152 158 153 if(cacheAtomicNumber >= minAtomicNumber && 159 if(cacheAtomicNumber >= minAtomicNumber && 154 cacheAtomicNumber <= maxAtomicNumber && 160 cacheAtomicNumber <= maxAtomicNumber && 155 cacheAtomicNumber != atomicNumberRefFe && 161 cacheAtomicNumber != atomicNumberRefFe && 156 cacheAtomicNumber != atomicNumberRefAr) { 162 cacheAtomicNumber != atomicNumberRefAr) { 157 163 158 if(!referencePrepared) CreateReferencePa << 164 if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles(); 159 165 160 if( useFe ) { 166 if( useFe ) { 161 167 162 G4double equilibriumCharge = Equilibr 168 G4double equilibriumCharge = EquilibriumCharge(cacheMass, 163 169 cacheCharge, 164 170 cacheAtomicNumberPow23, 165 171 kineticEnergy); 166 172 167 G4double scaledKineticEnergy = kineti 173 G4double scaledKineticEnergy = kineticEnergy * (massRefFe / cacheMass); 168 174 169 G4double equilibriumChargeRefFe = Equ 175 G4double equilibriumChargeRefFe = EquilibriumCharge(massRefFe, 170 176 chargeRefFe, 171 177 atomicNumberRefPow23Fe, 172 178 scaledKineticEnergy); 173 179 174 factor = equilibriumCharge * equilibr 180 factor = equilibriumCharge * equilibriumCharge/ 175 ( equilibriumChargeRefFe * 181 ( equilibriumChargeRefFe * equilibriumChargeRefFe ); 176 182 177 } 183 } 178 else { 184 else { 179 185 180 G4double equilibriumCharge = Equilibr 186 G4double equilibriumCharge = EquilibriumCharge(cacheMass, 181 187 cacheCharge, 182 188 cacheAtomicNumberPow23, 183 189 kineticEnergy); 184 190 185 G4double scaledKineticEnergy = kineti 191 G4double scaledKineticEnergy = kineticEnergy * (massRefAr / cacheMass); 186 192 187 G4double equilibriumChargeRefAr = Equ 193 G4double equilibriumChargeRefAr = EquilibriumCharge(massRefAr, 188 194 chargeRefAr, 189 195 atomicNumberRefPow23Ar, 190 196 scaledKineticEnergy); 191 197 192 factor = equilibriumCharge * equilibr 198 factor = equilibriumCharge * equilibriumCharge/ 193 ( equilibriumChargeRefAr * 199 ( equilibriumChargeRefAr * equilibriumChargeRefAr ); 194 200 195 } 201 } 196 } 202 } 197 203 198 return factor; 204 return factor; 199 } 205 } 200 206 201 // ########################################### 207 // ########################################################################### 202 208 203 G4int G4IonDEDXScalingICRU73::AtomicNumberBase 209 G4int G4IonDEDXScalingICRU73::AtomicNumberBaseIon( 204 G4int atomicNumberIon, 210 G4int atomicNumberIon, // Atomic number of ion 205 const G4Material* material) { 211 const G4Material* material) { // Target material 206 212 207 UpdateCacheMaterial(material); 213 UpdateCacheMaterial(material); 208 214 209 G4int atomicNumber = atomicNumberIon; 215 G4int atomicNumber = atomicNumberIon; 210 216 211 if(atomicNumberIon >= minAtomicNumber && 217 if(atomicNumberIon >= minAtomicNumber && 212 atomicNumberIon <= maxAtomicNumber && 218 atomicNumberIon <= maxAtomicNumber && 213 atomicNumberIon != atomicNumberRefFe && 219 atomicNumberIon != atomicNumberRefFe && 214 atomicNumberIon != atomicNumberRefAr) { 220 atomicNumberIon != atomicNumberRefAr) { 215 221 216 if(!referencePrepared) CreateReferencePar << 222 if(referenceFe == 0 || referenceAr == 0) CreateReferenceParticles(); 217 223 218 if( useFe ) atomicNumber = atomicNumberRe 224 if( useFe ) atomicNumber = atomicNumberRefFe; 219 else atomicNumber = atomicNumberRefAr; 225 else atomicNumber = atomicNumberRefAr; 220 } 226 } 221 227 222 return atomicNumber; 228 return atomicNumber; 223 } 229 } 224 230 225 // ########################################### 231 // ########################################################################### 226 232