CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 TrackerGeometry &trackGeom)
 
void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap)
 
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
 

Detailed Description

Definition at line 16 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Constructor & Destructor Documentation

CosmicHitTripletGeneratorFromLayerTriplet::CosmicHitTripletGeneratorFromLayerTriplet ( const LayerWithHits inner,
const LayerWithHits middle,
const LayerWithHits outer,
const TrackerGeometry trackGeom 
)
CosmicHitTripletGeneratorFromLayerTriplet::~CosmicHitTripletGeneratorFromLayerTriplet ( )
inline

Definition at line 22 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

22 {}

Member Function Documentation

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

Definition at line 21 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

References funct::abs(), LayerWithHits::layer(), LayerWithHits::recHits(), theInnerLayer, theMiddleLayer, and theOuterLayer.

21  {
22  if (theInnerLayer->recHits().empty())
23  return;
24  if (theMiddleLayer->recHits().empty())
25  return;
26  if (theOuterLayer->recHits().empty())
27  return;
28  float radius1 = dynamic_cast<const BarrelDetLayer *>(theInnerLayer->layer())->specificSurface().radius();
29  float radius2 = dynamic_cast<const BarrelDetLayer *>(theMiddleLayer->layer())->specificSurface().radius();
30  float radius3 = dynamic_cast<const BarrelDetLayer *>(theOuterLayer->layer())->specificSurface().radius();
31  bool seedfromoverlaps = ((std::abs(radius1 - radius2) < 0.1) || (std::abs(radius3 - radius2) < 0.1)) ? true : false;
32  std::vector<const TrackingRecHit *>::const_iterator ohh;
33  std::vector<const TrackingRecHit *>::const_iterator mhh;
34  std::vector<const TrackingRecHit *>::const_iterator ihh;
35 
36  if (!seedfromoverlaps) {
37  for (ohh = theOuterLayer->recHits().begin(); ohh != theOuterLayer->recHits().end(); ohh++) {
38  auto oh = (BaseTrackerRecHit const *)(&*ohh);
39  for (mhh = theMiddleLayer->recHits().begin(); mhh != theMiddleLayer->recHits().end(); mhh++) {
40  auto mh = (BaseTrackerRecHit const *)(&*mhh);
41  float z_diff = mh->globalPosition().z() - oh->globalPosition().z();
42  float midy = mh->globalPosition().y();
43  float outy = oh->globalPosition().y();
44  float midx = mh->globalPosition().x();
45  float outx = oh->globalPosition().x();
46  float dxdy = std::abs((outx - midx) / (outy - midy));
47  if ((std::abs(z_diff) < 30) && (outy * midy > 0) && (dxdy < 2)) {
48  for (ihh = theInnerLayer->recHits().begin(); ihh != theInnerLayer->recHits().end(); ihh++) {
49  auto ih = (BaseTrackerRecHit const *)(&*ihh);
50  float z_diff = mh->globalPosition().z() - ih->globalPosition().z();
51  float inny = ih->globalPosition().y();
52  float innx = ih->globalPosition().x();
53  float dxdy = std::abs((innx - midx) / (inny - midy));
54  if ((std::abs(z_diff) < 30) && (inny * midy > 0) && (dxdy < 2) && (!seedfromoverlaps)) {
55  result.push_back(OrderedHitTriplet(ih, mh, oh));
56  }
57  }
58  }
59  }
60  }
61  } else {
62  for (ohh = theOuterLayer->recHits().begin(); ohh != theOuterLayer->recHits().end(); ohh++) {
63  auto oh = (BaseTrackerRecHit const *)(&*ohh);
64  for (mhh = theMiddleLayer->recHits().begin(); mhh != theMiddleLayer->recHits().end(); mhh++) {
65  auto mh = (BaseTrackerRecHit const *)(&*mhh);
66  float z_diff = mh->globalPosition().z() - oh->globalPosition().z();
67  float midy = mh->globalPosition().y();
68  float outy = oh->globalPosition().y();
69  float midx = mh->globalPosition().x();
70  float outx = oh->globalPosition().x();
71  float dxdy = std::abs((outx - midx) / (outy - midy));
72  float DeltaR = oh->globalPosition().perp() - mh->globalPosition().perp();
73  if ((std::abs(z_diff) < 18) && (std::abs(oh->globalPosition().phi() - mh->globalPosition().phi()) < 0.05) &&
74  (DeltaR < 0) && (dxdy < 2)) {
75  for (ihh = theInnerLayer->recHits().begin(); ihh != theInnerLayer->recHits().end(); ihh++) {
76  auto ih = (BaseTrackerRecHit const *)(&*ihh);
77  float z_diff = mh->globalPosition().z() - ih->globalPosition().z();
78  float inny = ih->globalPosition().y();
79  float innx = ih->globalPosition().x();
80  float dxdy = std::abs((innx - midx) / (inny - midy));
81  if ((std::abs(z_diff) < 30) && (inny * midy > 0) && (dxdy < 2)) {
82  result.push_back(OrderedHitTriplet(ih, mh, oh));
83  }
84  }
85  }
86  }
87  }
88  }
89 }
const DetLayer * layer() const
Definition: LayerWithHits.h:35
Definition: deltaR.h:58
tuple result
Definition: mps_fire.py:311
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const std::vector< const TrackingRecHit * > & recHits() const
return the recHits of the Layer
Definition: LayerWithHits.h:32
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::innerLayer ( ) const
inline
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::middleLayer ( ) const
inline
const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::outerLayer ( ) const
inline

Member Data Documentation

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::innerlay
private

Definition at line 35 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::middlelay
private

Definition at line 37 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::outerlay
private

Definition at line 36 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theInnerLayer
private

Definition at line 34 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and innerLayer().

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theMiddleLayer
private

Definition at line 33 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and middleLayer().

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theOuterLayer
private

Definition at line 32 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and outerLayer().

const TrackerGeometry* CosmicHitTripletGeneratorFromLayerTriplet::trackerGeometry
private

Definition at line 31 of file CosmicHitTripletGeneratorFromLayerTriplet.h.