CMS 3D CMS Logo

Public Member Functions | Public Attributes

EgAmbiguityTools::isInnerMost Struct Reference

#include <EgAmbiguityTools.h>

List of all members.

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.

: trackerHandle_(geom) {}

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::HitPattern::getHitPattern(), reco::HitPattern::getLayer(), reco::HitPattern::getSubStructure(), and EgAmbiguityTools::isBetter().

 {
  reco::HitPattern gsfHitPattern1 = e1->gsfTrack()->hitPattern() ;
  reco::HitPattern gsfHitPattern2 = e2->gsfTrack()->hitPattern() ;

  // retreive first valid hit
  int gsfHitCounter1 = 0 ;
  trackingRecHit_iterator elHitsIt1 ;
  for
   ( elHitsIt1 = e1->gsfTrack()->recHitsBegin() ;
     elHitsIt1 != e1->gsfTrack()->recHitsEnd() ;
     elHitsIt1++, gsfHitCounter1++ )
   { if (((**elHitsIt1).isValid())) break ; }

  int gsfHitCounter2 = 0 ;
  trackingRecHit_iterator elHitsIt2 ;
  for
   ( elHitsIt2 = e2->gsfTrack()->recHitsBegin() ;
     elHitsIt2 != e2->gsfTrack()->recHitsEnd() ;
     elHitsIt2++, gsfHitCounter2++ )
   { if (((**elHitsIt2).isValid())) break ; }

  uint32_t gsfHit1 = gsfHitPattern1.getHitPattern(gsfHitCounter1) ;
  uint32_t gsfHit2 = gsfHitPattern2.getHitPattern(gsfHitCounter2) ;
  if (gsfHitPattern1.getSubStructure(gsfHit1)!=gsfHitPattern2.getSubStructure(gsfHit2))
   { return (gsfHitPattern1.getSubStructure(gsfHit1)<gsfHitPattern2.getSubStructure(gsfHit2)) ; }
  else if (gsfHitPattern1.getLayer(gsfHit1)!=gsfHitPattern2.getLayer(gsfHit2))
   { return (gsfHitPattern1.getLayer(gsfHit1)<gsfHitPattern2.getLayer(gsfHit2)) ; }
  else
   { return isBetter(e1,e2) ; }
 }

Member Data Documentation

Definition at line 57 of file EgAmbiguityTools.h.