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 | // $Id: G4Decay.hh,v 1.20 2008/09/19 03:19:53 kurasige Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
29 | // |
---|
30 | // |
---|
31 | // ------------------------------------------------------------ |
---|
32 | // GEANT 4 class header file |
---|
33 | // |
---|
34 | // History: first implementation, based on object model of |
---|
35 | // 7 July 1996 H.Kurashige |
---|
36 | // ------------------------------------------------------------ |
---|
37 | // New Physics scheme 18 Jan. 1997 H.Kurahige |
---|
38 | // ------------------------------------------------------------ |
---|
39 | // modified 4 Feb. 1997 H.Kurahige |
---|
40 | // modified 8 Sep. 1997 H.Kurahige |
---|
41 | // remove BuildPhysicsTable() 27 Nov. 1997 H.Kurashige |
---|
42 | // modified for new ParticleChange 12 Mar. 1998 H.Kurashige |
---|
43 | // added aPhysicsTable 2 Aug. 1998 H.Kurashige |
---|
44 | // PreAssignedDecayTime 18 Jan. 2001 H.Kurashige |
---|
45 | // Add External Decayer 23 Feb. 2001 H.Kurashige |
---|
46 | // Remove PhysicsTable 12 Feb. 2002 H.Kurashige |
---|
47 | // Fixed bug in PostStepGPIL |
---|
48 | // in case of stopping during AlongStepDoIt 12 Mar. 2004 H.Kurashige |
---|
49 | // Add GetRemainderLifeTime 10 Aug/2004 H.Kurashige |
---|
50 | // Add DaughterPolarization 23 July 2008 H.Kurashige |
---|
51 | |
---|
52 | |
---|
53 | #ifndef G4Decay_h |
---|
54 | #define G4Decay_h 1 |
---|
55 | |
---|
56 | #include "G4ios.hh" |
---|
57 | #include "globals.hh" |
---|
58 | #include "G4VRestDiscreteProcess.hh" |
---|
59 | #include "G4ParticleChangeForDecay.hh" |
---|
60 | #include "G4DecayProcessType.hh" |
---|
61 | |
---|
62 | class G4VExtDecayer; |
---|
63 | |
---|
64 | class G4Decay : public G4VRestDiscreteProcess |
---|
65 | { |
---|
66 | // Class Description |
---|
67 | // This class is a decay process |
---|
68 | |
---|
69 | public: |
---|
70 | // Constructors |
---|
71 | G4Decay(const G4String& processName ="Decay"); |
---|
72 | |
---|
73 | // Destructor |
---|
74 | virtual ~G4Decay(); |
---|
75 | |
---|
76 | private: |
---|
77 | // copy constructor |
---|
78 | G4Decay(const G4Decay &right); |
---|
79 | |
---|
80 | // Assignment Operation (generated) |
---|
81 | G4Decay & operator=(const G4Decay &right); |
---|
82 | |
---|
83 | public: //With Description |
---|
84 | // G4Decay Process has both |
---|
85 | // PostStepDoIt (for decay in flight) |
---|
86 | // and |
---|
87 | // AtRestDoIt (for decay at rest) |
---|
88 | |
---|
89 | virtual G4VParticleChange *PostStepDoIt( |
---|
90 | const G4Track& aTrack, |
---|
91 | const G4Step& aStep |
---|
92 | ); |
---|
93 | |
---|
94 | virtual G4VParticleChange* AtRestDoIt( |
---|
95 | const G4Track& aTrack, |
---|
96 | const G4Step& aStep |
---|
97 | ); |
---|
98 | |
---|
99 | virtual void BuildPhysicsTable(const G4ParticleDefinition&); |
---|
100 | // In G4Decay, thePhysicsTable stores values of |
---|
101 | // beta * std::sqrt( 1 - beta*beta) |
---|
102 | // as a function of normalized kinetic enregy (=Ekin/mass), |
---|
103 | // becasuse this table is universal for all particle types, |
---|
104 | |
---|
105 | |
---|
106 | virtual G4bool IsApplicable(const G4ParticleDefinition&); |
---|
107 | // returns "true" if the decay process can be applied to |
---|
108 | // the particle type. |
---|
109 | |
---|
110 | protected: // With Description |
---|
111 | virtual G4VParticleChange* DecayIt( |
---|
112 | const G4Track& aTrack, |
---|
113 | const G4Step& aStep |
---|
114 | ); |
---|
115 | // The DecayIt() method returns by pointer a particle-change object, |
---|
116 | // which has information of daughter particles. |
---|
117 | |
---|
118 | // Set daughter polarization |
---|
119 | // NO OPERATION in the base class of G4Decay |
---|
120 | virtual void DaughterPolarization(const G4Track& aTrack, |
---|
121 | G4DecayProducts* products); |
---|
122 | |
---|
123 | public: |
---|
124 | virtual G4double AtRestGetPhysicalInteractionLength( |
---|
125 | const G4Track& track, |
---|
126 | G4ForceCondition* condition |
---|
127 | ); |
---|
128 | |
---|
129 | virtual G4double PostStepGetPhysicalInteractionLength( |
---|
130 | const G4Track& track, |
---|
131 | G4double previousStepSize, |
---|
132 | G4ForceCondition* condition |
---|
133 | ); |
---|
134 | |
---|
135 | protected: // With Description |
---|
136 | // GetMeanFreePath returns ctau*beta*gamma for decay in flight |
---|
137 | // GetMeanLifeTime returns ctau for decay at rest |
---|
138 | virtual G4double GetMeanFreePath(const G4Track& aTrack, |
---|
139 | G4double previousStepSize, |
---|
140 | G4ForceCondition* condition |
---|
141 | ); |
---|
142 | |
---|
143 | virtual G4double GetMeanLifeTime(const G4Track& aTrack, |
---|
144 | G4ForceCondition* condition |
---|
145 | ); |
---|
146 | |
---|
147 | public: //With Description |
---|
148 | virtual void StartTracking(G4Track*); |
---|
149 | virtual void EndTracking(); |
---|
150 | // inform Start/End of tracking for each track to the physics process |
---|
151 | |
---|
152 | public: //With Description |
---|
153 | void SetExtDecayer(G4VExtDecayer*); |
---|
154 | const G4VExtDecayer* GetExtDecayer() const; |
---|
155 | // Set/Get External Decayer |
---|
156 | |
---|
157 | G4double GetRemainderLifeTime() const; |
---|
158 | //Get Remainder of life time at rest decay |
---|
159 | |
---|
160 | public: |
---|
161 | void SetVerboseLevel(G4int value); |
---|
162 | G4int GetVerboseLevel() const; |
---|
163 | |
---|
164 | protected: |
---|
165 | G4int verboseLevel; |
---|
166 | // controle flag for output message |
---|
167 | // 0: Silent |
---|
168 | // 1: Warning message |
---|
169 | // 2: More |
---|
170 | |
---|
171 | protected: |
---|
172 | // HighestValue. |
---|
173 | const G4double HighestValue; |
---|
174 | |
---|
175 | // Remainder of life time at rest |
---|
176 | G4double fRemainderLifeTime; |
---|
177 | |
---|
178 | // ParticleChange for decay process |
---|
179 | G4ParticleChangeForDecay fParticleChangeForDecay; |
---|
180 | |
---|
181 | // External Decayer |
---|
182 | G4VExtDecayer* pExtDecayer; |
---|
183 | }; |
---|
184 | |
---|
185 | inline |
---|
186 | void G4Decay::SetVerboseLevel(G4int value){ verboseLevel = value; } |
---|
187 | |
---|
188 | inline |
---|
189 | G4int G4Decay::GetVerboseLevel() const { return verboseLevel; } |
---|
190 | |
---|
191 | inline |
---|
192 | G4VParticleChange* G4Decay::AtRestDoIt( |
---|
193 | const G4Track& aTrack, |
---|
194 | const G4Step& aStep |
---|
195 | ) |
---|
196 | { |
---|
197 | return DecayIt(aTrack, aStep); |
---|
198 | } |
---|
199 | |
---|
200 | inline |
---|
201 | G4VParticleChange* G4Decay::PostStepDoIt( |
---|
202 | const G4Track& aTrack, |
---|
203 | const G4Step& aStep |
---|
204 | ) |
---|
205 | { |
---|
206 | return DecayIt(aTrack, aStep); |
---|
207 | } |
---|
208 | |
---|
209 | inline |
---|
210 | const G4VExtDecayer* G4Decay::GetExtDecayer() const |
---|
211 | { |
---|
212 | return pExtDecayer; |
---|
213 | } |
---|
214 | |
---|
215 | inline |
---|
216 | G4double G4Decay::GetRemainderLifeTime() const |
---|
217 | { |
---|
218 | return fRemainderLifeTime; |
---|
219 | } |
---|
220 | |
---|
221 | #endif |
---|
222 | |
---|
223 | |
---|
224 | |
---|
225 | |
---|
226 | |
---|
227 | |
---|
228 | |
---|
229 | |
---|
230 | |
---|
231 | |
---|