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 34 of file EgAmbiguityTools.cc.

References reco::e1, reco::e2, reco::HitPattern::getHitPattern(), reco::HitPattern::getLayer(), reco::HitPattern::getSubStructure(), and EgAmbiguityTools::isBetter().

35  {
36  reco::HitPattern gsfHitPattern1 = e1->gsfTrack()->hitPattern() ;
37  reco::HitPattern gsfHitPattern2 = e2->gsfTrack()->hitPattern() ;
38 
39  // retreive first valid hit
40  int gsfHitCounter1 = 0 ;
41  trackingRecHit_iterator elHitsIt1 ;
42  for
43  ( elHitsIt1 = e1->gsfTrack()->recHitsBegin() ;
44  elHitsIt1 != e1->gsfTrack()->recHitsEnd() ;
45  elHitsIt1++, gsfHitCounter1++ )
46  { if (((**elHitsIt1).isValid())) break ; }
47 
48  int gsfHitCounter2 = 0 ;
49  trackingRecHit_iterator elHitsIt2 ;
50  for
51  ( elHitsIt2 = e2->gsfTrack()->recHitsBegin() ;
52  elHitsIt2 != e2->gsfTrack()->recHitsEnd() ;
53  elHitsIt2++, gsfHitCounter2++ )
54  { if (((**elHitsIt2).isValid())) break ; }
55 
56  uint32_t gsfHit1 = gsfHitPattern1.getHitPattern(gsfHitCounter1) ;
57  uint32_t gsfHit2 = gsfHitPattern2.getHitPattern(gsfHitCounter2) ;
58  if (gsfHitPattern1.getSubStructure(gsfHit1)!=gsfHitPattern2.getSubStructure(gsfHit2))
59  { return (gsfHitPattern1.getSubStructure(gsfHit1)<gsfHitPattern2.getSubStructure(gsfHit2)) ; }
60  else if (gsfHitPattern1.getLayer(gsfHit1)!=gsfHitPattern2.getLayer(gsfHit2))
61  { return (gsfHitPattern1.getLayer(gsfHit1)<gsfHitPattern2.getLayer(gsfHit2)) ; }
62  else
63  { return isBetter(e1,e2) ; }
64  }
static uint32_t getLayer(uint32_t pattern)
Definition: HitPattern.h:513
bool isBetter(const reco::GsfElectron *, const reco::GsfElectron *)
static uint32_t getSubStructure(uint32_t pattern)
Definition: HitPattern.h:507
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:144
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:169

Member Data Documentation

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

Definition at line 57 of file EgAmbiguityTools.h.