ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Trk::CylinderBounds Class Referencefinal

#include <CylinderBounds.h>

Inheritance diagram for Trk::CylinderBounds:
Collaboration diagram for Trk::CylinderBounds:

Public Types

enum  BoundValues {
  bv_radius = 0, bv_averagePhi = 1, bv_halfPhiSector = 2, bv_halfZ = 3,
  bv_length = 4
}
 BoundValues for readablility. More...
 
enum  BoundsType {
  Cone = 0, Cylinder = 1, Diamond = 2, Disc = 3,
  Ellipse = 5, Rectangle = 6, RotatedTrapezoid = 7, Trapezoid = 8,
  Triangle = 9, DiscTrapezoidal = 10, Annulus = 11, Other = 12
}
 

Public Member Functions

 CylinderBounds ()
 Default Constructor. More...
 
 CylinderBounds (double radius, double halez)
 Constructor - full cylinder. More...
 
 CylinderBounds (double radius, double halfphi, double halez)
 Constructor - cylinder segment. More...
 
 CylinderBounds (double radius, double halfphi, double avphi, double halez)
 Constructor - cylinder segment with given averagePhi, not supposed for CylinderSurfaces. More...
 
 CylinderBounds (const CylinderBounds &cylbo)=default
 Copy Constructor. More...
 
 CylinderBounds (CylinderBounds &&cylbo)=default
 Move Constructor. More...
 
virtual ~CylinderBounds ()=default
 Destructor. More...
 
CylinderBoundsoperator= (const CylinderBounds &cylbo)=default
 Assignment operator. More...
 
CylinderBoundsoperator= (CylinderBounds &&cylbo)=default
 Move assignment operator. More...
 
virtual bool operator== (const SurfaceBounds &sbo) const override
 Equality operator. More...
 
bool operator== (const CylinderBounds &bo) const
 
virtual CylinderBoundsclone () const override
 Virtual constructor. More...
 
virtual BoundsType type () const override final
 Return the bounds type. More...
 
virtual bool inside (const Amg::Vector2D &locpo, double tol1, double tol2) const override final
 This method checks if a LocalPosition is inside z bounds and rphi value- interface method. More...
 
virtual bool inside (const Amg::Vector2D &locpo, const BoundaryCheck &bchk) const override final
 
bool inside3D (const Amg::Vector3D &gp, double tol1=0., double tol2=0.) const
 This method checks if a GlobalPosition is inside the Cylinder - not an interface method, assumes that GlobalPosition is in the right frame. More...
 
virtual bool insideLoc1 (const Amg::Vector2D &locpo, double tol1=0.) const override final
 This method checks inside bounds in loc1. More...
 
virtual bool insideLoc2 (const Amg::Vector2D &locpo, double tol2=0.) const override final
 This method checks inside bounds in loc1. More...
 
virtual double minDistance (const Amg::Vector2D &pos) const override final
 Minimal distance to boundary ( > 0 if outside and <=0 if inside) More...
 
bool insideRadius (const Amg::Vector2D &locpo, double tol) const
 This method checks if a LocalPosition is inside z bounds and inside the radius (for straws) More...
 
virtual double r () const override final
 This method returns the radius. More...
 
double averagePhi () const
 This method returns the average phi. More...
 
double halfPhiSector () const
 This method returns the halfPhiSector angle. More...
 
double halflengthZ () const
 This method returns the halflengthZ. More...
 
virtual MsgStream & dump (MsgStream &sl) const override
 Output Method for MsgStream. More...
 
virtual std::ostream & dump (std::ostream &sl) const override
 Output Method for std::ostream. More...
 
virtual bool operator!= (const SurfaceBounds &sb) const
 Non-Equality operator. More...
 

Protected Member Functions

void swap (double &b1, double &b2)
 Swap method to be called from DiscBounds or TrapezoidalBounds. More...
 
virtual void initCache ()
 virtual initCache method for object persistency More...
 

Private Member Functions

bool inside (double r, double phi, double z, double tol1, double tol2) const
 helper methods for the inside check More...
 
bool insideLocZ (double z, double tol2) const
 

Private Attributes

std::vector< TDD_real_tm_boundValues
 internal storage of the geometry parameters More...
 
bool m_checkPhi
 

Detailed Description

Bounds for a cylindrical Surface. These bounds may be used for both, CylinderSurface and StraightLineSurface. In case of bounds for a StraightLineSurface the radius determines the radius within a localPosition is regarded as inside bounds.

Trk::CylinderBounds also enhance the possibility of a cylinder segment with an opening angle \( 2\cdot\phi_{half}\) around an average \( \phi \) angle \( \phi_{ave} \).

Todo:
update the documentation picture for cylinder segments
Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 45 of file CylinderBounds.h.

Member Enumeration Documentation

◆ BoundsType

This enumerator simplifies the persistency, by saving a dynamic_cast to happen.

Other is reserved for the GeometrySurfaces implementation.

Enumerator
Cone 
Cylinder 
Diamond 
Disc 
Ellipse 
Rectangle 
RotatedTrapezoid 
Trapezoid 
Triangle 
DiscTrapezoidal 
Annulus 
Other 

Definition at line 58 of file SurfaceBounds.h.

59  {
60  Cone = 0,
61  Cylinder = 1,
62  Diamond = 2,
63  Disc = 3,
64  Ellipse = 5,
65  Rectangle = 6,
66  RotatedTrapezoid = 7,
67  Trapezoid = 8,
68  Triangle = 9,
69  DiscTrapezoidal = 10,
70  Annulus = 11,
71  Other = 12
72 
73  };

◆ BoundValues

BoundValues for readablility.

Enumerator
bv_radius 
bv_averagePhi 
bv_halfPhiSector 
bv_halfZ 
bv_length 

Definition at line 49 of file CylinderBounds.h.

50  {
51  bv_radius = 0,
52  bv_averagePhi = 1,
53  bv_halfPhiSector = 2,
54  bv_halfZ = 3,
55  bv_length = 4
56  };

Constructor & Destructor Documentation

◆ CylinderBounds() [1/6]

Trk::CylinderBounds::CylinderBounds ( )

Default Constructor.

Definition at line 18 of file CylinderBounds.cxx.

20  , m_checkPhi(false)
21 {}

◆ CylinderBounds() [2/6]

Trk::CylinderBounds::CylinderBounds ( double  radius,
double  halez 
)

Constructor - full cylinder.

Definition at line 23 of file CylinderBounds.cxx.

◆ CylinderBounds() [3/6]

Trk::CylinderBounds::CylinderBounds ( double  radius,
double  halfphi,
double  halez 
)

Constructor - cylinder segment.

Definition at line 32 of file CylinderBounds.cxx.

◆ CylinderBounds() [4/6]

Trk::CylinderBounds::CylinderBounds ( double  radius,
double  halfphi,
double  avphi,
double  halez 
)

Constructor - cylinder segment with given averagePhi, not supposed for CylinderSurfaces.

Definition at line 41 of file CylinderBounds.cxx.

◆ CylinderBounds() [5/6]

Trk::CylinderBounds::CylinderBounds ( const CylinderBounds cylbo)
default

Copy Constructor.

◆ CylinderBounds() [6/6]

Trk::CylinderBounds::CylinderBounds ( CylinderBounds &&  cylbo)
default

Move Constructor.

◆ ~CylinderBounds()

virtual Trk::CylinderBounds::~CylinderBounds ( )
virtualdefault

Destructor.

Member Function Documentation

◆ averagePhi()

double Trk::CylinderBounds::averagePhi ( ) const

This method returns the average phi.

◆ clone()

virtual CylinderBounds* Trk::CylinderBounds::clone ( ) const
overridevirtual

Virtual constructor.

Implements Trk::SurfaceBounds.

◆ dump() [1/2]

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

Output Method for MsgStream.

Implements Trk::SurfaceBounds.

Definition at line 88 of file CylinderBounds.cxx.

89 {
90  sl << std::setiosflags(std::ios::fixed);
91  sl << std::setprecision(7);
92  sl << "Trk::CylinderBounds: (radius, averagePhi, halfPhiSector, halflengthInZ) = ";
93  sl << "(" << this->r() << ", " << this->averagePhi() << ", ";
94  sl << this->halfPhiSector() << ", " << this->halflengthZ() << ")";
95  sl << std::setprecision(-1);
96  return sl;
97 }

◆ dump() [2/2]

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

Output Method for std::ostream.

Implements Trk::SurfaceBounds.

Definition at line 100 of file CylinderBounds.cxx.

101 {
102  sl << std::setiosflags(std::ios::fixed);
103  sl << std::setprecision(7);
104  sl << "Trk::CylinderBounds: (radius, averagePhi, halfPhiSector, halflengthInZ) = ";
105  sl << "(" << this->r() << ", " << this->averagePhi() << ", ";
106  sl << this->halfPhiSector() << ", " << this->halflengthZ() << ")";
107  sl << std::setprecision(-1);
108  return sl;
109 }

◆ halflengthZ()

double Trk::CylinderBounds::halflengthZ ( ) const

This method returns the halflengthZ.

◆ halfPhiSector()

double Trk::CylinderBounds::halfPhiSector ( ) const

This method returns the halfPhiSector angle.

◆ initCache()

virtual void Trk::SurfaceBounds::initCache ( )
inlineprotectedvirtualinherited

virtual initCache method for object persistency

Reimplemented in Trk::RotatedTrapezoidBounds, Trk::ConeBounds, Trk::RotatedDiamondBounds, and Trk::DiamondBounds.

Definition at line 129 of file SurfaceBounds.h.

129 {}

◆ inside() [1/3]

virtual bool Trk::CylinderBounds::inside ( const Amg::Vector2D locpo,
const BoundaryCheck bchk 
) const
finaloverridevirtual

Implements Trk::SurfaceBounds.

◆ inside() [2/3]

virtual bool Trk::CylinderBounds::inside ( const Amg::Vector2D locpo,
double  tol1,
double  tol2 
) const
finaloverridevirtual

This method checks if a LocalPosition is inside z bounds and rphi value- interface method.

Implements Trk::SurfaceBounds.

◆ inside() [3/3]

bool Trk::CylinderBounds::inside ( double  r,
double  phi,
double  z,
double  tol1,
double  tol2 
) const
private

helper methods for the inside check

◆ inside3D()

bool Trk::CylinderBounds::inside3D ( const Amg::Vector3D gp,
double  tol1 = 0.,
double  tol2 = 0. 
) const

This method checks if a GlobalPosition is inside the Cylinder - not an interface method, assumes that GlobalPosition is in the right frame.

◆ insideLoc1()

virtual bool Trk::CylinderBounds::insideLoc1 ( const Amg::Vector2D locpo,
double  tol1 = 0. 
) const
finaloverridevirtual

This method checks inside bounds in loc1.

  • loc1/loc2 correspond to the natural coordinates of the surface

Implements Trk::SurfaceBounds.

◆ insideLoc2()

virtual bool Trk::CylinderBounds::insideLoc2 ( const Amg::Vector2D locpo,
double  tol2 = 0. 
) const
finaloverridevirtual

This method checks inside bounds in loc1.

  • loc1/loc2 correspond to the natural coordinates of the surface

Implements Trk::SurfaceBounds.

◆ insideLocZ()

bool Trk::CylinderBounds::insideLocZ ( double  z,
double  tol2 
) const
private

◆ insideRadius()

bool Trk::CylinderBounds::insideRadius ( const Amg::Vector2D locpo,
double  tol 
) const

This method checks if a LocalPosition is inside z bounds and inside the radius (for straws)

◆ minDistance()

double Trk::CylinderBounds::minDistance ( const Amg::Vector2D pos) const
finaloverridevirtual

Minimal distance to boundary ( > 0 if outside and <=0 if inside)

Implements Trk::SurfaceBounds.

Definition at line 62 of file CylinderBounds.cxx.

63 {
64  const double pi2 = 2. * M_PI;
65 
66  double sZ = fabs(pos[locZ]) - m_boundValues[CylinderBounds::bv_halfZ];
68  if (wF >= M_PI)
69  return sZ;
70  double dF =
72  if (dF > M_PI)
73  dF = pi2 - dF;
74  double sF = 2. * m_boundValues[CylinderBounds::bv_radius] * sin(.5 * (dF - wF));
75 
76  if (sF <= 0. || sZ <= 0.) {
77  if (sF > sZ){
78  return sF;
79  }
80 
81  return sZ;
82  }
83  return sqrt(sF * sF + sZ * sZ);
84 }

◆ operator!=()

bool Trk::SurfaceBounds::operator!= ( const SurfaceBounds sb) const
inlinevirtualinherited

Non-Equality operator.

Reimplemented in Trk::InvalidBounds.

Definition at line 141 of file SurfaceBounds.h.

142 {
143  return !((*this) == sb);
144 }

◆ operator=() [1/2]

CylinderBounds& Trk::CylinderBounds::operator= ( const CylinderBounds cylbo)
default

Assignment operator.

◆ operator=() [2/2]

CylinderBounds& Trk::CylinderBounds::operator= ( CylinderBounds &&  cylbo)
default

Move assignment operator.

◆ operator==() [1/2]

bool Trk::CylinderBounds::operator== ( const CylinderBounds bo) const

◆ operator==() [2/2]

bool Trk::CylinderBounds::operator== ( const SurfaceBounds sbo) const
overridevirtual

Equality operator.

Implements Trk::SurfaceBounds.

Definition at line 52 of file CylinderBounds.cxx.

53 {
54  // check the type first not to compare apples with oranges
55  const Trk::CylinderBounds* cylbo = dynamic_cast<const Trk::CylinderBounds*>(&sbo);
56  if (!cylbo)
57  return false;
58  return (m_boundValues == cylbo->m_boundValues);
59 }

◆ r()

virtual double Trk::CylinderBounds::r ( ) const
finaloverridevirtual

This method returns the radius.

Implements Trk::SurfaceBounds.

◆ swap()

void Trk::SurfaceBounds::swap ( double &  b1,
double &  b2 
)
inlineprotectedinherited

Swap method to be called from DiscBounds or TrapezoidalBounds.

Definition at line 133 of file SurfaceBounds.h.

134 {
135  double tmp = b1;
136  b1 = b2;
137  b2 = tmp;
138 }

◆ type()

virtual BoundsType Trk::CylinderBounds::type ( ) const
inlinefinaloverridevirtual

Return the bounds type.

Implements Trk::SurfaceBounds.

Definition at line 95 of file CylinderBounds.h.

95 { return SurfaceBounds::Cylinder; }

Member Data Documentation

◆ m_boundValues

std::vector<TDD_real_t> Trk::CylinderBounds::m_boundValues
private

internal storage of the geometry parameters

Definition at line 143 of file CylinderBounds.h.

◆ m_checkPhi

bool Trk::CylinderBounds::m_checkPhi
private

Definition at line 144 of file CylinderBounds.h.


The documentation for this class was generated from the following files:
Trk::SurfaceBounds::DiscTrapezoidal
@ DiscTrapezoidal
Definition: SurfaceBounds.h:69
Trk::CylinderBounds::halfPhiSector
double halfPhiSector() const
This method returns the halfPhiSector angle.
Trk::SurfaceBounds::Cone
@ Cone
Definition: SurfaceBounds.h:60
Trk::SurfaceBounds::Rectangle
@ Rectangle
Definition: SurfaceBounds.h:65
Trk::locRPhi
@ locRPhi
Definition: ParamDefs.h:46
python.PhysicalConstants.pi2
float pi2
Definition: PhysicalConstants.py:52
M_PI
#define M_PI
Definition: ActiveFraction.h:11
Trk::SurfaceBounds::Annulus
@ Annulus
Definition: SurfaceBounds.h:70
Trk::SurfaceBounds::Diamond
@ Diamond
Definition: SurfaceBounds.h:62
Trk::CylinderBounds::bv_averagePhi
@ bv_averagePhi
Definition: CylinderBounds.h:52
Trk::CylinderBounds::bv_halfPhiSector
@ bv_halfPhiSector
Definition: CylinderBounds.h:53
Trk::CylinderBounds::m_checkPhi
bool m_checkPhi
Definition: CylinderBounds.h:144
Trk::CylinderBounds::bv_halfZ
@ bv_halfZ
Definition: CylinderBounds.h:54
Trk::locZ
@ locZ
local cylindrical
Definition: ParamDefs.h:48
Trk::CylinderBounds
Definition: CylinderBounds.h:46
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
keylayer_zslicemap.sb
sb
Definition: keylayer_zslicemap.py:192
Trk::SurfaceBounds::Trapezoid
@ Trapezoid
Definition: SurfaceBounds.h:67
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Trk::SurfaceBounds::Disc
@ Disc
Definition: SurfaceBounds.h:63
Trk::CylinderBounds::bv_length
@ bv_length
Definition: CylinderBounds.h:55
Trk::SurfaceBounds::RotatedTrapezoid
@ RotatedTrapezoid
Definition: SurfaceBounds.h:66
Trk::CylinderBounds::m_boundValues
std::vector< TDD_real_t > m_boundValues
internal storage of the geometry parameters
Definition: CylinderBounds.h:143
Trk::SurfaceBounds::Other
@ Other
Definition: SurfaceBounds.h:71
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
Trk::CylinderBounds::averagePhi
double averagePhi() const
This method returns the average phi.
Trk::SurfaceBounds::Triangle
@ Triangle
Definition: SurfaceBounds.h:68
Trk::SurfaceBounds::Ellipse
@ Ellipse
Definition: SurfaceBounds.h:64
Trk::CylinderBounds::bv_radius
@ bv_radius
Definition: CylinderBounds.h:51
Trk::CylinderBounds::halflengthZ
double halflengthZ() const
This method returns the halflengthZ.
Trk::SurfaceBounds::Cylinder
@ Cylinder
Definition: SurfaceBounds.h:61
Trk::CylinderBounds::r
virtual double r() const override final
This method returns the radius.