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_Beast.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Setup_Beast.C
1
#ifndef MACRO_G4SETUPBEAST_C
2
#define MACRO_G4SETUPBEAST_C
3
4
#include <GlobalVariables.C>
5
6
#include <G4_BlackHole.C>
7
#include <
G4_Magnet_Beast.C
>
8
#include <G4_Pipe_EIC.C>
9
#include <
G4_User.C
>
10
#include <
G4_World.C
>
11
12
#include <
g4decayer/EDecayType.hh
>
13
14
#include <
g4main/PHG4Reco.h
>
15
#include <
g4main/PHG4TruthSubsystem.h
>
16
17
#include <phfield/PHFieldConfig.h>
18
19
#include <
fun4all/Fun4AllDstOutputManager.h
>
20
#include <
fun4all/Fun4AllServer.h
>
21
22
R__LOAD_LIBRARY
(libg4decayer.so)
23
24
void
G4Init
()
25
{
26
// load detector/material macros and execute Init() function
27
28
if
(
Enable::PIPE
)
PipeInit
();
29
if
(
Enable::MAGNET
)
MagnetInit
();
30
MagnetFieldInit
();
// We want the field - even if the magnet volume is disabled
31
}
32
33
void
G4Setup
()
34
{
35
//---------------
36
// Fun4All server
37
//---------------
38
39
Fun4AllServer
*se =
Fun4AllServer::instance
();
40
41
PHG4Reco
*g4Reco =
new
PHG4Reco
();
42
43
WorldInit
(g4Reco);
44
45
// global coverage used for length of cylinders if lengthviarapidity is set
46
// probably needs to be adjusted for JLeic
47
g4Reco->
set_rapidity_coverage
(1.1);
48
49
if
(
G4P6DECAYER::decayType
!=
EDecayType::kAll
)
50
{
51
g4Reco->
set_force_decay
(
G4P6DECAYER::decayType
);
52
}
53
54
double
fieldstrength;
55
istringstream stringline(
G4MAGNET::magfield
);
56
stringline >> fieldstrength;
57
if
(stringline.fail())
58
{
// conversion to double fails -> we have a string
59
g4Reco->
set_field_map
(
G4MAGNET::magfield
,
PHFieldConfig::kFieldBeast
);
60
}
61
else
62
{
63
g4Reco->
set_field
(fieldstrength);
// use const soleniodal field
64
}
65
g4Reco->
set_field_rescale
(
G4MAGNET::magfield_rescale
);
66
67
double
radius
= 0.;
68
69
if
(
Enable::PIPE
) radius =
Pipe
(g4Reco, radius);
70
if
(
Enable::MAGNET
) radius =
Magnet
(g4Reco, radius);
71
if
(
Enable::USER
)
UserDetector
(g4Reco);
72
73
//----------------------------------------
74
// BLACKHOLE needs to be last
75
76
if
(
Enable::BLACKHOLE
)
BlackHole
(g4Reco, radius);
77
78
PHG4TruthSubsystem
*truth =
new
PHG4TruthSubsystem
();
79
g4Reco->
registerSubsystem
(truth);
80
// finally adjust the world size in case the default is too small
81
WorldSize
(g4Reco, radius);
82
83
se->
registerSubsystem
(g4Reco);
84
return
;
85
}
86
87
void
DstCompress
(
Fun4AllDstOutputManager
*out)
88
{
89
if
(out)
90
{
91
out->
StripNode
(
"G4HIT_PIPE"
);
92
}
93
}
94
95
#endif // MACRO_G4SETUPBEAST_C
fun4all_eicmacros
blob
master
detectors
Beast
G4Setup_Beast.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration