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: G4VAtomDeexcitation.hh 84398 2014-10-15 07:20:18Z gcosmo $ 26 // 27 // 27 // ------------------------------------------- 28 // ------------------------------------------------------------------- 28 // 29 // 29 // GEANT4 Class header file 30 // GEANT4 Class header file 30 // 31 // 31 // 32 // 32 // File name: G4VAtomDeexcitation 33 // File name: G4VAtomDeexcitation 33 // 34 // 34 // Author: Alfonso Mantero & Vladimir I 35 // Author: Alfonso Mantero & Vladimir Ivanchenko 35 // 36 // 36 // Creation date: 30.06.2009 37 // Creation date: 30.06.2009 37 // 38 // 38 // Modifications: 39 // Modifications: 39 // 15 Mar 2011 ALF stripped G4AtomicShellEn 40 // 15 Mar 2011 ALF stripped G4AtomicShellEnumerator to its own file 40 // 41 // 41 // Class Description: 42 // Class Description: 42 // 43 // 43 // Abstract interface to energy loss models 44 // Abstract interface to energy loss models 44 45 45 // ------------------------------------------- 46 // ------------------------------------------------------------------- 46 // 47 // 47 48 48 #ifndef G4VAtomDeexcitation_h 49 #ifndef G4VAtomDeexcitation_h 49 #define G4VAtomDeexcitation_h 1 50 #define G4VAtomDeexcitation_h 1 50 51 51 #include "globals.hh" 52 #include "globals.hh" 52 #include "G4EmParameters.hh" 53 #include "G4EmParameters.hh" 53 #include "G4AtomicShell.hh" 54 #include "G4AtomicShell.hh" 54 #include "G4AtomicShellEnumerator.hh" 55 #include "G4AtomicShellEnumerator.hh" 55 #include "G4ProductionCutsTable.hh" 56 #include "G4ProductionCutsTable.hh" 56 #include "G4Track.hh" 57 #include "G4Track.hh" 57 #include "G4Threading.hh" << 58 #include <vector> 58 #include <vector> 59 59 60 class G4ParticleDefinition; 60 class G4ParticleDefinition; 61 class G4DynamicParticle; 61 class G4DynamicParticle; 62 class G4MaterialCutsCouple; 62 class G4MaterialCutsCouple; 63 63 64 class G4VAtomDeexcitation { 64 class G4VAtomDeexcitation { 65 public: 65 public: 66 66 67 explicit G4VAtomDeexcitation(const G4String& << 67 G4VAtomDeexcitation(const G4String& modname = "Deexcitation", >> 68 const G4String& pixename = ""); 68 69 69 virtual ~G4VAtomDeexcitation(); 70 virtual ~G4VAtomDeexcitation(); 70 71 71 //========== initialization ========== 72 //========== initialization ========== 72 73 73 // Overall initialisation before new run 74 // Overall initialisation before new run 74 void InitialiseAtomicDeexcitation(); 75 void InitialiseAtomicDeexcitation(); 75 76 76 // Initialisation of deexcitation at the beg 77 // Initialisation of deexcitation at the beginning of run 77 virtual void InitialiseForNewRun() = 0; 78 virtual void InitialiseForNewRun() = 0; 78 79 79 // Initialisation for a concrete atom 80 // Initialisation for a concrete atom 80 // May be called at run time 81 // May be called at run time 81 virtual void InitialiseForExtraAtom(G4int Z) 82 virtual void InitialiseForExtraAtom(G4int Z) = 0; 82 83 >> 84 // Activation of deexcitation per detector region 83 void SetDeexcitationActiveRegion(const G4Str 85 void SetDeexcitationActiveRegion(const G4String& rname, 84 G4bool valD << 86 G4bool valDeexcitation, 85 G4bool valA << 87 G4bool valAuger, 86 G4bool valP << 88 G4bool valPIXE); 87 89 88 // Activation of deexcitation 90 // Activation of deexcitation 89 inline void SetFluo(G4bool); 91 inline void SetFluo(G4bool); 90 inline G4bool IsFluoActive() const; 92 inline G4bool IsFluoActive() const; 91 93 92 // Activation of Auger electron production 94 // Activation of Auger electron production 93 inline void SetAuger(G4bool); 95 inline void SetAuger(G4bool); 94 inline G4bool IsAugerActive() const; 96 inline G4bool IsAugerActive() const; 95 97 96 // Activation of Auger cascade << 97 inline void SetAugerCascade(G4bool); << 98 inline G4bool IsAugerCascadeActive() const; << 99 << 100 // Activation of PIXE simulation 98 // Activation of PIXE simulation 101 inline void SetPIXE(G4bool); 99 inline void SetPIXE(G4bool); >> 100 // inline void SetPIXEActive(G4bool); 102 inline G4bool IsPIXEActive() const; 101 inline G4bool IsPIXEActive() const; 103 102 104 // Deexcitation model name 103 // Deexcitation model name 105 inline const G4String& GetName() const; 104 inline const G4String& GetName() const; 106 105 >> 106 // PIXE model name >> 107 inline void SetPIXECrossSectionModel(const G4String&); >> 108 inline const G4String& PIXECrossSectionModel() const; >> 109 >> 110 // PIXE model name for e+e- >> 111 inline void SetPIXEElectronCrossSectionModel(const G4String&); >> 112 inline const G4String& PIXEElectronCrossSectionModel() const; >> 113 >> 114 // Set flag allowing ignore production thresholds in deexcitation >> 115 inline void SetIgnoreCuts(G4bool); >> 116 inline G4bool IgnoreCuts() const; >> 117 107 // Access to the list of atoms active for de 118 // Access to the list of atoms active for deexcitation 108 inline const std::vector<G4bool>& GetListOfA 119 inline const std::vector<G4bool>& GetListOfActiveAtoms() const; 109 120 110 // Verbosity level 121 // Verbosity level 111 inline void SetVerboseLevel(G4int); 122 inline void SetVerboseLevel(G4int); 112 inline G4int GetVerboseLevel() const; 123 inline G4int GetVerboseLevel() const; 113 124 114 //========== Run time methods ========== 125 //========== Run time methods ========== 115 126 116 // Check if deexcitation is active for a giv 127 // Check if deexcitation is active for a given geometry volume 117 inline G4bool CheckDeexcitationActiveRegion( 128 inline G4bool CheckDeexcitationActiveRegion(G4int coupleIndex); 118 inline G4bool CheckAugerActiveRegion(G4int c 129 inline G4bool CheckAugerActiveRegion(G4int coupleIndex); 119 130 120 // Get atomic shell by shell index, used by 131 // Get atomic shell by shell index, used by discrete processes 121 // (for example, photoelectric), when shell 132 // (for example, photoelectric), when shell vacancy sampled by the model 122 virtual 133 virtual 123 const G4AtomicShell* GetAtomicShell(G4int Z, 134 const G4AtomicShell* GetAtomicShell(G4int Z, 124 G4Atomic << 135 G4AtomicShellEnumerator shell) = 0; 125 136 126 // generation of deexcitation for given atom 137 // generation of deexcitation for given atom and shell vacancy 127 // and material cut couple, which defines cu << 138 inline void GenerateParticles(std::vector<G4DynamicParticle*>* secVect, 128 void GenerateParticles(std::vector<G4Dynamic << 139 const G4AtomicShell*, 129 const G4AtomicShell*, << 140 G4int Z, 130 G4int Z, G4int couple << 141 G4int coupleIndex); 131 142 132 // generation of deexcitation for given atom 143 // generation of deexcitation for given atom and shell vacancy 133 virtual void GenerateParticles(std::vector<G 144 virtual void GenerateParticles(std::vector<G4DynamicParticle*>* secVect, 134 const G4Atomi << 145 const G4AtomicShell*, 135 G4int Z, G4do << 146 G4int Z, >> 147 G4double gammaCut, >> 148 G4double eCut) = 0; 136 149 137 // access or compute PIXE cross section 150 // access or compute PIXE cross section 138 virtual G4double 151 virtual G4double 139 GetShellIonisationCrossSectionPerAtom(const 152 GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition*, 140 G4int << 153 G4int Z, 141 G4Atom << 154 G4AtomicShellEnumerator shell, 142 G4doub << 155 G4double kinE, 143 const << 156 const G4Material* mat = 0) = 0; 144 157 145 // access or compute PIXE cross section 158 // access or compute PIXE cross section 146 virtual G4double 159 virtual G4double 147 ComputeShellIonisationCrossSectionPerAtom( << 160 ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition*, 148 const << 161 G4int Z, 149 G4int << 162 G4AtomicShellEnumerator shell, 150 G4Atom << 163 G4double kinE, 151 G4doub << 164 const G4Material* mat = 0) = 0; 152 const << 153 165 154 // Sampling of PIXE for ionisation processes 166 // Sampling of PIXE for ionisation processes 155 void AlongStepDeexcitation(std::vector<G4Tra 167 void AlongStepDeexcitation(std::vector<G4Track*>& tracks, 156 const G4Step& ste << 168 const G4Step& step, 157 G4double& eLoss, << 169 G4double& eLoss, 158 G4int coupleIndex 170 G4int coupleIndex); 159 171 160 // copy constructor and hide assignment oper << 161 G4VAtomDeexcitation(G4VAtomDeexcitation &) = << 162 G4VAtomDeexcitation & operator=(const G4VAto << 163 << 164 private: 172 private: 165 173 166 const G4ParticleDefinition* gamma; << 174 // copy constructor and hide assignment operator 167 const G4ProductionCutsTable* theCoupleTable << 175 G4VAtomDeexcitation(G4VAtomDeexcitation &); 168 << 176 G4VAtomDeexcitation & operator=(const G4VAtomDeexcitation &right); 169 G4int nCouples = 0; << 170 G4int verbose = 1; << 171 177 172 G4bool isActive = false; << 178 G4EmParameters* theParameters; 173 G4bool flagAuger = false; << 179 const G4ParticleDefinition* gamma; 174 G4bool flagPIXE = false; << 175 G4bool ignoreCuts = false; << 176 << 177 G4bool isActiveLocked = false; << 178 G4bool isAugerLocked = false; << 179 G4bool isPIXELocked = false; << 180 180 >> 181 G4ProductionCutsTable* theCoupleTable; >> 182 G4double lowestKinEnergy; >> 183 G4int verbose; >> 184 G4String name; >> 185 G4String namePIXE; >> 186 G4String nameElectronPIXE; >> 187 G4bool isActive; >> 188 G4bool flagAuger; >> 189 G4bool flagPIXE; >> 190 G4bool ignoreCuts; 181 std::vector<G4bool> activeZ; 191 std::vector<G4bool> activeZ; 182 std::vector<G4bool> activeDeexcitationMedi 192 std::vector<G4bool> activeDeexcitationMedia; 183 std::vector<G4bool> activeAugerMedia; 193 std::vector<G4bool> activeAugerMedia; 184 std::vector<G4bool> activePIXEMedia; 194 std::vector<G4bool> activePIXEMedia; >> 195 std::vector<G4String> activeRegions; 185 std::vector<G4bool> deRegions; 196 std::vector<G4bool> deRegions; 186 std::vector<G4bool> AugerRegions; 197 std::vector<G4bool> AugerRegions; 187 std::vector<G4bool> PIXERegions; 198 std::vector<G4bool> PIXERegions; 188 std::vector<G4DynamicParticle*> vdyn; 199 std::vector<G4DynamicParticle*> vdyn; 189 std::vector<G4String> activeRegions; << 190 << 191 G4String name; << 192 200 193 #ifdef G4MULTITHREADED << 201 static G4int pixeIDg; 194 static G4Mutex atomDeexcitationMutex; << 202 static G4int pixeIDe; 195 #endif << 196 }; 203 }; 197 204 198 inline void G4VAtomDeexcitation::SetFluo(G4boo 205 inline void G4VAtomDeexcitation::SetFluo(G4bool val) 199 { 206 { 200 if(!isActiveLocked) { isActive = val; isActi << 207 isActive = val; >> 208 theParameters->SetFluo(val); 201 } 209 } 202 210 203 inline G4bool G4VAtomDeexcitation::IsFluoActiv 211 inline G4bool G4VAtomDeexcitation::IsFluoActive() const 204 { 212 { 205 return isActive; 213 return isActive; 206 } 214 } 207 215 208 inline void G4VAtomDeexcitation::SetAuger(G4bo 216 inline void G4VAtomDeexcitation::SetAuger(G4bool val) 209 { 217 { 210 if(!isAugerLocked) { flagAuger = val; isAuge << 218 flagAuger = val; >> 219 if(val) { isActive = true; } >> 220 theParameters->SetAuger(val); 211 } 221 } 212 222 213 inline G4bool G4VAtomDeexcitation::IsAugerActi 223 inline G4bool G4VAtomDeexcitation::IsAugerActive() const 214 { 224 { 215 return flagAuger; 225 return flagAuger; 216 } 226 } 217 227 218 inline void G4VAtomDeexcitation::SetAugerCasca << 228 inline void G4VAtomDeexcitation::SetPIXE(G4bool val) 219 { 229 { 220 SetAuger(val); << 230 flagPIXE = val; >> 231 if(val) { isActive = true; } >> 232 theParameters->SetPixe(val); 221 } 233 } 222 234 223 inline G4bool G4VAtomDeexcitation::IsAugerCasc << 235 inline G4bool G4VAtomDeexcitation::IsPIXEActive() const 224 { 236 { 225 return flagAuger; << 237 return flagPIXE; 226 } 238 } 227 239 228 inline void G4VAtomDeexcitation::SetPIXE(G4boo << 240 inline void G4VAtomDeexcitation::SetIgnoreCuts(G4bool val) 229 { 241 { 230 if(!isPIXELocked) { flagPIXE = val; isPIXEL << 242 ignoreCuts = val; 231 } << 243 } 232 244 233 inline G4bool G4VAtomDeexcitation::IsPIXEActiv << 245 inline G4bool G4VAtomDeexcitation::IgnoreCuts() const 234 { 246 { 235 return flagPIXE; << 247 return ignoreCuts; 236 } << 248 } 237 249 238 inline const G4String& G4VAtomDeexcitation::Ge 250 inline const G4String& G4VAtomDeexcitation::GetName() const 239 { 251 { 240 return name; 252 return name; 241 } 253 } 242 254 >> 255 inline >> 256 void G4VAtomDeexcitation::SetPIXECrossSectionModel(const G4String& n) >> 257 { >> 258 namePIXE = n; >> 259 } >> 260 >> 261 inline void >> 262 G4VAtomDeexcitation::SetPIXEElectronCrossSectionModel(const G4String& n) >> 263 { >> 264 nameElectronPIXE = n; >> 265 } >> 266 >> 267 inline >> 268 const G4String& G4VAtomDeexcitation::PIXECrossSectionModel() const >> 269 { >> 270 return namePIXE; >> 271 } >> 272 >> 273 inline >> 274 const G4String& G4VAtomDeexcitation::PIXEElectronCrossSectionModel() const >> 275 { >> 276 return nameElectronPIXE; >> 277 } >> 278 243 inline const std::vector<G4bool>& 279 inline const std::vector<G4bool>& 244 G4VAtomDeexcitation::GetListOfActiveAtoms() co 280 G4VAtomDeexcitation::GetListOfActiveAtoms() const 245 { 281 { 246 return activeZ; 282 return activeZ; 247 } 283 } 248 284 249 inline void G4VAtomDeexcitation::SetVerboseLev 285 inline void G4VAtomDeexcitation::SetVerboseLevel(G4int val) 250 { 286 { 251 verbose = val; 287 verbose = val; 252 } 288 } 253 289 254 inline G4int G4VAtomDeexcitation::GetVerboseLe 290 inline G4int G4VAtomDeexcitation::GetVerboseLevel() const 255 { 291 { 256 return verbose; 292 return verbose; 257 } 293 } 258 294 259 inline G4bool 295 inline G4bool 260 G4VAtomDeexcitation::CheckDeexcitationActiveRe << 296 G4VAtomDeexcitation::CheckDeexcitationActiveRegion(G4int coupleIndex) 261 { 297 { 262 return (idx < nCouples) ? activeDeexcitation << 298 return (isActive || activeDeexcitationMedia[coupleIndex]); 263 } 299 } 264 300 265 inline G4bool 301 inline G4bool 266 G4VAtomDeexcitation::CheckAugerActiveRegion(G4 << 302 G4VAtomDeexcitation::CheckAugerActiveRegion(G4int coupleIndex) 267 { 303 { 268 return (idx < nCouples) ? activeAugerMedia[i << 304 >> 305 return (flagAuger || activeAugerMedia[coupleIndex]); >> 306 } >> 307 >> 308 inline void >> 309 G4VAtomDeexcitation::GenerateParticles(std::vector<G4DynamicParticle*>* v, >> 310 const G4AtomicShell* as, >> 311 G4int Z, >> 312 G4int idx) >> 313 { >> 314 G4double gCut = DBL_MAX; >> 315 if(ignoreCuts) { >> 316 gCut = 0.0; >> 317 } else if (theCoupleTable) { >> 318 gCut = (*(theCoupleTable->GetEnergyCutsVector(0)))[idx]; >> 319 } >> 320 if(gCut < as->BindingEnergy()) { >> 321 G4double eCut = DBL_MAX; >> 322 if(CheckAugerActiveRegion(idx)) { >> 323 if(ignoreCuts) { >> 324 eCut = 0.0; >> 325 } else if (theCoupleTable) { >> 326 eCut = (*(theCoupleTable->GetEnergyCutsVector(1)))[idx]; >> 327 } >> 328 } >> 329 GenerateParticles(v, as, Z, gCut, eCut); >> 330 } 269 } 331 } 270 332 271 #endif 333 #endif 272 334 273 335