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_Magnet_Cleo.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_Magnet_Cleo.C
1
#ifndef MACRO_G4MAGNETJLEIC_C
2
#define MACRO_G4MAGNETJLEIC_C
3
4
#include "GlobalVariables.C"
5
6
#include <
g4detectors/PHG4CylinderSubsystem.h
>
7
8
#include <
g4main/PHG4Reco.h
>
9
10
R__LOAD_LIBRARY
(libg4detectors.so)
11
12
namespace Enable
13
{
14
bool
MAGNET
=
false
;
15
bool
MAGNET_ABSORBER
=
false
;
16
bool
MAGNET_OVERLAPCHECK
=
false
;
17
int
MAGNET_VERBOSITY
= 0;
18
}
// namespace Enable
19
20
namespace
G4MAGNET
21
{
22
double
magnet_inner_radius
= 130.;
23
double
magnet_outer_radius
= 143.;
24
double
magnet_length
= 400.;
25
double
magfield_rescale
= 1;
26
string
magfield
= string(getenv(
"CALIBRATIONROOT"
)) + string(
"/Field/Map/SolenoidMag3D.TABLE"
);
27
28
}
// namespace G4MAGNET
29
30
void
MagnetInit
()
31
{
32
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
,
G4MAGNET::magnet_outer_radius
);
33
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
,
G4MAGNET::magnet_length
/ 2.);
34
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
, -
G4MAGNET::magnet_length
/ 2.);
35
}
36
37
double
Magnet
(
PHG4Reco
* g4Reco,
38
double
radius
)
39
{
40
bool
AbsorberActive =
Enable::ABSORBER
||
Enable::MAGNET_ABSORBER
;
41
bool
OverlapCheck =
Enable::OVERLAPCHECK
||
Enable::MAGNET_OVERLAPCHECK
;
42
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::MAGNET_VERBOSITY
);
43
44
if
(radius >
G4MAGNET::magnet_inner_radius
)
45
{
46
cout <<
"inconsistency: radius: "
<< radius
47
<<
" larger than Magnet inner radius: "
<<
G4MAGNET::magnet_inner_radius
<< endl;
48
gSystem->Exit(-1);
49
}
50
51
// right now Cleo is a massive Al cylinder which is likely not correct
52
// need to know the radiation length and adjust the material for that
53
// or get an idea about the actual cleo magnet design
54
radius =
G4MAGNET::magnet_inner_radius
;
55
PHG4CylinderSubsystem
* cyl =
new
PHG4CylinderSubsystem
(
"MAGNET"
, 0);
56
cyl->
set_double_param
(
"radius"
,
G4MAGNET::magnet_inner_radius
);
57
cyl->
set_double_param
(
"length"
,
G4MAGNET::magnet_length
);
58
cyl->
set_double_param
(
"thickness"
,
G4MAGNET::magnet_outer_radius
-
G4MAGNET::magnet_inner_radius
);
59
cyl->
set_string_param
(
"material"
,
"Al5083"
);
60
cyl->
SuperDetector
(
"MAGNET"
);
61
if
(AbsorberActive) cyl->
SetActive
();
62
g4Reco->
registerSubsystem
(cyl);
63
64
radius =
G4MAGNET::magnet_outer_radius
;
// outside of magnet
65
66
if
(verbosity > 0)
67
{
68
cout <<
"========================= G4_Magnet.C::Magnet() ==========================="
<< endl;
69
cout <<
" MAGNET Material Description:"
<< endl;
70
cout <<
" inner radius = "
<<
G4MAGNET::magnet_inner_radius
<<
" cm"
<< endl;
71
cout <<
" outer radius = "
<<
G4MAGNET::magnet_outer_radius
<<
" cm"
<< endl;
72
cout <<
" length = "
<<
G4MAGNET::magnet_length
<<
" cm"
<< endl;
73
cout <<
"==========================================================================="
<< endl;
74
}
75
76
radius +=
no_overlapp
;
77
78
return
radius
;
79
}
80
81
#endif // MACRO_G4MAGNETJLEIC_C
fun4all_eic_tutorials
blob
master
detectors
Cleo
G4_Magnet_Cleo.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration