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_Babar.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Setup_Babar.C
1
#ifndef MACRO_G4SETUPBABAR_C
2
#define MACRO_G4SETUPBABAR_C
3
4
#include "GlobalVariables.C"
5
6
#include "G4_BlackHole.C"
7
#include "
G4_Magnet.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
30
//----------------------------------------
31
// MAGNET
32
33
if
(
Enable::MAGNET
)
MagnetInit
();
34
}
35
36
void
G4Setup
()
37
{
38
//---------------
39
// Fun4All server
40
//---------------
41
42
Fun4AllServer
*se =
Fun4AllServer::instance
();
43
44
PHG4Reco
*g4Reco =
new
PHG4Reco
();
45
46
WorldInit
(g4Reco);
47
48
// global coverage used for length of cylinders if lengthviarapidity is set
49
// probably needs to be adjusted for JLeic
50
g4Reco->
set_rapidity_coverage
(1.1);
51
52
if
(
G4P6DECAYER::decayType
!=
EDecayType::kAll
)
53
{
54
g4Reco->
set_force_decay
(
G4P6DECAYER::decayType
);
55
}
56
57
double
fieldstrength;
58
istringstream stringline(
G4MAGNET::magfield
);
59
stringline >> fieldstrength;
60
if
(stringline.fail())
61
{
// conversion to double fails -> we have a string
62
g4Reco->
set_field_map
(
G4MAGNET::magfield
,
PHFieldConfig::kField2D
);
63
}
64
else
65
{
66
g4Reco->
set_field
(fieldstrength);
// use const soleniodal field
67
}
68
g4Reco->
set_field_rescale
(
G4MAGNET::magfield_rescale
);
69
70
double
radius
= 0.;
71
72
//----------------------------------------
73
// PIPE
74
if
(
Enable::PIPE
) radius =
Pipe
(g4Reco, radius);
75
76
//----------------------------------------
77
// MAGNET
78
79
if
(
Enable::MAGNET
) radius =
Magnet
(g4Reco, radius);
80
81
if
(
Enable::USER
)
UserDetector
(g4Reco);
82
83
//----------------------------------------
84
// BLACKHOLE
85
86
if
(
Enable::BLACKHOLE
)
BlackHole
(g4Reco, radius);
87
88
PHG4TruthSubsystem
*truth =
new
PHG4TruthSubsystem
();
89
g4Reco->
registerSubsystem
(truth);
90
// finally adjust the world size in case the default is too small
91
WorldSize
(g4Reco, radius);
92
93
se->
registerSubsystem
(g4Reco);
94
return
;
95
}
96
97
void
DstCompress
(
Fun4AllDstOutputManager
*out)
98
{
99
if
(out)
100
{
101
out->
StripNode
(
"G4HIT_PIPE"
);
102
}
103
}
104
105
#endif // MACRO_G4SETUPBABAR_C
fun4all_eic_tutorials
blob
master
detectors
Babar
G4Setup_Babar.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:51
using
1.8.2 with
EIC GitHub integration