Go to the documentation of this file.00001 #ifndef Geometry_TrackerGeometryBuilder_RectangularPixelTopology_H
00002 #define Geometry_TrackerGeometryBuilder_RectangularPixelTopology_H
00003
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include "Geometry/CommonTopologies/interface/PixelTopology.h"
00036 #include "DataFormats/SiPixelDetId/interface/PixelChannelIdentifier.h"
00037 #include <iostream>
00038 #include <iomanip>
00039
00040 namespace {
00041 const float EPS = 0.001;
00042 const float EPSCM = 0.00001;
00043 const bool TP_DEBUG = false;
00044 }
00045
00046 class RectangularPixelTopology : public PixelTopology {
00047 private:
00048
00049 static const int ROWS_PER_ROC = 80;
00050 static const int COLS_PER_ROC = 52;
00051 static const int BIG_PIX_PER_ROC_X = 1;
00052 static const int BIG_PIX_PER_ROC_Y = 2;
00053
00054 public:
00055
00056
00057 RectangularPixelTopology( int nrows, int ncols, float pitchx,
00058 float pitchy) :
00059 m_nrows(nrows), m_ncols(ncols),
00060 m_pitchx(pitchx), m_pitchy(pitchy) {
00061
00062
00063
00064
00065
00066
00067
00068 m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X*m_nrows/ROWS_PER_ROC)/2. *
00069 m_pitchx;
00070 m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y*m_ncols/COLS_PER_ROC)/2. *
00071 m_pitchy;
00072
00073 if(TP_DEBUG) std::cout<<" RectangularPixelTopology: "
00074 <<m_nrows<<" "<<m_ncols<<" "
00075 <<m_pitchx<<" "<<m_pitchy<<" "<<m_xoffset<<" "<<m_yoffset
00076 <<BIG_PIX_PER_ROC_X<<" "<<BIG_PIX_PER_ROC_Y<<" "
00077 <<ROWS_PER_ROC<<" "<<COLS_PER_ROC<<std::endl;
00078 }
00079
00080
00081
00082 virtual LocalPoint localPosition( const MeasurementPoint& mp) const;
00083
00084
00085 virtual MeasurementPoint measurementPosition( const LocalPoint& lp)
00086 const {
00087 std::pair<float,float> p = pixel(lp);
00088 return MeasurementPoint( p.first, p.second);
00089 }
00090
00091
00092
00093 virtual std::pair<float,float> pixel( const LocalPoint& p) const;
00094
00095
00096
00097 virtual LocalError localError( const MeasurementPoint&,
00098 const MeasurementError& ) const;
00099
00100 virtual MeasurementError measurementError( const LocalPoint&,
00101 const LocalError& ) const;
00102
00103
00104
00105 virtual int channel( const LocalPoint& lp) const {
00106 std::pair<float,float> p = pixel(lp);
00107 return PixelChannelIdentifier::pixelToChannel( int(p.first),
00108 int(p.second));
00109 }
00110
00111
00112
00113 virtual float localX(const float mpX) const;
00114 virtual float localY(const float mpY) const;
00115
00116
00117
00118
00119 virtual bool isItBigPixelInX(const int ixbin) const {
00120 return ( (ixbin == 79) || (ixbin == 80));
00121 }
00122 virtual bool isItBigPixelInY(const int iybin) const {
00123 int iybin0 = iybin%52;
00124 return ( (iybin0 == 0) || (iybin0 == 51));
00125 }
00126
00127
00128
00129 bool containsBigPixelInX(const int& ixmin, const int& ixmax) const;
00130 bool containsBigPixelInY(const int& iymin, const int& iymax) const;
00131
00132
00133
00134 bool isItEdgePixelInX (int ixbin) const {
00135 return ( (ixbin == 0) || (ixbin == (m_nrows-1)) );
00136 }
00137 bool isItEdgePixelInY (int iybin) const {
00138 return ( (iybin == 0) || (iybin == (m_ncols-1)) );
00139 }
00140 bool isItEdgePixel (int ixbin, int iybin) const {
00141 return ( isItEdgePixelInX( ixbin ) || isItEdgePixelInY( iybin ) );
00142 }
00143
00144
00145
00146 virtual std::pair<float,float> pitch() const {
00147 return std::pair<float,float>( float(m_pitchx), float(m_pitchy));
00148 }
00149
00150 virtual int nrows() const {
00151 return m_nrows;
00152 }
00153
00154 virtual int ncolumns() const {
00155 return m_ncols;
00156 }
00157
00158 private:
00159 int m_nrows;
00160 int m_ncols;
00161 float m_pitchx;
00162 float m_pitchy;
00163 float m_xoffset;
00164 float m_yoffset;
00165 };
00166
00167 #endif
00168
00169