Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:03:06

0001 #ifndef HitEtaCheck_H
0002 #define HitEtaCheck_H
0003 
0004 /** Fast Implementation of HitRZCompatibility.
0005     The RZConstraint is defined by two lines and their crossing point.
0006     The r-z compatibility is tested by comparistion of 
0007     cotangent given by r-z and lines crossing point with cotangents
0008     of two lines. */
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