[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1196] | 26 | // $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $ |
---|
[1228] | 27 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[819] | 28 | // |
---|
| 29 | // ------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // GEANT4 Class header file |
---|
| 32 | // |
---|
| 33 | // |
---|
| 34 | // File name: G4VMultipleScattering |
---|
| 35 | // |
---|
| 36 | // Author: Vladimir Ivanchenko on base of Laszlo Urban code |
---|
| 37 | // |
---|
| 38 | // Creation date: 12.03.2002 |
---|
| 39 | // |
---|
| 40 | // Modifications: |
---|
| 41 | // |
---|
| 42 | // 16-07-03 Update GetRange interface (V.Ivanchenko) |
---|
| 43 | // |
---|
| 44 | // |
---|
| 45 | // Class Description: |
---|
| 46 | // |
---|
| 47 | // It is the generic process of multiple scattering it includes common |
---|
| 48 | // part of calculations for all charged particles |
---|
| 49 | // |
---|
| 50 | // 26-11-03 bugfix in AlongStepDoIt (L.Urban) |
---|
| 51 | // 25-05-04 add protection against case when range is less than steplimit (VI) |
---|
| 52 | // 30-06-04 make destructor virtual (V.Ivanchenko) |
---|
| 53 | // 27-08-04 Add InitialiseForRun method (V.Ivanchneko) |
---|
| 54 | // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) |
---|
| 55 | // 15-04-05 optimize internal interfaces (V.Ivanchenko) |
---|
| 56 | // 15-04-05 remove boundary flag (V.Ivanchenko) |
---|
| 57 | // 07-10-05 error in a protection in GetContinuousStepLimit corrected (L.Urban) |
---|
| 58 | // 27-10-05 introduce virtual function MscStepLimitation() (V.Ivanchenko) |
---|
| 59 | // 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko) |
---|
| 60 | // 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko) |
---|
| 61 | // 07-03-06 Move step limit calculation to model (V.Ivanchenko) |
---|
| 62 | // 13-05-06 Add method to access model by index (V.Ivanchenko) |
---|
| 63 | // 12-02-07 Add get/set skin (V.Ivanchenko) |
---|
| 64 | // 27-10-07 Virtual functions moved to source (V.Ivanchenko) |
---|
[961] | 65 | // 15-07-08 Reorder class members for further multi-thread development (VI) |
---|
[1055] | 66 | // 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI) |
---|
[819] | 67 | // |
---|
| 68 | |
---|
| 69 | // ------------------------------------------------------------------- |
---|
| 70 | // |
---|
| 71 | |
---|
| 72 | #ifndef G4VMultipleScattering_h |
---|
| 73 | #define G4VMultipleScattering_h 1 |
---|
| 74 | |
---|
| 75 | #include "G4VContinuousDiscreteProcess.hh" |
---|
| 76 | #include "globals.hh" |
---|
| 77 | #include "G4Material.hh" |
---|
| 78 | #include "G4MaterialCutsCouple.hh" |
---|
| 79 | #include "G4ParticleChangeForMSC.hh" |
---|
| 80 | #include "G4Track.hh" |
---|
| 81 | #include "G4Step.hh" |
---|
| 82 | #include "G4EmModelManager.hh" |
---|
[1055] | 83 | #include "G4VMscModel.hh" |
---|
[819] | 84 | #include "G4MscStepLimitType.hh" |
---|
| 85 | |
---|
| 86 | class G4ParticleDefinition; |
---|
| 87 | class G4DataVector; |
---|
| 88 | class G4PhysicsTable; |
---|
| 89 | class G4PhysicsVector; |
---|
| 90 | |
---|
| 91 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 92 | |
---|
| 93 | class G4VMultipleScattering : public G4VContinuousDiscreteProcess |
---|
| 94 | { |
---|
| 95 | public: |
---|
| 96 | |
---|
| 97 | G4VMultipleScattering(const G4String& name = "msc", |
---|
[961] | 98 | G4ProcessType type = fElectromagnetic); |
---|
[819] | 99 | |
---|
| 100 | virtual ~G4VMultipleScattering(); |
---|
| 101 | |
---|
| 102 | //------------------------------------------------------------------------ |
---|
| 103 | // Virtual methods to be implemented for the concrete model |
---|
| 104 | //------------------------------------------------------------------------ |
---|
| 105 | |
---|
| 106 | virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; |
---|
| 107 | |
---|
| 108 | virtual void PrintInfo() = 0; |
---|
| 109 | |
---|
| 110 | protected: |
---|
| 111 | |
---|
| 112 | virtual void InitialiseProcess(const G4ParticleDefinition*) = 0; |
---|
| 113 | |
---|
| 114 | public: |
---|
| 115 | |
---|
| 116 | //------------------------------------------------------------------------ |
---|
| 117 | // Generic methods common to all ContinuousDiscrete processes |
---|
| 118 | //------------------------------------------------------------------------ |
---|
| 119 | |
---|
| 120 | // Initialise for build of tables |
---|
| 121 | void PreparePhysicsTable(const G4ParticleDefinition&); |
---|
| 122 | |
---|
| 123 | // Build physics table during initialisation |
---|
| 124 | void BuildPhysicsTable(const G4ParticleDefinition&); |
---|
| 125 | |
---|
| 126 | // Print out of generic class parameters |
---|
| 127 | void PrintInfoDefinition(); |
---|
| 128 | |
---|
| 129 | // Store PhysicsTable in a file. |
---|
| 130 | // Return false in case of failure at I/O |
---|
| 131 | G4bool StorePhysicsTable(const G4ParticleDefinition*, |
---|
| 132 | const G4String& directory, |
---|
[961] | 133 | G4bool ascii = false); |
---|
[819] | 134 | |
---|
| 135 | // Retrieve Physics from a file. |
---|
| 136 | // (return true if the Physics Table can be build by using file) |
---|
| 137 | // (return false if the process has no functionality or in case of failure) |
---|
| 138 | // File name should is constructed as processName+particleName and the |
---|
| 139 | // should be placed under the directory specifed by the argument. |
---|
| 140 | G4bool RetrievePhysicsTable(const G4ParticleDefinition*, |
---|
| 141 | const G4String& directory, |
---|
[961] | 142 | G4bool ascii); |
---|
[819] | 143 | |
---|
| 144 | // The function overloads the corresponding function of the base |
---|
| 145 | // class.It limits the step near to boundaries only |
---|
| 146 | // and invokes the method GetMscContinuousStepLimit at every step. |
---|
[1055] | 147 | G4double AlongStepGetPhysicalInteractionLength( |
---|
[819] | 148 | const G4Track&, |
---|
[961] | 149 | G4double previousStepSize, |
---|
| 150 | G4double currentMinimalStep, |
---|
| 151 | G4double& currentSafety, |
---|
| 152 | G4GPILSelection* selection); |
---|
[819] | 153 | |
---|
| 154 | // The function overloads the corresponding function of the base |
---|
| 155 | // class. |
---|
[1196] | 156 | inline G4double PostStepGetPhysicalInteractionLength( |
---|
[819] | 157 | const G4Track&, |
---|
| 158 | G4double previousStepSize, |
---|
| 159 | G4ForceCondition* condition); |
---|
| 160 | |
---|
[1196] | 161 | // Along step actions |
---|
| 162 | inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); |
---|
| 163 | |
---|
| 164 | // Post step actions |
---|
| 165 | inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); |
---|
| 166 | |
---|
[819] | 167 | // This method does not used for tracking, it is intended only for tests |
---|
| 168 | inline G4double ContinuousStepLimit(const G4Track& track, |
---|
| 169 | G4double previousStepSize, |
---|
| 170 | G4double currentMinimalStep, |
---|
| 171 | G4double& currentSafety); |
---|
| 172 | |
---|
| 173 | //------------------------------------------------------------------------ |
---|
| 174 | // Specific methods to build and access Physics Tables |
---|
| 175 | //------------------------------------------------------------------------ |
---|
| 176 | |
---|
| 177 | // Build empty Physics Vector |
---|
| 178 | G4PhysicsVector* PhysicsVector(const G4MaterialCutsCouple*); |
---|
| 179 | |
---|
| 180 | inline void SetBinning(G4int nbins); |
---|
| 181 | inline G4int Binning() const; |
---|
| 182 | |
---|
| 183 | inline void SetMinKinEnergy(G4double e); |
---|
| 184 | inline G4double MinKinEnergy() const; |
---|
| 185 | |
---|
| 186 | inline void SetMaxKinEnergy(G4double e); |
---|
| 187 | inline G4double MaxKinEnergy() const; |
---|
| 188 | |
---|
| 189 | inline void SetBuildLambdaTable(G4bool val); |
---|
| 190 | |
---|
| 191 | inline G4PhysicsTable* LambdaTable() const; |
---|
| 192 | |
---|
[1055] | 193 | // access particle type |
---|
[819] | 194 | inline const G4ParticleDefinition* Particle() const; |
---|
| 195 | |
---|
| 196 | //------------------------------------------------------------------------ |
---|
| 197 | // Specific methods to set, access, modify models |
---|
| 198 | //------------------------------------------------------------------------ |
---|
| 199 | |
---|
[1055] | 200 | protected: |
---|
| 201 | // Select model in run time |
---|
| 202 | inline G4VEmModel* SelectModel(G4double kinEnergy); |
---|
[819] | 203 | |
---|
[1055] | 204 | public: |
---|
| 205 | // Select model in run time |
---|
[819] | 206 | inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, |
---|
| 207 | size_t& idxRegion) const; |
---|
| 208 | |
---|
[1055] | 209 | // Add model for region, smaller value of order defines which |
---|
| 210 | // model will be selected for a given energy interval |
---|
| 211 | void AddEmModel(G4int order, G4VEmModel*, const G4Region* region = 0); |
---|
[961] | 212 | |
---|
[1196] | 213 | // Assign a model to a process |
---|
| 214 | void SetModel(G4VMscModel*, G4int index = 1); |
---|
| 215 | |
---|
| 216 | // return the assigned model |
---|
| 217 | G4VMscModel* Model(G4int index = 1); |
---|
| 218 | |
---|
[1055] | 219 | // Access to models by index |
---|
[1196] | 220 | G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false) const; |
---|
[1055] | 221 | |
---|
[819] | 222 | //------------------------------------------------------------------------ |
---|
[1055] | 223 | // Get/Set parameters for simulation of multiple scattering |
---|
[819] | 224 | //------------------------------------------------------------------------ |
---|
| 225 | |
---|
[1055] | 226 | inline G4bool LateralDisplasmentFlag() const; |
---|
[819] | 227 | inline void SetLateralDisplasmentFlag(G4bool val); |
---|
| 228 | |
---|
[1055] | 229 | inline G4double Skin() const; |
---|
[819] | 230 | inline void SetSkin(G4double val); |
---|
| 231 | |
---|
[1055] | 232 | inline G4double RangeFactor() const; |
---|
[819] | 233 | inline void SetRangeFactor(G4double val); |
---|
| 234 | |
---|
[1055] | 235 | inline G4double GeomFactor() const; |
---|
[819] | 236 | inline void SetGeomFactor(G4double val); |
---|
| 237 | |
---|
[1055] | 238 | inline G4double PolarAngleLimit() const; |
---|
[961] | 239 | inline void SetPolarAngleLimit(G4double val); |
---|
| 240 | |
---|
[1055] | 241 | inline G4MscStepLimitType StepLimitType() const; |
---|
[819] | 242 | inline void SetStepLimitType(G4MscStepLimitType val); |
---|
| 243 | |
---|
[1055] | 244 | //------------------------------------------------------------------------ |
---|
| 245 | // Run time methods |
---|
| 246 | //------------------------------------------------------------------------ |
---|
| 247 | |
---|
[819] | 248 | protected: |
---|
| 249 | |
---|
[1055] | 250 | // This method is not used for tracking, it returns mean free path value |
---|
[819] | 251 | G4double GetMeanFreePath(const G4Track& track, |
---|
| 252 | G4double, |
---|
| 253 | G4ForceCondition* condition); |
---|
| 254 | |
---|
| 255 | // This method is not used for tracking, it returns step limit |
---|
| 256 | G4double GetContinuousStepLimit(const G4Track& track, |
---|
| 257 | G4double previousStepSize, |
---|
| 258 | G4double currentMinimalStep, |
---|
| 259 | G4double& currentSafety); |
---|
| 260 | |
---|
[1055] | 261 | // This method returns inversed transport cross section |
---|
[961] | 262 | inline G4double GetLambda(const G4ParticleDefinition* p, |
---|
| 263 | G4double& kineticEnergy); |
---|
[819] | 264 | |
---|
[1055] | 265 | // defines current material in run time |
---|
| 266 | inline void DefineMaterial(const G4MaterialCutsCouple* couple); |
---|
[1007] | 267 | |
---|
| 268 | inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const; |
---|
| 269 | |
---|
[961] | 270 | private: |
---|
[819] | 271 | |
---|
[961] | 272 | // hide assignment operator |
---|
| 273 | G4VMultipleScattering(G4VMultipleScattering &); |
---|
| 274 | G4VMultipleScattering & operator=(const G4VMultipleScattering &right); |
---|
[819] | 275 | |
---|
[961] | 276 | // ======== Parameters of the class fixed at construction ========= |
---|
[819] | 277 | |
---|
[961] | 278 | G4EmModelManager* modelManager; |
---|
| 279 | G4bool buildLambdaTable; |
---|
[819] | 280 | |
---|
[961] | 281 | // ======== Parameters of the class fixed at initialisation ======= |
---|
[819] | 282 | |
---|
[1196] | 283 | std::vector<G4VMscModel*> mscModels; |
---|
| 284 | |
---|
[961] | 285 | G4PhysicsTable* theLambdaTable; |
---|
| 286 | const G4ParticleDefinition* firstParticle; |
---|
[819] | 287 | |
---|
[961] | 288 | G4MscStepLimitType stepLimit; |
---|
[819] | 289 | |
---|
[961] | 290 | G4double minKinEnergy; |
---|
| 291 | G4double maxKinEnergy; |
---|
| 292 | G4double skin; |
---|
| 293 | G4double facrange; |
---|
| 294 | G4double facgeom; |
---|
| 295 | G4double polarAngleLimit; |
---|
[819] | 296 | |
---|
[961] | 297 | G4int nBins; |
---|
[819] | 298 | |
---|
[961] | 299 | G4bool latDisplasment; |
---|
[1196] | 300 | G4bool isIon; |
---|
[961] | 301 | |
---|
| 302 | // ======== Cashed values - may be state dependent ================ |
---|
| 303 | |
---|
[819] | 304 | protected: |
---|
| 305 | |
---|
| 306 | G4GPILSelection valueGPILSelectionMSC; |
---|
| 307 | G4ParticleChangeForMSC fParticleChange; |
---|
| 308 | |
---|
| 309 | private: |
---|
| 310 | |
---|
[1055] | 311 | G4VMscModel* currentModel; |
---|
[819] | 312 | |
---|
| 313 | // cache |
---|
| 314 | const G4ParticleDefinition* currentParticle; |
---|
| 315 | const G4MaterialCutsCouple* currentCouple; |
---|
| 316 | size_t currentMaterialIndex; |
---|
| 317 | |
---|
[961] | 318 | }; |
---|
[819] | 319 | |
---|
[961] | 320 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 321 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
[819] | 322 | |
---|
[1055] | 323 | inline G4double G4VMultipleScattering::ContinuousStepLimit( |
---|
| 324 | const G4Track& track, |
---|
| 325 | G4double previousStepSize, |
---|
| 326 | G4double currentMinimalStep, |
---|
| 327 | G4double& currentSafety) |
---|
[961] | 328 | { |
---|
[1196] | 329 | return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep, |
---|
| 330 | currentSafety); |
---|
[961] | 331 | } |
---|
[819] | 332 | |
---|
[961] | 333 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
[819] | 334 | |
---|
[1055] | 335 | inline void G4VMultipleScattering::SetBinning(G4int nbins) |
---|
[961] | 336 | { |
---|
[1055] | 337 | nBins = nbins; |
---|
[961] | 338 | } |
---|
| 339 | |
---|
[819] | 340 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 341 | |
---|
[1055] | 342 | inline G4int G4VMultipleScattering::Binning() const |
---|
[819] | 343 | { |
---|
[1055] | 344 | return nBins; |
---|
[819] | 345 | } |
---|
| 346 | |
---|
| 347 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 348 | |
---|
[1055] | 349 | inline void G4VMultipleScattering::SetMinKinEnergy(G4double e) |
---|
[819] | 350 | { |
---|
[1055] | 351 | minKinEnergy = e; |
---|
[819] | 352 | } |
---|
| 353 | |
---|
| 354 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 355 | |
---|
[1055] | 356 | inline G4double G4VMultipleScattering::MinKinEnergy() const |
---|
[819] | 357 | { |
---|
[1055] | 358 | return minKinEnergy; |
---|
[819] | 359 | } |
---|
| 360 | |
---|
| 361 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 362 | |
---|
[1055] | 363 | inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e) |
---|
[819] | 364 | { |
---|
[1055] | 365 | maxKinEnergy = e; |
---|
[819] | 366 | } |
---|
| 367 | |
---|
| 368 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 369 | |
---|
[1055] | 370 | inline G4double G4VMultipleScattering::MaxKinEnergy() const |
---|
[819] | 371 | { |
---|
[1055] | 372 | return maxKinEnergy; |
---|
[819] | 373 | } |
---|
| 374 | |
---|
| 375 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 376 | |
---|
[1055] | 377 | inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val) |
---|
[819] | 378 | { |
---|
[1055] | 379 | buildLambdaTable = val; |
---|
[819] | 380 | } |
---|
| 381 | |
---|
| 382 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 383 | |
---|
[1055] | 384 | inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const |
---|
[819] | 385 | { |
---|
[1055] | 386 | return theLambdaTable; |
---|
[819] | 387 | } |
---|
| 388 | |
---|
| 389 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 390 | |
---|
[1055] | 391 | inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const |
---|
[819] | 392 | { |
---|
[1055] | 393 | return currentParticle; |
---|
[819] | 394 | } |
---|
| 395 | |
---|
| 396 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 397 | |
---|
[1055] | 398 | inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy) |
---|
[819] | 399 | { |
---|
[1055] | 400 | return modelManager->SelectModel(kinEnergy, currentMaterialIndex); |
---|
[819] | 401 | } |
---|
| 402 | |
---|
| 403 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 404 | |
---|
[1055] | 405 | inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial( |
---|
| 406 | G4double kinEnergy, size_t& idxRegion) const |
---|
[819] | 407 | { |
---|
[1055] | 408 | return modelManager->SelectModel(kinEnergy, idxRegion); |
---|
[819] | 409 | } |
---|
| 410 | |
---|
| 411 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 412 | |
---|
[1007] | 413 | inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const |
---|
[819] | 414 | { |
---|
[1007] | 415 | return latDisplasment; |
---|
[819] | 416 | } |
---|
| 417 | |
---|
| 418 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 419 | |
---|
[1007] | 420 | inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val) |
---|
[819] | 421 | { |
---|
[1007] | 422 | latDisplasment = val; |
---|
[819] | 423 | } |
---|
| 424 | |
---|
| 425 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 426 | |
---|
| 427 | inline G4double G4VMultipleScattering::Skin() const |
---|
| 428 | { |
---|
| 429 | return skin; |
---|
| 430 | } |
---|
| 431 | |
---|
| 432 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 433 | |
---|
| 434 | inline void G4VMultipleScattering::SetSkin(G4double val) |
---|
| 435 | { |
---|
[961] | 436 | if(val < 1.0) skin = 0.0; |
---|
| 437 | else skin = val; |
---|
[819] | 438 | } |
---|
| 439 | |
---|
| 440 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 441 | |
---|
| 442 | inline G4double G4VMultipleScattering::RangeFactor() const |
---|
| 443 | { |
---|
| 444 | return facrange; |
---|
| 445 | } |
---|
| 446 | |
---|
| 447 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 448 | |
---|
| 449 | inline void G4VMultipleScattering::SetRangeFactor(G4double val) |
---|
| 450 | { |
---|
| 451 | if(val > 0.0) facrange = val; |
---|
| 452 | } |
---|
| 453 | |
---|
| 454 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 455 | |
---|
| 456 | inline G4double G4VMultipleScattering::GeomFactor() const |
---|
| 457 | { |
---|
| 458 | return facgeom; |
---|
| 459 | } |
---|
| 460 | |
---|
| 461 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 462 | |
---|
| 463 | inline void G4VMultipleScattering::SetGeomFactor(G4double val) |
---|
| 464 | { |
---|
| 465 | if(val > 0.0) facgeom = val; |
---|
| 466 | } |
---|
| 467 | |
---|
| 468 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 469 | |
---|
[961] | 470 | inline G4double G4VMultipleScattering::PolarAngleLimit() const |
---|
| 471 | { |
---|
| 472 | return polarAngleLimit; |
---|
| 473 | } |
---|
| 474 | |
---|
| 475 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 476 | |
---|
| 477 | inline void G4VMultipleScattering::SetPolarAngleLimit(G4double val) |
---|
| 478 | { |
---|
| 479 | if(val < 0.0) polarAngleLimit = 0.0; |
---|
| 480 | else if(val > pi) polarAngleLimit = pi; |
---|
| 481 | else polarAngleLimit = val; |
---|
| 482 | } |
---|
| 483 | |
---|
| 484 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 485 | |
---|
[819] | 486 | inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const |
---|
| 487 | { |
---|
| 488 | return stepLimit; |
---|
| 489 | } |
---|
| 490 | |
---|
| 491 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 492 | |
---|
| 493 | inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) |
---|
| 494 | { |
---|
| 495 | stepLimit = val; |
---|
[961] | 496 | if(val == fMinimal) facrange = 0.2; |
---|
[819] | 497 | } |
---|
| 498 | |
---|
| 499 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 500 | |
---|
[1055] | 501 | inline |
---|
| 502 | G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, |
---|
| 503 | G4double& e) |
---|
[819] | 504 | { |
---|
[1055] | 505 | G4double x; |
---|
| 506 | if(theLambdaTable) { |
---|
[1196] | 507 | x = ((*theLambdaTable)[currentMaterialIndex])->Value(e); |
---|
[1055] | 508 | } else { |
---|
| 509 | x = currentModel->CrossSection(currentCouple,p,e); |
---|
| 510 | } |
---|
| 511 | if(x > DBL_MIN) x = 1./x; |
---|
| 512 | else x = DBL_MAX; |
---|
| 513 | return x; |
---|
[819] | 514 | } |
---|
| 515 | |
---|
| 516 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 517 | |
---|
[1055] | 518 | inline |
---|
| 519 | void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple) |
---|
[819] | 520 | { |
---|
[1055] | 521 | if(couple != currentCouple) { |
---|
| 522 | currentCouple = couple; |
---|
| 523 | currentMaterialIndex = couple->GetIndex(); |
---|
| 524 | } |
---|
[819] | 525 | } |
---|
| 526 | |
---|
| 527 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 528 | |
---|
[1055] | 529 | inline const G4MaterialCutsCouple* |
---|
| 530 | G4VMultipleScattering::CurrentMaterialCutsCouple() const |
---|
[819] | 531 | { |
---|
| 532 | return currentCouple; |
---|
| 533 | } |
---|
| 534 | |
---|
| 535 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
[1196] | 536 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
[819] | 537 | |
---|
[1196] | 538 | // Follwoing methods are virtual, they are inlined because they applied at |
---|
| 539 | // each simulation step and some compilers may inline these methods |
---|
| 540 | |
---|
| 541 | inline G4double |
---|
| 542 | G4VMultipleScattering::PostStepGetPhysicalInteractionLength( |
---|
| 543 | const G4Track&, G4double, G4ForceCondition* condition) |
---|
| 544 | { |
---|
| 545 | *condition = Forced; |
---|
| 546 | return DBL_MAX; |
---|
| 547 | } |
---|
| 548 | |
---|
| 549 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 550 | |
---|
| 551 | inline G4VParticleChange* |
---|
| 552 | G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step) |
---|
| 553 | { |
---|
| 554 | if(currentModel->IsActive(track.GetKineticEnergy())) { |
---|
| 555 | fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength())); |
---|
| 556 | } |
---|
| 557 | return &fParticleChange; |
---|
| 558 | } |
---|
| 559 | |
---|
| 560 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 561 | |
---|
| 562 | inline G4VParticleChange* |
---|
| 563 | G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step) |
---|
| 564 | { |
---|
| 565 | fParticleChange.Initialize(track); |
---|
| 566 | if(currentModel->IsActive(track.GetKineticEnergy())) { |
---|
| 567 | currentModel->SampleScattering(track.GetDynamicParticle(), |
---|
| 568 | step.GetPostStepPoint()->GetSafety()); |
---|
| 569 | } |
---|
| 570 | return &fParticleChange; |
---|
| 571 | } |
---|
| 572 | |
---|
| 573 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
| 574 | |
---|
[819] | 575 | #endif |
---|