ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4Scintillation.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Scintillation.hh
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
//
30
// Scintillation Light Class Definition
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
// mail: gum@triumf.ca
51
//
53
54
#ifndef G4Scintillation_h
55
#define G4Scintillation_h 1
56
58
// Includes
60
61
#include "
globals.hh
"
62
#include "
templates.hh
"
63
#include "
Randomize.hh
"
64
#include "
G4Poisson.hh
"
65
#include "
G4ThreeVector.hh
"
66
#include "
G4ParticleMomentum.hh
"
67
#include "
G4Step.hh
"
68
#include "
G4VRestDiscreteProcess.hh
"
69
#include "
G4OpticalPhoton.hh
"
70
#include "
G4DynamicParticle.hh
"
71
#include "
G4Material.hh
"
72
#include "
G4PhysicsTable.hh
"
73
#include "
G4MaterialPropertiesTable.hh
"
74
#include "
G4PhysicsOrderedFreeVector.hh
"
75
76
#include "
G4EmSaturation.hh
"
77
78
// Class Description:
79
// RestDiscrete Process - Generation of Scintillation Photons.
80
// Class inherits publicly from G4VRestDiscreteProcess.
81
// Class Description - End:
82
84
// Class Definition
86
87
class
G4Scintillation
:
public
G4VRestDiscreteProcess
88
{
89
90
public
:
91
93
// Constructors and Destructor
95
96
explicit
G4Scintillation
(
const
G4String
& processName =
"Scintillation"
,
97
G4ProcessType
type =
fElectromagnetic
);
98
~G4Scintillation
();
99
100
private
:
101
102
G4Scintillation
(
const
G4Scintillation
&
right
) =
delete
;
103
105
// Operators
107
108
G4Scintillation
&
operator=
(
const
G4Scintillation
&right) =
delete
;
109
110
public
:
111
113
// Methods
115
116
// G4Scintillation Process has both PostStepDoIt (for energy
117
// deposition of particles in flight) and AtRestDoIt (for energy
118
// given to the medium by particles at rest)
119
120
G4bool
IsApplicable
(
121
const
G4ParticleDefinition
& aParticleType)
override
;
122
// Returns true -> 'is applicable', for any particle type except
123
// for an 'opticalphoton' and for short-lived particles
124
125
void
BuildPhysicsTable
(
126
const
G4ParticleDefinition
& aParticleType)
override
;
127
// Build table at the right time
128
129
G4double
GetMeanFreePath
(
const
G4Track
& aTrack,
130
G4double
,
131
G4ForceCondition
* )
override
;
132
// Returns infinity; i. e. the process does not limit the step,
133
// but sets the 'StronglyForced' condition for the DoIt to be
134
// invoked at every step.
135
136
G4double
GetMeanLifeTime
(
const
G4Track
& aTrack,
137
G4ForceCondition
* )
override
;
138
// Returns infinity; i. e. the process does not limit the time,
139
// but sets the 'StronglyForced' condition for the DoIt to be
140
// invoked at every step.
141
142
G4VParticleChange
*
PostStepDoIt
(
const
G4Track
& aTrack,
143
const
G4Step
& aStep)
override
;
144
G4VParticleChange
*
AtRestDoIt
(
const
G4Track
& aTrack,
145
const
G4Step
& aStep)
override
;
146
147
G4double
GetScintillationYieldByParticleType
(
const
G4Track
&aTrack,
148
const
G4Step
&aStep);
149
// Returns the number of scintillation photons calculated when
150
// scintillation depends on the particle type and energy
151
// deposited (includes nonlinear dependendency)
152
153
// These are the methods implementing the scintillation process.
154
155
void
SetTrackSecondariesFirst
(
const
G4bool
state);
156
// If set, the primary particle tracking is interrupted and any
157
// produced scintillation photons are tracked next. When all
158
// have been tracked, the tracking of the primary resumes.
159
160
G4bool
GetTrackSecondariesFirst
()
const
;
161
// Returns the boolean flag for tracking secondaries first.
162
163
void
SetFiniteRiseTime
(
const
G4bool
state);
164
// If set, the G4Scintillation process expects the user to have
165
// set the constant material property FAST/SLOWSCINTILLATIONRISETIME.
166
167
G4bool
GetFiniteRiseTime
()
const
;
168
// Returns the boolean flag for a finite scintillation rise time.
169
170
void
SetScintillationYieldFactor
(
const
G4double
yieldfactor);
171
// Called to set the scintillation photon yield factor, needed when
172
// the yield is different for different types of particles. This
173
// scales the yield obtained from the G4MaterialPropertiesTable.
174
175
G4double
GetScintillationYieldFactor
()
const
;
176
// Returns the photon yield factor.
177
178
void
SetScintillationExcitationRatio
(
const
G4double
ratio
);
179
// Called to set the scintillation exciation ratio, needed when
180
// the scintillation level excitation is different for different
181
// types of particles. This overwrites the YieldRatio obtained
182
// from the G4MaterialPropertiesTable.
183
184
G4double
GetScintillationExcitationRatio
()
const
;
185
// Returns the scintillation level excitation ratio.
186
187
G4PhysicsTable
*
GetFastIntegralTable
()
const
;
188
// Returns the address of the fast scintillation integral table.
189
190
G4PhysicsTable
*
GetSlowIntegralTable
()
const
;
191
// Returns the address of the slow scintillation integral table.
192
193
void
AddSaturation
(
G4EmSaturation
* sat);
194
// Adds Birks Saturation to the process.
195
196
void
RemoveSaturation
();
197
// Removes the Birks Saturation from the process.
198
199
G4EmSaturation
*
GetSaturation
()
const
;
200
// Returns the Birks Saturation.
201
202
void
SetScintillationByParticleType
(
const
G4bool
);
203
// Called by the user to set the scintillation yield as a function
204
// of energy deposited by particle type
205
206
G4bool
GetScintillationByParticleType
()
const
;
207
// Return the boolean that determines the method of scintillation
208
// production
209
210
void
SetScintillationTrackInfo
(
const
G4bool
trackType);
211
// Call by the user to set the G4ScintillationTrackInformation
212
// to scintillation photon track
213
214
G4bool
GetScintillationTrackInfo
()
const
;
215
// Return the boolean for whether or not the
216
// G4ScintillationTrackInformation is set to the scint. photon track
217
218
void
SetStackPhotons
(
const
G4bool
);
219
// Call by the user to set the flag for stacking the scint. photons
220
221
G4bool
GetStackPhotons
()
const
;
222
// Return the boolean for whether or not the scint. photons are stacked
223
224
G4int
GetNumPhotons
()
const
;
225
// Returns the current number of scint. photons (after PostStepDoIt)
226
227
void
DumpPhysicsTable
()
const
;
228
// Prints the fast and slow scintillation integral tables.
229
230
protected
:
231
232
void
BuildThePhysicsTable
();
233
// It builds either the fast or slow scintillation integral table;
234
// or both.
235
237
// Class Data Members
239
240
G4PhysicsTable
*
fFastIntegralTable
;
241
G4PhysicsTable
*
fSlowIntegralTable
;
242
243
private
:
244
245
G4bool
fTrackSecondariesFirst
;
246
G4bool
fFiniteRiseTime
;
247
248
G4double
fYieldFactor
;
249
250
G4double
fExcitationRatio
;
251
252
G4bool
fScintillationByParticleType
;
253
254
G4bool
fScintillationTrackInfo
;
255
256
G4bool
fStackingFlag
;
257
258
G4int
fNumPhotons
;
259
260
#ifdef G4DEBUG_SCINTILLATION
261
G4double
ScintTrackEDep, ScintTrackYield;
262
#endif
263
264
G4double
single_exp
(
G4double
t
,
G4double
tau2);
265
G4double
bi_exp
(
G4double
t
,
G4double
tau1,
G4double
tau2);
266
267
// emission time distribution when there is a finite rise time
268
G4double
sample_time
(
G4double
tau1,
G4double
tau2);
269
270
G4EmSaturation
*
fEmSaturation
;
271
272
};
273
275
// Inline methods
277
278
inline
279
void
G4Scintillation::SetTrackSecondariesFirst
(
const
G4bool
state)
280
{
281
fTrackSecondariesFirst
= state;
282
}
283
284
inline
285
G4bool
G4Scintillation::GetTrackSecondariesFirst
()
const
286
{
287
return
fTrackSecondariesFirst
;
288
}
289
290
inline
291
void
G4Scintillation::SetFiniteRiseTime
(
const
G4bool
state)
292
{
293
fFiniteRiseTime
= state;
294
}
295
296
inline
297
G4bool
G4Scintillation::GetFiniteRiseTime
()
const
298
{
299
return
fFiniteRiseTime
;
300
}
301
302
inline
303
void
G4Scintillation::SetScintillationYieldFactor
(
const
G4double
yieldfactor)
304
{
305
fYieldFactor
= yieldfactor;
306
}
307
308
inline
309
G4double
G4Scintillation::GetScintillationYieldFactor
()
const
310
{
311
return
fYieldFactor
;
312
}
313
314
inline
315
void
G4Scintillation::SetScintillationExcitationRatio
(
const
G4double
ratio
)
316
{
317
fExcitationRatio
=
ratio
;
318
}
319
320
inline
321
G4double
G4Scintillation::GetScintillationExcitationRatio
()
const
322
{
323
return
fExcitationRatio
;
324
}
325
326
inline
327
G4PhysicsTable
*
G4Scintillation::GetSlowIntegralTable
()
const
328
{
329
return
fSlowIntegralTable
;
330
}
331
332
inline
333
G4PhysicsTable
*
G4Scintillation::GetFastIntegralTable
()
const
334
{
335
return
fFastIntegralTable
;
336
}
337
338
inline
339
void
G4Scintillation::AddSaturation
(
G4EmSaturation
* sat)
340
{
341
fEmSaturation
= sat;
342
}
343
344
inline
345
void
G4Scintillation::RemoveSaturation
()
346
{
347
fEmSaturation
=
nullptr
;
348
}
349
350
inline
351
G4EmSaturation
*
G4Scintillation::GetSaturation
()
const
352
{
353
return
fEmSaturation
;
354
}
355
356
inline
357
G4bool
G4Scintillation::GetScintillationByParticleType
()
const
358
{
359
return
fScintillationByParticleType
;
360
}
361
362
inline
363
void
G4Scintillation::SetScintillationTrackInfo
(
const
G4bool
trackType)
364
{
365
fScintillationTrackInfo
= trackType;
366
}
367
368
inline
369
G4bool
G4Scintillation::GetScintillationTrackInfo
()
const
370
{
371
return
fScintillationTrackInfo
;
372
}
373
374
inline
375
void
G4Scintillation::SetStackPhotons
(
const
G4bool
stackingFlag)
376
{
377
fStackingFlag
= stackingFlag;
378
}
379
380
inline
381
G4bool
G4Scintillation::GetStackPhotons
()
const
382
{
383
return
fStackingFlag
;
384
}
385
386
inline
387
G4int
G4Scintillation::GetNumPhotons
()
const
388
{
389
return
fNumPhotons
;
390
}
391
392
393
inline
394
G4double
G4Scintillation::single_exp
(
G4double
t
,
G4double
tau2)
395
{
396
return
std::exp(-1.0*t/tau2)/tau2;
397
}
398
399
inline
400
G4double
G4Scintillation::bi_exp
(
G4double
t
,
G4double
tau1,
G4double
tau2)
401
{
402
return
std::exp(-1.0*t/tau2)*(1-std::exp(-1.0*t/tau1))/tau2/tau2*(tau1+tau2);
403
}
404
405
#endif
/* G4Scintillation_h */
geant4
tree
geant4-10.6-release
source
processes
electromagnetic
xrays
include
G4Scintillation.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:36
using
1.8.2 with
ECCE GitHub integration