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" 56 #include "G4IonTable.hh" 57 #include "G4Material.hh" 57 #include "G4Material.hh" 58 58 59 59 60 // ########################################### 60 // ########################################################################### 61 61 62 G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73 62 G4IonDEDXScalingICRU73::G4IonDEDXScalingICRU73( 63 G4int minAtomicNumbe 63 G4int minAtomicNumberIon, 64 G4int maxAtomicNumbe 64 G4int maxAtomicNumberIon) : 65 minAtomicNumber( minAtomicNumberIon ), 65 minAtomicNumber( minAtomicNumberIon ), 66 maxAtomicNumber( maxAtomicNumberIon ), 66 maxAtomicNumber( maxAtomicNumberIon ), 67 referencePrepared( false ), 67 referencePrepared( false ), 68 atomicNumberRefFe( 26 ), 68 atomicNumberRefFe( 26 ), 69 massNumberRefFe( 56 ), 69 massNumberRefFe( 56 ), 70 atomicNumberRefPow23Fe( 0 ), 70 atomicNumberRefPow23Fe( 0 ), 71 chargeRefFe( 0 ), 71 chargeRefFe( 0 ), 72 massRefFe( 0 ), 72 massRefFe( 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 void G4IonDEDXScalingICRU73::CreateReferencePa 96 void G4IonDEDXScalingICRU73::CreateReferenceParticles() { 97 97 98 G4IonTable* ionTable = G4IonTable::GetIonTab 98 G4IonTable* ionTable = G4IonTable::GetIonTable(); 99 99 100 massRefFe = ionTable->GetIonMass(atomicNumbe 100 massRefFe = ionTable->GetIonMass(atomicNumberRefFe,massNumberRefFe); 101 massRefAr = ionTable->GetIonMass(atomicNumbe 101 massRefAr = ionTable->GetIonMass(atomicNumberRefAr,massNumberRefAr); 102 102 103 chargeRefFe = G4double(atomicNumberRefFe)*CL 103 chargeRefFe = G4double(atomicNumberRefFe)*CLHEP::eplus; 104 chargeRefAr = G4double(atomicNumberRefAr)*CL 104 chargeRefAr = G4double(atomicNumberRefAr)*CLHEP::eplus; 105 105 106 atomicNumberRefPow23Fe = std::pow(G4double(a 106 atomicNumberRefPow23Fe = std::pow(G4double(atomicNumberRefFe), 2./3.); 107 atomicNumberRefPow23Ar = std::pow(G4double(a 107 atomicNumberRefPow23Ar = std::pow(G4double(atomicNumberRefAr), 2./3.); 108 108 109 referencePrepared = true; 109 referencePrepared = true; 110 } 110 } 111 111 112 112 113 // ########################################### 113 // ########################################################################### 114 114 115 115 116 G4double G4IonDEDXScalingICRU73::ScalingFactor 116 G4double G4IonDEDXScalingICRU73::ScalingFactorEnergy ( 117 const G4ParticleDefinition* partic 117 const G4ParticleDefinition* particle, // Projectile (ion) 118 const G4Material* material) { 118 const G4Material* material) { // Target material 119 119 120 G4double factor = 1.0; 120 G4double factor = 1.0; 121 121 122 UpdateCacheParticle(particle); 122 UpdateCacheParticle(particle); 123 UpdateCacheMaterial(material); 123 UpdateCacheMaterial(material); 124 124 125 if(cacheAtomicNumber >= minAtomicNumber && 125 if(cacheAtomicNumber >= minAtomicNumber && 126 cacheAtomicNumber <= maxAtomicNumber && 126 cacheAtomicNumber <= maxAtomicNumber && 127 cacheAtomicNumber != atomicNumberRefFe && 127 cacheAtomicNumber != atomicNumberRefFe && 128 cacheAtomicNumber != atomicNumberRefAr) { 128 cacheAtomicNumber != atomicNumberRefAr) { 129 129 130 if(!referencePrepared) CreateReferencePar 130 if(!referencePrepared) CreateReferenceParticles(); 131 131 132 if( useFe ) 132 if( useFe ) 133 factor = cacheMassNumber * (massRefFe 133 factor = cacheMassNumber * (massRefFe / cacheMass) / massNumberRefFe; 134 else 134 else 135 factor = cacheMassNumber * (massRefAr 135 factor = cacheMassNumber * (massRefAr / cacheMass) / massNumberRefAr; 136 } 136 } 137 137 138 return factor; 138 return factor; 139 } 139 } 140 140 141 // ########################################### 141 // ########################################################################### 142 142 143 G4double G4IonDEDXScalingICRU73::ScalingFactor 143 G4double G4IonDEDXScalingICRU73::ScalingFactorDEDX( 144 const G4ParticleDefinition* parti 144 const G4ParticleDefinition* particle, // Projectile (ion) 145 const G4Material* material, 145 const G4Material* material, // Target material 146 G4double kineticEnergy) { 146 G4double kineticEnergy) { // Kinetic energy 147 147 148 G4double factor = 1.0; 148 G4double factor = 1.0; 149 149 150 UpdateCacheParticle(particle); 150 UpdateCacheParticle(particle); 151 UpdateCacheMaterial(material); 151 UpdateCacheMaterial(material); 152 152 153 if(cacheAtomicNumber >= minAtomicNumber && 153 if(cacheAtomicNumber >= minAtomicNumber && 154 cacheAtomicNumber <= maxAtomicNumber && 154 cacheAtomicNumber <= maxAtomicNumber && 155 cacheAtomicNumber != atomicNumberRefFe && 155 cacheAtomicNumber != atomicNumberRefFe && 156 cacheAtomicNumber != atomicNumberRefAr) { 156 cacheAtomicNumber != atomicNumberRefAr) { 157 157 158 if(!referencePrepared) CreateReferencePa 158 if(!referencePrepared) CreateReferenceParticles(); 159 159 160 if( useFe ) { 160 if( useFe ) { 161 161 162 G4double equilibriumCharge = Equilibr 162 G4double equilibriumCharge = EquilibriumCharge(cacheMass, 163 163 cacheCharge, 164 164 cacheAtomicNumberPow23, 165 165 kineticEnergy); 166 166 167 G4double scaledKineticEnergy = kineti 167 G4double scaledKineticEnergy = kineticEnergy * (massRefFe / cacheMass); 168 168 169 G4double equilibriumChargeRefFe = Equ 169 G4double equilibriumChargeRefFe = EquilibriumCharge(massRefFe, 170 170 chargeRefFe, 171 171 atomicNumberRefPow23Fe, 172 172 scaledKineticEnergy); 173 173 174 factor = equilibriumCharge * equilibr 174 factor = equilibriumCharge * equilibriumCharge/ 175 ( equilibriumChargeRefFe * 175 ( equilibriumChargeRefFe * equilibriumChargeRefFe ); 176 176 177 } 177 } 178 else { 178 else { 179 179 180 G4double equilibriumCharge = Equilibr 180 G4double equilibriumCharge = EquilibriumCharge(cacheMass, 181 181 cacheCharge, 182 182 cacheAtomicNumberPow23, 183 183 kineticEnergy); 184 184 185 G4double scaledKineticEnergy = kineti 185 G4double scaledKineticEnergy = kineticEnergy * (massRefAr / cacheMass); 186 186 187 G4double equilibriumChargeRefAr = Equ 187 G4double equilibriumChargeRefAr = EquilibriumCharge(massRefAr, 188 188 chargeRefAr, 189 189 atomicNumberRefPow23Ar, 190 190 scaledKineticEnergy); 191 191 192 factor = equilibriumCharge * equilibr 192 factor = equilibriumCharge * equilibriumCharge/ 193 ( equilibriumChargeRefAr * 193 ( equilibriumChargeRefAr * equilibriumChargeRefAr ); 194 194 195 } 195 } 196 } 196 } 197 197 198 return factor; 198 return factor; 199 } 199 } 200 200 201 // ########################################### 201 // ########################################################################### 202 202 203 G4int G4IonDEDXScalingICRU73::AtomicNumberBase 203 G4int G4IonDEDXScalingICRU73::AtomicNumberBaseIon( 204 G4int atomicNumberIon, 204 G4int atomicNumberIon, // Atomic number of ion 205 const G4Material* material) { 205 const G4Material* material) { // Target material 206 206 207 UpdateCacheMaterial(material); 207 UpdateCacheMaterial(material); 208 208 209 G4int atomicNumber = atomicNumberIon; 209 G4int atomicNumber = atomicNumberIon; 210 210 211 if(atomicNumberIon >= minAtomicNumber && 211 if(atomicNumberIon >= minAtomicNumber && 212 atomicNumberIon <= maxAtomicNumber && 212 atomicNumberIon <= maxAtomicNumber && 213 atomicNumberIon != atomicNumberRefFe && 213 atomicNumberIon != atomicNumberRefFe && 214 atomicNumberIon != atomicNumberRefAr) { 214 atomicNumberIon != atomicNumberRefAr) { 215 215 216 if(!referencePrepared) CreateReferencePar 216 if(!referencePrepared) CreateReferenceParticles(); 217 217 218 if( useFe ) atomicNumber = atomicNumberRe 218 if( useFe ) atomicNumber = atomicNumberRefFe; 219 else atomicNumber = atomicNumberRefAr; 219 else atomicNumber = atomicNumberRefAr; 220 } 220 } 221 221 222 return atomicNumber; 222 return atomicNumber; 223 } 223 } 224 224 225 // ########################################### 225 // ########################################################################### 226 226