Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:19

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:     G4VAtomDeexcitation
0033 //
0034 // Author:        Alfonso Mantero & Vladimir Ivanchenko
0035 //
0036 // Creation date: 30.06.2009
0037 //
0038 // Modifications:
0039 // 15 Mar 2011  ALF   stripped G4AtomicShellEnumerator to its own file
0040 //
0041 // Class Description:
0042 //
0043 // Abstract interface to energy loss models
0044 
0045 // -------------------------------------------------------------------
0046 //
0047 
0048 #ifndef G4VAtomDeexcitation_h
0049 #define G4VAtomDeexcitation_h 1
0050 
0051 #include "globals.hh"
0052 #include "G4EmParameters.hh"
0053 #include "G4AtomicShell.hh"
0054 #include "G4AtomicShellEnumerator.hh"
0055 #include "G4ProductionCutsTable.hh"
0056 #include "G4Track.hh"
0057 #include "G4Threading.hh"
0058 #include <vector>
0059 
0060 class G4ParticleDefinition;
0061 class G4DynamicParticle;
0062 class G4MaterialCutsCouple;
0063 
0064 class G4VAtomDeexcitation {
0065 public:
0066 
0067   explicit G4VAtomDeexcitation(const G4String& modname = "Deexcitation");
0068 
0069   virtual ~G4VAtomDeexcitation();
0070 
0071   //========== initialization ==========
0072 
0073   // Overall initialisation before new run
0074   void InitialiseAtomicDeexcitation();
0075 
0076   // Initialisation of deexcitation at the beginning of run 
0077   virtual void InitialiseForNewRun() = 0;
0078 
0079   // Initialisation for a concrete atom 
0080   // May be called at run time 
0081   virtual void InitialiseForExtraAtom(G4int Z) = 0;
0082 
0083   void SetDeexcitationActiveRegion(const G4String& rname, 
0084                                    G4bool valDeexcitation,
0085                                    G4bool valAuger,
0086                                    G4bool valPIXE);
0087 
0088   // Activation of deexcitation
0089   inline void SetFluo(G4bool);
0090   inline G4bool IsFluoActive() const;
0091 
0092   // Activation of Auger electron production
0093   inline void SetAuger(G4bool);
0094   inline G4bool IsAugerActive() const;
0095 
0096   // Activation of Auger cascade
0097   inline void SetAugerCascade(G4bool);
0098   inline G4bool IsAugerCascadeActive() const;
0099 
0100   // Activation of PIXE simulation
0101   inline void SetPIXE(G4bool);
0102   inline G4bool IsPIXEActive() const;
0103 
0104   // Deexcitation model name
0105   inline const G4String& GetName() const;
0106 
0107   // Access to the list of atoms active for deexcitation
0108   inline const std::vector<G4bool>& GetListOfActiveAtoms() const;
0109 
0110   // Verbosity level
0111   inline void SetVerboseLevel(G4int);
0112   inline G4int GetVerboseLevel() const;
0113 
0114   //========== Run time methods ==========
0115 
0116   // Check if deexcitation is active for a given geometry volume
0117   inline G4bool CheckDeexcitationActiveRegion(G4int coupleIndex);
0118   inline G4bool CheckAugerActiveRegion(G4int coupleIndex);
0119 
0120   // Get atomic shell by shell index, used by discrete processes 
0121   // (for example, photoelectric), when shell vacancy sampled by the model
0122   virtual 
0123   const G4AtomicShell* GetAtomicShell(G4int Z, 
0124                                       G4AtomicShellEnumerator shell) = 0;
0125 
0126   // generation of deexcitation for given atom and shell vacancy
0127   // and material cut couple, which defines cut values 
0128   void GenerateParticles(std::vector<G4DynamicParticle*>* secVect,  
0129                          const G4AtomicShell*, 
0130                          G4int Z, G4int coupleIndex);
0131 
0132   // generation of deexcitation for given atom and shell vacancy
0133   virtual void GenerateParticles(std::vector<G4DynamicParticle*>* secVect,  
0134                                  const G4AtomicShell*, 
0135                                  G4int Z, G4double gammaCut, G4double eCut) = 0;
0136 
0137   // access or compute PIXE cross section 
0138   virtual G4double 
0139   GetShellIonisationCrossSectionPerAtom(const G4ParticleDefinition*, 
0140                                         G4int Z, 
0141                                         G4AtomicShellEnumerator shell,
0142                                         G4double kinE,
0143                                         const G4Material* mat = nullptr) = 0;
0144 
0145   // access or compute PIXE cross section 
0146   virtual G4double 
0147   ComputeShellIonisationCrossSectionPerAtom(
0148                                         const G4ParticleDefinition*, 
0149                                         G4int Z, 
0150                                         G4AtomicShellEnumerator shell,
0151                                         G4double kinE,
0152                                         const G4Material* mat = nullptr) = 0;
0153 
0154   // Sampling of PIXE for ionisation processes
0155   void AlongStepDeexcitation(std::vector<G4Track*>& tracks,  
0156                              const G4Step& step, 
0157                              G4double& eLoss,
0158                              G4int coupleIndex);
0159 
0160   // copy constructor and hide assignment operator
0161   G4VAtomDeexcitation(G4VAtomDeexcitation &) = delete;
0162   G4VAtomDeexcitation & operator=(const G4VAtomDeexcitation &right) = delete;
0163 
0164 private:
0165 
0166   const G4ParticleDefinition* gamma;
0167   const G4ProductionCutsTable* theCoupleTable = nullptr;
0168 
0169   G4int    nCouples = 0;
0170   G4int    verbose = 1;
0171 
0172   G4bool   isActive = false;
0173   G4bool   flagAuger = false;
0174   G4bool   flagPIXE = false;
0175   G4bool   ignoreCuts = false;
0176 
0177   G4bool   isActiveLocked = false;
0178   G4bool   isAugerLocked = false;
0179   G4bool   isPIXELocked = false;
0180 
0181   std::vector<G4bool>   activeZ;
0182   std::vector<G4bool>   activeDeexcitationMedia;
0183   std::vector<G4bool>   activeAugerMedia;
0184   std::vector<G4bool>   activePIXEMedia;
0185   std::vector<G4bool>   deRegions;
0186   std::vector<G4bool>   AugerRegions;
0187   std::vector<G4bool>   PIXERegions;
0188   std::vector<G4DynamicParticle*> vdyn;
0189   std::vector<G4String> activeRegions;
0190 
0191   G4String name;
0192 
0193 #ifdef G4MULTITHREADED
0194   static G4Mutex atomDeexcitationMutex;
0195 #endif
0196 };
0197 
0198 inline void G4VAtomDeexcitation::SetFluo(G4bool val)
0199 {
0200   if(!isActiveLocked) { isActive = val; isActiveLocked = true; }
0201 }
0202 
0203 inline G4bool G4VAtomDeexcitation::IsFluoActive() const
0204 {
0205   return isActive;
0206 }
0207 
0208 inline void G4VAtomDeexcitation::SetAuger(G4bool val)
0209 {
0210   if(!isAugerLocked) { flagAuger = val; isAugerLocked = true; }
0211 }
0212 
0213 inline G4bool G4VAtomDeexcitation::IsAugerActive() const
0214 {
0215   return flagAuger;
0216 }
0217 
0218 inline void G4VAtomDeexcitation::SetAugerCascade(G4bool val)
0219 {
0220   SetAuger(val);
0221 }
0222 
0223 inline G4bool G4VAtomDeexcitation::IsAugerCascadeActive() const
0224 {
0225   return flagAuger;
0226 }
0227 
0228 inline void G4VAtomDeexcitation::SetPIXE(G4bool val)
0229 {
0230   if(!isPIXELocked) { flagPIXE = val;  isPIXELocked = true; }
0231 }
0232 
0233 inline G4bool G4VAtomDeexcitation::IsPIXEActive() const
0234 {
0235   return flagPIXE;
0236 }
0237 
0238 inline const G4String& G4VAtomDeexcitation::GetName() const
0239 {
0240   return name;
0241 }
0242 
0243 inline const std::vector<G4bool>& 
0244 G4VAtomDeexcitation::GetListOfActiveAtoms() const
0245 {
0246   return activeZ;
0247 }
0248 
0249 inline void G4VAtomDeexcitation::SetVerboseLevel(G4int val)
0250 {
0251   verbose = val;
0252 }
0253 
0254 inline G4int G4VAtomDeexcitation::GetVerboseLevel() const
0255 {
0256   return verbose;
0257 }
0258 
0259 inline G4bool 
0260 G4VAtomDeexcitation::CheckDeexcitationActiveRegion(G4int idx)
0261 {
0262   return (idx < nCouples) ? activeDeexcitationMedia[idx] : false;
0263 }
0264 
0265 inline G4bool 
0266 G4VAtomDeexcitation::CheckAugerActiveRegion(G4int idx)
0267 {
0268   return (idx < nCouples) ? activeAugerMedia[idx] : false;
0269 }
0270 
0271 #endif
0272