155{
156
158 float tot_acc = 0.f;
159
164 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmin_diode{};
165 InDetDD::PixelDiodeTree::DiodeProxyWithPosition colmax_diode{};
166 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmin_diode{};
167 InDetDD::PixelDiodeTree::DiodeProxyWithPosition rowmax_diode{};
168
169
170
174
176 assert( idHash == cluster.identifyHash());
177 Identifier module_id = element.
identify();
178 std::optional<Identifier::value_type> first_rdo_id;
179 int cluster_lvl1min = std::numeric_limits<int>::max();
180
181 using CellProxy = InPlaceClusterization::CellProxy<const IPixelClusteringTool::CellContainer>;
182 for (CellProxy cellProxy : cluster) {
183
184
185 Identifier rdo_id =
m_pixelID->pixel_id(module_id, cellProxy.coordinates()[0], cellProxy.coordinates()[1]);
186 if (!first_rdo_id.has_value()) {
188 }
189
190
191
192
193
194
195
196 assert(cellProxy.srcIndex() < rdos.
size());
197 const PixelRDORawData *rdo = rdos[cellProxy.srcIndex()];
198 cluster_lvl1min = std::min(cluster_lvl1min, rdo->
getLVL1A());
201
202 std::array<InDetDD::PixelDiodeTree::CellIndexType,2> diode_idx
204 cellProxy.coordinates()[1]);
206
207 if (calibData) {
208
209
210 std::uint32_t feValue = design.
getFE(si_param);
213
216 return StatusCode::FAILURE;
217 }
218
220 calibStrategy,
221 idHash,
222 feValue,
223 tot);
224 } else {
226 idHash,
227 feValue,
228 tot);
229
230
233 }
234 }
236 }
239 ++n_rdos;
240
243 if (row>rowmax) {
245 rowmax_diode = si_param;
246 }
247 if (row<rowmin) {
249 rowmin_diode = si_param;
250 }
251 if (col>colmax) {
252 colmax=col;
253 colmax_diode = si_param;
254 }
255 if (col<colmin) {
256 colmin=col;
257 colmin_diode = si_param;
258 }
259
260
261
262
263
264
266 pos_acc +=
charge * si_param.position();
268 } else {
269 pos_acc += si_param.position();
270 tot_acc += 1;
271 }
272
273 }
274 assert(n_rdos>0);
275 if (tot_acc > 0)
276 pos_acc /= tot_acc;
277
278
279 const int colWidth = colmax - colmin + 1;
280 const int rowWidth = rowmax - rowmin + 1;
281
282 double etaWidth = colmax_diode.
xEtaMax() - colmin_diode.
xEtaMin();
284
285
288
290 double Ax[3] = {
T(0,0),
T(1,0),
T(2,0)};
291 double Ay[3] = {
T(0,1),
T(1,1),
T(2,1)};
292 double R [3] = {
T(0,3),
T(1,3),
T(2,3)};
293
295 Amg::Vector3D globalPos(M[0]*Ax[0]+M[1]*Ay[0]+R[0],M[0]*Ax[1]+M[1]*Ay[1]+R[1],M[0]*Ax[2]+M[1]*Ay[2]+R[2]);
296
297
298 float width0, width1;
300
302 width1 = etaWidth;
303 } else {
304
306 width1 = etaWidth / colWidth;
307 }
308
309
310
311 Eigen::Matrix<float,2,1> localPosition(locpos.x(), locpos.y());
312 Eigen::Matrix<float,2,2> localCovariance = Eigen::Matrix<float,2,2>::Zero();
313 localCovariance(0, 0) = width0 * width0 / 12.0f;
314 localCovariance(1, 1) = width1 * width1 / 12.0f;
315
316 clusterVars.identifierHash[icluster] = idHash;
318 xAOD::MatrixMap<2>(clusterVars.localCovarianceDim2[icluster].data()) = localCovariance;
319 assert( first_rdo_id.has_value());
320 clusterVars.identifier[icluster] = *first_rdo_id;
322 xAOD::VectorMap<3>(clusterVars.globalPosition[icluster].data()) = globalPos.cast<
float>();
325 clusterVars.lvl1a[icluster] = cluster_lvl1min;
326 clusterVars.channelsInPhi[icluster] = rowWidth;
327 clusterVars.channelsInEta[icluster] = colWidth;
328 clusterVars.widthInEta[icluster] = etaWidth;
329
330 return StatusCode::SUCCESS;
331}
double charge(const T &p)
value_type get_compact() const
Get the compact id.
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
PixelReadoutTechnology getReadoutTechnology() const
static InDetDD::PixelDiodeType getDiodeType(const PixelDiodeTree::DiodeProxy &diode_proxy)
static unsigned int getFE(const PixelDiodeTree::DiodeProxy &diode_proxy)
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::Surface & surface()
Element Surface.
float getCharge(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE, float ToT) const
virtual int getToT() const =0
virtual int getLVL1A() const =0
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
void updateEndIndex(unsigned int obj_i, unsigned int elm_i)
unsigned int getBeginIndex(unsigned int obj_i) const
void setValue(unsigned int elm_i, T &&value)
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
row
Appending html table to final .html summary file.
Eigen::Map< MeasVector< N > > VectorMap
Eigen::Map< MeasMatrix< N > > MatrixMap
double xPhiMax() const
for backward compatibility, return the position of the lower edge of the diode in local-y(phi,...
double xEtaMin() const
for backward compatibility, return the position of the lower edge of the diode in local-y(eta,...
double xPhiMin() const
for backward compatibility, return the position of the lower edge of the diode in local-x(phi,...
double xEtaMax() const
for backward compatibility, return the position of the upper edge of the diode in local-y(eta,...
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< float > chargeList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< int > totList
xAOD::xAODInDetMeasurement::Utilities::JaggedVecEltCache< Identifier::value_type > rdoList