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 
11 #include "OuterHitPhiPrediction.h"
17 
19 
20 template <typename Algo>
22 public:
23  OuterHitCompatibility(const OuterHitPhiPrediction& phiPrediction, const Algo& rzCompatibility)
24  : thePhiPrediction(phiPrediction), theRZCompatibility(rzCompatibility) {}
25 
26  bool operator()(const TrackingRecHit& hit) const {
27  auto hitPos = hit.globalPosition();
28  auto hitR = hitPos.perp();
29 
30  auto hitZ = hitPos.z();
31  if (!theRZCompatibility(hitR, hitZ))
32  return false;
33 
34  auto hitPhi = unsafe_atan2f<9>(hitPos.y(), hitPos.x());
35 
36  return checkPhi(hitPhi, hitR);
37  }
38 
39  bool checkPhi(float phi, float r) const {
40  auto hitPhiRange = thePhiPrediction(r);
41  bool phiOK = Geom::phiLess(hitPhiRange.min(), phi) && Geom::phiLess(phi, hitPhiRange.max());
42  return phiOK;
43  }
44 
45 private:
48 };
49 #endif
#define dso_internal
Definition: Visibility.h:13
bool operator()(const TrackingRecHit &hit) const
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
bool checkPhi(float phi, float r) const
OuterHitPhiPrediction thePhiPrediction
Definition: fakeMenu.h:6
OuterHitCompatibility(const OuterHitPhiPrediction &phiPrediction, const Algo &rzCompatibility)