Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Scintillation.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// Scintillation Light Class Definition
28////////////////////////////////////////////////////////////////////////
29//
30// File: G4Scintillation.hh
31// Description: Discrete Process - Generation of Scintillation Photons
32// Version: 1.0
33// Created: 1998-11-07
34// Author: Peter Gumplinger
35// Updated: 2010-10-20 Allow the scintillation yield to be a function
36// of energy deposited by particle type
37// Thanks to Zach Hartwig (Department of Nuclear
38// Science and Engineeering - MIT)
39// 2005-07-28 add G4ProcessType to constructor
40// 2002-11-21 change to user G4Poisson for small MeanNumPotons
41// 2002-11-07 allow for fast and slow scintillation
42// 2002-11-05 make use of constant material properties
43// 2002-05-16 changed to inherit from VRestDiscreteProcess
44// 2002-05-09 changed IsApplicable method
45// 1999-10-29 add method and class descriptors
46//
47//
48////////////////////////////////////////////////////////////////////////
49
50#ifndef G4Scintillation_h
51#define G4Scintillation_h 1
52
53#include "globals.hh"
54#include "G4EmSaturation.hh"
55#include "G4OpticalPhoton.hh"
57
58#include <map>
59
60class G4PhysicsTable;
61class G4Step;
62class G4Track;
63
64// Class Description:
65// RestDiscrete Process - Generation of Scintillation Photons.
66// Class inherits publicly from G4VRestDiscreteProcess.
67// Class Description - End:
68
70{
71 public:
72 explicit G4Scintillation(const G4String& processName = "Scintillation",
75
76 G4Scintillation(const G4Scintillation& right) = delete;
77 G4Scintillation& operator=(const G4Scintillation& right) = delete;
78
79 // G4Scintillation Process has both PostStepDoIt (for energy
80 // deposition of particles in flight) and AtRestDoIt (for energy
81 // given to the medium by particles at rest)
82
83 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
84 // Returns true -> 'is applicable', for any particle type except
85 // for an 'opticalphoton' and for short-lived particles
86
87 void ProcessDescription(std::ostream&) const override;
88 void DumpInfo() const override {ProcessDescription(G4cout);};
89
90 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
91 // Build table at the right time
92
93 void PreparePhysicsTable(const G4ParticleDefinition& part) override;
94 void Initialise();
95
97 G4ForceCondition*) override;
98 // Returns infinity; i. e. the process does not limit the step,
99 // but sets the 'StronglyForced' condition for the DoIt to be
100 // invoked at every step.
101
102 G4double GetMeanLifeTime(const G4Track& aTrack, G4ForceCondition*) override;
103 // Returns infinity; i. e. the process does not limit the time,
104 // but sets the 'StronglyForced' condition for the DoIt to be
105 // invoked at every step.
106
108 const G4Step& aStep) override;
109 G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
110 const G4Step& aStep) override;
111
113 const G4Step& aStep,
114 G4double& yield1,
115 G4double& yield2,
116 G4double& yield3,
117 G4double& timeconstant1,
118 G4double& timeconstant2,
119 G4double& timeconstant3);
120 // allow multiple time constants with scint by particle type
121 // Returns the number of scintillation photons calculated when
122 // scintillation depends on the particle type and energy
123 // deposited (includes nonlinear dependendency) and updates the
124 // yields for each channel
125
126 void SetTrackSecondariesFirst(const G4bool state);
127 // If set, the primary particle tracking is interrupted and any
128 // produced scintillation photons are tracked next. When all
129 // have been tracked, the tracking of the primary resumes.
130
132 // Returns the boolean flag for tracking secondaries first.
133
134 void SetFiniteRiseTime(const G4bool state);
135 // If set, the G4Scintillation process expects the user to have
136 // set the constant material property SCINTILLATIONRISETIME{1,2,3}.
137
139 // Returns the boolean flag for a finite scintillation rise time.
140
142 // Returns the address of scintillation integral table #1.
143
145 // Returns the address of scintillation integral table #2.
146
148 // Returns the address of scintillation integral table #3.
149
150 void AddSaturation(G4EmSaturation* sat);
151 // Adds Birks Saturation to the process.
152
153 void RemoveSaturation();
154 // Removes the Birks Saturation from the process.
155
157 // Returns the Birks Saturation.
158
160 // Called by the user to set the scintillation yield as a function
161 // of energy deposited by particle type
162
164 // Return the boolean that determines the method of scintillation
165 // production
166
167 void SetScintillationTrackInfo(const G4bool trackType);
168 // Call by the user to set the G4ScintillationTrackInformation
169 // to scintillation photon track
170
172 // Return the boolean for whether or not the
173 // G4ScintillationTrackInformation is set to the scint. photon track
174
175 void SetStackPhotons(const G4bool);
176 // Call by the user to set the flag for stacking the scint. photons
177
178 G4bool GetStackPhotons() const;
179 // Return the boolean for whether or not the scint. photons are stacked
180
181 G4int GetNumPhotons() const;
182 // Returns the current number of scint. photons (after PostStepDoIt)
183
184 void DumpPhysicsTable() const;
185 // Prints the fast and slow scintillation integral tables.
186
188 // sets verbosity
189
190 private:
191 void BuildInverseCdfTable(const G4MaterialPropertyVector* MPV,
192 G4PhysicsFreeVector* vec) const;
193 // Build the inverse cumulative distribution function (C.D.F.) table
194 // for the scintillation photon energy spectrum
195
196 private:
197
198 G4PhysicsTable* fIntegralTable1;
199 G4PhysicsTable* fIntegralTable2;
200 G4PhysicsTable* fIntegralTable3;
201 std::map<std::size_t, std::size_t> fIndexMPT;
202
203 G4EmSaturation* fEmSaturation;
204 const G4ParticleDefinition* opticalphoton =
206
207 G4int fNumPhotons;
208
209 G4bool fScintillationByParticleType;
210 G4bool fScintillationTrackInfo;
211 G4bool fStackingFlag;
212 G4bool fTrackSecondariesFirst;
213 G4bool fFiniteRiseTime;
214
215#ifdef G4DEBUG_SCINTILLATION
216 G4double ScintTrackEDep, ScintTrackYield;
217#endif
218
219 G4double single_exp(G4double t, G4double tau2);
220 G4double bi_exp(G4double t, G4double tau1, G4double tau2);
221
222 // emission time distribution when there is a finite rise time
223 G4double sample_time(G4double tau1, G4double tau2);
224
225 G4int secID = -1; // creator modelID
226 G4int fNumEnergyWarnings = 0;
227
228};
229
230////////////////////
231// Inline methods
232////////////////////
233
235{
236 return fTrackSecondariesFirst;
237}
238
240{
241 return fFiniteRiseTime;
242}
243
245{
246 return fIntegralTable1;
247}
248
250{
251 return fIntegralTable2;
252}
253
255{
256 return fIntegralTable3;
257}
258
260{
261 fEmSaturation = sat;
262}
263
264inline void G4Scintillation::RemoveSaturation() { fEmSaturation = nullptr; }
265
267{
268 return fEmSaturation;
269}
270
272{
273 return fScintillationByParticleType;
274}
275
277{
278 return fScintillationTrackInfo;
279}
280
281inline G4bool G4Scintillation::GetStackPhotons() const { return fStackingFlag; }
282
283inline G4int G4Scintillation::GetNumPhotons() const { return fNumPhotons; }
284
285inline G4double G4Scintillation::single_exp(G4double t, G4double tau2)
286{
287 return std::exp(-1.0 * t / tau2) / tau2;
288}
289
290inline G4double G4Scintillation::bi_exp(G4double t, G4double tau1,
291 G4double tau2)
292{
293 return std::exp(-1.0 * t / tau2) * (1 - std::exp(-1.0 * t / tau1)) / tau2 /
294 tau2 * (tau1 + tau2);
295}
296
297#endif /* G4Scintillation_h */
G4ForceCondition
G4PhysicsFreeVector G4MaterialPropertyVector
G4ProcessType
@ fElectromagnetic
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
static G4OpticalPhoton * OpticalPhotonDefinition()
G4bool GetScintillationTrackInfo() const
G4VParticleChange * AtRestDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4EmSaturation * GetSaturation() const
G4PhysicsTable * GetIntegralTable1() const
void SetTrackSecondariesFirst(const G4bool state)
void SetStackPhotons(const G4bool)
G4double GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *) override
void BuildPhysicsTable(const G4ParticleDefinition &aParticleType) override
void SetVerboseLevel(G4int)
void SetScintillationTrackInfo(const G4bool trackType)
G4bool GetFiniteRiseTime() const
G4double GetMeanLifeTime(const G4Track &aTrack, G4ForceCondition *) override
G4PhysicsTable * GetIntegralTable2() const
G4PhysicsTable * GetIntegralTable3() const
G4VParticleChange * PostStepDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4Scintillation(const G4Scintillation &right)=delete
void AddSaturation(G4EmSaturation *sat)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep, G4double &yield1, G4double &yield2, G4double &yield3, G4double &timeconstant1, G4double &timeconstant2, G4double &timeconstant3)
void DumpPhysicsTable() const
void SetFiniteRiseTime(const G4bool state)
G4Scintillation(const G4String &processName="Scintillation", G4ProcessType type=fElectromagnetic)
G4Scintillation & operator=(const G4Scintillation &right)=delete
void DumpInfo() const override
G4int GetNumPhotons() const
G4bool GetTrackSecondariesFirst() const
G4bool GetScintillationByParticleType() const
void PreparePhysicsTable(const G4ParticleDefinition &part) override
void SetScintillationByParticleType(const G4bool)
void ProcessDescription(std::ostream &) const override
G4bool GetStackPhotons() const
G4VRestDiscreteProcess(const G4String &, G4ProcessType aType=fNotDefined)