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
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
blob
master
common
DisplayOn.C
ECCEStyle.C
ECCEStyle.h
G4_Aerogel.C
G4_AllSilicon.C
G4_B0ECAL.C
G4_B0Tracking_EIC.C
G4_Barrel_EIC.C
G4_Bbc.C
G4_BECAL.C
G4_BlackHole.C
G4_BMMG.C
G4_BToF.C
G4_BWD.C
G4_CEmc_Albedo.C
G4_CEmc_EIC.C
G4_CEmc_Spacal.C
G4_DIRC.C
G4_DRCALO.C
G4_dRICH.C
G4_DSTReader_EICDetector.C
G4_EEMC.C
G4_EEMC_hybrid.C
G4_EHCAL.C
G4_EToF.C
G4_EventEvaluator.C
G4_FEMC.C
G4_FEMC_EIC.C
G4_FHCAL.C
G4_FST_EIC.C
G4_FwdJets.C
G4_GEM_EIC.C
G4_Global.C
G4_HcalIn_ref.C
G4_HcalOut_ref.C
G4_hFarBwdBeamLine_EIC.C
G4_hFarFwdBeamLine_EIC.C
G4_HToF.C
G4_Input.C
G4_Jets.C
G4_KFParticle.C
G4_LFHCAL.C
G4_Magnet.C
G4_Micromegas.C
G4_mRICH.C
G4_mRwell_EIC.C
G4_Mvtx_EIC.C
G4_ParticleFlow.C
G4_Pipe.C
G4_Pipe_EIC.C
G4_Piston.C
G4_PlugDoor.C
G4_PlugDoor_EIC.C
G4_Production.C
G4_PSTOF.C
G4_RICH.C
G4_TopoClusterReco.C
G4_TPC_EIC.C
G4_Tracking_EIC.C
G4_TrackingSupport.C
G4_TRD.C
G4_TTL_EIC.C
G4_User.C
G4_World.C
GlobalVariables.C
QA.C
sPhenixStyle.C
sPhenixStyle.h
detectors
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4_Pipe_EIC.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_Pipe_EIC.C
1
#ifndef MACRO_G4PIPEEIC_C
2
#define MACRO_G4PIPEEIC_C
3
4
#include <
GlobalVariables.C
>
5
6
#include <
g4detectors/PHG4CylinderSubsystem.h
>
7
#include <
g4detectors/PHG4GDMLSubsystem.h
>
8
9
#include <
g4main/PHG4Reco.h
>
10
11
#include <TSystem.h>
12
13
R__LOAD_LIBRARY
(libg4detectors.so)
14
15
// This creates the Enable Flag to be used in the main steering macro
16
namespace Enable
17
{
18
bool
PIPE
=
false
;
19
bool
PIPE_ABSORBER
=
false
;
20
bool
PIPE_OVERLAPCHECK
=
false
;
21
int
PIPE_VERBOSITY
= 0;
22
}
// namespace Enable
23
24
namespace
G4PIPE
25
{
26
// Central pipe dimension
27
// Extracted via mechanical model: Detector chamber 3-20-20
28
// directly implimenting the central Be section in G4 cylinder for max speed simulation in the detector region.
29
// The jointer lip structure of the pipe R = 3.2cm x L=5mm is ignored here
30
double
be_pipe_radius
= 3.1000;
31
double
Au_coating_thickness
= 2
e
-4;
// 2um Au coating
32
double
be_pipe_thickness
= 3.1762 -
be_pipe_radius
;
// 760 um for sPHENIX
33
double
be_pipe_length_plus
= 66.8;
// +z beam pipe extend.
34
double
be_pipe_length_neg
= -79.8;
// -z beam pipe extend.
35
bool
use_forward_pipes
=
true
;
36
}
// namespace G4PIPE
37
38
void
PipeInit
()
39
{
40
if
(
G4PIPE::use_forward_pipes
)
41
{
42
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
, 23.);
43
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
, 500.);
44
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
, -463.);
45
}
46
else
47
{
48
BlackHoleGeometry::max_radius
=
std::max
(
BlackHoleGeometry::max_radius
,
G4PIPE::be_pipe_radius
+
G4PIPE::be_pipe_thickness
);
49
BlackHoleGeometry::max_z
=
std::max
(
BlackHoleGeometry::max_z
,
G4PIPE::be_pipe_length_plus
);
50
BlackHoleGeometry::min_z
=
std::min
(
BlackHoleGeometry::min_z
,
G4PIPE::be_pipe_length_neg
);
51
}
52
}
53
55
double
Pipe
(
PHG4Reco
* g4Reco,
56
double
radius
)
57
{
58
bool
AbsorberActive =
Enable::ABSORBER
||
Enable::PIPE_ABSORBER
;
59
bool
OverlapCheck =
Enable::PIPE_OVERLAPCHECK
or
Enable::OVERLAPCHECK
;
// || to suppress GDML validation messages
60
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::PIPE_VERBOSITY
);
61
// process pipe extentions?
62
const
bool
do_pipe_hadron_forward_extension =
G4PIPE::use_forward_pipes
&&
true
;
63
const
bool
do_pipe_electron_forward_extension =
G4PIPE::use_forward_pipes
&&
true
;
64
65
const
double
be_pipe_length
=
G4PIPE::be_pipe_length_plus
-
G4PIPE::be_pipe_length_neg
;
// pipe length
66
const
double
be_pipe_center = 0.5 * (
G4PIPE::be_pipe_length_plus
+
G4PIPE::be_pipe_length_neg
);
67
68
if
(radius >
G4PIPE::be_pipe_radius
)
69
{
70
cout <<
"inconsistency: radius: "
<< radius
71
<<
" larger than pipe inner radius: "
<<
G4PIPE::be_pipe_radius
<< endl;
72
gSystem->Exit(-1);
73
}
74
75
// mid-rapidity beryillium pipe
76
PHG4CylinderSubsystem
* cyl =
new
PHG4CylinderSubsystem
(
"VAC_BE_PIPE"
, 0);
77
cyl->
set_double_param
(
"radius"
, 0.0);
78
cyl->
set_int_param
(
"lengthviarapidity"
, 0);
79
cyl->
set_double_param
(
"length"
, be_pipe_length);
80
cyl->
set_double_param
(
"place_z"
, be_pipe_center);
81
cyl->
set_string_param
(
"material"
,
"G4_Galactic"
);
82
cyl->
set_double_param
(
"thickness"
,
G4PIPE::be_pipe_radius
-
G4PIPE::Au_coating_thickness
);
83
cyl->
SuperDetector
(
"PIPE"
);
84
cyl->
OverlapCheck
(OverlapCheck);
85
g4Reco->
registerSubsystem
(cyl);
86
87
// 2um Au coating for X-ray absorption
88
cyl =
new
PHG4CylinderSubsystem
(
"Au_PIPE"
, 2);
89
cyl->
set_double_param
(
"radius"
,
G4PIPE::be_pipe_radius
-
G4PIPE::Au_coating_thickness
);
90
cyl->
set_int_param
(
"lengthviarapidity"
, 0);
91
cyl->
set_double_param
(
"length"
, be_pipe_length);
92
cyl->
set_double_param
(
"place_z"
, be_pipe_center);
93
cyl->
set_string_param
(
"material"
,
"G4_Au"
);
94
cyl->
set_double_param
(
"thickness"
,
G4PIPE::Au_coating_thickness
);
95
cyl->
SuperDetector
(
"PIPE"
);
96
cyl->
OverlapCheck
(OverlapCheck);
97
if
(AbsorberActive) cyl->
SetActive
();
98
g4Reco->
registerSubsystem
(cyl);
99
100
cyl =
new
PHG4CylinderSubsystem
(
"BE_PIPE"
, 1);
101
cyl->
set_double_param
(
"radius"
,
G4PIPE::be_pipe_radius
);
102
cyl->
set_int_param
(
"lengthviarapidity"
, 0);
103
cyl->
set_double_param
(
"length"
, be_pipe_length);
104
cyl->
set_double_param
(
"place_z"
, be_pipe_center);
105
cyl->
set_string_param
(
"material"
,
"G4_Be"
);
106
cyl->
set_double_param
(
"thickness"
,
G4PIPE::be_pipe_thickness
);
107
cyl->
SuperDetector
(
"PIPE"
);
108
cyl->
OverlapCheck
(OverlapCheck);
109
if
(AbsorberActive) cyl->
SetActive
();
110
g4Reco->
registerSubsystem
(cyl);
111
112
radius =
G4PIPE::be_pipe_radius
+
G4PIPE::be_pipe_thickness
;
113
114
radius +=
no_overlapp
;
115
116
if
(do_pipe_electron_forward_extension)
117
{
118
if
(
Enable::IP6
)
119
{
120
PHG4GDMLSubsystem
* gdml =
new
PHG4GDMLSubsystem
(
"ElectronForwardChamber"
);
121
gdml->
set_string_param
(
"GDMPath"
,
string
(getenv(
"CALIBRATIONROOT"
)) +
"/Beam/ConstructSimplifiedBeamChamber.gdml"
);
122
gdml->
set_string_param
(
"TopVolName"
,
"ElectronForwardChamber"
);
123
gdml->
OverlapCheck
(OverlapCheck);
124
g4Reco->
registerSubsystem
(gdml);
125
}
126
if
(
Enable::IP8
)
127
{
128
cout <<__PRETTY_FUNCTION__<<
" IP8 beam chamber not defined yet! Consider disable G4PIPE::use_forward_pipes"
<<endl;
129
exit
(1);
130
}
131
}
132
133
if
(do_pipe_hadron_forward_extension)
134
{
135
if
(
Enable::IP6
)
136
{
137
PHG4GDMLSubsystem
* gdml =
new
PHG4GDMLSubsystem
(
"HadronForwardChamber"
);
138
gdml->
set_string_param
(
"GDMPath"
,
string
(getenv(
"CALIBRATIONROOT"
)) +
"/Beam/ConstructSimplifiedBeamChamber.gdml"
);
139
gdml->
set_string_param
(
"TopVolName"
,
"HadronForwardChamber"
);
140
gdml->
OverlapCheck
(OverlapCheck);
141
g4Reco->
registerSubsystem
(gdml);
142
}
143
if
(
Enable::IP8
)
144
{
145
cout <<__PRETTY_FUNCTION__<<
" IP8 beam chamber not defined yet! Consider disable G4PIPE::use_forward_pipes"
<<endl;
146
exit
(1);
147
}
148
}
149
150
return
radius
;
151
}
152
#endif
macros
blob
master
common
G4_Pipe_EIC.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:58
using
1.8.2 with
ECCE GitHub integration