OMSim
Geant4 for IceCube optical module studies
Loading...
Searching...
No Matches
OMSimG4RadioactiveDecay.hh
Go to the documentation of this file.
1
7#pragma once
8
10
11#include <vector>
12#include <map>
13#include <CLHEP/Units/SystemOfUnits.h>
14
15#include "G4ios.hh"
16#include "globals.hh"
17#include "G4VRestDiscreteProcess.hh"
18#include "OMSimG4ParticleChangeForRadDecay.hh"
19
20#include "G4NucleusLimits.hh"
21#include "G4RadioactiveDecayRatesToDaughter.hh"
22#include "G4RadioactiveDecayChainsFromParent.hh"
23#include "G4RadioactivityTable.hh"
24#include "G4ThreeVector.hh"
25#include "G4Threading.hh"
26
27class G4Fragment;
28class G4RadioactivationMessenger;
29
30typedef std::vector<G4RadioactiveDecayChainsFromParent> G4RadioactiveDecayParentChainTable;
31typedef std::vector<G4RadioactiveDecayRatesToDaughter> G4RadioactiveDecayRates;
32typedef std::map<G4String, G4DecayTable*> DecayTableMap;
33
35{
36 public: // with description
37
38 G4RadioactiveDecay(const G4String& processName="RadioactiveDecay",
39 const G4double timeThresholdForRadioactiveDecays=-1.0);
40 ~G4RadioactiveDecay() override;
41
42 G4VParticleChange* DecayIt(const G4Track& theTrack,
43 const G4Step& theStep) override;
44
45 void ProcessDescription(std::ostream& outFile) const override;
46
47 // Set the decay biasing scheme using the data in "filename"
48 void SetDecayBias(const G4String& filename);
49
50 // Set the half-life threshold for isomer production
51 void SetHLThreshold(G4double hl) {halflifethreshold = hl;}
52
53 void SetSourceTimeProfile(const G4String& filename);
54 // Set source exposure function using histograms in "filename"
55
56 G4bool IsRateTableReady(const G4ParticleDefinition &);
57 // Returns true if the coefficient and decay time table for all the
58 // descendants of the specified isotope are ready.
59 // used in VR decay mode only
60
61 void CalculateChainsFromParent(const G4ParticleDefinition&);
62 // Calculates the coefficient and decay time table for all the descendents
63 // of the specified isotope. Adds the calculated table to the private data
64 // member "theParentChainTable".
65 // used in VR decay mode only
66
67 void GetChainsFromParent(const G4ParticleDefinition&);
68 // Used to retrieve the coefficient and decay time table for all the
69 // descendants of the specified isotope from "theParentChainTable"
70 // and place it in "chainsFromParent".
71 // used in VR decay mode only
72
73 void SetDecayRate(G4int,G4int,G4double, G4int, std::vector<G4double>&,
74 std::vector<G4double>&);
75 // Sets "theDecayRate" with data supplied in the arguements.
76 // used in VR decay mode only
77
78 std::vector<G4RadioactivityTable*>& GetTheRadioactivityTables()
79 {return theRadioactivityTables;}
80 // Return vector of G4Radioactivity map - should be used in VR mode only
81
82
83 // Controls whether G4RadioactiveDecay runs in analogue mode or
84 // variance reduction mode. SetBRBias, SetSplitNuclei and
85 // SetSourceTimeProfile all turn off analogue mode and use VR mode
86 inline void SetAnalogueMonteCarlo (G4bool r) {
87 AnalogueMC = r;
88 }
89
90 // Returns true if the simulation is an analogue Monte Carlo, and false if
91 // any of the biassing schemes have been selected.
92 inline G4bool IsAnalogueMonteCarlo () {return AnalogueMC;}
93
94 // Sets whether branching ration bias scheme applies.
95 inline void SetBRBias(G4bool r) {
96 BRBias = r;
97 AnalogueMC = false;
98 }
99
100 // Sets the number of times a nucleus will decay when biased
101 inline void SetSplitNuclei(G4int r) {
102 NSplit = r;
103 AnalogueMC = false;
104 }
105
106 // Returns the nuclear splitting number
107 inline G4int GetSplitNuclei () {return NSplit;}
108
109 G4RadioactiveDecay(const G4RadioactiveDecay& right) = delete;
110 G4RadioactiveDecay& operator=(const G4RadioactiveDecay& right) = delete;
111
112 protected:
113
114 G4double ConvolveSourceTimeProfile(const G4double, const G4double);
115 G4double GetDecayTime();
116 G4int GetDecayTimeBin(const G4double aDecayTime);
117
118 G4double GetMeanLifeTime(const G4Track& theTrack,
119 G4ForceCondition* condition) override;
120
121 //Add gamma,Xray,conversion,and auger electrons for bias mode
122 void AddDeexcitationSpectrumForBiasMode(G4ParticleDefinition* apartDef,
123 G4double weight,
124 G4double currenTime,
125 std::vector<double>& weights_v,
126 std::vector<double>& times_v,
127 std::vector<G4DynamicParticle*>& secondaries_v);
128
129 private:
130
131 G4RadioactivationMessenger* theRadioactivationMessenger;
132 G4bool AnalogueMC;
133 G4bool BRBias;
134 G4int NSplit;
135
136 G4double halflifethreshold;
137
138 G4int NSourceBin;
139 G4double SBin[100];
140 G4double SProfile[100];
141 G4int NDecayBin;
142 G4double DBin[100];
143 G4double DProfile[100];
144
145 G4RadioactiveDecayRatesToDaughter ratesToDaughter;
146 G4RadioactiveDecayRates theDecayRateVector;
147 G4RadioactiveDecayChainsFromParent chainsFromParent;
148 G4RadioactiveDecayParentChainTable theParentChainTable;
149
150 // for the radioactivity tables
151 std::vector<G4RadioactivityTable*> theRadioactivityTables;
152 G4int decayWindows[100];
153};
Modified version of the original Geant4 RadioactiveDecay class to define custom decay time.
Definition OMSimG4RadioactiveDecay.hh:35
Definition OMSimG4VRadioactiveDecay.hh:35