CMS 3D CMS Logo

Public Member Functions | Private Attributes

TrackerRecHit Class Reference

#include <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 std::string &seedingAlgo) 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 makesAPairWith3rd (const TrackerRecHit &anotherHit) const
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 SiTrackerGSRecHit2D *theSplitHit, const TrackerRecHit &other)
 Soft Copy Constructor from private members.
 TrackerRecHit (const SiTrackerGSRecHit2D *theHit, const TrackerGeometry *theGeometry)
 Constructor from a GSRecHit and the Geometry.
 TrackerRecHit (const SiTrackerGSMatchedRecHit2D *theHit, const TrackerGeometry *theGeometry)
 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.

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

Soft Copy Constructor from private members.

Definition at line 42 of file TrackerRecHit.h.

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().

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

Definition at line 4 of file TrackerRecHit.cc.

References init().


Member Function Documentation

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

The global layer number in the nested cylinder geometry.

Definition at line 87 of file TrackerRecHit.h.

References theCylinderNumber.

Referenced by FastPixelHitMatcher::isASeed().

{ return theCylinderNumber; }
const GeomDet* TrackerRecHit::geomDet ( ) const [inline]

The GeomDet.

Definition at line 93 of file TrackerRecHit.h.

References theGeomDet.

Referenced by operator!=().

{ return theGeomDet; }
GlobalPoint TrackerRecHit::globalPosition ( ) const [inline]
const GSSiTrackerRecHit2DLocalPos* TrackerRecHit::hit ( void  ) const [inline]
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().

                                                      { 

  const DetId& theDetId = hit()->geographicalId();
  theGeomDet = theGeometry->idToDet(theDetId);
  theSubDetId = theDetId.subdetId(); 
  if ( theSubDetId == StripSubdetector::TIB) { 
    TIBDetId tibid(theDetId.rawId()); 
    theLayerNumber = tibid.layer();
    theCylinderNumber = TrackerInteractionGeometry::TIB+theLayerNumber;
    forward = false;
  } else if ( theSubDetId ==  StripSubdetector::TOB ) { 
    TOBDetId tobid(theDetId.rawId()); 
    theLayerNumber = tobid.layer();
    theCylinderNumber = TrackerInteractionGeometry::TOB+theLayerNumber;
    forward = false;
  } else if ( theSubDetId ==  StripSubdetector::TID) { 
    TIDDetId tidid(theDetId.rawId());
    theLayerNumber = tidid.wheel();
    theCylinderNumber = TrackerInteractionGeometry::TID+theLayerNumber;
    theRingNumber = tidid.ring();
    forward = true;
  } else if ( theSubDetId ==  StripSubdetector::TEC ) { 
    TECDetId tecid(theDetId.rawId()); 
    theLayerNumber = tecid.wheel(); 
    theCylinderNumber = TrackerInteractionGeometry::TEC+theLayerNumber;
    theRingNumber = tecid.ring();
    forward = true;
  } else if ( theSubDetId ==  PixelSubdetector::PixelBarrel ) { 
    PXBDetId pxbid(theDetId.rawId()); 
    theLayerNumber = pxbid.layer(); 
    theCylinderNumber = TrackerInteractionGeometry::PXB+theLayerNumber;
    forward = false;
  } else if ( theSubDetId ==  PixelSubdetector::PixelEndcap ) { 
    PXFDetId pxfid(theDetId.rawId()); 
    theLayerNumber = pxfid.disk();  
    theCylinderNumber = TrackerInteractionGeometry::PXD+theLayerNumber;
    forward = true;
  }
  
}
bool TrackerRecHit::isForward ( ) const [inline]

Is it a forward hit ?

Definition at line 90 of file TrackerRecHit.h.

References forward.

Referenced by TrajectorySeedProducer::produce().

{ return forward; }
bool TrackerRecHit::isOnRequestedDet ( const std::vector< unsigned int > &  whichDet,
const std::string &  seedingAlgo 
) const

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

Definition at line 78 of file TrackerRecHit.cc.

References gather_cfg::cout, theLayerNumber, theRingNumber, and theSubDetId.

Referenced by TrajectorySeedProducer::produce().

                                                                                                           { 
  
  bool isOnDet = false;
  
  for ( unsigned idet=0; idet<whichDet.size(); ++idet ) {
    
    switch ( whichDet[idet] ) { 
      
    case 1: 
      //Pixel Barrel
      isOnDet =  theSubDetId==1;
      break;
      
    case 2: 
      //Pixel Disks
      isOnDet = theSubDetId==2;
      break;
      
    case 3:
      //Inner Barrel
      isOnDet = theSubDetId==3 && theLayerNumber < 4;
      break;
      
    case 4:
      //Inner Disks
      isOnDet = theSubDetId==4 && theRingNumber < 3;
      break;
      
    case 5:
      //Outer Barrel
      if(seedingAlgo == "TobTecLayerPairs"){
        isOnDet = theSubDetId==5 && theLayerNumber <3;
      }else {
        isOnDet = false;
      }
      break;
      
    case 6:
      //Tracker EndCap
      if(seedingAlgo == "PixelLessPairs"){
        isOnDet = theSubDetId==6 && theLayerNumber < 6 && theRingNumber < 3;
      }else if (seedingAlgo == "TobTecLayerPairs"){
        //      isOnDet = theSubDetId==6 && theLayerNumber < 8 && theRingNumber < 5;
        isOnDet = theSubDetId==6 && theLayerNumber < 8 && theRingNumber == 5;
      } else if (seedingAlgo == "MixedTriplets"){ 
        //      isOnDet = theSubDetId==6 && theLayerNumber == 2 && theRingNumber == 1;
        isOnDet = theSubDetId==6 && theLayerNumber < 4 && theRingNumber == 1;
      } else {
        isOnDet = theSubDetId==6;
        std::cout << "DEBUG - this should never happen" << std::endl;
      }

      break;
      
    default:
      // Should not happen
      isOnDet = false;
      break;
      
    }
    
    if ( isOnDet ) break;
    
  }
  
  return isOnDet;
}
bool TrackerRecHit::isOnTheSameLayer ( const TrackerRecHit other) const [inline]

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

Definition at line 116 of file TrackerRecHit.h.

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

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

                                                                 {
    
    return 
      theSubDetId == other.subDetId() && 
      theLayerNumber == other.layerNumber();
  }
double TrackerRecHit::largerError ( ) [inline]

Definition at line 140 of file TrackerRecHit.h.

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

Referenced by TrajectorySeedProducer::produce().

                       { 

    // Check if it has been already computed
    if ( theLargerError != 0. ) return theLargerError;

    // Otherwise, compute it!
    double xx = hit()->localPositionError().xx();
    double yy = hit()->localPositionError().yy();
    double xy = hit()->localPositionError().xy();
    double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
    theLargerError = 0.5 * (xx+yy+delta);
    return theLargerError;

  }
unsigned int TrackerRecHit::layerNumber ( ) const [inline]
double TrackerRecHit::localError ( ) [inline]

Definition at line 124 of file TrackerRecHit.h.

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

Referenced by TrackCandidateProducer::produce().

                      { 

    // Check if it has been already computed
    if ( theLocalError != 0. ) return theLocalError;

    // Otherwise, compute it!
    double xx = hit()->localPositionError().xx();
    double yy = hit()->localPositionError().yy();
    double xy = hit()->localPositionError().xy();
    double delta = std::sqrt((xx-yy)*(xx-yy)+4.*xy*xy);
    theLocalError = 0.5 * (xx+yy-delta);
    return theLocalError;

  }
LocalPoint TrackerRecHit::localPosition ( ) const [inline]

The local position.

Definition at line 101 of file TrackerRecHit.h.

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

Referenced by globalPosition().

{ return hit()->localPosition(); }
bool TrackerRecHit::makesAPairWith ( const TrackerRecHit anotherHit) const

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

Definition at line 147 of file TrackerRecHit.cc.

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

                                                                   { 

  bool isAProperPair = false;

  unsigned int anotherSubDetId = anotherHit.subDetId();
  unsigned int anotherLayerNumber = anotherHit.layerNumber();
  isAProperPair = 
    // First hit on PXB1
    ( ( theSubDetId == 1 && theLayerNumber == 1 ) && (
      ( anotherSubDetId == 1 && anotherLayerNumber == 2) || 
      ( anotherSubDetId == 1 && anotherLayerNumber == 3) || 
      ( anotherSubDetId == 2 && anotherLayerNumber == 1) || 
      ( anotherSubDetId == 2 && anotherLayerNumber == 2) ) ) || 
    // First hit on PXB2
    ( ( theSubDetId == 1 && theLayerNumber == 2 ) && (
      ( anotherSubDetId == 1 && anotherLayerNumber == 3) || 
      ( anotherSubDetId == 2 && anotherLayerNumber == 1) || 
      ( anotherSubDetId == 2 && anotherLayerNumber == 2) ) ) ||
    // First Hit on PXD1
    ( ( theSubDetId == 2 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 2 && anotherLayerNumber == 2 ) ) ||
    // First Hit on PXD2
    ( ( theSubDetId == 2 && theLayerNumber == 2 ) && ( 
      ( anotherSubDetId == 6 && anotherLayerNumber == 1 ) ||
      ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) ) ) ||
    // First Hit on TEC1
    ( ( theSubDetId == 6 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) ) ||
    // First Hit on TEC2
    ( ( theSubDetId == 6 && theLayerNumber == 2 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 3 ) ) ||

  //Pixelless Pairs  
   // First Hit on TIB1
    ( ( theSubDetId == 3 && theLayerNumber == 1 ) && 
      (( anotherSubDetId == 3 && anotherLayerNumber == 2 ) ||
       ( anotherSubDetId == 4 && anotherLayerNumber == 1 )) ) ||
    // First Hit on TID1
    ( ( theSubDetId == 4 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 4 && anotherLayerNumber == 2 ) ) ||
    // First Hit on TID2
    ( ( theSubDetId == 4 && theLayerNumber == 2 ) && 
      ( anotherSubDetId == 4 && anotherLayerNumber == 3 ) ) ||
    // First Hit on TID3
    ( ( theSubDetId == 4 && theLayerNumber == 3 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 1 ) ) ||
    // First Hit on TEC3
    ( ( theSubDetId == 6 && theLayerNumber == 3 ) && 
      (      ( anotherSubDetId == 6 && anotherLayerNumber == 4 ) || 
             ( anotherSubDetId == 6 && anotherLayerNumber == 5 ))  ) ||
    // First Hit on TEC4
    ( ( theSubDetId == 6 && theLayerNumber == 4 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 5 ) ) ||

  //Tob-Tec pairs
  //first hit on TOB1 
    ( ( theSubDetId == 5 && theLayerNumber == 1 ) && 
      (( anotherSubDetId == 5 && anotherLayerNumber == 2 ) ||
       ( anotherSubDetId == 6 && anotherLayerNumber == 1 )) ) ||
    // First Hit on TEC1
    ( ( theSubDetId == 6 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) ) ||
    // First Hit on TEC2
    ( ( theSubDetId == 6 && theLayerNumber == 2 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 3 ) ) ||
    // First Hit on TEC3
    ( ( theSubDetId == 6 && theLayerNumber == 3 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 4 ) ) || 
      // ???     ( anotherSubDetId == 6 && anotherLayerNumber == 5 ) ) ||
    // First Hit on TEC4
    ( ( theSubDetId == 6 && theLayerNumber == 4 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 5 ) ) ||
    // First Hit on TEC5
    ( ( theSubDetId == 6 && theLayerNumber == 5 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 6 ) ) ||
    // First Hit on TEC6
    ( ( theSubDetId == 6 && theLayerNumber == 6 ) && 
      ( anotherSubDetId == 6 && anotherLayerNumber == 7 ) ) ;

  return isAProperPair;

} 
bool TrackerRecHit::makesAPairWith3rd ( const TrackerRecHit anotherHit) const

Definition at line 231 of file TrackerRecHit.cc.

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

                                                                      { 

  bool isAProperPair = false;

  unsigned int anotherSubDetId = anotherHit.subDetId();
  unsigned int anotherLayerNumber = anotherHit.layerNumber();
  isAProperPair = 
    // First hit on PXB1
    ( ( theSubDetId == 1 && theLayerNumber == 1 ) && (
      ( anotherSubDetId == 1 && anotherLayerNumber == 2) || 
      ( anotherSubDetId == 2 && anotherLayerNumber == 1) ) ) || 
      // First hit on PXB2
    ( ( theSubDetId == 1 && theLayerNumber == 2 ) && 
      ( anotherSubDetId == 1 && anotherLayerNumber == 3) ) || 
    // First Hit on PXD1
    ( ( theSubDetId == 2 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 2 && anotherLayerNumber == 2) ) ||
    // First Hit on PXD2
    ( ( theSubDetId == 2 && theLayerNumber == 2 ) &&  
      ( anotherSubDetId == 6 && anotherLayerNumber == 2 ) );

 return isAProperPair;

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

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

Definition at line 257 of file TrackerRecHit.cc.

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

                                                                            { 

  bool isAProperTriplet = false;

  unsigned int anotherSubDetId = anotherHit.subDetId();
  unsigned int anotherLayerNumber = anotherHit.layerNumber();
  unsigned int yetAnotherSubDetId = yetAnotherHit.subDetId();
  unsigned int yetAnotherLayerNumber = yetAnotherHit.layerNumber();
  isAProperTriplet = 
    // First hit on PXB1, second on PXB2
    ( ( theSubDetId == 1 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 1 && anotherLayerNumber == 2) && ( 
      ( yetAnotherSubDetId == 1 && yetAnotherLayerNumber == 3) || 
      ( yetAnotherSubDetId == 2 && yetAnotherLayerNumber == 1) || 
      ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) ) || 
    // First hit on PXB1, second on PXB3 
    ( ( theSubDetId == 1 && theLayerNumber == 1 ) &&
      ( anotherSubDetId == 1 && anotherLayerNumber == 3) && 
      ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) || 
    // First hit on PXB2, second on PXB3 
    ( ( theSubDetId == 1 && theLayerNumber == 2 ) &&
      ( anotherSubDetId == 1 && anotherLayerNumber == 3) && 
      ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 1) ) || 
    // First Hit on PXB1, second on PXD1
    ( ( theSubDetId == 1 && theLayerNumber == 1 ) &&
      ( anotherSubDetId == 2 && anotherLayerNumber == 1) && ( 
      ( yetAnotherSubDetId == 2 && yetAnotherLayerNumber == 2) || 
      ( yetAnotherSubDetId == 4 && yetAnotherLayerNumber == 1) || 
      ( yetAnotherSubDetId == 4 && yetAnotherLayerNumber == 2) ) ) || 
    // First Hit on PXD1, second on PXD2
    ( ( theSubDetId == 2 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 2 && anotherLayerNumber == 2 ) && (
      ( yetAnotherSubDetId == 6 && yetAnotherLayerNumber == 1 ) ||
      ( yetAnotherSubDetId == 6 && yetAnotherLayerNumber == 2 ) ) ) ||
    // First hit on TIB1 (pixel less)
    ( ( theSubDetId == 3 && theLayerNumber == 1 ) && 
      ( anotherSubDetId == 3 && anotherLayerNumber == 2 ) && 
      ( yetAnotherSubDetId == 3 && yetAnotherLayerNumber == 3 ) );
  
  return isAProperTriplet;
  
}
const SiTrackerGSMatchedRecHit2D* TrackerRecHit::matchedHit ( ) const [inline]

The Hit itself.

Definition at line 70 of file TrackerRecHit.h.

References theMatchedHit.

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

{ return theMatchedHit; }
bool TrackerRecHit::operator!= ( const TrackerRecHit aHit) const [inline]
unsigned int TrackerRecHit::ringNumber ( ) const [inline]

The Ring Number.

Definition at line 84 of file TrackerRecHit.h.

References theRingNumber.

Referenced by FastElectronSeedGenerator::run().

{ return theRingNumber; }
const SiTrackerGSRecHit2D* TrackerRecHit::splitHit ( ) const [inline]

Definition at line 71 of file TrackerRecHit.h.

References theSplitHit.

{ return theSplitHit; }
unsigned int TrackerRecHit::subDetId ( ) const [inline]

Member Data Documentation

bool TrackerRecHit::forward [private]

Definition at line 174 of file TrackerRecHit.h.

Referenced by init(), and isForward().

unsigned int TrackerRecHit::theCylinderNumber [private]

Definition at line 171 of file TrackerRecHit.h.

Referenced by cylinderNumber(), and init().

Definition at line 167 of file TrackerRecHit.h.

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

Definition at line 173 of file TrackerRecHit.h.

Referenced by largerError().

unsigned int TrackerRecHit::theLayerNumber [private]
double TrackerRecHit::theLocalError [private]

Definition at line 172 of file TrackerRecHit.h.

Referenced by localError().

Definition at line 166 of file TrackerRecHit.h.

Referenced by hit(), and matchedHit().

unsigned int TrackerRecHit::theRingNumber [private]

Definition at line 170 of file TrackerRecHit.h.

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

Definition at line 165 of file TrackerRecHit.h.

Referenced by hit(), and splitHit().

unsigned int TrackerRecHit::theSubDetId [private]