CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
OuterHitCompatibility Class Reference

#include <OuterHitCompatibility.h>

Public Member Functions

bool checkPhi (const float &phi, const float &r) const
 
OuterHitCompatibilityclone () const
 
bool operator() (const TransientTrackingRecHit *hit) const
 
bool operator() (const TrackingRecHit *hit, const edm::EventSetup &iSetup) const
 
 OuterHitCompatibility (const OuterHitPhiPrediction &phiPrediction, const HitRZCompatibility &rzCompatibility)
 
 OuterHitCompatibility (const OuterHitCompatibility &ohc)
 
 ~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().

22  : thePhiPrediction(phiPrediction)
23  { theRZCompatibility = rzCompatibility.clone(); }
OuterHitPhiPrediction thePhiPrediction
const HitRZCompatibility * theRZCompatibility
virtual HitRZCompatibility * clone() const =0
OuterHitCompatibility::OuterHitCompatibility ( const OuterHitCompatibility ohc)
inline

Definition at line 25 of file OuterHitCompatibility.h.

References HitRZCompatibility::clone(), and theRZCompatibility.

OuterHitPhiPrediction thePhiPrediction
const HitRZCompatibility * theRZCompatibility
virtual HitRZCompatibility * clone() const =0
OuterHitCompatibility::~OuterHitCompatibility ( )
inline

Definition at line 29 of file OuterHitCompatibility.h.

References theRZCompatibility.

30  { delete theRZCompatibility; }
const HitRZCompatibility * 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()().

45 {
47  PhiLess less;
48  bool phiOK = less(hitPhiRange.min(),phi) && less(phi,hitPhiRange.max());
49  return phiOK;
50 }
T max() const
T min() const
OuterHitPhiPrediction thePhiPrediction
Definition: DDAxes.h:10
OuterHitCompatibility* OuterHitCompatibility::clone ( void  ) const
inline

Definition at line 38 of file OuterHitCompatibility.h.

References OuterHitCompatibility().

38  {
39  return new OuterHitCompatibility(*this);
40  }
OuterHitCompatibility(const OuterHitPhiPrediction &phiPrediction, const HitRZCompatibility &rzCompatibility)
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().

13 {
14  GlobalPoint hitPos = hit->globalPosition();
15  float hitR = hitPos.perp();
16  float hitPhi = hitPos.phi();
17 
18  if ( !checkPhi(hitPhi, hitR) ) return 0;
19 
20  float hitZ = hitPos.z();
21  if ( !(*theRZCompatibility)(hitR,hitZ) ) return 0;
22 
23  return 1;
24 }
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
const HitRZCompatibility * theRZCompatibility
T z() const
Definition: PV3DBase.h:63
virtual GlobalPoint globalPosition() const
bool checkPhi(const float &phi, const float &r) const
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().

28 {
30  iSetup.get<TrackerDigiGeometryRecord>().get(tracker);
31  DetId tmp=hit->geographicalId();
32  GlobalPoint hitPos = tracker->idToDet(tmp)->surface().toGlobal(hit->localPosition());
33  float hitR = hitPos.perp();
34  float hitPhi = hitPos.phi();
35 
36  if ( !checkPhi(hitPhi, hitR) ) return 0;
37 
38  float hitZ = hitPos.z();
39  if ( !(*theRZCompatibility)(hitR,hitZ) ) return 0;
40 
41  return 1;
42 }
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
const HitRZCompatibility * theRZCompatibility
T z() const
Definition: PV3DBase.h:63
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool checkPhi(const float &phi, const float &r) const
DetId geographicalId() const
virtual LocalPoint localPosition() const =0

Member Data Documentation

OuterHitPhiPrediction OuterHitCompatibility::thePhiPrediction
protected

Definition at line 44 of file OuterHitCompatibility.h.

Referenced by checkPhi().

const HitRZCompatibility* OuterHitCompatibility::theRZCompatibility
protected