#include <RoadSearchHitSorting.h>
Public Member Functions | |
bool | operator() (const TrackingRecHit &a, const TrackingRecHit &b) const |
SortHitsByGlobalPosition (const TrackingGeometry *geometry_, PropagationDirection dir=alongMomentum) | |
Private Member Functions | |
bool | barrelForwardLess (const TrackingRecHit &a, const TrackingRecHit &b) const |
bool | insideOutLess (const TrackingRecHit &a, const TrackingRecHit &b) const |
Private Attributes | |
const TrackingGeometry * | geometry |
PropagationDirection | theDir |
Definition at line 30 of file RoadSearchHitSorting.h.
SortHitsByGlobalPosition::SortHitsByGlobalPosition | ( | const TrackingGeometry * | geometry_, |
PropagationDirection | dir = alongMomentum |
||
) | [inline] |
Definition at line 33 of file RoadSearchHitSorting.h.
bool SortHitsByGlobalPosition::barrelForwardLess | ( | const TrackingRecHit & | a, |
const TrackingRecHit & | b | ||
) | const [private] |
Definition at line 75 of file RoadSearchHitSorting.cc.
References abs, TrackingRecHit::geographicalId(), geometry, TrackingGeometry::idToDet(), TrackingRecHit::localPosition(), GeomDet::surface(), Surface::toGlobal(), and z.
Referenced by insideOutLess().
{ // // for the moment sort again in z, but since the z in the barrel is wrong (it is in the centre of the module) // add the semi length // DetId ida(a.geographicalId()); DetId idb(b.geographicalId()); return static_cast<unsigned int>(std::abs( geometry->idToDet(ida)->surface().toGlobal(a.localPosition()).z()) * 1E7) < static_cast<unsigned int>(std::abs( geometry->idToDet(idb)->surface().toGlobal(b.localPosition()).z()) * 1E7); }
bool SortHitsByGlobalPosition::insideOutLess | ( | const TrackingRecHit & | a, |
const TrackingRecHit & | b | ||
) | const [private] |
Definition at line 24 of file RoadSearchHitSorting.cc.
References abs, barrelForwardLess(), TrackingRecHit::geographicalId(), geometry, TrackingGeometry::idToDet(), TrackingRecHit::localPosition(), perp(), PixelSubdetector::PixelBarrel, GeomDetEnumerators::PixelBarrel, PixelSubdetector::PixelEndcap, GeomDetEnumerators::PixelEndcap, GeomDet::surface(), StripSubdetector::TEC, sistripsummary::TEC, sistripsummary::TIB, StripSubdetector::TIB, sistripsummary::TID, StripSubdetector::TID, StripSubdetector::TOB, sistripsummary::TOB, Surface::toGlobal(), and z.
Referenced by operator()().
{ DetId ida(a.geographicalId()); DetId idb(b.geographicalId()); unsigned int idetA = static_cast<unsigned int>(ida.subdetId()); unsigned int idetB = static_cast<unsigned int>(idb.subdetId()); //check for mixed case... bool same_det = ( (idetA == StripSubdetector::TIB && idetB == StripSubdetector::TIB) || (idetA == StripSubdetector::TID && idetB == StripSubdetector::TID) || (idetA == StripSubdetector::TIB && idetB == StripSubdetector::TID) || (idetA == StripSubdetector::TID && idetB == StripSubdetector::TIB) || (idetA == StripSubdetector::TOB && idetB == StripSubdetector::TOB) || (idetA == StripSubdetector::TEC && idetB == StripSubdetector::TEC) || (idetA == StripSubdetector::TOB && idetB == StripSubdetector::TEC) || (idetA == StripSubdetector::TEC && idetB == StripSubdetector::TOB) || (idetA == PixelSubdetector::PixelBarrel && idetB == PixelSubdetector::PixelBarrel) || (idetA == PixelSubdetector::PixelEndcap && idetB == PixelSubdetector::PixelEndcap) || (idetA == PixelSubdetector::PixelBarrel && idetB == PixelSubdetector::PixelEndcap) || (idetA == PixelSubdetector::PixelEndcap && idetB == PixelSubdetector::PixelBarrel) ); if (!same_det) return (idetA < idetB); if( (idetA == StripSubdetector::TIB || idetA == StripSubdetector::TOB || idetA == PixelSubdetector::PixelBarrel) && (idetB == StripSubdetector::TIB || idetB == StripSubdetector::TOB || idetB == PixelSubdetector::PixelBarrel)) { return static_cast<unsigned int>(geometry->idToDet(ida)->surface().toGlobal(a.localPosition()).perp() * 1E7) < static_cast<unsigned int>(geometry->idToDet(idb)->surface().toGlobal(b.localPosition()).perp() * 1E7); } if( (idetA == StripSubdetector::TEC || idetA == StripSubdetector::TID || idetA == PixelSubdetector::PixelEndcap) && (idetB == StripSubdetector::TEC || idetB == StripSubdetector::TID || idetB == PixelSubdetector::PixelEndcap)) { return static_cast<unsigned int>(std::abs(geometry->idToDet(ida)->surface().toGlobal(a.localPosition()).z()) * 1E7) < static_cast<unsigned int>(std::abs(geometry->idToDet(idb)->surface().toGlobal(b.localPosition()).z()) * 1E7); } // // here I have 1 barrel against one forward // if( (idetA == StripSubdetector::TIB || idetA == StripSubdetector::TOB || idetA == PixelSubdetector::PixelBarrel) && (idetB == StripSubdetector::TEC || idetB == StripSubdetector::TID || idetB == PixelSubdetector::PixelEndcap)) { return barrelForwardLess( a, b); }else{ return !barrelForwardLess( b, a); } throw Genexception("SortHitsByGlobalPosition: arguments are not Ok"); }
bool SortHitsByGlobalPosition::operator() | ( | const TrackingRecHit & | a, |
const TrackingRecHit & | b | ||
) | const [inline] |
Definition at line 38 of file RoadSearchHitSorting.h.
References alongMomentum, insideOutLess(), and theDir.
{ if (theDir == alongMomentum) return insideOutLess( a, b); else return insideOutLess( b, a); }
const TrackingGeometry* SortHitsByGlobalPosition::geometry [private] |
Definition at line 49 of file RoadSearchHitSorting.h.
Referenced by barrelForwardLess(), and insideOutLess().
Definition at line 50 of file RoadSearchHitSorting.h.
Referenced by operator()().