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
G4OpBoundaryProcess.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4OpBoundaryProcess.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
// Optical Photon Boundary Process Class Definition
32
//
33
// File: G4OpBoundaryProcess.hh
34
// Description: Discrete Process -- reflection/refraction at
35
// optical interfaces
36
// Version: 1.1
37
// Created: 1997-06-18
38
// Modified: 2005-07-28 add G4ProcessType to constructor
39
// 1999-10-29 add method and class descriptors
40
// 1999-10-10 - Fill NewMomentum/NewPolarization in
41
// DoAbsorption. These members need to be
42
// filled since DoIt calls
43
// aParticleChange.SetMomentumChange etc.
44
// upon return (thanks to: Clark McGrew)
45
// 2006-11-04 - add capability of calculating the reflectivity
46
// off a metal surface by way of a complex index
47
// of refraction - Thanks to Sehwook Lee and John
48
// Hauptman (Dept. of Physics - Iowa State Univ.)
49
// 2009-11-10 - add capability of simulating surface reflections
50
// with Look-Up-Tables (LUT) containing measured
51
// optical reflectance for a variety of surface
52
// treatments - Thanks to Martin Janecek and
53
// William Moses (Lawrence Berkeley National Lab.)
54
// 2013-06-01 - add the capability of simulating the transmission
55
// of a dichronic filter
56
// 2017-02-24 - add capability of simulating surface reflections
57
// with Look-Up-Tables (LUT) developed in DAVIS
58
//
59
// Author: Peter Gumplinger
60
// adopted from work by Werner Keil - April 2/96
61
// mail: gum@triumf.ca
62
//
64
65
#ifndef G4OpBoundaryProcess_h
66
#define G4OpBoundaryProcess_h 1
67
68
#include "
globals.hh
"
69
#include "
templates.hh
"
70
#include "
geomdefs.hh
"
71
#include "
Randomize.hh
"
72
73
#include "
G4RandomTools.hh
"
74
#include "
G4RandomDirection.hh
"
75
76
#include "
G4Step.hh
"
77
#include "
G4VDiscreteProcess.hh
"
78
#include "
G4DynamicParticle.hh
"
79
#include "
G4Material.hh
"
80
#include "
G4LogicalBorderSurface.hh
"
81
#include "
G4LogicalSkinSurface.hh
"
82
#include "
G4OpticalSurface.hh
"
83
#include "
G4OpticalPhoton.hh
"
84
#include "
G4TransportationManager.hh
"
85
86
// Class Description:
87
// Discrete Process -- reflection/refraction at optical interfaces.
88
// Class inherits publicly from G4VDiscreteProcess.
89
// Class Description - End:
90
91
enum
G4OpBoundaryProcessStatus
{
Undefined
,
92
Transmission
,
FresnelRefraction
,
93
FresnelReflection
,
TotalInternalReflection
,
94
LambertianReflection
,
LobeReflection
,
95
SpikeReflection
,
BackScattering
,
96
Absorption
,
Detection
,
NotAtBoundary
,
97
SameMaterial
,
StepTooSmall
,
NoRINDEX
,
98
PolishedLumirrorAirReflection
,
99
PolishedLumirrorGlueReflection
,
100
PolishedAirReflection
,
101
PolishedTeflonAirReflection
,
102
PolishedTiOAirReflection
,
103
PolishedTyvekAirReflection
,
104
PolishedVM2000AirReflection
,
105
PolishedVM2000GlueReflection
,
106
EtchedLumirrorAirReflection
,
107
EtchedLumirrorGlueReflection
,
108
EtchedAirReflection
,
109
EtchedTeflonAirReflection
,
110
EtchedTiOAirReflection
,
111
EtchedTyvekAirReflection
,
112
EtchedVM2000AirReflection
,
113
EtchedVM2000GlueReflection
,
114
GroundLumirrorAirReflection
,
115
GroundLumirrorGlueReflection
,
116
GroundAirReflection
,
117
GroundTeflonAirReflection
,
118
GroundTiOAirReflection
,
119
GroundTyvekAirReflection
,
120
GroundVM2000AirReflection
,
121
GroundVM2000GlueReflection
,
122
Dichroic
};
123
124
class
G4OpBoundaryProcess
:
public
G4VDiscreteProcess
125
{
126
127
public
:
128
129
explicit
G4OpBoundaryProcess
(
const
G4String
& processName =
"OpBoundary"
,
130
G4ProcessType
type =
fOptical
);
131
virtual
~G4OpBoundaryProcess
();
132
133
virtual
G4bool
IsApplicable
(
const
G4ParticleDefinition
& aParticleType)
override
;
134
// Returns true -> 'is applicable' only for an optical photon.
135
136
virtual
G4double
GetMeanFreePath
(
const
G4Track
&,
G4double
,
G4ForceCondition
*
condition
)
override
;
137
// Returns infinity; i. e. the process does not limit the step,
138
// but sets the 'Forced' condition for the DoIt to be invoked at
139
// every step. However, only at a boundary will any action be
140
// taken.
141
142
G4VParticleChange
*
PostStepDoIt
(
const
G4Track
& aTrack,
143
const
G4Step
& aStep)
override
;
144
// This is the method implementing boundary processes.
145
146
virtual
G4OpBoundaryProcessStatus
GetStatus
()
const
;
147
// Returns the current status.
148
149
virtual
void
SetInvokeSD
(
G4bool
);
150
// Set flag for call to InvokeSD method.
151
152
private
:
153
154
G4OpBoundaryProcess
(
const
G4OpBoundaryProcess
&
right
) =
delete
;
155
G4OpBoundaryProcess
&
operator=
(
const
G4OpBoundaryProcess
&right) =
delete
;
156
157
G4bool
G4BooleanRand
(
const
G4double
prob)
const
;
158
159
G4ThreeVector
GetFacetNormal
(
const
G4ThreeVector
& Momentum,
160
const
G4ThreeVector
& Normal)
const
;
161
162
void
DielectricMetal
();
163
void
DielectricDielectric
();
164
165
void
DielectricLUT
();
166
void
DielectricLUTDAVIS
();
167
168
void
DielectricDichroic
();
169
170
void
ChooseReflection
();
171
void
DoAbsorption
();
172
void
DoReflection
();
173
174
G4double
GetIncidentAngle
();
175
// Returns the incident angle of optical photon
176
177
G4double
GetReflectivity
(
G4double
E1_perp,
178
G4double
E1_parl,
179
G4double
incidentangle,
180
G4double
RealRindex,
181
G4double
ImaginaryRindex);
182
// Returns the Reflectivity on a metalic surface
183
184
void
CalculateReflectivity
(
void
);
185
186
void
BoundaryProcessVerbose
(
void
)
const
;
187
188
// Invoke SD for post step point if the photon is 'detected'
189
G4bool
InvokeSD
(
const
G4Step
*
step
);
190
191
G4double
thePhotonMomentum
;
192
193
G4ThreeVector
OldMomentum
;
194
G4ThreeVector
OldPolarization
;
195
196
G4ThreeVector
NewMomentum
;
197
G4ThreeVector
NewPolarization
;
198
199
G4ThreeVector
theGlobalNormal
;
200
G4ThreeVector
theFacetNormal
;
201
202
G4Material
*
Material1
;
203
G4Material
*
Material2
;
204
205
G4OpticalSurface
*
OpticalSurface
;
206
207
G4MaterialPropertyVector
*
fRealRIndexMPV
;
208
G4MaterialPropertyVector
*
fImagRIndexMPV
;
209
210
G4double
Rindex1
;
211
G4double
Rindex2
;
212
213
G4double
cost1
,
cost2
,
sint1
,
sint2
;
214
215
G4OpBoundaryProcessStatus
theStatus
;
216
217
G4OpticalSurfaceModel
theModel
;
218
219
G4OpticalSurfaceFinish
theFinish
;
220
221
G4double
theReflectivity
;
222
G4double
theEfficiency
;
223
G4double
theTransmittance
;
224
225
G4double
theSurfaceRoughness
;
226
227
G4double
prob_sl
,
prob_ss
,
prob_bs
;
228
229
G4int
iTE
,
iTM
;
230
231
G4double
kCarTolerance
;
232
233
size_t
idx
,
idy
;
234
G4Physics2DVector
*
DichroicVector
;
235
236
G4bool
fInvokeSD
;
237
};
238
240
// Inline methods
242
243
inline
244
G4bool
G4OpBoundaryProcess::G4BooleanRand
(
const
G4double
prob)
const
245
{
246
/* Returns a random boolean variable with the specified probability */
247
return
(
G4UniformRand
() < prob);
248
}
249
250
inline
251
G4bool
G4OpBoundaryProcess::IsApplicable
(
const
G4ParticleDefinition
&
252
aParticleType)
253
{
254
return
(&aParticleType ==
G4OpticalPhoton::OpticalPhoton
());
255
}
256
257
inline
258
G4OpBoundaryProcessStatus
G4OpBoundaryProcess::GetStatus
()
const
259
{
260
return
theStatus
;
261
}
262
263
inline
264
void
G4OpBoundaryProcess::SetInvokeSD
(
G4bool
flag)
265
{
266
fInvokeSD
= flag;
267
}
268
269
inline
270
void
G4OpBoundaryProcess::ChooseReflection
()
271
{
272
G4double
rand =
G4UniformRand
();
273
if
(rand >= 0.0 && rand <
prob_ss
) {
274
theStatus
=
SpikeReflection
;
275
theFacetNormal
=
theGlobalNormal
;
276
}
277
else
if
( rand >=
prob_ss
&& rand <=
prob_ss
+
prob_sl
) {
278
theStatus
=
LobeReflection
;
279
}
280
else
if
( rand >
prob_ss
+
prob_sl
&& rand <
prob_ss
+
prob_sl
+
prob_bs
) {
281
theStatus
=
BackScattering
;
282
}
283
else
{
284
theStatus
=
LambertianReflection
;
285
}
286
}
287
288
inline
289
void
G4OpBoundaryProcess::DoAbsorption
()
290
{
291
theStatus
=
Absorption
;
292
293
if
(
G4BooleanRand
(
theEfficiency
)) {
294
// EnergyDeposited =/= 0 means: photon has been detected
295
theStatus
=
Detection
;
296
aParticleChange
.
ProposeLocalEnergyDeposit
(
thePhotonMomentum
);
297
}
298
else
{
299
aParticleChange
.
ProposeLocalEnergyDeposit
(0.0);
300
}
301
302
NewMomentum
=
OldMomentum
;
303
NewPolarization
=
OldPolarization
;
304
305
aParticleChange
.
ProposeTrackStatus
(
fStopAndKill
);
306
}
307
308
inline
309
void
G4OpBoundaryProcess::DoReflection
()
310
{
311
if
(
theStatus
==
LambertianReflection
) {
312
NewMomentum
=
G4LambertianRand
(
theGlobalNormal
);
313
theFacetNormal
= (
NewMomentum
-
OldMomentum
).unit();
314
}
315
else
if
(
theFinish
==
ground
) {
316
theStatus
=
LobeReflection
;
317
if
(
fRealRIndexMPV
&&
fImagRIndexMPV
) {
318
//
319
}
else
{
320
theFacetNormal
=
GetFacetNormal
(
OldMomentum
,
theGlobalNormal
);
321
}
322
G4double
PdotN =
OldMomentum
*
theFacetNormal
;
323
NewMomentum
=
OldMomentum
- (2.*PdotN)*theFacetNormal;
324
}
325
else
{
326
theStatus
=
SpikeReflection
;
327
theFacetNormal
=
theGlobalNormal
;
328
G4double
PdotN =
OldMomentum
*
theFacetNormal
;
329
NewMomentum
=
OldMomentum
- (2.*PdotN)*theFacetNormal;
330
}
331
G4double
EdotN =
OldPolarization
*
theFacetNormal
;
332
NewPolarization
= -
OldPolarization
+ (2.*EdotN)*theFacetNormal;
333
}
334
335
#endif
/* G4OpBoundaryProcess_h */
geant4
tree
geant4-10.6-release
source
processes
optical
include
G4OpBoundaryProcess.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:52
using
1.8.2 with
ECCE GitHub integration