106 {
107 if (cluster.ids.empty()) return StatusCode::SUCCESS;
108
109 InDetDD::SiLocalPosition pos_acc(0,0);
110 double tot_time = 0;
111
112 unsigned int icluster=xaodcluster.index();
113 unsigned int n_rdos = auxDataCache->
rdoList.getBeginIndex(icluster);
114 assert(icluster==0 || n_rdos == auxDataCache->totList.getBeginIndex(icluster));
115 assert( n_rdos+cluster.ids.size() <= auxDataCache->rdoList.nObjects() );
116 assert( cluster.tots.size() == cluster.ids.size());
117 for (
size_t i = 0;
i < cluster.ids.size();
i++) {
118 Identifier rdo_id(cluster.ids[i]);
119
120 const InDetDD::HGTD_DetectorElement* element =
m_hgtd_det_mgr->getDetectorElement(rdo_id);
123
124 auxDataCache->rdoList.setValue(n_rdos,rdo_id.get_compact());
125 auxDataCache->totList.setValue(n_rdos,cluster.tots[i]);
126 ++n_rdos;
127
128 pos_acc += si_pos;
129 tot_time += cluster.times[
i];
130 }
131
132 pos_acc /= cluster.ids.size();
133 tot_time /= cluster.ids.size();
134
135
136 Eigen::Matrix<float, 3, 1> loc_pos(pos_acc.xPhi(), pos_acc.xEta(), tot_time);
137 Eigen::Matrix<float, 3, 3> cov_matrix= Eigen::Matrix<float, 3, 3>::Zero();
138
139 constexpr float xWidth = 1.3;
140 constexpr float yWidth = 1.3;
141 cov_matrix(0,0) = xWidth * xWidth / 12 / cluster.ids.size();
142 cov_matrix(1,1) = yWidth * yWidth / 12 / cluster.ids.size();
143 constexpr float time_of_arrival_err = 0.035;
144 cov_matrix(2,2) = time_of_arrival_err * time_of_arrival_err / cluster.ids.size();
145
146 IdentifierHash id_hash =
m_hgtd_det_mgr->getDetectorElement(Identifier(cluster.ids.front()))->identifyHash();
147
148
151 auxDataCache->rdoList.updateEndIndex(icluster,n_rdos);
152 auxDataCache->totList.updateEndIndex(icluster,n_rdos);
153
154 return StatusCode::SUCCESS;
155 }
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.
SG::ConstAccessor< SG::JaggedVecElt< Identifier::value_type > >::element_type rdoList() const
Returns 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.