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
CosmicHitTripletGeneratorFromLayerTriplet Class Reference

#include <CosmicHitTripletGeneratorFromLayerTriplet.h>

Inheritance diagram for CosmicHitTripletGeneratorFromLayerTriplet:
HitTripletGenerator OrderedHitsGenerator

Public Member Functions

virtual
CosmicHitTripletGeneratorFromLayerTriplet
clone () const
 
 CosmicHitTripletGeneratorFromLayerTriplet (const LayerWithHits *inner, const LayerWithHits *middle, const LayerWithHits *outer, const edm::EventSetup &iSetup)
 
virtual void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap, const edm::EventSetup &iSetup)
 
virtual void hitTriplets (const TrackingRegion &ar, OrderedHitTriplets &ap, const edm::Event &ev, const edm::EventSetup &iSetup)
 
void init (const HitPairGenerator &pairs, const std::vector< const LayerWithHits * > &layers)
 
const LayerWithHitsinnerLayer () const
 
const LayerWithHitsmiddleLayer () const
 
const LayerWithHitsouterLayer () const
 
virtual ~CosmicHitTripletGeneratorFromLayerTriplet ()
 
- Public Member Functions inherited from HitTripletGenerator
virtual void clear ()
 
 HitTripletGenerator (unsigned int size=500)
 
virtual const OrderedHitTripletsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~HitTripletGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Attributes

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

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 17 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Constructor & Destructor Documentation

CosmicHitTripletGeneratorFromLayerTriplet::CosmicHitTripletGeneratorFromLayerTriplet ( const LayerWithHits inner,
const LayerWithHits middle,
const LayerWithHits outer,
const edm::EventSetup iSetup 
)

Definition at line 17 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

References edm::EventSetup::get(), edm::ESHandle< class >::product(), and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by clone().

virtual CosmicHitTripletGeneratorFromLayerTriplet::~CosmicHitTripletGeneratorFromLayerTriplet ( )
inlinevirtual

Definition at line 27 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

27 { }

Member Function Documentation

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

Definition at line 33 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

References CosmicHitTripletGeneratorFromLayerTriplet().

33  {
35  }
CosmicHitTripletGeneratorFromLayerTriplet(const LayerWithHits *inner, const LayerWithHits *middle, const LayerWithHits *outer, const edm::EventSetup &iSetup)
void CosmicHitTripletGeneratorFromLayerTriplet::hitTriplets ( const TrackingRegion ar,
OrderedHitTriplets ap,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from HitTripletGenerator.

Definition at line 30 of file CosmicHitTripletGeneratorFromLayerTriplet.cc.

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

33 {
34 
35  if (theInnerLayer->recHits().empty()) return;
36  if (theMiddleLayer->recHits().empty()) return;
37  if (theOuterLayer->recHits().empty()) return;
38  float radius1 =dynamic_cast<const BarrelDetLayer*>(theInnerLayer->layer())->specificSurface().radius();
39  float radius2 =dynamic_cast<const BarrelDetLayer*>(theMiddleLayer->layer())->specificSurface().radius();
40  float radius3 =dynamic_cast<const BarrelDetLayer*>(theOuterLayer->layer())->specificSurface().radius();
41  bool seedfromoverlaps=((std::abs(radius1-radius2)<0.1)|| (std::abs(radius3-radius2)<0.1))? true : false;
42  std::vector<const TrackingRecHit*>::const_iterator ohh;
43  std::vector<const TrackingRecHit*>::const_iterator mhh;
44  std::vector<const TrackingRecHit*>::const_iterator ihh;
45 
46  std::string builderName = "WithTrackAngle";
48  iSetup.get<TransientRecHitRecord>().get(builderName, builder);
49 
50  if(!seedfromoverlaps){
51  for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){
52  auto oh= (BaseTrackerRecHit const *)(&*ohh);
53  for(mhh=theMiddleLayer->recHits().begin();mhh!=theMiddleLayer->recHits().end();mhh++){
54  auto mh= (BaseTrackerRecHit const *)(&*mhh);
55  float z_diff =mh->globalPosition().z()-oh->globalPosition().z();
56  float midy=mh->globalPosition().y();
57  float outy=oh->globalPosition().y();
58  float midx=mh->globalPosition().x();
59  float outx=oh->globalPosition().x();
60  float dxdy=std::abs((outx-midx)/(outy-midy));
61  if((std::abs(z_diff)<30) && (outy*midy>0) &&(dxdy<2))
62  {
63  for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){
64  auto ih= (BaseTrackerRecHit const *)(&*ihh);
65  float z_diff =mh->globalPosition().z()-ih->globalPosition().z();
66  float inny=ih->globalPosition().y();
67  float innx=ih->globalPosition().x();
68  float dxdy=std::abs((innx-midx)/(inny-midy));
69  if ((std::abs(z_diff)<30) && (inny*midy>0) &&(dxdy<2)&&(!seedfromoverlaps))
70  {
71  result.push_back( OrderedHitTriplet(ih,mh,oh) );
72  }
73  }
74  }
75  }
76  }
77  } else {
78  for(ohh=theOuterLayer->recHits().begin();ohh!=theOuterLayer->recHits().end();ohh++){
79  auto oh= (BaseTrackerRecHit const *)(&*ohh);
80  for(mhh=theMiddleLayer->recHits().begin();mhh!=theMiddleLayer->recHits().end();mhh++){
81  auto mh= (BaseTrackerRecHit const *)(&*mhh);
82  float z_diff =mh->globalPosition().z()-oh->globalPosition().z();
83  float midy=mh->globalPosition().y();
84  float outy=oh->globalPosition().y();
85  float midx=mh->globalPosition().x();
86  float outx=oh->globalPosition().x();
87  float dxdy=std::abs((outx-midx)/(outy-midy));
88  float DeltaR=oh->globalPosition().perp()-mh->globalPosition().perp();
89  if((std::abs(z_diff)<18) && (std::abs(oh->globalPosition().phi()-mh->globalPosition().phi())<0.05) &&(DeltaR<0)&&(dxdy<2)){
90  for(ihh=theInnerLayer->recHits().begin();ihh!=theInnerLayer->recHits().end();ihh++){
91  auto ih= (BaseTrackerRecHit const *)(&*ihh);
92  float z_diff =mh->globalPosition().z()-ih->globalPosition().z();
93  float inny=ih->globalPosition().y();
94  float innx=ih->globalPosition().x();
95  float dxdy=std::abs((innx-midx)/(inny-midy));
96  if ((std::abs(z_diff)<30) && (inny*midy>0) &&(dxdy<2))
97  {
98  result.push_back( OrderedHitTriplet(ih,mh,oh));
99  }
100  }
101  }
102  }
103  }
104  }
105 }
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 CosmicHitTripletGeneratorFromLayerTriplet::hitTriplets ( const TrackingRegion ar,
OrderedHitTriplets ap,
const edm::Event ev,
const edm::EventSetup iSetup 
)
inlinevirtual

Implements HitTripletGenerator.

Definition at line 31 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

31 {}
void CosmicHitTripletGeneratorFromLayerTriplet::init ( const HitPairGenerator pairs,
const std::vector< const LayerWithHits * > &  layers 
)
inline

Definition at line 36 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

37  {}
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 48 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::middlelay
private

Definition at line 50 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const DetLayer* CosmicHitTripletGeneratorFromLayerTriplet::outerlay
private

Definition at line 49 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theInnerLayer
private

Definition at line 47 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and innerLayer().

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theMiddleLayer
private

Definition at line 46 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and middleLayer().

const LayerWithHits* CosmicHitTripletGeneratorFromLayerTriplet::theOuterLayer
private

Definition at line 45 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

Referenced by hitTriplets(), and outerLayer().

const TrackerGeometry* CosmicHitTripletGeneratorFromLayerTriplet::trackerGeometry
private

Definition at line 44 of file CosmicHitTripletGeneratorFromLayerTriplet.h.

const TransientTrackingRecHitBuilder* CosmicHitTripletGeneratorFromLayerTriplet::TTRHbuilder
private

Definition at line 43 of file CosmicHitTripletGeneratorFromLayerTriplet.h.