93 {
94 if (cluster.ids.empty()) return StatusCode::SUCCESS;
95
96 InDetDD::SiLocalPosition pos_acc(0,0);
97 double tot_time = 0;
98
99 for (
size_t i = 0;
i < cluster.ids.size();
i++) {
100 Identifier rdo_id = cluster.ids[
i];
101
102 const InDetDD::HGTD_DetectorElement* element =
m_hgtd_det_mgr->getDetectorElement(rdo_id);
105
106 pos_acc += si_pos;
107 tot_time += cluster.times[
i];
108 }
109
110 pos_acc /= cluster.ids.size();
111 tot_time /= cluster.ids.size();
112
113
114 Eigen::Matrix<float, 3, 1> loc_pos(pos_acc.xPhi(), pos_acc.xEta(), tot_time);
115 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
116
117 constexpr float xWidth = 1.3;
118 constexpr float yWidth = 1.3;
119 cov_matrix(0,0) = xWidth * xWidth / 12 / cluster.ids.size();
120 cov_matrix(1,1) = yWidth * yWidth / 12 / cluster.ids.size();
121 constexpr float time_of_arrival_err = 0.035;
122 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err / cluster.ids.size();
123
124 IdentifierHash id_hash =
m_hgtd_det_mgr->getDetectorElement(cluster.ids.front())->identifyHash();
125
126
128 xaodcluster.
setIdentifier(cluster.ids.front().get_compact());
129 xaodcluster.
setRDOlist(std::move(cluster.ids));
130 xaodcluster.
setToTlist(std::move(cluster.tots));
131
132 return StatusCode::SUCCESS;
133 }
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.