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;
58 Acts::RotationMatrix3 lRotation =
59 surface->transform(geoContext).rotation();
60 Acts::Vector3 eulerAngles = lRotation.eulerAngles(2, 1, 0);
61 Acts::Vector3 lTranslation = surface->center(geoContext);
63 for (
int i = 0; i < 3; ++i) {
64 rotation.push_back(eulerAngles[i]);
65 translation.push_back(lTranslation[i]);
68 const std::vector<double>& values = surface->bounds().values();
69 boundValues.insert(boundValues.end(), values.begin(), values.end());
80 const Acts::GeometryContext& geo) {
82 std::vector<float> translation, rotation, bounds;
83 encodeSurface(surfaceType, translation, rotation, bounds, surface, geo);
85 s->setSurfaceType(surfaceType);
86 s->setTranslation(translation);
87 s->setRotation(rotation);
88 s->setBoundValues(bounds);
93 const std::vector<float>& rotation,
const std::vector<float>& boundValues) {
104 switch (surfaceType) {
107 return Acts::Surface::makeShared<Acts::ConeSurface>(std::move(transform),
108 boundValues[0], boundValues[1], boundValues[2], boundValues[3]);
111 const float fixedPhi = boundValues[2] >
M_PI - 0.001 ?
M_PI - 0.001 : boundValues[2];
112 return Acts::Surface::makeShared<Acts::CylinderSurface>(std::move(transform),
113 boundValues[0], boundValues[1], fixedPhi, boundValues[3], boundValues[4]);
115 return Acts::Surface::makeShared<Acts::DiscSurface>(std::move(transform),
116 boundValues[0], boundValues[1], boundValues[2]);
118 return Acts::Surface::makeShared<Acts::PerigeeSurface>(std::move(transform));
120 Acts::Vector2
min(boundValues[0], boundValues[1]),
121 max(boundValues[2], boundValues[3]);
122 auto rBounds = std::make_shared<const Acts::RectangleBounds>(
min,
max);
123 return Acts::Surface::makeShared<Acts::PlaneSurface>(std::move(transform), rBounds);
125 return Acts::Surface::makeShared<Acts::StrawSurface>(std::move(transform),
126 boundValues[0], boundValues[1]);
129 THROW_EXCEPTION(
"EncodeSurface this type " <<
static_cast<int>(surfaceType)<<
130 " 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.