CMS 3D CMS Logo

CRackTrajectoryBuilder::CompareDetByTraj Class Reference

#include <RecoTracker/SingleTrackPattern/interface/CRackTrajectoryBuilder.h>

List of all members.

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


Detailed Description

Definition at line 147 of file CRackTrajectoryBuilder.h.


Constructor & Destructor Documentation

CRackTrajectoryBuilder::CompareDetByTraj::CompareDetByTraj ( const TSOS tSos  )  [inline]

Definition at line 149 of file CRackTrajectoryBuilder.h.

00149                                        :_tSos(tSos)
00150     {};


Member Function Documentation

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    };


Member Data Documentation

const TrajectoryStateOnSurface& CRackTrajectoryBuilder::CompareDetByTraj::_tSos [private]

Definition at line 178 of file CRackTrajectoryBuilder.h.

Referenced by operator()().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:16:59 2009 for CMSSW by  doxygen 1.5.4