File indexing completed on 2024-04-06 12:28:35
0001 #ifndef RecoTracker_PixelSeeding_plugins_ThirdHitZPrediction_h
0002 #define RecoTracker_PixelSeeding_plugins_ThirdHitZPrediction_h
0003
0004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0005 #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h"
0006 #include <cmath>
0007
0008 class ThirdHitZPrediction {
0009 public:
0010 typedef PixelRecoRange<float> Range;
0011 ThirdHitZPrediction(const GlobalPoint& p1,
0012 float erroRPhi1,
0013 float errorZ1,
0014 const GlobalPoint& p2,
0015 float erroRPhi2,
0016 float errorZ2,
0017 double curvature,
0018 double nSigma = 3.)
0019 : thePoint2(p2),
0020 sqr_errorXY12(erroRPhi1 * erroRPhi1 + erroRPhi2 * erroRPhi2),
0021 sqr_errorXY2(erroRPhi2 * erroRPhi2),
0022 theErrorZ1(errorZ1),
0023 theErrorZ2(errorZ2),
0024 theCurvature(curvature),
0025 theNSigma(nSigma) {
0026 auto d = p2 - p1;
0027 dR12 = d.perp();
0028 if (dR12 < 1.e-5)
0029 dR12 = 1.e-5;
0030 dS12 = std::abs(0.5 * dR12 * theCurvature) < 1 ? std::asin(0.5 * dR12 * theCurvature) : 1.;
0031 dZ12 = d.z();
0032 }
0033 Range operator()(const GlobalPoint& p3, float erroRPhi3) const;
0034
0035 private:
0036 GlobalPoint thePoint2;
0037 double dR12, dZ12, dS12;
0038 double sqr_errorXY12;
0039 double sqr_errorXY2;
0040 double theErrorZ1, theErrorZ2;
0041 double theCurvature;
0042 double theNSigma;
0043 };
0044 #endif