Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // 27 // ------------------------------------------- 24 // ------------------------------------------------------------------- 28 // 25 // 29 // GEANT4 Class file 26 // GEANT4 Class file 30 // 27 // 31 // 28 // 32 // File name: G4hBetheBlochModel 29 // File name: G4hBetheBlochModel 33 // 30 // 34 // Author: V.Ivanchenko (Vladimir.Ivanc 31 // Author: V.Ivanchenko (Vladimir.Ivanchenko@cern.ch) 35 // 32 // 36 // Creation date: 20 July 2000 33 // Creation date: 20 July 2000 37 // 34 // 38 // Modifications: 35 // Modifications: 39 // 20/07/2000 V.Ivanchenko First implementati 36 // 20/07/2000 V.Ivanchenko First implementation 40 // 03/10/2000 V.Ivanchenko clean up accoding 37 // 03/10/2000 V.Ivanchenko clean up accoding to CodeWizard 41 // 38 // 42 // Class Description: 39 // Class Description: 43 // 40 // 44 // Bethe-Bloch ionisation model 41 // Bethe-Bloch ionisation model 45 // 42 // 46 // Class Description: End 43 // Class Description: End 47 // 44 // 48 // ------------------------------------------- 45 // ------------------------------------------------------------------- 49 // 46 // 50 //....oooOO0OOooo........oooOO0OOooo........oo 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 51 48 52 #include "G4hBetheBlochModel.hh" 49 #include "G4hBetheBlochModel.hh" 53 << 54 #include "globals.hh" << 55 #include "G4PhysicalConstants.hh" << 56 #include "G4SystemOfUnits.hh" << 57 #include "G4DynamicParticle.hh" 50 #include "G4DynamicParticle.hh" 58 #include "G4ParticleDefinition.hh" 51 #include "G4ParticleDefinition.hh" 59 #include "G4Material.hh" 52 #include "G4Material.hh" >> 53 #include "globals.hh" 60 54 61 //....oooOO0OOooo........oooOO0OOooo........oo 55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 62 56 63 G4hBetheBlochModel::G4hBetheBlochModel(const G 57 G4hBetheBlochModel::G4hBetheBlochModel(const G4String& name) 64 : G4VLowEnergyModel(name), << 58 : G4VLowEnergyModel(name), 65 twoln10(2.*std::log(10.)), << 59 twoln10(2.*log(10.)), 66 bg2lim(0.0169), 60 bg2lim(0.0169), 67 taulim(8.4146e-3), << 61 taulim(8.4146e-3) 68 lowEnergyLimit(1.*MeV), << 69 highEnergyLimit(100.*GeV) << 70 {;} 62 {;} 71 63 72 //....oooOO0OOooo........oooOO0OOooo........oo 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 73 65 74 G4hBetheBlochModel::~G4hBetheBlochModel() 66 G4hBetheBlochModel::~G4hBetheBlochModel() 75 {;} 67 {;} 76 68 77 //....oooOO0OOooo........oooOO0OOooo........oo 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 78 70 79 G4double G4hBetheBlochModel::TheValue(const G4 71 G4double G4hBetheBlochModel::TheValue(const G4DynamicParticle* particle, 80 const G4Materi 72 const G4Material* material) 81 { 73 { 82 G4double energy = particle->GetKineticEnergy 74 G4double energy = particle->GetKineticEnergy() ; 83 G4double particleMass = particle->GetMass() 75 G4double particleMass = particle->GetMass() ; 84 76 85 G4double eloss = BetheBlochFormula(material 77 G4double eloss = BetheBlochFormula(material,energy,particleMass) ; 86 78 87 return eloss ; 79 return eloss ; 88 } 80 } 89 81 90 //....oooOO0OOooo........oooOO0OOooo........oo 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 91 83 92 G4double G4hBetheBlochModel::TheValue(const G4 84 G4double G4hBetheBlochModel::TheValue(const G4ParticleDefinition* aParticle, 93 const G4Materi 85 const G4Material* material, 94 G4double kineticEnergy) << 86 G4double kineticEnergy) 95 { 87 { 96 G4double particleMass = aParticle->GetPDGMas 88 G4double particleMass = aParticle->GetPDGMass() ; 97 G4double eloss = BetheBlochFormula(material 89 G4double eloss = BetheBlochFormula(material,kineticEnergy,particleMass) ; 98 90 99 return eloss ; 91 return eloss ; 100 } 92 } 101 93 102 //....oooOO0OOooo........oooOO0OOooo........oo 94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 103 95 104 G4double G4hBetheBlochModel::HighEnergyLimit( 96 G4double G4hBetheBlochModel::HighEnergyLimit( 105 const G4ParticleD << 97 const G4ParticleDefinition* aParticle, 106 const G4Material* << 98 const G4Material* material) const 107 { 99 { 108 return highEnergyLimit ; 100 return highEnergyLimit ; 109 } 101 } 110 102 111 //....oooOO0OOooo........oooOO0OOooo........oo 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 112 104 113 G4double G4hBetheBlochModel::LowEnergyLimit( 105 G4double G4hBetheBlochModel::LowEnergyLimit( 114 const G4ParticleD 106 const G4ParticleDefinition* aParticle, 115 const G4Material* 107 const G4Material* material) const 116 { 108 { 117 G4double taul = (material->GetIonisation()-> 109 G4double taul = (material->GetIonisation()->GetTaul())* 118 (aParticle->GetPDGMass()) ; 110 (aParticle->GetPDGMass()) ; 119 return taul ; 111 return taul ; 120 } 112 } 121 113 122 //....oooOO0OOooo........oooOO0OOooo........oo 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 123 115 124 G4double G4hBetheBlochModel::HighEnergyLimit( 116 G4double G4hBetheBlochModel::HighEnergyLimit( 125 const G4ParticleD << 117 const G4ParticleDefinition* aParticle) const 126 { 118 { 127 return highEnergyLimit ; 119 return highEnergyLimit ; 128 } 120 } 129 121 130 //....oooOO0OOooo........oooOO0OOooo........oo 122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 131 123 132 G4double G4hBetheBlochModel::LowEnergyLimit( 124 G4double G4hBetheBlochModel::LowEnergyLimit( 133 const G4ParticleD << 125 const G4ParticleDefinition* aParticle) const 134 { 126 { 135 return lowEnergyLimit ; 127 return lowEnergyLimit ; 136 } 128 } 137 129 138 //....oooOO0OOooo........oooOO0OOooo........oo 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 139 131 140 G4bool G4hBetheBlochModel::IsInCharge(const G4 << 132 G4bool G4hBetheBlochModel::IsInCharge(const G4DynamicParticle* particle, 141 const G4Material* ) << 133 const G4Material* material) const 142 { 134 { 143 return true ; 135 return true ; 144 } 136 } 145 137 146 //....oooOO0OOooo........oooOO0OOooo........oo 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 147 139 148 G4bool G4hBetheBlochModel::IsInCharge(const G4 << 140 G4bool G4hBetheBlochModel::IsInCharge(const G4ParticleDefinition* aParticle, 149 const G4Material* ) << 141 const G4Material* material) const 150 { 142 { 151 return true ; 143 return true ; 152 } 144 } 153 145 154 //....oooOO0OOooo........oooOO0OOooo........oo 146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 155 147 156 G4double G4hBetheBlochModel::BetheBlochFormula 148 G4double G4hBetheBlochModel::BetheBlochFormula( 157 const G4Material* 149 const G4Material* material, 158 G4double ki 150 G4double kineticEnergy, 159 G4double pa 151 G4double particleMass) const 160 { 152 { 161 // This member function is applied normally 153 // This member function is applied normally to proton/antiproton 162 G4double ionloss ; 154 G4double ionloss ; 163 155 164 G4double rateMass = electron_mass_c2/particl 156 G4double rateMass = electron_mass_c2/particleMass ; 165 157 166 G4double taul = material->GetIonisation()->G 158 G4double taul = material->GetIonisation()->GetTaul() ; 167 G4double tau = kineticEnergy/particleMass ; 159 G4double tau = kineticEnergy/particleMass ; // tau is relative energy 168 160 169 // It is not normal case for this function 161 // It is not normal case for this function 170 // for low energy parametrisation have to be 162 // for low energy parametrisation have to be applied 171 if ( tau < taul ) tau = taul ; 163 if ( tau < taul ) tau = taul ; 172 164 173 // some local variables 165 // some local variables 174 166 175 G4double gamma,bg2,beta2,tmax,x,delta,sh ; 167 G4double gamma,bg2,beta2,tmax,x,delta,sh ; 176 G4double electronDensity = material->GetElec 168 G4double electronDensity = material->GetElectronDensity(); 177 G4double eexc = material->GetIonisation()-> 169 G4double eexc = material->GetIonisation()->GetMeanExcitationEnergy(); 178 G4double eexc2 = eexc*eexc ; 170 G4double eexc2 = eexc*eexc ; 179 G4double cden = material->GetIonisation()-> 171 G4double cden = material->GetIonisation()->GetCdensity(); 180 G4double mden = material->GetIonisation()-> 172 G4double mden = material->GetIonisation()->GetMdensity(); 181 G4double aden = material->GetIonisation()-> 173 G4double aden = material->GetIonisation()->GetAdensity(); 182 G4double x0den = material->GetIonisation()-> 174 G4double x0den = material->GetIonisation()->GetX0density(); 183 G4double x1den = material->GetIonisation()-> 175 G4double x1den = material->GetIonisation()->GetX1density(); 184 G4double* shellCorrectionVector = 176 G4double* shellCorrectionVector = 185 material->GetIonisation()->GetShel 177 material->GetIonisation()->GetShellCorrectionVector(); 186 178 187 gamma = tau + 1.0 ; 179 gamma = tau + 1.0 ; 188 bg2 = tau*(tau+2.0) ; 180 bg2 = tau*(tau+2.0) ; 189 beta2 = bg2/(gamma*gamma) ; 181 beta2 = bg2/(gamma*gamma) ; 190 tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma* 182 tmax = 2.*electron_mass_c2*bg2/(1.+2.*gamma*rateMass+rateMass*rateMass) ; 191 183 192 ionloss = std::log(2.0*electron_mass_c2*bg2* << 184 ionloss = log(2.0*electron_mass_c2*bg2*tmax/eexc2)-2.0*beta2 ; 193 185 194 // density correction 186 // density correction 195 x = std::log(bg2)/twoln10 ; << 187 x = log(bg2)/twoln10 ; 196 if ( x < x0den ) { 188 if ( x < x0den ) { 197 delta = 0.0 ; 189 delta = 0.0 ; 198 190 199 } else { 191 } else { 200 delta = twoln10*x - cden ; 192 delta = twoln10*x - cden ; 201 if ( x < x1den ) delta += aden*std::pow((x << 193 if ( x < x1den ) delta += aden*pow((x1den-x),mden) ; 202 } 194 } 203 195 204 // shell correction 196 // shell correction 205 sh = 0.0 ; 197 sh = 0.0 ; 206 x = 1.0 ; 198 x = 1.0 ; 207 199 208 if ( bg2 > bg2lim ) { 200 if ( bg2 > bg2lim ) { 209 for (G4int k=0; k<=2; k++) { 201 for (G4int k=0; k<=2; k++) { 210 x *= bg2 ; 202 x *= bg2 ; 211 sh += shellCorrectionVector[k]/x; 203 sh += shellCorrectionVector[k]/x; 212 } 204 } 213 205 214 } else { 206 } else { 215 for (G4int k=0; k<=2; k++) { 207 for (G4int k=0; k<=2; k++) { 216 x *= bg2lim ; 208 x *= bg2lim ; 217 sh += shellCorrectionVector[k]/x; 209 sh += shellCorrectionVector[k]/x; 218 } 210 } 219 sh *= std::log(tau/taul)/std::log(taulim/t << 211 sh *= log(tau/taul)/log(taulim/taul) ; 220 } 212 } 221 213 222 // now compute the total ionization loss 214 // now compute the total ionization loss 223 215 224 ionloss -= delta + sh ; 216 ionloss -= delta + sh ; 225 ionloss *= twopi_mc2_rcl2*electronDensity/be 217 ionloss *= twopi_mc2_rcl2*electronDensity/beta2 ; 226 218 227 if ( ionloss < 0.0) ionloss = 0.0 ; 219 if ( ionloss < 0.0) ionloss = 0.0 ; 228 220 229 return ionloss; 221 return ionloss; 230 } 222 } 231 223 232 224 233 225