92 {
93 if (cluster.ids.empty()) return StatusCode::SUCCESS;
94
95 InDetDD::SiLocalPosition pos_acc(0,0);
96 double tot_time = 0;
97
98 for (
size_t i = 0;
i < cluster.ids.size();
i++) {
99 Identifier rdo_id = cluster.ids[
i];
100
101 const InDetDD::HGTD_DetectorElement* element =
m_hgtd_det_mgr->getDetectorElement(rdo_id);
104
105 pos_acc += si_pos;
106 tot_time += cluster.times[
i];
107 }
108
109 pos_acc /= cluster.ids.size();
110 tot_time /= cluster.ids.size();
111
112
113 Eigen::Matrix<float, 3, 1> loc_pos(pos_acc.xPhi(), pos_acc.xEta(), tot_time);
114 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
115
116 constexpr float xWidth = 1.3;
117 constexpr float yWidth = 1.3;
118 cov_matrix(0,0) = xWidth * xWidth / 12 / cluster.ids.size();
119 cov_matrix(1,1) = yWidth * yWidth / 12 / cluster.ids.size();
120 constexpr float time_of_arrival_err = 0.035;
121 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err / cluster.ids.size();
122
123 IdentifierHash id_hash =
m_hgtd_det_mgr->getDetectorElement(cluster.ids.front())->identifyHash();
124
125
127 xaodcluster.
setIdentifier(cluster.ids.front().get_compact());
128 xaodcluster.
setRDOlist(std::move(cluster.ids));
129 xaodcluster.
setToTlist(std::move(cluster.tots));
130
131 return StatusCode::SUCCESS;
132 }
SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
const HGTD_ModuleDesign & design() const override final
access to the local description:
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
readout or diode id -> position.
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.