ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
Geo2G4
src
Geo2G4OpticalSurfaceFactory.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
Geo2G4OpticalSurfaceFactory.h
"
6
#include "
GeoMaterial2G4/Geo2G4MatPropTableFactory.h
"
7
8
#include "
GeoModelUtilities/GeoOpticalSurface.h
"
9
10
#include "G4OpticalSurface.hh"
11
12
Geo2G4OpticalSurfaceFactory::Geo2G4OpticalSurfaceFactory
()
13
{
14
}
15
16
G4OpticalSurface*
Geo2G4OpticalSurfaceFactory::Build
(
const
GeoOpticalSurface
* geoOpticalSurface)
17
{
18
//
19
// Check if this surface has already been defined.
20
//
21
if
(
m_definedOptSurfaces
.find(geoOpticalSurface) !=
m_definedOptSurfaces
.end()) {
22
return
m_definedOptSurfaces
[geoOpticalSurface];
23
}
24
25
// map enums
26
G4OpticalSurfaceModel g4Model;
27
G4OpticalSurfaceFinish g4Finish;
28
G4SurfaceType g4Type;
29
30
switch
(geoOpticalSurface->
GetModel
())
31
{
32
case
GeoOpticalSurface::glisur
:
33
{
34
g4Model = glisur;
35
break
;
36
}
37
case
GeoOpticalSurface::unified
:
38
{
39
g4Model = unified;
40
break
;
41
}
42
default
:
43
g4Model = glisur;
44
}
45
46
switch
(geoOpticalSurface->
GetFinish
())
47
{
48
case
GeoOpticalSurface::polished
:
49
{
50
g4Finish = polished;
51
break
;
52
}
53
case
GeoOpticalSurface::polishedfrontpainted
:
54
{
55
g4Finish = polishedfrontpainted;
56
break
;
57
}
58
case
GeoOpticalSurface::polishedbackpainted
:
59
{
60
g4Finish = polishedbackpainted;
61
break
;
62
}
63
case
GeoOpticalSurface::ground
:
64
{
65
g4Finish = ground;
66
break
;
67
}
68
case
GeoOpticalSurface::groundfrontpainted
:
69
{
70
g4Finish = groundfrontpainted;
71
break
;
72
}
73
case
GeoOpticalSurface::groundbackpainted
:
74
{
75
g4Finish = groundbackpainted;
76
break
;
77
}
78
default
:
79
g4Finish = polished;
80
}
81
82
switch
(geoOpticalSurface->
GetType
())
83
{
84
case
GeoOpticalSurface::dielectric_metal
:
85
{
86
g4Type = dielectric_metal;
87
break
;
88
}
89
case
GeoOpticalSurface::dielectric_dielectric
:
90
{
91
g4Type = dielectric_dielectric;
92
break
;
93
}
94
case
GeoOpticalSurface::firsov
:
95
{
96
g4Type = firsov;
97
break
;
98
}
99
case
GeoOpticalSurface::x_ray
:
100
{
101
g4Type = x_ray;
102
break
;
103
}
104
default
:
105
g4Type = dielectric_dielectric;
106
}
107
108
109
110
G4OpticalSurface* newG4Surface =
new
G4OpticalSurface(geoOpticalSurface->
GetName
(),
111
g4Model,
112
g4Finish,
113
g4Type,
114
geoOpticalSurface->
GetParameter
());
115
116
// Create material properties table
117
const
GeoMaterialPropertiesTable
* geoPropTable = geoOpticalSurface->
GetMaterialPropertiesTable
();
118
119
if
(geoPropTable){
120
Geo2G4MatPropTableFactory
tFactory;
121
G4MaterialPropertiesTable* g4PropTable = tFactory.
Build
(geoPropTable);
122
if
(g4PropTable)
123
newG4Surface->SetMaterialPropertiesTable(g4PropTable);
124
}
125
126
return
newG4Surface;
127
}
Geo2G4MatPropTableFactory.h
Geo2G4OpticalSurfaceFactory.h
GeoOpticalSurface.h
Geo2G4MatPropTableFactory
Definition
Geo2G4MatPropTableFactory.h:11
Geo2G4MatPropTableFactory::Build
G4MaterialPropertiesTable * Build(const GeoMaterialPropertiesTable *)
Definition
Geo2G4MatPropTableFactory.cxx:21
Geo2G4OpticalSurfaceFactory::m_definedOptSurfaces
Geo2G4OptSurfaceMap m_definedOptSurfaces
Definition
Geo2G4OpticalSurfaceFactory.h:22
Geo2G4OpticalSurfaceFactory::Build
G4OpticalSurface * Build(const GeoOpticalSurface *)
Definition
Geo2G4OpticalSurfaceFactory.cxx:16
Geo2G4OpticalSurfaceFactory::Geo2G4OpticalSurfaceFactory
Geo2G4OpticalSurfaceFactory()
Definition
Geo2G4OpticalSurfaceFactory.cxx:12
GeoMaterialPropertiesTable
Definition
GeoMaterialPropertiesTable.h:20
GeoOpticalSurface
Ensure that the extensions for the Vector3D are properly loaded.
Definition
GeoOpticalSurface.h:19
GeoOpticalSurface::GetFinish
GeoOpticalSurfaceFinish GetFinish() const
Definition
GeoOpticalSurface.h:58
GeoOpticalSurface::GetType
GeoSurfaceType GetType() const
Definition
GeoOpticalSurface.h:57
GeoOpticalSurface::unified
@ unified
Definition
GeoOpticalSurface.h:43
GeoOpticalSurface::glisur
@ glisur
Definition
GeoOpticalSurface.h:42
GeoOpticalSurface::GetName
const std::string & GetName() const
Definition
GeoOpticalSurface.h:56
GeoOpticalSurface::GetMaterialPropertiesTable
GeoMaterialPropertiesTable * GetMaterialPropertiesTable()
Definition
GeoOpticalSurface.h:65
GeoOpticalSurface::GetModel
GeoOpticalSurfaceModel GetModel() const
Definition
GeoOpticalSurface.h:59
GeoOpticalSurface::GetParameter
double GetParameter() const
Definition
GeoOpticalSurface.h:60
GeoOpticalSurface::firsov
@ firsov
Definition
GeoOpticalSurface.h:26
GeoOpticalSurface::dielectric_dielectric
@ dielectric_dielectric
Definition
GeoOpticalSurface.h:25
GeoOpticalSurface::x_ray
@ x_ray
Definition
GeoOpticalSurface.h:27
GeoOpticalSurface::dielectric_metal
@ dielectric_metal
Definition
GeoOpticalSurface.h:24
GeoOpticalSurface::polishedbackpainted
@ polishedbackpainted
Definition
GeoOpticalSurface.h:34
GeoOpticalSurface::ground
@ ground
Definition
GeoOpticalSurface.h:35
GeoOpticalSurface::groundfrontpainted
@ groundfrontpainted
Definition
GeoOpticalSurface.h:36
GeoOpticalSurface::polished
@ polished
Definition
GeoOpticalSurface.h:32
GeoOpticalSurface::polishedfrontpainted
@ polishedfrontpainted
Definition
GeoOpticalSurface.h:33
GeoOpticalSurface::groundbackpainted
@ groundbackpainted
Definition
GeoOpticalSurface.h:37
Generated on
for ATLAS Offline Software by
1.17.0