test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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"
16 
19 
21 
22 template<typename Algo>
24 public:
25 
27  const OuterHitPhiPrediction & phiPrediction,
28  const Algo & rzCompatibility)
29  : thePhiPrediction(phiPrediction),
30  theRZCompatibility(rzCompatibility) {}
31 
32  bool operator() (const TrackingRecHit & hit) const {
33 
34  auto hitPos = hit.globalPosition();
35  auto hitR = hitPos.perp();
36 
37  auto hitZ = hitPos.z();
38  if ( !theRZCompatibility(hitR,hitZ) ) return false;
39 
40  auto hitPhi = unsafe_atan2f<9>(hitPos.y(),hitPos.x());
41 
42  return checkPhi(hitPhi, hitR);
43  }
44 
45 
46  bool checkPhi(float phi, float r) const {
47  auto hitPhiRange = thePhiPrediction(r);
48  PhiLess less;
49  bool phiOK = less(hitPhiRange.min(),phi) && less(phi,hitPhiRange.max());
50  return phiOK;
51  }
52 
53 private:
56 };
57 #endif
T perp() const
Definition: PV3DBase.h:72
virtual GlobalPoint globalPosition() const
#define dso_internal
bool checkPhi(float phi, float r) const
OuterHitPhiPrediction thePhiPrediction
Definition: fakeMenu.h:6
OuterHitCompatibility(const OuterHitPhiPrediction &phiPrediction, const Algo &rzCompatibility)