CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
18  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);};
19  bool operator()( const OrderedHitPair& h1,
20  const OrderedHitPair& h2)
21  {
22  const TrackingRecHit * trh1i = h1.inner()->hit();
23  const TrackingRecHit * trh2i = h2.inner()->hit();
24  const TrackingRecHit * trh1o = h1.outer()->hit();
25  const TrackingRecHit * trh2o = h2.outer()->hit();
26  GlobalPoint in1p=tracker->idToDet(trh1i->geographicalId())->surface().toGlobal(trh1i->localPosition());
27  GlobalPoint in2p=tracker->idToDet(trh2i->geographicalId())->surface().toGlobal(trh2i->localPosition());
28  GlobalPoint ou1p=tracker->idToDet(trh1o->geographicalId())->surface().toGlobal(trh1o->localPosition());
29  GlobalPoint ou2p=tracker->idToDet(trh2o->geographicalId())->surface().toGlobal(trh2o->localPosition());
30  if (ou1p.y()*ou2p.y()<0) return ou1p.y()>ou2p.y();
31  else{
32  float dist1=100*std::abs(ou1p.z()-in1p.z())-std::abs(ou1p.y())-0.1*std::abs(in1p.y());
33  float dist2=100*std::abs(ou2p.z()-in2p.z())-std::abs(ou2p.y())-0.1*std::abs(in2p.y());
34  return dist1 < dist2;
35  }
36  }
37  private:
39  };
41 
42 public:
43 
44 
46  const LayerWithHits* inner,
47  const LayerWithHits* outer,
48  const edm::EventSetup& iSetup);
50 
52 
53 // virtual OrderedHitPairs hitPairs( const TrackingRegion& region,const edm::EventSetup& iSetup ) {
54 // return HitPairGenerator::hitPairs(region, iSetup);
55 // }
56  virtual void hitPairs( const TrackingRegion& ar, OrderedHitPairs & ap, const edm::EventSetup& iSetup);
57 
58  virtual void hitPairs( const TrackingRegion& ar, OrderedHitPairs & ap, const edm::Event & ev, const edm::EventSetup& iSetup) {}
59 
61  return new CosmicHitPairGeneratorFromLayerPair(*this);
62  }
63 
64  const LayerWithHits* innerLayer() const { return theInnerLayer; }
65  const LayerWithHits* outerLayer() const { return theOuterLayer; }
66 
67 private:
74 
75 };
76 
77 #endif
virtual CosmicHitPairGeneratorFromLayerPair * clone() const
const TransientTrackingRecHitBuilder * TTRHbuilder
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
virtual void hitPairs(const TrackingRegion &ar, OrderedHitPairs &ap, const edm::Event &ev, const edm::EventSetup &iSetup)
const InnerRecHit & inner() const
bool operator()(const OrderedHitPair &h1, const OrderedHitPair &h2)
T y() const
Definition: PV3DBase.h:63
CompareHitPairsY(const edm::EventSetup &iSetup)
const OuterRecHit & outer() const
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::ESHandle< TrackerGeometry > tracker
const T & get() const
Definition: EventSetup.h:55
virtual void hitPairs(const TrackingRegion &ar, OrderedHitPairs &ap, const edm::EventSetup &iSetup)
DetId geographicalId() const
void setSeedingLayers(SeedingLayerSetsHits::SeedingLayerSet layers) override
virtual LocalPoint localPosition() const =0
CosmicHitPairGeneratorFromLayerPair(const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup)