Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4Reco.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4Reco.h
1
// Tell emacs that this is a C++ source
2
// -*- C++ -*-.
3
#ifndef G4MAIN_PHG4RECO_H
4
#define G4MAIN_PHG4RECO_H
5
6
#include <
g4decayer/EDecayType.hh
>
7
8
#include <
fun4all/SubsysReco.h
>
9
10
#include <phfield/PHFieldConfig.h>
11
12
#include <list>
13
#include <string>
// for string
14
15
// Forward declerations
16
class
G4RunManager;
17
class
G4TBMagneticFieldSetup
;
18
class
G4UImanager;
19
class
G4UImessenger;
20
class
G4VisManager;
21
class
PHCompositeNode
;
22
class
PHG4DisplayAction
;
23
class
PHG4PhenixDetector
;
24
class
PHG4PhenixEventAction
;
25
class
PHG4PhenixStackingAction
;
26
class
PHG4PhenixSteppingAction
;
27
class
PHG4PhenixTrackingAction
;
28
class
PHG4PrimaryGeneratorAction
;
29
class
PHG4Subsystem
;
30
class
PHG4UIsession
;
31
37
class
PHG4Reco
:
public
SubsysReco
38
{
39
public
:
40
enum
DecayerOptions
41
{
42
kGEANTInternalDecayer
= 0,
43
kPYTHIA6Decayer
= 1,
44
kEvtGenDecayer
= 2,
45
46
};
// Decayer Option for User to Choose: 0 - GEANT 4 Internal Decayer (with momentum conservation issues), 1, PYTHIA 6 Decayer, 2 - EvtGen Decayer
47
49
explicit
PHG4Reco
(
const
std::string
&
name
=
"PHG4RECO"
);
50
52
~PHG4Reco
()
override
;
53
55
int
Init
(
PHCompositeNode
*)
override
;
56
57
int
InitRun
(
PHCompositeNode
*topNode)
override
;
58
60
int
process_event
(
PHCompositeNode
*)
override
;
61
63
int
ResetEvent
(
PHCompositeNode
*)
override
;
64
66
void
Print
(
const
std::string
&what =
std::string
())
const override
;
67
69
void
registerSubsystem
(
PHG4Subsystem
*subsystem)
70
{
71
m_SubsystemList
.push_back(subsystem);
72
}
73
75
int
ApplyCommand
(
const
std::string
&
cmd
);
76
78
int
StartGui
();
79
80
int
InitField
(
PHCompositeNode
*topNode);
81
83
void
set_field
(
const
float
tesla)
84
{
85
m_MagneticField
= tesla;
86
}
87
91
void
set_field_map
(
const
std::string
&fmap,
const
PHFieldConfig::FieldConfigTypes
dim
)
92
{
93
m_FieldMapFile
= fmap;
94
m_FieldConfigType
=
dim
;
95
}
96
98
void
set_field_rescale
(
const
float
rescale) {
m_MagneticFieldRescale
= rescale; }
99
100
void
set_force_decay
(
EDecayType
force_decay_type)
101
{
102
m_ActiveForceDecayFlag
=
true
;
103
m_ForceDecayType
= force_decay_type;
104
}
105
106
void
set_decayer
(
DecayerOptions
type
) {
m_Decayer
=
type
; }
107
109
void
export_geometry
(
bool
b
,
const
std::string
&
filename
=
"sPHENIXGeom.root"
)
110
{
111
m_ExportGeometry
=
b
;
112
m_ExportGeomFilename
=
filename
;
113
}
114
116
void
save_DST_geometry
(
bool
b
) {
m_SaveDstGeometryFlag
=
b
; }
117
void
SetWorldSizeX
(
const
double
sx) {
m_WorldSize
[0] = sx; }
118
void
SetWorldSizeY
(
const
double
sy) {
m_WorldSize
[1] = sy; }
119
void
SetWorldSizeZ
(
const
double
sz) {
m_WorldSize
[2] = sz; }
120
double
GetWorldSizeX
()
const
{
return
m_WorldSize
[0]; }
121
double
GetWorldSizeY
()
const
{
return
m_WorldSize
[1]; }
122
double
GetWorldSizeZ
()
const
{
return
m_WorldSize
[2]; }
123
void
SetWorldShape
(
const
std::string
&
s
) {
m_WorldShape
=
s
; }
124
void
SetWorldMaterial
(
const
std::string
&
s
) {
m_WorldMaterial
=
s
; }
125
void
SetPhysicsList
(
const
std::string
&
s
) {
m_PhysicsList
=
s
; }
126
void
set_rapidity_coverage
(
const
double
eta
);
127
128
int
setupInputEventNodeReader
(
PHCompositeNode
*);
129
130
static
void
G4Seed
(
const
unsigned
int
i
);
131
132
PHG4Subsystem
*
getSubsystem
(
const
std::string
&
name
);
133
PHG4DisplayAction
*
GetDisplayAction
() {
return
m_DisplayAction
; }
134
void
Dump_GDML
(
const
std::string
&
filename
);
135
void
Dump_G4_GDML
(
const
std::string
&
filename
);
136
137
void
G4Verbosity
(
const
int
i
);
138
140
void
setDisableUserActions
(
bool
b
=
true
) {
m_disableUserActions
=
b
; }
141
void
ApplyDisplayAction
();
142
143
void
CustomizeEvtGenDecay
(
const
std::string
&
DecayFile
)
144
{
145
EvtGenDecayFile
=
DecayFile
;
146
if
(!
EvtGenDecayFile
.empty())
CustomizeDecay
=
true
;
147
}
148
149
private
:
150
static
void
g4guithread
(
void
*ptr);
151
int
InitUImanager
();
152
void
DefineMaterials
();
153
void
DefineRegions
();
154
155
float
m_MagneticField
= 0.;
156
float
m_MagneticFieldRescale
= 1.0;
157
double
m_WorldSize
[3]{1000., 1000., 1000.};
158
160
G4TBMagneticFieldSetup
*
m_Field
=
nullptr
;
161
163
G4RunManager *
m_RunManager
=
nullptr
;
164
166
PHG4UIsession
*
m_UISession
=
nullptr
;
167
169
PHG4PhenixDetector
*
m_Detector
=
nullptr
;
170
172
PHG4PhenixEventAction
*
m_EventAction
=
nullptr
;
173
175
PHG4PhenixStackingAction
*
m_StackingAction
=
nullptr
;
176
178
PHG4PhenixSteppingAction
*
m_SteppingAction
=
nullptr
;
179
181
PHG4PhenixTrackingAction
*
m_TrackingAction
=
nullptr
;
182
184
185
PHG4DisplayAction
*
m_DisplayAction
=
nullptr
;
186
188
PHG4PrimaryGeneratorAction
*
m_GeneratorAction
=
nullptr
;
189
191
std::list<PHG4Subsystem *>
m_SubsystemList
;
192
193
// visualization
194
G4VisManager *
m_VisManager
=
nullptr
;
195
196
// Message interface to Fun4All
197
G4UImessenger *
m_Fun4AllMessenger
=
nullptr
;
198
199
// for the G4 cmd line interface
200
G4UImanager *
m_UImanager
=
nullptr
;
201
double
m_EtaCoverage
= 1.0;
202
PHFieldConfig::FieldConfigTypes
m_FieldConfigType
=
PHFieldConfig::kFieldUniform
;
203
std::string
m_FieldMapFile
=
"NONE"
;
204
std::string
m_WorldShape
=
"G4Tubs"
;
205
std::string
m_WorldMaterial
=
"G4_AIR"
;
206
std::string
m_PhysicsList
=
"FTFP_BERT"
;
207
208
bool
m_ExportGeometry
=
false
;
209
std::string
m_ExportGeomFilename
=
"sPHENIXGeom.root"
;
210
211
// settings for the external Pythia6 decayer
212
// bool m_ActiveDecayerFlag = true; //< turn on/off decayer
213
bool
m_ActiveForceDecayFlag
=
false
;
//< turn on/off force decay channels
214
215
DecayerOptions
m_Decayer
=
kEvtGenDecayer
;
// Here we use EvtGen as default
216
std::string
EvtGenDecayFile
=
""
;
217
bool
CustomizeDecay
=
false
;
218
219
EDecayType
m_ForceDecayType
=
kAll
;
//< forced decay channel setting
220
221
bool
m_SaveDstGeometryFlag
=
true
;
222
bool
m_disableUserActions
=
false
;
223
};
224
225
#endif
coresoftware
blob
master
simulation
g4simulation
g4main
PHG4Reco.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:15
using
1.8.2 with
sPHENIX GitHub integration