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 ( const LayerWithHits inner,
const LayerWithHits outer,
const edm::EventSetup iSetup 
)
CosmicHitPairGeneratorFromLayerPair::~CosmicHitPairGeneratorFromLayerPair ( )

Definition at line 29 of file CosmicHitPairGeneratorFromLayerPair.cc.

29 {}

Member Function Documentation

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

Definition at line 30 of file CosmicHitPairGeneratorFromLayerPair.cc.

References funct::abs(), watchdog::const, edm::EventSetup::get(), LayerWithHits::layer(), LayerWithHits::recHits(), AlCaHLTBitMon_QueryRunRegistry::string, theInnerLayer, and theOuterLayer.

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 }
Definition: DeltaR.py:1
const DetLayer * layer() const
Definition: LayerWithHits.h:35
SeedingHitSet::ConstRecHitPointer InnerRecHit
Definition: OrderedHitPair.h:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T get() const
Definition: EventSetup.h:73
const std::vector< const TrackingRecHit * > & recHits() const
return the recHits of the Layer
Definition: LayerWithHits.h:32
SeedingHitSet::ConstRecHitPointer OuterRecHit
Definition: OrderedHitPair.h:8
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::innerLayer ( ) const
inline

Definition at line 50 of file CosmicHitPairGeneratorFromLayerPair.h.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::outerLayer ( ) const
inline

Definition at line 51 of file CosmicHitPairGeneratorFromLayerPair.h.

Member Data Documentation

const DetLayer* CosmicHitPairGeneratorFromLayerPair::innerlay
private

Definition at line 58 of file CosmicHitPairGeneratorFromLayerPair.h.

const DetLayer* CosmicHitPairGeneratorFromLayerPair::outerlay
private

Definition at line 59 of file CosmicHitPairGeneratorFromLayerPair.h.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theInnerLayer
private

Definition at line 57 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs().

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theOuterLayer
private

Definition at line 56 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs().

const TrackerGeometry* CosmicHitPairGeneratorFromLayerPair::trackerGeometry
private
const TransientTrackingRecHitBuilder* CosmicHitPairGeneratorFromLayerPair::TTRHbuilder
private

Definition at line 54 of file CosmicHitPairGeneratorFromLayerPair.h.