Geant4 10.7.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//
28//
29////////////////////////////////////////////////////////////////////////
30// Scintillation Light Class Definition
31////////////////////////////////////////////////////////////////////////
32//
33// File: G4Scintillation.hh
34// Description: Discrete Process - Generation of Scintillation Photons
35// Version: 1.0
36// Created: 1998-11-07
37// Author: Peter Gumplinger
38// Updated: 2010-10-20 Allow the scintillation yield to be a function
39// of energy deposited by particle type
40// Thanks to Zach Hartwig (Department of Nuclear
41// Science and Engineeering - MIT)
42// 2005-07-28 add G4ProcessType to constructor
43// 2002-11-21 change to user G4Poisson for small MeanNumPotons
44// 2002-11-07 allow for fast and slow scintillation
45// 2002-11-05 make use of constant material properties
46// 2002-05-16 changed to inherit from VRestDiscreteProcess
47// 2002-05-09 changed IsApplicable method
48// 1999-10-29 add method and class descriptors
49//
50//
51////////////////////////////////////////////////////////////////////////
52
53#ifndef G4Scintillation_h
54#define G4Scintillation_h 1
55
56#include "globals.hh"
57#include "templates.hh"
58#include "Randomize.hh"
59#include "G4Poisson.hh"
60#include "G4ThreeVector.hh"
61#include "G4ParticleMomentum.hh"
62#include "G4Step.hh"
64#include "G4OpticalPhoton.hh"
65#include "G4DynamicParticle.hh"
66#include "G4Material.hh"
67#include "G4PhysicsTable.hh"
70
71#include "G4EmSaturation.hh"
72
73// Class Description:
74// RestDiscrete Process - Generation of Scintillation Photons.
75// Class inherits publicly from G4VRestDiscreteProcess.
76// Class Description - End:
77
79{
80 public:
81 explicit G4Scintillation(const G4String& processName = "Scintillation",
84
85 private:
86 G4Scintillation(const G4Scintillation& right) = delete;
87 G4Scintillation& operator=(const G4Scintillation& right) = delete;
88
89 public:
90 // G4Scintillation Process has both PostStepDoIt (for energy
91 // deposition of particles in flight) and AtRestDoIt (for energy
92 // given to the medium by particles at rest)
93
94 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
95 // Returns true -> 'is applicable', for any particle type except
96 // for an 'opticalphoton' and for short-lived particles
97
98 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
99 // Build table at the right time
100
101 void PreparePhysicsTable(const G4ParticleDefinition& part) override;
102 void Initialise();
103
105 G4ForceCondition*) override;
106 // Returns infinity; i. e. the process does not limit the step,
107 // but sets the 'StronglyForced' condition for the DoIt to be
108 // invoked at every step.
109
110 G4double GetMeanLifeTime(const G4Track& aTrack, G4ForceCondition*) override;
111 // Returns infinity; i. e. the process does not limit the time,
112 // but sets the 'StronglyForced' condition for the DoIt to be
113 // invoked at every step.
114
116 const G4Step& aStep) override;
117 G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
118 const G4Step& aStep) override;
119
121 const G4Step& aStep);
122 // Returns the number of scintillation photons calculated when
123 // scintillation depends on the particle type and energy
124 // deposited (includes nonlinear dependendency)
125 // DEPRECATED: to be removed in the next major release. Use the
126 // following instead.
127
129 const G4Step& aStep,
130 G4double& yield1,
131 G4double& yield2,
132 G4double& yield3);
133 // allow multiple time constants with scint by particle type
134
135 void SetTrackSecondariesFirst(const G4bool state);
136 // If set, the primary particle tracking is interrupted and any
137 // produced scintillation photons are tracked next. When all
138 // have been tracked, the tracking of the primary resumes.
139
141 // Returns the boolean flag for tracking secondaries first.
142
143 void SetFiniteRiseTime(const G4bool state);
144 // If set, the G4Scintillation process expects the user to have
145 // set the constant material property FAST/SLOWSCINTILLATIONRISETIME.
146
148 // Returns the boolean flag for a finite scintillation rise time.
149
150 void SetScintillationYieldFactor(const G4double yieldfactor);
151 // Called to set the scintillation photon yield factor, needed when
152 // the yield is different for different types of particles. This
153 // scales the yield obtained from the G4MaterialPropertiesTable.
154
156 // Returns the photon yield factor.
157
159 // Called to set the scintillation excitation ratio, needed when
160 // the scintillation level excitation is different for different
161 // types of particles. This overwrites the YieldRatio obtained
162 // from the G4MaterialPropertiesTable.
163 // DEPRECATED and will be removed in the next major release. Set
164 // the yields for different particles in material property table instead.
165
167 // Returns the scintillation level excitation ratio.
168 // DEPRECATED and will be removed in the next major release. Set
169 // the yields for different particles in material property table instead.
170
172 // Returns the address of the fast scintillation integral table.
173 // DEPRECATED and will be removed in the next major release. Use
174 // GetIntegralTable1() instead.
175
177 // Returns the address of the slow scintillation integral table.
178 // DEPRECATED and will be removed in the next major release. Use
179 // GetIntegralTable3() instead.
180
182 // Returns the address of scintillation integral table #1.
183
185 // Returns the address of scintillation integral table #2.
186
188 // Returns the address of scintillation integral table #3.
189
190 void AddSaturation(G4EmSaturation* sat);
191 // Adds Birks Saturation to the process.
192
193 void RemoveSaturation();
194 // Removes the Birks Saturation from the process.
195
197 // Returns the Birks Saturation.
198
200 // Called by the user to set the scintillation yield as a function
201 // of energy deposited by particle type
202
204 // Return the boolean that determines the method of scintillation
205 // production
206
209 // Starting with 10.7.beta, enable 3 time constants, either for
210 // all particles or by particle type. The names of the material
211 // properties have been generalized from FAST and SLOW to 1, 2, 3.
212
213 void SetScintillationTrackInfo(const G4bool trackType);
214 // Call by the user to set the G4ScintillationTrackInformation
215 // to scintillation photon track
216
218 // Return the boolean for whether or not the
219 // G4ScintillationTrackInformation is set to the scint. photon track
220
221 void SetStackPhotons(const G4bool);
222 // Call by the user to set the flag for stacking the scint. photons
223
224 G4bool GetStackPhotons() const;
225 // Return the boolean for whether or not the scint. photons are stacked
226
227 G4int GetNumPhotons() const;
228 // Returns the current number of scint. photons (after PostStepDoIt)
229
230 void DumpPhysicsTable() const;
231 // Prints the fast and slow scintillation integral tables.
232
233 protected:
237
238 private:
239 G4bool fTrackSecondariesFirst;
240 G4bool fFiniteRiseTime;
241 G4double fYieldFactor;
242 G4double fExcitationRatio;
243 G4bool fScintillationByParticleType;
244 G4bool fScintillationTrackInfo;
245 G4bool fStackingFlag;
246 G4int fNumPhotons;
247 G4bool fEnhancedTimeConstants;
248
249#ifdef G4DEBUG_SCINTILLATION
250 G4double ScintTrackEDep, ScintTrackYield;
251#endif
252
253 G4double single_exp(G4double t, G4double tau2);
254 G4double bi_exp(G4double t, G4double tau1, G4double tau2);
255
256 // emission time distribution when there is a finite rise time
257 G4double sample_time(G4double tau1, G4double tau2);
258
259 G4EmSaturation* fEmSaturation;
260 G4ParticleDefinition* opticalphoton =
262};
263
264////////////////////
265// Inline methods
266////////////////////
267
269{
270 fTrackSecondariesFirst = state;
271}
272
274{
275 return fTrackSecondariesFirst;
276}
277
279{
280 fFiniteRiseTime = state;
281}
282
284{
285 return fFiniteRiseTime;
286}
287
289 const G4double yieldfactor)
290{
291 fYieldFactor = yieldfactor;
292}
293
295{
296 return fYieldFactor;
297}
298
300 const G4double ratio)
301{
302 fExcitationRatio = ratio;
303}
304
306{
307 return fExcitationRatio;
308}
309
311{
312 return fIntegralTable3;
313}
314
316{
317 return fIntegralTable1;
318}
319
321{
322 return fIntegralTable1;
323}
324
326{
327 return fIntegralTable2;
328}
329
331{
332 return fIntegralTable3;
333}
334
336{
337 fEmSaturation = sat;
338}
339
340inline void G4Scintillation::RemoveSaturation() { fEmSaturation = nullptr; }
341
343{
344 return fEmSaturation;
345}
346
348{
349 return fScintillationByParticleType;
350}
351
353{
354 fEnhancedTimeConstants = val;
355}
356
358{
359 return fEnhancedTimeConstants;
360}
361
363{
364 fScintillationTrackInfo = trackType;
365}
366
368{
369 return fScintillationTrackInfo;
370}
371
372inline void G4Scintillation::SetStackPhotons(const G4bool stackingFlag)
373{
374 fStackingFlag = stackingFlag;
375}
376
377inline G4bool G4Scintillation::GetStackPhotons() const { return fStackingFlag; }
378
379inline G4int G4Scintillation::GetNumPhotons() const { return fNumPhotons; }
380
381inline G4double G4Scintillation::single_exp(G4double t, G4double tau2)
382{
383 return std::exp(-1.0 * t / tau2) / tau2;
384}
385
386inline G4double G4Scintillation::bi_exp(G4double t, G4double tau1,
387 G4double tau2)
388{
389 return std::exp(-1.0 * t / tau2) * (1 - std::exp(-1.0 * t / tau1)) / tau2 /
390 tau2 * (tau1 + tau2);
391}
392
393#endif /* G4Scintillation_h */
G4ForceCondition
G4ProcessType
@ fElectromagnetic
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4OpticalPhoton * OpticalPhotonDefinition()
G4bool GetScintillationTrackInfo() const
G4PhysicsTable * fIntegralTable3
G4VParticleChange * AtRestDoIt(const G4Track &aTrack, const G4Step &aStep) override
G4EmSaturation * GetSaturation() const
void SetScintillationYieldFactor(const G4double yieldfactor)
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
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep)
void SetScintillationExcitationRatio(const G4double ratio)
G4PhysicsTable * fIntegralTable1
void SetScintillationTrackInfo(const G4bool trackType)
void SetEnhancedTimeConstants(G4bool)
G4bool GetEnhancedTimeConstants() const
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
void AddSaturation(G4EmSaturation *sat)
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
G4double GetScintillationYieldFactor() const
void DumpPhysicsTable() const
void SetFiniteRiseTime(const G4bool state)
G4double GetScintillationExcitationRatio() const
G4PhysicsTable * GetFastIntegralTable() const
G4int GetNumPhotons() const
G4bool GetTrackSecondariesFirst() const
G4bool GetScintillationByParticleType() const
G4PhysicsTable * GetSlowIntegralTable() const
void PreparePhysicsTable(const G4ParticleDefinition &part) override
void SetScintillationByParticleType(const G4bool)
G4PhysicsTable * fIntegralTable2
G4bool GetStackPhotons() const
Definition: G4Step.hh:62