CMS 3D CMS Logo

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

#include <CosmicHitPairGeneratorFromLayerPair.h>

Public Member Functions

 CosmicHitPairGeneratorFromLayerPair (const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup)
 
void hitPairs (const TrackingRegion &ar, OrderedHitPairs &ap, const edm::EventSetup &iSetup)
 
const LayerWithHitsinnerLayer () const
 
const LayerWithHitsouterLayer () const
 
 ~CosmicHitPairGeneratorFromLayerPair ()
 

Private Attributes

const DetLayerinnerlay
 
const DetLayerouterlay
 
const LayerWithHitstheInnerLayer
 
const LayerWithHitstheOuterLayer
 
const TrackerGeometrytrackerGeometry
 
const TransientTrackingRecHitBuilderTTRHbuilder
 

Detailed Description

Definition at line 38 of file CosmicHitPairGeneratorFromLayerPair.h.

Constructor & Destructor Documentation

◆ CosmicHitPairGeneratorFromLayerPair()

CosmicHitPairGeneratorFromLayerPair::CosmicHitPairGeneratorFromLayerPair ( const LayerWithHits inner,
const LayerWithHits outer,
const edm::EventSetup iSetup 
)

Definition at line 15 of file CosmicHitPairGeneratorFromLayerPair.cc.

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

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

◆ ~CosmicHitPairGeneratorFromLayerPair()

CosmicHitPairGeneratorFromLayerPair::~CosmicHitPairGeneratorFromLayerPair ( )

Definition at line 29 of file CosmicHitPairGeneratorFromLayerPair.cc.

29 {}

Member Function Documentation

◆ hitPairs()

void CosmicHitPairGeneratorFromLayerPair::hitPairs ( const TrackingRegion ar,
OrderedHitPairs ap,
const edm::EventSetup iSetup 
)

Definition at line 30 of file CosmicHitPairGeneratorFromLayerPair.cc.

32  {
33  // static int NSee = 0; static int Ntry = 0; static int Nacc = 0;
34 
35  typedef OrderedHitPair::InnerRecHit InnerHit;
36  typedef OrderedHitPair::OuterRecHit OuterHit;
37 
38  if (theInnerLayer->recHits().empty())
39  return;
40 
41  if (theOuterLayer->recHits().empty())
42  return;
43  // const DetLayer* innerlay=theOuterLayer->layer();
44  // const BarrelDetLayer *pippo=dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer());
45 
46  // ************ Daniele
47 
48  const DetLayer* blay1;
49  const DetLayer* blay2;
50  blay1 = dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer());
51  blay2 = dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer());
52 
53  bool seedfromoverlaps = false;
54  bool InTheBarrel = false;
55  bool InTheForward = false;
56  if (blay1 && blay2) {
57  InTheBarrel = true;
58  } else
59  InTheForward = true;
60 
61  if (InTheBarrel) {
62  float radius1 = dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer())->specificSurface().radius();
63  float radius2 = dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer())->specificSurface().radius();
64  seedfromoverlaps = (abs(radius1 - radius2) < 0.1) ? true : false;
65  }
66 
67  vector<OrderedHitPair> allthepairs;
68  std::string builderName = "WithTrackAngle";
70  iSetup.get<TransientRecHitRecord>().get(builderName, builder);
71 
72  for (auto ohh = theOuterLayer->recHits().begin(); ohh != theOuterLayer->recHits().end(); ohh++) {
73  for (auto ihh = theInnerLayer->recHits().begin(); ihh != theInnerLayer->recHits().end(); ihh++) {
74  auto oh = static_cast<BaseTrackerRecHit const* const>(*ohh);
75  auto ih = static_cast<BaseTrackerRecHit const* const>(*ihh);
76 
77  float z_diff = ih->globalPosition().z() - oh->globalPosition().z();
78  float inny = ih->globalPosition().y();
79  float outy = oh->globalPosition().y();
80  float innx = ih->globalPosition().x();
81  float outx = oh->globalPosition().x();
82  ;
83  float dxdy = abs((outx - innx) / (outy - inny));
84  float DeltaR = oh->globalPosition().perp() - ih->globalPosition().perp();
85  ;
86 
87  if (InTheBarrel &&
88  (abs(z_diff) < 30) // && (outy > 0.) && (inny > 0.)
89  //&&((abs(inny-outy))<30)
90  && (dxdy < 2) && (inny * outy > 0) && (abs(DeltaR) > 0)) {
91  // cout << " ******** sono dentro inthebarrel *********** " << endl;
92  if (seedfromoverlaps) {
93  //this part of code works for MTCC
94  // for the other geometries must be verified
95  //Overlaps in the difference in z is decreased and the difference in phi is
96  //less than 0.05
97  if ((DeltaR < 0) && (abs(z_diff) < 18) &&
98  (abs(ih->globalPosition().phi() - oh->globalPosition().phi()) < 0.05) && (dxdy < 2))
99  result.push_back(OrderedHitPair(ih, oh));
100  } else
101  result.push_back(OrderedHitPair(ih, oh));
102  }
103  if (InTheForward && (abs(z_diff) > 1.)) {
104  // cout << " ******** sono dentro intheforward *********** " << endl;
105  result.push_back(OrderedHitPair(ih, oh));
106  }
107  }
108  }
109 
110  // stable_sort(allthepairs.begin(),allthepairs.end(),CompareHitPairsY(iSetup));
111  // //Seed from overlaps are saved only if
112  // //no others have been saved
113 
114  // if (allthepairs.size()>0) {
115  // if (seedfromoverlaps) {
116  // if (result.size()==0) result.push_back(allthepairs[0]);
117  // }
118  // else result.push_back(allthepairs[0]);
119  // }
120 }

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

◆ innerLayer()

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::innerLayer ( ) const
inline

Definition at line 50 of file CosmicHitPairGeneratorFromLayerPair.h.

50 { return theInnerLayer; }

References theInnerLayer.

◆ outerLayer()

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::outerLayer ( ) const
inline

Definition at line 51 of file CosmicHitPairGeneratorFromLayerPair.h.

51 { return theOuterLayer; }

References theOuterLayer.

Member Data Documentation

◆ innerlay

const DetLayer* CosmicHitPairGeneratorFromLayerPair::innerlay
private

Definition at line 58 of file CosmicHitPairGeneratorFromLayerPair.h.

◆ outerlay

const DetLayer* CosmicHitPairGeneratorFromLayerPair::outerlay
private

Definition at line 59 of file CosmicHitPairGeneratorFromLayerPair.h.

◆ theInnerLayer

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theInnerLayer
private

Definition at line 57 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and innerLayer().

◆ theOuterLayer

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theOuterLayer
private

Definition at line 56 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and outerLayer().

◆ trackerGeometry

const TrackerGeometry* CosmicHitPairGeneratorFromLayerPair::trackerGeometry
private

◆ TTRHbuilder

const TransientTrackingRecHitBuilder* CosmicHitPairGeneratorFromLayerPair::TTRHbuilder
private

Definition at line 54 of file CosmicHitPairGeneratorFromLayerPair.h.

CosmicHitPairGeneratorFromLayerPair::TTRHbuilder
const TransientTrackingRecHitBuilder * TTRHbuilder
Definition: CosmicHitPairGeneratorFromLayerPair.h:54
LayerWithHits::layer
const DetLayer * layer() const
Definition: LayerWithHits.h:35
DetLayer
Definition: DetLayer.h:21
CosmicHitPairGeneratorFromLayerPair::theInnerLayer
const LayerWithHits * theInnerLayer
Definition: CosmicHitPairGeneratorFromLayerPair.h:57
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
OrderedHitPair::OuterRecHit
SeedingHitSet::ConstRecHitPointer OuterRecHit
Definition: OrderedHitPair.h:8
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
SurfaceOrientation::inner
Definition: Surface.h:19
CosmicHitPairGeneratorFromLayerPair::trackerGeometry
const TrackerGeometry * trackerGeometry
Definition: CosmicHitPairGeneratorFromLayerPair.h:55
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
funct::true
true
Definition: Factorize.h:173
DeltaR
Definition: DeltaR.py:1
get
#define get
OrderedHitPair::InnerRecHit
SeedingHitSet::ConstRecHitPointer InnerRecHit
Definition: OrderedHitPair.h:9
mps_fire.result
result
Definition: mps_fire.py:311
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