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
RawClusterBuilderTopo.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RawClusterBuilderTopo.h
1
#ifndef CALORECO_RAWCLUSTERTOPO_H
2
#define CALORECO_RAWCLUSTERTOPO_H
3
4
//===========================================================
8
//===========================================================
9
10
#include <
fun4all/SubsysReco.h
>
11
12
#include <map>
13
#include <string>
14
#include <utility>
// for pair
15
#include <vector>
16
17
class
PHCompositeNode
;
18
class
RawClusterContainer
;
19
class
RawTowerGeomContainer
;
20
21
class
RawClusterBuilderTopo
:
public
SubsysReco
22
{
23
public
:
24
explicit
RawClusterBuilderTopo
(
const
std::string
&
name
=
"RawClusterBuilderTopo"
);
25
~RawClusterBuilderTopo
()
override
{}
26
27
int
InitRun
(
PHCompositeNode
*topNode)
override
;
28
int
process_event
(
PHCompositeNode
*topNode)
override
;
29
int
End
(
PHCompositeNode
*topNode)
override
;
30
31
void
set_nodename
(
const
std::string
&nodename)
32
{
33
ClusterNodeName
= nodename;
34
}
35
36
void
set_noise
(
float
noise_0 = 0.0025,
float
noise_1 = 0.006,
float
noise_2 = 0.03)
37
{
38
_noise_LAYER
[0] = noise_0;
39
_noise_LAYER
[1] = noise_1;
40
_noise_LAYER
[2] = noise_2;
41
}
42
43
void
set_significance
(
float
seed
,
float
grow,
float
peri)
44
{
45
_sigma_seed
=
seed
;
46
_sigma_grow
= grow;
47
_sigma_peri
= peri;
48
}
49
50
void
allow_corner_neighbor
(
bool
allow)
51
{
52
_allow_corner_neighbor
= allow;
53
}
54
55
void
set_enable_HCal
(
bool
enable_HCal)
56
{
57
_enable_HCal
= enable_HCal;
58
}
59
60
void
set_enable_EMCal
(
bool
enable_EMCal)
61
{
62
_enable_EMCal
= enable_EMCal;
63
}
64
65
void
set_do_split
(
bool
do_split)
66
{
67
_do_split
= do_split;
68
}
69
70
void
set_minE_local_max
(
float
minE_0 = 1,
float
minE_1 = 1,
float
minE_2 = 1)
71
{
72
_local_max_minE_LAYER
[0] = minE_0;
73
_local_max_minE_LAYER
[1] = minE_1;
74
_local_max_minE_LAYER
[2] = minE_2;
75
}
76
77
void
set_R_shower
(
float
R_shower)
78
{
79
_R_shower
= R_shower;
80
}
81
82
private
:
83
void
CreateNodes
(
PHCompositeNode
*topNode);
84
85
std::vector<std::vector<std::vector<float> > >
_TOWERMAP_E_LAYER_ETA_PHI
;
86
std::vector<std::vector<std::vector<int> > >
_TOWERMAP_KEY_LAYER_ETA_PHI
;
87
std::vector<std::vector<std::vector<int> > >
_TOWERMAP_STATUS_LAYER_ETA_PHI
;
88
89
std::vector<std::vector<float> >
_EMTOWERMAP_E_ETA_PHI
;
90
std::vector<std::vector<int> >
_EMTOWERMAP_KEY_ETA_PHI
;
91
std::vector<std::vector<int> >
_EMTOWERMAP_STATUS_ETA_PHI
;
92
93
// geometric constants to express IHCal<->EMCal overlap in eta
94
static
int
RawClusterBuilderTopo_constants_EMCal_eta_start_given_IHCal
[];
95
96
static
int
RawClusterBuilderTopo_constants_EMCal_eta_end_given_IHCal
[];
97
98
static
int
RawClusterBuilderTopo_constants_IHCal_eta_given_EMCal
[];
99
100
// geometric parameters defined at runtime
101
int
_EMCAL_NETA
;
102
int
_EMCAL_NPHI
;
103
104
int
_HCAL_NETA
;
105
int
_HCAL_NPHI
;
106
107
// utility functions to express IHCal<->EMCal overlap in phi
108
int
get_first_matching_EMCal_phi_from_IHCal
(
int
index_hcal_phi)
109
{
110
return
((68 + 4 * (index_hcal_phi - 32) +
_EMCAL_NPHI
) %
_EMCAL_NPHI
);
111
}
112
113
int
get_matching_HCal_phi_from_EMCal
(
int
index_emcal_phi)
114
{
115
return
((32 + (index_emcal_phi - 68 +
_EMCAL_NPHI
) / 4) %
_HCAL_NPHI
);
116
}
117
118
std::vector<int>
get_adjacent_towers_by_ID
(
int
ID);
119
120
float
calculate_dR
(
float
,
float
,
float
,
float
);
121
122
void
export_single_cluster
(
const
std::vector<int> &);
123
124
void
export_clusters
(
const
std::vector<int> &, std::map<
int
, std::pair<int, int> >,
unsigned
int
, std::vector<float>, std::vector<float>, std::vector<float>);
125
126
int
get_ID
(
int
ilayer,
int
ieta,
int
iphi)
127
{
128
if
(ilayer < 2)
129
{
130
return
ilayer *
_HCAL_NETA
*
_HCAL_NPHI
+ ieta *
_HCAL_NPHI
+ iphi;
131
}
132
return
_EMCAL_NPHI
*
_EMCAL_NETA
+ ieta *
_EMCAL_NPHI
+ iphi;
133
}
134
135
int
get_ilayer_from_ID
(
int
ID)
136
{
137
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
138
{
139
return
((
int
) (ID / (
_HCAL_NETA
*
_HCAL_NPHI
)));
140
}
141
else
142
{
143
return
2;
144
}
145
}
146
147
int
get_ieta_from_ID
(
int
ID)
148
{
149
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
150
{
151
return
((
int
) ((ID % (
_HCAL_NETA
*
_HCAL_NPHI
)) / (_HCAL_NPHI)));
152
}
153
else
154
{
155
return
((
int
) ((ID -
_EMCAL_NPHI
* _EMCAL_NETA) /
_EMCAL_NPHI
));
156
}
157
}
158
159
int
get_iphi_from_ID
(
int
ID)
160
{
161
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
162
{
163
return
((
int
) (ID %
_HCAL_NPHI
));
164
}
165
else
166
{
167
return
((
int
) ((ID -
_EMCAL_NPHI
* _EMCAL_NETA) %
_EMCAL_NPHI
));
168
}
169
}
170
171
int
get_status_from_ID
(
int
ID)
172
{
173
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
174
{
175
return
_TOWERMAP_STATUS_LAYER_ETA_PHI
[
get_ilayer_from_ID
(ID)][
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)];
176
}
177
return
_EMTOWERMAP_STATUS_ETA_PHI
[
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)];
178
}
179
180
float
get_E_from_ID
(
int
ID)
181
{
182
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
183
{
184
return
_TOWERMAP_E_LAYER_ETA_PHI
[
get_ilayer_from_ID
(ID)][
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)];
185
}
186
return
_EMTOWERMAP_E_ETA_PHI
[
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)];
187
}
188
189
void
set_status_by_ID
(
int
ID,
int
status
)
190
{
191
if
(ID <
_EMCAL_NPHI
*
_EMCAL_NETA
)
192
{
193
_TOWERMAP_STATUS_LAYER_ETA_PHI
[
get_ilayer_from_ID
(ID)][
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)] =
status
;
194
}
195
else
196
{
197
_EMTOWERMAP_STATUS_ETA_PHI
[
get_ieta_from_ID
(ID)][
get_iphi_from_ID
(ID)] =
status
;
198
}
199
}
200
201
RawClusterContainer
*
_clusters
=
nullptr
;
202
203
RawTowerGeomContainer
*
_geom_containers
[3]{};
204
205
float
_noise_LAYER
[3]{};
206
207
float
_sigma_seed
;
208
float
_sigma_grow
;
209
float
_sigma_peri
;
210
211
bool
_allow_corner_neighbor
;
212
213
bool
_enable_HCal
;
214
bool
_enable_EMCal
;
215
216
bool
_do_split
;
217
float
_local_max_minE_LAYER
[3]{};
218
float
_R_shower
;
219
220
std::string
ClusterNodeName
;
221
};
222
223
#endif
coresoftware
blob
master
offline
packages
CaloReco
RawClusterBuilderTopo.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:05
using
1.8.2 with
sPHENIX GitHub integration