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 "FWCore/ServiceRegistry/interface/Service.h"
00038 # include "FWCore/MessageLogger/interface/MessageLogger.h"
00039
00040 namespace {
00041 const float EPS = 0.001;
00042 const float EPSCM = 0.00001;
00043 }
00044
00045 class RectangularPixelTopology GCC11_FINAL : public PixelTopology
00046 {
00047 public:
00048
00049
00050 RectangularPixelTopology( int nrows, int ncols, float pitchx, float pitchy,
00051 bool upgradeGeometry,
00052 int ROWS_PER_ROC,
00053 int COLS_PER_ROC,
00054 int BIG_PIX_PER_ROC_X,
00055 int BIG_PIX_PER_ROC_Y,
00056 int ROCS_X, int ROCS_Y )
00057 : m_pitchx( pitchx ),
00058 m_pitchy( pitchy ),
00059 m_nrows( nrows ),
00060 m_ncols( ncols ),
00061 m_ROWS_PER_ROC( ROWS_PER_ROC ),
00062 m_COLS_PER_ROC( COLS_PER_ROC ),
00063 m_ROCS_X( ROCS_X ),
00064 m_ROCS_Y( ROCS_Y ),
00065 m_upgradeGeometry( upgradeGeometry )
00066 {
00067
00068
00069
00070 m_xoffset = -(m_nrows + BIG_PIX_PER_ROC_X*m_nrows/ROWS_PER_ROC)/2. *
00071 m_pitchx;
00072 m_yoffset = -(m_ncols + BIG_PIX_PER_ROC_Y*m_ncols/COLS_PER_ROC)/2. *
00073 m_pitchy;
00074
00075 LogDebug("RectangularPixelTopology") << "nrows " << m_nrows << ", ncols " << m_ncols << ", pitchx "
00076 << m_pitchx << ", pitchy " << m_pitchy << ", xoffset "
00077 << m_xoffset << ", yoffset " << m_yoffset << ", BIG_PIX_PER_ROC_X "
00078 << BIG_PIX_PER_ROC_X << ", BIG_PIX_PER_ROC_Y " << BIG_PIX_PER_ROC_Y << ", ROWS_PER_ROC "
00079 << ROWS_PER_ROC << ", COLS_PER_ROC " << COLS_PER_ROC << ", ROCS_X " << ROCS_X << ", ROCS_Y " << ROCS_Y
00080 << "\nNROWS " << m_ROWS_PER_ROC * m_ROCS_X << ", NCOL " << m_COLS_PER_ROC * m_ROCS_Y;
00081 }
00082
00083
00084
00085 virtual LocalPoint localPosition( const MeasurementPoint& mp ) const;
00086
00087
00088 virtual MeasurementPoint measurementPosition( const LocalPoint& lp )
00089 const {
00090 std::pair<float,float> p = pixel( lp );
00091 return MeasurementPoint( p.first, p.second );
00092 }
00093
00094
00095
00096 virtual std::pair<float,float> pixel( const LocalPoint& p ) const;
00097
00098
00099
00100 virtual LocalError localError( const MeasurementPoint&,
00101 const MeasurementError& ) const;
00102
00103 virtual MeasurementError measurementError( const LocalPoint&,
00104 const LocalError& ) const;
00105
00106
00107
00108
00109 virtual int channel( const LocalPoint& lp ) const {
00110 std::pair<float,float> p = pixel( lp );
00111 return PixelChannelIdentifier::pixelToChannel( int( p.first ),
00112 int( p.second ));
00113 }
00114
00115
00116
00117
00118 virtual float localX( const float mpX ) const;
00119 virtual float localY( const float mpY ) const;
00120
00121
00122
00123
00124 virtual bool isItBigPixelInX( const int ixbin ) const {
00125 return (( m_upgradeGeometry )?(false):(( ixbin == 79 ) || ( ixbin == 80 )));
00126 }
00127 virtual bool isItBigPixelInY( const int iybin ) const {
00128 if( m_upgradeGeometry ) return false;
00129 else
00130 {
00131 int iybin0 = iybin%52;
00132 return(( iybin0 == 0 ) || ( iybin0 == 51 ));
00133
00134
00135 }
00136 }
00137
00138
00139
00140
00141 bool containsBigPixelInX( const int& ixmin, const int& ixmax ) const;
00142 bool containsBigPixelInY( const int& iymin, const int& iymax ) const;
00143
00144
00145
00146
00147
00148 bool isItEdgePixelInX (int ixbin) const {
00149 return ( (ixbin == 0) || (ixbin == (m_nrows-1)) );
00150 }
00151 bool isItEdgePixelInY (int iybin) const {
00152 return ( (iybin == 0) || (iybin == (m_ncols-1)) );
00153 }
00154 bool isItEdgePixel (int ixbin, int iybin) const {
00155 return ( isItEdgePixelInX( ixbin ) || isItEdgePixelInY( iybin ) );
00156 }
00157
00158
00159
00160 virtual std::pair<float,float> pitch() const {
00161 return std::pair<float,float>( float(m_pitchx), float(m_pitchy));
00162 }
00163
00164 virtual int nrows() const {
00165 return ( m_nrows );
00166 }
00167
00168 virtual int ncolumns() const {
00169 return ( m_ncols );
00170 }
00171
00172 virtual int rocsY() const {
00173 return m_ROCS_Y;
00174 }
00175
00176 virtual int rocsX() const {
00177 return m_ROCS_X;
00178 }
00179
00180 virtual int rowsperroc() const {
00181 return m_ROWS_PER_ROC;
00182 }
00183
00184 virtual int colsperroc() const {
00185 return m_COLS_PER_ROC;
00186 }
00187
00188 private:
00189
00190 float m_pitchx;
00191 float m_pitchy;
00192 float m_xoffset;
00193 float m_yoffset;
00194 int m_nrows;
00195 int m_ncols;
00196 int m_ROWS_PER_ROC;
00197 int m_COLS_PER_ROC;
00198 int m_ROCS_X;
00199 int m_ROCS_Y;
00200 bool m_upgradeGeometry;
00201 };
00202
00203 #endif
00204
00205