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 // $Id: G4VMultipleScattering.hh,v 1.48 2007/10/29 08:38:58 vnivanch Exp $ >> 27 // GEANT4 tag $Name: geant4-09-01-patch-03 $ 26 // 28 // 27 // ------------------------------------------- 29 // ------------------------------------------------------------------- 28 // 30 // 29 // GEANT4 Class header file 31 // GEANT4 Class header file 30 // 32 // 31 // 33 // 32 // File name: G4VMultipleScattering 34 // File name: G4VMultipleScattering 33 // 35 // 34 // Author: Vladimir Ivanchenko on base 36 // Author: Vladimir Ivanchenko on base of Laszlo Urban code 35 // 37 // 36 // Creation date: 12.03.2002 38 // Creation date: 12.03.2002 37 // 39 // 38 // Modifications: 40 // Modifications: 39 // 41 // 40 // 16-07-03 Update GetRange interface (V.Ivanc 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 // 41 // 26-11-03 bugfix in AlongStepDoIt (L.Urban) 50 // 26-11-03 bugfix in AlongStepDoIt (L.Urban) 42 // 25-05-04 add protection against case when r 51 // 25-05-04 add protection against case when range is less than steplimit (VI) >> 52 // 30-06-04 make destructor virtual (V.Ivanchenko) 43 // 27-08-04 Add InitialiseForRun method (V.Iva 53 // 27-08-04 Add InitialiseForRun method (V.Ivanchneko) 44 // 08-11-04 Migration to new interface of Stor 54 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivanchenko) >> 55 // 15-04-05 optimize internal interfaces (V.Ivanchenko) 45 // 15-04-05 remove boundary flag (V.Ivanchenko 56 // 15-04-05 remove boundary flag (V.Ivanchenko) 46 // 07-10-05 error in a protection in GetContin 57 // 07-10-05 error in a protection in GetContinuousStepLimit corrected (L.Urban) 47 // 27-10-05 introduce virtual function MscStep 58 // 27-10-05 introduce virtual function MscStepLimitation() (V.Ivanchenko) 48 // 26-01-06 Rename GetRange -> GetRangeFromRes 59 // 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko) 49 // 17-02-06 Save table of transport cross sect 60 // 17-02-06 Save table of transport cross sections not mfp (V.Ivanchenko) 50 // 07-03-06 Move step limit calculation to mod 61 // 07-03-06 Move step limit calculation to model (V.Ivanchenko) 51 // 13-05-06 Add method to access model by inde 62 // 13-05-06 Add method to access model by index (V.Ivanchenko) 52 // 12-02-07 Add get/set skin (V.Ivanchenko) 63 // 12-02-07 Add get/set skin (V.Ivanchenko) 53 // 27-10-07 Virtual functions moved to source 64 // 27-10-07 Virtual functions moved to source (V.Ivanchenko) 54 // 15-07-08 Reorder class members for further << 55 // 07-04-09 Moved msc methods from G4VEmModel << 56 // 65 // 57 // Class Description: << 58 // << 59 // It is the generic process of multiple scatt << 60 // part of calculations for all charged partic << 61 66 62 // ------------------------------------------- 67 // ------------------------------------------------------------------- 63 // 68 // 64 69 65 #ifndef G4VMultipleScattering_h 70 #ifndef G4VMultipleScattering_h 66 #define G4VMultipleScattering_h 1 71 #define G4VMultipleScattering_h 1 67 72 68 #include "G4VContinuousDiscreteProcess.hh" 73 #include "G4VContinuousDiscreteProcess.hh" >> 74 #include "G4LossTableManager.hh" 69 #include "globals.hh" 75 #include "globals.hh" 70 #include "G4Material.hh" 76 #include "G4Material.hh" >> 77 #include "G4MaterialCutsCouple.hh" 71 #include "G4ParticleChangeForMSC.hh" 78 #include "G4ParticleChangeForMSC.hh" 72 #include "G4Track.hh" 79 #include "G4Track.hh" 73 #include "G4Step.hh" 80 #include "G4Step.hh" 74 #include "G4EmModelManager.hh" 81 #include "G4EmModelManager.hh" 75 #include "G4VMscModel.hh" << 82 #include "G4VEmModel.hh" 76 #include "G4EmParameters.hh" << 77 #include "G4MscStepLimitType.hh" 83 #include "G4MscStepLimitType.hh" 78 84 79 class G4ParticleDefinition; 85 class G4ParticleDefinition; 80 class G4VEnergyLossProcess; << 86 class G4DataVector; 81 class G4LossTableManager; << 87 class G4PhysicsTable; 82 class G4SafetyHelper; << 88 class G4PhysicsVector; 83 89 84 //....oooOO0OOooo........oooOO0OOooo........oo 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 85 91 86 class G4VMultipleScattering : public G4VContin 92 class G4VMultipleScattering : public G4VContinuousDiscreteProcess 87 { 93 { 88 public: 94 public: 89 95 90 explicit G4VMultipleScattering(const G4Strin << 96 G4VMultipleScattering(const G4String& name = "msc", 91 G4ProcessType << 97 G4ProcessType type = fElectromagnetic); 92 98 93 ~G4VMultipleScattering() override; << 99 virtual ~G4VMultipleScattering(); 94 100 95 //------------------------------------------ 101 //------------------------------------------------------------------------ 96 // Virtual methods to be implemented for the 102 // Virtual methods to be implemented for the concrete model 97 //------------------------------------------ 103 //------------------------------------------------------------------------ 98 104 99 void ProcessDescription(std::ostream& outFil << 105 virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0; >> 106 // True for all charged particles 100 107 101 virtual void InitialiseProcess(const G4Parti << 108 virtual void PrintInfo() = 0; 102 << 103 // Print out of generic class parameters << 104 void StreamInfo(std::ostream& outFile, const << 105 G4bool rst = false) const; << 106 109 107 protected: 110 protected: 108 111 109 virtual void StreamProcessInfo(std::ostream& << 112 virtual void InitialiseProcess(const G4ParticleDefinition*) = 0; 110 113 >> 114 //------------------------------------------------------------------------ >> 115 // Methods with standard implementation; may be overwritten if needed >> 116 //------------------------------------------------------------------------ 111 public: 117 public: 112 118 113 //------------------------------------------ 119 //------------------------------------------------------------------------ 114 // Generic methods common to all ContinuousD 120 // Generic methods common to all ContinuousDiscrete processes 115 //------------------------------------------ 121 //------------------------------------------------------------------------ 116 122 117 // Initialise for build of tables 123 // Initialise for build of tables 118 void PreparePhysicsTable(const G4ParticleDef << 124 void PreparePhysicsTable(const G4ParticleDefinition&); 119 << 125 120 // Build physics table during initialisation 126 // Build physics table during initialisation 121 void BuildPhysicsTable(const G4ParticleDefin << 127 void BuildPhysicsTable(const G4ParticleDefinition&); >> 128 >> 129 // Print out of generic class parameters >> 130 void PrintInfoDefinition(); >> 131 >> 132 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&); >> 133 >> 134 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&); 122 135 123 // Store PhysicsTable in a file. 136 // Store PhysicsTable in a file. 124 // Return false in case of failure at I/O 137 // Return false in case of failure at I/O 125 G4bool StorePhysicsTable(const G4ParticleDef 138 G4bool StorePhysicsTable(const G4ParticleDefinition*, 126 const G4String& dir 139 const G4String& directory, 127 G4bool ascii = fals << 140 G4bool ascii = false); 128 141 129 // Retrieve Physics from a file. 142 // Retrieve Physics from a file. 130 // (return true if the Physics Table can be 143 // (return true if the Physics Table can be build by using file) 131 // (return false if the process has no funct 144 // (return false if the process has no functionality or in case of failure) 132 // File name should is constructed as proces 145 // File name should is constructed as processName+particleName and the 133 // should be placed under the directory spec << 146 // should be placed under the directory specifed by the argument. 134 G4bool RetrievePhysicsTable(const G4Particle 147 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 135 const G4String& 148 const G4String& directory, 136 G4bool ascii) ov << 149 G4bool ascii); 137 150 138 // This is called in the beginning of tracki << 151 //------------------------------------------------------------------------ 139 void StartTracking(G4Track*) override; << 152 // Specific methods for msc processes >> 153 //------------------------------------------------------------------------ 140 154 141 // The function overloads the corresponding 155 // The function overloads the corresponding function of the base 142 // class.It limits the step near to boundari 156 // class.It limits the step near to boundaries only 143 // and invokes the method GetMscContinuousSt 157 // and invokes the method GetMscContinuousStepLimit at every step. 144 G4double AlongStepGetPhysicalInteractionLeng 158 G4double AlongStepGetPhysicalInteractionLength( 145 const << 159 const G4Track&, 146 G4doub << 160 G4double previousStepSize, 147 G4doub << 161 G4double currentMinimalStep, 148 G4doub << 162 G4double& currentSafety, 149 G4GPIL << 163 G4GPILSelection* selection); 150 164 151 // The function overloads the corresponding 165 // The function overloads the corresponding function of the base 152 // class. 166 // class. 153 G4double PostStepGetPhysicalInteractionLengt 167 G4double PostStepGetPhysicalInteractionLength( 154 const G4 << 168 const G4Track&, 155 G4double << 169 G4double previousStepSize, 156 G4ForceC << 170 G4ForceCondition* condition); 157 << 158 // Along step actions << 159 G4VParticleChange* AlongStepDoIt(const G4Tra << 160 171 161 // This method does not used for tracking, i 172 // This method does not used for tracking, it is intended only for tests 162 G4double ContinuousStepLimit(const G4Track& << 173 inline G4double ContinuousStepLimit(const G4Track& track, 163 G4double previo << 174 G4double previousStepSize, 164 G4double curren << 175 G4double currentMinimalStep, 165 G4double& curre << 176 G4double& currentSafety); 166 << 167 // hide assignment operator << 168 G4VMultipleScattering(G4VMultipleScattering << 169 G4VMultipleScattering & operator=(const G4VM << 170 177 171 //------------------------------------------ 178 //------------------------------------------------------------------------ 172 // Specific methods to set, access, modify m << 179 // Specific methods to build and access Physics Tables 173 //------------------------------------------ 180 //------------------------------------------------------------------------ 174 181 175 // Select model in run time << 182 // Build empty Physics Vector 176 inline G4VEmModel* SelectModel(G4double kinE << 183 G4PhysicsVector* PhysicsVector(const G4MaterialCutsCouple*); 177 184 178 public: << 185 inline void SetBinning(G4int nbins); >> 186 inline G4int Binning() const; 179 187 180 // Add model for region, smaller value of or << 188 inline void SetMinKinEnergy(G4double e); 181 // model will be selected for a given energy << 189 inline G4double MinKinEnergy() const; 182 void AddEmModel(G4int order, G4VMscModel*, c << 190 // Print out of the class parameters 183 << 191 184 // Assign a model to a process local list, t << 192 inline void SetMaxKinEnergy(G4double e); 185 // the derived process should execute AddEmM << 193 inline G4double MaxKinEnergy() const; 186 void SetEmModel(G4VMscModel*, G4int idx = 0) << 187 << 188 // return a model from the local list << 189 inline G4VMscModel* EmModel(size_t index = 0 << 190 194 191 // Access to run time models << 195 inline void SetBuildLambdaTable(G4bool val); 192 inline G4int NumberOfModels() const; << 193 196 194 inline G4VMscModel* GetModelByIndex(G4int id << 197 inline G4PhysicsTable* LambdaTable() const; 195 198 196 //------------------------------------------ 199 //------------------------------------------------------------------------ 197 // Get/Set parameters for simulation of mult << 200 // Define and access particle type 198 //------------------------------------------ 201 //------------------------------------------------------------------------ 199 202 200 inline G4bool LateralDisplasmentFlag() const << 203 inline const G4ParticleDefinition* Particle() const; 201 << 204 inline void SetParticle(const G4ParticleDefinition*); 202 inline G4double Skin() const; << 203 << 204 inline G4double RangeFactor() const; << 205 << 206 inline G4double GeomFactor() const; << 207 << 208 inline G4double PolarAngleLimit() const; << 209 205 210 inline G4bool UseBaseMaterial() const; << 206 //------------------------------------------------------------------------ 211 << 207 // Specific methods to set, access, modify models 212 inline G4MscStepLimitType StepLimitType() co << 208 //------------------------------------------------------------------------ 213 inline void SetStepLimitType(G4MscStepLimitT << 214 209 215 inline G4double LowestKinEnergy() const; << 210 inline void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0); 216 inline void SetLowestKinEnergy(G4double val) << 217 211 218 inline const G4ParticleDefinition* FirstPart << 212 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, >> 213 size_t& idxRegion) const; >> 214 >> 215 // Access to models >> 216 inline G4VEmModel* GetModelByIndex(G4int idx = 0); 219 217 220 //------------------------------------------ 218 //------------------------------------------------------------------------ 221 // Run time methods << 219 // Parameters for simulation of multiple scattering 222 //------------------------------------------ 220 //------------------------------------------------------------------------ 223 221 >> 222 inline void SetLateralDisplasmentFlag(G4bool val); >> 223 // lateral displacement to be/not to be computed >> 224 >> 225 inline void SetSkin(G4double val); >> 226 // skin parameter >> 227 >> 228 inline void SetRangeFactor(G4double val); >> 229 // FactorRange parameter >> 230 >> 231 inline void SetGeomFactor(G4double val); >> 232 // FactorRange parameter >> 233 >> 234 inline void SetStepLimitType(G4MscStepLimitType val); >> 235 // FactorRange parameter >> 236 224 protected: 237 protected: 225 238 226 // This method is not used for tracking, it << 239 // This method is used for tracking, it returns mean free path value 227 G4double GetMeanFreePath(const G4Track& trac 240 G4double GetMeanFreePath(const G4Track& track, 228 G4double, << 241 G4double, 229 G4ForceCondition* c << 242 G4ForceCondition* condition); >> 243 >> 244 //------------------------------------------------------------------------ >> 245 // Run time methods >> 246 //------------------------------------------------------------------------ 230 247 231 // This method is not used for tracking, it 248 // This method is not used for tracking, it returns step limit 232 G4double GetContinuousStepLimit(const G4Trac 249 G4double GetContinuousStepLimit(const G4Track& track, 233 G4double pre << 250 G4double previousStepSize, 234 G4double cur << 251 G4double currentMinimalStep, 235 G4double& cu << 252 G4double& currentSafety); >> 253 >> 254 inline G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy); >> 255 >> 256 // This method is used for tracking, it returns step limit >> 257 inline G4double GetMscContinuousStepLimit(const G4Track& track, >> 258 G4double previousStepSize, >> 259 G4double currentMinimalStep, >> 260 G4double& currentSafety); 236 261 237 private: << 262 inline G4VEmModel* SelectModel(G4double kinEnergy); >> 263 // Select concrete model 238 264 239 // ======== Parameters of the class fixed at << 265 inline const G4MaterialCutsCouple* CurrentMaterialCutsCouple() const; >> 266 // Return current G4MaterialCutsCouple 240 267 241 G4EmModelManager* modelManager; << 268 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 242 G4LossTableManager* emManager; << 269 // define current material 243 G4EmParameters* theParameters; << 270 >> 271 //------------------------------------------------------------------------ >> 272 // Parameters for simulation of multiple scattering >> 273 //------------------------------------------------------------------------ >> 274 >> 275 inline G4double Skin() const; >> 276 >> 277 inline G4double RangeFactor() const; >> 278 >> 279 inline G4double GeomFactor() const; 244 280 245 // ======== Parameters of the class fixed at << 281 inline G4MscStepLimitType StepLimitType() const; 246 282 247 G4SafetyHelper* safetyHelper = n << 283 inline G4bool LateralDisplasmentFlag() const; 248 const G4ParticleDefinition* firstParticle = << 284 249 const G4ParticleDefinition* currParticle = n << 285 private: 250 << 251 std::vector<G4VMscModel*> mscModels; << 252 286 253 G4double facrange = 0.04; << 287 // hide assignment operator 254 G4double lowestKinEnergy; << 255 288 256 // ======== Cached values - may be state dep << 289 G4VMultipleScattering(G4VMultipleScattering &); >> 290 G4VMultipleScattering & operator=(const G4VMultipleScattering &right); >> 291 >> 292 // ===================================================================== 257 293 258 protected: 294 protected: 259 295 >> 296 G4GPILSelection valueGPILSelectionMSC; 260 G4ParticleChangeForMSC fParticleChange; 297 G4ParticleChangeForMSC fParticleChange; 261 298 262 private: 299 private: 263 300 264 G4ThreeVector fNewPosition; << 301 G4EmModelManager* modelManager; 265 G4ThreeVector fNewDirection; << 302 G4VEmModel* currentModel; >> 303 G4PhysicsTable* theLambdaTable; 266 304 267 G4VMscModel* currentModel = n << 305 // cache 268 G4VEnergyLossProcess* fIonisation = nu << 306 const G4ParticleDefinition* firstParticle; >> 307 const G4ParticleDefinition* currentParticle; >> 308 const G4MaterialCutsCouple* currentCouple; >> 309 size_t currentMaterialIndex; >> 310 >> 311 G4int nBins; >> 312 >> 313 G4MscStepLimitType stepLimit; >> 314 >> 315 G4double minKinEnergy; >> 316 G4double maxKinEnergy; >> 317 G4double skin; >> 318 G4double facrange; >> 319 G4double facgeom; 269 320 270 G4double geomMin; << 321 G4bool latDisplasment; 271 G4double minDisplacement2 << 322 G4bool buildLambdaTable; 272 G4double physStepLimit = << 273 G4double tPathLength = 0. << 274 G4double gPathLength = 0. << 275 << 276 G4MscStepLimitType stepLimit = fUse << 277 G4int numberOfModels = << 278 << 279 G4bool latDisplacement << 280 G4bool isIon = false; << 281 G4bool fPositionChanged << 282 G4bool isActive = false << 283 G4bool baseMat = false; << 284 }; 323 }; 285 324 286 // ======== Run time inline methods ========== << 325 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 327 >> 328 inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple) >> 329 { >> 330 if(couple != currentCouple) { >> 331 currentCouple = couple; >> 332 currentMaterialIndex = couple->GetIndex(); >> 333 } >> 334 } >> 335 >> 336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 337 >> 338 inline G4double G4VMultipleScattering::GetMscContinuousStepLimit( >> 339 const G4Track& track, >> 340 G4double, >> 341 G4double currentMinimalStep, >> 342 G4double&) >> 343 { >> 344 G4double x = currentMinimalStep; >> 345 G4double e = track.GetKineticEnergy(); >> 346 DefineMaterial(track.GetMaterialCutsCouple()); >> 347 currentModel = SelectModel(e); >> 348 if(x > 0.0 && e > 0.0) { >> 349 G4double tPathLength = >> 350 currentModel->ComputeTruePathLengthLimit(track, theLambdaTable, x); >> 351 if (tPathLength < x) valueGPILSelectionMSC = CandidateForSelection; >> 352 x = currentModel->ComputeGeomPathLength(tPathLength); >> 353 // G4cout << "tPathLength= " << tPathLength >> 354 // << " stepLimit= " << x >> 355 // << " currentMinimalStep= " << currentMinimalStep<< G4endl; >> 356 } >> 357 return x; >> 358 } >> 359 >> 360 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 361 >> 362 inline G4double G4VMultipleScattering::ContinuousStepLimit( >> 363 const G4Track& track, >> 364 G4double previousStepSize, >> 365 G4double currentMinimalStep, >> 366 G4double& currentSafety) >> 367 { >> 368 return GetMscContinuousStepLimit(track,previousStepSize,currentMinimalStep, >> 369 currentSafety); >> 370 } >> 371 >> 372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 373 >> 374 inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, G4double& e) >> 375 { >> 376 G4double x; >> 377 if(theLambdaTable) { >> 378 G4bool b; >> 379 x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b); >> 380 } else { >> 381 x = currentModel->CrossSection(currentCouple,p,e); >> 382 } >> 383 if(x > DBL_MIN) x = 1./x; >> 384 else x = DBL_MAX; >> 385 return x; >> 386 } >> 387 >> 388 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 389 >> 390 inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy) >> 391 { >> 392 return modelManager->SelectModel(kinEnergy, currentMaterialIndex); >> 393 } >> 394 >> 395 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 396 >> 397 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial( >> 398 G4double kinEnergy, size_t& idxRegion) const >> 399 { >> 400 return modelManager->SelectModel(kinEnergy, idxRegion); >> 401 } >> 402 >> 403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 404 >> 405 inline void G4VMultipleScattering::SetBinning(G4int nbins) >> 406 { >> 407 nBins = nbins; >> 408 } >> 409 >> 410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 411 >> 412 inline G4int G4VMultipleScattering::Binning() const >> 413 { >> 414 return nBins; >> 415 } >> 416 >> 417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 418 >> 419 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e) >> 420 { >> 421 minKinEnergy = e; >> 422 } >> 423 >> 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 425 >> 426 inline G4double G4VMultipleScattering::MinKinEnergy() const >> 427 { >> 428 return minKinEnergy; >> 429 } 287 430 288 //....oooOO0OOooo........oooOO0OOooo........oo 431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 289 432 290 inline G4VEmModel* << 433 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e) 291 G4VMultipleScattering::SelectModel(G4double ki << 292 { 434 { 293 return modelManager->SelectModel(kinEnergy, << 435 maxKinEnergy = e; >> 436 } >> 437 >> 438 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 439 >> 440 inline G4double G4VMultipleScattering::MaxKinEnergy() const >> 441 { >> 442 return maxKinEnergy; 294 } 443 } 295 444 296 //....oooOO0OOooo........oooOO0OOooo........oo 445 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 297 446 298 inline G4bool G4VMultipleScattering::LateralD 447 inline G4bool G4VMultipleScattering::LateralDisplasmentFlag() const 299 { 448 { 300 return latDisplacement; << 449 return latDisplasment; >> 450 } >> 451 >> 452 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 453 >> 454 inline void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val) >> 455 { >> 456 latDisplasment = val; 301 } 457 } 302 458 303 //....oooOO0OOooo........oooOO0OOooo........oo 459 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 304 460 305 inline G4double G4VMultipleScattering::Skin() 461 inline G4double G4VMultipleScattering::Skin() const 306 { 462 { 307 return theParameters->MscSkin(); << 463 return skin; >> 464 } >> 465 >> 466 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 467 >> 468 inline void G4VMultipleScattering::SetSkin(G4double val) >> 469 { >> 470 if(val <= 0.99999) { >> 471 skin = 0.0; >> 472 stepLimit = fUseSafety; >> 473 } else { >> 474 skin = val; >> 475 stepLimit = fUseDistanceToBoundary; >> 476 } 308 } 477 } 309 478 310 //....oooOO0OOooo........oooOO0OOooo........oo 479 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 311 480 312 inline G4double G4VMultipleScattering::RangeF 481 inline G4double G4VMultipleScattering::RangeFactor() const 313 { 482 { 314 return facrange; 483 return facrange; 315 } 484 } 316 485 317 //....oooOO0OOooo........oooOO0OOooo........oo 486 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 318 487 319 inline G4double G4VMultipleScattering::GeomFa << 488 inline void G4VMultipleScattering::SetRangeFactor(G4double val) 320 { 489 { 321 return theParameters->MscGeomFactor(); << 490 if(val > 0.0) facrange = val; 322 } 491 } 323 492 324 //....oooOO0OOooo........oooOO0OOooo........oo 493 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 325 494 326 inline G4double G4VMultipleScattering::PolarA << 495 inline G4double G4VMultipleScattering::GeomFactor() const 327 { 496 { 328 return theParameters->MscThetaLimit(); << 497 return facgeom; 329 } 498 } 330 499 331 //....oooOO0OOooo........oooOO0OOooo........oo 500 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 332 501 333 inline G4MscStepLimitType G4VMultipleScatterin << 502 inline void G4VMultipleScattering::SetGeomFactor(G4double val) 334 { 503 { 335 return stepLimit; << 504 if(val > 0.0) facgeom = val; 336 } 505 } 337 506 338 //....oooOO0OOooo........oooOO0OOooo........oo 507 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 339 508 340 inline void G4VMultipleScattering::SetStepLimi << 509 inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const 341 { 510 { 342 theParameters->SetMscStepLimitType(val); << 511 return stepLimit; 343 } 512 } 344 513 345 //....oooOO0OOooo........oooOO0OOooo........oo 514 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 346 515 347 inline G4double G4VMultipleScattering::LowestK << 516 inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) 348 { 517 { 349 return lowestKinEnergy; << 518 stepLimit = val; >> 519 if(val == fMinimal) { >> 520 skin = 0; >> 521 facrange = 0.2; >> 522 } else if(val == fUseSafety) { >> 523 skin = 0; >> 524 } 350 } 525 } 351 526 352 //....oooOO0OOooo........oooOO0OOooo........oo 527 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 353 528 354 inline void G4VMultipleScattering::SetLowestKi << 529 inline void G4VMultipleScattering::SetBuildLambdaTable(G4bool val) 355 { 530 { 356 lowestKinEnergy = val; << 531 buildLambdaTable = val; 357 } 532 } 358 533 359 //....oooOO0OOooo........oooOO0OOooo........oo 534 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 360 535 361 inline const G4ParticleDefinition* G4VMultiple << 536 inline const G4ParticleDefinition* G4VMultipleScattering::Particle() const 362 { 537 { 363 return firstParticle; << 538 return currentParticle; 364 } 539 } 365 540 366 //....oooOO0OOooo........oooOO0OOooo........oo 541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 367 542 368 inline G4VMscModel* G4VMultipleScattering::EmM << 543 inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const 369 { 544 { 370 return (index < mscModels.size()) ? mscModel << 545 return theLambdaTable; 371 } 546 } 372 547 373 //....oooOO0OOooo........oooOO0OOooo........oo 548 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 374 549 375 inline G4int G4VMultipleScattering::NumberOfMo << 550 inline >> 551 const G4MaterialCutsCouple* G4VMultipleScattering::CurrentMaterialCutsCouple() const 376 { 552 { 377 return numberOfModels; << 553 return currentCouple; 378 } << 554 } 379 555 380 //....oooOO0OOooo........oooOO0OOooo........oo 556 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 381 557 382 inline G4VMscModel* << 558 inline void G4VMultipleScattering::AddEmModel(G4int order, G4VEmModel* p, 383 G4VMultipleScattering::GetModelByIndex(G4int i << 559 const G4Region* region) 384 { 560 { 385 // static cast is possible inside this class << 561 G4VEmFluctuationModel* fm = 0; 386 return static_cast<G4VMscModel*>(modelManage << 562 modelManager->AddEmModel(order, p, fm, region); >> 563 if(p)p->SetParticleChange(pParticleChange); 387 } 564 } 388 565 389 //....oooOO0OOooo........oooOO0OOooo........oo 566 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 390 567 391 inline G4bool G4VMultipleScattering::UseBaseMa << 568 inline G4VEmModel* G4VMultipleScattering::GetModelByIndex(G4int idx) 392 { 569 { 393 return baseMat; << 570 return modelManager->GetModel(idx); 394 } 571 } 395 572 396 //....oooOO0OOooo........oooOO0OOooo........oo 573 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 397 574 398 #endif 575 #endif 399 576