CMS 3D CMS Logo

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

#include <CosmicHitTripletGeneratorFromLayerTriplet.h>

Public Member Functions

 CosmicHitTripletGeneratorFromLayerTriplet (const LayerWithHits *inner, const LayerWithHits *middle, const LayerWithHits *outer, const edm::EventSetup &iSetup)
 
void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap, const edm::EventSetup &iSetup)
 
const LayerWithHitsinnerLayer () const
 
const LayerWithHitsmiddleLayer () const
 
const LayerWithHitsouterLayer () const
 
 ~CosmicHitTripletGeneratorFromLayerTriplet ()
 

Private Attributes

const DetLayerinnerlay
 
const DetLayermiddlelay
 
const DetLayerouterlay
 
const LayerWithHitstheInnerLayer
 
const LayerWithHitstheMiddleLayer
 
const LayerWithHitstheOuterLayer
 
const TrackerGeometrytrackerGeometry
 
const TransientTrackingRecHitBuilderTTRHbuilder
 

Detailed Description

Definition at line 16 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Constructor & Destructor Documentation

◆ CosmicHitTripletGeneratorFromLayerTriplet()

CosmicHitTripletGeneratorFromLayerTriplet::CosmicHitTripletGeneratorFromLayerTriplet ( const LayerWithHits inner,
const LayerWithHits middle,
const LayerWithHits outer,
const edm::EventSetup iSetup 
)

Definition at line 16 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

20  : TTRHbuilder(nullptr),
21  trackerGeometry(nullptr),
22  //theLayerCache(*layerCache),
24  theMiddleLayer(middle),
28  trackerGeometry = tracker.product();
29 }

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

◆ ~CosmicHitTripletGeneratorFromLayerTriplet()

CosmicHitTripletGeneratorFromLayerTriplet::~CosmicHitTripletGeneratorFromLayerTriplet ( )
inline

Definition at line 22 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

22 {}

Member Function Documentation

◆ hitTriplets()

void CosmicHitTripletGeneratorFromLayerTriplet::hitTriplets ( const TrackingRegion ar,
OrderedHitTriplets ap,
const edm::EventSetup iSetup 
)

Definition at line 30 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

32  {
33  if (theInnerLayer->recHits().empty())
34  return;
35  if (theMiddleLayer->recHits().empty())
36  return;
37  if (theOuterLayer->recHits().empty())
38  return;
39  float radius1 = dynamic_cast<const BarrelDetLayer *>(theInnerLayer->layer())->specificSurface().radius();
40  float radius2 = dynamic_cast<const BarrelDetLayer *>(theMiddleLayer->layer())->specificSurface().radius();
41  float radius3 = dynamic_cast<const BarrelDetLayer *>(theOuterLayer->layer())->specificSurface().radius();
42  bool seedfromoverlaps = ((std::abs(radius1 - radius2) < 0.1) || (std::abs(radius3 - radius2) < 0.1)) ? true : false;
43  std::vector<const TrackingRecHit *>::const_iterator ohh;
44  std::vector<const TrackingRecHit *>::const_iterator mhh;
45  std::vector<const TrackingRecHit *>::const_iterator ihh;
46 
47  std::string builderName = "WithTrackAngle";
49  iSetup.get<TransientRecHitRecord>().get(builderName, builder);
50 
51  if (!seedfromoverlaps) {
52  for (ohh = theOuterLayer->recHits().begin(); ohh != theOuterLayer->recHits().end(); ohh++) {
53  auto oh = (BaseTrackerRecHit const *)(&*ohh);
54  for (mhh = theMiddleLayer->recHits().begin(); mhh != theMiddleLayer->recHits().end(); mhh++) {
55  auto mh = (BaseTrackerRecHit const *)(&*mhh);
56  float z_diff = mh->globalPosition().z() - oh->globalPosition().z();
57  float midy = mh->globalPosition().y();
58  float outy = oh->globalPosition().y();
59  float midx = mh->globalPosition().x();
60  float outx = oh->globalPosition().x();
61  float dxdy = std::abs((outx - midx) / (outy - midy));
62  if ((std::abs(z_diff) < 30) && (outy * midy > 0) && (dxdy < 2)) {
63  for (ihh = theInnerLayer->recHits().begin(); ihh != theInnerLayer->recHits().end(); ihh++) {
64  auto ih = (BaseTrackerRecHit const *)(&*ihh);
65  float z_diff = mh->globalPosition().z() - ih->globalPosition().z();
66  float inny = ih->globalPosition().y();
67  float innx = ih->globalPosition().x();
68  float dxdy = std::abs((innx - midx) / (inny - midy));
69  if ((std::abs(z_diff) < 30) && (inny * midy > 0) && (dxdy < 2) && (!seedfromoverlaps)) {
70  result.push_back(OrderedHitTriplet(ih, mh, oh));
71  }
72  }
73  }
74  }
75  }
76  } else {
77  for (ohh = theOuterLayer->recHits().begin(); ohh != theOuterLayer->recHits().end(); ohh++) {
78  auto oh = (BaseTrackerRecHit const *)(&*ohh);
79  for (mhh = theMiddleLayer->recHits().begin(); mhh != theMiddleLayer->recHits().end(); mhh++) {
80  auto mh = (BaseTrackerRecHit const *)(&*mhh);
81  float z_diff = mh->globalPosition().z() - oh->globalPosition().z();
82  float midy = mh->globalPosition().y();
83  float outy = oh->globalPosition().y();
84  float midx = mh->globalPosition().x();
85  float outx = oh->globalPosition().x();
86  float dxdy = std::abs((outx - midx) / (outy - midy));
87  float DeltaR = oh->globalPosition().perp() - mh->globalPosition().perp();
88  if ((std::abs(z_diff) < 18) && (std::abs(oh->globalPosition().phi() - mh->globalPosition().phi()) < 0.05) &&
89  (DeltaR < 0) && (dxdy < 2)) {
90  for (ihh = theInnerLayer->recHits().begin(); ihh != theInnerLayer->recHits().end(); ihh++) {
91  auto ih = (BaseTrackerRecHit const *)(&*ihh);
92  float z_diff = mh->globalPosition().z() - ih->globalPosition().z();
93  float inny = ih->globalPosition().y();
94  float innx = ih->globalPosition().x();
95  float dxdy = std::abs((innx - midx) / (inny - midy));
96  if ((std::abs(z_diff) < 30) && (inny * midy > 0) && (dxdy < 2)) {
97  result.push_back(OrderedHitTriplet(ih, mh, oh));
98  }
99  }
100  }
101  }
102  }
103  }
104 }

References funct::abs(), edm::EventSetup::get(), get, LayerWithHits::layer(), LayerWithHits::recHits(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theInnerLayer, theMiddleLayer, and theOuterLayer.

◆ innerLayer()

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::innerLayer ( ) const
inline

Definition at line 26 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

26 { return theInnerLayer; }

References theInnerLayer.

◆ middleLayer()

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::middleLayer ( ) const
inline

Definition at line 27 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

27 { return theMiddleLayer; }

References theMiddleLayer.

◆ outerLayer()

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::outerLayer ( ) const
inline

Definition at line 28 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

28 { return theOuterLayer; }

References theOuterLayer.

Member Data Documentation

◆ innerlay

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::innerlay
private

Definition at line 36 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

◆ middlelay

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::middlelay
private

Definition at line 38 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

◆ outerlay

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::outerlay
private

Definition at line 37 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

◆ theInnerLayer

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theInnerLayer
private

Definition at line 35 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and innerLayer().

◆ theMiddleLayer

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theMiddleLayer
private

Definition at line 34 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and middleLayer().

◆ theOuterLayer

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theOuterLayer
private

Definition at line 33 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and outerLayer().

◆ trackerGeometry

const TrackerGeometry* CosmicHitTripletGeneratorFromLayerTriplet::trackerGeometry
private

◆ TTRHbuilder

const TransientTrackingRecHitBuilder* CosmicHitTripletGeneratorFromLayerTriplet::TTRHbuilder
private

Definition at line 31 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

CosmicHitTripletGeneratorFromLayerTriplet::TTRHbuilder
const TransientTrackingRecHitBuilder * TTRHbuilder
Definition: CosmicHitTripletGeneratorFromLayerTriplet.h:31
LayerWithHits::layer
const DetLayer * layer() const
Definition: LayerWithHits.h:35
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
CosmicHitTripletGeneratorFromLayerTriplet::theMiddleLayer
const LayerWithHits * theMiddleLayer
Definition: CosmicHitTripletGeneratorFromLayerTriplet.h:34
CosmicHitTripletGeneratorFromLayerTriplet::trackerGeometry
const TrackerGeometry * trackerGeometry
Definition: CosmicHitTripletGeneratorFromLayerTriplet.h:32
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
SurfaceOrientation::inner
Definition: Surface.h:19
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
edm::ESHandle< TrackerGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
LayerWithHits::recHits
const std::vector< const TrackingRecHit * > & recHits() const
return the recHits of the Layer
Definition: LayerWithHits.h:32
DeltaR
Definition: DeltaR.py:1
CosmicHitTripletGeneratorFromLayerTriplet::theInnerLayer
const LayerWithHits * theInnerLayer
Definition: CosmicHitTripletGeneratorFromLayerTriplet.h:35
get
#define get
CosmicHitTripletGeneratorFromLayerTriplet::theOuterLayer
const LayerWithHits * theOuterLayer
Definition: CosmicHitTripletGeneratorFromLayerTriplet.h:33
OrderedHitTriplet
Definition: OrderedHitTriplet.h:11
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SurfaceOrientation::outer
Definition: Surface.h:19