CMS 3D CMS Logo

CosmicHitPairGeneratorFromLayerPair.h
Go to the documentation of this file.
1 #ifndef CosmicHitPairGeneratorFromLayerPair_h
2 #define CosmicHitPairGeneratorFromLayerPair_h
3 
11 class DetLayer;
12 class TrackingRegion;
13 class LayerWithHits;
15 public:
17  bool operator()(const OrderedHitPair& h1, const OrderedHitPair& h2) {
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  }
34 
35 private:
37 };
39 public:
41  const LayerWithHits* outer,
42  const edm::EventSetup& iSetup);
44 
45  // virtual OrderedHitPairs hitPairs( const TrackingRegion& region,const edm::EventSetup& iSetup ) {
46  // return HitPairGenerator::hitPairs(region, iSetup);
47  // }
48  void hitPairs(const TrackingRegion& ar, OrderedHitPairs& ap, const edm::EventSetup& iSetup);
49 
50  const LayerWithHits* innerLayer() const { return theInnerLayer; }
51  const LayerWithHits* outerLayer() const { return theOuterLayer; }
52 
53 private:
60 };
61 
62 #endif
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
OrderedHitPairs
Definition: OrderedHitPairs.h:8
CosmicHitPairGeneratorFromLayerPair::TTRHbuilder
const TransientTrackingRecHitBuilder * TTRHbuilder
Definition: CosmicHitPairGeneratorFromLayerPair.h:54
CosmicHitPairGeneratorFromLayerPair
Definition: CosmicHitPairGeneratorFromLayerPair.h:38
TrackerGeometry.h
CompareHitPairsY::CompareHitPairsY
CompareHitPairsY(const edm::EventSetup &iSetup)
Definition: CosmicHitPairGeneratorFromLayerPair.h:16
ESHandle.h
DetLayer
Definition: DetLayer.h:21
CosmicHitPairGeneratorFromLayerPair::~CosmicHitPairGeneratorFromLayerPair
~CosmicHitPairGeneratorFromLayerPair()
Definition: CosmicHitPairGeneratorFromLayerPair.cc:29
CosmicHitPairGeneratorFromLayerPair::outerLayer
const LayerWithHits * outerLayer() const
Definition: CosmicHitPairGeneratorFromLayerPair.h:51
CosmicHitPairGeneratorFromLayerPair::theInnerLayer
const LayerWithHits * theInnerLayer
Definition: CosmicHitPairGeneratorFromLayerPair.h:57
CosmicHitPairGeneratorFromLayerPair::CosmicHitPairGeneratorFromLayerPair
CosmicHitPairGeneratorFromLayerPair(const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup)
Definition: CosmicHitPairGeneratorFromLayerPair.cc:15
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:73
SurfaceOrientation::inner
Definition: Surface.h:19
CosmicHitPairGeneratorFromLayerPair::trackerGeometry
const TrackerGeometry * trackerGeometry
Definition: CosmicHitPairGeneratorFromLayerPair.h:55
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
LayerWithHits.h
CosmicHitPairGeneratorFromLayerPair::innerLayer
const LayerWithHits * innerLayer() const
Definition: CosmicHitPairGeneratorFromLayerPair.h:50
edm::ESHandle< TrackerGeometry >
CosmicHitPairGeneratorFromLayerPair::hitPairs
void hitPairs(const TrackingRegion &ar, OrderedHitPairs &ap, const edm::EventSetup &iSetup)
Definition: CosmicHitPairGeneratorFromLayerPair.cc:30
CompareHitPairsY::tracker
edm::ESHandle< TrackerGeometry > tracker
Definition: CosmicHitPairGeneratorFromLayerPair.h:36
Point3DBase< float, GlobalTag >
OrderedHitPairs.h
TrackerDigiGeometryRecord.h
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
CompareHitPairsY::operator()
bool operator()(const OrderedHitPair &h1, const OrderedHitPair &h2)
Definition: CosmicHitPairGeneratorFromLayerPair.h:17
CompareHitPairsY
Definition: CosmicHitPairGeneratorFromLayerPair.h:14
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
TrackingRecHit
Definition: TrackingRecHit.h:21
CosmicHitPairGeneratorFromLayerPair::outerlay
const DetLayer * outerlay
Definition: CosmicHitPairGeneratorFromLayerPair.h:59
EventSetup.h
TrackingRegion
Definition: TrackingRegion.h:40
CosmicHitPairGeneratorFromLayerPair::innerlay
const DetLayer * innerlay
Definition: CosmicHitPairGeneratorFromLayerPair.h:58
TransientTrackingRecHitBuilder.h
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SurfaceOrientation::outer
Definition: Surface.h:19
OrderedHitPair
Definition: OrderedHitPair.h:6
CosmicHitPairGeneratorFromLayerPair::theOuterLayer
const LayerWithHits * theOuterLayer
Definition: CosmicHitPairGeneratorFromLayerPair.h:56
TransientTrackingRecHitBuilder
Definition: TransientTrackingRecHitBuilder.h:6
LayerWithHits
Definition: LayerWithHits.h:12
OrderedHitPair::outer
OuterRecHit outer() const
Definition: OrderedHitPair.h:15
TrackerGeometry
Definition: TrackerGeometry.h:14