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_Barrel_Hcal_JLeic.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_Barrel_Hcal_JLeic.C
1
#ifndef MACRO_G4BARRELHCALJLEIC_C
2
#define MACRO_G4BARRELHCALJLEIC_C
3
4
#include <GlobalVariables.C>
5
6
#include <
g4detectors/PHG4CylinderSubsystem.h
>
7
#include <
g4main/PHG4Reco.h
>
8
9
R__LOAD_LIBRARY
(libg4detectors.so)
10
11
namespace Enable
12
{
13
bool
BARREL_HCAL
=
false
;
14
}
15
16
namespace
G4BARRELHCAL
17
{
18
double
inner_radius
= 144.;
19
double
outer_radius
=
inner_radius
+ 100.;
20
double
length
= 460.;
21
}
// namespace G4BARRELHCAL
22
23
void
Barrel_HcalInit
()
24
{
25
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
,
G4BARRELHCAL::outer_radius
);
26
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
,
G4BARRELHCAL::length
/ 2.);
27
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
, -
G4BARRELHCAL::length
/ 2.);
28
}
29
30
double
Barrel_Hcal
(
PHG4Reco
* g4Reco,
31
double
radius
)
32
{
33
// here is our silicon:
34
double
gap
= 2.;
35
double
thickness
= 2.;
// cm
36
if
(radius >
G4BARRELHCAL::inner_radius
)
37
{
38
cout <<
"inconsistency: radius: "
<< radius
39
<<
" larger than Barrel Hcal inner radius: "
<<
G4BARRELHCAL::inner_radius
<< endl;
40
gSystem->Exit(-1);
41
}
42
43
PHG4CylinderSubsystem
* cyl;
44
radius =
G4BARRELHCAL::inner_radius
;
45
for
(
int
ilayer = 0; ilayer < 25; ilayer++)
46
{
47
if
(radius >
G4BARRELHCAL::outer_radius
)
48
{
49
continue
;
50
}
51
cyl =
new
PHG4CylinderSubsystem
(
"BARRELHCAL"
, ilayer);
52
cyl->
set_double_param
(
"radius"
, radius);
53
cyl->
set_string_param
(
"material"
,
"G4_Fe"
);
54
cyl->
set_double_param
(
"thickness"
, thickness);
55
cyl->
set_double_param
(
"length"
,
G4BARRELHCAL::length
);
56
cyl->
SetActive
();
57
cyl->
SuperDetector
(
"BARRELHCAL"
);
58
g4Reco->
registerSubsystem
(cyl);
59
radius += gap +
thickness
;
60
}
61
return
G4BARRELHCAL::outer_radius
;
62
}
63
#endif // MACRO_G4BARRELHCALJLEIC_C
fun4all_eicmacros
blob
master
common
G4_Barrel_Hcal_JLeic.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration