20#include "GaudiKernel/MsgStream.h"
21#include "GaudiKernel/SystemOfUnits.h"
28 10
e-2 * Gaudi::Units::mm;
97std::vector<std::unique_ptr<Trk::Surface>>
101 auto retsf = std::vector<std::unique_ptr<Trk::Surface>>();
106 bool isConcentric = transform.isApprox(Amg::Transform3D::Identity());
113 bottomDiscRot.col(0) = discRot.col(1);
114 bottomDiscRot.col(1) = discRot.col(0);
115 bottomDiscRot.col(2) = -discRot.col(2);
116 retsf.push_back(std::make_unique<Trk::DiscSurface>(
122 retsf.push_back(std::make_unique<Trk::DiscSurface>(
127 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
135 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
143 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
151 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
173 double posZ = gp.z();
174 double posR = gp.perp();
178 double deltaZ =
diff.z() - posZ;
182 bool isOnFace =
false;
183 bool intersectionIndicator = (
deltaR > 0.);
184 bool choiceIndicator =
false;
190 (posZ < (-
m_halfZ) && deltaZ > 0.)) {
194 (posZ >
m_halfZ && deltaZ < 0.)) {
199 (posR < m_innerRadius && deltaR > 0.)) {
216 if (intersectionIndicator) {
220 double zOfIntersect = intersectRmax.
yOfX;
222 if (std::abs(zOfIntersect) <=
m_halfZ)
223 return {(choiceIndicator || zOfIntersect > 0.)
230 (choiceIndicator || zOfIntersect > 0.)
238 double zOfIntersect = intersectRmin.
yOfX;
240 if (std::abs(zOfIntersect) <=
m_halfZ)
242 (choiceIndicator || zOfIntersect > 0.)
248 (choiceIndicator || zOfIntersect > 0.)
261 if (posZ < -
m_halfZ && deltaZ < 0.)
263 if (posZ >
m_halfZ && deltaZ > 0.)
272 double zOfIntersect = intersectRmax.
yOfX;
274 if (std::abs(zOfIntersect) <=
m_halfZ && zOfIntersect > 0.)
276 if (std::abs(zOfIntersect) <=
m_halfZ && zOfIntersect < 0.)
278 if (std::abs(zOfIntersect) >
m_halfZ && zOfIntersect < 0.)
280 if (std::abs(zOfIntersect) >
m_halfZ && zOfIntersect > 0.)
288 double zOfIntersect = intersectRmin.
yOfX;
290 if (std::abs(zOfIntersect) <=
m_halfZ && zOfIntersect > 0.)
292 if (std::abs(zOfIntersect) <=
m_halfZ && zOfIntersect < 0.)
294 if (std::abs(zOfIntersect) >
m_halfZ && zOfIntersect > 0.)
305 double posZ = gp.z();
306 double posR = gp.perp();
314 double deltaZ =
diff.z() - posZ;
317 int radiusSign =
deltaR > 0. ? 1 : -1;
328 double zOfIntersect = intersectR.
yOfX;
330 bool intersectsCylinder =
331 !isOnCylinder ? (zOfIntersect * zOfIntersect <=
m_halfZ *
m_halfZ)
335 if (intersectsCylinder && zOfIntersect > 0.)
337 if (intersectsCylinder && zOfIntersect <= 0.)
351std::shared_ptr<Trk::CylinderBounds>
357std::shared_ptr<Trk::CylinderBounds>
363std::shared_ptr<Trk::DiscBounds>
369std::shared_ptr<Trk::RectangleBounds>
372 return std::make_shared<Trk::RectangleBounds>(
381 std::stringstream temp_sl;
382 temp_sl << std::setiosflags(std::ios::fixed);
383 temp_sl << std::setprecision(2);
384 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
394 std::stringstream temp_sl;
395 temp_sl << std::setiosflags(std::ios::fixed);
396 temp_sl << std::setprecision(2);
397 temp_sl <<
"Trk::CylinderVolumeBounds: (rMin, rMax, halfPhi, halfZ) = ";
Scalar deltaR(const MatrixBase< Derived > &vec) const
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Bounds for a cylindrical Volume, the decomposeToSurfaces method creates a vector of up to 6 surfaces:
MsgStream & dump(MsgStream &sl) const override final
Output Method for MsgStream.
double mediumRadius() const
This method returns the medium radius.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces(const Amg::Transform3D &transform) override final
Method to decompose the Bounds into boundarySurfaces.
CylinderVolumeBoundaryAccessors m_boundaryAccessors
Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () w...
virtual ~CylinderVolumeBounds()
Destructor.
double innerRadius() const
This method returns the inner radius.
double halflengthZ() const
This method returns the halflengthZ.
static const double s_numericalStable
numerical stability
std::shared_ptr< CylinderBounds > outerCylinderBounds() const
This method returns the associated CylinderBounds of the outer CylinderSurfaces.
std::shared_ptr< DiscBounds > bottomDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
CylinderVolumeBounds & operator=(const CylinderVolumeBounds &cylbo)
Assignment operator.
CylinderVolumeBounds()
Default Constructor.
std::shared_ptr< DiscBounds > topDiscBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
double halfPhiSector() const
This method returns the halfPhiSector angle.
ObjectAccessor boundarySurfaceAccessor(const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override final
Provide accessor for BoundarySurfaces.
std::shared_ptr< CylinderBounds > innerCylinderBounds() const
This method returns the associated CylinderBounds of the inner CylinderSurfaces.
std::shared_ptr< RectangleBounds > sectorPlaneBounds() const
This method returns the associated PlaneBounds limiting a sectoral CylinderVolume.
VolumeBounds()
Default Constructor.
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D
@ CylinderNegativeFace
Neg.
@ CylinderZincrease
Cylinder hit, then pos.
@ CylinderPositiveFace
Pos.
@ CylinderZdecrease
Cylinder hit, the neg.
@ TubeOutsideZminZdecrease
Accessor type [ 0,3,2,1 ] - inverse case.
@ TubeRdecreaseZdecrease
Accessor type [ 3,0,1,2 ].
@ TubeOutsideZmaxZincrease
Accessor type [ 1,3,2,0 ] - inverse case.
@ TubeZincreaseRincrease
Accessor type [ 1,2,0,3 ].
@ TubeRincreaseZdecrease
Accessor type [ 2,0,1,3 ].
@ TubeOutsideRminRdecrease
Accessor type [ 3,1,0,2] - inverse case.
@ TubeZdecreaseRdecrease
Accessor type [ 0,3,1,2 ].
@ TubeRincreaseZincrease
Accessor type [ 2,1,0,3 ].
@ TubeZincreaseRdecrease
Accessor type [ 1,3,0,2 ].
@ TubeRdecreaseZincrease
Accessor type [ 3,1,0,2 ].
@ TubeOutsideRmaxRincrease
Accessor type [ 2,1,0,3 ] - inverse case.
@ TubeZdecreaseRincrease
Accessor type [ 0,2,1,3 ].
@ StandardSectoralCylinder
double yOfX
the result of x