CMS 3D CMS Logo

Public Member Functions | Private Attributes

CompareHitPairsY Class Reference

#include <CosmicHitPairGeneratorFromLayerPair.h>

List of all members.

Public Member Functions

 CompareHitPairsY (const edm::EventSetup &iSetup)
bool operator() (OrderedHitPair h1, OrderedHitPair h2)

Private Attributes

edm::ESHandle< TrackerGeometrytracker

Detailed Description

Definition at line 14 of file CosmicHitPairGeneratorFromLayerPair.h.


Constructor & Destructor Documentation

CompareHitPairsY::CompareHitPairsY ( const edm::EventSetup iSetup) [inline]

Definition at line 16 of file CosmicHitPairGeneratorFromLayerPair.h.

References edm::EventSetup::get(), and tracker.

                                                {    

     iSetup.get<TrackerDigiGeometryRecord>().get(tracker);};

Member Function Documentation

bool CompareHitPairsY::operator() ( OrderedHitPair  h1,
OrderedHitPair  h2 
) [inline]

Definition at line 19 of file CosmicHitPairGeneratorFromLayerPair.h.

References abs, TrackingRecHit::geographicalId(), OrderedHitPair::inner(), TrackingRecHit::localPosition(), OrderedHitPair::outer(), tracker, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

   {      
     const TrackingRecHit * trh1i = h1.inner()->hit();
     const TrackingRecHit * trh2i = h2.inner()->hit();
     const TrackingRecHit * trh1o = h1.outer()->hit();
     const TrackingRecHit * trh2o = h2.outer()->hit();
     GlobalPoint in1p=tracker->idToDet(trh1i->geographicalId())->surface().toGlobal(trh1i->localPosition());
     GlobalPoint in2p=tracker->idToDet(trh2i->geographicalId())->surface().toGlobal(trh2i->localPosition());
     GlobalPoint ou1p=tracker->idToDet(trh1o->geographicalId())->surface().toGlobal(trh1o->localPosition());
     GlobalPoint ou2p=tracker->idToDet(trh2o->geographicalId())->surface().toGlobal(trh2o->localPosition());
     if (ou1p.y()*ou2p.y()<0) return ou1p.y()>ou2p.y();
     else{
       float dist1=100*std::abs(ou1p.z()-in1p.z())-std::abs(ou1p.y())-0.1*std::abs(in1p.y());
       float dist2=100*std::abs(ou2p.z()-in2p.z())-std::abs(ou2p.y())-0.1*std::abs(in2p.y());
       return dist1 < dist2;
     }
   }

Member Data Documentation

Definition at line 38 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by CompareHitPairsY(), and operator()().