CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
SortHitTrajectoryPairsByGlobalPosition Class Reference

#include <RoadSearchHitSorting.h>

Public Member Functions

bool operator() (const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM1, const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM2) const
 
 SortHitTrajectoryPairsByGlobalPosition ()
 

Private Member Functions

bool InsideOutCompare (const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM1, const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM2) const
 

Detailed Description

Definition at line 76 of file RoadSearchHitSorting.h.

Constructor & Destructor Documentation

SortHitTrajectoryPairsByGlobalPosition::SortHitTrajectoryPairsByGlobalPosition ( )
inline

Definition at line 79 of file RoadSearchHitSorting.h.

79 { };

Member Function Documentation

bool SortHitTrajectoryPairsByGlobalPosition::InsideOutCompare ( const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &  HitTM1,
const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &  HitTM2 
) const
private

Definition at line 146 of file RoadSearchHitSorting.cc.

References abs, LogDebug, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by operator()().

148 {
149 
150 
151  DetId ida(HitTM1.first->det()->geographicalId());
152  DetId idb(HitTM2.first->det()->geographicalId());
153 
154 
155  LogDebug("RoadSearch")<<" Comparing (r/phi/z) Hit 1 on DetID "
156  << ida.rawId() << " : "
157  << HitTM1.first->globalPosition().perp() << " / "
158  << HitTM1.first->globalPosition().phi() << " / "
159  << HitTM1.first->globalPosition().z()
160  << " and Hit 2 on DetID "
161  << idb.rawId() << " : "
162  << HitTM2.first->globalPosition().perp() << " / "
163  << HitTM2.first->globalPosition().phi() << " / "
164  << HitTM2.first->globalPosition().z() ;
165 
166 
167  if( ((unsigned int)ida.subdetId() == StripSubdetector::TIB || (unsigned int)ida.subdetId() == StripSubdetector::TOB || (unsigned int)ida.subdetId() == PixelSubdetector::PixelBarrel) &&
168  ((unsigned int)idb.subdetId() == StripSubdetector::TIB || (unsigned int)idb.subdetId() == StripSubdetector::TOB || (unsigned int)idb.subdetId() == PixelSubdetector::PixelBarrel)) { // barrel with barrel
169  return static_cast<unsigned int>(HitTM1.first->globalPosition().perp() * 1E7) < static_cast<unsigned int>(HitTM2.first->globalPosition().perp() * 1E7);
170  }
171 
172  if( ((unsigned int)ida.subdetId() == StripSubdetector::TEC || (unsigned int)ida.subdetId() == StripSubdetector::TID || (unsigned int)ida.subdetId() == PixelSubdetector::PixelEndcap) &&
173  ((unsigned int)idb.subdetId() == StripSubdetector::TEC || (unsigned int)idb.subdetId() == StripSubdetector::TID || (unsigned int)idb.subdetId() == PixelSubdetector::PixelEndcap)) { // fwd with fwd
174  return static_cast<unsigned int>(std::abs(HitTM1.first->globalPosition().z()) * 1E7) < static_cast<unsigned int>(std::abs(HitTM2.first->globalPosition().z()) * 1E7);
175  }
176 
177  //
178  // here I have 1 barrel against one forward
179  //
180 
181  if( ((unsigned int)ida.subdetId() == StripSubdetector::TIB || (unsigned int)ida.subdetId() == StripSubdetector::TOB || (unsigned int)ida.subdetId() == PixelSubdetector::PixelBarrel) &&
182  ((unsigned int)idb.subdetId() == StripSubdetector::TEC || (unsigned int)idb.subdetId() == StripSubdetector::TID || (unsigned int)idb.subdetId() == PixelSubdetector::PixelEndcap)) { // barrel with barrel
183  LogDebug("RoadSearch") <<"*** How did this happen ?!?!? ***" ;
184  }else{
185  LogDebug("RoadSearch") <<"*** How did this happen ?!?!? ***" ;
186  }
187 
188  //throw DetLogicError("GeomDetLess: arguments are not Barrel or Forward GeomDets");
189  throw Genexception("SortHitTrajectoryPairsByGlobalPosition: arguments are not Ok");
190 
191 
192 }
#define LogDebug(id)
#define abs(x)
Definition: mlp_lapack.h:159
Definition: DetId.h:20
bool SortHitTrajectoryPairsByGlobalPosition::operator() ( const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &  HitTM1,
const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &  HitTM2 
) const
inline

Definition at line 81 of file RoadSearchHitSorting.h.

References InsideOutCompare().

83  {
84  return
85  InsideOutCompare(HitTM1,HitTM2);
86  }
bool InsideOutCompare(const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM1, const std::pair< TransientTrackingRecHit::ConstRecHitPointer, TrajectoryMeasurement * > &HitTM2) const