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