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

Constructor & Destructor Documentation

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

Definition at line 16 of file DiskSectorBounds.h.

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

Referenced by clone().

16  :
17  theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExtH(0.5f*phiExt) {
18  assert(thePhiExtH>0);
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 34 of file DiskSectorBounds.h.

References DiskSectorBounds().

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

Definition at line 38 of file DiskSectorBounds.h.

References theRmin.

Referenced by BoundDiskSector::innerRadius().

38 {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(), tmp, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by thickness().

5  {
6 
7  // transform to system with local frame situated at disk center
8  // and rotated x/y axis
9  Local3DPoint tmp( p.y()+theOffset, -p.x(), p.z());
10 
11  return
12  ( (tmp.z() >= theZmin) & (tmp.z() <= theZmax) &
13  (tmp.perp2() >= theRmin*theRmin) & (tmp.perp2() <= theRmax*theRmax)
14  ) &&
15  (std::abs(tmp.barePhi()) <= thePhiExtH);
16 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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 18 of file DiskSectorBounds.cc.

References hiPixelPairStep_cff::deltaPhi, deltaR(), f, SiStripPI::max, perp(), perp2(), LocalError::rotate(), mathSSE::sqrt(), tmp, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

18  {
19 
20  if ( (p.z() < theZmin) | (p.z() > theZmax)) return false;
21 
22  Local2DPoint tmp( p.x(), p.y()+ theOffset);
23  auto perp2 = tmp.mag2();
24  auto perp = std::sqrt(perp2);
25 
26  // this is not really correct, should consider also the angle of the error ellipse
27  if (perp2 == 0) return scale*scale*err.yy() > theRmin*theRmin;
28 
29  LocalError tmpErr( err.xx(), err.xy(), err.yy());
30  LocalError rotatedErr = tmpErr.rotate(tmp.x(), tmp.y());
31  // x direction in this system is now r, phi is y
32 
33  float deltaR = scale*std::sqrt(rotatedErr.xx());
34  float deltaPhi = std::atan( scale*std::sqrt(rotatedErr.yy()/perp2));
35 
36  float tmpPhi = std::acos( tmp.y() / perp);
37 
38  // the previous code (tmpPhi <= thePhiExt + deltaPhi) was wrong
39  return ( (perp >= std::max(theRmin-deltaR, 0.f)) & (perp <= theRmax+deltaR) )
40  && (tmpPhi <= thePhiExtH + deltaPhi) ;
41 
42 }
T sqrt(T t)
Definition: SSEVec.h:18
double f[11][100]
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
T perp2() const
Squared magnitude of transverse component.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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:39
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.

Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float DiskSectorBounds::outerRadius ( void  ) const
inline

Definition at line 39 of file DiskSectorBounds.h.

References theRmax.

Referenced by BoundDiskSector::outerRadius().

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

Definition at line 40 of file DiskSectorBounds.h.

References thePhiExtH.

Referenced by BoundDiskSector::phiHalfExtension().

40 {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 inside(), AlCaHLTBitMon_ParallelJobs::p, Scenarios_cff::scale, theZmax, and 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 48 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

float DiskSectorBounds::thePhiExtH
private

Definition at line 47 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theRmax
private

Definition at line 44 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theRmin
private

Definition at line 43 of file DiskSectorBounds.h.

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

float DiskSectorBounds::theZmax
private

Definition at line 46 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

float DiskSectorBounds::theZmin
private

Definition at line 45 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().