File indexing completed on 2024-04-06 12:04:14
0001
0002
0003 #include "DataFormats/GeometrySurface/interface/Cone.h"
0004 #include "DataFormats/GeometrySurface/interface/TangentPlane.h"
0005
0006 #include <iostream>
0007
0008 ConstReferenceCountingPointer<TangentPlane> Cone::tangentPlane(const GlobalPoint&) const {
0009
0010 std::cout << "*** WARNING: Cone::tangentPlane not implemented." << std::endl;
0011 abort();
0012 return ConstReferenceCountingPointer<TangentPlane>();
0013 }
0014
0015 ConstReferenceCountingPointer<TangentPlane> Cone::tangentPlane(const LocalPoint&) const {
0016
0017 std::cout << "*** WARNING: Cone::tangentPlane not implemented." << std::endl;
0018 abort();
0019 return ConstReferenceCountingPointer<TangentPlane>();
0020 }
0021
0022 Surface::Side Cone::side(const GlobalPoint& p, Scalar tolerance) const {
0023
0024
0025
0026
0027 GlobalPoint p1(p.x(), p.y(), p.z() - vertex().z());
0028
0029
0030 if (p1.mag() < tolerance)
0031 return SurfaceOrientation::onSurface;
0032 double delta = double(p1.theta()) - double(openingAngle());
0033 if (fabs(delta) < tolerance / p1.mag())
0034 return SurfaceOrientation::onSurface;
0035
0036 if (p1.theta() < Geom::pi() / 2.) {
0037 return (delta > 0. ? SurfaceOrientation::positiveSide : SurfaceOrientation::negativeSide);
0038 } else {
0039 return (delta > 0. ? SurfaceOrientation::negativeSide : SurfaceOrientation::positiveSide);
0040 }
0041 }