#include <RecoLocalTracker/SiPixelRecHits/interface/PixelCPEInitial.h>
Public Member Functions | |
LocalError | localError (const SiPixelCluster &cl, const GeomDetUnit &det) const |
PixelCPEInitial (edm::ParameterSet const &conf, const MagneticField *, const SiPixelLorentzAngle *) | |
Protected Member Functions | |
float | chargeWidthX () const |
float | chargeWidthY () const |
float | err2X (bool &, int &) const |
float | err2Y (bool &, int &) const |
float | geomCorrectionX (float xpos) const |
float | geomCorrectionY (float ypos) const |
float | xpos (const SiPixelCluster &) const |
float | ypos (const SiPixelCluster &) const |
Definition at line 30 of file PixelCPEInitial.h.
PixelCPEInitial::PixelCPEInitial | ( | edm::ParameterSet const & | conf, | |
const MagneticField * | mag, | |||
const SiPixelLorentzAngle * | lorentzAngle | |||
) |
Definition at line 27 of file PixelCPEInitial.cc.
00028 : PixelCPEBase(conf,mag,lorentzAngle) 00029 { 00030 }
float PixelCPEInitial::chargeWidthX | ( | ) | const [protected] |
Definition at line 265 of file PixelCPEInitial.cc.
References GeomDetEnumerators::PixelBarrel, PixelCPEBase::theDetR, PixelCPEBase::theDetZ, PixelCPEBase::theLShiftX, PixelCPEBase::thePart, PixelCPEBase::thePitchX, and PixelCPEBase::theThickness.
Referenced by xpos().
00265 { 00266 float chargeW = 0; 00267 float lorentzWidth = 2 * theLShiftX; 00268 if (thePart == GeomDetEnumerators::PixelBarrel) { 00269 chargeW = lorentzWidth; // width from Lorentz shift 00270 } else { // forward 00271 chargeW = fabs(lorentzWidth) + // Lorentz shift 00272 theThickness * fabs(theDetR/theDetZ) / thePitchX; // + geometry 00273 } 00274 return chargeW; 00275 }
float PixelCPEInitial::chargeWidthY | ( | ) | const [protected] |
Definition at line 280 of file PixelCPEInitial.cc.
References PixelCPEBase::alpha2Order, degsPerRad, GeomDetEnumerators::PixelBarrel, funct::tan(), PixelCPEBase::theDetR, PixelCPEBase::theDetZ, PixelCPEBase::theLShiftY, PixelCPEBase::thePart, PixelCPEBase::thePitchY, and PixelCPEBase::theThickness.
00280 { 00281 float chargeW = 0; 00282 float lorentzWidth = 2 * theLShiftY; 00283 if (thePart == GeomDetEnumerators::PixelBarrel) { 00284 // Charge width comes from the geometry (inclined angles) 00285 chargeW = theThickness * fabs(theDetZ/theDetR) / thePitchY; 00286 } else { //forward 00287 // Width comes from geometry only, given by the tilt angle 00288 if ( alpha2Order) { 00289 chargeW = -fabs(lorentzWidth)+ theThickness * tan(20./degsPerRad) / thePitchY; 00290 }else { 00291 chargeW = theThickness * tan(20./degsPerRad) / thePitchY; 00292 } 00293 } 00294 return chargeW; 00295 }
Definition at line 81 of file PixelCPEInitial.cc.
References GeomDetEnumerators::PixelBarrel, PixelCPEBase::thePart, and PixelCPEBase::thePitchX.
Referenced by localError().
00082 { 00083 // Assign maximum error 00084 // if edge cluster the maximum error is assigned: Pitch/sqrt(12)=43mu 00085 // float xerr = 0.0043; 00086 float xerr = thePitchX/3.464; 00087 // 00088 // Pixels not at the edge: errors parameterized as function of the cluster size 00089 // V.Chiochia - 12/4/06 00090 // 00091 if (!edgex){ 00092 // if (fabs(thePitchX-0.010)<0.001){ // 100um pixel size 00093 if (thePart == GeomDetEnumerators::PixelBarrel) { 00094 if ( sizex == 1) xerr = 0.00115; // Size = 1 -> Sigma = 11.5 um 00095 else if ( sizex == 2) xerr = 0.0012; // Size = 2 -> Sigma = 12 um 00096 else if ( sizex == 3) xerr = 0.00088; // Size = 3 -> Sigma = 8.8 um 00097 else xerr = 0.0103; 00098 } else { //forward 00099 if ( sizex == 1) { 00100 xerr = 0.0020; 00101 } else if ( sizex == 2) { 00102 xerr = 0.0020; 00103 // xerr = (0.005351 - atan(fabs(theDetZ/theDetR)) * 0.003291); 00104 } else { 00105 xerr = 0.0020; 00106 //xerr = (0.003094 - atan(fabs(theDetZ/theDetR)) * 0.001854); 00107 } 00108 } 00109 // } 00110 // }else if (fabs(thePitchX-0.015)<0.001){ // 150 um pixel size 00111 // if (thePart == GeomDetEnumerators::PixelBarrel) { 00112 // if ( sizex == 1) xerr = 0.0014; // 14um 00113 // else xerr = 0.0008; // 8um 00114 // } else { //forward 00115 // if ( sizex == 1) 00116 // xerr = (-0.00385 + atan(fabs(theDetZ/theDetR)) * 0.00407); 00117 // else xerr = (0.00366 - atan(fabs(theDetZ/theDetR)) * 0.00209); 00118 // } 00119 // } 00120 00121 } 00122 return xerr*xerr; 00123 }
Definition at line 129 of file PixelCPEInitial.cc.
References GeomDetEnumerators::PixelBarrel, PixelCPEBase::thePart, and PixelCPEBase::thePitchY.
Referenced by localError().
00130 { 00131 // Assign maximum error 00132 // if edge cluster the maximum error is assigned: Pitch/sqrt(12)=43mu 00133 // float yerr = 0.0043; 00134 float yerr = thePitchY/3.464; 00135 if (!edgey){ 00136 if (thePart == GeomDetEnumerators::PixelBarrel) { // Barrel 00137 if ( sizey == 1) { 00138 yerr = 0.00375; // 37.5um 00139 } else if ( sizey == 2) { 00140 yerr = 0.0023; // 23 um 00141 } else if ( sizey == 3) { 00142 yerr = 0.0025; // 25 um 00143 } else if ( sizey == 4) { 00144 yerr = 0.0025; // 25um 00145 } else if ( sizey == 5) { 00146 yerr = 0.0023; // 23um 00147 } else if ( sizey == 6) { 00148 yerr = 0.0023; // 23um 00149 } else if ( sizey == 7) { 00150 yerr = 0.0021; // 21um 00151 } else if ( sizey == 8) { 00152 yerr = 0.0021; // 21um 00153 } else if ( sizey == 9) { 00154 yerr = 0.0024; // 24um 00155 } else if ( sizey >= 10) { 00156 yerr = 0.0021; // 21um 00157 } 00158 } else { // Endcaps 00159 if ( sizey == 1) yerr = 0.0021; // 21 um 00160 else if ( sizey >= 2) yerr = 0.00075;// 7.5 um 00161 } 00162 } 00163 return yerr*yerr; 00164 }
float PixelCPEInitial::geomCorrectionX | ( | float | xpos | ) | const [protected] |
Definition at line 305 of file PixelCPEInitial.cc.
References GeomDetEnumerators::PixelEndcap, PixelCPEBase::theDetR, PixelCPEBase::theOffsetX, PixelCPEBase::thePart, PixelCPEBase::theSign, PixelCPEBase::theThickness, and tmp.
Referenced by xpos().
00305 { 00306 if (thePart == GeomDetEnumerators::PixelEndcap) return 0; 00307 else { 00308 float tmp = theSign * (theThickness / theDetR) * (xcenter-theOffsetX); 00309 return tmp; 00310 } 00311 }
float PixelCPEInitial::geomCorrectionY | ( | float | ypos | ) | const [protected] |
Definition at line 314 of file PixelCPEInitial.cc.
References GeomDetEnumerators::PixelEndcap, PixelCPEBase::theDetR, PixelCPEBase::theDetZ, PixelCPEBase::theOffsetY, PixelCPEBase::thePart, PixelCPEBase::theThickness, and tmp.
00314 { 00315 if (thePart == GeomDetEnumerators::PixelEndcap) return 0; 00316 else { 00317 float tmp = (ycenter - theOffsetY) * theThickness / theDetR; 00318 if(theDetZ>0.) tmp = -tmp; // it is the opposite for Z>0 and Z<0 00319 return tmp; 00320 } 00321 }
LocalError PixelCPEInitial::localError | ( | const SiPixelCluster & | cl, | |
const GeomDetUnit & | det | |||
) | const [virtual] |
Implements PixelCPEBase.
Definition at line 42 of file PixelCPEInitial.cc.
References err2X(), err2Y(), RectangularPixelTopology::isItEdgePixelInX(), RectangularPixelTopology::isItEdgePixelInY(), LogDebug, SiPixelCluster::maxPixelCol(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), PixelCPEBase::setTheDet(), SiPixelCluster::sizeX(), SiPixelCluster::sizeY(), PixelCPEBase::theTopol, and PixelCPEBase::theVerboseLevel.
00043 { 00044 setTheDet( det ); 00045 int sizex = cluster.sizeX(); 00046 int sizey = cluster.sizeY(); 00047 00048 // Find edge clusters 00049 // Use edge methods from the Toplogy class 00050 int maxPixelCol = cluster.maxPixelCol(); 00051 int maxPixelRow = cluster.maxPixelRow(); 00052 int minPixelCol = cluster.minPixelCol(); 00053 int minPixelRow = cluster.minPixelRow(); 00054 // edge method moved to topologu class 00055 bool edgex = (theTopol->isItEdgePixelInX(minPixelRow)) || 00056 (theTopol->isItEdgePixelInX(maxPixelRow)); 00057 bool edgey = (theTopol->isItEdgePixelInY(minPixelCol)) || 00058 (theTopol->isItEdgePixelInY(maxPixelCol)); 00059 00060 //&&& testing... 00061 if (theVerboseLevel > 9) { 00062 LogDebug("PixelCPEInitial") << 00063 "Sizex = " << sizex << 00064 " Sizey = " << sizey << 00065 " Edgex = " << edgex << 00066 " Edgey = " << edgey ; 00067 } 00068 //if (sizex>0) return LocalError( sizex, 0, sizey ); 00069 00070 return LocalError( err2X(edgex, sizex), 0, err2Y(edgey, sizey) ); 00071 }
float PixelCPEInitial::xpos | ( | const SiPixelCluster & | cluster | ) | const [protected, virtual] |
Implements PixelCPEBase.
Definition at line 171 of file PixelCPEInitial.cc.
References chargeWidthX(), geomCorrectionX(), RectangularPixelTopology::localX(), max, SiPixelCluster::maxPixelRow(), min, SiPixelCluster::minPixelRow(), SiPixelCluster::pixels(), size, SiPixelCluster::sizeX(), PixelCPEBase::thePitchX, PixelCPEBase::theTopol, tmp, width, SiPixelCluster::x(), and PixelCPEBase::xCharge().
00171 { 00172 00173 int size = cluster.sizeX(); 00174 00175 if (size == 1) { 00176 float baryc = cluster.x(); 00177 // the middle of only one pixel is equivalent to the baryc. 00178 // transform baryc to local 00179 return theTopol->localX(baryc); 00180 } 00181 00182 //calculate center 00183 int imin = cluster.minPixelRow(); 00184 int imax = cluster.maxPixelRow(); 00185 float min = float(imin) + 0.5; // center of the edge 00186 float max = float(imax) + 0.5; // center of the edge 00187 float minEdge = theTopol->localX(float(imin+1)); // left inner edge 00188 float maxEdge = theTopol->localX(float(imax)); // right inner edge 00189 float center = (minEdge + maxEdge)/2.; // center of inner part 00190 float wInner = maxEdge-minEdge; // width of the inner part 00191 00192 // get the charge in the edge pixels 00193 const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels(); 00194 float q1 = 0.; 00195 float q2 = 0.; 00196 xCharge(pixelsVec, imin, imax, q1, q2); // get q1 and q2 00197 00198 // Estimate the charge width. main contribution + 2nd order geom corr. 00199 float tmp = (max+min)/2.; 00200 float width = (chargeWidthX() + geomCorrectionX(tmp)) * thePitchX; 00201 00202 // Check the valid chargewidth (WHY IS THERE THE FABS??) 00203 float effWidth = fabs(width) - wInner; 00204 00205 // Check the residual width 00206 if( (effWidth>(2*thePitchX)) || (effWidth<0.) ) { // for illiegal wifth 00207 effWidth=thePitchX; // make it equal to pitch 00208 } 00209 00210 // For X (no angles) use the MSI formula. 00211 // position msI 00212 float pos = center + (q2-q1)/(2.*(q1+q2)) * effWidth; 00213 00214 return pos; 00215 00216 }
float PixelCPEInitial::ypos | ( | const SiPixelCluster & | cluster | ) | const [protected, virtual] |
Implements PixelCPEBase.
Definition at line 221 of file PixelCPEInitial.cc.
References RectangularPixelTopology::isItBigPixelInY(), RectangularPixelTopology::localY(), SiPixelCluster::maxPixelCol(), SiPixelCluster::minPixelCol(), SiPixelCluster::pixels(), size, SiPixelCluster::sizeY(), PixelCPEBase::thePitchY, PixelCPEBase::theTopol, SiPixelCluster::y(), and PixelCPEBase::yCharge().
00221 { 00222 00223 int size = cluster.sizeY(); 00224 00225 if (size == 1) { 00226 float baryc = cluster.y(); 00227 // the middle of only one pixel is equivalent to the baryc. 00228 // transform baryc to local 00229 return theTopol->localY(baryc); 00230 } 00231 00232 //calculate center 00233 int imin = cluster.minPixelCol(); 00234 int imax = cluster.maxPixelCol(); 00235 //float min = float(imin) + 0.5; // center of the edge 00236 //float max = float(imax) + 0.5; // center of the edge 00237 float minEdge = theTopol->localY(float(imin+1)); // left inner edge 00238 float maxEdge = theTopol->localY(float(imax)); // right inner edge 00239 float center = (minEdge + maxEdge)/2.; // center of inner part in LC 00240 //float wInner = maxEdge-minEdge; // width of the inner part in LC 00241 00242 // get the charge in the edge pixels 00243 const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels(); 00244 float q1 = 0.; 00245 float q2 = 0.; 00246 yCharge(pixelsVec, imin, imax, q1, q2); 00247 00248 float pitch1 = thePitchY; 00249 float pitch2 = thePitchY; 00250 if(RectangularPixelTopology::isItBigPixelInY(imin) ) 00251 pitch1= 2.*thePitchY; 00252 if(RectangularPixelTopology::isItBigPixelInY(imax) ) 00253 pitch2= 2.*thePitchY; 00254 00255 // position msII 00256 float pos = center + (q2-q1)/(2.*(q1+q2)) * (pitch1+pitch2)/2.; 00257 return pos; 00258 00259 }