CMS 3D CMS Logo

OffsetRadialStripTopology Class Reference

ABC defining RadialStripTopology with shifted offset so that it is not centred on local y (of parent chamber). More...

#include <Geometry/CSCGeometry/interface/OffsetRadialStripTopology.h>

Inheritance diagram for OffsetRadialStripTopology:

RadialStripTopology StripTopology Topology CSCStripTopology CSCGangedStripTopology CSCUngangedStripTopology

List of all members.

Public Member Functions

virtual int channel (const LocalPoint &lp) const =0
 Channel number corresponding to a given LocalPoint.
virtual int channel (int strip) const =0
 Channel number corresponding to a strip or a LocalPoint.
virtual LocalPoint localPosition (const MeasurementPoint &) const
 LocalPoint for a given MeasurementPoint
.
virtual LocalPoint localPosition (float strip) const
 LocalPoint for a given strip.
virtual MeasurementPoint measurementPosition (const LocalPoint &) const
 MeasurementPoint corresponding to given LocalPoint.
 OffsetRadialStripTopology (int numberOfStrips, float stripPhiPitch, float detectorHeight, float radialDistance, float stripOffset, float yCentre)
 Constructor Note that yCentre is local y of symmetry centre of strip plane _before_ the rotation shift: it is passed directly to RST base.
virtual float strip (const LocalPoint &) const
 Strip in which a given LocalPoint lies.
float stripAngle (float strip) const
 Angle between strip and local y axis (measured clockwise from y axis).
virtual float stripOffset (void) const
 Fraction of a strip offset of layer relative to symmetry axis (local y).
virtual ~OffsetRadialStripTopology ()

Private Member Functions

LocalPoint toLocal (float xprime, float yprime) const
 Transform from coordinates wrt strip plane symmetry axes to local coordinates.
LocalPoint toPrime (const LocalPoint &) const
 Transform from local coordinates to coordinates wrt strip plane symmetry axes.

Private Attributes

float theCosOff
float theSinOff
float theStripOffset

Friends

std::ostream & operator<< (std::ostream &, const OffsetRadialStripTopology &)


Detailed Description

ABC defining RadialStripTopology with shifted offset so that it is not centred on local y (of parent chamber).

The offset is specified as a fraction of the strip angular width.

Author:
Tim Cox

Definition at line 17 of file OffsetRadialStripTopology.h.


Constructor & Destructor Documentation

OffsetRadialStripTopology::OffsetRadialStripTopology ( int  numberOfStrips,
float  stripPhiPitch,
float  detectorHeight,
float  radialDistance,
float  stripOffset,
float  yCentre 
)

Constructor Note that yCentre is local y of symmetry centre of strip plane _before_ the rotation shift: it is passed directly to RST base.

Definition at line 26 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::angularWidth(), funct::cos(), LogTrace, funct::sin(), theCosOff, and theSinOff.

00029                                      :
00030   RadialStripTopology( numberOfStrips, stripPhiPitch, detectorHeight, radialDistance, +1, yCentre),
00031              theStripOffset( stripOffset )
00032 { 
00033   float rotate_by = stripOffset * angularWidth(); // now in angular units (radians, I hope)
00034   theCosOff = cos(rotate_by);
00035   theSinOff = sin(rotate_by);
00036 
00037   LogTrace("CSC") << "fractional strip offset = " << stripOffset <<
00038     "\n angle = " << rotate_by << 
00039     " cos = " << theCosOff << " sin = " << theSinOff;
00040 }

virtual OffsetRadialStripTopology::~OffsetRadialStripTopology (  )  [inline, virtual]

Definition at line 28 of file OffsetRadialStripTopology.h.

00028 {};


Member Function Documentation

virtual int OffsetRadialStripTopology::channel ( const LocalPoint lp  )  const [pure virtual]

Channel number corresponding to a given LocalPoint.


This is effectively an integer version of strip(), with range 0 to nstrips-1.
LocalPoints outside the detector strip plane will be considered as contributing to the edge channels 0 or nstrips-1.

Reimplemented from RadialStripTopology.

Implemented in CSCGangedStripTopology, and CSCUngangedStripTopology.

virtual int OffsetRadialStripTopology::channel ( int  strip  )  const [pure virtual]

Channel number corresponding to a strip or a LocalPoint.

Sometimes more than one strip is OR'ed into one channel.

Implemented in CSCGangedStripTopology, and CSCUngangedStripTopology.

Referenced by CSCLayerGeometry::channel().

LocalPoint OffsetRadialStripTopology::localPosition ( const MeasurementPoint mp  )  const [virtual]

LocalPoint for a given MeasurementPoint
.

What's a MeasurementPoint?
A MeasurementPoint is a 2-dim object, with the 1st dim specifying the angular position in strip widths, and the 2nd dim specifying the fractional distance alone a strip.

Thus the 1st dimension measures the angular position wrt central line of symmetry of detector, in units of strip (angular) widths (range 0 to total angle subtended by a detector). The 2nd dimension measures the fractional position along the strip (range -0.5 to +0.5).

BEWARE! The components are not Cartesian.
BEWARE! Neither coordinate may correspond to either local x or local y.
BEWARE! This involves ONLY strip-related measurements, not CSC wires!

Reimplemented from RadialStripTopology.

Definition at line 42 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::angularWidth(), RadialStripTopology::detHeight(), RadialStripTopology::originToIntersection(), phi, RadialStripTopology::phiOfOneEdge(), funct::tan(), toLocal(), PV2DBase< T, PVType, FrameType >::x(), PV2DBase< T, PVType, FrameType >::y(), and RadialStripTopology::yCentreOfStripPlane().

00042                                                                                      {
00043   // Local coordinates are (x,y). Coordinates along symmetry axes of strip
00044   // plane are (x',y'). These are rotated w.r.t. (x,y)
00045 
00046   // You might first think you could implement this as follows (cf. measurementPosition below):
00047   //  LocalPoint lpp = RST::localPosition(MP);
00048   //  return this->toLocal(lpp);
00049   // But this does not work because RST::localPosition makes use of stripAngle() - virtual - and thus
00050   // this is not the appropriate angle - it has the offset added, which is unwanted in this case!
00051   // So have to implement it directly...
00052 
00053   // 1st component of MP measures angular position within strip plane
00054   float phi = phiOfOneEdge() + mp.x() * angularWidth();
00055   // 2nd component of MP is fractional position along strip, with range +/-0.5,
00056   // so distance along strip, measured from mid-point of length of strip, is
00057   //     mp.y() * (length of strip). 
00058   // Distance in direction of coordinate y' is
00059   //    mp.y() * (length of strip) * cos(phi)
00060   // where phi is angle between strip and y' axis.
00061   // But (length of strip) = detHeight/cos(phi), so
00062   float yprime =  mp.y() * detHeight() + yCentreOfStripPlane();
00063   float xprime = ( originToIntersection() + yprime ) * tan ( phi );
00064   //  Rotate to (x,y)
00065   return toLocal(xprime, yprime);
00066 }

virtual LocalPoint OffsetRadialStripTopology::localPosition ( float  strip  )  const [inline, virtual]

LocalPoint for a given strip.

Reimplemented from RadialStripTopology.

Definition at line 37 of file OffsetRadialStripTopology.h.

References RadialStripTopology::localPosition().

00037                                                       {
00038     // Pass through to base class since otherwise it is shadowed by the localPosition(const MP&).
00039     // Note that base class version is OK because it uses stripAngle() which is overridden in ORST!
00040     // Also note that xOfStrip from base class RST also works for ORST for the same reason.
00041     return RadialStripTopology::localPosition( strip );
00042   }

MeasurementPoint OffsetRadialStripTopology::measurementPosition ( const LocalPoint lp  )  const [virtual]

MeasurementPoint corresponding to given LocalPoint.

Reimplemented from RadialStripTopology.

Definition at line 68 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::measurementPosition(), and toPrime().

00068                                                                                             {
00069   LocalPoint lpp = this->toPrime(lp); // in prime system, aligned with strip plane sym axes
00070   return RadialStripTopology::measurementPosition(lpp); // now can use the base class method
00071 }

float OffsetRadialStripTopology::strip ( const LocalPoint lp  )  const [virtual]

Strip in which a given LocalPoint lies.

This is a float which represents the fractional strip position within the detector.
Returns zero if the LocalPoint falls at the extreme low edge of the detector or BELOW, and float(nstrips) if it falls at the extreme high edge or ABOVE.

Reimplemented from RadialStripTopology.

Definition at line 73 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::angularWidth(), RadialStripTopology::nstrips(), RadialStripTopology::originToIntersection(), phi, RadialStripTopology::phiOfOneEdge(), toPrime(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by CSCLayerGeometry::strip().

00073                                                                  {
00074   LocalPoint pnt = toPrime(lp);
00075   float phi = atan2( pnt.x(), pnt.y()+originToIntersection() );
00076   float fstrip = ( phi - phiOfOneEdge() ) / angularWidth();
00077   fstrip = ( fstrip>=0. ? fstrip : 0. );
00078   fstrip = ( fstrip<=nstrips() ? fstrip : nstrips() );
00079   return fstrip;
00080 }

float OffsetRadialStripTopology::stripAngle ( float  strip  )  const [virtual]

Angle between strip and local y axis (measured clockwise from y axis).

Reimplemented from RadialStripTopology.

Definition at line 82 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::angularWidth(), RadialStripTopology::phiOfOneEdge(), and theStripOffset.

Referenced by CSCStripTopology::equationOfStrip(), and CSCLayerGeometry::stripAngle().

00082                                                              {
00083   return ( phiOfOneEdge() + (strip+theStripOffset)*angularWidth() );
00084 }

virtual float OffsetRadialStripTopology::stripOffset ( void   )  const [inline, virtual]

Fraction of a strip offset of layer relative to symmetry axis (local y).

(This is an _angular_ value)

Definition at line 33 of file OffsetRadialStripTopology.h.

References theStripOffset.

Referenced by operator<<(), and CSCLayerGeometry::stripOffset().

00033 { return theStripOffset; }

LocalPoint OffsetRadialStripTopology::toLocal ( float  xprime,
float  yprime 
) const [private]

Transform from coordinates wrt strip plane symmetry axes to local coordinates.

Definition at line 86 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::originToIntersection(), theCosOff, theSinOff, x, and y.

Referenced by localPosition().

00086                                                                               {
00087   float x =  theCosOff * xprime + theSinOff * yprime
00088              + originToIntersection() * theSinOff;
00089   float y = -theSinOff * xprime + theCosOff * yprime
00090              - originToIntersection() * (1. - theCosOff);
00091   return LocalPoint(x, y);
00092 }

LocalPoint OffsetRadialStripTopology::toPrime ( const LocalPoint lp  )  const [private]

Transform from local coordinates to coordinates wrt strip plane symmetry axes.

Definition at line 94 of file OffsetRadialStripTopology.cc.

References RadialStripTopology::originToIntersection(), theCosOff, theSinOff, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by measurementPosition(), and strip().

00094                                                                         {
00095   float xprime = theCosOff * lp.x() - theSinOff * lp.y()
00096                   - originToIntersection() * theSinOff;
00097   float yprime = theSinOff * lp.x() + theCosOff * lp.y()
00098                   - originToIntersection() * (1. - theCosOff);
00099   return LocalPoint(xprime, yprime);
00100 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const OffsetRadialStripTopology orst 
) [friend]

Definition at line 102 of file OffsetRadialStripTopology.cc.

00103 {
00104   os << "OffsetRadialStripTopology isa "
00105      <<  static_cast<const RadialStripTopology&>( orst )
00106      << "fractional strip offset   " << orst.stripOffset()
00107      << "\ncos(angular offset)       " << orst.theCosOff
00108      << "\nsin(angular offset)       " << orst.theSinOff << std::endl;
00109   return os;
00110 }


Member Data Documentation

float OffsetRadialStripTopology::theCosOff [private]

Definition at line 103 of file OffsetRadialStripTopology.h.

Referenced by OffsetRadialStripTopology(), operator<<(), toLocal(), and toPrime().

float OffsetRadialStripTopology::theSinOff [private]

Definition at line 104 of file OffsetRadialStripTopology.h.

Referenced by OffsetRadialStripTopology(), operator<<(), toLocal(), and toPrime().

float OffsetRadialStripTopology::theStripOffset [private]

Definition at line 102 of file OffsetRadialStripTopology.h.

Referenced by stripAngle(), and stripOffset().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:13 2009 for CMSSW by  doxygen 1.5.4