File indexing completed on 2023-10-25 10:03:06
0001 #ifndef HitEtaCheck_H
0002 #define HitEtaCheck_H
0003
0004
0005
0006
0007
0008
0009
0010 #include "RecoTracker/TkTrackingRegions/interface/HitRZCompatibility.h"
0011 #include "RecoTracker/TkTrackingRegions/interface/HitRZConstraint.h"
0012 #include "RecoTracker/TkTrackingRegions/interface/HitRCheck.h"
0013 #include "RecoTracker/TkTrackingRegions/interface/HitZCheck.h"
0014
0015 class HitEtaCheck final : public HitRZCompatibility {
0016 public:
0017 static constexpr Algo me = etaAlgo;
0018
0019 HitEtaCheck(bool inbarrel, const HitRZConstraint::Point& point, float cotLeftLine, float cotRightLine)
0020 : HitRZCompatibility(me), isBarrel(inbarrel), theRZ(HitRZConstraint(point, cotLeftLine, point, cotRightLine)) {}
0021
0022 bool operator()(const float& r, const float& z) const override {
0023 const auto& lineLeft = theRZ.lineLeft();
0024 const auto& lineRight = theRZ.lineRight();
0025 float cotHit = (lineLeft.origin().z() - z) / (lineLeft.origin().r() - r);
0026 return lineRight.cotLine() < cotHit && cotHit < lineLeft.cotLine();
0027 }
0028
0029 Range range(const float& rORz) const override {
0030 return (isBarrel) ? HitZCheck(theRZ).range(rORz) : HitRCheck(theRZ).range(rORz);
0031 }
0032 HitEtaCheck* clone() const override { return new HitEtaCheck(*this); }
0033
0034 private:
0035 bool isBarrel;
0036 HitRZConstraint theRZ;
0037 };
0038 #endif