CMS 3D CMS Logo

CPEFromDetPosition Class Reference

#include <RecoLocalTracker/SiPixelRecHits/interface/CPEFromDetPosition.h>

Inheritance diagram for CPEFromDetPosition:

ClusterParameterEstimator< SiPixelCluster >

List of all members.

Public Member Functions

 CPEFromDetPosition (edm::ParameterSet const &conf, const MagneticField *)
LocalError localError (const SiPixelCluster &cl, const GeomDetUnit &det) const
LocalValues localParameters (const SiPixelCluster &cl, const GeomDetUnit &det) const
LocalPoint localPosition (const SiPixelCluster &cl, const GeomDetUnit &det) const

Protected Types

typedef GloballyPositioned
< double > 
Frame

Protected Member Functions

float chargeWidthX () const
float chargeWidthY () const
LocalVector driftDirection (GlobalVector bfield) const
float err2X (bool &, int &) const
float err2Y (bool &, int &) const
float estimatedAlphaForBarrel (const float &) const
float geomCorrectionX (float xpos) const
float geomCorrectionY (float ypos) const
bool isFlipped () const
float lorentzShiftX () const
float lorentzShiftY () const
MeasurementError measurementError (const SiPixelCluster &, const GeomDetUnit &det) const
MeasurementPoint measurementPosition (const SiPixelCluster &, const GeomDetUnit &det) const
void setTheDet (const GeomDetUnit &det) const
std::vector< float > xCharge (const std::vector< SiPixelCluster::Pixel > &, const float &, const float &) const
float xpos (const SiPixelCluster &) const
std::vector< float > yCharge (const std::vector< SiPixelCluster::Pixel > &, const float &, const float &) const
float ypos (const SiPixelCluster &) const

Protected Attributes

bool alpha2Order
const MagneticFieldmagfield_
const PixelGeomDetUnittheDet
float theDetR
float theDetZ
EtaCorrection theEtaFunc
float theLShiftX
float theLShiftY
float theNumOfCol
float theNumOfRow
float theOffsetX
float theOffsetY
GeomDetType::SubDetector thePart
float thePitchX
float thePitchY
float theSign
float theTanLorentzAnglePerTesla
float theThickness
const RectangularPixelTopologytheTopol
int theVerboseLevel


Detailed Description

Definition at line 40 of file CPEFromDetPosition.h.


Member Typedef Documentation

typedef GloballyPositioned<double> CPEFromDetPosition::Frame [protected]

Definition at line 121 of file CPEFromDetPosition.h.


Constructor & Destructor Documentation

CPEFromDetPosition::CPEFromDetPosition ( edm::ParameterSet const &  conf,
const MagneticField mag 
)

Definition at line 38 of file CPEFromDetPosition.cc.

References alpha2Order, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogDebug, magfield_, theTanLorentzAnglePerTesla, and theVerboseLevel.

00039                                                                  {
00040   //--- Lorentz angle tangent per Tesla
00041   theTanLorentzAnglePerTesla =
00042     conf.getParameter<double>("TanLorentzAnglePerTesla");
00043 
00044   //--- Algorithm's verbosity
00045   theVerboseLevel = 
00046     conf.getUntrackedParameter<int>("VerboseLevel",0);
00047 
00048   //-- Magnetic Field
00049   magfield_ = mag;
00050  
00051   alpha2Order = conf.getParameter<bool>("Alpha2Order");
00052 
00053 #ifdef CORRECT_FOR_BIG_PIXELS
00054   if (theVerboseLevel > 0) 
00055     LogDebug("CPEFromDetPosition")<<"Correct the Lorentz shift for big pixels";
00056 #endif
00057 }


Member Function Documentation

float CPEFromDetPosition::chargeWidthX (  )  const [protected]

Definition at line 611 of file CPEFromDetPosition.cc.

References GeomDetEnumerators::PixelBarrel, theDetR, theDetZ, theLShiftX, thePart, thePitchX, and theThickness.

Referenced by xpos().

00613                                              { 
00614   float chargeW = 0;
00615   float lorentzWidth = 2 * theLShiftX;
00616   if (thePart == GeomDetEnumerators::PixelBarrel) {  // barrel
00617     chargeW = lorentzWidth; // width from Lorentz shift
00618   } else { // forward
00619     chargeW = fabs(lorentzWidth) +                      // Lorentz shift 
00620       theThickness * fabs(theDetR/theDetZ) / thePitchX; // + geometry
00621   }

float CPEFromDetPosition::chargeWidthY (  )  const [protected]

Definition at line 627 of file CPEFromDetPosition.cc.

References alpha2Order, degsPerRad, GeomDetEnumerators::PixelBarrel, funct::tan(), theDetR, theDetZ, theLShiftY, thePart, thePitchY, and theThickness.

00630 {
00631   float chargeW = 0;
00632   float lorentzWidth = 2 * theLShiftY;  
00633   if (thePart == GeomDetEnumerators::PixelBarrel) {  // barrel
00634     // Charge width comes from the geometry (inclined angles)
00635     chargeW = theThickness * fabs(theDetZ/theDetR) / thePitchY;
00636   } else { //forward
00637     // Width comes from geometry only, given by the tilt angle
00638      if ( alpha2Order) {
00639        chargeW = -fabs(lorentzWidth)+ theThickness * tan(20./degsPerRad) / thePitchY; 
00640      }else {
00641        chargeW = theThickness * tan(20./degsPerRad) / thePitchY;
00642      }
00643 
00644   }

LocalVector CPEFromDetPosition::driftDirection ( GlobalVector  bfield  )  const [protected]

Definition at line 783 of file CPEFromDetPosition.cc.

References alpha2Order, LogDebug, GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), scale, GeomDet::surface(), theDet, theTanLorentzAnglePerTesla, and theVerboseLevel.

Referenced by lorentzShiftX().

00785                                                               {
00786   Frame detFrame(theDet->surface().position(), theDet->surface().rotation());
00787   LocalVector Bfield = detFrame.toLocal(bfield);
00788 
00789   float alpha2;
00790   if ( alpha2Order) {
00791      alpha2 = theTanLorentzAnglePerTesla*theTanLorentzAnglePerTesla;
00792   }else {
00793      alpha2 = 0.0;
00794   }
00795 
00796   float dir_x =  ( theTanLorentzAnglePerTesla * Bfield.y() + alpha2* Bfield.z()* Bfield.x() );
00797   float dir_y = -( theTanLorentzAnglePerTesla * Bfield.x() - alpha2* Bfield.z()* Bfield.y() );
00798   float dir_z = -( 1 + alpha2* Bfield.z()*Bfield.z() );
00799   float scale = (1 + alpha2* Bfield.z()*Bfield.z() );
00800   LocalVector theDriftDirection = LocalVector(dir_x/scale, dir_y/scale, dir_z/scale );
00801  
00802  
00803   // float dir_x =  theTanLorentzAnglePerTesla * Bfield.y();
00804   // float dir_y = -theTanLorentzAnglePerTesla * Bfield.x();
00805   // float dir_z = -1.; // E field always in z direction, so electrons go to -z.
00806   // LocalVector theDriftDirection = LocalVector(dir_x,dir_y,dir_z);
00807 
00808   if (theVerboseLevel > 9) { 
00809     LogDebug("CPEFromDetPosition") 
00810       << " The drift direction in local coordinate is " 
00811       << theDriftDirection    ;
00812   }
00813 

float CPEFromDetPosition::err2X ( bool edgex,
int sizex 
) const [protected]

Definition at line 288 of file CPEFromDetPosition.cc.

References GeomDetEnumerators::PixelBarrel, thePart, and thePitchX.

Referenced by localError().

00291 {
00292 // Assign maximum error
00293   // if edge cluster the maximum error is assigned: Pitch/sqrt(12)=43mu
00294   //  float xerr = 0.0043; 
00295   float xerr = thePitchX/3.464;
00296   //
00297   // Pixels not at the edge: errors parameterized as function of the cluster size
00298   // V.Chiochia - 12/4/06
00299   //
00300   if (!edgex){
00301     //    if (fabs(thePitchX-0.010)<0.001){   // 100um pixel size
00302       if (thePart == GeomDetEnumerators::PixelBarrel) {
00303         if ( sizex == 1) xerr = 0.00115;      // Size = 1 -> Sigma = 11.5 um 
00304         else if ( sizex == 2) xerr = 0.0012;  // Size = 2 -> Sigma = 12 um      
00305         else if ( sizex == 3) xerr = 0.00088; // Size = 3 -> Sigma = 8.8 um
00306         else xerr = 0.0103;
00307       } else { //forward
00308         if ( sizex == 1) {
00309           xerr = 0.0020;
00310         }  else if ( sizex == 2) {
00311           xerr = 0.0020;
00312           // xerr = (0.005351 - atan(fabs(theDetZ/theDetR)) * 0.003291);  
00313         } else {
00314           xerr = 0.0020;
00315           //xerr = (0.003094 - atan(fabs(theDetZ/theDetR)) * 0.001854);  
00316         }
00317       }
00318       //    }
00319 //     }else if (fabs(thePitchX-0.015)<0.001){  // 150 um pixel size
00320 //       if (thePart == GeomDetEnumerators::PixelBarrel) {
00321 //      if ( sizex == 1) xerr = 0.0014;     // 14um 
00322 //      else xerr = 0.0008;   // 8um      
00323 //       } else { //forward
00324 //      if ( sizex == 1) 
00325 //        xerr = (-0.00385 + atan(fabs(theDetZ/theDetR)) * 0.00407);
00326 //      else xerr = (0.00366 - atan(fabs(theDetZ/theDetR)) * 0.00209);  
00327 //       }
00328 //     }
00329 
00330   }

float CPEFromDetPosition::err2Y ( bool edgey,
int sizey 
) const [protected]

Definition at line 337 of file CPEFromDetPosition.cc.

References GeomDetEnumerators::PixelBarrel, thePart, and thePitchY.

Referenced by localError().

00340 {
00341 // Assign maximum error
00342 // if edge cluster the maximum error is assigned: Pitch/sqrt(12)=43mu
00343 //  float yerr = 0.0043;
00344   float yerr = thePitchY/3.464; 
00345   if (!edgey){
00346     if (thePart == GeomDetEnumerators::PixelBarrel) { // Barrel
00347       if ( sizey == 1) {
00348         yerr = 0.00375;     // 37.5um 
00349       } else if ( sizey == 2) {
00350         yerr = 0.0023;   // 23 um      
00351       } else if ( sizey == 3) {
00352         yerr = 0.0025; // 25 um
00353       } else if ( sizey == 4) {
00354         yerr = 0.0025; // 25um
00355       } else if ( sizey == 5) {
00356         yerr = 0.0023; // 23um
00357       } else if ( sizey == 6) {
00358         yerr = 0.0023; // 23um
00359       } else if ( sizey == 7) {
00360         yerr = 0.0021; // 21um
00361       } else if ( sizey == 8) {
00362         yerr = 0.0021; // 21um
00363       } else if ( sizey == 9) {
00364         yerr = 0.0024; // 24um
00365       } else if ( sizey >= 10) {
00366         yerr = 0.0021; // 21um
00367       }
00368     } else { // Endcaps
00369       if ( sizey == 1)      yerr = 0.0021; // 21 um
00370       else if ( sizey >= 2) yerr = 0.00075;// 7.5 um
00371     }
00372   }

float CPEFromDetPosition::estimatedAlphaForBarrel ( const float &  centerx  )  const [protected]

Definition at line 717 of file CPEFromDetPosition.cc.

References PI, theDetR, theOffsetX, thePitchX, and theSign.

00720 {
00721   float tanalpha = theSign*(centerx-theOffsetX)/theDetR*thePitchX;

float CPEFromDetPosition::geomCorrectionX ( float  xpos  )  const [protected]

Definition at line 654 of file CPEFromDetPosition.cc.

References GeomDetEnumerators::PixelEndcap, theDetR, theOffsetX, thePart, theSign, theThickness, and tmp.

Referenced by xpos().

00656                                                              { 
00657   if (thePart == GeomDetEnumerators::PixelEndcap) return 0;
00658   else {
00659     float tmp = theSign * (theThickness / theDetR) * (xcenter-theOffsetX);
00660     return tmp;

float CPEFromDetPosition::geomCorrectionY ( float  ypos  )  const [protected]

Definition at line 663 of file CPEFromDetPosition.cc.

References GeomDetEnumerators::PixelEndcap, theDetR, theDetZ, theOffsetY, thePart, theThickness, and tmp.

00665                                                              { 
00666   if (thePart == GeomDetEnumerators::PixelEndcap) return 0;
00667   else { 
00668     float tmp = (ycenter - theOffsetY) * theThickness / theDetR;
00669     if(theDetZ>0.) tmp = -tmp; // it is the opposite for Z>0 and Z<0
00670     return tmp;

bool CPEFromDetPosition::isFlipped (  )  const [protected]

Definition at line 598 of file CPEFromDetPosition.cc.

References PV3DBase< T, PVType, FrameType >::perp(), GeomDet::surface(), theDet, tmp1, tmp2, and Surface::toGlobal().

Referenced by setTheDet().

00600                                          {
00601   // Check the relative position of the local +/- z in global coordinates. 
00602   float tmp1 = theDet->surface().toGlobal(Local3DPoint(0.,0.,0.)).perp();
00603   float tmp2 = theDet->surface().toGlobal(Local3DPoint(0.,0.,1.)).perp();
00604   //cout << " 1: " << tmp1 << " 2: " << tmp2 << endl;
00605   if ( tmp2<tmp1 ) return true;

LocalError CPEFromDetPosition::localError ( const SiPixelCluster cl,
const GeomDetUnit det 
) const

Definition at line 155 of file CPEFromDetPosition.cc.

References err2X(), err2Y(), RectangularPixelTopology::isItEdgePixelInX(), RectangularPixelTopology::isItEdgePixelInY(), LogDebug, SiPixelCluster::maxPixelCol(), SiPixelCluster::maxPixelRow(), SiPixelCluster::minPixelCol(), SiPixelCluster::minPixelRow(), setTheDet(), SiPixelCluster::sizeX(), SiPixelCluster::sizeY(), theTopol, and theVerboseLevel.

Referenced by localParameters(), and measurementError().

00156                                                                {
00157   setTheDet( det );
00158   int sizex = cluster.sizeX();
00159   int sizey = cluster.sizeY();
00160 
00161   // Find edge clusters
00162   // Use edge methods from the Toplogy class
00163   int maxPixelCol = cluster.maxPixelCol();
00164   int maxPixelRow = cluster.maxPixelRow();
00165   int minPixelCol = cluster.minPixelCol();
00166   int minPixelRow = cluster.minPixelRow();       
00167   // edge method moved to topologu class
00168   bool edgex = (theTopol->isItEdgePixelInX(minPixelRow)) ||
00169     (theTopol->isItEdgePixelInX(maxPixelRow));
00170   bool edgey = (theTopol->isItEdgePixelInY(minPixelCol)) ||
00171     (theTopol->isItEdgePixelInY(maxPixelCol));
00172   
00173   //&&& testing...
00174   if (theVerboseLevel > 9) {
00175     LogDebug("CPEFromDetPosition") <<
00176       "Sizex = " << sizex << 
00177       " Sizey = " << sizey << 
00178       " Edgex = " << edgex << 
00179       " Edgey = " << edgey ;
00180   }
00181 
00182   return LocalError( err2X(edgex, sizex), 0, err2Y(edgey, sizey) );
00183 }

LocalValues CPEFromDetPosition::localParameters ( const SiPixelCluster cl,
const GeomDetUnit det 
) const [inline, virtual]

Implements ClusterParameterEstimator< SiPixelCluster >.

Definition at line 47 of file CPEFromDetPosition.h.

References localError(), and localPosition().

00049                                                                   {
00050     return std::make_pair( localPosition(cl,det), localError(cl,det) );

LocalPoint CPEFromDetPosition::localPosition ( const SiPixelCluster cl,
const GeomDetUnit det 
) const

Definition at line 236 of file CPEFromDetPosition.cc.

References alpha2Order, RectangularPixelTopology::localPosition(), lp, GeomDetEnumerators::PixelBarrel, setTheDet(), theLShiftX, theLShiftY, thePart, thePitchX, thePitchY, theTopol, PV3DBase< T, PVType, FrameType >::x(), xpos(), PV3DBase< T, PVType, FrameType >::y(), and ypos().

Referenced by localParameters(), and measurementError().

00238                                                                  {
00239   setTheDet( det );  // Initlize the det
00240 
00241 #ifdef CORRECT_FOR_BIG_PIXELS
00242 
00243   float lpx = xpos(cluster);
00244   float lpy = ypos(cluster);
00245   if ( alpha2Order) {
00246     float lxshift = theLShiftX * thePitchX;  // shift in cm
00247     float lyshift = theLShiftY * thePitchY;
00248     if (thePart == GeomDetEnumerators::PixelBarrel) {
00249       LocalPoint cdfsfs(lpx-lxshift, lpy);
00250       return cdfsfs;
00251     } else { //forward
00252       LocalPoint cdfsfs(lpx-lxshift, lpy-lyshift);
00253       return cdfsfs;
00254     }
00255     
00256   } else {
00257 
00258      float lxshift = theLShiftX * thePitchX;  // shift in cm
00259      LocalPoint cdfsfs(lpx-lxshift, lpy );
00260      return cdfsfs;
00261   }
00262 
00263 #else
00264 
00265   MeasurementPoint ssss( xpos(cluster),ypos(cluster));
00266   LocalPoint lp = theTopol->localPosition(ssss);
00267   if ( alpha2Order) {
00268     float lxshift = theLShiftX * thePitchX;  // shift in cm
00269     float lyshift = theLShiftY*thePitchY;
00270      if (thePart == GeomDetEnumerators::PixelBarrel) {
00271        LocalPoint cdfsfs(lp.x()-lxshift, lp.y());
00272        return cdfsfs;
00273      } else { //forward
00274        LocalPoint cdfsfs(lp.x()-lxshift, lp.y()-lyshift);
00275        return cdfsfs;
00276      }
00277   } else {
00278     float lxshift = theLShiftX * thePitchX;  // shift in cm
00279     LocalPoint cdfsfs(lp.x()-lxshift, lp.y() );
00280     return cdfsfs;
00281   }
00282   
00283 #endif

float CPEFromDetPosition::lorentzShiftX (  )  const [protected]

Definition at line 676 of file CPEFromDetPosition.cc.

References dir, driftDirection(), MagneticField::inTesla(), magfield_, GloballyPositioned< T >::position(), GeomDet::surface(), theDet, thePitchX, theThickness, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by setTheDet().

00678                                               {
00679 
00680   LocalVector dir = driftDirection(magfield_->inTesla(theDet->surface().position()) );
00681 
00682   // max shift in cm 
00683   float xdrift = dir.x()/dir.z() * theThickness;  
00684   // express the shift in units of pitch, 
00685   // divide by 2 to get the hit correction
00686   float lshift = xdrift / thePitchX / 2.; 
00687 
00688   //cout << "Lorentz Drift = " << lshift << endl;
00689   //cout << "X Drift = " << dir.x() << endl;
00690   //cout << "Z Drift = " << dir.z() << endl;
00691  

float CPEFromDetPosition::lorentzShiftY (  )  const [protected]

Definition at line 693 of file CPEFromDetPosition.cc.

Referenced by setTheDet().

00695                                               {
00696 
00697   LocalVector dir = driftDirection(magfield_->inTesla(theDet->surface().position()) );
00698   float ydrift = dir.y()/dir.z() * theThickness;
00699   float lshift = ydrift / thePitchY / 2.;

MeasurementError CPEFromDetPosition::measurementError ( const SiPixelCluster cluster,
const GeomDetUnit det 
) const [protected]

Definition at line 144 of file CPEFromDetPosition.cc.

References asciidump::le, localError(), localPosition(), lp, RectangularPixelTopology::measurementError(), and theTopol.

00145                                                                      {
00146   LocalPoint lp( localPosition(cluster, det) );
00147   LocalError le( localError(   cluster, det) );
00148 
00149   return theTopol->measurementError( lp, le );
00150 }

MeasurementPoint CPEFromDetPosition::measurementPosition ( const SiPixelCluster cluster,
const GeomDetUnit det 
) const [protected]

Definition at line 188 of file CPEFromDetPosition.cc.

References alpha2Order, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), RectangularPixelTopology::isItBigPixelInX(), RectangularPixelTopology::isItBigPixelInY(), LogDebug, GeomDetEnumerators::PixelBarrel, theLShiftX, theLShiftY, thePart, theVerboseLevel, xpos(), and ypos().

00189                                                                         {
00190   if (theVerboseLevel > 9) {
00191     LogDebug("CPEFromDetPosition") <<
00192       "X-pos = " << xpos(cluster) << 
00193       " Y-pos = " << ypos(cluster) << 
00194       " Lshf = " << theLShiftX ;
00195   }
00196 
00197 
00198   // Fix to take into account the large pixels
00199 #ifdef CORRECT_FOR_BIG_PIXELS
00200 
00201   cout<<"CPEFromDetPosition::measurementPosition: Not implemented "
00202       <<"I hope it is not needed?"<<endl;
00203   return MeasurementPoint(0,0);
00204 
00205 #else
00206 
00207   // correct the measurement for Lorentz shift
00208   if ( alpha2Order) {
00209     float xPos = xpos(cluster); // x position in the measurement frame
00210     float yPos = ypos(cluster);
00211     float lxshift = theLShiftX; // nominal lorentz shift
00212     float lyshift = theLShiftY;
00213     if(RectangularPixelTopology::isItBigPixelInX(int(xPos))) // if big
00214       lxshift = theLShiftX/2.;  // reduce the shift
00215     if (thePart == GeomDetEnumerators::PixelBarrel) {
00216       lyshift =0.0;
00217     } else { //forward
00218       if(RectangularPixelTopology::isItBigPixelInY(int(yPos))) // if big
00219         lyshift = theLShiftY/2.;  // reduce the shift 
00220     }
00221     return MeasurementPoint( xpos(cluster)-lxshift,ypos(cluster)-lyshift);
00222   } else {
00223     float xPos = xpos(cluster); // x position in the measurement frame
00224     float lshift = theLShiftX; // nominal lorentz shift
00225     if(RectangularPixelTopology::isItBigPixelInX(int(xPos))) // if big 
00226       lshift = theLShiftX/2.;  // reduce the shift
00227     return MeasurementPoint( xpos(cluster)-lshift,ypos(cluster));
00228   } 
00229   
00230 #endif
00231 

void CPEFromDetPosition::setTheDet ( const GeomDetUnit det  )  const [protected]

Definition at line 62 of file CPEFromDetPosition.cc.

References BoundSurface::bounds(), isFlipped(), LogDebug, lorentzShiftX(), lorentzShiftY(), RectangularPixelTopology::measurementPosition(), RectangularPixelTopology::ncolumns(), RectangularPixelTopology::nrows(), offset, RectangularPixelTopology::pitch(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GloballyPositioned< T >::position(), PixelGeomDetUnit::specificTopology(), GeomDetType::subDetector(), GeomDet::surface(), theDet, theDetR, theDetZ, theLShiftX, theLShiftY, theNumOfCol, theNumOfRow, theOffsetX, theOffsetY, thePart, thePitchX, thePitchY, theSign, theThickness, theTopol, theVerboseLevel, Bounds::thickness(), PixelGeomDetUnit::type(), PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by localError(), and localPosition().

00062                                                                  {
00063   if ( theDet == &det )
00064     return;       // we have already seen this det unit
00065 
00066   //--- This is a new det unit, so cache it
00067   theDet = dynamic_cast<const PixelGeomDetUnit*>( &det );
00068   if (! theDet) {
00069     // &&& Fatal error!  TO DO: throw an exception!
00070     assert(0);
00071   }
00072 
00073   //--- theDet->type() returns a GeomDetType, which implements subDetector()
00074   thePart = theDet->type().subDetector();
00075   switch (thePart) {
00076   case GeomDetEnumerators::PixelBarrel:
00077     // A barrel!  A barrel!
00078     break;
00079   case GeomDetEnumerators::PixelEndcap:
00080     // A forward!  A forward!
00081     break;
00082   default:
00083     LogDebug("CPEFromDetPosition") 
00084       << "CPEFromDetPosition:: a non-pixel detector type in here?" ;
00085     //  &&& Should throw an exception here!
00086     assert(0);
00087   }
00088        
00089   //--- The location in of this DetUnit in a cyllindrical coord system (R,Z)
00090   //--- The call goes via BoundSurface, returned by theDet->surface(), but
00091   //--- position() is implemented in GloballyPositioned<> template
00092   //--- ( BoundSurface : Surface : GloballyPositioned<float> )
00093   theDetR = theDet->surface().position().perp();
00094   theDetZ = theDet->surface().position().z();
00095 
00096 
00097   //--- Define parameters for chargewidth calculation
00098 
00099   //--- bounds() is implemented in BoundSurface itself.
00100   theThickness = theDet->surface().bounds().thickness();
00101 
00102   //--- Cache the topology.
00103   theTopol
00104     = dynamic_cast<const RectangularPixelTopology*>( & (theDet->specificTopology()) );
00105 
00106   //---- The geometrical description of one module/plaquette
00107   theNumOfRow = theTopol->nrows();      // rows in x
00108   theNumOfCol = theTopol->ncolumns();   // cols in y
00109   std::pair<float,float> pitchxy = theTopol->pitch();
00110   thePitchX = pitchxy.first;            // pitch along x
00111   thePitchY = pitchxy.second;           // pitch along y
00112 
00113   //--- Find the offset
00114   MeasurementPoint  offset = 
00115     theTopol->measurementPosition( LocalPoint(0., 0.) );  
00116   theOffsetX = offset.x();
00117   theOffsetY = offset.y();
00118 
00119   //--- Find if the E field is flipped: i.e. whether it points
00120   //--- from the beam, or towards the beam.  (The voltages are
00121   //--- applied backwards on every other module in barrel and
00122   //--- blade in forward.)
00123   theSign = isFlipped() ? -1 : 1;
00124 
00125   //--- The Lorentz shift.
00126   theLShiftX = lorentzShiftX();
00127   theLShiftY = lorentzShiftY();
00128 
00129   if (theVerboseLevel > 1) {
00130     LogDebug("CPEFromDetPosition") << "***** PIXEL LAYOUT ***** " 
00131                                    << " thePart = " << thePart
00132                                    << " theThickness = " << theThickness
00133                                    << " thePitchX  = " << thePitchX 
00134                                    << " thePitchY  = " << thePitchY 
00135                                    << " theOffsetX = " << theOffsetX 
00136                                    << " theOffsetY = " << theOffsetY 
00137                                    << " theLShiftX  = " << theLShiftX;
00138   }
00139 }

std::vector<float> CPEFromDetPosition::xCharge ( const std::vector< SiPixelCluster::Pixel > &  ,
const float &  ,
const float &   
) const [protected]

Referenced by xpos().

float CPEFromDetPosition::xpos ( const SiPixelCluster cluster  )  const [protected]

Definition at line 381 of file CPEFromDetPosition.cc.

References chargeWidthX(), geomCorrectionX(), RectangularPixelTopology::localX(), max, SiPixelCluster::maxPixelRow(), min, SiPixelCluster::minPixelRow(), SiPixelCluster::pixels(), size, SiPixelCluster::sizeX(), thePitchX, theTopol, tmp, width, SiPixelCluster::x(), and xCharge().

Referenced by localPosition(), and measurementPosition().

00383                                                                   {
00384   int size = cluster.sizeX();
00385 
00386   if (size == 1) {
00387     float baryc = cluster.x();
00388     // the middle of only one pixel is equivalent to the baryc.
00389     // transform baryc to local 
00390     return theTopol->localX(baryc);
00391   }
00392 
00393   //calculate center
00394   int imin = cluster.minPixelRow();
00395   int imax = cluster.maxPixelRow();
00396   float min = float(imin) + 0.5; // center of the edge
00397   float max = float(imax) + 0.5; // center of the edge
00398   float minEdge = theTopol->localX(float(imin+1)); // left inner edge 
00399   float maxEdge = theTopol->localX(float(imax));   // right inner edge
00400   float center = (minEdge + maxEdge)/2.; // center of inner part
00401   float wInner = maxEdge-minEdge; // width of the inner part
00402   
00403   // get the charge in the edge pixels
00404   const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels();
00405   vector<float> chargeVec = xCharge(pixelsVec, min, max); 
00406   float q1 = chargeVec[0];
00407   float q2 = chargeVec[1];
00408   
00409   // Estimate the charge width. main contribution + 2nd order geom corr.
00410   float tmp = (max+min)/2.;
00411   float width = (chargeWidthX() + geomCorrectionX(tmp)) * thePitchX;
00412   
00413   // Check the valid chargewidth (WHY IS THERE THE FABS??)
00414   float effWidth = fabs(width) - wInner;
00415   
00416   // For X (no angles) use the MSI formula.
00417   // position msI  
00418   float pos = center + (q2-q1)/(2.*(q1+q2)) * effWidth; 
00419 

std::vector<float> CPEFromDetPosition::yCharge ( const std::vector< SiPixelCluster::Pixel > &  ,
const float &  ,
const float &   
) const [protected]

float CPEFromDetPosition::ypos ( const SiPixelCluster cluster  )  const [protected]

Definition at line 421 of file CPEFromDetPosition.cc.

Referenced by localPosition(), and measurementPosition().

00423                                                                   {
00424   int size = cluster.sizeY();
00425 
00426   if (size == 1) {
00427     float baryc = cluster.y();
00428     // the middle of only one pixel is equivalent to the baryc.
00429     // transform baryc to local 
00430     return theTopol->localY(baryc);
00431   }
00432 
00433   //calculate center
00434   int imin = cluster.minPixelCol();
00435   int imax = cluster.maxPixelCol();
00436   float min = float(imin) + 0.5; // center of the edge
00437   float max = float(imax) + 0.5; // center of the edge
00438   float minEdge = theTopol->localY(float(imin+1)); // left inner edge 
00439   float maxEdge = theTopol->localY(float(imax));   // right inner edge
00440   float center = (minEdge + maxEdge)/2.; // center of inner part in LC
00441   //float wInner = maxEdge-minEdge; // width of the inner part in LC
00442   
00443   // get the charge in the edge pixels
00444   const vector<SiPixelCluster::Pixel>& pixelsVec = cluster.pixels();
00445   vector<float> chargeVec = yCharge(pixelsVec, min, max); 
00446   float q1 = chargeVec[0];
00447   float q2 = chargeVec[1];
00448   
00449   // Estimate the charge width. main contribution + 2nd order geom corr.
00450   //float tmp = (max+min)/2.;
00451   //float width = (chargeWidthY() + geomCorrectionY(tmp)) * thePitchY;
00452   //float width = (chargeWidthY()) * thePitchY;  
00453   // Check the valid chargewidth (WHY IS THERE THE FABS??)
00454   //if(width<0.) cout<<" width Y < 0"<<width<<endl;
00455   //float effWidth = fabs(width) - wInner;
00456 
00457   //float pos = center + (q2*arm2-q1*arm1)/(q1+q2); // position dk  
00458   // position msI  
00459   //float pos = center + (q2-q1)/(2.*(q1+q2)) * effWidth; 
00460 
00461   float pitch1 = thePitchY;
00462   float pitch2 = thePitchY;
00463   if(RectangularPixelTopology::isItBigPixelInY(imin) ) 
00464     pitch1= 2.*thePitchY;
00465   if(RectangularPixelTopology::isItBigPixelInY(imax) ) 
00466     pitch2= 2.*thePitchY;
00467   
00468   // position msII
00469   float pos = center + (q2-q1)/(2.*(q1+q2)) * (pitch1+pitch2)/2.; 


Member Data Documentation

bool CPEFromDetPosition::alpha2Order [protected]

Definition at line 82 of file CPEFromDetPosition.h.

Referenced by chargeWidthY(), CPEFromDetPosition(), driftDirection(), localPosition(), and measurementPosition().

const MagneticField* CPEFromDetPosition::magfield_ [protected]

Definition at line 79 of file CPEFromDetPosition.h.

Referenced by CPEFromDetPosition(), and lorentzShiftX().

const PixelGeomDetUnit* CPEFromDetPosition::theDet [mutable, protected]

Definition at line 57 of file CPEFromDetPosition.h.

Referenced by driftDirection(), isFlipped(), lorentzShiftX(), and setTheDet().

float CPEFromDetPosition::theDetR [mutable, protected]

Definition at line 69 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), chargeWidthY(), estimatedAlphaForBarrel(), geomCorrectionX(), geomCorrectionY(), and setTheDet().

float CPEFromDetPosition::theDetZ [mutable, protected]

Definition at line 68 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), chargeWidthY(), geomCorrectionY(), and setTheDet().

EtaCorrection CPEFromDetPosition::theEtaFunc [mutable, protected]

Definition at line 60 of file CPEFromDetPosition.h.

float CPEFromDetPosition::theLShiftX [mutable, protected]

Definition at line 70 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), localPosition(), measurementPosition(), and setTheDet().

float CPEFromDetPosition::theLShiftY [mutable, protected]

Definition at line 71 of file CPEFromDetPosition.h.

Referenced by chargeWidthY(), localPosition(), measurementPosition(), and setTheDet().

float CPEFromDetPosition::theNumOfCol [mutable, protected]

Definition at line 67 of file CPEFromDetPosition.h.

Referenced by setTheDet().

float CPEFromDetPosition::theNumOfRow [mutable, protected]

Definition at line 66 of file CPEFromDetPosition.h.

Referenced by setTheDet().

float CPEFromDetPosition::theOffsetX [mutable, protected]

Definition at line 64 of file CPEFromDetPosition.h.

Referenced by estimatedAlphaForBarrel(), geomCorrectionX(), and setTheDet().

float CPEFromDetPosition::theOffsetY [mutable, protected]

Definition at line 65 of file CPEFromDetPosition.h.

Referenced by geomCorrectionY(), and setTheDet().

GeomDetType::SubDetector CPEFromDetPosition::thePart [mutable, protected]

Definition at line 59 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), chargeWidthY(), err2X(), err2Y(), geomCorrectionX(), geomCorrectionY(), localPosition(), measurementPosition(), and setTheDet().

float CPEFromDetPosition::thePitchX [mutable, protected]

Definition at line 62 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), err2X(), estimatedAlphaForBarrel(), localPosition(), lorentzShiftX(), setTheDet(), and xpos().

float CPEFromDetPosition::thePitchY [mutable, protected]

Definition at line 63 of file CPEFromDetPosition.h.

Referenced by chargeWidthY(), err2Y(), localPosition(), and setTheDet().

float CPEFromDetPosition::theSign [mutable, protected]

Definition at line 73 of file CPEFromDetPosition.h.

Referenced by estimatedAlphaForBarrel(), geomCorrectionX(), and setTheDet().

float CPEFromDetPosition::theTanLorentzAnglePerTesla [mutable, protected]

Definition at line 75 of file CPEFromDetPosition.h.

Referenced by CPEFromDetPosition(), and driftDirection().

float CPEFromDetPosition::theThickness [mutable, protected]

Definition at line 61 of file CPEFromDetPosition.h.

Referenced by chargeWidthX(), chargeWidthY(), geomCorrectionX(), geomCorrectionY(), lorentzShiftX(), and setTheDet().

const RectangularPixelTopology* CPEFromDetPosition::theTopol [mutable, protected]

Definition at line 58 of file CPEFromDetPosition.h.

Referenced by localError(), localPosition(), measurementError(), setTheDet(), and xpos().

int CPEFromDetPosition::theVerboseLevel [protected]

Definition at line 76 of file CPEFromDetPosition.h.

Referenced by CPEFromDetPosition(), driftDirection(), localError(), measurementPosition(), and setTheDet().


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