CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
DiskSectorBounds Class Referencefinal

#include <DiskSectorBounds.h>

Inheritance diagram for DiskSectorBounds:
Bounds

Public Member Functions

Boundsclone () const override
 
 DiskSectorBounds (float rmin, float rmax, float zmin, float zmax, float phiExt)
 
float innerRadius () const
 
bool inside (const Local3DPoint &p) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local3DPoint &p, const LocalError &err, float scale) const override
 Determine if a point is inside the bounds, taking error into account. More...
 
float length () const override
 
float outerRadius () const
 
float phiHalfExtension () const
 
float thickness () const override
 
float width () const override
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
virtual float significanceInside (const Local3DPoint &, const LocalError &) const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Attributes

float theOffset
 
float thePhiExtH
 
float theRmax
 
float theRmin
 
float theZmax
 
float theZmin
 

Detailed Description

Definition at line 11 of file DiskSectorBounds.h.

Constructor & Destructor Documentation

DiskSectorBounds::DiskSectorBounds ( float  rmin,
float  rmax,
float  zmin,
float  zmax,
float  phiExt 
)
inline

Definition at line 13 of file DiskSectorBounds.h.

References cms::cuda::assert(), std::swap(), theOffset, thePhiExtH, theRmax, theRmin, theZmax, and theZmin.

Referenced by clone().

14  : theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExtH(0.5f * phiExt) {
15  assert(thePhiExtH > 0);
16  if (theRmin > theRmax)
18  if (theZmin > theZmax)
20  theOffset = theRmin + 0.5f * (theRmax - theRmin);
21  }
assert(be >=bs)
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Function Documentation

Bounds* DiskSectorBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 31 of file DiskSectorBounds.h.

References DiskSectorBounds().

31 { return new DiskSectorBounds(*this); }
DiskSectorBounds(float rmin, float rmax, float zmin, float zmax, float phiExt)
float DiskSectorBounds::innerRadius ( ) const
inline

Definition at line 33 of file DiskSectorBounds.h.

References theRmin.

Referenced by BoundDiskSector::innerRadius().

33 { return theRmin; }
bool DiskSectorBounds::inside ( const Local3DPoint ) const
overridevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 5 of file DiskSectorBounds.cc.

References funct::abs(), createJobs::tmp, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

5  {
6  // transform to system with local frame situated at disk center
7  // and rotated x/y axis
8  Local3DPoint tmp(p.y() + theOffset, -p.x(), p.z());
9 
10  return ((tmp.z() >= theZmin) & (tmp.z() <= theZmax) & (tmp.perp2() >= theRmin * theRmin) &
11  (tmp.perp2() <= theRmax * theRmax)) &&
12  (std::abs(tmp.barePhi()) <= thePhiExtH);
13 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tmp
align.sh
Definition: createJobs.py:716
bool DiskSectorBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
overridevirtual

Determine if a point is inside the bounds, taking error into account.

Implements Bounds.

Definition at line 15 of file DiskSectorBounds.cc.

References srCondWrite_cfg::deltaPhi, HLT_FULL_cff::deltaR, validate-o2o-wbm::f, SiStripPI::max, perp(), perp2(), LocalError::rotate(), mathSSE::sqrt(), createJobs::tmp, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

15  {
16  if ((p.z() < theZmin) | (p.z() > theZmax))
17  return false;
18 
19  Local2DPoint tmp(p.x(), p.y() + theOffset);
20  auto perp2 = tmp.mag2();
21  auto perp = std::sqrt(perp2);
22 
23  // this is not really correct, should consider also the angle of the error ellipse
24  if (perp2 == 0)
25  return scale * scale * err.yy() > theRmin * theRmin;
26 
27  LocalError tmpErr(err.xx(), err.xy(), err.yy());
28  LocalError rotatedErr = tmpErr.rotate(tmp.x(), tmp.y());
29  // x direction in this system is now r, phi is y
30 
31  float deltaR = scale * std::sqrt(rotatedErr.xx());
32  float deltaPhi = std::atan(scale * std::sqrt(rotatedErr.yy() / perp2));
33 
34  float tmpPhi = std::acos(tmp.y() / perp);
35 
36  // the previous code (tmpPhi <= thePhiExt + deltaPhi) was wrong
37  return ((perp >= std::max(theRmin - deltaR, 0.f)) & (perp <= theRmax + deltaR)) && (tmpPhi <= thePhiExtH + deltaPhi);
38 }
T sqrt(T t)
Definition: SSEVec.h:19
T perp2() const
Squared magnitude of transverse component.
T perp() const
Magnitude of transverse component.
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
tmp
align.sh
Definition: createJobs.py:716
float DiskSectorBounds::length ( ) const
inlineoverridevirtual

"Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 23 of file DiskSectorBounds.h.

References funct::cos(), thePhiExtH, theRmax, and theRmin.

23 { return theRmax - theRmin * std::cos(thePhiExtH); }
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float DiskSectorBounds::outerRadius ( ) const
inline

Definition at line 34 of file DiskSectorBounds.h.

References theRmax.

Referenced by BoundDiskSector::outerRadius().

34 { return theRmax; }
float DiskSectorBounds::phiHalfExtension ( ) const
inline

Definition at line 35 of file DiskSectorBounds.h.

References thePhiExtH.

Referenced by BoundDiskSector::phiHalfExtension().

35 { return thePhiExtH; }
float DiskSectorBounds::thickness ( ) const
inlineoverridevirtual

"Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 25 of file DiskSectorBounds.h.

References theZmax, and theZmin.

25 { return theZmax - theZmin; }
float DiskSectorBounds::width ( ) const
inlineoverridevirtual

"width" of the bounds; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 24 of file DiskSectorBounds.h.

References funct::sin(), thePhiExtH, and theRmax.

24 { return 2.f * theRmax * std::sin(thePhiExtH); }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22

Member Data Documentation

float DiskSectorBounds::theOffset
private

Definition at line 43 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

float DiskSectorBounds::thePhiExtH
private

Definition at line 42 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), length(), phiHalfExtension(), and width().

float DiskSectorBounds::theRmax
private

Definition at line 39 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), length(), outerRadius(), and width().

float DiskSectorBounds::theRmin
private

Definition at line 38 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), innerRadius(), and length().

float DiskSectorBounds::theZmax
private

Definition at line 41 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

float DiskSectorBounds::theZmin
private

Definition at line 40 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().