164{
165 ATH_MSG_DEBUG(
"--- HGTD_SmearedDigitizationTool: in digitize() ---");
166
167
168 ATHRNG::RNGWrapper* rngWrapper =
m_rndm_svc->getEngine(
this);
170 CLHEP::HepRandomEngine* rndmEngine = rngWrapper->
getEngine(ctx);
171
172 PRD_MultiTruthCollection* prd_truth_coll = nullptr;
174
175
177
179 const TimedHitPtr<SiHit>& hit(*i++);
180
181
182
183
184
185 int endcap = hit->getBarrelEndcap();
186 int layer = hit->getLayerDisk();
187 int phi_module = hit->getPhiModule();
188 int eta_module = hit->getEtaModule();
189
191 << endcap << ", layer_disk " << layer << ", phi_module "
192 << phi_module << ", eta_module " << eta_module);
193
194 const InDetDD::SolidStateDetectorElementBase* curr_det_element =
196 eta_module);
197
198 if (!curr_det_element) {
199 ATH_MSG_ERROR(
"could not get detector element for SolidStateDetector");
200 continue;
201 }
202
203 IdentifierHash wafer_id =
205
206 HepGeom::Point3D<double> hit_loc_start_pos = hit->localStartPosition();
207 HepGeom::Point3D<double> hit_loc_end_pos = hit->localEndPosition();
208
209 HepGeom::Point3D<double> hit_glob_start_pos =
211 HepGeom::Point3D<double> hit_glob_end_pos =
213
214 double globa_entry_x = hit_glob_start_pos.x();
215 double globa_entry_y = hit_glob_start_pos.y();
219
220 double globa_exit_x = hit_glob_end_pos.x();
221 double globa_exit_y = hit_glob_end_pos.y();
225
226 double dist_x = std::abs(std::abs(globa_exit_x) - std::abs(globa_entry_x));
227 double dist_y = std::abs(std::abs(globa_exit_y) - std::abs(globa_entry_y));
228
231
232
235
236
237 InDetDD::SiCellId entry_cell_id =
239 InDetDD::SiCellId exit_cell_id =
241
243 << entry_id << " --- exitId " << exit_id);
244 ATH_MSG_DEBUG(
"--- HGTD_SmearedDigitizationTool: entryCellId "
245 << entry_cell_id << " --- exitCellId " << exit_cell_id);
246
248 continue;
249 }
250
251
252 double intersection_x = 0.5 * (globa_entry_x + globa_exit_x);
253 double intersection_y = 0.5 * (globa_entry_y + globa_exit_y);
256
257
258 double times_x = floor(dist_x /
m_pitch_x);
259 double times_y = floor(dist_y /
m_pitch_y);
260
261 double sigma_x =
m_pitch_x / std::sqrt(12);
262 double sigma_y =
m_pitch_y / std::sqrt(12);
263
264 int element_x = times_x + 1;
265 int element_y = times_y + 1;
266
267
268
271 curr_det_element->
width() / 2.,
272 rndmEngine);
274 curr_det_element->
length() / 2.,
275 rndmEngine);
276 }
279
281
282 Identifier intersection_id =
284
285
286 std::vector<Identifier> rdo_list = {intersection_id};
287
288 InDetDD::SiCellId current_cell_id =
290
291 if (!current_cell_id.
isValid()) {
292 continue;
293 }
294
297
300
302 covariance.setIdentity();
303 covariance(Trk::locX, Trk::locX) = sigma_x * sigma_x;
304 covariance(Trk::locY, Trk::locY) = sigma_y * sigma_y;
305 Amg::MatrixX cluster_err = Amg::MatrixX(covariance);
306
307 float hit_time = hit->meanTime();
311 }
313
314 std::vector<int> tot_vec = {0};
315
317 si_width, curr_det_element, std::move(cluster_err),
319
325
328 }
329
330 det_element_rio_map.insert(
331 std::pair<IdentifierHash, const Cluster_t*>(wafer_id, cluster));
332
334
335 }
336 return StatusCode::SUCCESS;
337}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define AmgSymMatrix(dim)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
bool isValid() const
Test if its in a valid state.
double length() const
Length in eta direction (z - barrel, r - endcap).
HepGeom::Point3D< double > hitLocalToLocal3D(const HepGeom::Point3D< double > &hitPosition) const
Same as previuos method but 3D.
double width() const
Methods from design (inline).
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const =0
SiCellId from Identifier.
virtual Identifier identify() const override final
identifier of this detector element (inline)
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift).
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
TimedVector::const_iterator const_iterator
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Eigen::Matrix< double, 2, 1 > Vector2D