ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::GeometryRealmConvTool Class Reference

Implementation of the IGeometryRealmConvTool. More...

#include <GeometryRealmConvTool.h>

Inheritance diagram for ActsTrk::GeometryRealmConvTool:
Collaboration diagram for ActsTrk::GeometryRealmConvTool:

Public Member Functions

 ~GeometryRealmConvTool ()
virtual StatusCode initialize () override final
virtual SurfacePtr_t convertSurfaceToTrk (const EventContext &ctx, const Acts::Surface &actsSurface) const override final
 Translates the parsed Acts surface into a Trk::Surface via associated detector element.
virtual std::shared_ptr< const Acts::Surface > convertSurfaceToActs (const Trk::Surface &atlasSurface) const override final
 Translate the parsed Trk surface into an Acts surface.
virtual Acts::BoundTrackParameters convertTrackParametersToActs (const EventContext &ctx, const Trk::TrackParameters &atlasParameter, Trk::ParticleHypothesis hypothesis=Trk::pion) const override final
 Translates the Trk track parameters into bound Acts track parameters with a particle hypothesis.
virtual std::unique_ptr< Trk::TrackParametersconvertTrackParametersToTrk (const EventContext &ctx, const Acts::BoundTrackParameters &actsParameters) const override final
 Translates the bounded Acts track parameters to Trk parameters.

Private Member Functions

std::shared_ptr< Trk::SurfaceBoundstranslateBounds (const Acts::SurfaceBounds &bounds) const
 Translate the Acts surface bounds to its equivalent in the Trk realm.
SurfacePtr_t translateFreeSurface (const EventContext &ctx, const Acts::Surface &surface) const
 Translate a surface that is not associated with any detector element.

Private Attributes

PublicToolHandle< ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", ""}
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry {}
std::unordered_map< Identifier, std::shared_ptr< const Acts::Surface > > m_actsSurfaceMap {}
Gaudi::Property< bool > m_extractMuonSurfaces
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_muonMgrKey {this, "MuonManagerKey", "MuonDetectorManager"}
 Detector manager to fetch the legacy Trk surfaces.

Detailed Description

Implementation of the IGeometryRealmConvTool.

At initialization stage the tool associates every Acts::Surface with an ATLAS identifier to convert the sensitive surfaces without extra memory allocation. If portals and free surfaces are converted as new free Trk::Surfaces with bounds. To return aligned muon surfaces in the Acts -> Trk conversion, the tool has a data dependency on the legacy Muon::DetectorManager

Definition at line 27 of file GeometryRealmConvTool.h.

Constructor & Destructor Documentation

◆ ~GeometryRealmConvTool()

ActsTrk::GeometryRealmConvTool::~GeometryRealmConvTool ( )
default

Member Function Documentation

◆ convertSurfaceToActs()

std::shared_ptr< const Acts::Surface > ActsTrk::GeometryRealmConvTool::convertSurfaceToActs ( const Trk::Surface & atlasSurface) const
finaloverridevirtual

Translate the parsed Trk surface into an Acts surface.

The detector element identifier of the surface needs to be filled into the internal tool's look-up map. Otherwise an exception is thrown.

Parameters
atlasSurfaceRefrence to the Trk surface to translate

Definition at line 195 of file GeometryRealmConvTool.cxx.

195 {
196 Identifier atlasID = atlasSurface.associatedDetectorElementIdentifier();
197 auto it = m_actsSurfaceMap.find(atlasID);
198 if (it != m_actsSurfaceMap.end()) {
199 return it->second;
200 }
201 const Amg::Transform3D& trf{atlasSurface.transform()};
202 switch (atlasSurface.type()){
203 using enum Trk::SurfaceType;
204 case Plane:
205 return Acts::Surface::makeShared<Acts::PlaneSurface>(trf);
206 case Perigee:
207 return Acts::Surface::makeShared<Acts::PerigeeSurface>(trf);
208 case Line:
209 return Acts::Surface::makeShared<Acts::StrawSurface>(trf);
210 // TODO - implement the missing types?
211 default: {
212 break;
213 }
214 }
215 std::stringstream surfStr{};
216 atlasSurface.dump(surfStr);
217 throw std::domain_error(std::format("Failed to translate surface {:}", surfStr.str()));
218 }
std::unordered_map< Identifier, std::shared_ptr< const Acts::Surface > > m_actsSurfaceMap
virtual MsgStream & dump(MsgStream &sl) const
Output Method for MsgStream, to be overloaded by child classes.
Definition Surface.cxx:157
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Identifier associatedDetectorElementIdentifier() const
return Identifier of the associated Detector Element
virtual constexpr SurfaceType type() const =0
Returns the Surface type to avoid dynamic casts.
Eigen::Affine3d Transform3D
SurfaceType
This enumerator simplifies the persistency & calculations,.

◆ convertSurfaceToTrk()

SurfacePtr_t ActsTrk::GeometryRealmConvTool::convertSurfaceToTrk ( const EventContext & ctx,
const Acts::Surface & actsSurface ) const
finaloverridevirtual

Translates the parsed Acts surface into a Trk::Surface via associated detector element.

For the ID measurements a direct link is provided and for the muon measurements the look-up is performed via the associated Identifier and the detector manager. Other surfaces trigger the creation of new free Trk surfaces

Parameters
ctxThe current event context
actsSurfaceRefrence to the acts surface to translate

Produce a new free surface

Definition at line 161 of file GeometryRealmConvTool.cxx.

162 {
163 const auto *detEleBase= dynamic_cast<const IDetectorElementBase*>(actsSurface.surfacePlacement());
164 if (!detEleBase) {
165 return translateFreeSurface(ctx, actsSurface);
166 }
167 switch (detEleBase->detectorType()) {
168 using enum DetectorType;
169 case Pixel:
170 case Sct:
171 case Hgtd:
172 case Trt: {
173 const auto actsElement = dynamic_cast<const ActsDetectorElement*>(detEleBase);
174 if (actsElement) {
175 return SurfacePtr_t{&actsElement->atlasSurface()};
176 }
177 break;
178 } case Mdt:
179 case Rpc:
180 case Tgc:
181 case Csc:
182 case sTgc:
183 case Mm: {
184 const MuonGM::MuonDetectorManager* detMgr{nullptr};
185 if (!SG::get(detMgr, m_muonMgrKey, ctx).isSuccess() || !detMgr) {
186 THROW_EXCEPTION("Failed to retrieve the muon detector manager");
187 }
188 return SurfacePtr_t{&detMgr->getReadoutElement(detEleBase->identify())->surface(detEleBase->identify())};
189 } default:
190 break;
191 }
193 return translateFreeSurface(ctx, actsSurface);
194 }
ActsTrk::GeometryRealmConvTool::SurfacePtr_t SurfacePtr_t
SurfacePtr_t translateFreeSurface(const EventContext &ctx, const Acts::Surface &surface) const
Translate a surface that is not associated with any detector element.
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muonMgrKey
Detector manager to fetch the legacy Trk surfaces.
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Get any read out element.
virtual const Surface & surface() const =0
Return surface associated with this detector element.
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ sTgc
Micromegas (NSW).
@ Rpc
Monitored Drift Tubes.
@ Csc
Thin gap champers.
@ Mdt
MuonSpectrometer.
@ Pixel
Definition DetType.h:13
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

◆ convertTrackParametersToActs()

Acts::BoundTrackParameters ActsTrk::GeometryRealmConvTool::convertTrackParametersToActs ( const EventContext & ctx,
const Trk::TrackParameters & atlasParameter,
Trk::ParticleHypothesis hypothesis = Trk::pion ) const
finaloverridevirtual

Translates the Trk track parameters into bound Acts track parameters with a particle hypothesis.

Parameters
atlasParameterThe Trk parameters to translate.
gctsGeometry context needed for special treatment of the annulus bounds
hypothesisTrack hypothesis to use

Definition at line 221 of file GeometryRealmConvTool.cxx.

223 {
224
225 std::shared_ptr<const Acts::Surface> actsSurface{};
226 Acts::BoundVector params{};
227 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
228
229 // get the associated surface
230 try {
231 actsSurface = convertSurfaceToActs(atlasParameter.associatedSurface());
232 } catch (const std::exception &e) {
233 ATH_MSG_ERROR("Could not find ACTS detector surface for this TrackParameter:");
234 ATH_MSG_ERROR(atlasParameter);
235 throw; // Nothing we can do, so just pass exception on...
236 }
237
238 // Construct track parameters
239 const auto& atlasParam{atlasParameter.parameters()};
240 if (actsSurface->bounds().type() == Acts::SurfaceBounds::BoundsType::eAnnulus) {
241 // Annulus surfaces are constructed differently in Acts/Trk so we need to
242 // convert local coordinates
243 const Amg::Vector3D& position{atlasParameter.position()};
244 auto result = actsSurface->globalToLocal(tgContext, position, atlasParameter.momentum());
245 if (result.ok()) {
246 params << (*result)[0], (*result)[1], atlasParam[Trk::phi0],
247 atlasParam[Trk::theta],
248 atlasParameter.charge() / (atlasParameter.momentum().mag() * 1_MeV),
249 0.;
250 } else {
251 ATH_MSG_WARNING("Unable to convert annulus surface - globalToLocal failed");
252 }
253 } else {
254 params << atlasParam[Trk::locX], atlasParam[Trk::locY],
255 atlasParam[Trk::phi0], atlasParam[Trk::theta],
256 atlasParameter.charge() / (atlasParameter.momentum().mag() * 1_MeV), 0.;
257 }
258
259 std::optional<Acts::BoundMatrix> cov{};
260 if (atlasParameter.covariance()) {
261 cov = Acts::BoundMatrix::Identity();
262 cov->topLeftCorner(5, 5) = *atlasParameter.covariance();
263
264 // Convert the covariance matrix from MeV
265 // FIXME: This needs to handle the annulus case as well - currently the cov
266 // is wrong for annulus surfaces
267 for (int i = 0; i < cov->rows(); ++i) {
268 (*cov)(i, 4) = (*cov)(i, 4) / 1_MeV;
269 }
270 for (int i = 0; i < cov->cols(); ++i) {
271 (*cov)(4, i) = (*cov)(4, i) / 1_MeV;
272 }
273 }
274 return Acts::BoundTrackParameters{actsSurface, params, std::move(cov),
275 ParticleHypothesis::convert(hypothesis)};
276 }
Scalar mag() const
mag method
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual std::shared_ptr< const Acts::Surface > convertSurfaceToActs(const Trk::Surface &atlasSurface) const override final
Translate the parsed Trk surface into an Acts surface.
PublicToolHandle< ITrackingGeometryTool > m_trackingGeometryTool
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
double charge() const
Returns the charge.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
xAOD::ParticleHypothesis convert(Acts::ParticleHypothesis h)
Eigen::Matrix< double, 3, 1 > Vector3D
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
@ phi0
Definition ParamDefs.h:65
@ theta
Definition ParamDefs.h:66
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ convertTrackParametersToTrk()

std::unique_ptr< Trk::TrackParameters > ActsTrk::GeometryRealmConvTool::convertTrackParametersToTrk ( const EventContext & ctx,
const Acts::BoundTrackParameters & actsParameters ) const
finaloverridevirtual

Translates the bounded Acts track parameters to Trk parameters.

The bound parameter surface must be translatble by the tool

Parameters
ctxEventContext
actsParameterRefrence to the bounded parameters to translate

Convert to free parameters

Back conversion to bound parameters of the helper plane

Definition at line 278 of file GeometryRealmConvTool.cxx.

279 {
280
281
282 std::optional<AmgSymMatrix(5)> cov = std::nullopt;
283 if (actsParameter.covariance()) {
284 AmgSymMatrix(5) newcov(actsParameter.covariance()->topLeftCorner<5, 5>());
285 // Convert the covariance matrix to GeV
286 for (int i = 0; i < newcov.rows(); i++) {
287 newcov(i, 4) = newcov(i, 4) * 1_MeV;
288 }
289 for (int i = 0; i < newcov.cols(); i++) {
290 newcov(4, i) = newcov(4, i) * 1_MeV;
291 }
292 cov = newcov;
293 }
294
295 const Acts::Surface &actsSurface = actsParameter.referenceSurface();
296 SurfacePtr_t trkSurface = convertSurfaceToTrk(ctx, actsSurface);
297 switch (actsSurface.type()) {
298 case Acts::Surface::SurfaceType::Cone: {
299 const auto &coneSurface = static_cast<const Trk::ConeSurface&>(*trkSurface);
300 return std::make_unique<Trk::AtaCone>(
301 actsParameter.get<Acts::eBoundLoc0>(),
302 actsParameter.get<Acts::eBoundLoc1>(),
303 actsParameter.get<Acts::eBoundPhi>(),
304 actsParameter.get<Acts::eBoundTheta>(),
305 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, coneSurface, cov);
306 } case Acts::Surface::SurfaceType::Cylinder: {
307 const auto &cylSurface{static_cast<const Trk::CylinderSurface&>(*trkSurface)};
308 return std::make_unique<Trk::AtaCylinder>(
309 actsParameter.get<Acts::eBoundLoc0>(),
310 actsParameter.get<Acts::eBoundLoc1>(),
311 actsParameter.get<Acts::eBoundPhi>(),
312 actsParameter.get<Acts::eBoundTheta>(),
313 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, cylSurface, cov);
314 } case Acts::Surface::SurfaceType::Disc: {
315 if (trkSurface->type() == Trk::SurfaceType::Disc) {
316 const auto& discSurface{static_cast<const Trk::DiscSurface&>(*trkSurface)};
317 return std::make_unique<Trk::AtaDisc>(
318 actsParameter.get<Acts::eBoundLoc0>(),
319 actsParameter.get<Acts::eBoundLoc1>(),
320 actsParameter.get<Acts::eBoundPhi>(),
321 actsParameter.get<Acts::eBoundTheta>(),
322 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, discSurface, cov);
323 } else if (trkSurface->type() == Trk::SurfaceType::Plane) {
324 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
325 auto& planeSurface{static_cast<const Trk::PlaneSurface&>(*trkSurface)};
326 // need to convert to plane position on plane surface (annulus bounds)
327 auto helperSurface = Acts::Surface::makeShared<Acts::PlaneSurface>(planeSurface.transform());
328
329 auto covpc = actsParameter.covariance().value();
331 Acts::FreeVector freePars = Acts::transformBoundToFreeParameters(actsSurface, tgContext,
332 actsParameter.parameters());
333
335 Acts::BoundVector targetPars = Acts::transformFreeToBoundParameters(freePars,
336 *helperSurface, tgContext).value();
337
338
339 Acts::FreeMatrix freeTransportJacobian{Acts::FreeMatrix::Identity()};
340
341 Acts::FreeVector freeToPathDerivatives{Acts::FreeVector::Zero()};
342 freeToPathDerivatives.head<3>() = freePars.segment<3>(Acts::eFreeDir0);
343
344 auto boundToFreeJacobian = actsSurface.boundToFreeJacobian(tgContext,
345 freePars.segment<3>(Acts::eFreePos0),
346 freePars.segment<3>(Acts::eFreeDir0));
347
348 Acts::BoundMatrix boundToBoundJac =
349 Acts::detail::boundToBoundTransportJacobian(tgContext, freePars,
350 boundToFreeJacobian, freeTransportJacobian,
351 freeToPathDerivatives, *helperSurface);
352
353 Acts::BoundMatrix targetCov{boundToBoundJac * covpc * boundToBoundJac.transpose()};
354
355 return std::make_unique<Trk::AtaPlane>(
356 targetPars[Acts::eBoundLoc0], targetPars[Acts::eBoundLoc1],
357 targetPars[Acts::eBoundPhi], targetPars[Acts::eBoundTheta],
358 targetPars[Acts::eBoundQOverP] * 1_MeV, planeSurface,
359 targetCov.topLeftCorner<5, 5>());
360 } else {
361 throw std::domain_error("Acts::DiscSurface is not associated with ATLAS disc or plane surface");
362 }
363 break;
364 } case Acts::Surface::SurfaceType::Perigee: {
365 const auto& perSurface = static_cast<const Trk::PerigeeSurface&>(*trkSurface);
366 return std::make_unique<Trk::Perigee>(
367 actsParameter.get<Acts::eBoundLoc0>(),
368 actsParameter.get<Acts::eBoundLoc1>(),
369 actsParameter.get<Acts::eBoundPhi>(),
370 actsParameter.get<Acts::eBoundTheta>(),
371 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, perSurface, cov);
372 } case Acts::Surface::SurfaceType::Plane: {
373 auto &plaSurface{static_cast<const Trk::PlaneSurface&>(*trkSurface)};
374 return std::make_unique<Trk::AtaPlane>(
375 actsParameter.get<Acts::eBoundLoc0>(),
376 actsParameter.get<Acts::eBoundLoc1>(),
377 actsParameter.get<Acts::eBoundPhi>(),
378 actsParameter.get<Acts::eBoundTheta>(),
379 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, plaSurface, cov);
380 } case Acts::Surface::SurfaceType::Straw: {
381 auto& lineSurface{static_cast<const Trk::StraightLineSurface&>(*trkSurface)};
382 return std::make_unique<Trk::AtaStraightLine>(
383 actsParameter.get<Acts::eBoundLoc0>(),
384 actsParameter.get<Acts::eBoundLoc1>(),
385 actsParameter.get<Acts::eBoundPhi>(),
386 actsParameter.get<Acts::eBoundTheta>(),
387 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, lineSurface, cov);
388 } case Acts::Surface::SurfaceType::Curvilinear: {
389 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
390 return std::make_unique<Trk::CurvilinearParameters>(
391 actsParameter.position(tgContext), actsParameter.get<Acts::eBoundPhi>(),
392 actsParameter.get<Acts::eBoundTheta>(),
393 actsParameter.get<Acts::eBoundQOverP>() * 1_MeV, cov);
394 } case Acts::Surface::SurfaceType::Other: {
395 break;
396 }
397 }
398 throw std::domain_error("Surface type not found");
399 }
#define AmgSymMatrix(dim)
virtual SurfacePtr_t convertSurfaceToTrk(const EventContext &ctx, const Acts::Surface &actsSurface) const override final
Translates the parsed Acts surface into a Trk::Surface via associated detector element.

◆ initialize()

StatusCode ActsTrk::GeometryRealmConvTool::initialize ( )
finaloverridevirtual

Definition at line 54 of file GeometryRealmConvTool.cxx.

54 {
55 if (parent() != toolSvc()) {
56 ATH_MSG_ERROR("The tool is initialized as a private tool but should be public");
57 return StatusCode::FAILURE;
58 }
60 m_trackingGeometryTool->trackingGeometry()->visitSurfaces([&](const Acts::Surface *surface) {
61 // find acts surface with the same detector element ID
62 if (!surface->isSensitive()) {
63 return;
64 }
65 const auto *actsElement = dynamic_cast<const IDetectorElementBase*>(surface->surfacePlacement());
66 if (!actsElement) {
67 return;
68 }
69 // Conversion from Acts to ATLAS surface impossible for the TRT so the TRT
70 // surfaces are not stored in this map
71 if (actsElement->detectorType() == DetectorType::Trt) {
72 return;
73 }
74 auto [it, ok] = m_actsSurfaceMap.insert(std::make_pair(actsElement->identify(), surface->getSharedPtr()));
75 if (!ok) {
76 ATH_MSG_WARNING("ATLAS ID " << actsElement->identify()
77 << " has two ACTS surfaces: "
78 << it->second->geometryId() << " and "
79 << surface->geometryId());
80 }
81 });
83 return StatusCode::SUCCESS;
84 }
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Property< bool > m_extractMuonSurfaces

◆ translateBounds()

std::shared_ptr< Trk::SurfaceBounds > ActsTrk::GeometryRealmConvTool::translateBounds ( const Acts::SurfaceBounds & bounds) const
private

Translate the Acts surface bounds to its equivalent in the Trk realm.

Note
Not all bounds are implemented
Parameters
boundsRefrence to the bounds to be translated

Definition at line 86 of file GeometryRealmConvTool.cxx.

86 {
87 switch (bounds.type()) {
88 using enum Acts::SurfaceBounds::BoundsType;
89 case eRectangle:{
90 using ParEnum_t = Acts::RectangleBounds::BoundValues;
91 const auto& cBounds = static_cast<const Acts::RectangleBounds&>(bounds);
92 return std::make_shared<Trk::RectangleBounds>(cBounds.get(ParEnum_t::eMaxX),
93 cBounds.get(ParEnum_t::eMaxY));
94 } case eTrapezoid: {
95 using ParEnum_t = Acts::TrapezoidBounds::BoundValues;
96 const auto& cBounds = static_cast<const Acts::TrapezoidBounds&>(bounds);
97 return std::make_shared<Trk::TrapezoidBounds>(cBounds.get(ParEnum_t::eHalfLengthXnegY),
98 cBounds.get(ParEnum_t::eHalfLengthXposY),
99 cBounds.get(ParEnum_t::eHalfLengthY));
100 } case eDisc: {
101 using ParEnum_t = Acts::RadialBounds::BoundValues;
102 const auto& cBounds = static_cast<const Acts::RadialBounds&>(bounds);
103 return std::make_shared<Trk::DiscBounds>(cBounds.get(ParEnum_t::eMinR),
104 cBounds.get(ParEnum_t::eMaxR),
105 cBounds.get(ParEnum_t::eAveragePhi),
106 cBounds.get(ParEnum_t::eHalfPhiSector));
107 } case eCylinder: {
108 using ParEnum_t = Acts::CylinderBounds::BoundValues;
109 const auto& cBounds = static_cast<const Acts::CylinderBounds&>(bounds);
110 return std::make_shared<Trk::CylinderBounds>(cBounds.get(ParEnum_t::eR),
111 cBounds.get(ParEnum_t::eHalfPhiSector),
112 cBounds.get(ParEnum_t::eAveragePhi),
113 cBounds.get(ParEnum_t::eHalfLengthZ));
114 } case eLine: {
115 using ParEnum_t = Acts::LineBounds::BoundValues;
116 const auto& cBounds = static_cast<const Acts::LineBounds&>(bounds);
117 return std::make_shared<Trk::CylinderBounds>(cBounds.get(ParEnum_t::eR),
118 cBounds.get(ParEnum_t::eHalfLengthZ));
119 } case eDiamond: {
120 using ParEnum_t = Acts::DiamondBounds::BoundValues;
121 const auto& cBounds = static_cast<const Acts::DiamondBounds&>(bounds);
122 return std::make_shared<Trk::DiamondBounds>(cBounds.get(ParEnum_t::eHalfLengthXnegY),
123 cBounds.get(ParEnum_t::eHalfLengthXzeroY),
124 cBounds.get(ParEnum_t::eHalfLengthXposY),
125 cBounds.get(ParEnum_t::eHalfLengthYneg),
126 cBounds.get(ParEnum_t::eHalfLengthYpos));
127 } default:
128 break;
129 }
130 THROW_EXCEPTION("The bounds "<<bounds<<" cannot be translated");
131 return nullptr;
132 }

◆ translateFreeSurface()

SurfacePtr_t ActsTrk::GeometryRealmConvTool::translateFreeSurface ( const EventContext & ctx,
const Acts::Surface & surface ) const
private

Translate a surface that is not associated with any detector element.

Bounds of the surface are also translated

Parameters
ctxThe event context to access the aligned detector
surfaceReference to the Acts surface for translation

Definition at line 133 of file GeometryRealmConvTool.cxx.

134 {
135 const Acts::GeometryContext tgContext = m_trackingGeometryTool->getGeometryContext(ctx).context();
136 const Amg::Transform3D& trf{surface.localToGlobalTransform(tgContext)};
137 switch (surface.type()) {
138 using enum Acts::Surface::SurfaceType;
139 case Plane:
140 return SurfacePtr_t{new Trk::PlaneSurface(trf, translateBounds(surface.bounds()))};
141 case Cylinder:
142 return SurfacePtr_t{new Trk::CylinderSurface(trf,
143 std::dynamic_pointer_cast<Trk::CylinderBounds>(translateBounds(surface.bounds())))};
144 case Perigee:
145 return SurfacePtr_t{new Trk::PerigeeSurface(trf)};
146 case Disc:
147 return SurfacePtr_t{new Trk::DiscSurface(trf,
148 std::dynamic_pointer_cast<Trk::DiscBounds>(translateBounds(surface.bounds())))};
149 case Straw: {
150 auto bounds = std::dynamic_pointer_cast<Trk::CylinderBounds>(translateBounds(surface.bounds()));
151 return SurfacePtr_t{new Trk::StraightLineSurface(trf, bounds->r(), bounds->halflengthZ())};
152 } default:
153 break;
154 }
155 THROW_EXCEPTION("ActsToTrkConverterTool() - Surface cannot be translated "
156 <<surface.toString(tgContext));
157
158 return nullptr;
159 }
std::shared_ptr< Trk::SurfaceBounds > translateBounds(const Acts::SurfaceBounds &bounds) const
Translate the Acts surface bounds to its equivalent in the Trk realm.

Member Data Documentation

◆ m_actsSurfaceMap

std::unordered_map<Identifier, std::shared_ptr<const Acts::Surface> > ActsTrk::GeometryRealmConvTool::m_actsSurfaceMap {}
private

Definition at line 63 of file GeometryRealmConvTool.h.

63{};

◆ m_extractMuonSurfaces

Gaudi::Property<bool> ActsTrk::GeometryRealmConvTool::m_extractMuonSurfaces
private
Initial value:
{this, "ExtractMuonSurfaces", false,
"If True, use the MuonDetectorManager to extract the Muon surfaces"}

Definition at line 65 of file GeometryRealmConvTool.h.

65 {this, "ExtractMuonSurfaces", false,
66 "If True, use the MuonDetectorManager to extract the Muon surfaces"};

◆ m_muonMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> ActsTrk::GeometryRealmConvTool::m_muonMgrKey {this, "MuonManagerKey", "MuonDetectorManager"}
private

Detector manager to fetch the legacy Trk surfaces.

Definition at line 69 of file GeometryRealmConvTool.h.

69{this, "MuonManagerKey", "MuonDetectorManager"};

◆ m_trackingGeometry

std::shared_ptr<const Acts::TrackingGeometry> ActsTrk::GeometryRealmConvTool::m_trackingGeometry {}
private

Definition at line 62 of file GeometryRealmConvTool.h.

62{};

◆ m_trackingGeometryTool

PublicToolHandle<ITrackingGeometryTool> ActsTrk::GeometryRealmConvTool::m_trackingGeometryTool {this, "TrackingGeometryTool", ""}
private

Definition at line 60 of file GeometryRealmConvTool.h.

60{this, "TrackingGeometryTool", ""};

The documentation for this class was generated from the following files: