CMS 3D CMS Logo

OuterHitCompatibility.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_OuterHitCompatibility_H
2 #define RecoTracker_TkTrackingRegions_OuterHitCompatibility_H
3 
4 
12 #include "OuterHitPhiPrediction.h"
18 
20 
21 template<typename Algo>
23 public:
24 
26  const OuterHitPhiPrediction & phiPrediction,
27  const Algo & rzCompatibility)
28  : thePhiPrediction(phiPrediction),
29  theRZCompatibility(rzCompatibility) {}
30 
31  bool operator() (const TrackingRecHit & hit) const {
32 
33  auto hitPos = hit.globalPosition();
34  auto hitR = hitPos.perp();
35 
36  auto hitZ = hitPos.z();
37  if ( !theRZCompatibility(hitR,hitZ) ) return false;
38 
39  auto hitPhi = unsafe_atan2f<9>(hitPos.y(),hitPos.x());
40 
41  return checkPhi(hitPhi, hitR);
42  }
43 
44 
45  bool checkPhi(float phi, float r) const {
46  auto hitPhiRange = thePhiPrediction(r);
47  bool phiOK = Geom::phiLess(hitPhiRange.min(),phi) && Geom::phiLess(phi,hitPhiRange.max());
48  return phiOK;
49  }
50 
51 private:
54 };
55 #endif
T perp() const
Definition: PV3DBase.h:72
virtual GlobalPoint globalPosition() const
#define dso_internal
Definition: Visibility.h:13
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:23
bool checkPhi(float phi, float r) const
OuterHitPhiPrediction thePhiPrediction
Definition: fakeMenu.h:6
OuterHitCompatibility(const OuterHitPhiPrediction &phiPrediction, const Algo &rzCompatibility)