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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
G4_B0Tracking_EIC.C
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file G4_B0Tracking_EIC.C
1
#ifndef MACRO_G4B0TRACKINGEIC_C
2
#define MACRO_G4B0TRACKINGEIC_C
3
4
#include <
GlobalVariables.C
>
5
6
#include <
trackreco/PHRaveVertexing.h
>
7
8
#include <eicg4b0/B0TrackFastSimEval.h>
9
#include <eicg4b0/B0TrackFastSim.h>
10
11
#include <
fun4all/Fun4AllServer.h
>
12
13
#include <vector>
14
15
R__LOAD_LIBRARY
(libtrack_reco.so)
16
R__LOAD_LIBRARY
(libEICG4B0.so)
//
17
18
namespace Enable
19
{
20
bool
B0TRACKING =
false
;
21
bool
B0TRACKING_EVAL =
false
;
22
int
B0TRACKING_VERBOSITY = 0;
23
}
// namespace Enable
24
25
namespace
G4B0TRACKING
26
{
27
bool
DISPLACED_VERTEX
=
false
;
28
bool
PROJECTION_B0
=
false
;
29
const
double
PositionResolution
(30
e
-4);
30
}
// namespace G4TRACKING
31
32
//-----------------------------------------------------------------------------//
33
void
B0TrackingInit
()
34
{
35
B0TRACKING::FastKalmanFilter
=
new
B0TrackFastSim
(
"B0TrackFastSim"
);
36
B0TRACKING::FastKalmanFilterB0Track
=
new
B0TrackFastSim
(
"FastKalmanFilterB0Track"
);
//b0Truth
37
}
38
39
void
InitFastKalmanFilter
(
B0TrackFastSim
*kalman_filter)
40
{
41
// kalman_filter->Smearing(false);
42
if
(
G4B0TRACKING::DISPLACED_VERTEX
)
43
{
44
// do not use truth vertex in the track fitting,
45
// which would lead to worse momentum resolution for prompt tracks
46
// but this allows displaced track analysis including DCA and vertex finding
47
kalman_filter->
set_use_vertex_in_fitting
(
false
);
48
kalman_filter->
set_vertex_xy_resolution
(0);
// do not smear the vertex used in the built-in DCA calculation
49
kalman_filter->
set_vertex_z_resolution
(0);
// do not smear the vertex used in the built-in DCA calculation
50
kalman_filter->
enable_vertexing
(
true
);
// enable vertex finding and fitting
51
}
52
else
53
{
54
// constraint to a primary vertex and use it as part of the fitting level arm
55
kalman_filter->
set_use_vertex_in_fitting
(
true
);
56
kalman_filter->
set_vertex_xy_resolution
(
G4B0TRACKING::PositionResolution
);
57
kalman_filter->
set_vertex_z_resolution
(
G4B0TRACKING::PositionResolution
);
58
}
59
60
kalman_filter->
set_sub_top_node_name
(
"TRACKS"
);
61
}
62
63
//-----------------------------------------------------------------------------//
64
void
B0Tracking_Reco
()
65
{
66
int
verbosity =
std::max
(
Enable::VERBOSITY
, Enable::B0TRACKING_VERBOSITY);
67
//---------------
68
// Fun4All server
69
//---------------
70
71
Fun4AllServer
*se =
Fun4AllServer::instance
();
72
73
if
(
B0TRACKING::FastKalmanFilter
==
nullptr
)
74
{
75
cout << __PRETTY_FUNCTION__ <<
" : missing the expected initialization for B0TRACKING::FastKalmanFilter."
<< endl;
76
exit
(1);
77
}
78
79
InitFastKalmanFilter
(
B0TRACKING::FastKalmanFilter
);
80
B0TRACKING::FastKalmanFilter
->
Verbosity
(verbosity);
81
B0TRACKING::FastKalmanFilter
->
set_trackmap_out_name
(
B0TRACKING::TrackNodeName
);
82
83
//-------------------------
84
// B0
85
//-------------------------
86
if
(Enable::B0TRACKING &&
G4B0TRACKING::PROJECTION_B0
)
87
{
88
// TRACKING::FastKalmanFilter->add_state_name("b0Truth");
89
// TRACKING::ProjectionNames.insert("b0Truth");
90
}
91
92
se->
registerSubsystem
(
B0TRACKING::FastKalmanFilter
);
93
94
// next, tracks with partial usage of the tracker stack
95
if
(
B0TRACKING::FastKalmanFilterB0Track
==
nullptr
)
96
{
97
cout << __PRETTY_FUNCTION__ <<
" : missing the expected initialization for TRACKING::FastKalmanFilterB0Track."
<< endl;
98
exit
(1);
99
}
100
InitFastKalmanFilter
(
B0TRACKING::FastKalmanFilterB0Track
);
101
B0TRACKING::FastKalmanFilterB0Track
->
Verbosity
(verbosity);
102
B0TRACKING::FastKalmanFilterB0Track
->
set_trackmap_out_name
(
"B0TrackMap"
);
103
B0TRACKING::FastKalmanFilterB0Track
->
enable_vertexing
(
false
);
104
se->
registerSubsystem
(
B0TRACKING::FastKalmanFilterB0Track
);
105
return
;
106
}
107
108
//-----------------------------------------------------------------------------//
109
110
void
B0Tracking_Eval
(
const
std::string &outputfile)
111
{
112
int
verbosity =
std::max
(
Enable::VERBOSITY
, Enable::B0TRACKING_VERBOSITY);
113
//---------------
114
// Fun4All server
115
//---------------
116
117
Fun4AllServer
*se =
Fun4AllServer::instance
();
118
119
//----------------
120
// Fast Tracking evaluation
121
//----------------
122
123
B0TrackFastSimEval
*b0_fast_sim_eval =
new
B0TrackFastSimEval
(
"B0FastTrackingEval"
);
124
b0_fast_sim_eval->
set_trackmapname
(
B0TRACKING::TrackNodeName
);
125
b0_fast_sim_eval->
set_filename
(outputfile);
126
b0_fast_sim_eval->
Verbosity
(verbosity);
127
//-------------------------
128
// FEMC
129
//-------------------------
130
131
cout <<
"Tracking_Eval(): configuration of track projections in B0TrackFastSimEval"
<< endl;
132
cout <<
"std::set<std::string> B0TRACKING::ProjectionNames = {"
;
133
bool
first =
true
;
134
for
(
const
string
&
proj
:
B0TRACKING::B0ProjectionNames
)
135
{
136
if
(first)
137
first =
false
;
138
else
139
cout <<
", "
;
140
cout <<
"\""
<<
proj
<<
"\""
;
141
142
b0_fast_sim_eval->
AddProjection
(proj);
143
}
144
cout <<
"};"
<< endl;
// override the TRACKING::ProjectionNames in eval macros
145
146
se->
registerSubsystem
(b0_fast_sim_eval);
147
// now partial track fits
148
//B0TrackFastSimEval *b0_fast_sim_eval = new B0TrackFastSimEval("FastTrackingEval_B0TrackMap");
149
b0_fast_sim_eval =
new
B0TrackFastSimEval
(
"FastTrackingEval_B0TrackMap"
);
150
b0_fast_sim_eval->
set_trackmapname
(
"B0TrackMap"
);
151
b0_fast_sim_eval->
set_filename
(outputfile +
".B0TrackMap_debug.root"
);
152
b0_fast_sim_eval->
Verbosity
(verbosity);
153
se->
registerSubsystem
(b0_fast_sim_eval);
154
}
155
#endif
macros
blob
master
common
G4_B0Tracking_EIC.C
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:58
using
1.8.2 with
ECCE GitHub integration