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
blob
master
dRICH
dispersion
macros
Fun4All_photonDispersion.C
G4_Disk.C
G4Setup.C
getVectors.cc
getVectors.h
TestImports
eIDML
FileSplit
MyNewAnalysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4Setup.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4Setup.C
1
#ifndef MACRO_G4SETUP_C
2
#define MACRO_G4SETUP_C
3
4
#include <
GlobalVariables.C
>
5
6
#include <
G4_BlackHole.C
>
7
#include <
G4_Magnet.C
>
8
#include "
G4_Disk.C
"
9
#include <
G4_World.C
>
10
#include <
G4_Pipe.C
>
11
12
#include <
g4main/PHG4Reco.h
>
13
#include <
g4main/PHG4TruthSubsystem.h
>
14
15
#include <phfield/PHFieldConfig.h>
16
17
#include <
g4decayer/EDecayType.hh
>
18
19
#include <
fun4all/Fun4AllServer.h
>
20
21
R__LOAD_LIBRARY
(libg4detectors.so)
22
23
using namespace mySim;
24
25
void
G4Init
()
26
{
27
DiskInit
();
28
MagnetFieldInit
();
29
BlackHoleInit
();
30
}
31
32
int
G4Setup
()
33
{
34
//---------------
35
// Fun4All server
36
//---------------
37
Fun4AllServer
*se =
Fun4AllServer::instance
();
38
39
PHG4Reco
*g4Reco =
new
PHG4Reco
();
40
g4Reco->
set_rapidity_coverage
(
dRICH_eta_coverage
.first);
41
42
WorldInit
(g4Reco);
43
44
double
fieldstrength;
45
istringstream stringline(
G4MAGNET::magfield
);
46
stringline >> fieldstrength;
47
if
(stringline.fail())
48
{
// conversion to double fails -> we have a string
49
if
(
G4MAGNET::magfield
.find(
"sphenix3dbigmapxyz"
) != string::npos ||
50
G4MAGNET::magfield
==
"CDB"
)
51
{
52
g4Reco->
set_field_map
(
G4MAGNET::magfield
,
PHFieldConfig::Field3DCartesian
);
53
}
54
else
55
{
56
g4Reco->
set_field_map
(
G4MAGNET::magfield
,
PHFieldConfig::kField2D
);
57
}
58
}
59
else
60
{
61
g4Reco->
set_field
(fieldstrength);
// use const soleniodal field
62
}
63
g4Reco->
set_field_rescale
(
G4MAGNET::magfield_rescale
);
64
65
double
radius
= 0.;
66
67
Disk
(g4Reco, radius);
68
BlackHole
(g4Reco, radius);
69
70
PHG4TruthSubsystem
*truth =
new
PHG4TruthSubsystem
();
71
g4Reco->
registerSubsystem
(truth);
72
// finally adjust the world size in case the default is too small
73
WorldSize
(g4Reco, radius);
74
75
se->
registerSubsystem
(g4Reco);
76
return
0;
77
}
78
79
#endif
analysis
blob
master
dRICH
dispersion
macros
G4Setup.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:28
using
1.8.2 with
ECCE GitHub integration