CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
TransientTrackingRecHitBuilder
TTRHbuilder
 

Detailed Description

Definition at line 40 of file CosmicHitPairGeneratorFromLayerPair.h.

Constructor & Destructor Documentation

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

Definition at line 28 of file CosmicHitPairGeneratorFromLayerPair.cc.

28 {}

Member Function Documentation

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

Definition at line 29 of file CosmicHitPairGeneratorFromLayerPair.cc.

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

Definition at line 56 of file CosmicHitPairGeneratorFromLayerPair.h.

References theInnerLayer.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::outerLayer ( ) const
inline

Definition at line 57 of file CosmicHitPairGeneratorFromLayerPair.h.

References theOuterLayer.

Member Data Documentation

const DetLayer* CosmicHitPairGeneratorFromLayerPair::innerlay
private

Definition at line 64 of file CosmicHitPairGeneratorFromLayerPair.h.

const DetLayer* CosmicHitPairGeneratorFromLayerPair::outerlay
private

Definition at line 65 of file CosmicHitPairGeneratorFromLayerPair.h.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theInnerLayer
private

Definition at line 63 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and innerLayer().

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theOuterLayer
private

Definition at line 62 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and outerLayer().

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

Definition at line 60 of file CosmicHitPairGeneratorFromLayerPair.h.