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: G4VEmModel.hh 91064 2015-06-17 09:08:14Z gcosmo $ >> 27 // 26 // ------------------------------------------- 28 // ------------------------------------------------------------------- 27 // 29 // 28 // GEANT4 Class header file 30 // GEANT4 Class header file 29 // 31 // 30 // 32 // 31 // File name: G4VEmModel 33 // File name: G4VEmModel 32 // 34 // 33 // Author: Vladimir Ivanchenko 35 // Author: Vladimir Ivanchenko 34 // 36 // 35 // Creation date: 03.01.2002 37 // Creation date: 03.01.2002 36 // 38 // 37 // Modifications: 39 // Modifications: 38 // 40 // 39 // 23-12-02 V.Ivanchenko change interface befo 41 // 23-12-02 V.Ivanchenko change interface before move to cut per region 40 // 24-01-03 Cut per region (V.Ivanchenko) 42 // 24-01-03 Cut per region (V.Ivanchenko) 41 // 13-02-03 Add name (V.Ivanchenko) 43 // 13-02-03 Add name (V.Ivanchenko) 42 // 25-02-03 Add sample theta and displacement 44 // 25-02-03 Add sample theta and displacement (V.Ivanchenko) 43 // 23-07-03 Replace G4Material by G4MaterialCu 45 // 23-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection 44 // calculation (V.Ivanchenko) 46 // calculation (V.Ivanchenko) 45 // 01-03-04 L.Urban signature changed in Sampl 47 // 01-03-04 L.Urban signature changed in SampleCosineTheta 46 // 23-04-04 L.urban signature of SampleCosineT 48 // 23-04-04 L.urban signature of SampleCosineTheta changed back 47 // 17-11-04 Add method CrossSectionPerAtom (V. 49 // 17-11-04 Add method CrossSectionPerAtom (V.Ivanchenko) 48 // 14-03-05 Reduce number of pure virtual meth 50 // 14-03-05 Reduce number of pure virtual methods and make inline part 49 // separate (V.Ivanchenko) 51 // separate (V.Ivanchenko) 50 // 24-03-05 Remove IsInCharge and add G4VParti 52 // 24-03-05 Remove IsInCharge and add G4VParticleChange in the constructor (VI) 51 // 08-04-05 Major optimisation of internal int 53 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko) 52 // 15-04-05 optimize internal interface for ms 54 // 15-04-05 optimize internal interface for msc (V.Ivanchenko) 53 // 08-05-05 A -> N (V.Ivanchenko) 55 // 08-05-05 A -> N (V.Ivanchenko) 54 // 25-07-05 Move constructor and destructor to 56 // 25-07-05 Move constructor and destructor to the body (V.Ivanchenko) 55 // 02-02-06 ComputeCrossSectionPerAtom: defaul 57 // 02-02-06 ComputeCrossSectionPerAtom: default value A=0. (mma) 56 // 06-02-06 add method ComputeMeanFreePath() ( 58 // 06-02-06 add method ComputeMeanFreePath() (mma) 57 // 07-03-06 Optimize msc methods (V.Ivanchenko 59 // 07-03-06 Optimize msc methods (V.Ivanchenko) 58 // 29-06-06 Add member currentElement and Get/ 60 // 29-06-06 Add member currentElement and Get/Set methods (V.Ivanchenko) 59 // 29-10-07 Added SampleScattering (V.Ivanchen 61 // 29-10-07 Added SampleScattering (V.Ivanchenko) 60 // 15-07-08 Reorder class members and improve 62 // 15-07-08 Reorder class members and improve comments (VI) 61 // 21-07-08 Added vector of G4ElementSelector 63 // 21-07-08 Added vector of G4ElementSelector and methods to use it (VI) 62 // 12-09-08 Added methods GetParticleCharge, G 64 // 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio, 63 // CorrectionsAlongStep, ActivateNucl 65 // CorrectionsAlongStep, ActivateNuclearStopping (VI) 64 // 16-02-09 Moved implementations of virtual m 66 // 16-02-09 Moved implementations of virtual methods to source (VI) 65 // 07-04-09 Moved msc methods from G4VEmModel 67 // 07-04-09 Moved msc methods from G4VEmModel to G4VMscModel (VI) 66 // 13-10-10 Added G4VEmAngularDistribution (VI 68 // 13-10-10 Added G4VEmAngularDistribution (VI) 67 // 69 // 68 // Class Description: 70 // Class Description: 69 // 71 // 70 // Abstract interface to energy loss models 72 // Abstract interface to energy loss models 71 73 72 // ------------------------------------------- 74 // ------------------------------------------------------------------- 73 // 75 // 74 76 75 #ifndef G4VEmModel_h 77 #ifndef G4VEmModel_h 76 #define G4VEmModel_h 1 78 #define G4VEmModel_h 1 77 79 78 #include "globals.hh" 80 #include "globals.hh" 79 #include "G4DynamicParticle.hh" 81 #include "G4DynamicParticle.hh" 80 #include "G4ParticleDefinition.hh" 82 #include "G4ParticleDefinition.hh" 81 #include "G4MaterialCutsCouple.hh" 83 #include "G4MaterialCutsCouple.hh" 82 #include "G4Material.hh" 84 #include "G4Material.hh" 83 #include "G4Element.hh" 85 #include "G4Element.hh" 84 #include "G4ElementVector.hh" 86 #include "G4ElementVector.hh" 85 #include "G4Isotope.hh" 87 #include "G4Isotope.hh" 86 #include "G4DataVector.hh" 88 #include "G4DataVector.hh" 87 #include "G4VEmFluctuationModel.hh" 89 #include "G4VEmFluctuationModel.hh" 88 #include "G4VEmAngularDistribution.hh" 90 #include "G4VEmAngularDistribution.hh" 89 #include "G4EmElementSelector.hh" 91 #include "G4EmElementSelector.hh" 90 #include <CLHEP/Random/RandomEngine.h> 92 #include <CLHEP/Random/RandomEngine.h> 91 #include <vector> 93 #include <vector> 92 94 93 class G4ElementData; 95 class G4ElementData; 94 class G4PhysicsTable; 96 class G4PhysicsTable; 95 class G4Region; 97 class G4Region; 96 class G4VParticleChange; 98 class G4VParticleChange; 97 class G4ParticleChangeForLoss; 99 class G4ParticleChangeForLoss; 98 class G4ParticleChangeForGamma; 100 class G4ParticleChangeForGamma; 99 class G4Track; 101 class G4Track; 100 class G4LossTableManager; 102 class G4LossTableManager; 101 103 102 class G4VEmModel 104 class G4VEmModel 103 { 105 { 104 106 105 public: 107 public: 106 108 107 explicit G4VEmModel(const G4String& nam); << 109 G4VEmModel(const G4String& nam); 108 110 109 virtual ~G4VEmModel(); 111 virtual ~G4VEmModel(); 110 112 111 //------------------------------------------ 113 //------------------------------------------------------------------------ 112 // Virtual methods to be implemented for any 114 // Virtual methods to be implemented for any concrete model 113 //------------------------------------------ 115 //------------------------------------------------------------------------ 114 116 115 virtual void Initialise(const G4ParticleDefi << 117 virtual void Initialise(const G4ParticleDefinition*, >> 118 const G4DataVector&) = 0; 116 119 117 virtual void SampleSecondaries(std::vector<G 120 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 118 const G4Mater << 121 const G4MaterialCutsCouple*, 119 const G4Dynam << 122 const G4DynamicParticle*, 120 G4double tmin << 123 G4double tmin = 0.0, 121 G4double tmax << 124 G4double tmax = DBL_MAX) = 0; 122 125 123 //------------------------------------------ 126 //------------------------------------------------------------------------ 124 // Methods for initialisation of MT; may be 127 // Methods for initialisation of MT; may be overwritten if needed 125 //------------------------------------------ 128 //------------------------------------------------------------------------ 126 129 127 // initialisation in local thread << 130 // initilisation in local thread 128 virtual void InitialiseLocal(const G4Particl << 131 virtual void InitialiseLocal(const G4ParticleDefinition*, 129 G4VEmModel* mas << 132 G4VEmModel* masterModel); 130 133 131 // initialisation of a new material at run t << 134 // initilisation of a new material at run time 132 virtual void InitialiseForMaterial(const G4P 135 virtual void InitialiseForMaterial(const G4ParticleDefinition*, 133 const G4M << 136 const G4Material*); 134 137 135 // initialisation of a new element at run ti << 138 // initilisation of a new element at run time 136 virtual void InitialiseForElement(const G4Pa 139 virtual void InitialiseForElement(const G4ParticleDefinition*, 137 G4int Z); << 140 G4int Z); 138 141 139 //------------------------------------------ 142 //------------------------------------------------------------------------ 140 // Methods with standard implementation; may 143 // Methods with standard implementation; may be overwritten if needed 141 //------------------------------------------ 144 //------------------------------------------------------------------------ 142 145 143 // main method to compute dEdx 146 // main method to compute dEdx 144 virtual G4double ComputeDEDXPerVolume(const 147 virtual G4double ComputeDEDXPerVolume(const G4Material*, 145 const << 148 const G4ParticleDefinition*, 146 G4doub << 149 G4double kineticEnergy, 147 G4doub << 150 G4double cutEnergy = DBL_MAX); 148 151 149 // main method to compute cross section per 152 // main method to compute cross section per Volume 150 virtual G4double CrossSectionPerVolume(const 153 virtual G4double CrossSectionPerVolume(const G4Material*, 151 const << 154 const G4ParticleDefinition*, 152 G4dou << 155 G4double kineticEnergy, 153 G4dou << 156 G4double cutEnergy = 0.0, 154 G4dou << 157 G4double maxEnergy = DBL_MAX); 155 << 156 // method to get partial cross section << 157 virtual G4double GetPartialCrossSection(cons << 158 G4in << 159 cons << 160 G4do << 161 158 162 // main method to compute cross section per 159 // main method to compute cross section per atom 163 virtual G4double ComputeCrossSectionPerAtom( 160 virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 164 << 161 G4double kinEnergy, 165 << 162 G4double Z, 166 << 163 G4double A = 0., /* amu */ 167 << 164 G4double cutEnergy = 0.0, 168 << 165 G4double maxEnergy = DBL_MAX); 169 << 166 170 // main method to compute cross section per << 171 virtual G4double ComputeCrossSectionPerShell << 172 << 173 << 174 << 175 << 176 << 177 // Compute effective ion charge square 167 // Compute effective ion charge square 178 virtual G4double ChargeSquareRatio(const G4T 168 virtual G4double ChargeSquareRatio(const G4Track&); 179 169 180 // Compute effective ion charge square 170 // Compute effective ion charge square 181 virtual G4double GetChargeSquareRatio(const 171 virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*, 182 const << 172 const G4Material*, 183 G4doub << 173 G4double kineticEnergy); 184 174 185 // Compute ion charge 175 // Compute ion charge 186 virtual G4double GetParticleCharge(const G4P 176 virtual G4double GetParticleCharge(const G4ParticleDefinition*, 187 const G4M << 177 const G4Material*, 188 G4double << 178 G4double kineticEnergy); 189 179 190 // Initialisation for a new track 180 // Initialisation for a new track 191 virtual void StartTracking(G4Track*); 181 virtual void StartTracking(G4Track*); 192 182 193 // add correction to energy loss and compute 183 // add correction to energy loss and compute non-ionizing energy loss 194 virtual void CorrectionsAlongStep(const G4Ma 184 virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*, 195 const G4Dy << 185 const G4DynamicParticle*, 196 const G4do << 186 G4double& eloss, 197 G4double& << 187 G4double& niel, >> 188 G4double length); 198 189 199 // value which may be tabulated (by default 190 // value which may be tabulated (by default cross section) 200 virtual G4double Value(const G4MaterialCutsC 191 virtual G4double Value(const G4MaterialCutsCouple*, 201 const G4ParticleDefin << 192 const G4ParticleDefinition*, 202 G4double kineticEnerg << 193 G4double kineticEnergy); 203 194 204 // threshold for zero value 195 // threshold for zero value 205 virtual G4double MinPrimaryEnergy(const G4Ma 196 virtual G4double MinPrimaryEnergy(const G4Material*, 206 const G4Pa << 197 const G4ParticleDefinition*, 207 G4double c << 198 G4double cut = 0.0); 208 199 209 // model can define low-energy limit for the 200 // model can define low-energy limit for the cut 210 virtual G4double MinEnergyCut(const G4Partic << 201 virtual G4double MinEnergyCut(const G4ParticleDefinition*, 211 const G4Materi << 202 const G4MaterialCutsCouple*); 212 203 213 // initialisation at run time for a given ma << 204 // initilisation at run time for a given material 214 virtual void SetupForMaterial(const G4Partic 205 virtual void SetupForMaterial(const G4ParticleDefinition*, 215 const G4Materi << 206 const G4Material*, 216 G4double kinet 207 G4double kineticEnergy); 217 208 218 // add a region for the model 209 // add a region for the model 219 virtual void DefineForRegion(const G4Region* 210 virtual void DefineForRegion(const G4Region*); 220 211 221 // fill number of different type of secondar << 222 virtual void FillNumberOfSecondaries(G4int& << 223 G4int& << 224 << 225 // for automatic documentation << 226 virtual void ModelDescription(std::ostream& << 227 << 228 protected: 212 protected: 229 213 230 // initialisation of the ParticleChange for 214 // initialisation of the ParticleChange for the model 231 G4ParticleChangeForLoss* GetParticleChangeFo 215 G4ParticleChangeForLoss* GetParticleChangeForLoss(); 232 216 233 // initialisation of the ParticleChange for 217 // initialisation of the ParticleChange for the model 234 G4ParticleChangeForGamma* GetParticleChangeF 218 G4ParticleChangeForGamma* GetParticleChangeForGamma(); 235 219 236 // kinematically allowed max kinetic energy 220 // kinematically allowed max kinetic energy of a secondary 237 virtual G4double MaxSecondaryEnergy(const G4 221 virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 238 G4double << 222 G4double kineticEnergy); 239 223 240 public: 224 public: 241 225 242 //------------------------------------------ 226 //------------------------------------------------------------------------ 243 // Generic methods common to all models 227 // Generic methods common to all models 244 //------------------------------------------ 228 //------------------------------------------------------------------------ 245 229 246 // should be called at initialisation to bui 230 // should be called at initialisation to build element selectors 247 void InitialiseElementSelectors(const G4Part << 231 void InitialiseElementSelectors(const G4ParticleDefinition*, 248 const G4Data << 232 const G4DataVector&); 249 233 250 // should be called at initialisation to acc 234 // should be called at initialisation to access element selectors 251 inline std::vector<G4EmElementSelector*>* Ge 235 inline std::vector<G4EmElementSelector*>* GetElementSelectors(); 252 236 253 // should be called at initialisation to set 237 // should be called at initialisation to set element selectors 254 inline void SetElementSelectors(std::vector< 238 inline void SetElementSelectors(std::vector<G4EmElementSelector*>*); 255 239 256 // dEdx per unit length, base material appro << 240 // dEdx per unit length 257 inline G4double ComputeDEDX( const G4Materia << 241 inline G4double ComputeDEDX(const G4MaterialCutsCouple*, 258 const G4Particl << 242 const G4ParticleDefinition*, 259 G4double kineti << 243 G4double kineticEnergy, 260 G4double cutEne << 244 G4double cutEnergy = DBL_MAX); 261 245 262 // cross section per volume, base material a << 246 // cross section per volume 263 inline G4double CrossSection(const G4Materia 247 inline G4double CrossSection(const G4MaterialCutsCouple*, 264 const G4Particl << 248 const G4ParticleDefinition*, 265 G4double kineti << 249 G4double kineticEnergy, 266 G4double cutEne << 250 G4double cutEnergy = 0.0, 267 G4double maxEne << 251 G4double maxEnergy = DBL_MAX); 268 252 269 // compute mean free path via cross section 253 // compute mean free path via cross section per volume 270 inline G4double ComputeMeanFreePath(const G4 254 inline G4double ComputeMeanFreePath(const G4ParticleDefinition*, 271 G4double << 255 G4double kineticEnergy, 272 const G4 << 256 const G4Material*, 273 G4double << 257 G4double cutEnergy = 0.0, 274 G4double << 258 G4double maxEnergy = DBL_MAX); 275 259 276 // generic cross section per element 260 // generic cross section per element 277 inline G4double ComputeCrossSectionPerAtom(c 261 inline G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*, 278 c 262 const G4Element*, 279 G << 263 G4double kinEnergy, 280 G << 264 G4double cutEnergy = 0.0, 281 G << 265 G4double maxEnergy = DBL_MAX); >> 266 >> 267 // select isotope in order to have precise mass of the nucleus >> 268 inline G4int SelectIsotopeNumber(const G4Element*); 282 269 283 // atom can be selected effitiantly if eleme 270 // atom can be selected effitiantly if element selectors are initialised 284 inline const G4Element* SelectRandomAtom(con 271 inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*, 285 con << 272 const G4ParticleDefinition*, 286 G4d << 273 G4double kineticEnergy, 287 G4d << 274 G4double cutEnergy = 0.0, 288 G4d << 275 G4double maxEnergy = DBL_MAX); 289 // same as SelectRandomAtom above but more e << 290 inline const G4Element* SelectTargetAtom(con << 291 con << 292 G4d << 293 G4d << 294 G4d << 295 G4d << 296 276 297 // to select atom cross section per volume i 277 // to select atom cross section per volume is recomputed for each element 298 const G4Element* SelectRandomAtom(const G4Ma 278 const G4Element* SelectRandomAtom(const G4Material*, 299 const G4Pa << 279 const G4ParticleDefinition*, 300 G4double k << 280 G4double kineticEnergy, 301 G4double c << 281 G4double cutEnergy = 0.0, 302 G4double m << 282 G4double maxEnergy = DBL_MAX); 303 283 304 // to select atom if cross section is propor 284 // to select atom if cross section is proportional number of electrons 305 const G4Element* GetCurrentElement(const G4M << 285 inline G4int SelectRandomAtomNumber(const G4Material*); 306 G4int SelectRandomAtomNumber(const G4Materia << 307 << 308 // select isotope in order to have precise m << 309 const G4Isotope* GetCurrentIsotope(const G4E << 310 G4int SelectIsotopeNumber(const G4Element*) << 311 286 312 //------------------------------------------ 287 //------------------------------------------------------------------------ 313 // Get/Set methods 288 // Get/Set methods 314 //------------------------------------------ 289 //------------------------------------------------------------------------ 315 290 316 void SetParticleChange(G4VParticleChange*, G << 291 void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel* f=0); 317 292 318 void SetCrossSectionTable(G4PhysicsTable*, G 293 void SetCrossSectionTable(G4PhysicsTable*, G4bool isLocal); 319 294 320 inline G4ElementData* GetElementData(); 295 inline G4ElementData* GetElementData(); 321 296 322 inline G4PhysicsTable* GetCrossSectionTable( 297 inline G4PhysicsTable* GetCrossSectionTable(); 323 298 324 inline G4VEmFluctuationModel* GetModelOfFluc 299 inline G4VEmFluctuationModel* GetModelOfFluctuations(); 325 300 326 inline G4VEmAngularDistribution* GetAngularD 301 inline G4VEmAngularDistribution* GetAngularDistribution(); 327 302 328 inline G4VEmModel* GetTripletModel(); << 329 << 330 inline void SetTripletModel(G4VEmModel*); << 331 << 332 inline void SetAngularDistribution(G4VEmAngu 303 inline void SetAngularDistribution(G4VEmAngularDistribution*); 333 304 334 inline G4double HighEnergyLimit() const; 305 inline G4double HighEnergyLimit() const; 335 306 336 inline G4double LowEnergyLimit() const; 307 inline G4double LowEnergyLimit() const; 337 308 338 inline G4double HighEnergyActivationLimit() 309 inline G4double HighEnergyActivationLimit() const; 339 310 340 inline G4double LowEnergyActivationLimit() c 311 inline G4double LowEnergyActivationLimit() const; 341 312 342 inline G4double PolarAngleLimit() const; 313 inline G4double PolarAngleLimit() const; 343 314 344 inline G4double SecondaryThreshold() const; 315 inline G4double SecondaryThreshold() const; 345 316 >> 317 inline G4bool LPMFlag() const; >> 318 346 inline G4bool DeexcitationFlag() const; 319 inline G4bool DeexcitationFlag() const; 347 320 348 inline G4bool ForceBuildTableFlag() const; 321 inline G4bool ForceBuildTableFlag() const; 349 322 350 inline G4bool UseAngularGeneratorFlag() cons 323 inline G4bool UseAngularGeneratorFlag() const; 351 324 352 inline void SetAngularGeneratorFlag(G4bool); 325 inline void SetAngularGeneratorFlag(G4bool); 353 326 354 inline void SetHighEnergyLimit(G4double); 327 inline void SetHighEnergyLimit(G4double); 355 328 356 inline void SetLowEnergyLimit(G4double); 329 inline void SetLowEnergyLimit(G4double); 357 330 358 inline void SetActivationHighEnergyLimit(G4d 331 inline void SetActivationHighEnergyLimit(G4double); 359 332 360 inline void SetActivationLowEnergyLimit(G4do 333 inline void SetActivationLowEnergyLimit(G4double); 361 334 362 inline G4bool IsActive(G4double kinEnergy) c << 335 inline G4bool IsActive(G4double kinEnergy); 363 336 364 inline void SetPolarAngleLimit(G4double); 337 inline void SetPolarAngleLimit(G4double); 365 338 366 inline void SetSecondaryThreshold(G4double); 339 inline void SetSecondaryThreshold(G4double); 367 340 >> 341 inline void SetLPMFlag(G4bool val); >> 342 368 inline void SetDeexcitationFlag(G4bool val); 343 inline void SetDeexcitationFlag(G4bool val); 369 344 370 inline void SetForceBuildTable(G4bool val); 345 inline void SetForceBuildTable(G4bool val); 371 346 372 inline void SetFluctuationFlag(G4bool val); << 347 inline void SetMasterThread(G4bool val); 373 348 374 inline G4bool IsMaster() const; 349 inline G4bool IsMaster() const; 375 350 376 inline void SetUseBaseMaterials(G4bool val); << 377 << 378 inline G4bool UseBaseMaterials() const; << 379 << 380 inline G4double MaxSecondaryKinEnergy(const 351 inline G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle); 381 352 382 inline const G4String& GetName() const; 353 inline const G4String& GetName() const; 383 354 384 inline void SetCurrentCouple(const G4Materia 355 inline void SetCurrentCouple(const G4MaterialCutsCouple*); 385 356 386 inline G4bool IsLocked() const; << 357 inline const G4Element* GetCurrentElement() const; 387 << 388 inline void SetLocked(G4bool); << 389 << 390 // obsolete methods << 391 [[deprecated("Use G4EmParameters::Instance() << 392 void SetLPMFlag(G4bool); << 393 358 394 void SetMasterThread(G4bool); << 359 inline const G4Isotope* GetCurrentIsotope() const; 395 << 396 // hide assignment operator << 397 G4VEmModel & operator=(const G4VEmModel &ri << 398 G4VEmModel(const G4VEmModel&) = delete; << 399 360 400 protected: 361 protected: 401 362 402 inline const G4MaterialCutsCouple* CurrentCo 363 inline const G4MaterialCutsCouple* CurrentCouple() const; 403 364 404 inline void SetCurrentElement(const G4Elemen 365 inline void SetCurrentElement(const G4Element*); 405 366 406 private: 367 private: 407 368 408 // ======== Parameters of the class fixed at << 369 // hide assignment operator 409 << 370 G4VEmModel & operator=(const G4VEmModel &right); 410 G4VEmFluctuationModel* flucModel = null << 371 G4VEmModel(const G4VEmModel&); 411 G4VEmAngularDistribution* anglModel = null << 412 G4VEmModel* fTripletModel = << 413 const G4MaterialCutsCouple* fCurrentCouple = << 414 const G4Element* fCurrentElement << 415 std::vector<G4EmElementSelector*>* elmSelect << 416 G4LossTableManager* fEmManager; << 417 << 418 protected: << 419 << 420 G4ElementData* fElementData = << 421 G4VParticleChange* pParticleChange << 422 G4PhysicsTable* xSectionTable = << 423 const G4Material* pBaseMaterial = << 424 const std::vector<G4double>* theDensityFacto << 425 const std::vector<G4int>* theDensityIdx = << 426 372 427 G4double inveplus; << 373 // ======== Parameters of the class fixed at construction ========= 428 G4double pFactor = 1.0; << 429 374 430 private: << 375 G4VEmFluctuationModel* flucModel; >> 376 G4VEmAngularDistribution* anglModel; >> 377 const G4String name; >> 378 >> 379 // ======== Parameters of the class fixed at initialisation ======= >> 380 >> 381 G4double lowLimit; >> 382 G4double highLimit; >> 383 G4double eMinActive; >> 384 G4double eMaxActive; >> 385 G4double polarAngleLimit; >> 386 G4double secondaryThreshold; >> 387 G4bool theLPMflag; >> 388 G4bool flagDeexcitation; >> 389 G4bool flagForceBuildTable; >> 390 G4bool isMaster; >> 391 >> 392 G4bool localTable; >> 393 G4bool localElmSelectors; >> 394 G4bool useAngularGenerator; >> 395 G4int nSelectors; >> 396 std::vector<G4EmElementSelector*>* elmSelectors; 431 397 432 G4double lowLimit; << 398 protected: 433 G4double highLimit; << 434 G4double eMinActive = 0.0; << 435 G4double eMaxActive = DBL_MAX; << 436 G4double secondaryThreshold = DBL_MAX; << 437 G4double polarAngleLimit; << 438 399 439 G4int nSelectors = 0; << 400 CLHEP::HepRandomEngine* rndmEngineMod; 440 G4int nsec = 5; << 441 401 442 protected: << 402 G4ElementData* fElementData; >> 403 G4VParticleChange* pParticleChange; >> 404 G4PhysicsTable* xSectionTable; >> 405 const std::vector<G4double>* theDensityFactor; >> 406 const std::vector<G4int>* theDensityIdx; >> 407 size_t idxTable; >> 408 const static G4double inveplus; 443 409 444 std::size_t currentCoupleIndex = 0; << 410 // ======== Cashed values - may be state dependent ================ 445 std::size_t basedCoupleIndex = 0; << 446 G4bool lossFlucFlag = true; << 447 411 448 private: 412 private: 449 413 450 G4bool flagDeexcitation = false; << 414 G4LossTableManager* fManager; 451 G4bool flagForceBuildTable = false; << 415 const G4MaterialCutsCouple* fCurrentCouple; 452 G4bool isMaster = true; << 416 const G4Element* fCurrentElement; 453 << 417 const G4Isotope* fCurrentIsotope; 454 G4bool localTable = true; << 455 G4bool localElmSelectors = true; << 456 G4bool useAngularGenerator = false; << 457 G4bool useBaseMaterials = false; << 458 G4bool isLocked = false; << 459 418 460 const G4String name; << 419 G4int nsec; 461 std::vector<G4double> xsec; 420 std::vector<G4double> xsec; 462 421 463 }; 422 }; 464 423 465 // ======== Run time inline methods ========== 424 // ======== Run time inline methods ================ 466 425 467 inline void G4VEmModel::SetCurrentCouple(const << 426 inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p) 468 { 427 { 469 if(fCurrentCouple != ptr) { << 428 fCurrentCouple = p; 470 fCurrentCouple = ptr; << 429 rndmEngineMod = G4Random::getTheEngine(); 471 basedCoupleIndex = currentCoupleIndex = pt << 472 pBaseMaterial = ptr->GetMaterial(); << 473 pFactor = 1.0; << 474 if(useBaseMaterials) { << 475 basedCoupleIndex = (*theDensityIdx)[curr << 476 if(nullptr != pBaseMaterial->GetBaseMate << 477 pBaseMaterial = pBaseMaterial->GetBaseMateri << 478 pFactor = (*theDensityFactor)[currentCou << 479 } << 480 } << 481 } 430 } 482 431 483 //....oooOO0OOooo........oooOO0OOooo........oo 432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 484 433 485 inline const G4MaterialCutsCouple* G4VEmModel: 434 inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const 486 { 435 { 487 return fCurrentCouple; 436 return fCurrentCouple; 488 } 437 } 489 438 490 //....oooOO0OOooo........oooOO0OOooo........oo 439 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 491 440 492 inline void G4VEmModel::SetCurrentElement(cons 441 inline void G4VEmModel::SetCurrentElement(const G4Element* elm) 493 { 442 { 494 fCurrentElement = elm; 443 fCurrentElement = elm; >> 444 fCurrentIsotope = 0; >> 445 } >> 446 >> 447 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 448 >> 449 inline const G4Element* G4VEmModel::GetCurrentElement() const >> 450 { >> 451 return fCurrentElement; >> 452 } >> 453 >> 454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 455 >> 456 inline const G4Isotope* G4VEmModel::GetCurrentIsotope() const >> 457 { >> 458 return fCurrentIsotope; 495 } 459 } 496 460 497 //....oooOO0OOooo........oooOO0OOooo........oo 461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 498 462 499 inline 463 inline 500 G4double G4VEmModel::MaxSecondaryKinEnergy(con 464 G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart) 501 { 465 { 502 return MaxSecondaryEnergy(dynPart->GetPartic 466 return MaxSecondaryEnergy(dynPart->GetParticleDefinition(), 503 dynPart->GetKineti 467 dynPart->GetKineticEnergy()); 504 } 468 } 505 469 506 //....oooOO0OOooo........oooOO0OOooo........oo 470 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 507 471 508 inline G4double G4VEmModel::ComputeDEDX(const 472 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* couple, 509 const 473 const G4ParticleDefinition* part, 510 G4doub << 474 G4double kinEnergy, 511 G4doub << 475 G4double cutEnergy) 512 { 476 { 513 SetCurrentCouple(couple); 477 SetCurrentCouple(couple); 514 return pFactor*ComputeDEDXPerVolume(pBaseMat << 478 return ComputeDEDXPerVolume(couple->GetMaterial(),part,kinEnergy,cutEnergy); 515 } 479 } 516 480 517 //....oooOO0OOooo........oooOO0OOooo........oo 481 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 518 482 519 inline G4double G4VEmModel::CrossSection(const 483 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* couple, 520 const 484 const G4ParticleDefinition* part, 521 G4dou << 485 G4double kinEnergy, 522 G4dou << 486 G4double cutEnergy, 523 G4dou << 487 G4double maxEnergy) 524 { 488 { 525 SetCurrentCouple(couple); 489 SetCurrentCouple(couple); 526 return pFactor*CrossSectionPerVolume(pBaseMa << 490 return CrossSectionPerVolume(couple->GetMaterial(),part,kinEnergy, 527 cutEner << 491 cutEnergy,maxEnergy); 528 } 492 } 529 493 530 //....oooOO0OOooo........oooOO0OOooo........oo 494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 531 495 532 inline 496 inline 533 G4double G4VEmModel::ComputeMeanFreePath(const 497 G4double G4VEmModel::ComputeMeanFreePath(const G4ParticleDefinition* part, 534 G4dou << 498 G4double ekin, 535 const << 499 const G4Material* material, 536 G4dou << 500 G4double emin, 537 G4dou << 501 G4double emax) 538 { 502 { >> 503 G4double mfp = DBL_MAX; 539 G4double cross = CrossSectionPerVolume(mater 504 G4double cross = CrossSectionPerVolume(material,part,ekin,emin,emax); 540 return (cross > 0.0) ? 1./cross : DBL_MAX; << 505 if (cross > DBL_MIN) { mfp = 1./cross; } >> 506 return mfp; 541 } 507 } 542 508 543 //....oooOO0OOooo........oooOO0OOooo........oo 509 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 544 510 545 inline G4double << 511 inline G4double G4VEmModel::ComputeCrossSectionPerAtom( 546 G4VEmModel::ComputeCrossSectionPerAtom(const G << 512 const G4ParticleDefinition* part, 547 const G << 513 const G4Element* elm, 548 G4doubl << 514 G4double kinEnergy, 549 G4doubl << 515 G4double cutEnergy, 550 G4doubl << 516 G4double maxEnergy) 551 { 517 { 552 fCurrentElement = elm; << 518 SetCurrentElement(elm); 553 return ComputeCrossSectionPerAtom(part,kinEn 519 return ComputeCrossSectionPerAtom(part,kinEnergy,elm->GetZ(),elm->GetN(), 554 cutEnergy, << 520 cutEnergy,maxEnergy); 555 } 521 } 556 522 557 //....oooOO0OOooo........oooOO0OOooo........oo 523 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 558 524 559 inline const G4Element* << 525 inline const G4Element* 560 G4VEmModel::SelectRandomAtom(const G4MaterialC 526 G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple, 561 const G4ParticleD << 527 const G4ParticleDefinition* part, 562 G4double kinEnerg << 528 G4double kinEnergy, 563 G4double cutEnerg << 529 G4double cutEnergy, 564 G4double maxEnerg << 530 G4double maxEnergy) 565 { << 531 { 566 SetCurrentCouple(couple); << 532 fCurrentCouple = couple; 567 fCurrentElement = (nSelectors > 0) ? << 533 if(nSelectors > 0) { 568 ((*elmSelectors)[couple->GetIndex()])->Sel << 534 fCurrentElement = 569 SelectRandomAtom(pBaseMaterial,part,kinEne << 535 ((*elmSelectors)[couple->GetIndex()])->SelectRandomAtom(kinEnergy); >> 536 } else { >> 537 fCurrentElement = SelectRandomAtom(couple->GetMaterial(),part,kinEnergy, >> 538 cutEnergy,maxEnergy); >> 539 } >> 540 fCurrentIsotope = 0; 570 return fCurrentElement; 541 return fCurrentElement; 571 } 542 } 572 543 573 //....oooOO0OOooo........oooOO0OOooo........oo 544 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 574 545 575 inline const G4Element* << 546 inline G4int G4VEmModel::SelectRandomAtomNumber(const G4Material* mat) 576 G4VEmModel::SelectTargetAtom(const G4MaterialC << 577 const G4ParticleD << 578 G4double kinEnerg << 579 G4double logKinE, << 580 G4double cutEnerg << 581 G4double maxEnerg << 582 { 547 { 583 SetCurrentCouple(couple); << 548 // this algorith assumes that cross section is proportional to 584 fCurrentElement = (nSelectors > 0) << 549 // number electrons multiplied by number of atoms 585 ? ((*elmSelectors)[couple->GetIndex()])->Se << 550 size_t nn = mat->GetNumberOfElements(); 586 : SelectRandomAtom(pBaseMaterial,part,kinEn << 551 const G4ElementVector* elmv = mat->GetElementVector(); 587 return fCurrentElement; << 552 G4int Z = G4lrint((*elmv)[0]->GetZ()); >> 553 if(1 < nn) { >> 554 const G4double* at = mat->GetVecNbOfAtomsPerVolume(); >> 555 G4double tot = mat->GetTotNbOfAtomsPerVolume()*rndmEngineMod->flat(); >> 556 for( size_t i=0; i<nn; ++i) { >> 557 Z = G4lrint((*elmv)[0]->GetZ()); >> 558 tot -= Z*at[i]; >> 559 if(tot <= 0.0) { break; } >> 560 } >> 561 } >> 562 return Z; >> 563 } >> 564 >> 565 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 566 >> 567 inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm) >> 568 { >> 569 SetCurrentElement(elm); >> 570 G4int N = G4lrint(elm->GetN()); >> 571 G4int ni = elm->GetNumberOfIsotopes(); >> 572 fCurrentIsotope = 0; >> 573 if(ni > 0) { >> 574 G4int idx = 0; >> 575 if(ni > 1) { >> 576 G4double* ab = elm->GetRelativeAbundanceVector(); >> 577 G4double x = rndmEngineMod->flat(); >> 578 for(; idx<ni; ++idx) { >> 579 x -= ab[idx]; >> 580 if (x <= 0.0) { break; } >> 581 } >> 582 if(idx >= ni) { idx = ni - 1; } >> 583 } >> 584 fCurrentIsotope = elm->GetIsotope(idx); >> 585 N = fCurrentIsotope->GetN(); >> 586 } >> 587 return N; 588 } 588 } 589 589 590 // ======== Get/Set inline methods used at ini 590 // ======== Get/Set inline methods used at initialisation ================ 591 591 592 inline G4VEmFluctuationModel* G4VEmModel::GetM 592 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations() 593 { 593 { 594 return flucModel; 594 return flucModel; 595 } 595 } 596 596 597 //....oooOO0OOooo........oooOO0OOooo........oo 597 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 598 598 599 inline G4VEmAngularDistribution* G4VEmModel::G 599 inline G4VEmAngularDistribution* G4VEmModel::GetAngularDistribution() 600 { 600 { 601 return anglModel; 601 return anglModel; 602 } 602 } 603 603 604 //....oooOO0OOooo........oooOO0OOooo........oo 604 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 605 605 606 inline void G4VEmModel::SetAngularDistribution 606 inline void G4VEmModel::SetAngularDistribution(G4VEmAngularDistribution* p) 607 { 607 { 608 if(p != anglModel) { 608 if(p != anglModel) { 609 delete anglModel; 609 delete anglModel; 610 anglModel = p; 610 anglModel = p; 611 } 611 } 612 } 612 } 613 613 614 //....oooOO0OOooo........oooOO0OOooo........oo 614 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 615 615 616 inline G4VEmModel* G4VEmModel::GetTripletModel << 617 { << 618 return fTripletModel; << 619 } << 620 << 621 //....oooOO0OOooo........oooOO0OOooo........oo << 622 << 623 inline void G4VEmModel::SetTripletModel(G4VEmM << 624 { << 625 if(p != fTripletModel) { << 626 delete fTripletModel; << 627 fTripletModel = p; << 628 } << 629 } << 630 << 631 //....oooOO0OOooo........oooOO0OOooo........oo << 632 << 633 inline G4double G4VEmModel::HighEnergyLimit() 616 inline G4double G4VEmModel::HighEnergyLimit() const 634 { 617 { 635 return highLimit; 618 return highLimit; 636 } 619 } 637 620 638 //....oooOO0OOooo........oooOO0OOooo........oo 621 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 639 622 640 inline G4double G4VEmModel::LowEnergyLimit() c 623 inline G4double G4VEmModel::LowEnergyLimit() const 641 { 624 { 642 return lowLimit; 625 return lowLimit; 643 } 626 } 644 627 645 //....oooOO0OOooo........oooOO0OOooo........oo 628 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 646 629 647 inline G4double G4VEmModel::HighEnergyActivati 630 inline G4double G4VEmModel::HighEnergyActivationLimit() const 648 { 631 { 649 return eMaxActive; 632 return eMaxActive; 650 } 633 } 651 634 652 //....oooOO0OOooo........oooOO0OOooo........oo 635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 653 636 654 inline G4double G4VEmModel::LowEnergyActivatio 637 inline G4double G4VEmModel::LowEnergyActivationLimit() const 655 { 638 { 656 return eMinActive; 639 return eMinActive; 657 } 640 } 658 641 659 //....oooOO0OOooo........oooOO0OOooo........oo 642 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 660 643 661 inline G4double G4VEmModel::PolarAngleLimit() 644 inline G4double G4VEmModel::PolarAngleLimit() const 662 { 645 { 663 return polarAngleLimit; 646 return polarAngleLimit; 664 } 647 } 665 648 666 //....oooOO0OOooo........oooOO0OOooo........oo 649 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 667 650 668 inline G4double G4VEmModel::SecondaryThreshold 651 inline G4double G4VEmModel::SecondaryThreshold() const 669 { 652 { 670 return secondaryThreshold; 653 return secondaryThreshold; 671 } 654 } 672 655 673 //....oooOO0OOooo........oooOO0OOooo........oo 656 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 674 657 >> 658 inline G4bool G4VEmModel::LPMFlag() const >> 659 { >> 660 return theLPMflag; >> 661 } >> 662 >> 663 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 664 675 inline G4bool G4VEmModel::DeexcitationFlag() c 665 inline G4bool G4VEmModel::DeexcitationFlag() const 676 { 666 { 677 return flagDeexcitation; 667 return flagDeexcitation; 678 } 668 } 679 669 680 //....oooOO0OOooo........oooOO0OOooo........oo 670 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 681 671 682 inline G4bool G4VEmModel::ForceBuildTableFlag( 672 inline G4bool G4VEmModel::ForceBuildTableFlag() const 683 { 673 { 684 return flagForceBuildTable; 674 return flagForceBuildTable; 685 } 675 } 686 676 687 //....oooOO0OOooo........oooOO0OOooo........oo 677 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 688 678 689 inline G4bool G4VEmModel::UseAngularGeneratorF 679 inline G4bool G4VEmModel::UseAngularGeneratorFlag() const 690 { 680 { 691 return useAngularGenerator; 681 return useAngularGenerator; 692 } 682 } 693 683 694 //....oooOO0OOooo........oooOO0OOooo........oo 684 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 695 685 696 inline void G4VEmModel::SetAngularGeneratorFla 686 inline void G4VEmModel::SetAngularGeneratorFlag(G4bool val) 697 { 687 { 698 useAngularGenerator = val; 688 useAngularGenerator = val; 699 } 689 } 700 690 701 //....oooOO0OOooo........oooOO0OOooo........oo 691 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 702 692 703 inline void G4VEmModel::SetFluctuationFlag(G4b << 693 inline void G4VEmModel::SetMasterThread(G4bool val) 704 { 694 { 705 lossFlucFlag = val; << 695 isMaster = val; 706 } 696 } 707 697 708 //....oooOO0OOooo........oooOO0OOooo........oo 698 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 709 699 710 inline G4bool G4VEmModel::IsMaster() const 700 inline G4bool G4VEmModel::IsMaster() const 711 { 701 { 712 return isMaster; 702 return isMaster; 713 } 703 } 714 704 715 //....oooOO0OOooo........oooOO0OOooo........oo 705 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 716 706 717 inline void G4VEmModel::SetUseBaseMaterials(G4 << 718 { << 719 useBaseMaterials = val; << 720 } << 721 << 722 //....oooOO0OOooo........oooOO0OOooo........oo << 723 << 724 inline G4bool G4VEmModel::UseBaseMaterials() c << 725 { << 726 return useBaseMaterials; << 727 } << 728 << 729 //....oooOO0OOooo........oooOO0OOooo........oo << 730 << 731 inline void G4VEmModel::SetHighEnergyLimit(G4d 707 inline void G4VEmModel::SetHighEnergyLimit(G4double val) 732 { 708 { 733 highLimit = val; 709 highLimit = val; 734 } 710 } 735 711 736 //....oooOO0OOooo........oooOO0OOooo........oo 712 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 737 713 738 inline void G4VEmModel::SetLowEnergyLimit(G4do 714 inline void G4VEmModel::SetLowEnergyLimit(G4double val) 739 { 715 { 740 lowLimit = val; 716 lowLimit = val; 741 } 717 } 742 718 743 //....oooOO0OOooo........oooOO0OOooo........oo 719 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 744 720 745 inline void G4VEmModel::SetActivationHighEnerg 721 inline void G4VEmModel::SetActivationHighEnergyLimit(G4double val) 746 { 722 { 747 eMaxActive = val; 723 eMaxActive = val; 748 } 724 } 749 725 750 //....oooOO0OOooo........oooOO0OOooo........oo 726 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 751 727 752 inline void G4VEmModel::SetActivationLowEnergy 728 inline void G4VEmModel::SetActivationLowEnergyLimit(G4double val) 753 { 729 { 754 eMinActive = val; 730 eMinActive = val; 755 } 731 } 756 732 757 //....oooOO0OOooo........oooOO0OOooo........oo 733 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 758 734 759 inline G4bool G4VEmModel::IsActive(G4double ki << 735 inline G4bool G4VEmModel::IsActive(G4double kinEnergy) 760 { 736 { 761 return (kinEnergy >= eMinActive && kinEnergy 737 return (kinEnergy >= eMinActive && kinEnergy <= eMaxActive); 762 } 738 } 763 739 764 //....oooOO0OOooo........oooOO0OOooo........oo 740 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 765 741 766 inline void G4VEmModel::SetPolarAngleLimit(G4d 742 inline void G4VEmModel::SetPolarAngleLimit(G4double val) 767 { 743 { 768 if(!isLocked) { polarAngleLimit = val; } << 744 polarAngleLimit = val; 769 } 745 } 770 746 771 //....oooOO0OOooo........oooOO0OOooo........oo 747 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 772 748 773 inline void G4VEmModel::SetSecondaryThreshold( 749 inline void G4VEmModel::SetSecondaryThreshold(G4double val) 774 { 750 { 775 secondaryThreshold = val; 751 secondaryThreshold = val; 776 } 752 } 777 753 778 //....oooOO0OOooo........oooOO0OOooo........oo 754 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 779 755 >> 756 inline void G4VEmModel::SetLPMFlag(G4bool val) >> 757 { >> 758 theLPMflag = val; >> 759 } >> 760 >> 761 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 762 780 inline void G4VEmModel::SetDeexcitationFlag(G4 763 inline void G4VEmModel::SetDeexcitationFlag(G4bool val) 781 { 764 { 782 flagDeexcitation = val; 765 flagDeexcitation = val; 783 } 766 } 784 767 785 //....oooOO0OOooo........oooOO0OOooo........oo 768 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 786 769 787 inline void G4VEmModel::SetForceBuildTable(G4b 770 inline void G4VEmModel::SetForceBuildTable(G4bool val) 788 { 771 { 789 flagForceBuildTable = val; 772 flagForceBuildTable = val; 790 } 773 } 791 774 792 //....oooOO0OOooo........oooOO0OOooo........oo 775 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 793 776 794 inline const G4String& G4VEmModel::GetName() c 777 inline const G4String& G4VEmModel::GetName() const 795 { 778 { 796 return name; 779 return name; 797 } 780 } 798 781 799 //....oooOO0OOooo........oooOO0OOooo........oo 782 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 800 783 801 inline std::vector<G4EmElementSelector*>* G4VE 784 inline std::vector<G4EmElementSelector*>* G4VEmModel::GetElementSelectors() 802 { 785 { 803 return elmSelectors; 786 return elmSelectors; 804 } 787 } 805 788 806 //....oooOO0OOooo........oooOO0OOooo........oo 789 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 807 790 808 inline void 791 inline void 809 G4VEmModel::SetElementSelectors(std::vector<G4 792 G4VEmModel::SetElementSelectors(std::vector<G4EmElementSelector*>* p) 810 { 793 { 811 if(p != elmSelectors) { << 794 elmSelectors = p; 812 elmSelectors = p; << 795 if(elmSelectors) { nSelectors = elmSelectors->size(); } 813 nSelectors = (nullptr != elmSelectors) ? G << 796 localElmSelectors = false; 814 localElmSelectors = false; << 815 } << 816 } 797 } 817 798 818 //....oooOO0OOooo........oooOO0OOooo........oo 799 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 819 800 820 inline G4ElementData* G4VEmModel::GetElementDa 801 inline G4ElementData* G4VEmModel::GetElementData() 821 { 802 { 822 return fElementData; 803 return fElementData; 823 } 804 } 824 805 825 //....oooOO0OOooo........oooOO0OOooo........oo 806 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 826 807 827 inline G4PhysicsTable* G4VEmModel::GetCrossSec 808 inline G4PhysicsTable* G4VEmModel::GetCrossSectionTable() 828 { 809 { 829 return xSectionTable; 810 return xSectionTable; 830 } 811 } 831 812 832 //....oooOO0OOooo........oooOO0OOooo........oo << 833 << 834 inline G4bool G4VEmModel::IsLocked() const << 835 { << 836 return isLocked; << 837 } << 838 << 839 //....oooOO0OOooo........oooOO0OOooo........oo << 840 << 841 inline void G4VEmModel::SetLocked(G4bool val) << 842 { << 843 isLocked = val; << 844 } << 845 << 846 //....oooOO0OOooo........oooOO0OOooo........oo 813 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 847 814 848 #endif 815 #endif >> 816 849 817