CMS 3D CMS Logo

Public Member Functions

GlobalTrajectoryBuilderBase::ComparatorInOut Struct Reference

#include <GlobalTrajectoryBuilderBase.h>

List of all members.

Public Member Functions

bool operator() (const TransientTrackingRecHit::ConstRecHitPointer &a, const TransientTrackingRecHit::ConstRecHitPointer &b) const

Detailed Description

Definition at line 141 of file GlobalTrajectoryBuilderBase.h.


Member Function Documentation

bool GlobalTrajectoryBuilderBase::ComparatorInOut::operator() ( const TransientTrackingRecHit::ConstRecHitPointer a,
const TransientTrackingRecHit::ConstRecHitPointer b 
) const [inline]

Definition at line 143 of file GlobalTrajectoryBuilderBase.h.

References GeomDetEnumerators::DT, and GeomDetEnumerators::RPCBarrel.

                                                                               { 
        bool barrel_a = ( a->det()->subDetector() == GeomDetEnumerators::DT ||
                          a->det()->subDetector() == GeomDetEnumerators::RPCBarrel );
        
        bool barrel_b = ( b->det()->subDetector() == GeomDetEnumerators::DT ||
                          b->det()->subDetector() == GeomDetEnumerators::RPCBarrel );
        
         if ( barrel_a && barrel_b ) return  a->det()->surface().position().perp() < b->det()->surface().position().perp();

        else if ( !barrel_a && !barrel_b ) return  fabs(a->globalPosition().z()) < fabs(b->globalPosition().z());
        else if ( barrel_a && !barrel_b  ) return true;
        else if ( !barrel_a && barrel_b  ) return false;
         //shouldn;t really get here in any case (there's some sense to throw here )
         return false;
      }