CMS 3D CMS Logo

TrackerRecHit Class Reference

A class that gives some properties of the Tracker Layers in FAMOS. More...

#include <FastSimulation/Tracking/interface/TrackerRecHit.h>

List of all members.

Public Member Functions

unsigned int cylinderNumber () const
 The global layer number in the nested cylinder geometry.
const GeomDetgeomDet () const
 The GeomDet.
GlobalPoint globalPosition () const
 The global position.
const GSSiTrackerRecHit2DLocalPoshit () const
void init (const TrackerGeometry *theGeometry)
 Initialization at construction time.
bool isForward () const
 Is it a forward hit ?
bool isOnRequestedDet (const std::vector< unsigned int > &whichDet) const
 Check if the hit is on one of the requested detector.
bool isOnTheSameLayer (const TrackerRecHit &other) const
 Check if two hits are on the same layer of the same subdetector.
double largerError ()
unsigned int layerNumber () const
 The Layer Number.
double localError ()
LocalPoint localPosition () const
 The local position.
bool makesAPairWith (const TrackerRecHit &anotherHit) const
 Check if a pair is on the proper combination of detectors.
bool makesATripletWith (const TrackerRecHit &anotherHit, const TrackerRecHit &yetAnotherHit) const
 Check if a triplet is on the proper combination of detectors.
const SiTrackerGSMatchedRecHit2DmatchedHit () const
 The Hit itself.
bool operator!= (const TrackerRecHit &aHit) const
unsigned int ringNumber () const
 The Ring Number.
const SiTrackerGSRecHit2DsplitHit () const
unsigned int subDetId () const
 The subdet Id.
 TrackerRecHit (const SiTrackerGSMatchedRecHit2D *theHit, const TrackerGeometry *theGeometry)
 TrackerRecHit (const SiTrackerGSRecHit2D *theHit, const TrackerGeometry *theGeometry)
 Constructor from a GSRecHit and the Geometry.
 TrackerRecHit (const SiTrackerGSRecHit2D *theSplitHit, const TrackerRecHit &other)
 Soft Copy Constructor from private members.
 TrackerRecHit ()
 Default Constructor.

Private Attributes

bool forward
unsigned int theCylinderNumber
const GeomDettheGeomDet
double theLargerError
unsigned int theLayerNumber
double theLocalError
const SiTrackerGSMatchedRecHit2DtheMatchedHit
unsigned int theRingNumber
const SiTrackerGSRecHit2DtheSplitHit
unsigned int theSubDetId


Detailed Description

A class that gives some properties of the Tracker Layers in FAMOS.

Definition at line 25 of file TrackerRecHit.h.


Constructor & Destructor Documentation

TrackerRecHit::TrackerRecHit (  )  [inline]

Default Constructor.

Definition at line 29 of file TrackerRecHit.h.

00029                   :
00030     theSplitHit(0),
00031     theMatchedHit(0),
00032     theGeomDet(0),
00033     theSubDetId(0),
00034     theLayerNumber(0),
00035     theRingNumber(0), 
00036     theLocalError(0.),
00037     theLargerError(0.),
00038     forward(false) {}

TrackerRecHit::TrackerRecHit ( const SiTrackerGSRecHit2D theSplitHit,
const TrackerRecHit other 
) [inline]

Soft Copy Constructor from private members.

Definition at line 41 of file TrackerRecHit.h.

00042                                               : 
00043     theSplitHit(theSplitHit),
00044     theMatchedHit(0),
00045     theGeomDet(other.geomDet()),
00046     theSubDetId(other.subDetId()),
00047     theLayerNumber(other.layerNumber()),
00048     theRingNumber(other.ringNumber()), 
00049     theLocalError(0.),
00050     theLargerError(0.),
00051     forward(other.isForward()) {}

TrackerRecHit::TrackerRecHit ( const SiTrackerGSRecHit2D theHit,
const TrackerGeometry theGeometry 
)

Constructor from a GSRecHit and the Geometry.

Definition at line 19 of file TrackerRecHit.cc.

References init().

00020                                                                  :
00021   theSplitHit(theHit),
00022   theMatchedHit(0),
00023   theSubDetId(0),
00024   theLayerNumber(0),
00025   theRingNumber(0),
00026   theCylinderNumber(0),
00027   theLocalError(0.),
00028   theLargerError(0.)
00029      
00030 { 
00031   init(theGeometry);
00032 }

TrackerRecHit::TrackerRecHit ( const SiTrackerGSMatchedRecHit2D theHit,
const TrackerGeometry theGeometry 
)

Definition at line 4 of file TrackerRecHit.cc.

References init().

00005                                                                  :
00006   theSplitHit(0),
00007   theMatchedHit(theHit),
00008   theSubDetId(0),
00009   theLayerNumber(0),
00010   theRingNumber(0),
00011   theCylinderNumber(0),
00012   theLocalError(0.),
00013   theLargerError(0.)
00014      
00015 { 
00016   init(theGeometry);
00017 }


Member Function Documentation

unsigned int TrackerRecHit::cylinderNumber (  )  const [inline]

The global layer number in the nested cylinder geometry.

Definition at line 85 of file TrackerRecHit.h.

References theCylinderNumber.

Referenced by GSPixelHitMatcher::isASeed().

00085 { return theCylinderNumber; }

const GeomDet* TrackerRecHit::geomDet (  )  const [inline]

The GeomDet.

Definition at line 91 of file TrackerRecHit.h.

References theGeomDet.

Referenced by operator!=().

00091 { return theGeomDet; }

GlobalPoint TrackerRecHit::globalPosition (  )  const [inline]

The global position.

Definition at line 94 of file TrackerRecHit.h.

References hit(), localPosition(), GeomDet::surface(), theGeomDet, and Surface::toGlobal().

Referenced by GSPixelHitMatcher::isASeed(), and TrajectorySeedProducer::produce().

00094                                             { 
00095     return theGeomDet->surface().toGlobal(hit()->localPosition());
00096   }

const GSSiTrackerRecHit2DLocalPos* TrackerRecHit::hit ( void   )  const [inline]

Definition at line 71 of file TrackerRecHit.h.

References theMatchedHit, and theSplitHit.

Referenced by globalPosition(), init(), largerError(), localError(), localPosition(), and operator!=().

void TrackerRecHit::init ( const TrackerGeometry theGeometry  ) 

Initialization at construction time.

Definition at line 35 of file TrackerRecHit.cc.

References forward, TrackingRecHit::geographicalId(), hit(), TrackerGeometry::idToDet(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerInteractionGeometry::PXB, TrackerInteractionGeometry::PXD, DetId::rawId(), DetId::subdetId(), TrackerInteractionGeometry::TEC, StripSubdetector::TEC, theCylinderNumber, theGeomDet, theLayerNumber, theRingNumber, theSubDetId, TrackerInteractionGeometry::TIB, StripSubdetector::TIB, TrackerInteractionGeometry::TID, StripSubdetector::TID, StripSubdetector::TOB, and TrackerInteractionGeometry::TOB.

Referenced by TrackerRecHit().

00035                                                       { 
00036 
00037   const DetId& theDetId = hit()->geographicalId();
00038   theGeomDet = theGeometry->idToDet(theDetId);
00039   theSubDetId = theDetId.subdetId(); 
00040   if ( theSubDetId == StripSubdetector::TIB) { 
00041     TIBDetId tibid(theDetId.rawId()); 
00042     theLayerNumber = tibid.layer();
00043     theCylinderNumber = TrackerInteractionGeometry::TIB+theLayerNumber;
00044     forward = false;
00045   } else if ( theSubDetId ==  StripSubdetector::TOB ) { 
00046     TOBDetId tobid(theDetId.rawId()); 
00047     theLayerNumber = tobid.layer();
00048     theCylinderNumber = TrackerInteractionGeometry::TOB+theLayerNumber;
00049     forward = false;
00050   } else if ( theSubDetId ==  StripSubdetector::TID) { 
00051     TIDDetId tidid(theDetId.rawId());
00052     theLayerNumber = tidid.wheel();
00053     theCylinderNumber = TrackerInteractionGeometry::TID+theLayerNumber;
00054     theRingNumber = tidid.ring();
00055     forward = true;
00056   } else if ( theSubDetId ==  StripSubdetector::TEC ) { 
00057     TECDetId tecid(theDetId.rawId()); 
00058     theLayerNumber = tecid.wheel(); 
00059     theCylinderNumber = TrackerInteractionGeometry::TEC+theLayerNumber;
00060     theRingNumber = tecid.ring();
00061     forward = true;
00062   } else if ( theSubDetId ==  PixelSubdetector::PixelBarrel ) { 
00063     PXBDetId pxbid(theDetId.rawId()); 
00064     theLayerNumber = pxbid.layer(); 
00065     theCylinderNumber = TrackerInteractionGeometry::PXB+theLayerNumber;
00066     forward = false;
00067   } else if ( theSubDetId ==  PixelSubdetector::PixelEndcap ) { 
00068     PXFDetId pxfid(theDetId.rawId()); 
00069     theLayerNumber = pxfid.disk();  
00070     theCylinderNumber = TrackerInteractionGeometry::PXD+theLayerNumber;
00071     forward = true;
00072   }
00073   
00074 }

bool TrackerRecHit::isForward (  )  const [inline]

Is it a forward hit ?

Definition at line 88 of file TrackerRecHit.h.

References forward.

Referenced by TrajectorySeedProducer::produce().

00088 { return forward; }

bool TrackerRecHit::isOnRequestedDet ( const std::vector< unsigned int > &  whichDet  )  const

Check if the hit is on one of the requested detector.

Definition at line 77 of file TrackerRecHit.cc.

References theLayerNumber, theRingNumber, and theSubDetId.

Referenced by TrajectorySeedProducer::produce().

00077                                                                              { 
00078   
00079   bool isOnDet = false;
00080   
00081   for ( unsigned idet=0; idet<whichDet.size(); ++idet ) {
00082     
00083     switch ( whichDet[idet] ) { 
00084       
00085     case 1: 
00086       //Pixel Barrel
00087       isOnDet =  theSubDetId==1;
00088       break;
00089       
00090     case 2: 
00091       //Pixel Disks
00092       isOnDet = theSubDetId==2;
00093       break;
00094       
00095     case 3:
00096       //Inner Barrel
00097       isOnDet = theSubDetId==3 && theLayerNumber < 4;
00098       break;
00099       
00100     case 4:
00101       //Inner Disks
00102       isOnDet = theSubDetId==4 && theRingNumber < 3;
00103       break;
00104       
00105     case 5:
00106       //Outer Barrel
00107       isOnDet = false;
00108       break;
00109       
00110     case 6:
00111       //Tracker EndCap
00112       isOnDet = theSubDetId==6 && theLayerNumber < 4 && theRingNumber < 3;
00113       break;
00114       
00115     default:
00116       // Should not happen
00117       isOnDet = false;
00118       break;
00119       
00120     }
00121     
00122     if ( isOnDet ) break;
00123     
00124   }
00125   
00126   return isOnDet;
00127 }

bool TrackerRecHit::isOnTheSameLayer ( const TrackerRecHit other  )  const [inline]

Check if two hits are on the same layer of the same subdetector.

Definition at line 112 of file TrackerRecHit.h.

References layerNumber(), subDetId(), theLayerNumber, and theSubDetId.

Referenced by GSPixelHitMatcher::isASeed(), TrackCandidateProducer::produce(), and TrajectorySeedProducer::produce().

00112                                                                  {
00113     
00114     return 
00115       theSubDetId == other.subDetId() && 
00116       theLayerNumber == other.layerNumber();
00117   }

double TrackerRecHit::largerError (  )  [inline]

Definition at line 136 of file TrackerRecHit.h.

References hit(), GSSiTrackerRecHit2DLocalPos::localPositionError(), funct::sqrt(), theLargerError, LocalError::xx(), LocalError::xy(), and LocalError::yy().

Referenced by TrajectorySeedProducer::produce().

00136                        { 
00137 
00138     // Check if it has been already computed
00139     if ( theLargerError != 0. ) return theLargerError;
00140 
00141     // Otherwise, compute it!
00142     double xx = hit()->localPositionError().xx();
00143     double yy = hit()->localPositionError().yy();
00144     double xy = hit()->localPositionError().xy();
00145     double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
00146     theLargerError = 0.5 * (xx+yy+delta);
00147     return theLargerError;
00148 
00149   }

unsigned int TrackerRecHit::layerNumber (  )  const [inline]

The Layer Number.

Definition at line 79 of file TrackerRecHit.h.

References theLayerNumber.

Referenced by isOnTheSameLayer(), makesAPairWith(), makesATripletWith(), TrackCandidateProducer::produce(), TrajectorySeedProducer::produce(), and ElectronGSPixelSeedGenerator::run().

00079 { return theLayerNumber; }

double TrackerRecHit::localError (  )  [inline]

Definition at line 120 of file TrackerRecHit.h.

References hit(), GSSiTrackerRecHit2DLocalPos::localPositionError(), funct::sqrt(), theLocalError, LocalError::xx(), LocalError::xy(), and LocalError::yy().

Referenced by TrackCandidateProducer::produce().

00120                       { 
00121 
00122     // Check if it has been already computed
00123     if ( theLocalError != 0. ) return theLocalError;
00124 
00125     // Otherwise, compute it!
00126     double xx = hit()->localPositionError().xx();
00127     double yy = hit()->localPositionError().yy();
00128     double xy = hit()->localPositionError().xy();
00129     double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
00130     theLocalError = 0.5 * (xx+yy-delta);
00131     return theLocalError;
00132 
00133   }

LocalPoint TrackerRecHit::localPosition (  )  const [inline]

The local position.

Definition at line 99 of file TrackerRecHit.h.

References hit(), and GSSiTrackerRecHit2DLocalPos::localPosition().

Referenced by globalPosition().

00099 { return hit()->localPosition(); }

bool TrackerRecHit::makesAPairWith ( const TrackerRecHit anotherHit  )  const

Check if a pair is on the proper combination of detectors.

Definition at line 130 of file TrackerRecHit.cc.

References layerNumber(), subDetId(), theLayerNumber, and theSubDetId.

00130                                                                    { 
00131 
00132   bool isAProperPair = false;
00133 
00134   unsigned int anotherSubDetId = anotherHit.subDetId();
00135   unsigned int anotherLayerNumber = anotherHit.layerNumber();
00136   isAProperPair = 
00137     // First hit on PXB1
00138     ( ( theSubDetId == 1 && theLayerNumber == 1 ) && (
00139       ( anotherSubDetId == 1 && anotherLayerNumber == 2) || 
00140       ( anotherSubDetId == 1 && anotherLayerNumber == 3) || 
00141       ( anotherSubDetId == 2 && anotherLayerNumber == 1) || 
00142       ( anotherSubDetId == 2 && anotherLayerNumber == 2) ) ) || 
00143     // First hit on PXB2
00144     ( ( theSubDetId == 1 && theLayerNumber == 2 ) && (
00145       ( anotherSubDetId == 1 && anotherLayerNumber == 3) || 
00146       ( anotherSubDetId == 2 && anotherLayerNumber == 1) || 
00147       ( anotherSubDetId == 2 && anotherLayerNumber == 2) ) ) ||
00148     // First Hit on PXD1
00149     ( ( theSubDetId == 2 && theLayerNumber == 1 ) && 
00150       ( anotherSubDetId == 2 && anotherLayerNumber == 2 ) ) ||
00151     // First Hit on PXD2
00152     ( ( theSubDetId == 2 && theLayerNumber == 2 ) && ( 
00153       ( anotherSubDetId == 6 && anotherLayerNumber == 1 ) ||
00154       ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) ) ) ||
00155     // First Hit on TEC1
00156     ( ( theSubDetId == 6 && theLayerNumber == 1 ) && 
00157       ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) ) ||
00158     // First Hit on TEC2
00159     ( ( theSubDetId == 6 && theLayerNumber == 2 ) && 
00160       ( anotherSubDetId == 6 && anotherLayerNumber == 3 ) );
00161   
00162   return isAProperPair;
00163 
00164 } 

bool TrackerRecHit::makesATripletWith ( const TrackerRecHit anotherHit,
const TrackerRecHit yetAnotherHit 
) const

Check if a triplet is on the proper combination of detectors.

Definition at line 167 of file TrackerRecHit.cc.

References layerNumber(), subDetId(), theLayerNumber, and theSubDetId.

00168                                                                             { 
00169 
00170   bool isAProperTriplet = false;
00171 
00172   unsigned int anotherSubDetId = anotherHit.subDetId();
00173   unsigned int anotherLayerNumber = anotherHit.layerNumber();
00174   unsigned int yetAnotherSubDetId = yetAnotherHit.subDetId();
00175   unsigned int yetAnotherLayerNumber = yetAnotherHit.layerNumber();
00176   isAProperTriplet = 
00177     // First hit on PXB1, second on PXB2
00178     ( ( theSubDetId == 1 && theLayerNumber == 1 ) && 
00179       ( anotherSubDetId == 1 && anotherLayerNumber == 2) && ( 
00180       ( yetAnotherSubDetId == 1 && yetAnotherLayerNumber == 3) || 
00181       ( yetAnotherSubDetId == 2 && yetAnotherLayerNumber == 1) || 
00182       ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) ) || 
00183     // First hit on PXB1, second on PXB3 
00184     ( ( theSubDetId == 1 && theLayerNumber == 1 ) &&
00185       ( anotherSubDetId == 1 && anotherLayerNumber == 3) && 
00186       ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) || 
00187     // First hit on PXB2, second on PXB3 
00188     ( ( theSubDetId == 1 && theLayerNumber == 2 ) &&
00189       ( anotherSubDetId == 1 && anotherLayerNumber == 3) && 
00190       ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) || 
00191     // First Hit on PXB1, second on PXD1
00192     ( ( theSubDetId == 1 && theLayerNumber == 1 ) &&
00193       ( anotherSubDetId == 2 && anotherLayerNumber == 1) && ( 
00194       ( yetAnotherSubDetId == 2 && yetAnotherLayerNumber == 2) || 
00195       ( yetAnotherSubDetId == 4 && yetAnotherLayerNumber == 1) || 
00196       ( yetAnotherSubDetId == 4 && yetAnotherLayerNumber == 2) ) ) || 
00197     // First Hit on PXD1, second on PXD2
00198     ( ( theSubDetId == 2 && theLayerNumber == 1 ) && 
00199       ( anotherSubDetId == 2 && anotherLayerNumber == 2 ) && (
00200       ( yetAnotherSubDetId == 6 && yetAnotherLayerNumber == 1 ) ||
00201       ( yetAnotherSubDetId == 6 && yetAnotherLayerNumber == 2 ) ) ) || 
00202     // First hit on TIB1 (pixel less)
00203     ( ( theSubDetId == 3 && theLayerNumber == 1 ) && 
00204       ( anotherSubDetId == 3 && anotherLayerNumber == 2 ) && 
00205       ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 3 ) );
00206 
00207   return isAProperTriplet;
00208 
00209 } 

const SiTrackerGSMatchedRecHit2D* TrackerRecHit::matchedHit (  )  const [inline]

The Hit itself.

Definition at line 68 of file TrackerRecHit.h.

References theMatchedHit.

Referenced by TrackCandidateProducer::addSplitHits(), and TrackCandidateProducer::produce().

00068 { return theMatchedHit; }

bool TrackerRecHit::operator!= ( const TrackerRecHit aHit  )  const [inline]

Definition at line 151 of file TrackerRecHit.h.

References geomDet(), hit(), GSSiTrackerRecHit2DLocalPos::localPosition(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

00151                                                           {
00152     return 
00153       aHit.geomDet() != this->geomDet() ||
00154       aHit.hit()->localPosition().x() != this->hit()->localPosition().x() ||
00155       aHit.hit()->localPosition().y() != this->hit()->localPosition().y() ||
00156       aHit.hit()->localPosition().z() != this->hit()->localPosition().z();
00157   }

unsigned int TrackerRecHit::ringNumber (  )  const [inline]

The Ring Number.

Definition at line 82 of file TrackerRecHit.h.

References theRingNumber.

Referenced by ElectronGSPixelSeedGenerator::run().

00082 { return theRingNumber; }

const SiTrackerGSRecHit2D* TrackerRecHit::splitHit (  )  const [inline]

Definition at line 69 of file TrackerRecHit.h.

References theSplitHit.

00069 { return theSplitHit; }

unsigned int TrackerRecHit::subDetId (  )  const [inline]

The subdet Id.

Definition at line 76 of file TrackerRecHit.h.

References theSubDetId.

Referenced by GSPixelHitMatcher::isASeed(), isOnTheSameLayer(), makesAPairWith(), makesATripletWith(), TrackCandidateProducer::produce(), TrajectorySeedProducer::produce(), and ElectronGSPixelSeedGenerator::run().

00076 { return theSubDetId; }


Member Data Documentation

bool TrackerRecHit::forward [private]

Definition at line 170 of file TrackerRecHit.h.

Referenced by init(), and isForward().

unsigned int TrackerRecHit::theCylinderNumber [private]

Definition at line 167 of file TrackerRecHit.h.

Referenced by cylinderNumber(), and init().

const GeomDet* TrackerRecHit::theGeomDet [private]

Definition at line 163 of file TrackerRecHit.h.

Referenced by geomDet(), globalPosition(), and init().

double TrackerRecHit::theLargerError [private]

Definition at line 169 of file TrackerRecHit.h.

Referenced by largerError().

unsigned int TrackerRecHit::theLayerNumber [private]

Definition at line 165 of file TrackerRecHit.h.

Referenced by init(), isOnRequestedDet(), isOnTheSameLayer(), layerNumber(), makesAPairWith(), and makesATripletWith().

double TrackerRecHit::theLocalError [private]

Definition at line 168 of file TrackerRecHit.h.

Referenced by localError().

const SiTrackerGSMatchedRecHit2D* TrackerRecHit::theMatchedHit [private]

Definition at line 162 of file TrackerRecHit.h.

Referenced by hit(), and matchedHit().

unsigned int TrackerRecHit::theRingNumber [private]

Definition at line 166 of file TrackerRecHit.h.

Referenced by init(), isOnRequestedDet(), and ringNumber().

const SiTrackerGSRecHit2D* TrackerRecHit::theSplitHit [private]

Definition at line 161 of file TrackerRecHit.h.

Referenced by hit(), and splitHit().

unsigned int TrackerRecHit::theSubDetId [private]

Definition at line 164 of file TrackerRecHit.h.

Referenced by init(), isOnRequestedDet(), isOnTheSameLayer(), makesAPairWith(), makesATripletWith(), and subDetId().


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