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