CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

GlobalDetRangeRPhi Class Reference

#include <GlobalDetRangeRPhi.h>

List of all members.

Public Types

typedef std::pair< float, float > Range

Public Member Functions

 GlobalDetRangeRPhi (const BoundPlane &det)
Range phiRange () const
Range rRange () const

Private Attributes

Range thePhiRange
Range theRRange

Detailed Description

Keep R and Phi range for detunit

Definition at line 10 of file GlobalDetRangeRPhi.h.


Member Typedef Documentation

typedef std::pair<float,float> GlobalDetRangeRPhi::Range

Definition at line 13 of file GlobalDetRangeRPhi.h.


Constructor & Destructor Documentation

GlobalDetRangeRPhi::GlobalDetRangeRPhi ( const BoundPlane det)

Definition at line 11 of file GlobalDetRangeRPhi.cc.

References BoundSurface::bounds(), i, Bounds::length(), PV3DBase< T, PVType, FrameType >::phi(), phi, alignCSCRings::r, Surface::toGlobal(), and Bounds::width().

                                                               {

  float dx = plane.bounds().width()/2.;
  float dy = plane.bounds().length()/2.;

  std::vector<Surface::GlobalPoint> corners(4);
  corners[0] = plane.toGlobal( LocalPoint( -dx, -dy, 0));
  corners[1] = plane.toGlobal( LocalPoint( -dx,  dy, 0));
  corners[2] = plane.toGlobal( LocalPoint(  dx, -dy, 0));
  corners[3] = plane.toGlobal( LocalPoint(  dx,  dy, 0));

  float phimin = corners[0].phi();  float phimax = phimin;
  float rmin   = corners[0].perp(); float rmax   = rmin;
  for ( int i=1; i<4; i++) {
    float phi = corners[i].phi();
    if ( PhiLess()( phi, phimin)) phimin = phi;
    if ( PhiLess()( phimax, phi)) phimax = phi;

//    if ( phi < phimin) phimin = phi;
//    if ( phi > phimax) phimax = phi;

    float r = corners[i].perp();
    if ( r < rmin) rmin = r;
    if ( r > rmax) rmax = r;
  }

  theRRange.first    = rmin;
  theRRange.second   = rmax;
  thePhiRange.first  = phimin;
  thePhiRange.second = phimax;

}

Member Function Documentation

Range GlobalDetRangeRPhi::phiRange ( ) const [inline]

Definition at line 18 of file GlobalDetRangeRPhi.h.

References thePhiRange.

Referenced by OuterDetCompatibility::operator()().

{ return thePhiRange;}
Range GlobalDetRangeRPhi::rRange ( ) const [inline]

Definition at line 17 of file GlobalDetRangeRPhi.h.

References theRRange.

Referenced by OuterDetCompatibility::operator()().

{ return theRRange;}

Member Data Documentation

Definition at line 22 of file GlobalDetRangeRPhi.h.

Referenced by phiRange().

Definition at line 21 of file GlobalDetRangeRPhi.h.

Referenced by rRange().