CMS 3D CMS Logo

Public Member Functions | Protected Attributes

OuterHitCompatibility Class Reference

#include <OuterHitCompatibility.h>

List of all members.

Public Member Functions

bool checkPhi (const float &phi, const float &r) const
OuterHitCompatibilityclone () const
bool operator() (const TrackingRecHit *hit, const edm::EventSetup &iSetup) const
bool operator() (const TransientTrackingRecHit *hit) const
 OuterHitCompatibility (const OuterHitCompatibility &ohc)
 OuterHitCompatibility (const OuterHitPhiPrediction &phiPrediction, const HitRZCompatibility &rzCompatibility)
 ~OuterHitCompatibility ()

Protected Attributes

OuterHitPhiPrediction thePhiPrediction
const HitRZCompatibilitytheRZCompatibility

Detailed Description

test compatibility of RecHit. The phi and r-z are checked in independent way. The phi of a RecHit hit is tested if it is in the range defined by OuterHitPhiPrediction. The r-z checking is done with a help of HitRZCompatibility checker

Definition at line 16 of file OuterHitCompatibility.h.


Constructor & Destructor Documentation

OuterHitCompatibility::OuterHitCompatibility ( const OuterHitPhiPrediction phiPrediction,
const HitRZCompatibility rzCompatibility 
) [inline]

Definition at line 19 of file OuterHitCompatibility.h.

References HitRZCompatibility::clone(), and theRZCompatibility.

Referenced by clone().

    : thePhiPrediction(phiPrediction) 
  { theRZCompatibility = rzCompatibility.clone(); }
OuterHitCompatibility::OuterHitCompatibility ( const OuterHitCompatibility ohc) [inline]
OuterHitCompatibility::~OuterHitCompatibility ( ) [inline]

Definition at line 29 of file OuterHitCompatibility.h.

References theRZCompatibility.

   { delete theRZCompatibility; }  

Member Function Documentation

bool OuterHitCompatibility::checkPhi ( const float &  phi,
const float &  r 
) const

Definition at line 44 of file OuterHitCompatibility.cc.

References PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), phi, and thePhiPrediction.

Referenced by operator()().

{
  OuterHitPhiPrediction::Range hitPhiRange = thePhiPrediction(r);
  PhiLess less;
  bool phiOK = less(hitPhiRange.min(),phi) && less(phi,hitPhiRange.max());
  return phiOK;
}
OuterHitCompatibility* OuterHitCompatibility::clone ( void  ) const [inline]

Definition at line 38 of file OuterHitCompatibility.h.

References OuterHitCompatibility().

                                       { 
    return new OuterHitCompatibility(*this);
  }
bool OuterHitCompatibility::operator() ( const TransientTrackingRecHit hit) const

Definition at line 12 of file OuterHitCompatibility.cc.

References checkPhi(), TransientTrackingRecHit::globalPosition(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), theRZCompatibility, and PV3DBase< T, PVType, FrameType >::z().

{
  GlobalPoint hitPos = hit->globalPosition();
  float hitR = hitPos.perp();
  float hitPhi = hitPos.phi();

  if ( !checkPhi(hitPhi, hitR) ) return 0;

  float hitZ = hitPos.z();
  if ( !(*theRZCompatibility)(hitR,hitZ) ) return 0;

  return 1;
}
bool OuterHitCompatibility::operator() ( const TrackingRecHit hit,
const edm::EventSetup iSetup 
) const

Definition at line 27 of file OuterHitCompatibility.cc.

References checkPhi(), TrackingRecHit::geographicalId(), edm::EventSetup::get(), TrackingRecHit::localPosition(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), theRZCompatibility, tmp, patCandidatesForDimuonsSequences_cff::tracker, and PV3DBase< T, PVType, FrameType >::z().

{
  edm::ESHandle<TrackerGeometry> tracker;
  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
  DetId tmp=hit->geographicalId();
  GlobalPoint hitPos = tracker->idToDet(tmp)->surface().toGlobal(hit->localPosition());
  float hitR = hitPos.perp();
  float hitPhi = hitPos.phi();

  if ( !checkPhi(hitPhi, hitR) ) return 0;
 
  float hitZ = hitPos.z();
  if ( !(*theRZCompatibility)(hitR,hitZ) ) return 0;

  return 1;
}

Member Data Documentation

Definition at line 44 of file OuterHitCompatibility.h.

Referenced by checkPhi().