34 {
35
36
37 std::map<std::string, float> features;
38 features[
"x"] =
sp->globalPosition().x();
39 features[
"y"] =
sp->globalPosition().y();
40 features[
"z"] =
sp->globalPosition().z();
41 features[
"r"] =
sp->r();
42 features[
"phi"] =
sp->phi();
43 features[
"eta"] =
sp->eta();
44
45 const InDet::SiCluster *cluster_1 =
static_cast<const InDet::SiCluster *
>(
sp->clusterList().first);
46
52 features["cluster_eta_1"] = -1 * std::log(std::tan(0.5 * std::atan2(features["cluster_r_1"], features["cluster_z_1"])));
53
54 const InDet::SiCluster *cluster_2 =
static_cast<const InDet::SiCluster *
>(
sp->clusterList().second);
55 bool isStrip = (cluster_2 !=
nullptr);
56
57
58 float charge_count_1 = 0;
59 int pixel_count_1 = 0;
60 float loc_eta_1 = 0, loc_phi_1 = 0;
61 float glob_eta_1 = 0, glob_phi_1 = 0;
62 float localDir0_1 = 0, localDir1_1 = 0, localDir2_1 = 0;
63 float lengthDir0_1 = 0, lengthDir1_1 = 0, lengthDir2_1 = 0;
64 float eta_angle_1 = 0, phi_angle_1 = 0;
65
66
67
68
69
70
71
72 int region = 0;
73
74 if (!isStrip) {
75 const InDet::PixelCluster* cluster = dynamic_cast<const InDet::PixelCluster*>(cluster_1);
78 switch (barrel_endcap) {
79 case -2:
80 region = 1;
81 break;
82 case 0:
83 region = 3;
84 break;
85 case 2:
86 region = 5;
87 break;
88 default:
90 break;
91 }
92
93
94
95 int min_eta = 999;
96 int min_phi = 999;
97 int max_eta = -999;
98 int max_phi = -999;
99 for (
unsigned int rdo = 0; rdo < cluster->
rdoList().
size(); rdo++) {
100 charge_count_1 += cluster->
totList().at(rdo);
101 ++ pixel_count_1;
102
103 const auto &rdoID = cluster->
rdoList().at(rdo);
115 }
116
117
118 const InDetDD::PixelModuleDesign *design =
dynamic_cast<const InDetDD::PixelModuleDesign *
>(&element->
design());
119
120 InDetDD::SiLocalPosition localPos_entry = design->
localPositionOfCell(InDetDD::SiCellId(min_phi, min_eta));
121 InDetDD::SiLocalPosition localPos_exit = design->
localPositionOfCell(InDetDD::SiCellId(max_phi, max_eta));
122
128
129
130 Amg::Vector3D localDirection = localEndPosition - localStartPosition;
132
133 localDir0_1 = localDirection[0];
134 localDir1_1 = localDirection[1];
135 localDir2_1 = localDirection[2];
136
139
140 Amg::Vector3D direction = globalEndPosition - globalStartPosition;
142
146
147 float trkphicomp = direction.dot(my_phiax);
148 float trketacomp = direction.dot(my_etaax);
149 float trknormcomp = direction.dot(my_normal);
150 eta_angle_1 = atan2(trknormcomp, trketacomp);
151 phi_angle_1 = atan2(trknormcomp, trkphicomp);
152 } else {
153
155 glob_eta_1, glob_phi_1,
156 localDir0_1, localDir1_1, localDir2_1,
157 lengthDir0_1, lengthDir1_1, lengthDir2_1,
158 eta_angle_1, phi_angle_1
159 );
161 ATH_MSG_ERROR(
"Failed at " << __LINE__ <<
" of getting SCT cluster shape info.");
162 }
163 auto cluster = dynamic_cast<const InDet::SCT_Cluster*>(cluster_1);
165 switch (barrel_endcap) {
166 case -2:
167 region = 2;
168 break;
169 case 0:
170 region = 4;
171 break;
172 case 2:
173 region = 6;
174 break;
175 default:
177 break;
178 }
179 }
180 features["charge_count_1"] = charge_count_1;
181 features["count_1"] = pixel_count_1;
182 features["loc_eta_1"] = loc_eta_1;
183 features["loc_phi_1"] = loc_phi_1;
184 features["glob_eta_1"] = glob_eta_1;
185 features["glob_phi_1"] = glob_phi_1;
186 features["localDir0_1"] = localDir0_1;
187 features["localDir1_1"] = localDir1_1;
188 features["localDir2_1"] = localDir2_1;
189 features["lengthDir0_1"] = lengthDir0_1;
190 features["lengthDir1_1"] = lengthDir1_1;
191 features["lengthDir2_1"] = lengthDir2_1;
192 features["eta_angle_1"] = eta_angle_1;
193 features["phi_angle_1"] = phi_angle_1;
194 features["region"] = region;
195
196 if (isStrip) {
202 features["cluster_eta_2"] = -1 * std::log(std::tan(0.5 * std::atan2(features["cluster_r_2"], features["cluster_z_2"])));
203
204 float charge_count_2 = 0;
205 int pixel_count_2 = 0;
206 float loc_eta_2 = 0, loc_phi_2 = 0;
207 float glob_eta_2 = 0, glob_phi_2 = 0;
208 float localDir0_2 = 0, localDir1_2 = 0, localDir2_2 = 0;
209 float lengthDir0_2 = 0, lengthDir1_2 = 0, lengthDir2_2 = 0;
210 float eta_angle_2 = 0, phi_angle_2 = 0;
212 glob_eta_2, glob_phi_2,
213 localDir0_2, localDir1_2, localDir2_2,
214 lengthDir0_2, lengthDir1_2, lengthDir2_2,
215 eta_angle_2, phi_angle_2
216 );
218 ATH_MSG_ERROR(
"Failed at " << __LINE__ <<
" of getting SCT cluster shape info.");
219 }
220
221 features["charge_count_2"] = charge_count_2;
222 features["count_2"] = pixel_count_2;
223 features["loc_eta_2"] = loc_eta_2;
224 features["loc_phi_2"] = loc_phi_2;
225 features["glob_eta_2"] = glob_eta_2;
226 features["glob_phi_2"] = glob_phi_2;
227 features["localDir0_2"] = localDir0_2;
228 features["localDir1_2"] = localDir1_2;
229 features["localDir2_2"] = localDir2_2;
230 features["lengthDir0_2"] = lengthDir0_2;
231 features["lengthDir1_2"] = lengthDir1_2;
232 features["lengthDir2_2"] = lengthDir2_2;
233 features["eta_angle_2"] = eta_angle_2;
234 features["phi_angle_2"] = phi_angle_2;
235 } else {
236
237 features["cluster_x_2"] = features["cluster_x_1"];
238 features["cluster_y_2"] = features["cluster_y_1"];
239 features["cluster_z_2"] = features["cluster_z_1"];
240 features["cluster_r_2"] = features["cluster_r_1"];
241 features["cluster_phi_2"] = features["cluster_phi_1"];
242 features["cluster_eta_2"] = features["cluster_eta_1"];
243 features["charge_count_2"] = features["charge_count_1"];
244 features["count_2"] = features["count_1"];
245 features["loc_eta_2"] = features["loc_eta_1"];
246 features["loc_phi_2"] = features["loc_phi_1"];
247 features["glob_eta_2"] = features["glob_eta_1"];
248 features["glob_phi_2"] = features["glob_phi_1"];
249 features["localDir0_2"] = features["localDir0_1"];
250 features["localDir1_2"] = features["localDir1_1"];
251 features["localDir2_2"] = features["localDir2_1"];
252 features["lengthDir0_2"] = features["lengthDir0_1"];
253 features["lengthDir1_2"] = features["lengthDir1_1"];
254 features["lengthDir2_2"] = features["lengthDir2_1"];
255 features["eta_angle_2"] = features["eta_angle_1"];
256 features["phi_angle_2"] = features["phi_angle_1"];
257 }
258 return features;
259}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
int phiIndex() const
Get phi index. Equivalent to strip().
int etaIndex() const
Get eta index.
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double phiPitch() const
Pitch (inline methods)
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
const Amg::Vector3D & etaAxis() const
virtual const Amg::Vector3D & normal() const override final
Get reconstruction local normal axes in global frame.
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
const Amg::Vector3D & phiAxis() const
double etaPitch() const
Pitch (inline methods)
const std::vector< int > & totList() const
const Amg::Vector3D & globalPosition() const
return global position reference
virtual const InDetDD::SiDetectorElement * detectorElement() const override final
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...
Identifier identify() const
return the identifier
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
Eigen::Matrix< double, 3, 1 > Vector3D