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
67 features["module_id"] = static_cast<float>(module_id);
68
69
70
71
72
73
74
75 int region = 0;
76
77 if (!isStrip) {
78 const InDet::PixelCluster* cluster = dynamic_cast<const InDet::PixelCluster*>(cluster_1);
81 switch (barrel_endcap) {
82 case -2:
83 region = 1;
84 break;
85 case 0:
86 region = 3;
87 break;
88 case 2:
89 region = 5;
90 break;
91 default:
93 break;
94 }
95
96
97
98 int min_eta = 999;
99 int min_phi = 999;
100 int max_eta = -999;
101 int max_phi = -999;
102 for (
unsigned int rdo = 0; rdo < cluster->
rdoList().size(); rdo++) {
103 charge_count_1 += cluster->
totList().at(rdo);
104 ++ pixel_count_1;
105
106 const auto &rdoID = cluster->
rdoList().at(rdo);
118 }
119
120
121 const InDetDD::PixelModuleDesign *design =
dynamic_cast<const InDetDD::PixelModuleDesign *
>(&element->
design());
122
123 InDetDD::SiLocalPosition localPos_entry = design->
localPositionOfCell(InDetDD::SiCellId(min_phi, min_eta));
124 InDetDD::SiLocalPosition localPos_exit = design->
localPositionOfCell(InDetDD::SiCellId(max_phi, max_eta));
125
131
132
133 Amg::Vector3D localDirection = localEndPosition - localStartPosition;
135
136 localDir0_1 = localDirection[0];
137 localDir1_1 = localDirection[1];
138 localDir2_1 = localDirection[2];
139
142
143 Amg::Vector3D direction = globalEndPosition - globalStartPosition;
145
149
150 float trkphicomp = direction.dot(my_phiax);
151 float trketacomp = direction.dot(my_etaax);
152 float trknormcomp = direction.dot(my_normal);
153 eta_angle_1 = atan2(trknormcomp, trketacomp);
154 phi_angle_1 = atan2(trknormcomp, trkphicomp);
155 } else {
156
158 glob_eta_1, glob_phi_1,
159 localDir0_1, localDir1_1, localDir2_1,
160 lengthDir0_1, lengthDir1_1, lengthDir2_1,
161 eta_angle_1, phi_angle_1
162 );
164 ATH_MSG_ERROR(
"Failed at " << __LINE__ <<
" of getting SCT cluster shape info.");
165 }
166 auto cluster = dynamic_cast<const InDet::SCT_Cluster*>(cluster_1);
168 switch (barrel_endcap) {
169 case -2:
170 region = 2;
171 break;
172 case 0:
173 region = 4;
174 break;
175 case 2:
176 region = 6;
177 break;
178 default:
180 break;
181 }
182 }
183 features["charge_count_1"] = charge_count_1;
184 features["count_1"] = pixel_count_1;
185 features["loc_eta_1"] = loc_eta_1;
186 features["loc_phi_1"] = loc_phi_1;
187 features["glob_eta_1"] = glob_eta_1;
188 features["glob_phi_1"] = glob_phi_1;
189 features["localDir0_1"] = localDir0_1;
190 features["localDir1_1"] = localDir1_1;
191 features["localDir2_1"] = localDir2_1;
192 features["lengthDir0_1"] = lengthDir0_1;
193 features["lengthDir1_1"] = lengthDir1_1;
194 features["lengthDir2_1"] = lengthDir2_1;
195 features["eta_angle_1"] = eta_angle_1;
196 features["phi_angle_1"] = phi_angle_1;
197 features["region"] = region;
198
199 if (isStrip) {
205 features["cluster_eta_2"] = -1 * std::log(std::tan(0.5 * std::atan2(features["cluster_r_2"], features["cluster_z_2"])));
206
207 float charge_count_2 = 0;
208 int pixel_count_2 = 0;
209 float loc_eta_2 = 0, loc_phi_2 = 0;
210 float glob_eta_2 = 0, glob_phi_2 = 0;
211 float localDir0_2 = 0, localDir1_2 = 0, localDir2_2 = 0;
212 float lengthDir0_2 = 0, lengthDir1_2 = 0, lengthDir2_2 = 0;
213 float eta_angle_2 = 0, phi_angle_2 = 0;
215 glob_eta_2, glob_phi_2,
216 localDir0_2, localDir1_2, localDir2_2,
217 lengthDir0_2, lengthDir1_2, lengthDir2_2,
218 eta_angle_2, phi_angle_2
219 );
221 ATH_MSG_ERROR(
"Failed at " << __LINE__ <<
" of getting SCT cluster shape info.");
222 }
223
224 features["charge_count_2"] = charge_count_2;
225 features["count_2"] = pixel_count_2;
226 features["loc_eta_2"] = loc_eta_2;
227 features["loc_phi_2"] = loc_phi_2;
228 features["glob_eta_2"] = glob_eta_2;
229 features["glob_phi_2"] = glob_phi_2;
230 features["localDir0_2"] = localDir0_2;
231 features["localDir1_2"] = localDir1_2;
232 features["localDir2_2"] = localDir2_2;
233 features["lengthDir0_2"] = lengthDir0_2;
234 features["lengthDir1_2"] = lengthDir1_2;
235 features["lengthDir2_2"] = lengthDir2_2;
236 features["eta_angle_2"] = eta_angle_2;
237 features["phi_angle_2"] = phi_angle_2;
238 } else {
239
240 features["cluster_x_2"] = features["cluster_x_1"];
241 features["cluster_y_2"] = features["cluster_y_1"];
242 features["cluster_z_2"] = features["cluster_z_1"];
243 features["cluster_r_2"] = features["cluster_r_1"];
244 features["cluster_phi_2"] = features["cluster_phi_1"];
245 features["cluster_eta_2"] = features["cluster_eta_1"];
246 features["charge_count_2"] = features["charge_count_1"];
247 features["count_2"] = features["count_1"];
248 features["loc_eta_2"] = features["loc_eta_1"];
249 features["loc_phi_2"] = features["loc_phi_1"];
250 features["glob_eta_2"] = features["glob_eta_1"];
251 features["glob_phi_2"] = features["glob_phi_1"];
252 features["localDir0_2"] = features["localDir0_1"];
253 features["localDir1_2"] = features["localDir1_1"];
254 features["localDir2_2"] = features["localDir2_1"];
255 features["lengthDir0_2"] = features["lengthDir0_1"];
256 features["lengthDir1_2"] = features["lengthDir1_1"];
257 features["lengthDir2_2"] = features["lengthDir2_1"];
258 features["eta_angle_2"] = features["eta_angle_1"];
259 features["phi_angle_2"] = features["phi_angle_1"];
260 }
261 return features;
262}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
value_type get_compact() const
Get the compact id.
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):
virtual Identifier identify() const override final
identifier of this detector element (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