CMS 3D CMS Logo

RectangularPixelTopology Class Reference

#include <Geometry/TrackerTopology/interface/RectangularPixelTopology.h>

Inheritance diagram for RectangularPixelTopology:

PixelTopology Topology

List of all members.

Public Member Functions

virtual int channel (const LocalPoint &lp) const
bool containsBigPixelInX (const int &ixmin, const int &ixmax) const
bool containsBigPixelInY (const int &iymin, const int &iymax) const
bool isItEdgePixel (int ixbin, int iybin) const
bool isItEdgePixelInX (int ixbin) const
bool isItEdgePixelInY (int iybin) const
virtual LocalError localError (const MeasurementPoint &, const MeasurementError &) const
virtual LocalPoint localPosition (const MeasurementPoint &mp) const
float localX (const float mpX) const
float localY (const float mpY) const
virtual MeasurementError measurementError (const LocalPoint &, const LocalError &) const
virtual MeasurementPoint measurementPosition (const LocalPoint &lp) const
virtual int ncolumns () const
virtual int nrows () const
virtual std::pair< float, float > pitch () const
virtual std::pair< float, float > pixel (const LocalPoint &p) const
 Topology for rectangular pixel detector with BIG pixels.
 RectangularPixelTopology (int nrows, int ncols, float pitchx, float pitchy)

Static Public Member Functions

static bool isItBigPixelInX (const int ixbin)
static bool isItBigPixelInY (const int iybin)

Private Attributes

int m_ncols
int m_nrows
float m_pitchx
float m_pitchy
float m_xoffset
float m_yoffset

Static Private Attributes

static const int BIG_PIX_PER_ROC_X = 1
static const int BIG_PIX_PER_ROC_Y = 2
static const int COLS_PER_ROC = 52
static const int ROWS_PER_ROC = 80


Detailed Description

Definition at line 46 of file RectangularPixelTopology.h.


Constructor & Destructor Documentation

RectangularPixelTopology::RectangularPixelTopology ( int  nrows,
int  ncols,
float  pitchx,
float  pitchy 
) [inline]

Definition at line 57 of file RectangularPixelTopology.h.

References BIG_PIX_PER_ROC_X, BIG_PIX_PER_ROC_Y, COLS_PER_ROC, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), m_ncols, m_nrows, m_pitchx, m_pitchy, m_xoffset, m_yoffset, ROWS_PER_ROC, and TP_DEBUG.

00058                                           :
00059     m_nrows(nrows), m_ncols(ncols), 
00060     m_pitchx(pitchx), m_pitchy(pitchy) {
00061                                 
00062     //using std::cout;
00063     //using std::endl;
00064 
00065     // Calculate the edge of the active sensor with respect to the center,
00066     // that is simply the half-size.       
00067     // Take into account large pixels
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   }


Member Function Documentation

virtual int RectangularPixelTopology::channel ( const LocalPoint lp  )  const [inline, virtual]

Implements Topology.

Definition at line 105 of file RectangularPixelTopology.h.

References p, pixel(), and PixelChannelIdentifier::pixelToChannel().

00105                                                    {
00106     std::pair<float,float> p = pixel(lp);
00107     return PixelChannelIdentifier::pixelToChannel( int(p.first), 
00108                                                    int(p.second));
00109   }

bool RectangularPixelTopology::containsBigPixelInX ( const int ixmin,
const int ixmax 
) const

Definition at line 516 of file RectangularPixelTopology.cc.

References i, and isItBigPixelInX().

Referenced by SiPixelErrorEstimation::analyze(), and PixelCPEParmError::localError().

00516                                                                                            {
00517   bool big = false;
00518   for(int i=ixmin; i!=ixmax+1; i++) {
00519     if(isItBigPixelInX(i) && big==false) big=true;
00520   }
00521   return big;
00522 }

bool RectangularPixelTopology::containsBigPixelInY ( const int iymin,
const int iymax 
) const

Definition at line 524 of file RectangularPixelTopology.cc.

References i, and isItBigPixelInY().

Referenced by SiPixelErrorEstimation::analyze(), and PixelCPEParmError::localError().

00524                                                                                            {
00525   bool big = false;
00526   for(int i=iymin; i!=iymax+1; i++) {
00527     if(isItBigPixelInY(i) && big==false) big=true;
00528   }
00529   return big;
00530 }

static bool RectangularPixelTopology::isItBigPixelInX ( const int  ixbin  )  [inline, static]

Definition at line 119 of file RectangularPixelTopology.h.

Referenced by containsBigPixelInX(), ClusterShape::determineShape(), localError(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), and CPEFromDetPosition::measurementPosition().

00119                                                       {
00120     return ( (ixbin == 79) || (ixbin == 80));
00121   } 

static bool RectangularPixelTopology::isItBigPixelInY ( const int  iybin  )  [inline, static]

Definition at line 122 of file RectangularPixelTopology.h.

Referenced by containsBigPixelInY(), ClusterShape::determineShape(), localError(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), CPEFromDetPosition::measurementPosition(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00122                                                       {
00123     int iybin0 = iybin%52;
00124     return ( (iybin0 == 0) || (iybin0 == 51));
00125   } 

bool RectangularPixelTopology::isItEdgePixel ( int  ixbin,
int  iybin 
) const [inline]

Definition at line 140 of file RectangularPixelTopology.h.

References isItEdgePixelInX(), and isItEdgePixelInY().

00140                                                   {
00141     return ( isItEdgePixelInX( ixbin ) || isItEdgePixelInY( iybin ) );
00142   } 

bool RectangularPixelTopology::isItEdgePixelInX ( int  ixbin  )  const [inline]

Definition at line 134 of file RectangularPixelTopology.h.

References m_nrows.

Referenced by SiPixelErrorEstimation::analyze(), isItEdgePixel(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), CPEFromDetPosition::localError(), and PixelCPETemplateReco::localError().

00134                                           {
00135     return ( (ixbin == 0) || (ixbin == (m_nrows-1)) );
00136   } 

bool RectangularPixelTopology::isItEdgePixelInY ( int  iybin  )  const [inline]

Definition at line 137 of file RectangularPixelTopology.h.

References m_ncols.

Referenced by SiPixelErrorEstimation::analyze(), isItEdgePixel(), PixelCPEParmError::localError(), PixelCPEGeneric::localError(), PixelCPEInitial::localError(), CPEFromDetPosition::localError(), and PixelCPETemplateReco::localError().

00137                                           {
00138     return ( (iybin == 0) || (iybin == (m_ncols-1)) );
00139   } 

LocalError RectangularPixelTopology::localError ( const MeasurementPoint mp,
const MeasurementError me 
) const [virtual]

Implements Topology.

Definition at line 480 of file RectangularPixelTopology.cc.

References int, isItBigPixelInX(), isItBigPixelInY(), m_pitchx, m_pitchy, MeasurementError::uu(), MeasurementError::vv(), PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

00482                                                                         {
00483   float pitchy=m_pitchy;
00484   int binoffy=int(mp.y());
00485   if( isItBigPixelInY(binoffy) )pitchy = 2.*m_pitchy;
00486 
00487   float pitchx=m_pitchx;
00488   int binoffx=int(mp.x());
00489   if( isItBigPixelInX(binoffx) )pitchx = 2.*m_pitchx;
00490 
00491   return LocalError( me.uu()*float(pitchx*pitchx), 0,
00492                      me.vv()*float(pitchy*pitchy));
00493 }

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

Implements Topology.

Definition at line 141 of file RectangularPixelTopology.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), EPS, localX(), localY(), m_ncols, m_nrows, TP_DEBUG, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by VisSiPixelCluster::analyze(), SiPixelTrackResidualSource::analyze(), SiPixelErrorEstimation::analyze(), SiPixelErrorEstimation::computeAnglesFromDetPosition(), PixelCPEBase::computeAnglesFromDetPosition(), VisCuTrackerCluster::drawcluster(), VisCuTrackerDigi::drawdigi(), SiPixelLorentzAngle::fillPix(), CPEFromDetPosition::localPosition(), PixelCPEGeneric::localPosition(), PixelCPETemplateReco::localPosition(), VisTrackerPiClusterTwig::update(), VisCuTrackerDigi::update(), VisCuTrackerCluster::update(), VisTrackerPiDigiTwig::update(), VisCuTrackerCluster::updatetext(), and VisCuTrackerDigi::updatetext().

00142                                           {
00143   using std::cout;
00144   using std::endl;
00145 
00146   float mpy = mp.y(); // measurements 
00147   float mpx = mp.x();
00148 
00149   // check limits
00150   if(TP_DEBUG) {
00151     if( mpy<0.) { //  
00152       cout<<" wrong mp y, fix "<<mpy<<" "
00153           <<0<<endl;
00154       mpy = 0.;
00155     }
00156     if( mpy>=m_ncols) {
00157       cout<<" wrong mp y, fix "<<mpy<<" "
00158           <<m_ncols<<endl;
00159       mpy = float(m_ncols) - EPS; // EPS is a small number
00160     }
00161     if( mpx<0.) { //  
00162       cout<<" wrong mp x, fix "<<mpx<<" "
00163           <<0<<endl;
00164       mpx = 0.;
00165     }
00166     if( mpx>=m_nrows) {
00167       cout<<" wrong mp x, fix "<<mpx<<" "
00168           <<m_nrows<<endl;
00169       mpx = float(m_nrows) - EPS; // EPS is a small number
00170     }
00171   } // if TP_DEBUG
00172   
00173 
00174   // IF IT WORKS OK REPLACE THE CODE BELOW BY A CALL TO localY()
00175   float lpY = localY(mpy);
00176 
00177 //   // Start with Y
00178 //   int binoffy = int(mpy);             // truncate to int
00179 //   float fractionY = mpy - binoffy; // find the fraction 
00180 //   float local_pitchy = m_pitchy;      // defaultpitch
00181 //   //if(fractionY<0.) cout<<" fractiony m "<<fractionY<<" "<<mpy<<endl;
00182 
00183 //   if (binoffy>415) {   // too large
00184 //     if(TP_DEBUG) { 
00185 //       cout<<" very bad, biny "<<binoffy<<endl;
00186 //       cout<<mpy<<" "<<binoffy<<" "
00187 //        <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
00188 //     }
00189 //   } else if (binoffy==415) {    // ROC 7, last big pixel
00190 //     binoffy=binoffy+15;
00191 //     local_pitchy = 2 * m_pitchy;
00192 //   } else if (binoffy>364) {     // ROC 7
00193 //     binoffy=binoffy+15;
00194 //   } else if (binoffy==364) {    // ROC 7
00195 //     binoffy=binoffy+14;
00196 //     local_pitchy = 2 * m_pitchy;
00197     
00198 //   } else if (binoffy==363) {      // ROC 6
00199 //     binoffy=binoffy+13;
00200 //     local_pitchy = 2 * m_pitchy;    
00201 //   } else if (binoffy>312) {       // ROC 6
00202 //     binoffy=binoffy+13;
00203 //   } else if (binoffy==312) {      // ROC 6
00204 //     binoffy=binoffy+12;
00205 //     local_pitchy = 2 * m_pitchy;
00206     
00207 //   } else if (binoffy==311) {      // ROC 5
00208 //     binoffy=binoffy+11;
00209 //     local_pitchy = 2 * m_pitchy;    
00210 //   } else if (binoffy>260) {       // ROC 5
00211 //     binoffy=binoffy+11;
00212 //   } else if (binoffy==260) {      // ROC 5
00213 //     binoffy=binoffy+10;
00214 //     local_pitchy = 2 * m_pitchy;
00215     
00216 //   } else if (binoffy==259) {      // ROC 4
00217 //     binoffy=binoffy+9;
00218 //     local_pitchy = 2 * m_pitchy;    
00219 //   } else if (binoffy>208) {       // ROC 4
00220 //     binoffy=binoffy+9;
00221 //   } else if (binoffy==208) {      // ROC 4
00222 //     binoffy=binoffy+8;
00223 //     local_pitchy = 2 * m_pitchy;
00224     
00225 //   } else if (binoffy==207) {      // ROC 3
00226 //     binoffy=binoffy+7;
00227 //     local_pitchy = 2 * m_pitchy;    
00228 //     } else if (binoffy>156) {       // ROC 3
00229 //     binoffy=binoffy+7;
00230 //   } else if (binoffy==156) {      // ROC 3
00231 //     binoffy=binoffy+6;
00232 //     local_pitchy = 2 * m_pitchy;
00233     
00234 //   } else if (binoffy==155) {      // ROC 2
00235 //     binoffy=binoffy+5;
00236 //     local_pitchy = 2 * m_pitchy;    
00237 //   } else if (binoffy>104) {       // ROC 2
00238 //     binoffy=binoffy+5;
00239 //   } else if (binoffy==104) {      // ROC 2
00240 //     binoffy=binoffy+4;
00241 //     local_pitchy = 2 * m_pitchy;
00242     
00243 //   } else if (binoffy==103) {      // ROC 1
00244 //     binoffy=binoffy+3;
00245 //     local_pitchy = 2 * m_pitchy;    
00246 //   } else if (binoffy>52) {       // ROC 1
00247 //     binoffy=binoffy+3;
00248 //   } else if (binoffy==52) {      // ROC 1
00249 //     binoffy=binoffy+2;
00250 //     local_pitchy = 2 * m_pitchy;
00251     
00252 //   } else if (binoffy==51) {      // ROC 0
00253 //     binoffy=binoffy+1;
00254 //     local_pitchy = 2 * m_pitchy;    
00255 //   } else if (binoffy>0) {        // ROC 0
00256 //     binoffy=binoffy+1;
00257 //   } else if (binoffy==0) {       // ROC 0
00258 //     binoffy=binoffy+0;
00259 //     local_pitchy = 2 * m_pitchy;
00260 //   } else { // too small
00261 //     if(TP_DEBUG) { 
00262 //       cout<<" very bad, biny "<<binoffy<<endl;
00263 //       cout<<mpy<<" "<<binoffy<<" "
00264 //        <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
00265 //     }
00266 //   }
00267   
00268 //   // The final position in local coordinates 
00269 //   float lpY = float(binoffy*m_pitchy) + fractionY*local_pitchy + 
00270 //     m_yoffset;
00271 //   if(TP_DEBUG && (lpY<m_yoffset || lpY>(-m_yoffset)) ) {
00272 //     cout<<" bad lp y "<<lpY<<endl; 
00273 //     cout<<mpy<<" "<<binoffy<<" "
00274 //      <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
00275 //   }
00276   
00277 
00278   // IF IT WORKS OK REPLACE THE CODE BELOW BY A CALL TO localX()
00279   float lpX = localX(mpx);
00280 
00281 //   // Do the X
00282 //   int binoffx=int(mpx);             // truncate to int
00283 //   float fractionX = mpx - binoffx; // find the fraction 
00284 //   float local_pitchx = m_pitchx;      // defaultpitch
00285 //   //if(fractionX<0.) cout<<" fractionx m "<<fractionX<<" "<<mpx<<endl;
00286   
00287 //   if (binoffx>159) {   // too large
00288 //     if(TP_DEBUG) { 
00289 //       cout<<" very bad, binx "<<binoffx<<endl;
00290 //       cout<<mpx<<" "<<binoffx<<" "
00291 //        <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
00292 //     }
00293 //   } else if (binoffx>80) {     // ROC 1
00294 //     binoffx=binoffx+2;
00295 //   } else if (binoffx==80) {    // ROC 1
00296 //     binoffx=binoffx+1;
00297 //     local_pitchx = 2 * m_pitchx;
00298     
00299 //   } else if (binoffx==79) {      // ROC 0
00300 //     binoffx=binoffx+0;
00301 //     local_pitchx = 2 * m_pitchx;    
00302 //   } else if (binoffx>=0) {       // ROC 0
00303 //     binoffx=binoffx+0;
00304     
00305 //   } else { // too small
00306 //     if(TP_DEBUG) { 
00307 //       cout<<" very bad, binx "<<binoffx<<endl;
00308 //       cout<<mpx<<" "<<binoffx<<" "
00309 //        <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
00310 //     }
00311 //   }
00312   
00313 //   // The final position in local coordinates 
00314 //   float lpX = float(binoffx*m_pitchx) + fractionX*local_pitchx + 
00315 //     m_xoffset;
00316   
00317 //   if(TP_DEBUG && (lpX<m_xoffset || lpX>(-m_xoffset)) ) {
00318 //     cout<<" bad lp x "<<lpX<<endl; 
00319 //     cout<<mpx<<" "<<binoffx<<" "
00320 //      <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
00321 //   }
00322   
00323   // Return it as a LocalPoint
00324   return LocalPoint( lpX, lpY);
00325 }

float RectangularPixelTopology::localX ( const float  mpX  )  const

Definition at line 330 of file RectangularPixelTopology.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), int, m_pitchx, m_xoffset, and TP_DEBUG.

Referenced by localPosition(), PixelCPETemplateReco::localPosition(), PixelCPEInitial::xpos(), CPEFromDetPosition::xpos(), and PixelCPEParmError::xpos().

00330                                                             {
00331   using std::cout;
00332   using std::endl;
00333 
00334   int binoffx=int(mpx);             // truncate to int
00335   float fractionX = mpx - binoffx; // find the fraction 
00336   float local_pitchx = m_pitchx;      // defaultpitch
00337   //if(fractionX<0.) cout<<" fractionx m "<<fractionX<<" "<<mpx<<endl;
00338   
00339         if (binoffx>80) {            // ROC 1 - handles x on edge cluster
00340     binoffx=binoffx+2;
00341   } else if (binoffx==80) {    // ROC 1
00342     binoffx=binoffx+1;
00343     local_pitchx = 2 * m_pitchx;
00344     
00345   } else if (binoffx==79) {      // ROC 0
00346     binoffx=binoffx+0;
00347     local_pitchx = 2 * m_pitchx;    
00348   } else if (binoffx>=0) {       // ROC 0
00349     binoffx=binoffx+0;
00350     
00351   } else { // too small
00352     if(TP_DEBUG) { 
00353       cout<<" very bad, binx "<<binoffx<<endl;
00354       cout<<mpx<<" "<<binoffx<<" "
00355           <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
00356     }
00357   }
00358   
00359   // The final position in local coordinates 
00360   float lpX = float(binoffx*m_pitchx) + fractionX*local_pitchx + 
00361     m_xoffset;
00362   
00363   if(TP_DEBUG && (lpX<m_xoffset || lpX>(-m_xoffset)) ) {
00364     cout<<" bad lp x "<<lpX<<endl; 
00365     cout<<mpx<<" "<<binoffx<<" "
00366         <<fractionX<<" "<<local_pitchx<<" "<<m_xoffset<<endl;
00367   }
00368 
00369   return lpX;
00370 } 

float RectangularPixelTopology::localY ( const float  mpY  )  const

Definition at line 374 of file RectangularPixelTopology.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), int, m_pitchy, m_yoffset, and TP_DEBUG.

Referenced by localPosition(), PixelCPETemplateReco::localPosition(), PixelCPEParmError::ypos(), and PixelCPEInitial::ypos().

00374                                                             {
00375   using std::cout;
00376   using std::endl;
00377   int binoffy = int(mpy);             // truncate to int
00378   float fractionY = mpy - binoffy; // find the fraction 
00379   float local_pitchy = m_pitchy;      // defaultpitch
00380   //if(fractionY<0.) cout<<" fractiony m "<<fractionY<<" "<<mpy<<endl;
00381 
00382   if (binoffy>416) {            // ROC 8, not real ROC
00383     binoffy=binoffy+17;
00384   } else if (binoffy==416) {    // ROC 8
00385     binoffy=binoffy+16;
00386     local_pitchy = 2 * m_pitchy;
00387                 
00388   } else if (binoffy==415) {    // ROC 7, last big pixel
00389     binoffy=binoffy+15;
00390     local_pitchy = 2 * m_pitchy;
00391   } else if (binoffy>364) {     // ROC 7
00392     binoffy=binoffy+15;
00393   } else if (binoffy==364) {    // ROC 7
00394     binoffy=binoffy+14;
00395     local_pitchy = 2 * m_pitchy;
00396     
00397   } else if (binoffy==363) {      // ROC 6
00398     binoffy=binoffy+13;
00399     local_pitchy = 2 * m_pitchy;    
00400   } else if (binoffy>312) {       // ROC 6
00401     binoffy=binoffy+13;
00402   } else if (binoffy==312) {      // ROC 6
00403     binoffy=binoffy+12;
00404     local_pitchy = 2 * m_pitchy;
00405     
00406   } else if (binoffy==311) {      // ROC 5
00407     binoffy=binoffy+11;
00408     local_pitchy = 2 * m_pitchy;    
00409   } else if (binoffy>260) {       // ROC 5
00410     binoffy=binoffy+11;
00411   } else if (binoffy==260) {      // ROC 5
00412     binoffy=binoffy+10;
00413     local_pitchy = 2 * m_pitchy;
00414     
00415   } else if (binoffy==259) {      // ROC 4
00416     binoffy=binoffy+9;
00417     local_pitchy = 2 * m_pitchy;    
00418   } else if (binoffy>208) {       // ROC 4
00419     binoffy=binoffy+9;
00420   } else if (binoffy==208) {      // ROC 4
00421     binoffy=binoffy+8;
00422     local_pitchy = 2 * m_pitchy;
00423     
00424   } else if (binoffy==207) {      // ROC 3
00425     binoffy=binoffy+7;
00426     local_pitchy = 2 * m_pitchy;    
00427     } else if (binoffy>156) {       // ROC 3
00428     binoffy=binoffy+7;
00429   } else if (binoffy==156) {      // ROC 3
00430     binoffy=binoffy+6;
00431     local_pitchy = 2 * m_pitchy;
00432     
00433   } else if (binoffy==155) {      // ROC 2
00434     binoffy=binoffy+5;
00435     local_pitchy = 2 * m_pitchy;    
00436   } else if (binoffy>104) {       // ROC 2
00437     binoffy=binoffy+5;
00438   } else if (binoffy==104) {      // ROC 2
00439     binoffy=binoffy+4;
00440     local_pitchy = 2 * m_pitchy;
00441     
00442   } else if (binoffy==103) {      // ROC 1
00443     binoffy=binoffy+3;
00444     local_pitchy = 2 * m_pitchy;    
00445   } else if (binoffy>52) {       // ROC 1
00446     binoffy=binoffy+3;
00447   } else if (binoffy==52) {      // ROC 1
00448     binoffy=binoffy+2;
00449     local_pitchy = 2 * m_pitchy;
00450     
00451   } else if (binoffy==51) {      // ROC 0
00452     binoffy=binoffy+1;
00453     local_pitchy = 2 * m_pitchy;    
00454   } else if (binoffy>0) {        // ROC 0
00455     binoffy=binoffy+1;
00456   } else if (binoffy==0) {       // ROC 0
00457     binoffy=binoffy+0;
00458     local_pitchy = 2 * m_pitchy;
00459   } else { // too small
00460     if(TP_DEBUG) { 
00461       cout<<" very bad, biny "<<binoffy<<endl;
00462       cout<<mpy<<" "<<binoffy<<" "
00463           <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
00464     }
00465   }
00466   
00467   // The final position in local coordinates 
00468   float lpY = float(binoffy*m_pitchy) + fractionY*local_pitchy + 
00469     m_yoffset;
00470   if(TP_DEBUG && (lpY<m_yoffset || lpY>(-m_yoffset)) ) {
00471     cout<<" bad lp y "<<lpY<<endl; 
00472     cout<<mpy<<" "<<binoffy<<" "
00473         <<fractionY<<" "<<local_pitchy<<" "<<m_yoffset<<endl;
00474   }
00475 
00476   return lpY;
00477 } 

MeasurementError RectangularPixelTopology::measurementError ( const LocalPoint lp,
const LocalError le 
) const [virtual]

Implements Topology.

Definition at line 496 of file RectangularPixelTopology.cc.

References int, m_pitchx, m_pitchy, m_xoffset, m_yoffset, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by CPEFromDetPosition::measurementError(), and PixelCPEBase::measurementError().

00498                                              {
00499 
00500   float pitchy=m_pitchy;
00501   int iybin = int( (lp.y() - m_yoffset)/m_pitchy );   //get bin for equal picth 
00502   int iybin0 = iybin%54;  //This is just to avoid many ifs by using the periodicy
00503   //quasi bins 0,1,52,53 fall into larger pixels  
00504   if(iybin0==0 || iybin0==1 || iybin0==52 || iybin0==53 )
00505     pitchy = 2. * m_pitchy;
00506 
00507   float pitchx=m_pitchx;
00508   int ixbin = int( (lp.x() - m_xoffset)/m_pitchx );   //get bin for equal pitch
00509   //quasi bins 79,80,81,82 fall into the 2 larger pixels  
00510   if(ixbin>=79 && ixbin<=82) pitchx = 2. * m_pitchx;  
00511 
00512   return MeasurementError( le.xx()/float(pitchx*pitchx), 0,
00513                            le.yy()/float(pitchy*pitchy));
00514 }

virtual MeasurementPoint RectangularPixelTopology::measurementPosition ( const LocalPoint lp  )  const [inline, virtual]

Implements Topology.

Definition at line 85 of file RectangularPixelTopology.h.

References p, and pixel().

Referenced by SiPixelErrorEstimation::analyze(), PixelCPEGeneric::measurementPosition(), PixelCPETemplateReco::measurementPosition(), PixelCPEBase::measurementPosition(), PixelCPEBase::setTheDet(), CPEFromDetPosition::setTheDet(), and VisPixelDigiTwig::update().

00086             {
00087     std::pair<float,float> p = pixel(lp);
00088     return MeasurementPoint( p.first, p.second);
00089   }

virtual int RectangularPixelTopology::ncolumns (  )  const [inline, virtual]

Implements PixelTopology.

Definition at line 154 of file RectangularPixelTopology.h.

References m_ncols.

Referenced by PixelCPEBase::setTheDet(), CPEFromDetPosition::setTheDet(), and VisPixelDigiTwig::update().

00154                                {
00155     return m_ncols;
00156   }

virtual int RectangularPixelTopology::nrows (  )  const [inline, virtual]

Implements PixelTopology.

Definition at line 150 of file RectangularPixelTopology.h.

References m_nrows.

Referenced by PixelCPEBase::setTheDet(), CPEFromDetPosition::setTheDet(), and VisPixelDigiTwig::update().

00150                             {
00151     return m_nrows;
00152   }

virtual std::pair<float,float> RectangularPixelTopology::pitch (  )  const [inline, virtual]

Implements PixelTopology.

Definition at line 146 of file RectangularPixelTopology.h.

References m_pitchx, and m_pitchy.

Referenced by PixelCPEBase::setTheDet(), CPEFromDetPosition::setTheDet(), and VisPixelDigiTwig::update().

00146                                              {
00147     return std::pair<float,float>( float(m_pitchx), float(m_pitchy));
00148   }

std::pair< float, float > RectangularPixelTopology::pixel ( const LocalPoint p  )  const [virtual]

Topology for rectangular pixel detector with BIG pixels.

Implements PixelTopology.

Definition at line 13 of file RectangularPixelTopology.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), EPSCM, int, m_pitchx, m_pitchy, m_xoffset, m_yoffset, TP_DEBUG, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by channel(), and measurementPosition().

00014                                      {
00015   using std::cout;
00016   using std::endl;
00017 
00018   // check limits       
00019   float py = p.y();
00020   float px = p.x();
00021   
00022   if(TP_DEBUG) {
00023     // This will catch points which are outside the active sensor area.
00024     // In the digitizer during the early induce_signal phase non valid
00025     // location are passed here. They are cleaned later.
00026     if( py<m_yoffset ) { // m_yoffset is negative 
00027       cout<<" wrong lp y "<<py<<" "<<m_yoffset<<endl;
00028       py = m_yoffset + EPSCM; // make sure it is in, add an EPS in cm
00029     }
00030     if( py>-m_yoffset ) {
00031       cout<<" wrong lp y "<<py<<" "<<-m_yoffset<<endl;
00032       py = -m_yoffset - EPSCM;
00033     }
00034     if( px<m_xoffset ) { // m_xoffset is negative 
00035       cout<<" wrong lp x "<<px<<" "<<m_xoffset<<endl;
00036       px = m_xoffset + EPSCM;
00037     }
00038     if( px>-m_xoffset ) {
00039       cout<<" wrong lp x "<<px<<" "<<-m_xoffset<<endl;
00040       px = -m_xoffset - EPSCM;
00041     }
00042   } // end TP_DEBUG
00043 
00044   float newybin=(py - m_yoffset)/m_pitchy;
00045   int iybin = int(newybin);
00046   float fractionY = newybin - iybin;
00047   //if(fractionY<0.) cout<<" fractiony "<<fractionY<<" "<<newybin<<endl;
00048   
00049   // Normalize it all to 1 ROC
00050   int iybin0 = (iybin%54); // 0-53
00051   int numROC = iybin/54;  // 0-7
00052   
00053   if (iybin0>53) {
00054     if(TP_DEBUG) {
00055       cout<<" very bad, newbiny "<<iybin0<<endl;
00056       cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
00057           <<newybin<<" "<<iybin<<" "<<fractionY<<" "<<iybin0<<" "
00058           <<numROC<<endl;
00059     }
00060   } else if (iybin0==53) {   // inside big pixel
00061     iybin0=51;
00062     fractionY = (fractionY+1.)/2.;
00063   } else if (iybin0==52) {   // inside big pixel
00064     iybin0=51;
00065     fractionY = fractionY/2.;
00066   } else if (iybin0>1) {   // inside normal pixel
00067     iybin0=iybin0-1;
00068   } else if (iybin0==1) {   // inside big pixel
00069     iybin0=0;
00070     fractionY = (fractionY+1.)/2.;
00071   } else if (iybin0==0) {   // inside big pixel
00072     iybin0=0;
00073     fractionY = fractionY/2.;
00074   } else {
00075     if(TP_DEBUG) {
00076       cout<<" very bad, newbiny "<<newybin<<endl;
00077       cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
00078           <<newybin<<" "<<iybin<<" "<<fractionY<<" "
00079           <<iybin0<<" "<<numROC<<endl;
00080     }
00081   }
00082   float mpY = float(numROC*52. + iybin0) + fractionY;
00083   if(TP_DEBUG && (mpY<0. || mpY>=416.)) {
00084     cout<<" bad pix y "<<mpY<<endl;
00085     cout<<py<<" "<<m_yoffset<<" "<<m_pitchy<<" "
00086         <<newybin<<" "<<iybin<<" "<<fractionY<<" "
00087         <<iybin0<<" "<<numROC<<endl;
00088   }
00089   
00090   // In X
00091   float newxbin=(px - m_xoffset) / m_pitchx; 
00092   int ixbin = int(newxbin);
00093   float fractionX = newxbin - ixbin;
00094   // if(fractionX<0.) {
00095   //   cout<<" fractionx "<<fractionX<<" "<<newxbin<<" "<<ixbin<<" ";
00096   //   cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
00097   //      <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
00098   // }
00099 
00100   if (ixbin>161) {
00101     if(TP_DEBUG) {
00102       cout<<" very bad, newbinx "<<ixbin<<endl;
00103       cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
00104           <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
00105     }
00106   } else if (ixbin>82) {   // inside normal pixel, ROC 1 
00107     ixbin=ixbin-2;
00108   } else if (ixbin==82) {   // inside bin pixel 
00109     ixbin=80;
00110     fractionX = (fractionX+1.)/2.;
00111   } else if (ixbin==81) {   // inside big pixel
00112     ixbin=80;
00113     fractionX = fractionX/2.;
00114   } else if (ixbin==80) {   // inside bin pixel, ROC 0 
00115     ixbin=79;
00116     fractionX = (fractionX+1.)/2.;
00117   } else if (ixbin==79) {   // inside big pixel
00118     ixbin=79;
00119     fractionX = fractionX/2.;
00120   } else if (ixbin<0) {   // outside range
00121     if(TP_DEBUG) {
00122       cout<<" very bad, newbinx "<<ixbin<<endl;
00123       cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
00124           <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
00125     }
00126   }
00127   
00128   float mpX = float(ixbin) + fractionX;
00129   
00130   if(TP_DEBUG && (mpX<0. || mpX>=160.) ) {
00131     cout<<" bad pix x "<<mpX<<" "<<endl;
00132     cout<<px<<" "<<m_xoffset<<" "<<m_pitchx<<" "
00133         <<newxbin<<" "<<ixbin<<" "<<fractionX<<endl;
00134   }
00135   
00136   return std::pair<float,float>(mpX,mpY);
00137 }


Member Data Documentation

const int RectangularPixelTopology::BIG_PIX_PER_ROC_X = 1 [static, private]

Definition at line 51 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

const int RectangularPixelTopology::BIG_PIX_PER_ROC_Y = 2 [static, private]

Definition at line 52 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

const int RectangularPixelTopology::COLS_PER_ROC = 52 [static, private]

Definition at line 50 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().

int RectangularPixelTopology::m_ncols [private]

Definition at line 160 of file RectangularPixelTopology.h.

Referenced by isItEdgePixelInY(), localPosition(), ncolumns(), and RectangularPixelTopology().

int RectangularPixelTopology::m_nrows [private]

Definition at line 159 of file RectangularPixelTopology.h.

Referenced by isItEdgePixelInX(), localPosition(), nrows(), and RectangularPixelTopology().

float RectangularPixelTopology::m_pitchx [private]

Definition at line 161 of file RectangularPixelTopology.h.

Referenced by localError(), localX(), measurementError(), pitch(), pixel(), and RectangularPixelTopology().

float RectangularPixelTopology::m_pitchy [private]

Definition at line 162 of file RectangularPixelTopology.h.

Referenced by localError(), localY(), measurementError(), pitch(), pixel(), and RectangularPixelTopology().

float RectangularPixelTopology::m_xoffset [private]

Definition at line 163 of file RectangularPixelTopology.h.

Referenced by localX(), measurementError(), pixel(), and RectangularPixelTopology().

float RectangularPixelTopology::m_yoffset [private]

Definition at line 164 of file RectangularPixelTopology.h.

Referenced by localY(), measurementError(), pixel(), and RectangularPixelTopology().

const int RectangularPixelTopology::ROWS_PER_ROC = 80 [static, private]

Definition at line 49 of file RectangularPixelTopology.h.

Referenced by RectangularPixelTopology().


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