CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
EgAmbiguityTools::isInnerMost Struct Reference

#include <EgAmbiguityTools.h>

Public Member Functions

 isInnerMost (edm::ESHandle< TrackerGeometry > &geom)
 
bool operator() (const reco::GsfElectron *, const reco::GsfElectron *)
 

Public Attributes

edm::ESHandle< TrackerGeometrytrackerHandle_
 

Detailed Description

Definition at line 55 of file EgAmbiguityTools.h.

Constructor & Destructor Documentation

EgAmbiguityTools::isInnerMost::isInnerMost ( edm::ESHandle< TrackerGeometry > &  geom)
inline

Definition at line 58 of file EgAmbiguityTools.h.

58 : trackerHandle_(geom) {}
edm::ESHandle< TrackerGeometry > trackerHandle_

Member Function Documentation

bool EgAmbiguityTools::isInnerMost::operator() ( const reco::GsfElectron e1,
const reco::GsfElectron e2 
)

Definition at line 23 of file EgAmbiguityTools.cc.

References reco::GsfElectron::gsfTrack(), and EgAmbiguityTools::isBetter().

24 {
25  // retreive first valid hit
26  int gsfHitCounter1 = 0 ;
27  trackingRecHit_iterator elHitsIt1 ;
28  for(elHitsIt1 = e1->gsfTrack()->recHitsBegin();
29  elHitsIt1 != e1->gsfTrack()->recHitsEnd();
30  elHitsIt1++, gsfHitCounter1++)
31  {
32  if ((**elHitsIt1).isValid()){
33  break;
34  }
35  }
36 
37  int gsfHitCounter2 = 0 ;
38  trackingRecHit_iterator elHitsIt2 ;
39  for(elHitsIt2 = e2->gsfTrack()->recHitsBegin();
40  elHitsIt2 != e2->gsfTrack()->recHitsEnd();
41  elHitsIt2++, gsfHitCounter2++ )
42  {
43  if ((**elHitsIt2).isValid()){
44  break;
45  }
46  }
47 
48  uint32_t gsfHit1 = e1->gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter1);
49  uint32_t gsfHit2 = e2->gsfTrack()->hitPattern().getHitPattern(HitPattern::TRACK_HITS, gsfHitCounter2);
50 
51  if (HitPattern::getSubStructure(gsfHit1) != HitPattern::getSubStructure(gsfHit2)){
52  return (HitPattern::getSubStructure(gsfHit1) < HitPattern::getSubStructure(gsfHit2));
53  }else if (HitPattern::getLayer(gsfHit1) != HitPattern::getLayer(gsfHit2)){
54  return (HitPattern::getLayer(gsfHit1) < HitPattern::getLayer(gsfHit2));
55  }else{
56  return isBetter(e1, e2);
57  }
58 }
bool isBetter(const reco::GsfElectron *, const reco::GsfElectron *)
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183

Member Data Documentation

edm::ESHandle<TrackerGeometry> EgAmbiguityTools::isInnerMost::trackerHandle_

Definition at line 57 of file EgAmbiguityTools.h.