ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::BevelledCylinderVolumeBounds Class Referencefinal

Bounds for a cylindrical Volume, the decomposeToSurfaces method creates a vector of up to 6 surfaces: More...

#include <BevelledCylinderVolumeBounds.h>

Inheritance diagram for Trk::BevelledCylinderVolumeBounds:
Collaboration diagram for Trk::BevelledCylinderVolumeBounds:

Public Member Functions

 BevelledCylinderVolumeBounds ()
 Default Constructor.
 BevelledCylinderVolumeBounds (double rinner, double router, double halfPhiSector, double halez, int type)
 Constructor - cylinder segment bevelled in R.
 BevelledCylinderVolumeBounds (const BevelledCylinderVolumeBounds &cylbo)
 Copy Constructor.
virtual ~BevelledCylinderVolumeBounds ()
 Destructor.
BevelledCylinderVolumeBoundsoperator= (const BevelledCylinderVolumeBounds &cylbo)
 Assignment operator.
BevelledCylinderVolumeBoundsclone () const override
 Virtual constructor.
bool inside (const Amg::Vector3D &, double tol=0.) const override
 This method checks if position in the 3D volume frame is inside the cylinder.
virtual std::vector< std::unique_ptr< Trk::Surface > > decomposeToSurfaces (const Amg::Transform3D &transform) override
 Method to decompose the Bounds into boundarySurfaces.
ObjectAccessor boundarySurfaceAccessor (const Amg::Vector3D &gp, const Amg::Vector3D &dir, bool forceInside=false) const override
 Provide accessor for BoundarySurfaces.
double innerRadius () const
 This method returns the inner radius.
double outerRadius () const
 This method returns the outer radius.
double mediumRadius () const
 This method returns the medium radius.
double deltaRadius () const
 This method returns the delta radius.
double halfPhiSector () const
 This method returns the halfPhiSector angle.
double halflengthZ () const
 This method returns the halflengthZ.
double thetaMinus () const
 This method returns the thetaMinus.
double thetaPlus () const
 This method returns the thetaPlus.
int type () const
 This method returns the type.
MsgStream & dump (MsgStream &sl) const override
 Output Method for MsgStream.
std::ostream & dump (std::ostream &sl) const override
 Output Method for std::ostream.

Private Member Functions

std::shared_ptr< CylinderBoundsinnerBevelledCylinderBounds () const
 This method returns the associated BevelledCylinderBounds of the inner BevelledCylinderSurfaces.
std::shared_ptr< CylinderBoundsouterBevelledCylinderBounds () const
 This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
std::shared_ptr< RectangleBoundsinnerBevelledPlaneBounds () const
 This method returns the associated plane surface bounds of the inner bevelled surface.
std::shared_ptr< RectangleBoundsouterBevelledPlaneBounds () const
 This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
std::shared_ptr< EllipseBoundsbottomEllipseBounds () const
 This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
std::shared_ptr< EllipseBoundstopEllipseBounds () const
 This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
std::shared_ptr< CylinderBoundsinnerCylinderBounds () const
 This method returns the associated CylinderBounds of the inner CylinderSurfaces.
std::shared_ptr< CylinderBoundsouterCylinderBounds () const
 This method returns the associated CylinderBounds of the outer CylinderSurfaces.
std::shared_ptr< DiscBoundsdiscBounds () const
 This method returns the associated DiscBounds for the bottom/top DiscSurface.
VolumesubtractedVolume () const
 This method returns the bevelled area volume.
std::shared_ptr< TrapezoidBoundssectorTrdBounds () const
 This method returns the associated PlaneBounds limiting a sectoral BevelledCylinderVolume.
std::shared_ptr< RectangleBoundssectorPlaneBounds () const
void createBoundarySurfaceAccessors ()
 Private method to construct the accessors.

Private Attributes

double m_innerRadius
double m_outerRadius
double m_halfPhiSector
double m_halfZ
double m_thetaMinus
double m_thetaPlus
int m_type
BevelledCylinderVolumeBoundaryAccessors m_boundaryAccessors
 Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () with TrkMagFieldUtils.
CxxUtils::CachedUniquePtr< Trk::Volumem_subtractedVolume

Static Private Attributes

static const double s_numericalStable
 numerical stability

Detailed Description

Bounds for a cylindrical Volume, the decomposeToSurfaces method creates a vector of up to 6 surfaces:

case A) 3 Surfaces (full cylindrical tube): BoundarySurfaceFace [index]:

case B) 4 Surfaces (tube with inner and outer radius): BoundarySurfaceFace [index]:

case C) 6 Surfaces (sectoral tube with inner and outer radius): BoundarySurfaceFace [index]:

  • negativeFaceXY [0] : Trk::DiscSurface with \( r_{inner}>0 \) and \( \phi < \pi \), parallel to \( xy \) plane at negative \( z \)
  • positiveFaceXY [1] : Trk::DiscSurface with \( r_{inner}>0 \) and \( \phi < \pi \), parallel to \( xy \) plane at positive \( z \)
  • tubeSectorOuterCover [2] : Trk::CylinderSurface with \( r = r_{outer} \)
  • tubeSectorInnerCover [3] : Trk::CylinderSurface with \( r = r_{inner} \)
  • tubeSectorNegativePhi [4] : Rectangular Trk::PlaneSurface attached to [0] and [1] at negative \( \phi \)
  • tubeSectorNegativePhi [5] : Rectangular Trk::PlaneSurface attached to [0] and [1] at positive \( \phi \)

case D) 6 Surfaces (sectoral bevelled tube with inner and/or outer radius replaced by plane surface): BoundarySurfaceFace [index]:

  • negativeFaceXY [0] : Trk::DiscSurface with \( r_{inner}>0 \) and \( \phi < \pi \), parallel to \( xy \) plane at negative \( z \)
  • positiveFaceXY [1] : Trk::DiscSurface with \( r_{inner}>0 \) and \( \phi < \pi \), parallel to \( xy \) plane at positive \( z \)
  • tubeSectorOuterCover [2] : Trk::CylinderSurface with \( r = r_{outer} \) OR rectangular plane surface
  • tubeSectorInnerCover [3] : Trk::CylinderSurface with \( r = r_{inner} \) OR rectangular plane surface
  • tubeSectorNegativePhi [4] : Rectangular Trk::PlaneSurface attached to [0] and [1] at negative \( \phi \)
  • tubeSectorNegativePhi [5] : Rectangular Trk::PlaneSurface attached to [0] and [1] at positive \( \phi \)
Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 100 of file BevelledCylinderVolumeBounds.h.

Constructor & Destructor Documentation

◆ BevelledCylinderVolumeBounds() [1/3]

Trk::BevelledCylinderVolumeBounds::BevelledCylinderVolumeBounds ( )

Default Constructor.

Definition at line 34 of file BevelledCylinderVolumeBounds.cxx.

35 : VolumeBounds()
36 , m_innerRadius(0.)
37 , m_outerRadius(0.)
38 , m_halfPhiSector(0.)
39 , m_halfZ(0.)
40 , m_thetaMinus(0.)
41 , m_thetaPlus(0.)
42 , m_type(-1)
44 , m_subtractedVolume(nullptr)
45{}
CxxUtils::CachedUniquePtr< Trk::Volume > m_subtractedVolume
BevelledCylinderVolumeBoundaryAccessors m_boundaryAccessors
Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () w...
VolumeBounds()
Default Constructor.

◆ BevelledCylinderVolumeBounds() [2/3]

Trk::BevelledCylinderVolumeBounds::BevelledCylinderVolumeBounds ( double rinner,
double router,
double halfPhiSector,
double halez,
int type )

Constructor - cylinder segment bevelled in R.

Definition at line 47 of file BevelledCylinderVolumeBounds.cxx.

53 : VolumeBounds()
54 , m_innerRadius(std::abs(rinner))
55 , m_outerRadius(std::abs(router))
56 , m_halfPhiSector(haphi)
57 , m_halfZ(std::abs(halez))
58 , m_thetaMinus(0.)
59 , m_thetaPlus(0.)
60 , m_type(type)
62 , m_subtractedVolume(nullptr)
63{}
int type() const
This method returns the type.

◆ BevelledCylinderVolumeBounds() [3/3]

Trk::BevelledCylinderVolumeBounds::BevelledCylinderVolumeBounds ( const BevelledCylinderVolumeBounds & cylbo)

Copy Constructor.

Definition at line 65 of file BevelledCylinderVolumeBounds.cxx.

67 : VolumeBounds()
68 , m_innerRadius(cylbo.m_innerRadius)
69 , m_outerRadius(cylbo.m_outerRadius)
70 , m_halfPhiSector(cylbo.m_halfPhiSector)
71 , m_halfZ(cylbo.m_halfZ)
72 , m_thetaMinus(cylbo.m_thetaMinus)
73 , m_thetaPlus(cylbo.m_thetaPlus)
74 , m_type(cylbo.m_type)
76 , m_subtractedVolume(nullptr)
77{}

◆ ~BevelledCylinderVolumeBounds()

Trk::BevelledCylinderVolumeBounds::~BevelledCylinderVolumeBounds ( )
virtualdefault

Destructor.

Member Function Documentation

◆ bottomEllipseBounds()

std::shared_ptr< Trk::EllipseBounds > Trk::BevelledCylinderVolumeBounds::bottomEllipseBounds ( ) const
private

This method returns the associated EllipseBounds for the bottom/top EllipseSurface.

Definition at line 457 of file BevelledCylinderVolumeBounds.cxx.

458{
459 return std::make_shared<Trk::EllipseBounds>(
465}

◆ boundarySurfaceAccessor()

Trk::ObjectAccessor Trk::BevelledCylinderVolumeBounds::boundarySurfaceAccessor ( const Amg::Vector3D & gp,
const Amg::Vector3D & dir,
bool forceInside = false ) const
overridevirtual

Provide accessor for BoundarySurfaces.

Implements Trk::VolumeBounds.

Definition at line 249 of file BevelledCylinderVolumeBounds.cxx.

253{
254 // the tube case - most likely
255 if (m_innerRadius != 0. && std::abs(m_halfPhiSector - M_PI) < s_numericalStable) {
256 // prepare the data
257 double posZ = gp.z();
258 double posR = gp.perp();
259 // difference Vector
260 Amg::Vector3D diff(gp + dir);
261 // differences
262 double deltaZ = diff.z() - posZ;
263 double deltaR = diff.perp() - posR;
264
265 // the isOnSurface cases + switchers (that change with the cases)
266 bool isOnFace = false;
267 bool intersectionIndicator = (deltaR > 0.);
268 bool choiceIndicator = false;
269
270 // on surface or look-a-likes
271 // on zMin or slightly outside
272 if (
273 std::abs(posZ + m_halfZ) < s_numericalStable ||
274 (posZ < (-m_halfZ) && deltaZ > 0.)) {
275 isOnFace = true;
276 } else if (
277 std::abs(posZ - m_halfZ) < s_numericalStable ||
278 (posZ > m_halfZ && deltaZ < 0.)) {
279 // on zMax or slighly outside
280 isOnFace = true;
281 } else if (
282 std::abs(posR - m_innerRadius) < s_numericalStable ||
283 (posR < m_innerRadius && deltaR > 0.)) {
284 // on innerRadius or slightly outside
285 isOnFace = true;
286 choiceIndicator =
287 (deltaZ > 0.); // the side choice indicator <========== WRONG ==========
288 } else if (
289 std::abs(posR - m_outerRadius) < s_numericalStable ||
290 (posR > m_outerRadius && deltaR < 0.)) {
291 // on outRadius or slightly outside
292 isOnFace = true;
293 choiceIndicator =
294 (deltaZ > 0.); // the side choice indicator <========== WRONG ==========
295 }
296
297 // the onSurface case
298 // =================================================================================
299 if (isOnFace) {
300 if (intersectionIndicator) {
301 // intersect the Rmax
302 Trk::BevelledBoundaryIntersector intersectRmax(
303 posR, posZ, deltaZ / deltaR, m_outerRadius);
304 double zOfIntersect = intersectRmax.yOfX;
305 // now check if the intersect is inside m_halfZ
306 if (std::abs(zOfIntersect) <= m_halfZ)
307 return {(choiceIndicator || zOfIntersect > 0.)
308 ? m_boundaryAccessors.bevelledtubeAccessor(
310 : m_boundaryAccessors.bevelledtubeAccessor(
312 // if the intersect is outside
313 return {(choiceIndicator || zOfIntersect > 0.)
314 ? m_boundaryAccessors.bevelledtubeAccessor(
316 : m_boundaryAccessors.bevelledtubeAccessor(
318 }
319 // intersect the Rmin
320 Trk::BevelledBoundaryIntersector intersectRmin(
321 posR, posZ, deltaZ / deltaR, m_innerRadius);
322 double zOfIntersect = intersectRmin.yOfX;
323 // now check if the intersect is inside m_halfZ
324 if (std::abs(zOfIntersect) <= m_halfZ)
325 return {(choiceIndicator || zOfIntersect > 0.)
326 ? m_boundaryAccessors.bevelledtubeAccessor(
328 : m_boundaryAccessors.bevelledtubeAccessor(
330 // if the intersect is outside
331 return {(choiceIndicator || zOfIntersect > 0.)
332 ? m_boundaryAccessors.bevelledtubeAccessor(
334 : m_boundaryAccessors.bevelledtubeAccessor(
336 }
337 // =================================================================================================
338
339 // ======================= the inside/outside part remains
340 // =========================================
341 // (a) outside cases
342 if (posR < m_innerRadius && deltaR < 0.)
343 return {m_boundaryAccessors.bevelledtubeAccessor(
345 if (posR > m_outerRadius && deltaR > 0.)
346 return {m_boundaryAccessors.bevelledtubeAccessor(
348 if (posZ < -m_halfZ && deltaZ < 0.)
349 return {m_boundaryAccessors.bevelledtubeAccessor(
351 if (posZ > m_halfZ && deltaZ > 0.)
352 return {m_boundaryAccessors.bevelledtubeAccessor(
354 // (b) inside cases
355 // the increase R case
356 if (deltaR > 0.) {
357 // solve the linear equation for the outer Radius
358 Trk::BevelledBoundaryIntersector intersectRmax(
359 posR, posZ, deltaZ / deltaR, m_outerRadius);
360 double zOfIntersect = intersectRmax.yOfX;
361
362 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
363 return {m_boundaryAccessors.bevelledtubeAccessor(
365 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
366 return {m_boundaryAccessors.bevelledtubeAccessor(
368 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect < 0.)
369 return {m_boundaryAccessors.bevelledtubeAccessor(
371 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
372 return {m_boundaryAccessors.bevelledtubeAccessor(
374
375 } else {
376 // solve the linear equation for the inner Radius
377 Trk::BevelledBoundaryIntersector intersectRmin(
378 posR, posZ, deltaZ / deltaR, m_innerRadius);
379 double zOfIntersect = intersectRmin.yOfX;
380
381 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
382 return {m_boundaryAccessors.bevelledtubeAccessor(
384 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
385 return {m_boundaryAccessors.bevelledtubeAccessor(
387 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
388 return {m_boundaryAccessors.bevelledtubeAccessor(
390 return {m_boundaryAccessors.bevelledtubeAccessor(
392 }
393 }
394 // the cylinder case
395 if (m_innerRadius == 0. && std::abs(m_halfPhiSector - M_PI) < 10e-3) {
396
397 double posZ = gp.z();
398 double posR = gp.perp();
399 // difference Vector
400 Amg::Vector3D diff(gp + dir);
401 // differences
402 double deltaZ = diff.z() - posZ;
403 double deltaR = diff.perp() - posR;
404
405 // solve the linear equation for the cylinder Radius
406 Trk::BevelledBoundaryIntersector intersectR(
407 posR, posZ, deltaZ / deltaR, m_outerRadius);
408 // the intersection point
409 double zOfIntersect = intersectR.yOfX;
410
411 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
412 return {m_boundaryAccessors.bevelledcylinderAccessor(
414 if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
415 return {m_boundaryAccessors.bevelledcylinderAccessor(
417 if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
418 return {m_boundaryAccessors.bevelledcylinderAccessor(
420 return {m_boundaryAccessors.bevelledcylinderAccessor(
422 }
423 // the sectoral cylinder case
424 if (m_innerRadius != 0. && std::abs(m_halfPhiSector - M_PI) > 10e-3)
425 return {m_boundaryAccessors.sectoralBevelledCylinderAccessor(
427 // it remains the sectoral tube case
428 return {m_boundaryAccessors.sectoralBevelledTubeAccessor(
430}
#define M_PI
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.
Definition Jet.cxx:631
static const double s_numericalStable
numerical stability
Eigen::Matrix< double, 3, 1 > Vector3D
@ BevelledCylinderZincrease
Cylinder hit, then pos.
@ BevelledCylinderZdecrease
Cylinder hit, the neg.
@ BevelledTubeOutsideRminRdecrease
Accessor type [ 3,1,0,2] - inverse case.
@ BevelledTubeOutsideZmaxZincrease
Accessor type [ 1,3,2,0 ] - inverse case.
@ BevelledTubeRincreaseZincrease
Accessor type [ 2,1,0,3 ].
@ BevelledTubeZincreaseRdecrease
Accessor type [ 1,3,0,2 ].
@ BevelledTubeRdecreaseZincrease
Accessor type [ 3,1,0,2 ].
@ BevelledTubeZdecreaseRdecrease
Accessor type [ 0,3,1,2 ].
@ BevelledTubeRdecreaseZdecrease
Accessor type [ 3,0,1,2 ].
@ BevelledTubeRincreaseZdecrease
Accessor type [ 2,0,1,3 ].
@ BevelledTubeZincreaseRincrease
Accessor type [ 1,2,0,3 ].
@ BevelledTubeOutsideZminZdecrease
Accessor type [ 0,3,2,1 ] - inverse case.
@ BevelledTubeZdecreaseRincrease
Accessor type [ 0,2,1,3 ].
@ BevelledTubeOutsideRmaxRincrease
Accessor type [ 2,1,0,3 ] - inverse case.

◆ clone()

BevelledCylinderVolumeBounds * Trk::BevelledCylinderVolumeBounds::clone ( ) const
inlineoverridevirtual

Virtual constructor.

Implements Trk::VolumeBounds.

Definition at line 217 of file BevelledCylinderVolumeBounds.h.

218 { return new BevelledCylinderVolumeBounds(*this); }

◆ createBoundarySurfaceAccessors()

void Trk::BevelledCylinderVolumeBounds::createBoundarySurfaceAccessors ( )
private

Private method to construct the accessors.

◆ decomposeToSurfaces()

std::vector< std::unique_ptr< Trk::Surface > > Trk::BevelledCylinderVolumeBounds::decomposeToSurfaces ( const Amg::Transform3D & transform)
overridevirtual

Method to decompose the Bounds into boundarySurfaces.

Implements Trk::VolumeBounds.

Definition at line 99 of file BevelledCylinderVolumeBounds.cxx.

101{
102 auto retsf = std::vector<std::unique_ptr<Trk::Surface>>();
103 // memory optimisation (reserve a save number of 20)
104 retsf.reserve(6);
105
106 Amg::RotationMatrix3D discRot(transform.rotation());
107 Amg::Vector3D cylCenter(transform.translation());
108
109 // Lazy init m_m_subtractedVolume
110 if (m_type > -1 && !m_subtractedVolume) {
111 m_subtractedVolume.set(std::unique_ptr<Trk::Volume>(subtractedVolume()));
112 }
113
114 // bottom Ellipse/Disc (negative z)
115 if (m_type < 0)
116 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
118 (discRot *
121 cylCenter - (halflengthZ() - m_outerRadius * tan(m_thetaMinus)) *
122 discRot.col(2))),
124 else {
125 if (m_subtractedVolume) {
126 auto subtrVol = std::make_unique<Trk::Volume>(*m_subtractedVolume);
127 Trk::DiscSurface bottomDisc(
129 transform * Amg::AngleAxis3D(M_PI, Amg::Vector3D(1., 0., 0.)) *
131 discBounds());
132 retsf.push_back(std::make_unique<Trk::SubtractedDiscSurface>(
133 bottomDisc, std::make_shared<Trk::VolumeExcluder>(std::move(subtrVol)), false));
134 } else
135 retsf.push_back(std::make_unique<Trk::DiscSurface>(
137 transform * Amg::AngleAxis3D(M_PI, Amg::Vector3D(1., 0., 0.)) *
139 discBounds()));
140 }
141
142 // top Ellipse/Disc (positive z)
143 if (m_type < 0)
144 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
146 discRot * Amg::AngleAxis3D(m_thetaPlus, Amg::Vector3D(0., 1., 0.)) *
148 cylCenter +
149 (halflengthZ() - m_outerRadius * tan(m_thetaPlus)) * discRot.col(2))),
151 else {
152 if (m_subtractedVolume) {
153 auto subtrVol = std::make_unique<Trk::Volume>(*m_subtractedVolume);
154 Trk::DiscSurface topDisc(
156 transform * Amg::Translation3D(Amg::Vector3D(0., 0., halflengthZ()))),
157 discBounds());
158 retsf.push_back(std::make_unique<Trk::SubtractedDiscSurface>(
159 topDisc, std::make_shared<Trk::VolumeExcluder>(std::move(subtrVol)), false));
160 } else
161 retsf.push_back(std::make_unique<Trk::DiscSurface>(
163 transform * Amg::Translation3D(Amg::Vector3D(0., 0., halflengthZ()))),
164 discBounds()));
165 }
166
167 // outer BevelledCylinder/Plane
168 if (m_type < 0)
169 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
171 else if (m_type < 2)
172 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
174 else
175 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
177 transform *
179 Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
180 Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
182
183 // inner BevelledCylinder/Plane
185 if (m_type < 1)
186 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
188 else if (m_type == 2)
189 retsf.push_back(std::make_unique<Trk::CylinderSurface>(
191 else
192 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
194 transform *
196 Amg::AngleAxis3D(+90 * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
198 -90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
200 }
201
202 if (std::abs(halfPhiSector() - M_PI) > s_numericalStable) {
203 if (m_type < 0) {
204 // sectorPlane 1 (negative phi)
205 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
207 transform *
210 Amg::AngleAxis3D(M_PI / 2, Amg::Vector3D(1., 0., 0.))),
211 sectorTrdBounds()));
212 // sectorPlane 2 (positive phi)
213 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
215 transform *
218 Amg::AngleAxis3D(-M_PI / 2, Amg::Vector3D(1., 0., 0.))),
219 sectorTrdBounds()));
220 } else {
221 // sectorPlane 1 (negative phi)
222 double ri = innerRadius();
223 double ro = outerRadius();
224 if (m_type == 1 || m_type == 3)
225 ri *= 1. / cos(halfPhiSector());
226 if (m_type > 1)
227 ro *= 1. / cos(halfPhiSector());
228 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
230 transform *
232 Amg::Translation3D(Amg::Vector3D(0.5 * (ri + ro), 0., 0.)) *
233 Amg::AngleAxis3D(M_PI / 2, Amg::Vector3D(1., 0., 0.))),
235 // sectorPlane 2 (positive phi)
236 retsf.push_back(std::make_unique<Trk::PlaneSurface>(
238 transform *
240 Amg::Translation3D(Amg::Vector3D(0.5 * (ri + ro), 0., 0.)) *
241 Amg::AngleAxis3D(-M_PI / 2, Amg::Vector3D(1., 0., 0.))),
243 }
244 }
245 return retsf;
246}
std::shared_ptr< RectangleBounds > outerBevelledPlaneBounds() const
This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
std::shared_ptr< DiscBounds > discBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
std::shared_ptr< EllipseBounds > bottomEllipseBounds() const
This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
Volume * subtractedVolume() const
This method returns the bevelled area volume.
std::shared_ptr< RectangleBounds > innerBevelledPlaneBounds() const
This method returns the associated plane surface bounds of the inner bevelled surface.
double halflengthZ() const
This method returns the halflengthZ.
double mediumRadius() const
This method returns the medium radius.
double innerRadius() const
This method returns the inner radius.
std::shared_ptr< TrapezoidBounds > sectorTrdBounds() const
This method returns the associated PlaneBounds limiting a sectoral BevelledCylinderVolume.
std::shared_ptr< CylinderBounds > outerBevelledCylinderBounds() const
This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
std::shared_ptr< CylinderBounds > outerCylinderBounds() const
This method returns the associated CylinderBounds of the outer CylinderSurfaces.
std::shared_ptr< RectangleBounds > sectorPlaneBounds() const
double outerRadius() const
This method returns the outer radius.
std::shared_ptr< EllipseBounds > topEllipseBounds() const
This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
double halfPhiSector() const
This method returns the halfPhiSector angle.
std::shared_ptr< CylinderBounds > innerBevelledCylinderBounds() const
This method returns the associated BevelledCylinderBounds of the inner BevelledCylinderSurfaces.
std::shared_ptr< CylinderBounds > innerCylinderBounds() const
This method returns the associated CylinderBounds of the inner CylinderSurfaces.
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Eigen::Translation< double, 3 > Translation3D

◆ deltaRadius()

double Trk::BevelledCylinderVolumeBounds::deltaRadius ( ) const
inline

This method returns the delta radius.

Definition at line 240 of file BevelledCylinderVolumeBounds.h.

240{ return (m_outerRadius-m_innerRadius); }

◆ discBounds()

std::shared_ptr< Trk::DiscBounds > Trk::BevelledCylinderVolumeBounds::discBounds ( ) const
private

This method returns the associated DiscBounds for the bottom/top DiscSurface.

Definition at line 491 of file BevelledCylinderVolumeBounds.cxx.

492{
493 // adjust radius to make sure all surface covered
494 double outerRadius =
496 return std::make_shared<Trk::DiscBounds>(m_innerRadius, outerRadius, m_halfPhiSector);
497}

◆ dump() [1/2]

MsgStream & Trk::BevelledCylinderVolumeBounds::dump ( MsgStream & sl) const
overridevirtual

Output Method for MsgStream.

Implements Trk::VolumeBounds.

Definition at line 553 of file BevelledCylinderVolumeBounds.cxx.

554{
555 std::stringstream sl_temp;
556 sl_temp << std::setiosflags(std::ios::fixed);
557 sl_temp << std::setprecision(7);
558 sl_temp << "Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
559 "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
560 sl_temp << "(" << m_innerRadius << ", " << m_outerRadius << ", "
561 << m_halfPhiSector << ", " << m_halfZ << ", " << m_thetaMinus << ", "
562 << m_thetaPlus << ")";
563 sl << sl_temp.str();
564 return sl;
565}

◆ dump() [2/2]

std::ostream & Trk::BevelledCylinderVolumeBounds::dump ( std::ostream & sl) const
overridevirtual

Output Method for std::ostream.

Implements Trk::VolumeBounds.

Definition at line 568 of file BevelledCylinderVolumeBounds.cxx.

569{
570 std::stringstream sl_temp;
571 sl_temp << std::setiosflags(std::ios::fixed);
572 sl_temp << std::setprecision(7);
573 sl_temp << "Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
574 "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
575 sl_temp << "(" << m_innerRadius << ", " << m_outerRadius << ", "
576 << m_halfPhiSector << ", " << m_halfZ << m_thetaMinus << ", "
577 << m_thetaPlus << ")";
578 sl << sl_temp.str();
579 return sl;
580}

◆ halflengthZ()

double Trk::BevelledCylinderVolumeBounds::halflengthZ ( ) const
inline

This method returns the halflengthZ.

Definition at line 242 of file BevelledCylinderVolumeBounds.h.

242{ return m_halfZ; }

◆ halfPhiSector()

double Trk::BevelledCylinderVolumeBounds::halfPhiSector ( ) const
inline

This method returns the halfPhiSector angle.

Definition at line 241 of file BevelledCylinderVolumeBounds.h.

241{ return m_halfPhiSector; }

◆ innerBevelledCylinderBounds()

std::shared_ptr< Trk::CylinderBounds > Trk::BevelledCylinderVolumeBounds::innerBevelledCylinderBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the inner BevelledCylinderSurfaces.

Definition at line 433 of file BevelledCylinderVolumeBounds.cxx.

434{
435 return std::make_shared<Trk::CylinderBounds>(m_innerRadius, m_halfPhiSector, m_halfZ);
436}

◆ innerBevelledPlaneBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::BevelledCylinderVolumeBounds::innerBevelledPlaneBounds ( ) const
private

This method returns the associated plane surface bounds of the inner bevelled surface.

Definition at line 451 of file BevelledCylinderVolumeBounds.cxx.

452{
453 return std::make_shared<Trk::RectangleBounds>(m_innerRadius * tan(m_halfPhiSector), m_halfZ);
454}

◆ innerCylinderBounds()

std::shared_ptr< Trk::CylinderBounds > Trk::BevelledCylinderVolumeBounds::innerCylinderBounds ( ) const
private

This method returns the associated CylinderBounds of the inner CylinderSurfaces.

Definition at line 479 of file BevelledCylinderVolumeBounds.cxx.

480{
481 return std::make_shared<Trk::CylinderBounds>(m_innerRadius, m_halfPhiSector, m_halfZ);
482}

◆ innerRadius()

double Trk::BevelledCylinderVolumeBounds::innerRadius ( ) const
inline

This method returns the inner radius.

Definition at line 237 of file BevelledCylinderVolumeBounds.h.

237{ return m_innerRadius; }

◆ inside()

bool Trk::BevelledCylinderVolumeBounds::inside ( const Amg::Vector3D & pos,
double tol = 0. ) const
inlineoverridevirtual

This method checks if position in the 3D volume frame is inside the cylinder.

Implements Trk::VolumeBounds.

Definition at line 220 of file BevelledCylinderVolumeBounds.h.

221 {
222 double ros = pos.perp();
223 bool insidePhi = fabs(pos.phi()) <= m_halfPhiSector + tol;
224 double cphi = cos(pos.phi());
225 bool insideR = insidePhi;
226 if (m_type < 1) insideR = insidePhi ? ((ros >= m_innerRadius - tol ) && (ros <= m_outerRadius + tol)) : false;
227 else if (m_type == 1 ) insideR = insidePhi ? ((ros>= m_innerRadius/cphi-tol)&&(ros<=m_outerRadius+tol)):false;
228 else if (m_type == 2 ) insideR = insidePhi ? ((ros>= m_innerRadius-tol)&&(ros<=m_outerRadius/cphi+tol)):false;
229 else if (m_type == 3 ) insideR = insidePhi ? ((ros>= m_innerRadius/cphi-tol)&&(ros<=m_outerRadius/cphi+tol)):false;
230// bool insideZ = insideR ? (fabs(pos.z()) <= m_halfZ + tol ) : false ;
231 bool insideZ = insideR ? ((pos.z()<=m_halfZ-(pos.x()+m_outerRadius)*tan(m_thetaPlus) + tol)
232 && ( pos.z()>=-m_halfZ+(pos.x()+m_outerRadius)*tan(m_thetaMinus) - tol)) : false ;
233
234 return insideZ;
235 }

◆ mediumRadius()

double Trk::BevelledCylinderVolumeBounds::mediumRadius ( ) const
inline

This method returns the medium radius.

Definition at line 239 of file BevelledCylinderVolumeBounds.h.

239{ return 0.5*(m_innerRadius+m_outerRadius); }

◆ operator=()

Trk::BevelledCylinderVolumeBounds & Trk::BevelledCylinderVolumeBounds::operator= ( const BevelledCylinderVolumeBounds & cylbo)

Assignment operator.

Definition at line 82 of file BevelledCylinderVolumeBounds.cxx.

84{
85 if (this != &cylbo) {
86 m_innerRadius = cylbo.m_innerRadius;
87 m_outerRadius = cylbo.m_outerRadius;
88 m_halfPhiSector = cylbo.m_halfPhiSector;
89 m_halfZ = cylbo.m_halfZ;
90 m_thetaMinus = cylbo.m_thetaMinus;
91 m_thetaPlus = cylbo.m_thetaPlus;
92 m_type = cylbo.m_type;
93 m_subtractedVolume.store(nullptr);
94 }
95 return *this;
96}

◆ outerBevelledCylinderBounds()

std::shared_ptr< Trk::CylinderBounds > Trk::BevelledCylinderVolumeBounds::outerBevelledCylinderBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.

Definition at line 439 of file BevelledCylinderVolumeBounds.cxx.

440{
441 return std::make_shared<Trk::CylinderBounds>(m_outerRadius, m_halfPhiSector, m_halfZ);
442}

◆ outerBevelledPlaneBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::BevelledCylinderVolumeBounds::outerBevelledPlaneBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.

Definition at line 445 of file BevelledCylinderVolumeBounds.cxx.

446{
447 return std::make_shared<Trk::RectangleBounds>(m_outerRadius * tan(m_halfPhiSector), m_halfZ);
448}

◆ outerCylinderBounds()

std::shared_ptr< Trk::CylinderBounds > Trk::BevelledCylinderVolumeBounds::outerCylinderBounds ( ) const
private

This method returns the associated CylinderBounds of the outer CylinderSurfaces.

Definition at line 485 of file BevelledCylinderVolumeBounds.cxx.

486{
487 return std::make_shared<Trk::CylinderBounds>(m_outerRadius, m_halfPhiSector, m_halfZ);
488}

◆ outerRadius()

double Trk::BevelledCylinderVolumeBounds::outerRadius ( ) const
inline

This method returns the outer radius.

Definition at line 238 of file BevelledCylinderVolumeBounds.h.

238{ return m_outerRadius; }

◆ sectorPlaneBounds()

std::shared_ptr< Trk::RectangleBounds > Trk::BevelledCylinderVolumeBounds::sectorPlaneBounds ( ) const
private

Definition at line 508 of file BevelledCylinderVolumeBounds.cxx.

509{
510 double ri = innerRadius();
511 double ro = outerRadius();
512 if (m_type == 1 || m_type == 3)
513 ri *= 1. / cos(halfPhiSector());
514 if (m_type > 1)
515 ro *= 1. / cos(halfPhiSector());
516 return std::make_shared<Trk::RectangleBounds>(0.5 * (ro - ri), m_halfZ);
517}

◆ sectorTrdBounds()

std::shared_ptr< Trk::TrapezoidBounds > Trk::BevelledCylinderVolumeBounds::sectorTrdBounds ( ) const
private

This method returns the associated PlaneBounds limiting a sectoral BevelledCylinderVolume.

Definition at line 500 of file BevelledCylinderVolumeBounds.cxx.

501{
502 return std::make_shared<Trk::TrapezoidBounds>(
505}

◆ subtractedVolume()

Trk::Volume * Trk::BevelledCylinderVolumeBounds::subtractedVolume ( ) const
private

This method returns the bevelled area volume.

Definition at line 520 of file BevelledCylinderVolumeBounds.cxx.

521{
522 if (m_type < 1)
523 return nullptr;
524
525 double tp = tan(m_halfPhiSector);
526 std::unique_ptr<Trk::Volume> volIn;
527 std::unique_ptr<Trk::Volume> volOut;
528 if (m_type == 1 || m_type == 3) { // cut inner cylinder
529 volIn = std::make_unique<Trk::Volume>(
530 nullptr,
531 std::make_shared<Trk::CuboidVolumeBounds>(m_innerRadius, m_innerRadius * tp + 0.1, m_halfZ + 0.1));
532 }
533 if (m_type > 1) {
534 double hz = m_outerRadius * (1. / cos(m_halfPhiSector) - 1.);
535 volOut = std::make_unique<Trk::Volume>(
536 std::make_unique<Amg::Transform3D>(Amg::Translation3D(Amg::Vector3D(m_outerRadius + hz, 0., 0.))),
537 std::make_shared<Trk::CuboidVolumeBounds>(hz, m_outerRadius * tp + 0.1, m_halfZ + 0.1));
538 }
539
540 if (!volIn){
541 return volOut.release();
542 }
543 else if (!volOut){
544 return volIn.release();
545 }
546 return new Trk::Volume(
547 nullptr, std::make_shared<Trk::CombinedVolumeBounds>(std::move(volIn), std::move(volOut), false));
548}

◆ thetaMinus()

double Trk::BevelledCylinderVolumeBounds::thetaMinus ( ) const
inline

This method returns the thetaMinus.

Definition at line 243 of file BevelledCylinderVolumeBounds.h.

243{ return m_thetaMinus; }

◆ thetaPlus()

double Trk::BevelledCylinderVolumeBounds::thetaPlus ( ) const
inline

This method returns the thetaPlus.

Definition at line 244 of file BevelledCylinderVolumeBounds.h.

244{ return m_thetaPlus; }

◆ topEllipseBounds()

std::shared_ptr< Trk::EllipseBounds > Trk::BevelledCylinderVolumeBounds::topEllipseBounds ( ) const
private

This method returns the associated EllipseBounds for the bottom/top EllipseSurface.

Definition at line 468 of file BevelledCylinderVolumeBounds.cxx.

469{
470 return std::make_shared<Trk::EllipseBounds>(
476}

◆ type()

int Trk::BevelledCylinderVolumeBounds::type ( ) const
inline

This method returns the type.

Definition at line 245 of file BevelledCylinderVolumeBounds.h.

245{ return m_type; }

Member Data Documentation

◆ m_boundaryAccessors

BevelledCylinderVolumeBoundaryAccessors Trk::BevelledCylinderVolumeBounds::m_boundaryAccessors
private

Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () with TrkMagFieldUtils.

Definition at line 209 of file BevelledCylinderVolumeBounds.h.

◆ m_halfPhiSector

double Trk::BevelledCylinderVolumeBounds::m_halfPhiSector
private

Definition at line 197 of file BevelledCylinderVolumeBounds.h.

◆ m_halfZ

double Trk::BevelledCylinderVolumeBounds::m_halfZ
private

Definition at line 198 of file BevelledCylinderVolumeBounds.h.

◆ m_innerRadius

double Trk::BevelledCylinderVolumeBounds::m_innerRadius
private

Definition at line 195 of file BevelledCylinderVolumeBounds.h.

◆ m_outerRadius

double Trk::BevelledCylinderVolumeBounds::m_outerRadius
private

Definition at line 196 of file BevelledCylinderVolumeBounds.h.

◆ m_subtractedVolume

CxxUtils::CachedUniquePtr<Trk::Volume> Trk::BevelledCylinderVolumeBounds::m_subtractedVolume
private

Definition at line 214 of file BevelledCylinderVolumeBounds.h.

◆ m_thetaMinus

double Trk::BevelledCylinderVolumeBounds::m_thetaMinus
private

Definition at line 199 of file BevelledCylinderVolumeBounds.h.

◆ m_thetaPlus

double Trk::BevelledCylinderVolumeBounds::m_thetaPlus
private

Definition at line 200 of file BevelledCylinderVolumeBounds.h.

◆ m_type

int Trk::BevelledCylinderVolumeBounds::m_type
private

Definition at line 201 of file BevelledCylinderVolumeBounds.h.

◆ s_numericalStable

const double Trk::BevelledCylinderVolumeBounds::s_numericalStable
staticprivate
Initial value:
=
10e-2 * Gaudi::Units::millimeter

numerical stability

Definition at line 212 of file BevelledCylinderVolumeBounds.h.


The documentation for this class was generated from the following files: