ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Trk::BevelledCylinderVolumeBounds Class Referencefinal

#include <BevelledCylinderVolumeBounds.h>

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

Public Member Functions

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

Private Member Functions

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

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. More...
 
CxxUtils::CachedUniquePtr< Trk::Volumem_subtractedVolume
 

Static Private Attributes

static const double s_numericalStable
 numerical stability More...
 

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]:

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

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 {}

◆ 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 {}

◆ 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()

Trk::EllipseBounds * Trk::BevelledCylinderVolumeBounds::bottomEllipseBounds ( ) const
private

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

Definition at line 465 of file BevelledCylinderVolumeBounds.cxx.

466 {
467  // return new Trk::EllipseBounds();
468  return new Trk::EllipseBounds(
474 }

◆ 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 250 of file BevelledCylinderVolumeBounds.cxx.

254 {
255  // the tube case - most likely
256  if (m_innerRadius != 0. && std::abs(m_halfPhiSector - M_PI) < s_numericalStable) {
257  // prepare the data
258  double posZ = gp.z();
259  double posR = gp.perp();
260  // difference Vector
261  Amg::Vector3D diff(gp + dir);
262  // differences
263  double deltaZ = diff.z() - posZ;
264  double deltaR = diff.perp() - posR;
265 
266  // the isOnSurface cases + switchers (that change with the cases)
267  bool isOnFace = false;
268  bool intersectionIndicator = (deltaR > 0.);
269  bool choiceIndicator = false;
270 
271  // on surface or look-a-likes
272  // on zMin or slightly outside
273  if (
274  std::abs(posZ + m_halfZ) < s_numericalStable ||
275  (posZ < (-m_halfZ) && deltaZ > 0.)) {
276  isOnFace = true;
277  } else if (
278  std::abs(posZ - m_halfZ) < s_numericalStable ||
279  (posZ > m_halfZ && deltaZ < 0.)) {
280  // on zMax or slighly outside
281  isOnFace = true;
282  } else if (
283  std::abs(posR - m_innerRadius) < s_numericalStable ||
284  (posR < m_innerRadius && deltaR > 0.)) {
285  // on innerRadius or slightly outside
286  isOnFace = true;
287  choiceIndicator =
288  (deltaZ > 0.); // the side choice indicator <========== WRONG ==========
289  } else if (
290  std::abs(posR - m_outerRadius) < s_numericalStable ||
291  (posR > m_outerRadius && deltaR < 0.)) {
292  // on outRadius or slightly outside
293  isOnFace = true;
294  choiceIndicator =
295  (deltaZ > 0.); // the side choice indicator <========== WRONG ==========
296  }
297 
298  // the onSurface case
299  // =================================================================================
300  if (isOnFace) {
301  if (intersectionIndicator) {
302  // intersect the Rmax
303  Trk::BevelledBoundaryIntersector intersectRmax(
304  posR, posZ, deltaZ / deltaR, m_outerRadius);
305  double zOfIntersect = intersectRmax.yOfX;
306  // now check if the intersect is inside m_halfZ
307  if (std::abs(zOfIntersect) <= m_halfZ)
308  return {(choiceIndicator || zOfIntersect > 0.)
313  // if the intersect is outside
314  return {(choiceIndicator || zOfIntersect > 0.)
319  }
320  // intersect the Rmin
321  Trk::BevelledBoundaryIntersector intersectRmin(
322  posR, posZ, deltaZ / deltaR, m_innerRadius);
323  double zOfIntersect = intersectRmin.yOfX;
324  // now check if the intersect is inside m_halfZ
325  if (std::abs(zOfIntersect) <= m_halfZ)
326  return {(choiceIndicator || zOfIntersect > 0.)
331  // if the intersect is outside
332  return {(choiceIndicator || zOfIntersect > 0.)
337  }
338  // =================================================================================================
339 
340  // ======================= the inside/outside part remains
341  // =========================================
342  // (a) outside cases
343  if (posR < m_innerRadius && deltaR < 0.)
346  if (posR > m_outerRadius && deltaR > 0.)
349  if (posZ < -m_halfZ && deltaZ < 0.)
352  if (posZ > m_halfZ && deltaZ > 0.)
355  // (b) inside cases
356  // the increase R case
357  if (deltaR > 0.) {
358  // solve the linear equation for the outer Radius
359  Trk::BevelledBoundaryIntersector intersectRmax(
360  posR, posZ, deltaZ / deltaR, m_outerRadius);
361  double zOfIntersect = intersectRmax.yOfX;
362 
363  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
366  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
369  if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect < 0.)
372  if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
375 
376  } else {
377  // solve the linear equation for the inner Radius
378  Trk::BevelledBoundaryIntersector intersectRmin(
379  posR, posZ, deltaZ / deltaR, m_innerRadius);
380  double zOfIntersect = intersectRmin.yOfX;
381 
382  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
385  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
388  if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
393  }
394  }
395  // the cylinder case
396  if (m_innerRadius == 0. && std::abs(m_halfPhiSector - M_PI) < 10e-3) {
397 
398  double posZ = gp.z();
399  double posR = gp.perp();
400  // difference Vector
401  Amg::Vector3D diff(gp + dir);
402  // differences
403  double deltaZ = diff.z() - posZ;
404  double deltaR = diff.perp() - posR;
405 
406  // solve the linear equation for the cylinder Radius
408  posR, posZ, deltaZ / deltaR, m_outerRadius);
409  // the intersection point
410  double zOfIntersect = intersectR.yOfX;
411 
412  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect > 0.)
415  if (std::abs(zOfIntersect) <= m_halfZ && zOfIntersect < 0.)
418  if (std::abs(zOfIntersect) > m_halfZ && zOfIntersect > 0.)
423  }
424  // the sectoral cylinder case
425  if (m_innerRadius != 0. && std::abs(m_halfPhiSector - M_PI) > 10e-3)
428  // it remains the sectoral tube case
431 }

◆ 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()

const std::vector< const 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  std::vector<const Trk::Surface*>* retsf =
103  new std::vector<const Trk::Surface*>;
104  // memory optimisation (reserve a save number of 20)
105  retsf->reserve(6);
106 
107  Amg::RotationMatrix3D discRot(transform.rotation());
108  Amg::Vector3D cylCenter(transform.translation());
109 
110  // Lazy init m_m_subtractedVolume
111  if (m_type > -1 && !m_subtractedVolume) {
112  m_subtractedVolume.set(std::unique_ptr<Trk::Volume>(subtractedVolume()));
113  }
114 
115  // bottom Ellipse/Disc (negative z)
116  if (m_type < 0)
117  retsf->push_back(new Trk::PlaneSurface(
119  (discRot *
120  Amg::AngleAxis3D(-m_thetaMinus + M_PI, Amg::Vector3D(0., 1., 0.))) *
122  cylCenter - (halflengthZ() - m_outerRadius * tan(m_thetaMinus)) *
123  discRot.col(2))),
125  else {
126  if (m_subtractedVolume) {
127  Trk::Volume* subtrVol = new Trk::Volume(*m_subtractedVolume);
128  Trk::DiscSurface bottomDisc(
130  transform * Amg::AngleAxis3D(M_PI, Amg::Vector3D(1., 0., 0.)) *
132  discBounds());
133  retsf->push_back(new Trk::SubtractedDiscSurface(
134  bottomDisc, new Trk::VolumeExcluder(subtrVol), false));
135  } else
136  retsf->push_back(new Trk::DiscSurface(
138  transform * Amg::AngleAxis3D(M_PI, Amg::Vector3D(1., 0., 0.)) *
140  discBounds()));
141  }
142 
143  // top Ellipse/Disc (positive z)
144  if (m_type < 0)
145  retsf->push_back(new Trk::PlaneSurface(
147  discRot * Amg::AngleAxis3D(m_thetaPlus, Amg::Vector3D(0., 1., 0.)) *
149  cylCenter +
150  (halflengthZ() - m_outerRadius * tan(m_thetaPlus)) * discRot.col(2))),
151  topEllipseBounds()));
152  else {
153  if (m_subtractedVolume) {
154  Trk::Volume* subtrVol = new Trk::Volume(*m_subtractedVolume);
155  Trk::DiscSurface topDisc(
158  discBounds());
159  retsf->push_back(new Trk::SubtractedDiscSurface(
160  topDisc, new Trk::VolumeExcluder(subtrVol), false));
161  } else
162  retsf->push_back(new Trk::DiscSurface(
165  discBounds()));
166  }
167 
168  // outer BevelledCylinder/Plane
169  if (m_type < 0)
170  retsf->push_back(new Trk::CylinderSurface(
172  else if (m_type < 2)
173  retsf->push_back(new Trk::CylinderSurface(
175  else
176  retsf->push_back(new Trk::PlaneSurface(
178  transform *
179  Amg::Translation3D(Amg::Vector3D(this->outerRadius(), 0., 0.)) *
180  Amg::AngleAxis3D(-90 * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
181  Amg::AngleAxis3D(-90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
183 
184  // inner BevelledCylinder/Plane
185  if (innerRadius() > s_numericalStable) {
186  if (m_type < 1)
187  retsf->push_back(new Trk::CylinderSurface(
189  else if (m_type == 2)
190  retsf->push_back(new Trk::CylinderSurface(
192  else
193  retsf->push_back(new Trk::PlaneSurface(
195  transform *
196  Amg::Translation3D(Amg::Vector3D(this->innerRadius(), 0., 0.)) *
197  Amg::AngleAxis3D(+90 * Gaudi::Units::deg, Amg::Vector3D(0., 0., 1.)) *
199  -90. * Gaudi::Units::deg, Amg::Vector3D(1., 0., 0.))),
201  }
202 
203  if (std::abs(halfPhiSector() - M_PI) > s_numericalStable) {
204  if (m_type < 0) {
205  // sectorPlane 1 (negative phi)
206  retsf->push_back(new Trk::PlaneSurface(
208  transform *
209  Amg::AngleAxis3D(-halfPhiSector(), Amg::Vector3D(0., 0., 1.)) *
211  Amg::AngleAxis3D(M_PI / 2, Amg::Vector3D(1., 0., 0.))),
212  sectorTrdBounds()));
213  // sectorPlane 2 (positive phi)
214  retsf->push_back(new Trk::PlaneSurface(
216  transform *
219  Amg::AngleAxis3D(-M_PI / 2, Amg::Vector3D(1., 0., 0.))),
220  sectorTrdBounds()));
221  } else {
222  // sectorPlane 1 (negative phi)
223  double ri = innerRadius();
224  double ro = outerRadius();
225  if (m_type == 1 || m_type == 3)
226  ri *= 1. / cos(halfPhiSector());
227  if (m_type > 1)
228  ro *= 1. / cos(halfPhiSector());
229  retsf->push_back(new Trk::PlaneSurface(
231  transform *
232  Amg::AngleAxis3D(-halfPhiSector(), Amg::Vector3D(0., 0., 1.)) *
233  Amg::Translation3D(Amg::Vector3D(0.5 * (ri + ro), 0., 0.)) *
234  Amg::AngleAxis3D(M_PI / 2, Amg::Vector3D(1., 0., 0.))),
235  sectorPlaneBounds()));
236  // sectorPlane 2 (positive phi)
237  retsf->push_back(new Trk::PlaneSurface(
239  transform *
241  Amg::Translation3D(Amg::Vector3D(0.5 * (ri + ro), 0., 0.)) *
242  Amg::AngleAxis3D(-M_PI / 2, Amg::Vector3D(1., 0., 0.))),
243  sectorPlaneBounds()));
244  }
245  }
246  return retsf;
247 }

◆ 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()

Trk::DiscBounds * Trk::BevelledCylinderVolumeBounds::discBounds ( ) const
private

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

Definition at line 501 of file BevelledCylinderVolumeBounds.cxx.

502 {
503  // adjust radius to make sure all surface covered
504  double outerRadius =
507 }

◆ dump() [1/2]

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

Output Method for MsgStream.

Implements Trk::VolumeBounds.

Definition at line 562 of file BevelledCylinderVolumeBounds.cxx.

563 {
564  std::stringstream sl_temp;
565  sl_temp << std::setiosflags(std::ios::fixed);
566  sl_temp << std::setprecision(7);
567  sl_temp << "Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
568  "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
569  sl_temp << "(" << m_innerRadius << ", " << m_outerRadius << ", "
570  << m_halfPhiSector << ", " << m_halfZ << ", " << m_thetaMinus << ", "
571  << m_thetaPlus << ")";
572  sl << sl_temp.str();
573  return sl;
574 }

◆ dump() [2/2]

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

Output Method for std::ostream.

Implements Trk::VolumeBounds.

Definition at line 577 of file BevelledCylinderVolumeBounds.cxx.

578 {
579  std::stringstream sl_temp;
580  sl_temp << std::setiosflags(std::ios::fixed);
581  sl_temp << std::setprecision(7);
582  sl_temp << "Trk::BevelledCylinderVolumeBounds: (innerR, outerR, "
583  "halfPhiSector, halflengthInZ, thetaMinus, thetaPlus) = ";
584  sl_temp << "(" << m_innerRadius << ", " << m_outerRadius << ", "
585  << m_halfPhiSector << ", " << m_halfZ << m_thetaMinus << ", "
586  << m_thetaPlus << ")";
587  sl << sl_temp.str();
588  return sl;
589 }

◆ 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()

Trk::CylinderBounds * Trk::BevelledCylinderVolumeBounds::innerBevelledCylinderBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the inner BevelledCylinderSurfaces.

Definition at line 434 of file BevelledCylinderVolumeBounds.cxx.

435 {
436  // return new Trk::BevelledCylinderBounds(m_innerRadius, m_halfPhiSector,
437  // m_halfZ-(m_outerRadius-m_innerRadius)*tan(m_thetaPlus), m_thetaMinus,
438  // m_thetaPlus);
440 }

◆ innerBevelledPlaneBounds()

Trk::RectangleBounds * Trk::BevelledCylinderVolumeBounds::innerBevelledPlaneBounds ( ) const
private

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

Definition at line 458 of file BevelledCylinderVolumeBounds.cxx.

459 {
460  return new Trk::RectangleBounds(
462 }

◆ innerCylinderBounds()

Trk::CylinderBounds * Trk::BevelledCylinderVolumeBounds::innerCylinderBounds ( ) const
private

This method returns the associated CylinderBounds of the inner CylinderSurfaces.

Definition at line 489 of file BevelledCylinderVolumeBounds.cxx.

490 {
492 }

◆ 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()

Trk::CylinderBounds * Trk::BevelledCylinderVolumeBounds::outerBevelledCylinderBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.

Definition at line 443 of file BevelledCylinderVolumeBounds.cxx.

444 {
445  // return new Trk::BevelledCylinderBounds(m_outerRadius, m_halfPhiSector,
446  // m_halfZ, m_thetaMinus, m_thetaPlus);
448 }

◆ outerBevelledPlaneBounds()

Trk::RectangleBounds * Trk::BevelledCylinderVolumeBounds::outerBevelledPlaneBounds ( ) const
private

This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.

Definition at line 451 of file BevelledCylinderVolumeBounds.cxx.

452 {
453  return new Trk::RectangleBounds(
455 }

◆ outerCylinderBounds()

Trk::CylinderBounds * Trk::BevelledCylinderVolumeBounds::outerCylinderBounds ( ) const
private

This method returns the associated CylinderBounds of the outer CylinderSurfaces.

Definition at line 495 of file BevelledCylinderVolumeBounds.cxx.

496 {
498 }

◆ 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()

Trk::RectangleBounds * Trk::BevelledCylinderVolumeBounds::sectorPlaneBounds ( ) const
private

Definition at line 517 of file BevelledCylinderVolumeBounds.cxx.

518 {
519  double ri = innerRadius();
520  double ro = outerRadius();
521  if (m_type == 1 || m_type == 3)
522  ri *= 1. / cos(halfPhiSector());
523  if (m_type > 1)
524  ro *= 1. / cos(halfPhiSector());
525  return new Trk::RectangleBounds(0.5 * (ro - ri), m_halfZ);
526 }

◆ sectorTrdBounds()

Trk::TrapezoidBounds * Trk::BevelledCylinderVolumeBounds::sectorTrdBounds ( ) const
private

This method returns the associated PlaneBounds limiting a sectoral BevelledCylinderVolume.

Definition at line 510 of file BevelledCylinderVolumeBounds.cxx.

511 {
512  return new Trk::TrapezoidBounds(
514 }

◆ subtractedVolume()

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

This method returns the bevelled area volume.

Definition at line 529 of file BevelledCylinderVolumeBounds.cxx.

530 {
531  if (m_type < 1)
532  return nullptr;
533 
534  double tp = tan(m_halfPhiSector);
535  Trk::Volume* volIn = nullptr;
536  Trk::Volume* volOut = nullptr;
537  if (m_type == 1 || m_type == 3) { // cut inner cylinder
538  volIn = new Trk::Volume(
539  nullptr,
541  m_innerRadius, m_innerRadius * tp + 0.1, m_halfZ + 0.1));
542  }
543  if (m_type > 1) {
544  double hz = m_outerRadius * (1. / cos(m_halfPhiSector) - 1.);
545  volOut = new Trk::Volume(
546  new Amg::Transform3D(
548  new Trk::CuboidVolumeBounds(hz, m_outerRadius * tp + 0.1, m_halfZ + 0.1));
549  }
550 
551  if (!volIn)
552  return volOut;
553  else if (!volOut)
554  return volIn;
555  return new Trk::Volume(
556  nullptr, new Trk::CombinedVolumeBounds(volIn, volOut, false));
557 }

◆ 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()

Trk::EllipseBounds * Trk::BevelledCylinderVolumeBounds::topEllipseBounds ( ) const
private

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

Definition at line 477 of file BevelledCylinderVolumeBounds.cxx.

478 {
479  // return new Trk::EllipseBounds();
480  return new Trk::EllipseBounds(
486 }

◆ 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:

numerical stability

Definition at line 212 of file BevelledCylinderVolumeBounds.h.


The documentation for this class was generated from the following files:
Trk::BevelledCylinderVolumeBoundaryAccessors::sectoralBevelledTubeAccessor
const SixObjectsAccessor & sectoralBevelledTubeAccessor(SectoralBevelledTubeAccessorType stat) const
Return the accessor for the sectoral tube case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:106
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Trk::RectangleBounds
Definition: RectangleBounds.h:38
Trk::BevelledCylinderVolumeBounds::mediumRadius
double mediumRadius() const
This method returns the medium radius.
Definition: BevelledCylinderVolumeBounds.h:239
Trk::BevelledCylinderVolumeBounds::outerRadius
double outerRadius() const
This method returns the outer radius.
Definition: BevelledCylinderVolumeBounds.h:238
Trk::BevelledCylinderVolumeBoundaryAccessors::bevelledcylinderAccessor
const ThreeObjectsAccessor & bevelledcylinderAccessor(BevelledCylinderAccessorType cat) const
Return the accessor for the cylindrical case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:97
Trk::BevelledTubeRincreaseZincrease
@ BevelledTubeRincreaseZincrease
Accessor type [ 2,1,0,3 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:29
Trk::BevelledCylinderVolumeBoundaryAccessors::sectoralBevelledCylinderAccessor
const FiveObjectsAccessor & sectoralBevelledCylinderAccessor(SectoralBevelledCylinderAccessorType scat) const
Return the accessor for the sectoral cylinciracl case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:103
Trk::BevelledCylinderVolumeBounds::m_thetaMinus
double m_thetaMinus
Definition: BevelledCylinderVolumeBounds.h:199
Trk::BevelledCylinderVolumeBounds::type
int type() const
This method returns the type.
Definition: BevelledCylinderVolumeBounds.h:245
Trk::BevelledTubeRdecreaseZincrease
@ BevelledTubeRdecreaseZincrease
Accessor type [ 3,1,0,2 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:33
Trk::BevelledCylinderPositiveFace
@ BevelledCylinderPositiveFace
Pos.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:21
Trk::BevelledCylinderNegativeFace
@ BevelledCylinderNegativeFace
Neg.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:22
Trk::BevelledCylinderVolumeBounds::s_numericalStable
static const double s_numericalStable
numerical stability
Definition: BevelledCylinderVolumeBounds.h:212
Trk::CuboidVolumeBounds
Definition: CuboidVolumeBounds.h:52
Trk::SubtractedDiscSurface
Definition: SubtractedDiscSurface.h:33
Trk::EllipseBounds
Definition: EllipseBounds.h:38
Trk::BevelledCylinderVolumeBounds::m_type
int m_type
Definition: BevelledCylinderVolumeBounds.h:201
Trk::BevelledCylinderVolumeBounds::m_outerRadius
double m_outerRadius
Definition: BevelledCylinderVolumeBounds.h:196
Trk::BevelledCylinderVolumeBounds::discBounds
DiscBounds * discBounds() const
This method returns the associated DiscBounds for the bottom/top DiscSurface.
Definition: BevelledCylinderVolumeBounds.cxx:501
M_PI
#define M_PI
Definition: ActiveFraction.h:11
deg
#define deg
Definition: SbPolyhedron.cxx:17
Trk::BevelledCylinderVolumeBounds::BevelledCylinderVolumeBounds
BevelledCylinderVolumeBounds()
Default Constructor.
Definition: BevelledCylinderVolumeBounds.cxx:34
mc.diff
diff
Definition: mc.SFGenPy8_MuMu_DD.py:14
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Trk::BevelledTubeZincreaseRincrease
@ BevelledTubeZincreaseRincrease
Accessor type [ 1,2,0,3 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:31
Trk::BevelledTubeOutsideRminRdecrease
@ BevelledTubeOutsideRminRdecrease
Accessor type [ 3,1,0,2] - inverse case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:37
Trk::BevelledTubeOutsideRmaxRincrease
@ BevelledTubeOutsideRmaxRincrease
Accessor type [ 2,1,0,3 ] - inverse case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:38
Trk::DiscSurface
Definition: DiscSurface.h:54
Trk::BevelledTubeOutsideZminZdecrease
@ BevelledTubeOutsideZminZdecrease
Accessor type [ 0,3,2,1 ] - inverse case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:39
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::BevelledCylinderVolumeBounds::m_innerRadius
double m_innerRadius
Definition: BevelledCylinderVolumeBounds.h:195
Trk::BevelledTubeZdecreaseRincrease
@ BevelledTubeZdecreaseRincrease
Accessor type [ 0,2,1,3 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:32
Trk::BevelledCylinderVolumeBounds::m_halfZ
double m_halfZ
Definition: BevelledCylinderVolumeBounds.h:198
Trk::StandardSectoralBevelledCylinder
@ StandardSectoralBevelledCylinder
Definition: BevelledCylinderVolumeBoundaryAccessors.h:48
Trk::BevelledCylinderVolumeBounds::topEllipseBounds
EllipseBounds * topEllipseBounds() const
This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
Definition: BevelledCylinderVolumeBounds.cxx:477
Trk::BevelledCylinderVolumeBounds::m_thetaPlus
double m_thetaPlus
Definition: BevelledCylinderVolumeBounds.h:200
Trk::BevelledTubeRdecreaseZdecrease
@ BevelledTubeRdecreaseZdecrease
Accessor type [ 3,0,1,2 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:34
Trk::BevelledCylinderVolumeBounds::bottomEllipseBounds
EllipseBounds * bottomEllipseBounds() const
This method returns the associated EllipseBounds for the bottom/top EllipseSurface.
Definition: BevelledCylinderVolumeBounds.cxx:465
python.SystemOfUnits.millimeter
int millimeter
Definition: SystemOfUnits.py:53
Trk::BevelledCylinderVolumeBounds::sectorTrdBounds
TrapezoidBounds * sectorTrdBounds() const
This method returns the associated PlaneBounds limiting a sectoral BevelledCylinderVolume.
Definition: BevelledCylinderVolumeBounds.cxx:510
Trk::BevelledCylinderVolumeBounds::outerBevelledPlaneBounds
RectangleBounds * outerBevelledPlaneBounds() const
This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
Definition: BevelledCylinderVolumeBounds.cxx:451
beamspotman.posZ
posZ
Definition: beamspotman.py:1624
Trk::CylinderSurface
Definition: CylinderSurface.h:55
Trk::CylinderBounds
Definition: CylinderBounds.h:46
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Trk::BevelledCylinderVolumeBounds::outerBevelledCylinderBounds
CylinderBounds * outerBevelledCylinderBounds() const
This method returns the associated BevelledCylinderBounds of the outer BevelledCylinderSurfaces.
Definition: BevelledCylinderVolumeBounds.cxx:443
Trk::BevelledTubeRincreaseZdecrease
@ BevelledTubeRincreaseZdecrease
Accessor type [ 2,0,1,3 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:30
Trk::BevelledCylinderVolumeBounds::outerCylinderBounds
CylinderBounds * outerCylinderBounds() const
This method returns the associated CylinderBounds of the outer CylinderSurfaces.
Definition: BevelledCylinderVolumeBounds.cxx:495
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::BevelledTubeZdecreaseRdecrease
@ BevelledTubeZdecreaseRdecrease
Accessor type [ 0,3,1,2 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:36
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
Trk::BevelledTubeZincreaseRdecrease
@ BevelledTubeZincreaseRdecrease
Accessor type [ 1,3,0,2 ].
Definition: BevelledCylinderVolumeBoundaryAccessors.h:35
Trk::BevelledCylinderVolumeBoundaryAccessors::bevelledtubeAccessor
const FourObjectsAccessor & bevelledtubeAccessor(BevelledTubeAccessorType tat) const
Return the accessor for the tube case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:100
beamspotman.dir
string dir
Definition: beamspotman.py:623
Trk::BevelledCylinderZincrease
@ BevelledCylinderZincrease
Cylinder hit, then pos.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:19
Trk::BevelledCylinderVolumeBounds::sectorPlaneBounds
RectangleBounds * sectorPlaneBounds() const
Definition: BevelledCylinderVolumeBounds.cxx:517
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrapezoidBounds
Definition: TrapezoidBounds.h:43
Trk::BevelledCylinderVolumeBounds::innerRadius
double innerRadius() const
This method returns the inner radius.
Definition: BevelledCylinderVolumeBounds.h:237
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::BevelledCylinderVolumeBounds::m_subtractedVolume
CxxUtils::CachedUniquePtr< Trk::Volume > m_subtractedVolume
Definition: BevelledCylinderVolumeBounds.h:214
Trk::BevelledBoundaryIntersector
Definition: BevelledCylinderVolumeBounds.h:27
Trk::BevelledCylinderVolumeBounds::innerCylinderBounds
CylinderBounds * innerCylinderBounds() const
This method returns the associated CylinderBounds of the inner CylinderSurfaces.
Definition: BevelledCylinderVolumeBounds.cxx:489
Trk::PlaneSurface
Definition: PlaneSurface.h:64
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
Trk::BevelledTubeOutsideZmaxZincrease
@ BevelledTubeOutsideZmaxZincrease
Accessor type [ 1,3,2,0 ] - inverse case.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:40
Trk::BevelledCylinderVolumeBounds::innerBevelledPlaneBounds
RectangleBounds * innerBevelledPlaneBounds() const
This method returns the associated plane surface bounds of the inner bevelled surface.
Definition: BevelledCylinderVolumeBounds.cxx:458
Trk::BevelledCylinderVolumeBounds::subtractedVolume
Volume * subtractedVolume() const
This method returns the bevelled area volume.
Definition: BevelledCylinderVolumeBounds.cxx:529
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
Trk::VolumeExcluder
Definition: VolumeExcluder.h:29
fitman.hz
def hz
Definition: fitman.py:516
makeComparison.deltaZ
int deltaZ
Definition: makeComparison.py:46
Trk::CombinedVolumeBounds
Definition: CombinedVolumeBounds.h:42
Trk::BevelledCylinderVolumeBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Definition: BevelledCylinderVolumeBounds.h:242
Trk::BevelledCylinderZdecrease
@ BevelledCylinderZdecrease
Cylinder hit, the neg.
Definition: BevelledCylinderVolumeBoundaryAccessors.h:20
Trk::BevelledCylinderVolumeBounds::halfPhiSector
double halfPhiSector() const
This method returns the halfPhiSector angle.
Definition: BevelledCylinderVolumeBounds.h:241
Trk::Volume
Definition: Volume.h:35
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
Trk::BevelledCylinderVolumeBounds::innerBevelledCylinderBounds
CylinderBounds * innerBevelledCylinderBounds() const
This method returns the associated BevelledCylinderBounds of the inner BevelledCylinderSurfaces.
Definition: BevelledCylinderVolumeBounds.cxx:434
Trk::BevelledCylinderVolumeBounds::m_boundaryAccessors
BevelledCylinderVolumeBoundaryAccessors m_boundaryAccessors
Accessors for Boundary surface access - static is not possible due to mismatched delete() / free () w...
Definition: BevelledCylinderVolumeBounds.h:209
Trk::StandardSectoralBevelledTube
@ StandardSectoralBevelledTube
Definition: BevelledCylinderVolumeBoundaryAccessors.h:55
Trk::VolumeBounds::VolumeBounds
VolumeBounds()
Default Constructor.
Definition: VolumeBounds.h:48
Trk::DiscBounds
Definition: DiscBounds.h:44
Trk::BevelledCylinderVolumeBounds::m_halfPhiSector
double m_halfPhiSector
Definition: BevelledCylinderVolumeBounds.h:197