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, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance 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::DiskSectorBounds ( float  rmin,
float  rmax,
float  zmin,
float  zmax,
float  phiExt 
)
inline

Definition at line 14 of file DiskSectorBounds.h.

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  }

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

Referenced by clone().

Member Function Documentation

◆ clone()

Bounds* DiskSectorBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 32 of file DiskSectorBounds.h.

32 { return new DiskSectorBounds(*this); }

References DiskSectorBounds().

◆ innerRadius()

float DiskSectorBounds::innerRadius ( void  ) const
inline

Definition at line 34 of file DiskSectorBounds.h.

34 { return theRmin; }

References theRmin.

Referenced by BoundDiskSector::innerRadius().

◆ inside() [1/2]

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.

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 }

References funct::abs(), AlCaHLTBitMon_ParallelJobs::p, and createJobs::tmp.

◆ inside() [2/2]

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.

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 }

References SiPixelRawToDigiRegional_cfi::deltaPhi, PbPb_ZMuSkimMuonDPG_cff::deltaR, runTheMatrix::err, f, SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, perp(), perp2(), LocalError::rotate(), Scenarios_cff::scale, mathSSE::sqrt(), and createJobs::tmp.

◆ length()

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.

24 { return theRmax - theRmin * std::cos(thePhiExtH); }

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

◆ outerRadius()

float DiskSectorBounds::outerRadius ( void  ) const
inline

Definition at line 35 of file DiskSectorBounds.h.

35 { return theRmax; }

References theRmax.

Referenced by BoundDiskSector::outerRadius().

◆ phiHalfExtension()

float DiskSectorBounds::phiHalfExtension ( ) const
inline

Definition at line 36 of file DiskSectorBounds.h.

36 { return thePhiExtH; }

References thePhiExtH.

Referenced by BoundDiskSector::phiHalfExtension().

◆ thickness()

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.

26 { return theZmax - theZmin; }

References theZmax, and theZmin.

◆ width()

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.

25 { return 2.f * theRmax * std::sin(thePhiExtH); }

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

Member Data Documentation

◆ theOffset

float DiskSectorBounds::theOffset
private

Definition at line 44 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

◆ thePhiExtH

float DiskSectorBounds::thePhiExtH
private

Definition at line 43 of file DiskSectorBounds.h.

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

◆ theRmax

float DiskSectorBounds::theRmax
private

Definition at line 40 of file DiskSectorBounds.h.

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

◆ theRmin

float DiskSectorBounds::theRmin
private

Definition at line 39 of file DiskSectorBounds.h.

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

◆ theZmax

float DiskSectorBounds::theZmax
private

Definition at line 42 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

◆ theZmin

float DiskSectorBounds::theZmin
private

Definition at line 41 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

Point2DBase< float, LocalTag >
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DiskSectorBounds::thePhiExtH
float thePhiExtH
Definition: DiskSectorBounds.h:43
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
cms::cuda::assert
assert(be >=bs)
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
DiskSectorBounds::theZmin
float theZmin
Definition: DiskSectorBounds.h:41
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DiskSectorBounds::theOffset
float theOffset
Definition: DiskSectorBounds.h:44
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DiskSectorBounds::theRmax
float theRmax
Definition: DiskSectorBounds.h:40
Point3DBase< float, LocalTag >
DiskSectorBounds::DiskSectorBounds
DiskSectorBounds(float rmin, float rmax, float zmin, float zmax, float phiExt)
Definition: DiskSectorBounds.h:14
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
Scenarios_cff.scale
scale
Definition: Scenarios_cff.py:2186
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
runTheMatrix.err
err
Definition: runTheMatrix.py:288
LocalError
Definition: LocalError.h:12
LocalError::rotate
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
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
DiskSectorBounds::theZmax
float theZmax
Definition: DiskSectorBounds.h:42
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DiskSectorBounds::theRmin
float theRmin
Definition: DiskSectorBounds.h:39