47 const Acts::GeometryContext tgContext =
m_ctxProvider.getGeometryContext(ctx);
49 const std::string outDir = std::format(
"{:}/Event_{:}/",
m_outPath.value(),
50 ctx.eventID().event_number());
52 Acts::ObjVisualization3D visualHelper{};
53 std::unordered_set<std::shared_ptr<const Acts::Surface>> passedSurfaces{};
58 passedSurfaces.clear();
61 std::optional<Acts::BoundTrackParameters> startPars{};
63 startPars = track->createParametersAtReference();
64 for (
const auto& state : track->trackStates()) {
65 Acts::GeometryView3D::drawSurface(visualHelper, state.referenceSurface(),
66 tgContext, Acts::Transform3::Identity(),
67 Acts::s_viewSensitive);
68 passedSurfaces.insert(state.referenceSurface().getSharedPtr());
71 auto startSurf = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Transform3::Identity());
72 Acts::BoundVector pars{Acts::BoundVector::Zero()};
73 pars[Acts::eBoundLoc0] = particle->d0();
74 pars[Acts::eBoundLoc1] = particle->z0();
75 pars[Acts::eBoundLoc1] = particle->phi();
76 pars[Acts::eBoundTheta] = particle->theta();
77 pars[Acts::eBoundQOverP] = particle->charge() /
energyToActs(particle->pt() * std::cosh(particle->eta()));
78 startPars = Acts::BoundTrackParameters{startSurf, pars, std::nullopt,
81 auto steps =
m_extrapolationTool->propagationSteps(ctx, *startPars, Acts::Direction::Forward(), 50._m);
87 std::stringstream sstr{};
88 unsigned surfCounter{0};
89 for (
const auto& step : steps->first) {
93 sstr<<
" --- "<<(++surfCounter)<<
" @"<<
Amg::toString(step.position)
94 <<
", perp: "<<step.position.perp()
95 <<
", theta: "<<step.momentum.theta()
96 <<
", phi: "<<step.momentum.phi();
97 if (
const Acts::TrackingVolume* vol =
98 trackingGeo->findVolume(step.surface->geometryId().withBoundary(0).withSensitive(0)); vol !=
nullptr) {
99 sstr<<
", volume: "<<vol->volumeName();
101 sstr<<
", surface @"<<
Amg::toString(step.surface->center(tgContext))
102 <<
", id: "<<step.surface->geometryId()
103 <<
", bounds: "<<step.surface->bounds()<<std::endl;
104 if (passedSurfaces.insert(step.surface).second) {
105 Acts::GeometryView3D::drawSurface(visualHelper, *step.surface,
106 tgContext, Acts::Transform3::Identity(),
107 Acts::s_viewPassive);
110 ATH_MSG_VERBOSE(__func__<<
"() "<<__LINE__<<
" - Propagated track particle "<<particle->index()
111 <<
" with "<<(particle->pt()*1.e-3)<<
" [GeV], eta: "<<particle->eta()
112 <<
", phi: "<<particle->phi()<<
", q: "<<particle->charge()
114 visualHelper.write(std::format(
"{:}/Track_{:}_pt_{:}_eta_{:}_phi_{:}.obj", outDir,
115 particle->index(),
toString(particle->pt() / 1.e3),
117 visualHelper.clear();
119 return StatusCode::SUCCESS;
xAOD::ParticleHypothesis convert(Acts::ParticleHypothesis h)
void drawPropagation(const std::vector< Acts::detail::Step > &steps, Acts::ObjVisualization3D &visualHelper, const Acts::ViewConfig &viewConfig=Acts::s_viewLine)
Draws the recorded propagation steps as a polygon line.