7 #include "GaudiKernel/IInterface.h"
12 #include "Acts/Material/MaterialSlab.hpp"
13 #include <Acts/Geometry/GeometryIdentifier.hpp>
14 #include <Acts/Surfaces/CylinderBounds.hpp>
15 #include <Acts/Surfaces/RadialBounds.hpp>
16 #include <Acts/Utilities/Helpers.hpp>
18 using namespace Acts::VectorHelpers;
27 m_trackingGeometrySvc(
"ActsTrackingGeometrySvc",
name) {
83 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
118 using namespace std::chrono_literals;
121 std::this_thread::sleep_for(2
s);
134 std::this_thread::sleep_for(0.1
s);
137 ATH_MSG_INFO(
"Writer thread caught termination signal. Shutting down.");
147 <<
": Pop entry and write");
156 <<
": Lock and write until empty");
174 size_t mints = mTrack.second.materialInteractions.size();
243 m_tX0 = mTrack.second.materialInX0;
244 m_tL0 = mTrack.second.materialInL0;
247 m_v_x = mTrack.first.first.x();
248 m_v_y = mTrack.first.first.y();
249 m_v_z = mTrack.first.first.z();
250 m_v_px = mTrack.first.second.x();
251 m_v_py = mTrack.first.second.y();
252 m_v_pz = mTrack.first.second.z();
257 for (
auto& mint : mTrack.second.materialInteractions) {
259 m_step_x.push_back(mint.position.x());
260 m_step_y.push_back(mint.position.y());
261 m_step_z.push_back(mint.position.z());
267 = mint.position - 0.5 * mint.pathCorrection * mint.direction;
269 = mint.position + 0.5 * mint.pathCorrection * mint.direction;
278 const Acts::Surface* surface = mint.surface;
279 Acts::GeometryIdentifier layerID;
282 auto sfIntersection = surface
283 ->intersect(gctx.context(), mint.position,
286 layerID = surface->geometryId();
287 m_sur_id.push_back(layerID.value());
289 m_sur_x.push_back(sfIntersection.position().x());
290 m_sur_y.push_back(sfIntersection.position().y());
291 m_sur_z.push_back(sfIntersection.position().z());
293 const Acts::SurfaceBounds& surfaceBounds = surface->bounds();
294 const Acts::RadialBounds* radialBounds =
295 dynamic_cast<const Acts::RadialBounds*
>(&surfaceBounds);
296 const Acts::CylinderBounds* cylinderBounds =
297 dynamic_cast<const Acts::CylinderBounds*
>(&surfaceBounds);
302 }
else if (cylinderBounds) {
304 -cylinderBounds->get(Acts::CylinderBounds::eHalfLengthZ));
306 cylinderBounds->get(Acts::CylinderBounds::eHalfLengthZ));
312 layerID.setVolume(0);
313 layerID.setBoundary(0);
315 layerID.setApproach(0);
316 layerID.setSensitive(0);
317 m_sur_id.push_back(layerID.value());
329 const Acts::InteractionVolume& volume = mint.volume;
330 Acts::GeometryIdentifier vlayerID;
331 if (!volume.empty()) {
332 vlayerID = volume.geometryId();
333 m_vol_id.push_back(vlayerID.value());
335 vlayerID.setVolume(0);
336 vlayerID.setBoundary(0);
337 vlayerID.setLayer(0);
338 vlayerID.setApproach(0);
339 vlayerID.setSensitive(0);
340 m_vol_id.push_back(vlayerID.value());
344 const auto& mprops = mint.materialSlab;
346 m_step_X0.push_back(mprops.material().X0());
347 m_step_L0.push_back(mprops.material().L0());
348 m_step_A.push_back(mprops.material().Ar());
349 m_step_Z.push_back(mprops.material().Z());
350 m_step_rho.push_back(mprops.material().massDensity());