CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CompareHitPairsY Class Reference

#include <CosmicHitPairGeneratorFromLayerPair.h>

Public Member Functions

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

Private Attributes

edm::ESHandle< TrackerGeometrytracker
 

Detailed Description

Definition at line 14 of file CosmicHitPairGeneratorFromLayerPair.h.

Constructor & Destructor Documentation

◆ CompareHitPairsY()

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

Definition at line 16 of file CosmicHitPairGeneratorFromLayerPair.h.

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

Member Function Documentation

◆ operator()()

bool CompareHitPairsY::operator() ( const OrderedHitPair h1,
const OrderedHitPair h2 
)
inline

Definition at line 17 of file CosmicHitPairGeneratorFromLayerPair.h.

17  {
18  const TrackingRecHit* trh1i = h1.inner()->hit();
19  const TrackingRecHit* trh2i = h2.inner()->hit();
20  const TrackingRecHit* trh1o = h1.outer()->hit();
21  const TrackingRecHit* trh2o = h2.outer()->hit();
22  GlobalPoint in1p = tracker->idToDet(trh1i->geographicalId())->surface().toGlobal(trh1i->localPosition());
23  GlobalPoint in2p = tracker->idToDet(trh2i->geographicalId())->surface().toGlobal(trh2i->localPosition());
24  GlobalPoint ou1p = tracker->idToDet(trh1o->geographicalId())->surface().toGlobal(trh1o->localPosition());
25  GlobalPoint ou2p = tracker->idToDet(trh2o->geographicalId())->surface().toGlobal(trh2o->localPosition());
26  if (ou1p.y() * ou2p.y() < 0)
27  return ou1p.y() > ou2p.y();
28  else {
29  float dist1 = 100 * std::abs(ou1p.z() - in1p.z()) - std::abs(ou1p.y()) - 0.1 * std::abs(in1p.y());
30  float dist2 = 100 * std::abs(ou2p.z() - in2p.z()) - std::abs(ou2p.y()) - 0.1 * std::abs(in2p.y());
31  return dist1 < dist2;
32  }
33  }

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

Member Data Documentation

◆ tracker

edm::ESHandle<TrackerGeometry> CompareHitPairsY::tracker
private

Definition at line 36 of file CosmicHitPairGeneratorFromLayerPair.h.

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

TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
TrackingRecHit::localPosition
virtual LocalPoint localPosition() const =0
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition: TrackingRecHit.h:120
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
CompareHitPairsY::tracker
edm::ESHandle< TrackerGeometry > tracker
Definition: CosmicHitPairGeneratorFromLayerPair.h:36
Point3DBase< float, GlobalTag >
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
OrderedHitPair::inner
InnerRecHit inner() const
Definition: OrderedHitPair.h:14
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
get
#define get
TrackingRecHit
Definition: TrackingRecHit.h:21
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
OrderedHitPair::outer
OuterRecHit outer() const
Definition: OrderedHitPair.h:15