#include <RecoTracker/SingleTrackPattern/interface/CRackTrajectoryBuilder.h>
Public Member Functions | |
CompareDetByTraj (const TSOS &tSos) | |
bool | operator() (const std::pair< TrackingRecHitRangeIterator, TSOS > rh1, const std::pair< TrackingRecHitRangeIterator, TSOS > rh2) |
Private Attributes | |
const TrajectoryStateOnSurface & | _tSos |
Definition at line 147 of file CRackTrajectoryBuilder.h.
CRackTrajectoryBuilder::CompareDetByTraj::CompareDetByTraj | ( | const TSOS & | tSos | ) | [inline] |
bool CRackTrajectoryBuilder::CompareDetByTraj::operator() | ( | const std::pair< TrackingRecHitRangeIterator, TSOS > | rh1, | |
const std::pair< TrackingRecHitRangeIterator, TSOS > | rh2 | |||
) | [inline] |
Definition at line 151 of file CRackTrajectoryBuilder.h.
References _tSos, TrajectoryStateOnSurface::globalDirection(), and TrajectoryStateOnSurface::globalPosition().
00153 { 00154 GlobalPoint gp1 = rh1.second.globalPosition(); 00155 GlobalPoint gp2 = rh2.second.globalPosition(); 00156 00157 GlobalPoint gpT = _tSos.globalPosition(); 00158 GlobalVector gpDiff1 = gp1-gpT; 00159 GlobalVector gpDiff2 = gp2-gpT; 00160 00161 //this might have a better performance ... 00162 // float dist1 = ( gp1.x()-gpT.x() ) * ( gp1.x()-gpT.x() ) + ( gp1.y()-gpT.y() ) * ( gp1.y()-gpT.y() ) + ( gp1.z()-gpT.z() ) * ( gp1.z()-gpT.z() ); 00163 // float dist2 = ( gp2.x()-gpT.x() ) * ( gp2.x()-gpT.x() ) + ( gp2.y()-gpT.y() ) * ( gp2.y()-gpT.y() ) + ( gp2.z()-gpT.z() ) * ( gp2.z()-gpT.z() ); 00164 //if ( dist1<dist2 ) 00165 00166 // if ( gpDiff1.mag2() < gpDiff2.mag2() ) 00167 00168 00169 float dist1 = gpDiff1 * _tSos.globalDirection(); 00170 float dist2 = gpDiff2 * _tSos.globalDirection(); 00171 00172 if (dist1 < 0) 00173 return false; 00174 if ( dist1<dist2 ) 00175 return true; 00176 00177 return false; 00178 };
const TrajectoryStateOnSurface& CRackTrajectoryBuilder::CompareDetByTraj::_tSos [private] |