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
G4Setup_JLeic.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Setup_JLeic.C
1
#ifndef MACRO_G4SETUPJLEIC_C
2
#define MACRO_G4SETUPJLEIC_C
3
4
#include <GlobalVariables.C>
5
6
#include <
G4_Barrel_Hcal_JLeic.C
>
7
#include <
G4_BeamLine_JLeic.C
>
8
#include <G4_BlackHole.C>
9
#include <
G4_CTD_JLeic.C
>
10
#include <
G4_DIRC_JLeic.C
>
11
#include <
G4_DRich_JLeic.C
>
12
#include <
G4_EndCap_Electron_JLeic.C
>
13
#include <
G4_EndCap_Hadron_JLeic.C
>
14
#include <
G4_Gem_JLeic.C
>
15
#include <G4_Magnet_Cleo.C>
16
#include <G4_Pipe_EIC.C>
17
#include <
G4_User.C
>
18
#include <
G4_VTX_JLeic.C
>
19
#include <
G4_World.C
>
20
21
#include <
g4decayer/EDecayType.hh
>
22
23
#include <
g4main/PHG4Reco.h
>
24
#include <
g4main/PHG4TruthSubsystem.h
>
25
26
#include <phfield/PHFieldConfig.h>
27
28
#include <
fun4all/Fun4AllDstOutputManager.h
>
29
#include <
fun4all/Fun4AllServer.h
>
30
31
R__LOAD_LIBRARY
(libg4decayer.so)
32
33
void
G4Init
()
34
{
35
// load detector/material macros and execute Init() function
36
37
if
(
Enable::PIPE
)
PipeInit
();
38
if
(
Enable::VTX
)
VTXInit
();
39
if
(
Enable::CTD
)
CTDInit
();
40
if
(
Enable::MAGNET
)
MagnetInit
();
41
MagnetFieldInit
();
// We want the field - even if the magnet volume is disabled
42
if
(
Enable::GEM
)
GemInit
();
43
if
(
Enable::DIRC
)
JLDIRCInit
();
44
if
(
Enable::BARREL_HCAL
)
Barrel_HcalInit
();
45
if
(
Enable::DRICH
)
DRichInit
();
46
if
(
Enable::ENDCAP_ELECTRON
)
EndCap_ElectronInit
();
47
if
(
Enable::ENDCAP_HADRON
)
EndCap_HadronInit
();
48
if
(
Enable::BEAMLINE
)
BeamLineInit
();
49
}
50
51
void
G4Setup
()
52
{
53
//---------------
54
// Fun4All server
55
//---------------
56
57
Fun4AllServer
*se =
Fun4AllServer::instance
();
58
59
PHG4Reco
*g4Reco =
new
PHG4Reco
();
60
61
WorldInit
(g4Reco);
62
63
// global coverage used for length of cylinders if lengthviarapidity is set
64
// probably needs to be adjusted for JLeic
65
g4Reco->
set_rapidity_coverage
(1.1);
66
67
if
(
G4P6DECAYER::decayType
!=
EDecayType::kAll
)
68
{
69
g4Reco->
set_force_decay
(
G4P6DECAYER::decayType
);
70
}
71
72
double
fieldstrength;
73
istringstream stringline(
G4MAGNET::magfield
);
74
stringline >> fieldstrength;
75
if
(stringline.fail())
76
{
// conversion to double fails -> we have a string
77
78
g4Reco->
set_field_map
(
G4MAGNET::magfield
,
PHFieldConfig::kFieldCleo
);
79
}
80
else
81
{
82
g4Reco->
set_field
(fieldstrength);
// use const soleniodal field
83
}
84
g4Reco->
set_field_rescale
(
G4MAGNET::magfield_rescale
);
85
86
double
radius
= 0.;
87
88
if
(
Enable::PIPE
) radius =
Pipe
(g4Reco, radius);
89
if
(
Enable::VTX
) radius =
VTX
(g4Reco, radius);
90
if
(
Enable::CTD
) radius =
CTD
(g4Reco, radius);
91
if
(
Enable::DIRC
) radius =
JLDIRC
(g4Reco, radius);
92
if
(
Enable::MAGNET
) radius =
Magnet
(g4Reco, radius);
93
if
(
Enable::BARREL_HCAL
) radius =
Barrel_Hcal
(g4Reco, radius);
94
if
(
Enable::GEM
)
Gem
(g4Reco);
95
if
(
Enable::DRICH
)
DRich
(g4Reco);
96
if
(
Enable::ENDCAP_ELECTRON
)
EndCap_Electron
(g4Reco);
97
if
(
Enable::ENDCAP_HADRON
)
EndCap_Hadron
(g4Reco);
98
if
(
Enable::BEAMLINE
)
BeamLine
(g4Reco);
99
if
(
Enable::USER
)
UserDetector
(g4Reco);
100
101
//----------------------------------------
102
// BLACKHOLE needs to be last
103
104
if
(
Enable::BLACKHOLE
)
BlackHole
(g4Reco, radius);
105
106
PHG4TruthSubsystem
*truth =
new
PHG4TruthSubsystem
();
107
g4Reco->
registerSubsystem
(truth);
108
// finally adjust the world size in case the default is too small
109
WorldSize
(g4Reco, radius);
110
111
se->
registerSubsystem
(g4Reco);
112
return
;
113
}
114
115
void
DstCompress
(
Fun4AllDstOutputManager
*out)
116
{
117
if
(out)
118
{
119
out->
StripNode
(
"G4HIT_PIPE"
);
120
}
121
}
122
123
#endif // MACRO_G4SETUPJLEIC_C
fun4all_eicmacros
blob
master
detectors
JLeic
G4Setup_JLeic.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration