21 std::vector<float>& translation,
22 std::vector<float>& rotation,
23 std::vector<float>& boundValues,
24 const Acts::Surface* surface,
25 const Acts::GeometryContext& geoContext) {
30 switch (surface->type()){
31 using enum Acts::Surface::SurfaceType;
59 Acts::RotationMatrix3 lRotation =
60 surface->localToGlobalTransform(geoContext).rotation();
61 Acts::Vector3 eulerAngles = lRotation.eulerAngles(2, 1, 0);
62 Acts::Vector3 lTranslation = surface->center(geoContext);
64 for (
int i = 0; i < 3; ++i) {
65 rotation.push_back(eulerAngles[i]);
66 translation.push_back(lTranslation[i]);
69 const std::vector<double>& values = surface->bounds().values();
70 boundValues.insert(boundValues.end(), values.begin(), values.end());
81 const Acts::GeometryContext& geo) {
83 std::vector<float> translation, rotation, bounds;
84 encodeSurface(surfaceType, translation, rotation, bounds, surface, geo);
86 s->setSurfaceType(surfaceType);
87 s->setTranslation(translation);
88 s->setRotation(rotation);
89 s->setBoundValues(bounds);
94 const std::vector<float>& rotation,
const std::vector<float>& boundValues) {
105 switch (surfaceType) {
108 return Acts::Surface::makeShared<Acts::ConeSurface>(std::move(transform),
109 boundValues[0], boundValues[1], boundValues[2], boundValues[3]);
112 const float fixedPhi = boundValues[2] >
M_PI - 0.001 ?
M_PI - 0.001 : boundValues[2];
113 return Acts::Surface::makeShared<Acts::CylinderSurface>(std::move(transform),
114 boundValues[0], boundValues[1], fixedPhi, boundValues[3], boundValues[4]);
116 return Acts::Surface::makeShared<Acts::DiscSurface>(std::move(transform),
117 boundValues[0], boundValues[1], boundValues[2]);
119 return Acts::Surface::makeShared<Acts::PerigeeSurface>(std::move(transform));
121 Acts::Vector2
min(boundValues[0], boundValues[1]),
122 max(boundValues[2], boundValues[3]);
123 auto rBounds = std::make_shared<const Acts::RectangleBounds>(
min,
max);
124 return Acts::Surface::makeShared<Acts::PlaneSurface>(std::move(transform), rBounds);
126 return Acts::Surface::makeShared<Acts::StrawSurface>(std::move(transform),
127 boundValues[0], boundValues[1]);
130 THROW_EXCEPTION(
"EncodeSurface this type " <<
static_cast<int>(surfaceType)<<
131 " of xAOD::surface cannot be converted into an Acts one");
void encodeSurface(xAOD::TrackSurfaceAuxContainer *backend, size_t index, const Acts::Surface *surface, const Acts::GeometryContext &geoContext)
Prepares persistifiable representation of surface into xAOD::TrackSurface object.