8 std::vector<float>& translation,
10 std::vector<float>& boundValues,
11 const Acts::Surface* surface,
12 const Acts::GeometryContext& geoContext) {
14 if (surface ==
nullptr) {
25 }
else if (surface->type() == Acts::Surface::Perigee) {
26 surfaceType = xAOD::SurfaceType::Perigee;
32 throw std::out_of_range(
33 "encodeSurface this type " +
35 " of Acts Surface can not be saved in xAOD::TrackSurface");
39 Acts::RotationMatrix3 lRotation =
40 surface->transform(geoContext).rotation();
41 Acts::Vector3 eulerAngles = lRotation.eulerAngles(2, 1, 0);
42 Acts::Vector3 lTranslation = surface->center(geoContext);
44 for (
int i = 0;
i < 3;
i++) {
46 translation.push_back(lTranslation[
i]);
50 const std::vector<double>&
values = surface->bounds().values();
52 boundValues.push_back(
v);
56 const Acts::Surface* surface,
57 const Acts::GeometryContext&
geo) {
59 s->boundValues[
i], surface,
geo);
63 const Acts::GeometryContext&
geo) {
65 std::vector<float> translation,
rotation, bounds;
68 s->setSurfaceType(surfaceType);
69 s->setTranslation(translation);
71 s->setBoundValues(bounds);
76 const std::vector<float>&
rotation,
const std::vector<float>& boundValues,
77 const Acts::GeometryContext&) {
83 Acts::Translation3(translation[0], translation[1], translation[2]));
85 Acts::AngleAxis3(
rotation[0], Acts::Vector3(0., 0., 1.));
87 Acts::AngleAxis3(
rotation[1], Acts::Vector3(0., 1., 0.));
89 Acts::AngleAxis3(
rotation[2], Acts::Vector3(1., 0., 0.));
93 auto surface = Acts::Surface::makeShared<Acts::ConeSurface>(
94 transform, boundValues[0], boundValues[1], boundValues[2],
102 boundValues[2] >
M_PI - 0.001 ?
M_PI - 0.001 : boundValues[2];
103 auto surface = Acts::Surface::makeShared<Acts::CylinderSurface>(
104 transform, boundValues[0], boundValues[1], fixedPhi, boundValues[3],
110 auto surface = Acts::Surface::makeShared<Acts::DiscSurface>(
111 transform, boundValues[0], boundValues[1], boundValues[2]);
116 auto surface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
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);
125 Acts::Surface::makeShared<Acts::PlaneSurface>(
transform, rBounds);
130 auto surface = Acts::Surface::makeShared<Acts::StrawSurface>(
131 transform, boundValues[0], boundValues[1]);
134 throw std::out_of_range(
135 "encodeSurface this type " +
137 " of Acts Surface can not be saved in xAOD::TrackSurface");
146 s->boundValues(),
geo);
151 const Acts::GeometryContext&
geo) {
153 s->boundValues[
i],
geo);