00001 #ifndef HitEtaCheck_H 00002 #define HitEtaCheck_H 00003 00010 #include "RecoTracker/TkTrackingRegions/interface/HitRZCompatibility.h" 00011 #include "RecoTracker/TkTrackingRegions/interface/HitRZConstraint.h" 00012 #include "RecoTracker/TkTrackingRegions/interface/HitRCheck.h" 00013 #include "RecoTracker/TkTrackingRegions/interface/HitZCheck.h" 00014 00015 class HitEtaCheck : public HitRZCompatibility { 00016 public: 00017 HitEtaCheck(bool inbarrel, 00018 const PixelRecoLineRZ::LineOrigin & point, 00019 float cotLeftLine, float cotRightLine) 00020 : isBarrel(inbarrel), 00021 theRZ(HitRZConstraint(point, cotLeftLine, point, cotRightLine)) { } 00022 00023 virtual bool operator() (const float & r, const float & z) const { 00024 const PixelRecoLineRZ & lineLeft = theRZ.lineLeft(); 00025 const PixelRecoLineRZ & lineRight = theRZ.lineRight(); 00026 float cotHit = (lineLeft.origin().z()-z)/(lineLeft.origin().r()-r); 00027 return lineRight.cotLine() < cotHit && cotHit < lineLeft.cotLine(); 00028 } 00029 00030 virtual Range range(const float & rORz) const { 00031 return (isBarrel) ? 00032 HitZCheck(theRZ).range(rORz) : HitRCheck(theRZ).range(rORz); 00033 } 00034 virtual HitEtaCheck* clone() const { return new HitEtaCheck(*this); } 00035 private: 00036 bool isBarrel; 00037 HitRZConstraint theRZ; 00038 }; 00039 #endif