CMS 3D CMS Logo

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

#include <DiskSectorBounds.h>

Inheritance diagram for DiskSectorBounds:
Bounds

Public Member Functions

virtual Boundsclone () const
 
 DiskSectorBounds (float rmin, float rmax, float zmin, float zmax, float phiExt)
 
float innerRadius () const
 
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &p, const LocalError &err, float scale) const
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err) const
 
virtual float length () const
 
float outerRadius () const
 
float phiExtension () const
 
virtual float thickness () const
 
virtual float width () const
 
- Public Member Functions inherited from Bounds
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 float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
virtual ~Bounds ()
 

Private Attributes

float theOffset
 
float thePhiExt
 
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 15 of file DiskSectorBounds.h.

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

Referenced by clone().

15  :
16  theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExt(phiExt) {
19  theOffset = theRmin + (theRmax-theRmin)/2. ;
20  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)

Member Function Documentation

virtual Bounds* DiskSectorBounds::clone ( void  ) const
inlinevirtual

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 ( ) 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
virtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 5 of file DiskSectorBounds.cc.

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

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 fabs(tmp.phi()) <= thePhiExt/2. &&
12  tmp.perp() >= theRmin && tmp.perp() <= theRmax &&
13  tmp.z() >= theZmin && tmp.z() <= theZmax ;
14 
15 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool DiskSectorBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
virtual

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

Implements Bounds.

Definition at line 17 of file DiskSectorBounds.cc.

References Geom::deltaPhi(), deltaR(), f, 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().

17  {
18 
19  if (p.z() < theZmin || p.z() > theZmax) return false;
20 
21  Local3DPoint tmp( p.x(), p.y()+ theOffset, p.z());
22  double perp2 = tmp.perp2();
23  double perp = sqrt(perp2);
24 
25  // this is not really correct, should consider also the angle of the error ellipse
26  if (perp2 == 0) return scale*scale*err.yy() > theRmin*theRmin;
27 
28  LocalError tmpErr( err.xx(), err.xy(), err.yy());
29  LocalError rotatedErr = tmpErr.rotate(tmp.x(), tmp.y());
30  // x direction in this system is now r, phi is y
31 
32  float deltaR = scale*sqrt(rotatedErr.xx());
33  float deltaPhi = atan( scale*sqrt(rotatedErr.yy())/perp);
34 
35  float tmpPhi = acos( tmp.y() / perp);
36 
37  return perp >= max(theRmin-deltaR, 0.f) && perp <= theRmax+deltaR
38  && tmpPhi <= thePhiExt + deltaPhi ;
39 
40 }
double deltaPhi(float phi1, float phi2)
Definition: VectorUtil.h:30
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:28
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:34
virtual bool DiskSectorBounds::inside ( const Local2DPoint p,
const LocalError err 
) const
inlinevirtual

Definition at line 30 of file DiskSectorBounds.h.

References Bounds::inside().

30  {
31  return Bounds::inside(p,err);
32  }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual float DiskSectorBounds::length ( ) const
inlinevirtual

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

Implements Bounds.

Definition at line 22 of file DiskSectorBounds.h.

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

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

Definition at line 39 of file DiskSectorBounds.h.

References theRmax.

Referenced by BoundDiskSector::outerRadius().

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

Definition at line 40 of file DiskSectorBounds.h.

References thePhiExt.

Referenced by BoundDiskSector::phiExtension().

40 {return thePhiExt;}
virtual float DiskSectorBounds::thickness ( ) const
inlinevirtual

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

Implements Bounds.

Definition at line 24 of file DiskSectorBounds.h.

References theZmax, and theZmin.

Referenced by CompositeTECPetal::overlap().

virtual float DiskSectorBounds::width ( ) const
inlinevirtual

Member Data Documentation

float DiskSectorBounds::theOffset
private

Definition at line 48 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

float DiskSectorBounds::thePhiExt
private

Definition at line 47 of file DiskSectorBounds.h.

Referenced by length(), phiExtension(), 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().