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 // GEANT4 Class header file 28 // GEANT4 Class header file 29 // 29 // 30 // 30 // 31 // File name: G4VMscModel 31 // File name: G4VMscModel 32 // 32 // 33 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 34 // 34 // 35 // Creation date: 07.03.2008 35 // Creation date: 07.03.2008 36 // 36 // 37 // Modifications: 37 // Modifications: 38 // 07.04.2009 V.Ivanchenko moved msc methods f 38 // 07.04.2009 V.Ivanchenko moved msc methods from G4VEmModel to G4VMscModel 39 // 26.03.2012 V.Ivanchenko added transport x-s 39 // 26.03.2012 V.Ivanchenko added transport x-section pointer and Get?Set methods 40 // 40 // 41 // Class Description: 41 // Class Description: 42 // 42 // 43 // General interface to msc models 43 // General interface to msc models 44 44 45 // ------------------------------------------- 45 // ------------------------------------------------------------------- 46 // 46 // 47 #ifndef G4VMscModel_h 47 #ifndef G4VMscModel_h 48 #define G4VMscModel_h 1 48 #define G4VMscModel_h 1 49 49 50 #include <CLHEP/Units/SystemOfUnits.h> 50 #include <CLHEP/Units/SystemOfUnits.h> 51 51 52 #include "G4VEmModel.hh" 52 #include "G4VEmModel.hh" 53 #include "G4MscStepLimitType.hh" 53 #include "G4MscStepLimitType.hh" 54 #include "globals.hh" 54 #include "globals.hh" 55 #include "G4ThreeVector.hh" 55 #include "G4ThreeVector.hh" 56 #include "G4Track.hh" 56 #include "G4Track.hh" 57 #include "G4SafetyHelper.hh" 57 #include "G4SafetyHelper.hh" >> 58 #include "G4VEnergyLossProcess.hh" 58 #include "G4PhysicsTable.hh" 59 #include "G4PhysicsTable.hh" 59 #include "G4ThreeVector.hh" 60 #include "G4ThreeVector.hh" 60 #include <vector> 61 #include <vector> 61 62 62 class G4ParticleChangeForMSC; 63 class G4ParticleChangeForMSC; 63 class G4ParticleDefinition; 64 class G4ParticleDefinition; 64 class G4VEnergyLossProcess; << 65 65 66 class G4VMscModel : public G4VEmModel 66 class G4VMscModel : public G4VEmModel 67 { 67 { 68 68 69 public: 69 public: 70 70 71 explicit G4VMscModel(const G4String& nam); 71 explicit G4VMscModel(const G4String& nam); 72 72 73 ~G4VMscModel() override; 73 ~G4VMscModel() override; 74 74 75 virtual G4double ComputeTruePathLengthLimit( 75 virtual G4double ComputeTruePathLengthLimit(const G4Track& track, 76 G4double& stepLimit) = 0; 76 G4double& stepLimit) = 0; 77 77 78 virtual G4double ComputeGeomPathLength(G4dou 78 virtual G4double ComputeGeomPathLength(G4double truePathLength) = 0; 79 79 80 virtual G4double ComputeTrueStepLength(G4dou 80 virtual G4double ComputeTrueStepLength(G4double geomPathLength) = 0; 81 81 82 virtual G4ThreeVector& SampleScattering(cons 82 virtual G4ThreeVector& SampleScattering(const G4ThreeVector&, 83 G4double safety) = 0; 83 G4double safety) = 0; 84 84 85 void InitialiseParameters(const G4ParticleDe 85 void InitialiseParameters(const G4ParticleDefinition*); 86 86 87 void DumpParameters(std::ostream& out) const << 88 << 89 // empty method 87 // empty method 90 void SampleSecondaries(std::vector<G4Dynamic 88 void SampleSecondaries(std::vector<G4DynamicParticle*>*, 91 const G4MaterialCutsCouple*, 89 const G4MaterialCutsCouple*, 92 const G4DynamicParticle*, 90 const G4DynamicParticle*, 93 G4double tmin, G4double tmax) override; 91 G4double tmin, G4double tmax) override; 94 92 95 //========================================== 93 //================================================================ 96 // Set parameters of multiple scattering mo 94 // Set parameters of multiple scattering models 97 //========================================== 95 //================================================================ 98 96 99 inline void SetStepLimitType(G4MscStepLimitT 97 inline void SetStepLimitType(G4MscStepLimitType); 100 98 101 inline void SetLateralDisplasmentFlag(G4bool 99 inline void SetLateralDisplasmentFlag(G4bool val); 102 100 103 inline void SetRangeFactor(G4double); 101 inline void SetRangeFactor(G4double); 104 102 105 inline void SetGeomFactor(G4double); 103 inline void SetGeomFactor(G4double); 106 104 107 inline void SetSkin(G4double); 105 inline void SetSkin(G4double); 108 106 109 inline void SetLambdaLimit(G4double); 107 inline void SetLambdaLimit(G4double); 110 108 111 inline void SetSafetyFactor(G4double); 109 inline void SetSafetyFactor(G4double); 112 110 113 inline void SetSampleZ(G4bool); 111 inline void SetSampleZ(G4bool); 114 112 115 //========================================== 113 //================================================================ 116 // Get/Set access to Physics Tables 114 // Get/Set access to Physics Tables 117 //========================================== 115 //================================================================ 118 116 119 inline G4VEnergyLossProcess* GetIonisation() 117 inline G4VEnergyLossProcess* GetIonisation() const; 120 118 121 inline void SetIonisation(G4VEnergyLossProce 119 inline void SetIonisation(G4VEnergyLossProcess*, 122 const G4ParticleDefinition* part); 120 const G4ParticleDefinition* part); 123 121 124 //========================================== 122 //================================================================ 125 // Run time methods 123 // Run time methods 126 //========================================== 124 //================================================================ 127 125 128 protected: 126 protected: 129 127 130 // initialisation of the ParticleChange for 128 // initialisation of the ParticleChange for the model 131 // initialisation of interface with geometry 129 // initialisation of interface with geometry and ionisation 132 G4ParticleChangeForMSC* 130 G4ParticleChangeForMSC* 133 GetParticleChangeForMSC(const G4ParticleDefi 131 GetParticleChangeForMSC(const G4ParticleDefinition* p = nullptr); 134 132 135 // convert true length to geometry length 133 // convert true length to geometry length 136 inline G4double ConvertTrueToGeom(G4double& 134 inline G4double ConvertTrueToGeom(G4double& tLength, G4double& gLength); 137 135 138 // should be set before initialisation << 139 inline void SetUseSplineForMSC(G4bool val); << 140 << 141 public: 136 public: 142 137 143 // compute safety 138 // compute safety 144 inline G4double ComputeSafety(const G4ThreeV 139 inline G4double ComputeSafety(const G4ThreeVector& position, 145 G4double limit= DBL_MAX); 140 G4double limit= DBL_MAX); 146 141 147 // compute linear distance to a geometry bou 142 // compute linear distance to a geometry boundary 148 inline G4double ComputeGeomLimit(const G4Tra 143 inline G4double ComputeGeomLimit(const G4Track&, G4double& presafety, 149 G4double limit); 144 G4double limit); 150 145 151 G4double GetDEDX(const G4ParticleDefinition* << 146 inline G4double GetDEDX(const G4ParticleDefinition* part, 152 G4double kineticEner 147 G4double kineticEnergy, 153 const G4MaterialCuts 148 const G4MaterialCutsCouple* couple); 154 << 149 inline G4double GetDEDX(const G4ParticleDefinition* part, 155 G4double GetDEDX(const G4ParticleDefinition* << 156 G4double kineticEner 150 G4double kineticEnergy, 157 const G4MaterialCuts 151 const G4MaterialCutsCouple* couple, 158 G4double logKineticE 152 G4double logKineticEnergy); 159 153 160 G4double GetRange(const G4ParticleDefinition << 154 inline G4double GetRange(const G4ParticleDefinition* part, 161 G4double kineticEne 155 G4double kineticEnergy, 162 const G4MaterialCut 156 const G4MaterialCutsCouple* couple); 163 << 157 inline G4double GetRange(const G4ParticleDefinition* part, 164 G4double GetRange(const G4ParticleDefinition << 165 G4double kineticEne 158 G4double kineticEnergy, 166 const G4MaterialCut 159 const G4MaterialCutsCouple* couple, 167 G4double logKinetic 160 G4double logKineticEnergy); 168 161 169 G4double GetEnergy(const G4ParticleDefinitio << 162 inline G4double GetEnergy(const G4ParticleDefinition* part, 170 G4double range, 163 G4double range, 171 const G4MaterialCutsCouple* couple); 164 const G4MaterialCutsCouple* couple); 172 165 173 // G4MaterialCutsCouple should be defined be 166 // G4MaterialCutsCouple should be defined before call to this method 174 inline 167 inline 175 G4double GetTransportMeanFreePath(const G4Pa 168 G4double GetTransportMeanFreePath(const G4ParticleDefinition* part, 176 G4double k 169 G4double kinEnergy); 177 << 178 inline 170 inline 179 G4double GetTransportMeanFreePath(const G4Pa 171 G4double GetTransportMeanFreePath(const G4ParticleDefinition* part, 180 G4double k 172 G4double kinEnergy, 181 G4double l 173 G4double logKinEnergy); 182 174 >> 175 private: >> 176 183 // hide assignment operator 177 // hide assignment operator 184 G4VMscModel & operator=(const G4VMscModel & 178 G4VMscModel & operator=(const G4VMscModel &right) = delete; 185 G4VMscModel(const G4VMscModel&) = delete; 179 G4VMscModel(const G4VMscModel&) = delete; 186 180 187 private: << 181 G4SafetyHelper* safetyHelper; 188 << 182 G4VEnergyLossProcess* ionisation; 189 G4SafetyHelper* safetyHelper = nullptr; << 183 const G4ParticleDefinition* currentPart; 190 G4VEnergyLossProcess* ionisation = nullptr; << 184 191 const G4ParticleDefinition* currentPart = nu << 185 G4double dedx; 192 << 186 G4double localtkin; 193 G4double dedx = 0.0; << 187 G4double localrange; 194 G4double localtkin = 0.0; << 195 G4double localrange = DBL_MAX; << 196 188 197 protected: 189 protected: 198 190 199 G4double facrange = 0.04; << 191 G4double facrange; 200 G4double facgeom = 2.5; << 192 G4double facgeom; 201 G4double facsafety = 0.6; << 193 G4double facsafety; 202 G4double skin = 1.0; << 194 G4double skin; 203 G4double dtrl = 0.05; << 195 G4double dtrl; 204 G4double lambdalimit; 196 G4double lambdalimit; 205 G4double geomMin; 197 G4double geomMin; 206 G4double geomMax; 198 G4double geomMax; 207 199 208 G4ThreeVector fDisplacement; << 200 G4ThreeVector fDisplacement; 209 G4MscStepLimitType steppingAlgorithm; 201 G4MscStepLimitType steppingAlgorithm; 210 202 211 G4bool samplez = false; << 203 G4bool samplez; 212 G4bool latDisplasment = true; << 204 G4bool latDisplasment; 213 << 214 private: << 215 205 216 G4bool useSpline = true; << 217 }; 206 }; 218 207 219 //....oooOO0OOooo........oooOO0OOooo........oo 208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 220 //....oooOO0OOooo........oooOO0OOooo........oo 209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 221 210 222 inline void G4VMscModel::SetLateralDisplasment 211 inline void G4VMscModel::SetLateralDisplasmentFlag(G4bool val) 223 { 212 { 224 if(!IsLocked()) { latDisplasment = val; } 213 if(!IsLocked()) { latDisplasment = val; } 225 } 214 } 226 215 227 //....oooOO0OOooo........oooOO0OOooo........oo 216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 228 217 229 inline void G4VMscModel::SetSkin(G4double val) 218 inline void G4VMscModel::SetSkin(G4double val) 230 { 219 { 231 if(!IsLocked()) { skin = val; } 220 if(!IsLocked()) { skin = val; } 232 } 221 } 233 222 234 //....oooOO0OOooo........oooOO0OOooo........oo 223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 235 224 236 inline void G4VMscModel::SetRangeFactor(G4doub 225 inline void G4VMscModel::SetRangeFactor(G4double val) 237 { 226 { 238 if(!IsLocked()) { facrange = val; } 227 if(!IsLocked()) { facrange = val; } 239 } 228 } 240 229 241 //....oooOO0OOooo........oooOO0OOooo........oo 230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 242 231 243 inline void G4VMscModel::SetGeomFactor(G4doubl 232 inline void G4VMscModel::SetGeomFactor(G4double val) 244 { 233 { 245 if(!IsLocked()) { facgeom = val; } 234 if(!IsLocked()) { facgeom = val; } 246 } 235 } 247 236 248 //....oooOO0OOooo........oooOO0OOooo........oo 237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 249 238 250 inline void G4VMscModel::SetLambdaLimit(G4doub 239 inline void G4VMscModel::SetLambdaLimit(G4double val) 251 { 240 { 252 if(!IsLocked()) { lambdalimit = val; } 241 if(!IsLocked()) { lambdalimit = val; } 253 } 242 } 254 243 255 //....oooOO0OOooo........oooOO0OOooo........oo 244 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 256 245 257 inline void G4VMscModel::SetSafetyFactor(G4dou 246 inline void G4VMscModel::SetSafetyFactor(G4double val) 258 { 247 { 259 if(!IsLocked()) { facsafety = val; } 248 if(!IsLocked()) { facsafety = val; } 260 } 249 } 261 250 262 //....oooOO0OOooo........oooOO0OOooo........oo 251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 263 252 264 inline void G4VMscModel::SetStepLimitType(G4Ms 253 inline void G4VMscModel::SetStepLimitType(G4MscStepLimitType val) 265 { 254 { 266 if(!IsLocked()) { steppingAlgorithm = val; } 255 if(!IsLocked()) { steppingAlgorithm = val; } 267 } 256 } 268 257 269 //....oooOO0OOooo........oooOO0OOooo........oo 258 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 270 259 271 inline void G4VMscModel::SetSampleZ(G4bool val 260 inline void G4VMscModel::SetSampleZ(G4bool val) 272 { 261 { 273 if(!IsLocked()) { samplez = val; } 262 if(!IsLocked()) { samplez = val; } 274 } 263 } 275 264 276 //....oooOO0OOooo........oooOO0OOooo........oo 265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 277 266 278 inline G4double G4VMscModel::ComputeSafety(con 267 inline G4double G4VMscModel::ComputeSafety(const G4ThreeVector& position, 279 G4double limit) 268 G4double limit) 280 { 269 { 281 return safetyHelper->ComputeSafety(position 270 return safetyHelper->ComputeSafety(position, limit); 282 } 271 } 283 272 284 //....oooOO0OOooo........oooOO0OOooo........oo 273 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 285 274 286 inline G4double G4VMscModel::ConvertTrueToGeom 275 inline G4double G4VMscModel::ConvertTrueToGeom(G4double& tlength, 287 G4double& glength) 276 G4double& glength) 288 { 277 { 289 glength = ComputeGeomPathLength(tlength); 278 glength = ComputeGeomPathLength(tlength); 290 // should return true length 279 // should return true length 291 return tlength; 280 return tlength; 292 } 281 } 293 282 294 //....oooOO0OOooo........oooOO0OOooo........oo 283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 295 284 296 inline G4double G4VMscModel::ComputeGeomLimit( 285 inline G4double G4VMscModel::ComputeGeomLimit(const G4Track& track, 297 G4double& presafety, 286 G4double& presafety, 298 G4double limit) 287 G4double limit) 299 { 288 { 300 return safetyHelper->CheckNextStep( 289 return safetyHelper->CheckNextStep( 301 track.GetStep()->GetPreStepPoint()-> 290 track.GetStep()->GetPreStepPoint()->GetPosition(), 302 track.GetMomentumDirection(), 291 track.GetMomentumDirection(), 303 limit, presafety); 292 limit, presafety); 304 } 293 } 305 294 306 //....oooOO0OOooo........oooOO0OOooo........oo 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 307 296 >> 297 inline G4double >> 298 G4VMscModel::GetDEDX(const G4ParticleDefinition* part, G4double kinEnergy, >> 299 const G4MaterialCutsCouple* couple) >> 300 { >> 301 G4double x; >> 302 if (ionisation) { >> 303 x = ionisation->GetDEDX(kinEnergy, couple); >> 304 } else { >> 305 const G4double q = part->GetPDGCharge()*inveplus; >> 306 x = dedx*q*q; >> 307 } >> 308 return x; >> 309 } >> 310 >> 311 inline G4double >> 312 G4VMscModel::GetDEDX(const G4ParticleDefinition* part, G4double kinEnergy, >> 313 const G4MaterialCutsCouple* couple, G4double logKinEnergy) >> 314 { >> 315 G4double x; >> 316 if (ionisation) { >> 317 x = ionisation->GetDEDX(kinEnergy, couple, logKinEnergy); >> 318 } else { >> 319 const G4double q = part->GetPDGCharge()*inveplus; >> 320 x = dedx*q*q; >> 321 } >> 322 return x; >> 323 } >> 324 >> 325 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 326 >> 327 inline G4double >> 328 G4VMscModel::GetRange(const G4ParticleDefinition* part,G4double kinEnergy, >> 329 const G4MaterialCutsCouple* couple) >> 330 { >> 331 //G4cout << "G4VMscModel::GetRange E(MeV)= " << kinEnergy << " " >> 332 // << ionisation << " " << part->GetParticleName() >> 333 // << G4endl; >> 334 localtkin = kinEnergy; >> 335 if (ionisation) { >> 336 localrange = ionisation->GetRangeForLoss(kinEnergy, couple); >> 337 } else { >> 338 const G4double q = part->GetPDGCharge()*inveplus; >> 339 localrange = kinEnergy/(dedx*q*q*couple->GetMaterial()->GetDensity()); >> 340 } >> 341 //G4cout << "R(mm)= " << localrange << " " << ionisation << G4endl; >> 342 return localrange; >> 343 } >> 344 >> 345 inline G4double >> 346 G4VMscModel::GetRange(const G4ParticleDefinition* part,G4double kinEnergy, >> 347 const G4MaterialCutsCouple* couple, G4double logKinEnergy) >> 348 { >> 349 //G4cout << "G4VMscModel::GetRange E(MeV)= " << kinEnergy << " " >> 350 // << ionisation << " " << part->GetParticleName() >> 351 // << G4endl; >> 352 localtkin = kinEnergy; >> 353 if (ionisation) { >> 354 localrange = ionisation->GetRangeForLoss(kinEnergy, couple, logKinEnergy); >> 355 } else { >> 356 const G4double q = part->GetPDGCharge()*inveplus; >> 357 localrange = kinEnergy/(dedx*q*q*couple->GetMaterial()->GetDensity()); >> 358 } >> 359 //G4cout << "R(mm)= " << localrange << " " << ionisation << G4endl; >> 360 return localrange; >> 361 } >> 362 >> 363 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 364 >> 365 inline G4double >> 366 G4VMscModel::GetEnergy(const G4ParticleDefinition* part, >> 367 G4double range, const G4MaterialCutsCouple* couple) >> 368 { >> 369 G4double e; >> 370 //G4cout << "G4VMscModel::GetEnergy R(mm)= " << range << " " << ionisation >> 371 // << " Rlocal(mm)= " << localrange << " Elocal(MeV)= " << localtkin >> 372 // << G4endl; >> 373 if(ionisation) { e = ionisation->GetKineticEnergy(range, couple); } >> 374 else { >> 375 e = localtkin; >> 376 if(localrange > range) { >> 377 G4double q = part->GetPDGCharge()*inveplus; >> 378 e -= (localrange - range)*dedx*q*q*couple->GetMaterial()->GetDensity(); >> 379 } >> 380 } >> 381 return e; >> 382 } >> 383 >> 384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 385 308 inline G4VEnergyLossProcess* G4VMscModel::GetI 386 inline G4VEnergyLossProcess* G4VMscModel::GetIonisation() const 309 { 387 { 310 return ionisation; 388 return ionisation; 311 } 389 } 312 390 313 //....oooOO0OOooo........oooOO0OOooo........oo 391 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 314 392 315 inline void G4VMscModel::SetIonisation(G4VEner 393 inline void G4VMscModel::SetIonisation(G4VEnergyLossProcess* p, 316 const G4ParticleDefinition* par 394 const G4ParticleDefinition* part) 317 { 395 { 318 ionisation = p; 396 ionisation = p; 319 currentPart = part; 397 currentPart = part; 320 } 398 } 321 399 322 //....oooOO0OOooo........oooOO0OOooo........oo 400 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 323 401 324 inline G4double 402 inline G4double 325 G4VMscModel::GetTransportMeanFreePath(const G4 403 G4VMscModel::GetTransportMeanFreePath(const G4ParticleDefinition* part, 326 G4double 404 G4double ekin) 327 { 405 { 328 G4double x; 406 G4double x; 329 if (nullptr != xSectionTable) { << 407 if (xSectionTable) { 330 x = pFactor*(*xSectionTable)[basedCoupleIn << 408 const G4int idx = CurrentCouple()->GetIndex(); >> 409 x = (*xSectionTable)[idx]->Value(ekin, idxTable)/(ekin*ekin); 331 } else { 410 } else { 332 x = pFactor*CrossSectionPerVolume(pBaseMat << 411 x = CrossSectionPerVolume(CurrentCouple()->GetMaterial(), part, ekin, >> 412 0.0, DBL_MAX); 333 } 413 } 334 return (x > 0.0) ? 1.0/x : DBL_MAX; 414 return (x > 0.0) ? 1.0/x : DBL_MAX; 335 } 415 } 336 416 337 //....oooOO0OOooo........oooOO0OOooo........oo << 338 << 339 inline G4double 417 inline G4double 340 G4VMscModel::GetTransportMeanFreePath(const G4 418 G4VMscModel::GetTransportMeanFreePath(const G4ParticleDefinition* part, 341 G4double 419 G4double ekin, G4double logekin) 342 { 420 { 343 G4double x; 421 G4double x; 344 if (nullptr != xSectionTable) { << 422 if (xSectionTable) { 345 x = pFactor*(*xSectionTable)[basedCoupleIn << 423 const G4int idx = CurrentCouple()->GetIndex(); >> 424 x = (*xSectionTable)[idx]->LogVectorValue(ekin, logekin)/(ekin*ekin); 346 } else { 425 } else { 347 x = pFactor*CrossSectionPerVolume(pBaseMat << 426 x = CrossSectionPerVolume(CurrentCouple()->GetMaterial(), part, ekin, >> 427 0.0, DBL_MAX); 348 } 428 } 349 return (x > 0.0) ? 1.0/x : DBL_MAX; 429 return (x > 0.0) ? 1.0/x : DBL_MAX; 350 } 430 } 351 431 352 //....oooOO0OOooo........oooOO0OOooo........oo 432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 353 433 354 inline void G4VMscModel::SetUseSplineForMSC(G4 << 355 { << 356 useSpline = val; << 357 } << 358 << 359 //....oooOO0OOooo........oooOO0OOooo........oo << 360 << 361 #endif 434 #endif >> 435 362 436