Go to the documentation of this file.00001 #ifndef HitRCheck_H
00002 #define HitRCheck_H
00003
00007 #include "RecoTracker/TkTrackingRegions/interface/HitRZCompatibility.h"
00008 #include "RecoTracker/TkTrackingRegions/interface/HitRZConstraint.h"
00009
00010 class HitRCheck GCC11_FINAL : public HitRZCompatibility {
00011 public:
00012 static constexpr Algo me =rAlgo;
00013
00014 typedef TkTrackingRegionsMargin<float> Margin;
00015
00016 HitRCheck() : HitRZCompatibility(me) { }
00017 HitRCheck(const HitRZConstraint & rz, Margin margin = Margin(0,0))
00018 : HitRZCompatibility(me), theRZ(rz), theTolerance(margin) { }
00019
00020 virtual bool operator() (const float & r, const float & z) const
00021 { return range(z).inside(r); }
00022
00023 inline Range range(const float & z) const;
00024
00025 virtual HitRCheck * clone() const { return new HitRCheck(*this); }
00026
00027 void setTolerance(const Margin & tolerance) { theTolerance = tolerance; }
00028
00029 private:
00030 HitRZConstraint theRZ;
00031 Margin theTolerance;
00032 };
00033
00034
00035
00036 HitRCheck::Range HitRCheck::range(const float & z) const
00037 {
00038 constexpr float rBig = 150.;
00039 const auto & lineLeft = theRZ.lineLeft();
00040 const auto & lineRight = theRZ.lineRight();
00041
00042 float rR = lineRight.rAtZ(z);
00043 float rL = lineLeft.rAtZ(z);
00044 float rMin = (rR<rL) ? rR : rL;
00045 float rMax = (rR<rL) ? rL : rR;
00046
00047 float aMin = (rMin>0) ? rMin : rMax;
00048 float aMax = (rMin>0) ? rMax : rBig;
00049 aMin = (rMax>0) ? aMin : rBig;
00050 return Range(aMin-theTolerance.left(),aMax+theTolerance.right());
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 }
00099 #endif