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 (float phi, 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 20 of file OuterHitCompatibility.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file OuterHitCompatibility.h.

References HitRZCompatibility::clone().

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

Definition at line 29 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 33 of file OuterHitCompatibility.h.

34  { delete theRZCompatibility; }
const HitRZCompatibility * theRZCompatibility

Member Function Documentation

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

Definition at line 40 of file OuterHitCompatibility.h.

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

Referenced by operator()().

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

Definition at line 47 of file OuterHitCompatibility.h.

47  {
48  return new OuterHitCompatibility(*this);
49  }
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 false;
19 
20  float hitZ = hitPos.z();
21  if ( !(*theRZCompatibility)(hitR,hitZ) ) return false;
22 
23  return true;
24 }
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const HitRZCompatibility * theRZCompatibility
virtual GlobalPoint globalPosition() const =0
T z() const
Definition: PV3DBase.h:64
bool checkPhi(float phi, 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 false;
37 
38  float hitZ = hitPos.z();
39  if ( !(*theRZCompatibility)(hitR,hitZ) ) return false;
40 
41  return true;
42 }
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
const HitRZCompatibility * theRZCompatibility
T z() const
Definition: PV3DBase.h:64
Definition: DetId.h:18
const T & get() const
Definition: EventSetup.h:55
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
DetId geographicalId() const
virtual LocalPoint localPosition() const =0
bool checkPhi(float phi, float r) const

Member Data Documentation

OuterHitPhiPrediction OuterHitCompatibility::thePhiPrediction
protected

Definition at line 53 of file OuterHitCompatibility.h.

const HitRZCompatibility* OuterHitCompatibility::theRZCompatibility
protected

Definition at line 52 of file OuterHitCompatibility.h.

Referenced by operator()(), and OuterHitCompatibility().