Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
58class G4PhysicsTable;
59class G4Step;
60class G4Track;
61
62// Class Description:
63// RestDiscrete Process - Generation of Scintillation Photons.
64// Class inherits publicly from G4VRestDiscreteProcess.
65// Class Description - End:
66
68{
69 public:
70 explicit G4Scintillation(const G4String& processName = "Scintillation",
73
74 G4Scintillation(const G4Scintillation& right) = delete;
75 G4Scintillation& operator=(const G4Scintillation& right) = delete;
76
77 // G4Scintillation Process has both PostStepDoIt (for energy
78 // deposition of particles in flight) and AtRestDoIt (for energy
79 // given to the medium by particles at rest)
80
81 G4bool IsApplicable(const G4ParticleDefinition& aParticleType) override;
82 // Returns true -> 'is applicable', for any particle type except
83 // for an 'opticalphoton' and for short-lived particles
84
85 void ProcessDescription(std::ostream&) const override;
86 void DumpInfo() const override {ProcessDescription(G4cout);};
87
88 void BuildPhysicsTable(const G4ParticleDefinition& aParticleType) override;
89 // Build table at the right time
90
91 void PreparePhysicsTable(const G4ParticleDefinition& part) override;
92 void Initialise();
93
95 G4ForceCondition*) override;
96 // Returns infinity; i. e. the process does not limit the step,
97 // but sets the 'StronglyForced' condition for the DoIt to be
98 // invoked at every step.
99
100 G4double GetMeanLifeTime(const G4Track& aTrack, G4ForceCondition*) override;
101 // Returns infinity; i. e. the process does not limit the time,
102 // but sets the 'StronglyForced' condition for the DoIt to be
103 // invoked at every step.
104
106 const G4Step& aStep) override;
107 G4VParticleChange* AtRestDoIt(const G4Track& aTrack,
108 const G4Step& aStep) override;
109
111 const G4Step& aStep,
112 G4double& yield1,
113 G4double& yield2,
114 G4double& yield3);
115 // allow multiple time constants with scint by particle type
116 // Returns the number of scintillation photons calculated when
117 // scintillation depends on the particle type and energy
118 // deposited (includes nonlinear dependendency) and updates the
119 // yields for each channel
120
121 void SetTrackSecondariesFirst(const G4bool state);
122 // If set, the primary particle tracking is interrupted and any
123 // produced scintillation photons are tracked next. When all
124 // have been tracked, the tracking of the primary resumes.
125
127 // Returns the boolean flag for tracking secondaries first.
128
129 void SetFiniteRiseTime(const G4bool state);
130 // If set, the G4Scintillation process expects the user to have
131 // set the constant material property SCINTILLATIONRISETIME{1,2,3}.
132
134 // Returns the boolean flag for a finite scintillation rise time.
135
137 // Returns the address of scintillation integral table #1.
138
140 // Returns the address of scintillation integral table #2.
141
143 // Returns the address of scintillation integral table #3.
144
145 void AddSaturation(G4EmSaturation* sat);
146 // Adds Birks Saturation to the process.
147
148 void RemoveSaturation();
149 // Removes the Birks Saturation from the process.
150
152 // Returns the Birks Saturation.
153
155 // Called by the user to set the scintillation yield as a function
156 // of energy deposited by particle type
157
159 // Return the boolean that determines the method of scintillation
160 // production
161
162 void SetScintillationTrackInfo(const G4bool trackType);
163 // Call by the user to set the G4ScintillationTrackInformation
164 // to scintillation photon track
165
167 // Return the boolean for whether or not the
168 // G4ScintillationTrackInformation is set to the scint. photon track
169
170 void SetStackPhotons(const G4bool);
171 // Call by the user to set the flag for stacking the scint. photons
172
173 G4bool GetStackPhotons() const;
174 // Return the boolean for whether or not the scint. photons are stacked
175
176 G4int GetNumPhotons() const;
177 // Returns the current number of scint. photons (after PostStepDoIt)
178
179 void DumpPhysicsTable() const;
180 // Prints the fast and slow scintillation integral tables.
181
183 // sets verbosity
184
185 private:
186
187 G4PhysicsTable* fIntegralTable1;
188 G4PhysicsTable* fIntegralTable2;
189 G4PhysicsTable* fIntegralTable3;
190
191 G4EmSaturation* fEmSaturation;
192 const G4ParticleDefinition* opticalphoton =
194
195 G4int fNumPhotons;
196
197 G4bool fScintillationByParticleType;
198 G4bool fScintillationTrackInfo;
199 G4bool fStackingFlag;
200 G4bool fTrackSecondariesFirst;
201 G4bool fFiniteRiseTime;
202
203#ifdef G4DEBUG_SCINTILLATION
204 G4double ScintTrackEDep, ScintTrackYield;
205#endif
206
207 G4double single_exp(G4double t, G4double tau2);
208 G4double bi_exp(G4double t, G4double tau1, G4double tau2);
209
210 // emission time distribution when there is a finite rise time
211 G4double sample_time(G4double tau1, G4double tau2);
212
213 G4int secID = -1; // creator modelID
214
215};
216
217////////////////////
218// Inline methods
219////////////////////
220
222{
223 return fTrackSecondariesFirst;
224}
225
227{
228 return fFiniteRiseTime;
229}
230
232{
233 return fIntegralTable1;
234}
235
237{
238 return fIntegralTable2;
239}
240
242{
243 return fIntegralTable3;
244}
245
247{
248 fEmSaturation = sat;
249}
250
251inline void G4Scintillation::RemoveSaturation() { fEmSaturation = nullptr; }
252
254{
255 return fEmSaturation;
256}
257
259{
260 return fScintillationByParticleType;
261}
262
264{
265 return fScintillationTrackInfo;
266}
267
268inline G4bool G4Scintillation::GetStackPhotons() const { return fStackingFlag; }
269
270inline G4int G4Scintillation::GetNumPhotons() const { return fNumPhotons; }
271
272inline G4double G4Scintillation::single_exp(G4double t, G4double tau2)
273{
274 return std::exp(-1.0 * t / tau2) / tau2;
275}
276
277inline G4double G4Scintillation::bi_exp(G4double t, G4double tau1,
278 G4double tau2)
279{
280 return std::exp(-1.0 * t / tau2) * (1 - std::exp(-1.0 * t / tau1)) / tau2 /
281 tau2 * (tau1 + tau2);
282}
283
284#endif /* G4Scintillation_h */
G4ForceCondition
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
G4double GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep, G4double &yield1, G4double &yield2, G4double &yield3)
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
void DumpPhysicsTable() const
void SetFiniteRiseTime(const G4bool state)
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
Definition: G4Step.hh:62