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$ 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 "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" << 58 #include <vector> 57 #include <vector> 59 58 60 class G4ParticleDefinition; 59 class G4ParticleDefinition; 61 class G4DynamicParticle; 60 class G4DynamicParticle; 62 class G4MaterialCutsCouple; 61 class G4MaterialCutsCouple; 63 62 64 class G4VAtomDeexcitation { 63 class G4VAtomDeexcitation { 65 public: 64 public: 66 65 67 explicit G4VAtomDeexcitation(const G4String& << 66 G4VAtomDeexcitation(const G4String& modname = "Deexcitation", >> 67 const G4String& pixename = ""); 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 // Activation of deexcitation per detector region 83 void SetDeexcitationActiveRegion(const G4Str 84 void SetDeexcitationActiveRegion(const G4String& rname, 84 G4bool valD << 85 G4bool valDeexcitation, 85 G4bool valA << 86 G4bool valAuger, 86 G4bool valP << 87 G4bool valPIXE); 87 88 88 // Activation of deexcitation 89 // Activation of deexcitation 89 inline void SetFluo(G4bool); 90 inline void SetFluo(G4bool); 90 inline G4bool IsFluoActive() const; 91 inline G4bool IsFluoActive() const; 91 92 92 // Activation of Auger electron production 93 // Activation of Auger electron production 93 inline void SetAuger(G4bool); 94 inline void SetAuger(G4bool); 94 inline G4bool IsAugerActive() const; 95 inline G4bool IsAugerActive() const; 95 96 96 // Activation of Auger cascade << 97 inline void SetAugerCascade(G4bool); << 98 inline G4bool IsAugerCascadeActive() const; << 99 << 100 // Activation of PIXE simulation 97 // Activation of PIXE simulation 101 inline void SetPIXE(G4bool); 98 inline void SetPIXE(G4bool); >> 99 // inline void SetPIXEActive(G4bool); 102 inline G4bool IsPIXEActive() const; 100 inline G4bool IsPIXEActive() const; 103 101 104 // Deexcitation model name 102 // Deexcitation model name 105 inline const G4String& GetName() const; 103 inline const G4String& GetName() const; 106 104 >> 105 // PIXE model name >> 106 inline void SetPIXECrossSectionModel(const G4String&); >> 107 inline const G4String& PIXECrossSectionModel() const; >> 108 >> 109 // PIXE model name for e+e- >> 110 inline void SetPIXEElectronCrossSectionModel(const G4String&); >> 111 inline const G4String& PIXEElectronCrossSectionModel() const; >> 112 107 // Access to the list of atoms active for de 113 // Access to the list of atoms active for deexcitation 108 inline const std::vector<G4bool>& GetListOfA 114 inline const std::vector<G4bool>& GetListOfActiveAtoms() const; 109 115 110 // Verbosity level 116 // Verbosity level 111 inline void SetVerboseLevel(G4int); 117 inline void SetVerboseLevel(G4int); 112 inline G4int GetVerboseLevel() const; 118 inline G4int GetVerboseLevel() const; 113 119 114 //========== Run time methods ========== 120 //========== Run time methods ========== 115 121 116 // Check if deexcitation is active for a giv 122 // Check if deexcitation is active for a given geometry volume 117 inline G4bool CheckDeexcitationActiveRegion( 123 inline G4bool CheckDeexcitationActiveRegion(G4int coupleIndex); 118 inline G4bool CheckAugerActiveRegion(G4int c 124 inline G4bool CheckAugerActiveRegion(G4int coupleIndex); 119 125 120 // Get atomic shell by shell index, used by 126 // Get atomic shell by shell index, used by discrete processes 121 // (for example, photoelectric), when shell 127 // (for example, photoelectric), when shell vacancy sampled by the model 122 virtual 128 virtual 123 const G4AtomicShell* GetAtomicShell(G4int Z, 129 const G4AtomicShell* GetAtomicShell(G4int Z, 124 G4Atomic << 130 G4AtomicShellEnumerator shell) = 0; 125 131 126 // generation of deexcitation for given atom 132 // generation of deexcitation for given atom and shell vacancy 127 // and material cut couple, which defines cu << 133 inline void GenerateParticles(std::vector<G4DynamicParticle*>* secVect, 128 void GenerateParticles(std::vector<G4Dynamic << 134 const G4AtomicShell*, 129 const G4AtomicShell*, << 135 G4int Z, 130 G4int Z, G4int couple << 136 G4int coupleIndex); 131 137 132 // generation of deexcitation for given atom 138 // generation of deexcitation for given atom and shell vacancy 133 virtual void GenerateParticles(std::vector<G 139 virtual void GenerateParticles(std::vector<G4DynamicParticle*>* secVect, 134 const G4Atomi << 140 const G4AtomicShell*, 135 G4int Z, G4do << 141 G4int Z, >> 142 G4double gammaCut, >> 143 G4double eCut) = 0; 136 144 137 // access or compute PIXE cross section 145 // access or compute PIXE cross section 138 virtual G4double 146 virtual G4double 139 GetShellIonisationCrossSectionPerAtom(const 147 GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition*, 140 G4int << 148 G4int Z, 141 G4Atom << 149 G4AtomicShellEnumerator shell, 142 G4doub << 150 G4double kinE, 143 const << 151 const G4Material* mat = 0) = 0; 144 152 145 // access or compute PIXE cross section 153 // access or compute PIXE cross section 146 virtual G4double 154 virtual G4double 147 ComputeShellIonisationCrossSectionPerAtom( << 155 ComputeShellIonisationCrossSectionPerAtom(const G4ParticleDefinition*, 148 const << 156 G4int Z, 149 G4int << 157 G4AtomicShellEnumerator shell, 150 G4Atom << 158 G4double kinE, 151 G4doub << 159 const G4Material* mat = 0) = 0; 152 const << 153 160 154 // Sampling of PIXE for ionisation processes 161 // Sampling of PIXE for ionisation processes 155 void AlongStepDeexcitation(std::vector<G4Tra 162 void AlongStepDeexcitation(std::vector<G4Track*>& tracks, 156 const G4Step& ste << 163 const G4Step& step, 157 G4double& eLoss, << 164 G4double& eLoss, 158 G4int coupleIndex 165 G4int coupleIndex); 159 166 160 // copy constructor and hide assignment oper << 161 G4VAtomDeexcitation(G4VAtomDeexcitation &) = << 162 G4VAtomDeexcitation & operator=(const G4VAto << 163 << 164 private: 167 private: 165 168 166 const G4ParticleDefinition* gamma; << 169 // copy constructor and hide assignment operator 167 const G4ProductionCutsTable* theCoupleTable << 170 G4VAtomDeexcitation(G4VAtomDeexcitation &); 168 << 171 G4VAtomDeexcitation & operator=(const G4VAtomDeexcitation &right); 169 G4int nCouples = 0; << 170 G4int verbose = 1; << 171 << 172 G4bool isActive = false; << 173 G4bool flagAuger = false; << 174 G4bool flagPIXE = false; << 175 G4bool ignoreCuts = false; << 176 << 177 G4bool isActiveLocked = false; << 178 G4bool isAugerLocked = false; << 179 G4bool isPIXELocked = false; << 180 172 >> 173 G4ProductionCutsTable* theCoupleTable; >> 174 G4double lowestKinEnergy; >> 175 G4int verbose; >> 176 G4String name; >> 177 G4String namePIXE; >> 178 G4String nameElectronPIXE; >> 179 G4bool isActive; >> 180 G4bool flagAuger; >> 181 G4bool flagPIXE; 181 std::vector<G4bool> activeZ; 182 std::vector<G4bool> activeZ; 182 std::vector<G4bool> activeDeexcitationMedi 183 std::vector<G4bool> activeDeexcitationMedia; 183 std::vector<G4bool> activeAugerMedia; 184 std::vector<G4bool> activeAugerMedia; 184 std::vector<G4bool> activePIXEMedia; 185 std::vector<G4bool> activePIXEMedia; >> 186 std::vector<G4String> activeRegions; 185 std::vector<G4bool> deRegions; 187 std::vector<G4bool> deRegions; 186 std::vector<G4bool> AugerRegions; 188 std::vector<G4bool> AugerRegions; 187 std::vector<G4bool> PIXERegions; 189 std::vector<G4bool> PIXERegions; 188 std::vector<G4DynamicParticle*> vdyn; 190 std::vector<G4DynamicParticle*> vdyn; 189 std::vector<G4String> activeRegions; << 190 << 191 G4String name; << 192 << 193 #ifdef G4MULTITHREADED << 194 static G4Mutex atomDeexcitationMutex; << 195 #endif << 196 }; 191 }; 197 192 198 inline void G4VAtomDeexcitation::SetFluo(G4boo 193 inline void G4VAtomDeexcitation::SetFluo(G4bool val) 199 { 194 { 200 if(!isActiveLocked) { isActive = val; isActi << 195 isActive = val; 201 } 196 } 202 197 203 inline G4bool G4VAtomDeexcitation::IsFluoActiv 198 inline G4bool G4VAtomDeexcitation::IsFluoActive() const 204 { 199 { 205 return isActive; 200 return isActive; 206 } 201 } 207 202 208 inline void G4VAtomDeexcitation::SetAuger(G4bo 203 inline void G4VAtomDeexcitation::SetAuger(G4bool val) 209 { 204 { 210 if(!isAugerLocked) { flagAuger = val; isAuge << 205 flagAuger = val; >> 206 if(val) { isActive = true; } 211 } 207 } 212 208 213 inline G4bool G4VAtomDeexcitation::IsAugerActi 209 inline G4bool G4VAtomDeexcitation::IsAugerActive() const 214 { 210 { 215 return flagAuger; 211 return flagAuger; 216 } 212 } 217 213 218 inline void G4VAtomDeexcitation::SetAugerCasca << 214 inline void G4VAtomDeexcitation::SetPIXE(G4bool val) 219 { 215 { 220 SetAuger(val); << 216 flagPIXE = val; >> 217 if(val) { isActive = true; } 221 } 218 } 222 219 223 inline G4bool G4VAtomDeexcitation::IsAugerCasc << 220 inline G4bool G4VAtomDeexcitation::IsPIXEActive() const 224 { 221 { 225 return flagAuger; << 222 return flagPIXE; 226 } 223 } 227 224 228 inline void G4VAtomDeexcitation::SetPIXE(G4boo << 225 inline const G4String& G4VAtomDeexcitation::GetName() const 229 { 226 { 230 if(!isPIXELocked) { flagPIXE = val; isPIXEL << 227 return name; 231 } 228 } 232 229 233 inline G4bool G4VAtomDeexcitation::IsPIXEActiv << 230 inline >> 231 void G4VAtomDeexcitation::SetPIXECrossSectionModel(const G4String& n) 234 { 232 { 235 return flagPIXE; << 233 namePIXE = n; 236 } 234 } 237 235 238 inline const G4String& G4VAtomDeexcitation::Ge << 236 inline void >> 237 G4VAtomDeexcitation::SetPIXEElectronCrossSectionModel(const G4String& n) 239 { 238 { 240 return name; << 239 nameElectronPIXE = n; >> 240 } >> 241 >> 242 inline >> 243 const G4String& G4VAtomDeexcitation::PIXECrossSectionModel() const >> 244 { >> 245 return namePIXE; >> 246 } >> 247 >> 248 inline >> 249 const G4String& G4VAtomDeexcitation::PIXEElectronCrossSectionModel() const >> 250 { >> 251 return nameElectronPIXE; 241 } 252 } 242 253 243 inline const std::vector<G4bool>& 254 inline const std::vector<G4bool>& 244 G4VAtomDeexcitation::GetListOfActiveAtoms() co 255 G4VAtomDeexcitation::GetListOfActiveAtoms() const 245 { 256 { 246 return activeZ; 257 return activeZ; 247 } 258 } 248 259 249 inline void G4VAtomDeexcitation::SetVerboseLev 260 inline void G4VAtomDeexcitation::SetVerboseLevel(G4int val) 250 { 261 { 251 verbose = val; 262 verbose = val; 252 } 263 } 253 264 254 inline G4int G4VAtomDeexcitation::GetVerboseLe 265 inline G4int G4VAtomDeexcitation::GetVerboseLevel() const 255 { 266 { 256 return verbose; 267 return verbose; 257 } 268 } 258 269 259 inline G4bool 270 inline G4bool 260 G4VAtomDeexcitation::CheckDeexcitationActiveRe << 271 G4VAtomDeexcitation::CheckDeexcitationActiveRegion(G4int coupleIndex) 261 { 272 { 262 return (idx < nCouples) ? activeDeexcitation << 273 return (isActive || activeDeexcitationMedia[coupleIndex]); 263 } 274 } 264 275 265 inline G4bool 276 inline G4bool 266 G4VAtomDeexcitation::CheckAugerActiveRegion(G4 << 277 G4VAtomDeexcitation::CheckAugerActiveRegion(G4int coupleIndex) 267 { 278 { 268 return (idx < nCouples) ? activeAugerMedia[i << 279 >> 280 return (flagAuger || activeAugerMedia[coupleIndex]); >> 281 } >> 282 >> 283 inline void >> 284 G4VAtomDeexcitation::GenerateParticles(std::vector<G4DynamicParticle*>* v, >> 285 const G4AtomicShell* as, >> 286 G4int Z, >> 287 G4int idx) >> 288 { >> 289 G4double gCut = DBL_MAX; >> 290 if (theCoupleTable) { >> 291 gCut = (*(theCoupleTable->GetEnergyCutsVector(0)))[idx]; >> 292 } >> 293 if(gCut < as->BindingEnergy()) { >> 294 G4double eCut = DBL_MAX; >> 295 if(CheckAugerActiveRegion(idx)) { >> 296 if (theCoupleTable) { >> 297 eCut = (*(theCoupleTable->GetEnergyCutsVector(1)))[idx]; >> 298 } >> 299 } >> 300 GenerateParticles(v, as, Z, gCut, eCut); >> 301 } 269 } 302 } 270 303 271 #endif 304 #endif 272 305 273 306