41 std::vector<float>& translation,
42 std::vector<float>& rotation,
43 std::vector<float>& boundValues,
44 const Acts::Surface* surface,
45 const Acts::GeometryContext& geoContext) {
50 switch (surface->type()){
51 using enum Acts::Surface::SurfaceType;
79 Acts::RotationMatrix3 lRotation =
80 surface->localToGlobalTransform(geoContext).rotation();
81 Acts::Vector3 eulerAngles = lRotation.eulerAngles(2, 1, 0);
82 Acts::Vector3 lTranslation = surface->center(geoContext);
84 for (
int i = 0; i < 3; ++i) {
85 rotation.push_back(eulerAngles[i]);
86 translation.push_back(lTranslation[i]);
89 const std::vector<double>& values = surface->bounds().values();
90 boundValues.insert(boundValues.end(), values.begin(), values.end());
101 const Acts::GeometryContext& geo) {
103 std::vector<float> translation, rotation, bounds;
104 encodeSurface(surfaceType, translation, rotation, bounds, surface, geo);
106 s->setSurfaceType(surfaceType);
107 s->setTranslation(translation);
108 s->setRotation(rotation);
109 s->setBoundValues(bounds);
114 const std::vector<float>& rotation,
const std::vector<float>& boundValues) {
125 switch (surfaceType) {
128 return Acts::Surface::makeShared<Acts::ConeSurface>(std::move(transform),
129 boundValues[0], boundValues[1], boundValues[2],
130 decodeHalfPhiSector(boundValues[3]));
132 return Acts::Surface::makeShared<Acts::CylinderSurface>(std::move(transform),
133 boundValues[0], boundValues[1], decodeHalfPhiSector(boundValues[2]),
134 boundValues[3], boundValues[4]);
136 return Acts::Surface::makeShared<Acts::DiscSurface>(std::move(transform),
137 boundValues[0], boundValues[1], decodeHalfPhiSector(boundValues[2]));
139 return Acts::Surface::makeShared<Acts::PerigeeSurface>(std::move(transform));
141 Acts::Vector2
min(boundValues[0], boundValues[1]),
142 max(boundValues[2], boundValues[3]);
143 auto rBounds = std::make_shared<const Acts::RectangleBounds>(
min,
max);
144 return Acts::Surface::makeShared<Acts::PlaneSurface>(std::move(transform), rBounds);
146 return Acts::Surface::makeShared<Acts::StrawSurface>(std::move(transform),
147 boundValues[0], boundValues[1]);
150 THROW_EXCEPTION(
"EncodeSurface this type " <<
static_cast<int>(surfaceType)<<
151 " 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.