Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <Geometry/CSCGeometry/interface/OffsetRadialStripTopology.h>
00021 #include <FWCore/MessageLogger/interface/MessageLogger.h>
00022
00023 #include <iostream>
00024 #include <cmath>
00025
00026 OffsetRadialStripTopology::OffsetRadialStripTopology(
00027 int numberOfStrips, float stripPhiPitch,
00028 float detectorHeight, float radialDistance,
00029 float stripOffset, float yCentre ) :
00030 CSCRadialStripTopology( numberOfStrips, stripPhiPitch, detectorHeight, radialDistance, +1, yCentre),
00031 theStripOffset( stripOffset )
00032 {
00033 float rotate_by = stripOffset * angularWidth();
00034 theCosOff = cos(rotate_by);
00035 theSinOff = sin(rotate_by);
00036
00037 LogTrace("CSCStripTopology|CSC") << "fractional strip offset = " << stripOffset <<
00038 "\n angle = " << rotate_by <<
00039 " cos = " << theCosOff << " sin = " << theSinOff;
00040 }
00041
00042 LocalPoint OffsetRadialStripTopology::localPosition(const MeasurementPoint & mp) const {
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 float phi = phiOfOneEdge() + mp.x() * angularWidth();
00055
00056
00057
00058
00059
00060
00061
00062 float yprime = mp.y() * detHeight() + yCentreOfStripPlane();
00063 float xprime = ( originToIntersection() + yprime ) * tan ( phi );
00064
00065 return toLocal(xprime, yprime);
00066 }
00067
00068 MeasurementPoint OffsetRadialStripTopology::measurementPosition( const LocalPoint& lp ) const {
00069 LocalPoint lpp = this->toPrime(lp);
00070 return CSCRadialStripTopology::measurementPosition(lpp);
00071 }
00072
00073 float OffsetRadialStripTopology::strip(const LocalPoint& lp) const {
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 }
00081
00082 float OffsetRadialStripTopology::stripAngle(float strip) const {
00083 return ( phiOfOneEdge() + (strip+theStripOffset)*angularWidth() );
00084 }
00085
00086 LocalPoint OffsetRadialStripTopology::toLocal(float xprime, float yprime) const {
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 }
00093
00094 LocalPoint OffsetRadialStripTopology::toPrime(const LocalPoint& lp) const {
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 }
00101
00102 std::ostream & operator<<(std::ostream & os, const OffsetRadialStripTopology & orst)
00103 {
00104 os << "OffsetRadialStripTopology isa "
00105 << static_cast<const CSCRadialStripTopology&>( 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 }
00111