File indexing completed on 2024-04-06 12:28:56
0001 #ifndef HitZCheck_H
0002 #define HitZCheck_H
0003
0004
0005
0006
0007 #include "RecoTracker/TkTrackingRegions/interface/HitRZCompatibility.h"
0008 #include "RecoTracker/TkTrackingRegions/interface/HitRZConstraint.h"
0009
0010 class HitZCheck final : public HitRZCompatibility {
0011 public:
0012 static constexpr Algo me = zAlgo;
0013
0014 typedef TkTrackingRegionsMargin<float> Margin;
0015
0016 HitZCheck() : HitRZCompatibility(me) {}
0017 HitZCheck(const HitRZConstraint& rz, Margin margin = Margin(0, 0))
0018 : HitRZCompatibility(me), theRZ(rz), theTolerance(margin) {}
0019
0020 bool operator()(const float& r, const float& z) const override { return range(r).inside(z); }
0021
0022 inline Range range(const float& radius) const override;
0023
0024 HitZCheck* clone() const override { return new HitZCheck(*this); }
0025
0026 void setTolerance(const Margin& tolerance) { theTolerance = tolerance; }
0027
0028 private:
0029 HitRZConstraint theRZ;
0030 Margin theTolerance;
0031 };
0032
0033 HitZCheck::Range HitZCheck::range(const float& radius) const {
0034 return Range(theRZ.lineLeft().zAtR(radius) - theTolerance.left(),
0035 theRZ.lineRight().zAtR(radius) + theTolerance.right());
0036 }
0037
0038 #endif