Changeset 961 for trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh
- Timestamp:
- Apr 6, 2009, 12:21:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh
r819 r961 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4EnergyLossForExtrapolator.hh,v 1. 9 2007/07/28 13:44:25vnivanch Exp $27 // GEANT4 tag $Name: $26 // $Id: G4EnergyLossForExtrapolator.hh,v 1.12 2008/11/13 14:14:07 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 28 28 // 29 29 //--------------------------------------------------------------------------- … … 81 81 82 82 G4double EnergyBeforeStep(G4double kinEnergy, G4double step, 83 const G4Material*, const G4ParticleDefinition*); 83 const G4Material*, const G4ParticleDefinition*); 84 85 G4double TrueStepLength(G4double kinEnergy, G4double step, 86 const G4Material*, const G4ParticleDefinition* part); 84 87 85 88 inline G4double EnergyAfterStep(G4double kinEnergy, G4double step, 86 89 const G4Material*, const G4String& particleName); 87 90 88 91 inline G4double EnergyBeforeStep(G4double kinEnergy, G4double step, 89 92 const G4Material*, const G4String& particleName); 90 93 91 94 inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step, 92 const G4Material*, const G4ParticleDefinition* part); 95 const G4Material*, 96 const G4ParticleDefinition* part); 93 97 94 98 inline G4double AverageScatteringAngle(G4double kinEnergy, G4double step, 95 const G4Material*, const G4String& particleName); 99 const G4Material*, 100 const G4String& particleName); 101 102 inline G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part, 103 G4double kinEnergy, G4double stepLength); 96 104 97 105 inline G4double EnergyDispersion(G4double kinEnergy, G4double step, 98 106 const G4Material*, const G4ParticleDefinition*); 99 107 100 108 inline G4double EnergyDispersion(G4double kinEnergy, G4double step, … … 113 121 void Initialisation(); 114 122 123 G4bool SetupKinematics(const G4ParticleDefinition*, const G4Material*, 124 G4double kinEnergy); 125 115 126 G4PhysicsTable* PrepareTable(); 116 127 … … 123 134 void ComputeProtonDEDX(const G4ParticleDefinition* part, G4PhysicsTable* table); 124 135 125 G4double ComputeTrueStep(const G4Material*, const G4ParticleDefinition* part, 126 G4double kinEnergy, G4double stepLength); 136 void ComputeTrasportXS(const G4ParticleDefinition* part, G4PhysicsTable* table); 127 137 128 138 inline G4double ComputeValue(G4double x, const G4PhysicsTable* table); 129 130 inline G4double ComputeScatteringAngle(G4double x);131 139 132 140 // hide assignment operator … … 158 166 G4PhysicsTable* invRangeMuon; 159 167 G4PhysicsTable* invRangeProton; 168 G4PhysicsTable* mscElectron; 160 169 161 170 const G4Material* currentMaterial; … … 214 223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 215 224 216 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 217 G4double step, 218 const G4Material* mat, 219 const G4String& name) 225 inline G4double 226 G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 227 G4double step, 228 const G4Material* mat, 229 const G4String& name) 220 230 { 221 231 return EnergyDispersion(kinEnergy,step,mat,FindParticle(name)); … … 224 234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 225 235 226 inline G4double G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy,227 G4double stepLength,228 const G4Material* mat,229 const G4ParticleDefinition* part)230 { 231 if(!isInitialised) Initialisation(); 236 inline G4double 237 G4EnergyLossForExtrapolator::AverageScatteringAngle(G4double kinEnergy, 238 G4double stepLength, 239 const G4Material* mat, 240 const G4ParticleDefinition* part) 241 { 232 242 G4double theta = 0.0; 233 if(mat && part && kinEnergy > 0.0) { 234 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength); 235 if(step > 0.001*radLength) theta = ComputeScatteringAngle(stepLength); 243 if(SetupKinematics(part, mat, kinEnergy)) { 244 G4double t = stepLength/radLength; 245 G4double y = std::max(0.001, t); 246 theta = 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(y))/(beta2*gam*mass); 236 247 } 237 248 return theta; … … 240 251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 241 252 242 inline G4double G4EnergyLossForExtrapolator::ComputeScatteringAngle(G4double x) 243 { 244 G4double t = x/radLength; 245 return 19.23*MeV*std::sqrt(charge2*t)*(1.0 + 0.038*std::log(t))/(beta2*gam*mass); 246 } 253 inline G4double 254 G4EnergyLossForExtrapolator::ComputeTrueStep(const G4Material* mat, 255 const G4ParticleDefinition* part, 256 G4double kinEnergy, 257 G4double stepLength) 258 { 259 G4double theta = AverageScatteringAngle(kinEnergy,stepLength,mat,part); 260 return stepLength*std::sqrt(1.0 + 0.625*theta*theta); 261 } 247 262 248 263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 249 264 250 inline G4double G4EnergyLossForExtrapolator::EnergyDispersion(251 265 inline 266 G4double G4EnergyLossForExtrapolator::EnergyDispersion(G4double kinEnergy, 252 267 G4double stepLength, 253 268 const G4Material* mat, 254 269 const G4ParticleDefinition* part) 255 270 { 256 if(!isInitialised) Initialisation();257 271 G4double sig2 = 0.0; 258 if( mat && part) {272 if(SetupKinematics(part, mat, kinEnergy)) { 259 273 G4double step = ComputeTrueStep(mat,part,kinEnergy,stepLength); 260 sig2 = (1.0/beta2 - 0.5)* twopi_mc2_rcl2 * tmax*step * electronDensity *charge2;274 sig2 = (1.0/beta2 - 0.5)*twopi_mc2_rcl2*tmax*step*electronDensity*charge2; 261 275 } 262 276 return sig2; … … 269 283 { 270 284 G4double res = 0.0; 271 bool b;272 res = ((*table)[index])->GetValue(x, b);285 G4bool b; 286 if(table) res = ((*table)[index])->GetValue(x, b); 273 287 return res; 274 288 }
Note: See TracChangeset
for help on using the changeset viewer.