CMS 3D CMS Logo

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 12 of file DiskSectorBounds.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file DiskSectorBounds.h.

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

Referenced by clone().

15  : theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExtH(0.5f * phiExt) {
16  assert(thePhiExtH > 0);
17  if (theRmin > theRmax)
19  if (theZmin > theZmax)
21  theOffset = theRmin + 0.5f * (theRmax - theRmin);
22  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
double f[11][100]

Member Function Documentation

Bounds* DiskSectorBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 32 of file DiskSectorBounds.h.

References DiskSectorBounds().

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

Definition at line 34 of file DiskSectorBounds.h.

References theRmin.

Referenced by BoundDiskSector::innerRadius().

34 { 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().

Referenced by thickness().

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 SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, 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
double f[11][100]
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 24 of file DiskSectorBounds.h.

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

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

Definition at line 35 of file DiskSectorBounds.h.

References theRmax.

Referenced by BoundDiskSector::outerRadius().

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

Definition at line 36 of file DiskSectorBounds.h.

References thePhiExtH.

Referenced by BoundDiskSector::phiHalfExtension().

36 { 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 26 of file DiskSectorBounds.h.

References runTheMatrix::err, inside(), AlCaHLTBitMon_ParallelJobs::p, Scenarios_cff::scale, theZmax, and theZmin.

26 { 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 25 of file DiskSectorBounds.h.

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

Referenced by Vispa.Main.MainWindow.MainWindow::_saveIni(), Vispa.Views.PropertyView.PropertyView::resizeEvent(), Vispa.Views.PropertyView.PropertyView::sectionResized(), and Vispa.Main.MainWindow.MainWindow::updateStartupScreenGeometry().

25 { 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 44 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

float DiskSectorBounds::thePhiExtH
private

Definition at line 43 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theRmax
private

Definition at line 40 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theRmin
private

Definition at line 39 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theZmax
private

Definition at line 42 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

float DiskSectorBounds::theZmin
private

Definition at line 41 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().