File indexing completed on 2024-04-06 12:28:34
0001 #ifndef RecoTracker_PixelSeeding_plugins_MatchedHitRZCorrectionFromBending_h
0002 #define RecoTracker_PixelSeeding_plugins_MatchedHitRZCorrectionFromBending_h
0003
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0006
0007 class ThirdHitPredictionFromCircle;
0008 class DetLayer;
0009 class TrackerTopology;
0010
0011 class MatchedHitRZCorrectionFromBending {
0012 public:
0013 MatchedHitRZCorrectionFromBending() : rFixup(nullptr), zFixup(nullptr) {}
0014 MatchedHitRZCorrectionFromBending(DetId detId, const TrackerTopology *tTopo);
0015 MatchedHitRZCorrectionFromBending(const DetLayer *layer, const TrackerTopology *tTopo);
0016
0017 inline void operator()(const ThirdHitPredictionFromCircle &pred,
0018 double curvature,
0019 const TrackingRecHit &hit,
0020 double &r,
0021 double &z,
0022 const TrackerTopology *tTopo) const {
0023 if (!rFixup && !zFixup)
0024 return;
0025 if (rFixup)
0026 r += rFixup(pred, curvature, z, hit, tTopo);
0027 if (zFixup)
0028 z += zFixup(pred, curvature, r, hit, tTopo);
0029 }
0030
0031 private:
0032 typedef double (*FixupFn)(const ThirdHitPredictionFromCircle &pred,
0033 double curvature,
0034 double rOrZ,
0035 const TrackingRecHit &hit,
0036 const TrackerTopology *tTopo);
0037
0038 static double tibMatchedHitZFixup(const ThirdHitPredictionFromCircle &pred,
0039 double curvature,
0040 double rOrZ,
0041 const TrackingRecHit &hit,
0042 const TrackerTopology *tTopo);
0043
0044 FixupFn rFixup, zFixup;
0045 };
0046
0047 #endif