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>

Inheritance diagram for CosmicHitPairGeneratorFromLayerPair:
HitPairGenerator OrderedHitsGenerator

Public Member Functions

virtual
CosmicHitPairGeneratorFromLayerPair
clone () const
 
 CosmicHitPairGeneratorFromLayerPair (const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup)
 
virtual void hitPairs (const TrackingRegion &ar, OrderedHitPairs &ap, const edm::EventSetup &iSetup)
 
virtual void hitPairs (const TrackingRegion &ar, OrderedHitPairs &ap, const edm::Event &ev, const edm::EventSetup &iSetup)
 
const LayerWithHitsinnerLayer () const
 
const LayerWithHitsouterLayer () const
 
void setSeedingLayers (SeedingLayerSetsHits::SeedingLayerSet layers) override
 
virtual ~CosmicHitPairGeneratorFromLayerPair ()
 
- Public Member Functions inherited from HitPairGenerator
virtual void clear ()
 
virtual HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es)
 
 HitPairGenerator (unsigned int size=7500)
 
virtual const OrderedHitPairsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~HitPairGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Attributes

const DetLayerinnerlay
 
const DetLayerouterlay
 
const LayerWithHitstheInnerLayer
 
const LayerWithHitstheOuterLayer
 
const TrackerGeometrytrackerGeometry
 
const
TransientTrackingRecHitBuilder
TTRHbuilder
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

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 
)
virtual CosmicHitPairGeneratorFromLayerPair::~CosmicHitPairGeneratorFromLayerPair ( )
inlinevirtual

Definition at line 49 of file CosmicHitPairGeneratorFromLayerPair.h.

49 { }

Member Function Documentation

virtual CosmicHitPairGeneratorFromLayerPair* CosmicHitPairGeneratorFromLayerPair::clone ( void  ) const
inlinevirtual

Implements HitPairGenerator.

Definition at line 60 of file CosmicHitPairGeneratorFromLayerPair.h.

References CosmicHitPairGeneratorFromLayerPair().

60  {
61  return new CosmicHitPairGeneratorFromLayerPair(*this);
62  }
CosmicHitPairGeneratorFromLayerPair(const LayerWithHits *inner, const LayerWithHits *outer, const edm::EventSetup &iSetup)
void CosmicHitPairGeneratorFromLayerPair::hitPairs ( const TrackingRegion ar,
OrderedHitPairs ap,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from HitPairGenerator.

Definition at line 29 of file CosmicHitPairGeneratorFromLayerPair.cc.

References funct::abs(), 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  std::vector<const TrackingRecHit*>::const_iterator ohh;
77  for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){
78  TkHitPairsCachedHit oh= builder->build(*ohh);
79  std::vector<const TrackingRecHit*>::const_iterator ihh;
80  for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){
81  TkHitPairsCachedHit ih= builder->build(*ihh);
82 
83  float z_diff =ih->globalPosition().z()-oh->globalPosition().z();
84  float inny=ih->globalPosition().y();
85  float outy=oh->globalPosition().y();
86  float innx=ih->globalPosition().x();
87  float outx=oh->globalPosition().x();;
88  float dxdy=abs((outx-innx)/(outy-inny));
89  float DeltaR=oh->globalPosition().perp()-ih->globalPosition().perp();;
90 
91  if( InTheBarrel && (abs(z_diff)<30) // && (outy > 0.) && (inny > 0.)
92  //&&((abs(inny-outy))<30)
93  &&(dxdy<2)
94  &&(inny*outy>0)
95  && (abs(DeltaR)>0)) {
96 
97  // cout << " ******** sono dentro inthebarrel *********** " << endl;
98  if (seedfromoverlaps){
99  //this part of code works for MTCC
100  // for the other geometries must be verified
101  //Overlaps in the difference in z is decreased and the difference in phi is
102  //less than 0.05
103  if ((DeltaR<0)&&(abs(z_diff)<18)&&(abs(ih->globalPosition().phi()-oh->globalPosition().phi())<0.05)&&(dxdy<2)) result.push_back( OrderedHitPair(ih, oh));
104  }
105  else result.push_back( OrderedHitPair( ih, oh));
106 
107 
108 
109 
110  }
111  if( InTheForward && (abs(z_diff) > 1.)) {
112  // cout << " ******** sono dentro intheforward *********** " << endl;
113  result.push_back( OrderedHitPair(ih,oh));
114  }
115  }
116  }
117 
118 // stable_sort(allthepairs.begin(),allthepairs.end(),CompareHitPairsY(iSetup));
119 // //Seed from overlaps are saved only if
120 // //no others have been saved
121 
122 // if (allthepairs.size()>0) {
123 // if (seedfromoverlaps) {
124 // if (result.size()==0) result.push_back(allthepairs[0]);
125 // }
126 // else result.push_back(allthepairs[0]);
127 // }
128 
129 
130 }
const DetLayer * layer() const
Definition: LayerWithHits.h:38
Definition: deltaR.h:79
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const T & get() const
Definition: EventSetup.h:55
const std::vector< const TrackingRecHit * > & recHits() const
return the recHits of the Layer
Definition: LayerWithHits.h:35
virtual void CosmicHitPairGeneratorFromLayerPair::hitPairs ( const TrackingRegion ar,
OrderedHitPairs ap,
const edm::Event ev,
const edm::EventSetup iSetup 
)
inlinevirtual

Implements HitPairGenerator.

Definition at line 58 of file CosmicHitPairGeneratorFromLayerPair.h.

58 {}
const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::innerLayer ( ) const
inline

Definition at line 64 of file CosmicHitPairGeneratorFromLayerPair.h.

References theInnerLayer.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::outerLayer ( ) const
inline

Definition at line 65 of file CosmicHitPairGeneratorFromLayerPair.h.

References theOuterLayer.

void CosmicHitPairGeneratorFromLayerPair::setSeedingLayers ( SeedingLayerSetsHits::SeedingLayerSet  layers)
inlineoverridevirtual

Implements HitPairGenerator.

Definition at line 51 of file CosmicHitPairGeneratorFromLayerPair.h.

51 {}

Member Data Documentation

const DetLayer* CosmicHitPairGeneratorFromLayerPair::innerlay
private

Definition at line 72 of file CosmicHitPairGeneratorFromLayerPair.h.

const DetLayer* CosmicHitPairGeneratorFromLayerPair::outerlay
private

Definition at line 73 of file CosmicHitPairGeneratorFromLayerPair.h.

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theInnerLayer
private

Definition at line 71 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and innerLayer().

const LayerWithHits* CosmicHitPairGeneratorFromLayerPair::theOuterLayer
private

Definition at line 70 of file CosmicHitPairGeneratorFromLayerPair.h.

Referenced by hitPairs(), and outerLayer().

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

Definition at line 68 of file CosmicHitPairGeneratorFromLayerPair.h.