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
G4_Tracking_LBL.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_Tracking_LBL.C
1
#ifndef MACRO_G4TRACKINGLBL_C
2
#define MACRO_G4TRACKINGLBL_C
3
4
#include <GlobalVariables.C>
5
6
#include <
G4_AllSilicon.C
>
7
#include <
G4_CEmc_EIC.C
>
8
#include <
G4_FEMC_EIC.C
>
9
#include <
G4_FHCAL.C
>
10
11
#include <
g4trackfastsim/PHG4TrackFastSim.h
>
12
13
#include <
trackreco/PHRaveVertexing.h
>
14
15
#include <
g4trackfastsim/PHG4TrackFastSimEval.h
>
16
17
#include <
fun4all/Fun4AllServer.h
>
18
19
#include <vector>
20
21
R__LOAD_LIBRARY
(libtrack_reco.so)
22
R__LOAD_LIBRARY
(libg4trackfastsim.so)
23
24
namespace Enable
25
{
26
bool
TRACKING
=
false
;
27
bool
TRACKING_EVAL
=
false
;
28
int
TRACKING_VERBOSITY
= 0;
29
}
// namespace Enable
30
31
namespace
G4TRACKING
32
{
33
bool
DISPLACED_VERTEX
=
false
;
34
bool
PROJECTION_CEMC
=
false
;
35
bool
PROJECTION_FEMC
=
false
;
36
bool
PROJECTION_FHCAL
=
false
;
37
}
// namespace G4TRACKING
38
39
//-----------------------------------------------------------------------------//
40
void
TrackingInit
()
41
{
42
TRACKING::TrackNodeName
=
"TrackMap"
;
43
}
44
//-----------------------------------------------------------------------------//
45
void
Tracking_Reco
()
46
{
47
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::TRACKING_VERBOSITY
);
48
//---------------
49
// Fun4All server
50
//---------------
51
52
Fun4AllServer
*se =
Fun4AllServer::instance
();
53
54
PHG4TrackFastSim
*kalman =
new
PHG4TrackFastSim
(
"PHG4TrackFastSim"
);
55
// kalman->Verbosity();
56
// kalman->Smearing(false);
57
if
(
G4TRACKING::DISPLACED_VERTEX
)
58
{
59
// do not use truth vertex in the track fitting,
60
// which would lead to worse momentum resolution for prompt tracks
61
// but this allows displaced track analysis including DCA and vertex finding
62
kalman->
set_use_vertex_in_fitting
(
false
);
63
kalman->
set_vertex_xy_resolution
(0);
// do not smear the vertex used in the built-in DCA calculation
64
kalman->
set_vertex_z_resolution
(0);
// do not smear the vertex used in the built-in DCA calculation
65
kalman->
enable_vertexing
(
true
);
// enable vertex finding and fitting
66
}
67
else
68
{
69
// constraint to a primary vertex and use it as part of the fitting level arm
70
kalman->
set_use_vertex_in_fitting
(
true
);
71
kalman->
set_vertex_xy_resolution
(50
e
-4);
72
kalman->
set_vertex_z_resolution
(50
e
-4);
73
}
74
75
kalman->
set_use_vertex_in_fitting
(
false
);
76
kalman->
set_sub_top_node_name
(
"TRACKS"
);
77
kalman->
set_trackmap_out_name
(
TRACKING::TrackNodeName
);
78
79
char
nodename[100];
80
//-------------------------
81
// Barrel
82
//-------------------------
83
if
(
Enable::ALLSILICON
)
84
{
85
// CENTRAL BARREL
86
for
(
int
i = 10; i < 16; i++)
87
{
88
sprintf(nodename,
"G4HIT_LBLVTX_CENTRAL_%d"
, i);
89
kalman->
add_phg4hits
(
90
nodename,
// const std::string& phg4hitsNames
91
PHG4TrackFastSim::Cylinder
,
// const DETECTOR_TYPE phg4dettype
92
999.,
// radial-resolution [cm] (this number is not used in cylindrical geometry)
93
5.8
e
-4,
// azimuthal (arc-length) resolution [cm]
94
5.8
e
-4,
// longitudinal (z) resolution [cm]
95
1,
// efficiency (fraction)
96
0
// hit noise
97
);
98
}
99
// FORWARD DISKS
100
for
(
int
i = 20; i < 25; i++)
101
{
102
sprintf(nodename,
"G4HIT_LBLVTX_FORWARD_%d"
, i);
103
kalman->
add_phg4hits
(
104
nodename,
// const std::string& phg4hitsNames
105
PHG4TrackFastSim::Vertical_Plane
,
// const DETECTOR_TYPE phg4dettype
106
5.8
e
-4,
// radial-resolution [cm]
107
5.8
e
-4,
// azimuthal (arc-length) resolution [cm]
108
999.,
// longitudinal (z) resolution [cm] (this number is not used in vertical plane geometry)
109
1,
// efficiency (fraction)
110
0
// hit noise
111
);
112
}
113
// BACKWARD DISKS
114
for
(
int
i = 30; i < 35; i++)
115
{
116
sprintf(nodename,
"G4HIT_LBLVTX_BACKWARD_%d"
, i);
117
kalman->
add_phg4hits
(
118
nodename,
// const std::string& phg4hitsNames
119
PHG4TrackFastSim::Vertical_Plane
,
// const DETECTOR_TYPE phg4dettype
120
5.8
e
-4,
// radial-resolution [cm]
121
5.8
e
-4,
// azimuthal (arc-length) resolution [cm]
122
999.,
// longitudinal (z) resolution [cm] (this number is not used in vertical plane geometry)
123
1,
// efficiency (fraction)
124
0
// hit noise
125
);
126
}
127
}
128
//-------------------------
129
// FEMC
130
//-------------------------
131
// Saved track states (projections)
132
if
(
Enable::FEMC
&&
G4TRACKING::PROJECTION_FEMC
)
133
{
134
kalman->
add_state_name
(
"FEMC"
);
135
}
136
137
//-------------------------
138
// FHCAL
139
//-------------------------
140
if
(
Enable::FHCAL
&&
G4TRACKING::PROJECTION_FHCAL
)
141
{
142
kalman->
add_state_name
(
"FHCAL"
);
143
}
144
//-------------------------
145
// CEMC
146
//-------------------------
147
148
if
(
Enable::CEMC
&&
G4TRACKING::PROJECTION_CEMC
)
149
{
150
kalman->
add_state_name
(
"CEMC"
);
151
}
152
se->
registerSubsystem
(kalman);
153
154
return
;
155
}
156
157
//-----------------------------------------------------------------------------//
158
159
void
Tracking_Eval
(
const
std::string &
outputfile
)
160
{
161
int
verbosity =
std::max
(
Enable::VERBOSITY
,
Enable::TRACKING_VERBOSITY
);
162
//---------------
163
// Fun4All server
164
//---------------
165
166
Fun4AllServer
*se =
Fun4AllServer::instance
();
167
168
//----------------
169
// Fast Tracking evaluation
170
//----------------
171
172
PHG4TrackFastSimEval
*fast_sim_eval =
new
PHG4TrackFastSimEval
(
"FastTrackingEval"
);
173
fast_sim_eval->
set_trackmapname
(
TRACKING::TrackNodeName
);
174
fast_sim_eval->
set_filename
(outputfile);
175
se->
registerSubsystem
(fast_sim_eval);
176
}
177
#endif
fun4all_eicmacros
blob
master
common
G4_Tracking_LBL.C
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:53
using
1.8.2 with
EIC GitHub integration