ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RadioactiveDecayBase.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4RadioactiveDecayBase.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
27 // //
28 // File: G4RadioactiveDecayBase.hh //
29 // Author: D.H. Wright (SLAC) //
30 // Date: 9 August 2017 //
31 // Description: version the G4RadioactiveDecay process by F. Lei and //
32 // P.R. Truscott with biasing and activation calculations //
33 // removed to a derived class. It performs alpha, beta, //
34 // electron capture and isomeric transition decays of //
35 // radioactive nuclei. //
36 // //
38 
39 #ifndef G4RadioactiveDecayBase_h
40 #define G4RadioactiveDecayBase_h 1
41 
42 
43 #include <vector>
44 #include <map>
46 
47 #include "G4ios.hh"
48 #include "globals.hh"
51 
52 #include "G4NucleusLimits.hh"
53 #include "G4ThreeVector.hh"
54 #include "G4Threading.hh"
56 
57 class G4Fragment;
60 
61 typedef std::map<G4String, G4DecayTable*> DecayTableMap;
62 
63 
65 {
66  // class description
67 
68  // Implementation of the radioactive decay process which simulates the
69  // decays of radioactive nuclei. These nuclei are submitted to RDM as
70  // G4Ions. The required half-lives and decay schemes are retrieved from
71  // the Radioactivity database which was derived from ENSDF.
72  // All decay products are submitted back to the particle tracking process
73  // through the G4ParticleChangeForRadDecay object.
74  // class description - end
75 
76  public: // with description
77 
78  G4RadioactiveDecayBase(const G4String& processName="RadioactiveDecayBase");
80 
81  virtual void ProcessDescription(std::ostream& outFile) const;
82 
84  // Return true if the specified isotope is
85  // 1) defined as "nucleus" and
86  // 2) it is within theNucleusLimit
87 
88  // Return decay table if it exists, if not, load it from file
90 
91  // Select a logical volume in which RDM applies
92  void SelectAVolume(const G4String aVolume);
93 
94  // Remove a logical volume from the RDM applied list
95  void DeselectAVolume(const G4String aVolume);
96 
97  // Select all logical volumes for the application of RDM
98  void SelectAllVolumes();
99 
100  // Remove all logical volumes from RDM applications
101  void DeselectAllVolumes();
102 
103  // Enable/disable ICM
104  void SetICM(G4bool icm) {applyICM = icm;}
105 
106  // Enable/disable ARM
107  void SetARM(G4bool arm) {applyARM = arm;}
108 
109  G4DecayTable* LoadDecayTable(const G4ParticleDefinition& theParentNucleus);
110  // Load the decay data of isotope theParentNucleus
111 
113  // Allow the user to replace the radio-active decay data provided in Geant4
114  // by its own data file for a given isotope
115 
117  // Sets the VerboseLevel which controls duggering display
118 
119  inline G4int GetVerboseLevel() const {return verboseLevel;}
120  // Returns the VerboseLevel which controls level of debugging output
121 
122  inline void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
123  {theNucleusLimits = theNucleusLimits1 ;}
124  // Sets theNucleusLimits which specifies the range of isotopes
125  // the G4RadioactiveDecay applies.
126 
127  // Returns theNucleusLimits which specifies the range of isotopes used
128  // by G4RadioactiveDecay
130 
131  inline void SetDecayDirection(const G4ThreeVector& theDir) {
132  forceDecayDirection = theDir.unit();
133  }
134 
135  inline const G4ThreeVector& GetDecayDirection() const {
136  return forceDecayDirection;
137  }
138 
139  inline void SetDecayHalfAngle(G4double halfAngle=0.*CLHEP::deg) {
141  }
142 
144 
145  // Force direction (random within half-angle) for "visible" daughters
146  // (applies to electrons, positrons, gammas, neutrons, protons or alphas)
147  inline void SetDecayCollimation(const G4ThreeVector& theDir,
148  G4double halfAngle = 0.*CLHEP::deg) {
149  SetDecayDirection(theDir);
150  SetDecayHalfAngle(halfAngle);
151  }
152 
154 
155  G4VParticleChange* DecayIt(const G4Track& theTrack,
156  const G4Step& theStep);
157 
158  protected:
159 
160  void DecayAnalog(const G4Track& theTrack);
161 
162  G4DecayProducts* DoDecay(const G4ParticleDefinition& theParticleDef);
163 
164  // Apply directional bias for "visible" daughters (e+-, gamma, n, p, alpha)
165  void CollimateDecay(G4DecayProducts* products);
168 
169  G4double GetMeanFreePath(const G4Track& theTrack, G4double previousStepSize,
171 
172  G4double GetMeanLifeTime(const G4Track& theTrack,
174 
175  // ParticleChange for decay process
177 
180 
181  std::vector<G4String> ValidVolumes;
183 
184  static const G4double levelTolerance;
185 
186  // Library of decay tables
188 #ifdef G4MULTITHREADED
189  static DecayTableMap* master_dkmap;
190 #endif
191 
192  private:
193 
194  void StreamInfo(std::ostream& os, const G4String& endline);
195 
198 
200 
202 
205 
206  // Parameters for pre-collimated (biased) decay products
209  static const G4ThreeVector origin; // (0,0,0) for convenience
210 
211  // Radioactive decay database directory path
213 
214  //User define radioactive decay data files replacing some files in the G4RADECAY database
215  std::map<G4int, G4String> theUserRadioactiveDataFiles;
216 
217  //The last RadDecayMode
219 
220 // // Library of decay tables
221 // DecayTableMap* dkmap;
222 // #ifdef G4MULTITHREADED
223 // static DecayTableMap* master_dkmap;
224 // #endif
225 
226  // Remainder of life time at rest
229 
230 
231  // inline implementations
232  inline
235  {
238  return fRemainderLifeTime;
239  }
240 
241  inline
243  const G4Step& theStep)
244  {return DecayIt(theTrack, theStep);}
245 
246  inline
248  const G4Step& theStep)
249  {return DecayIt(theTrack, theStep);}
250 
251 #ifdef G4MULTITHREADED
252  public:
253  static G4Mutex radioactiveDecayMutex;
254  protected:
255  G4int& NumberOfInstances();
256 #endif
257 };
258 
259 #endif
260