32 m_bounds(other.m_bounds) {}
35 double alpha,
bool symmetric)
38 m_bounds(std::make_shared<const
ConeBounds>(alpha, symmetric)) {}
41 double alpha,
double zmin,
double zmax,
45 m_bounds(std::make_shared<const
ConeBounds>(alpha, zmin, zmax, halfPhi)) {
49 const std::shared_ptr<const ConeBounds>& cbounds)
56 const Vector3D& sfCenter = center(gctx);
60 return Vector3D(sfCenter.x() + bounds().r(sfCenter.z()), sfCenter.y(),
91 Vector3D measY = rotSymmetryAxis(gctx);
97 mFrame.col(0) = measX;
98 mFrame.col(1) = measY;
99 mFrame.col(2) = measDepth;
126 double r = loc3Dframe.z() * bounds().tanAlpha();
128 Vector2D(r * atan2(loc3Dframe.y(), loc3Dframe.x()), loc3Dframe.z());
130 double inttol = r * 0.0001;
131 inttol = (inttol < 0.01) ? 0.01 : 0.01;
132 return ((
std::abs(
perp(loc3Dframe) - r) > inttol) ?
false :
true);
142 double sgn = posLocal.z() > 0. ? -1. : +1.;
145 Vector3D normalC(cos(phi) * cosAlpha, sin(phi) * cosAlpha, sgn * sinAlpha);
150 double cAlpha = normalC.dot(direction);
155 return "Acts::ConeSurface";
163 sgn = lposition[Acts::eLOC_Z] > 0 ? -1. : +1.;
166 Vector3D localNormal(cos(phi) * cosAlpha, sin(phi) * cosAlpha,
177 if (m_transform || (m_associatedDetElement !=
nullptr)) {
181 return pos3D.normalized();
186 return (*m_bounds.get());
192 std::vector<Vector3D> vertices;
193 std::vector<Polyhedron::FaceType> faces;
194 std::vector<Polyhedron::FaceType> triangularMesh;
199 if (minZ == -std::numeric_limits<double>::infinity() or
200 maxZ == std::numeric_limits<double>::infinity()) {
201 throw std::domain_error(
202 "Polyhedron repr of boundless surface not possible");
208 bool tipExists =
false;
210 vertices.push_back(ctransform *
Vector3D(0., 0., 0.));
217 bool fullCone = (hPhiSec ==
M_PI);
222 avgPhi - hPhiSec, avgPhi + hPhiSec, {avgPhi});
225 std::vector<double> coneSides;
227 coneSides.push_back(minZ);
230 coneSides.push_back(maxZ);
232 for (
auto&
z : coneSides) {
234 size_t firstIv = vertices.size();
238 for (
unsigned int iseg = 0; iseg < phiSegs.size() - 1; ++iseg) {
239 int addon = (iseg == phiSegs.size() - 2 and not fullCone) ? 1 : 0;
241 phiSegs[iseg + 1], lseg, addon,
242 zoffset, ctransform);
246 for (
size_t iv = firstIv + 2; iv < vertices.size() + 1; ++iv) {
251 faces.push_back({
one,
two, three});
256 faces.push_back({0, firstIv, vertices.size() - 1});
258 faces.push_back({0, vertices.size() - 1, firstIv});
265 triangularMesh = faces;
269 faces = facesMesh.first;
270 triangularMesh = facesMesh.second;
272 return Polyhedron(vertices, faces, triangularMesh);