Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RadioactiveDecayBase.hh
Go to the documentation of this file.
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//
26////////////////////////////////////////////////////////////////////////////////
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// //
37////////////////////////////////////////////////////////////////////////////////
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
57class G4Fragment;
60
61typedef 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
112 void AddUserDecayDataFile(G4int Z, G4int A,G4String filename);
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
116 inline void SetVerboseLevel(G4int value) {verboseLevel = value;}
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
129 inline G4NucleusLimits GetNucleusLimits() const {return theNucleusLimits;}
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) {
140 forceDecayHalfAngle = std::min(std::max(0.*CLHEP::deg,halfAngle),180.*CLHEP::deg);
141 }
142
143 inline G4double GetDecayHalfAngle() const {return forceDecayHalfAngle;}
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
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
197 G4RadioactiveDecayBase& operator=(const G4RadioactiveDecayBase &right);
198
199 G4NucleusLimits theNucleusLimits;
200
201 G4bool isInitialised;
202
203 G4bool applyICM;
204 G4bool applyARM;
205
206 // Parameters for pre-collimated (biased) decay products
207 G4ThreeVector forceDecayDirection;
208 G4double forceDecayHalfAngle;
209 static const G4ThreeVector origin; // (0,0,0) for convenience
210
211 // Radioactive decay database directory path
212 G4String dirPath;
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
218 G4RadioactiveDecayMode theRadDecayMode;
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
227 G4double fRemainderLifeTime;
228 G4int verboseLevel;
229
230
231 // inline implementations
232 inline
233 G4double AtRestGetPhysicalInteractionLength(const G4Track& track,
235 {
236 fRemainderLifeTime =
238 return fRemainderLifeTime;
239 }
240
241 inline
242 G4VParticleChange* AtRestDoIt(const G4Track& theTrack,
243 const G4Step& theStep)
244 {return DecayIt(theTrack, theStep);}
245
246 inline
247 G4VParticleChange* PostStepDoIt(const G4Track& theTrack,
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
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
std::map< G4String, G4DecayTable * > DecayTableMap
G4RadioactiveDecayMode
std::mutex G4Mutex
Definition: G4Threading.hh:81
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Hep3Vector unit() const
void CollimateDecay(G4DecayProducts *products)
void AddUserDecayDataFile(G4int Z, G4int A, G4String filename)
std::vector< G4String > ValidVolumes
void SetNucleusLimits(G4NucleusLimits theNucleusLimits1)
G4bool IsApplicable(const G4ParticleDefinition &)
void DeselectAVolume(const G4String aVolume)
G4double GetMeanLifeTime(const G4Track &theTrack, G4ForceCondition *condition)
G4DecayTable * LoadDecayTable(const G4ParticleDefinition &theParentNucleus)
void SelectAVolume(const G4String aVolume)
void DecayAnalog(const G4Track &theTrack)
G4double GetMeanFreePath(const G4Track &theTrack, G4double previousStepSize, G4ForceCondition *condition)
static const G4double levelTolerance
G4VParticleChange * DecayIt(const G4Track &theTrack, const G4Step &theStep)
G4ThreeVector ChooseCollimationDirection() const
void SetDecayHalfAngle(G4double halfAngle=0.*CLHEP::deg)
void CollimateDecayProduct(G4DynamicParticle *product)
G4DecayProducts * DoDecay(const G4ParticleDefinition &theParticleDef)
G4DecayTable * GetDecayTable(const G4ParticleDefinition *)
virtual void ProcessDescription(std::ostream &outFile) const
void SetDecayCollimation(const G4ThreeVector &theDir, G4double halfAngle=0.*CLHEP::deg)
void SetDecayDirection(const G4ThreeVector &theDir)
G4ParticleChangeForRadDecay fParticleChangeForRadDecay
void BuildPhysicsTable(const G4ParticleDefinition &)
G4PhotonEvaporation * photonEvaporation
G4NucleusLimits GetNucleusLimits() const
G4RadioactiveDecayBaseMessenger * theRadioactiveDecayBaseMessenger
const G4ThreeVector & GetDecayDirection() const
Definition: G4Step.hh:62
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)