35 m_bounds(std::make_shared<const
ConeBounds>(alpha, symmetric)) {}
38 double zmin,
double zmax,
double halfPhi)
41 m_bounds(std::make_shared<const
ConeBounds>(alpha, zmin, zmax, halfPhi)) {
45 const std::shared_ptr<const ConeBounds>& cbounds)
52 const Vector3D& sfCenter = center(gctx);
56 return Vector3D(sfCenter.x() + bounds().r(sfCenter.z()), sfCenter.y(),
87 Vector3D measY = rotSymmetryAxis(gctx);
93 mFrame.col(0) = measX;
94 mFrame.col(1) = measY;
95 mFrame.col(2) = measDepth;
116 double r = loc3Dframe.z() * bounds().tanAlpha();
121 {r * atan2(loc3Dframe.y(), loc3Dframe.x()), loc3Dframe.z()});
130 double sgn = posLocal.z() > 0. ? -1. : +1.;
133 Vector3D normalC(
cos(phi) * cosAlpha, sin(phi) * cosAlpha, sgn * sinAlpha);
136 double cAlpha = normalC.dot(direction);
141 return "Acts::ConeSurface";
149 sgn = lposition[Acts::eBoundLoc1] > 0 ? -1. : +1.;
152 Vector3D localNormal(
cos(phi) * cosAlpha, sin(phi) * cosAlpha,
163 return pos3D.normalized();
168 return (*m_bounds.get());
174 std::vector<Vector3D> vertices;
175 std::vector<Polyhedron::FaceType> faces;
176 std::vector<Polyhedron::FaceType> triangularMesh;
181 if (minZ == -std::numeric_limits<double>::infinity() or
182 maxZ == std::numeric_limits<double>::infinity()) {
183 throw std::domain_error(
184 "Polyhedron repr of boundless surface not possible");
190 bool tipExists =
false;
192 vertices.push_back(ctransform *
Vector3D(0., 0., 0.));
199 bool fullCone = (hPhiSec ==
M_PI);
204 avgPhi - hPhiSec, avgPhi + hPhiSec, {avgPhi});
207 std::vector<double> coneSides;
209 coneSides.push_back(minZ);
212 coneSides.push_back(maxZ);
214 for (
auto&
z : coneSides) {
216 size_t firstIv = vertices.size();
218 double r =
std::abs(
z) * bounds().tanAlpha();
220 for (
unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) {
221 int addon = (iseg == phiSegs.size() - 2 and not fullCone) ? 1 : 0;
223 phiSegs[iseg + 1], lseg, addon,
224 zoffset, ctransform);
228 for (
size_t iv = firstIv + 2; iv < vertices.size() + 1; ++iv) {
233 faces.push_back({
one,
two, three});
238 faces.push_back({0, firstIv, vertices.size() - 1});
240 faces.push_back({0, vertices.size() - 1, firstIv});
247 triangularMesh = faces;
251 faces = facesMesh.first;
252 triangularMesh = facesMesh.second;
254 return Polyhedron(vertices, faces, triangularMesh,
false);