#include <RecoLocalTracker/SiPixelRecHits/interface/PixelCPEParmError.h>
Public Member Functions | |
LocalError | localError (const SiPixelCluster &cl, const GeomDetUnit &det) const |
PixelCPEParmError (edm::ParameterSet const &conf, const MagneticField *, const SiPixelLorentzAngle *) | |
~PixelCPEParmError () | |
Private Member Functions | |
float | chargeWidthX () const |
float | chargeWidthY () const |
float | xpos (const SiPixelCluster &) const |
float | ypos (const SiPixelCluster &) const |
Private Attributes | |
PixelErrorParametrization * | pixelErrorParametrization_ |
Definition at line 35 of file PixelCPEParmError.h.
PixelCPEParmError::PixelCPEParmError | ( | edm::ParameterSet const & | conf, | |
const MagneticField * | mag, | |||
const SiPixelLorentzAngle * | lorentzAngle | |||
) |
Definition at line 29 of file PixelCPEParmError.cc.
References HLT_VtxMuL3::PixelErrorParametrization, and pixelErrorParametrization_.
00031 : PixelCPEBase(conf,mag,lorentzAngle) 00032 { 00033 pixelErrorParametrization_ = new PixelErrorParametrization(conf); 00034 }
PixelCPEParmError::~PixelCPEParmError | ( | ) |
Definition at line 39 of file PixelCPEParmError.cc.
References pixelErrorParametrization_.
00040 { 00041 delete pixelErrorParametrization_ ; 00042 }
float PixelCPEParmError::chargeWidthX | ( | ) | const [private] |
Definition at line 232 of file PixelCPEParmError.cc.
References PixelCPEBase::alpha_, PI, GeomDetEnumerators::PixelBarrel, funct::tan(), PixelCPEBase::theLShiftX, PixelCPEBase::thePart, PixelCPEBase::thePitchX, and PixelCPEBase::theThickness.
Referenced by xpos().
00233 { 00234 // &&& Commented out: the version from FromDetPosition: 00235 // float chargeW = 0; 00236 // float lorentzWidth = 2 * theLShift; 00237 // if (thePart == GeomDetEnumerators::PixelBarrel) { 00238 // // Redefine the charge width to include the offset 00239 // chargeW = lorentzWidth - theSign * geomCorrection() * theOffsetX; 00240 // } else { // forward 00241 // chargeW = fabs(lorentzWidth) + 00242 // theThickness * fabs(theDetR/theDetZ) / thePitchX; 00243 // } 00244 // return chargeW; 00245 00246 float geomWidthX = theThickness * tan(PI/2 - alpha_)/thePitchX; 00247 if (thePart == GeomDetEnumerators::PixelBarrel){ 00248 return (geomWidthX) + (2 * theLShiftX); 00249 } else { 00250 return fabs(geomWidthX) + (2 * fabs(theLShiftX)); 00251 } 00252 }
float PixelCPEParmError::chargeWidthY | ( | ) | const [private] |
Definition at line 259 of file PixelCPEParmError.cc.
References PixelCPEBase::beta_, PI, GeomDetEnumerators::PixelBarrel, funct::tan(), PixelCPEBase::thePart, PixelCPEBase::thePitchY, and PixelCPEBase::theThickness.
Referenced by ypos().
00260 { 00261 // &&& Commented out: the version from FromDetPosition: 00262 // float chargeW = 0; 00263 // if (thePart == GeomDetEnumerators::PixelBarrel) { 00264 // chargeW = theThickness * fabs(theDetZ/theDetR) / thePitchY; 00265 // chargeW -= (geomCorrection() * theOffsetY); 00266 // } else { //forward 00267 // // Width comes from geometry only, fixed by the tilt angle 00268 // chargeW = theThickness * tan(20./degsPerRad) / thePitchY; 00269 // } 00270 // return chargeW; 00271 00272 float geomWidthY = theThickness * tan(PI/2 - beta_)/thePitchY; 00273 if (thePart == GeomDetEnumerators::PixelBarrel) { 00274 return geomWidthY; 00275 } else { 00276 return fabs(geomWidthY); 00277 } 00278 }
LocalError PixelCPEParmError::localError | ( | const SiPixelCluster & | cl, | |
const GeomDetUnit & | det | |||
) | const [virtual] |
Implements PixelCPEBase.
Definition at line 54 of file PixelCPEParmError.cc.
References PixelCPEBase::alpha_, PixelCPEBase::beta_, RectangularPixelTopology::containsBigPixelInX(), RectangularPixelTopology::containsBigPixelInY(), PixelErrorParametrization::getError(), RectangularPixelTopology::isItEdgePixelInX(), RectangularPixelTopology::isItEdgePixelInY(), LogDebug, SiPixelCluster::maxPixelCol(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), pixelErrorParametrization_, PixelCPEBase::setTheDet(), SiPixelCluster::sizeX(), SiPixelCluster::sizeY(), funct::sqrt(), PixelCPEBase::thePart, PixelCPEBase::thePitchX, PixelCPEBase::thePitchY, PixelCPEBase::theTopol, and PixelCPEBase::theVerboseLevel.
00055 { 00056 setTheDet( det ); 00057 00058 //--- Default is the maximum error used for edge clusters. 00059 float xerr = thePitchX / sqrt(12.); 00060 float yerr = thePitchY / sqrt(12.); 00061 00062 //--- Are we near either of the edges? 00063 // Use edge methods from the Toplogy class 00064 int maxPixelCol = cluster.maxPixelCol(); 00065 int maxPixelRow = cluster.maxPixelRow(); 00066 int minPixelCol = cluster.minPixelCol(); 00067 int minPixelRow = cluster.minPixelRow(); 00068 // edge method moved to topologu class 00069 bool edgex = (theTopol->isItEdgePixelInX(minPixelRow)) || 00070 (theTopol->isItEdgePixelInX(maxPixelRow)); 00071 bool edgey = (theTopol->isItEdgePixelInY(minPixelCol)) || 00072 (theTopol->isItEdgePixelInY(maxPixelCol)); 00073 00074 // Gavril: check if this rechit contains big pixels, 03/27/07 00075 bool bigInX = theTopol->containsBigPixelInX(minPixelRow, maxPixelRow); 00076 bool bigInY = theTopol->containsBigPixelInY(minPixelCol, maxPixelCol); 00077 00078 if (edgex && edgey) { 00079 //--- Both axes on the edge, no point in calling PixelErrorParameterization, 00080 //--- just return the max errors on both. 00081 // return LocalError(xerr*xerr, 0,yerr*yerr); 00082 } else { 00083 pair<float,float> errPair = 00084 pixelErrorParametrization_->getError(thePart, 00085 cluster.sizeX(), cluster.sizeY(), 00086 alpha_ , beta_, 00087 bigInX , bigInY); // Gavril: add big pixel flags, 03/27/07 00088 if (!edgex) xerr = errPair.first; 00089 if (!edgey) yerr = errPair.second; 00090 } 00091 00092 if (theVerboseLevel > 9) { 00093 LogDebug("PixelCPEParmError") << 00094 "Sizex = " << cluster.sizeX() << " Sizey = " << cluster.sizeY() << 00095 " Edgex = " << edgex << " Edgey = " << edgey << 00096 " ErrX = " << xerr << " ErrY = " << yerr; 00097 } 00098 return LocalError(xerr*xerr, 0,yerr*yerr); 00099 }
float PixelCPEParmError::xpos | ( | const SiPixelCluster & | cluster | ) | const [private, virtual] |
Implements PixelCPEBase.
Definition at line 111 of file PixelCPEParmError.cc.
References chargeWidthX(), RectangularPixelTopology::localX(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelRow(), SiPixelCluster::pixels(), size, SiPixelCluster::sizeX(), PixelCPEBase::thePitchX, PixelCPEBase::theTopol, width, SiPixelCluster::x(), and PixelCPEBase::xCharge().
00111 { 00112 int size = cluster.sizeX(); 00113 00114 if (size == 1) { 00115 float baryc = cluster.x(); 00116 // the middle of only one pixel is equivalent to the baryc. 00117 // transform baryc to local 00118 return theTopol->localX(baryc); 00119 } 00120 00121 //calculate center 00122 int imin = cluster.minPixelRow(); 00123 int imax = cluster.maxPixelRow(); 00124 //float min = float(imin) + 0.5; // center of the edge 00125 //float max = float(imax) + 0.5; // center of the edge 00126 float minEdge = theTopol->localX(float(imin+1)); // left inner edge 00127 float maxEdge = theTopol->localX(float(imax)); // right inner edge 00128 float center = (minEdge + maxEdge)/2.; // center of inner part 00129 float wInner = maxEdge-minEdge; // width of the inner part 00130 00131 // get the charge in the edge pixels 00132 const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels(); 00133 float q1 = 0.; 00134 float q2 = 0.; 00135 xCharge(pixelsVec, imin, imax, q1, q2); // get q1 and q2 00136 00137 // Estimate the charge width from track angle 00138 float width = chargeWidthX() * thePitchX; // chargewidth still in pitch units 00139 00140 // Check the valid chargewidth 00141 float effWidth = fabs(width) - wInner; 00142 00143 // Check the residual width 00144 if( (effWidth>(2*thePitchX)) || (effWidth<0.) ) { // for illiegal wifth 00145 effWidth=thePitchX; // make it equal to pitch 00146 } 00147 00148 // For X (with track angles) use the MSI formula. 00149 // position msI 00150 float pos = center + (q2-q1)/(2.*(q1+q2)) * effWidth; 00151 00152 00153 // Delete the eta correction, it did not bring much d.k.3/07 00154 //if (alpha_ < 1.53) { 00155 //float etashift=0; 00156 //float charatio = q1/(q1+q2); 00157 //etashift = theEtaFunc.xEtaShift(size,thePitchX,charatio,alpha_); 00158 //pos = pos - etashift; 00159 //} 00160 00161 return pos; 00162 }
float PixelCPEParmError::ypos | ( | const SiPixelCluster & | cluster | ) | const [private, virtual] |
Implements PixelCPEBase.
Definition at line 169 of file PixelCPEParmError.cc.
References chargeWidthY(), RectangularPixelTopology::isItBigPixelInY(), RectangularPixelTopology::localY(), SiPixelCluster::maxPixelCol(), SiPixelCluster::minPixelCol(), SiPixelCluster::pixels(), size, SiPixelCluster::sizeY(), PixelCPEBase::thePitchY, PixelCPEBase::theTopol, width, SiPixelCluster::y(), and PixelCPEBase::yCharge().
00170 { 00171 00172 int size = cluster.sizeY(); 00173 00174 if (size == 1) { 00175 float baryc = cluster.y(); 00176 // the middle of only one pixel is equivalent to the baryc. 00177 // transform baryc to local 00178 return theTopol->localY(baryc); 00179 } 00180 00181 //calculate center 00182 int imin = cluster.minPixelCol(); 00183 int imax = cluster.maxPixelCol(); 00184 //float min = float(imin) + 0.5; // center of the edge 00185 //float max = float(imax) + 0.5; // center of the edge 00186 float minEdge = theTopol->localY(float(imin+1)); // left inner edge 00187 float maxEdge = theTopol->localY(float(imax)); // right inner edge 00188 float center = (minEdge + maxEdge)/2.; // center of inner part in LC 00189 float wInner = maxEdge-minEdge; // width of the inner part in LC 00190 00191 // get the charge in the edge pixels 00192 const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels(); 00193 float q1 = 0.; 00194 float q2 = 0.; 00195 yCharge(pixelsVec, imin, imax, q1, q2); 00196 00197 // Estimate the charge width using the track angle 00198 float width = (chargeWidthY()) * thePitchY; 00199 float effWidth = fabs(width) - wInner; 00200 00201 // Check the validty of the width 00202 if(effWidth>2*thePitchY) { // width too large 00203 float edgeLength = 2*thePitchY; // take care of big pixels 00204 if(RectangularPixelTopology::isItBigPixelInY(imin) ) 00205 edgeLength += thePitchY; 00206 if(RectangularPixelTopology::isItBigPixelInY(imax) ) 00207 edgeLength += thePitchY; 00208 00209 if(effWidth>edgeLength) effWidth=edgeLength/2.; 00210 00211 } else if(effWidth<0.) { // width too small 00212 effWidth=thePitchY; // 00213 } 00214 00215 // For y with track angles use msI method 00216 float pos = center + (q2-q1)/(2.*(q1+q2)) * effWidth; 00217 00218 // Delete the eta correction. It did not bring much 00219 // eta function for shallow tracks 00220 //float charatio = q1/(q1+q2); 00221 //float etashift = theEtaFunc.yEtaShift(size,thePitchY,charatio,beta_); 00222 //pos = pos - etashift; 00223 00224 return pos; 00225 }
Definition at line 59 of file PixelCPEParmError.h.
Referenced by localError(), PixelCPEParmError(), and ~PixelCPEParmError().