EIC Software
Reference for
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
G4_DIRC.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_DIRC.C
1
#ifndef MACRO_G4DIRC_C
2
#define MACRO_G4DIRC_C
3
4
#include <GlobalVariables.C>
5
6
#include <
g4detectors/PHG4CylinderSubsystem.h
>
7
#include <
g4detectors/PHG4SectorSubsystem.h
>
8
#include <
g4detectors/PHG4ConeSubsystem.h
>
9
10
#include <
g4eicdirc/G4EicDircSubsystem.h
>
11
#include <
g4main/PHG4Reco.h
>
12
13
#include <cmath>
14
15
R__LOAD_LIBRARY
(libg4eicdirc.so)
16
17
25
namespace Enable
26
{
27
bool
DIRC
=
false
;
28
bool
DIRC_OVERLAPCHECK
=
false
;
29
}
// namespace Enable
30
31
namespace
G4DIRC
32
{
33
34
35
double
z_prism
= 30;
36
double
z_start
= -275+
z_prism
;
37
double
z_end
= 125;
38
double
length
= 0.;
39
double
z_shift
= 0.;
40
double
outer_skin_radius
= 89.25;
41
double
dRad
= 5.6;
42
double
dInSkin
= 7.54;
43
namespace
SETTING
44
{
45
bool
USECEMCGeo
=
true
;
46
bool
USEskinSupports
=
true
;
47
bool
NEWDIRC
=
true
;
48
}
49
50
}
// namespace G4DIRC
51
52
void
DIRCInit
()
53
{
54
if
(!
G4DIRC::SETTING::USECEMCGeo
){
55
G4DIRC::outer_skin_radius
= 78.;
56
G4DIRC::dRad
= 8.;
57
G4DIRC::dInSkin
= 9.;
58
G4DIRC::z_end
= -287 +
G4DIRC::z_prism
;
59
G4DIRC::z_end
= +168;
60
}
61
G4DIRC::z_shift
= 0.5 * (
G4DIRC::z_end
+
G4DIRC::z_start
);
62
G4DIRC::length
=
G4DIRC::z_end
-
G4DIRC::z_start
;
63
64
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
,
G4DIRC::outer_skin_radius
);
65
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
,
G4DIRC::z_end
);
66
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
, G4DIRC::z_start-
G4DIRC::z_prism
);
67
}
68
69
70
74
double
DIRCSetup
(
PHG4Reco
*g4Reco)
75
{
76
bool
OverlapCheck =
Enable::OVERLAPCHECK
||
Enable::DIRC_OVERLAPCHECK
;
77
78
if
(
G4DIRC::SETTING::NEWDIRC
){
79
// double z = 185;
80
// double dz = 40;
81
82
G4EicDircSubsystem
*dircSubsys =
new
G4EicDircSubsystem
(
"hpDIRC"
);
83
dircSubsys->
SuperDetector
(
"hpDIRC"
);
84
//dircSubsys->set_double_param("place_z", z + dz * 0.5);// relative position to mother vol.
85
dircSubsys->
OverlapCheck
(OverlapCheck);
86
dircSubsys->
Verbosity
(0);
87
dircSubsys->
SetActive
();
88
89
g4Reco->
registerSubsystem
(dircSubsys);
90
}
else
{
91
double
radiator_R
=
G4DIRC::outer_skin_radius
-
G4DIRC::dRad
;
92
93
PHG4SectorSubsystem
*dirc;
94
dirc =
new
PHG4SectorSubsystem
(
"DIRC"
);
95
dirc->
get_geometry
().
set_normal_polar_angle
(
M_PI
/ 2);
96
dirc->
get_geometry
().
set_normal_start
(radiator_R *
PHG4Sector::Sector_Geometry::Unit_cm
());
97
dirc->
get_geometry
().
set_min_polar_angle
(atan2(radiator_R,
G4DIRC::z_end
));
98
dirc->
get_geometry
().
set_max_polar_angle
(atan2(radiator_R,
G4DIRC::z_start
));
99
dirc->
get_geometry
().
set_min_polar_edge
(
PHG4Sector::Sector_Geometry::FlatEdge
());
100
dirc->
get_geometry
().
set_max_polar_edge
(
PHG4Sector::Sector_Geometry::FlatEdge
());
101
dirc->
get_geometry
().
set_material
(
"Quartz"
);
102
dirc->
get_geometry
().
set_N_Sector
(12);
103
dirc->
OverlapCheck
(OverlapCheck);
104
dirc->
get_geometry
().
AddLayer
(
"Radiator"
,
"Quartz"
, 1.7 *
PHG4Sector::Sector_Geometry::Unit_cm
(),
true
);
105
g4Reco->
registerSubsystem
(dirc);
106
107
PHG4CylinderSubsystem
*cyl;
108
109
// The cylinder skins provide most of the strength
110
// and stiffness of the CST. The thickness of the inner
111
// and outer skins is 1.27 and 0.76 mm, respectively
112
113
double
inner_R =
G4DIRC::outer_skin_radius
-
G4DIRC::dInSkin
;
114
// Inner skin:
115
116
if
(
G4DIRC::SETTING::USEskinSupports
){
117
cyl =
new
PHG4CylinderSubsystem
(
"DIRC_CST_Inner_Skin"
, 10);
118
cyl->
set_double_param
(
"radius"
, inner_R);
119
cyl->
set_double_param
(
"length"
,
G4DIRC::length
+
G4DIRC::z_prism
);
120
cyl->
set_string_param
(
"material"
,
"G4_Al"
);
121
cyl->
set_double_param
(
"thickness"
, 0.127);
122
cyl->
set_double_param
(
"place_x"
, 0.);
123
cyl->
set_double_param
(
"place_y"
, 0.);
124
cyl->
set_double_param
(
"place_z"
,
G4DIRC::z_shift
-
G4DIRC::z_prism
* 0.5);
125
cyl->
SetActive
(0);
126
cyl->
SuperDetector
(
"DIRC"
);
127
cyl->
OverlapCheck
(OverlapCheck);
128
129
g4Reco->
registerSubsystem
(cyl);
130
131
// Outer skin:
132
cyl =
new
PHG4CylinderSubsystem
(
"DIRC_CST_Outer_Skin"
, 11);
133
cyl->
set_double_param
(
"radius"
,
G4DIRC::outer_skin_radius
- 0.076);
134
cyl->
set_double_param
(
"length"
,
G4DIRC::length
);
135
cyl->
set_string_param
(
"material"
,
"G4_Al"
);
136
cyl->
set_double_param
(
"thickness"
, 0.076);
137
cyl->
set_double_param
(
"place_x"
, 0.);
138
cyl->
set_double_param
(
"place_y"
, 0.);
139
cyl->
set_double_param
(
"place_z"
,
G4DIRC::z_shift
);
140
cyl->
SetActive
(0);
141
cyl->
SuperDetector
(
"DIRC"
);
142
cyl->
OverlapCheck
(OverlapCheck);
143
144
g4Reco->
registerSubsystem
(cyl);
145
}
146
// simple approximation for DIRC prism
147
PHG4ConeSubsystem
*cone =
new
PHG4ConeSubsystem
(
"DIRC_Prism"
);
148
cone->
set_color
(0, 1, 0);
149
// cone->SetR1(radiator_R, radiator_R + 20);
150
// cone->SetR2(radiator_R, radiator_R + 2);
151
152
cone->
SetR1
(radiator_R, radiator_R + 20);
153
cone->
SetR2
(radiator_R, radiator_R + 2);
154
155
cone->
SetZlength
(0.5 *
G4DIRC::z_prism
);
156
cone->
SetPlaceZ
(
G4DIRC::z_start
- 0.5 *
G4DIRC::z_prism
);
157
cone->
SetMaterial
(
"Quartz"
);
158
cone->
SetActive
(0);
159
cone->
SuperDetector
(
"DIRC"
);
160
cone->
OverlapCheck
(OverlapCheck);
161
g4Reco->
registerSubsystem
(cone);
162
}
163
// Done
164
return
G4DIRC::outer_skin_radius
;
165
}
166
#endif
fun4all_eicmacros
blob
master
common
G4_DIRC.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration