CMS 3D CMS Logo

BarrelUtil.h
Go to the documentation of this file.
1 #ifndef TkDetLayers_BarrelUtil_h
2 #define TkDetLayers_BarrelUtil_h
3 
5 
11 
12 #pragma GCC visibility push(hidden)
13 namespace barrelUtil {
14 
15  inline float calculatePhiWindow(float Xmax, const GeomDet& det, const TrajectoryStateOnSurface& state) {
16  LocalPoint startPoint = state.localPosition();
17  LocalVector shift(Xmax, 0., 0.);
18  LocalPoint shift1 = startPoint + shift;
19  LocalPoint shift2 = startPoint + (-shift);
20  //LocalPoint shift2( startPoint); //original code;
21  //shift2 -= shift;
22 
23  auto phi1 = det.surface().toGlobal(shift1).barePhi();
24  auto phi2 = det.surface().toGlobal(shift2).barePhi();
25  auto phiStart = state.globalPosition().barePhi();
26  auto phiWin = std::min(std::abs(phiStart - phi1), std::abs(phiStart - phi2));
27 
28  return phiWin;
29  }
30 
31  inline float computeWindowSize(const GeomDet* det,
32  const TrajectoryStateOnSurface& tsos,
33  const MeasurementEstimator& est) {
34  auto xmax = est.maximalLocalDisplacement(tsos, det->surface()).x();
35  return calculatePhiWindow(xmax, *det, tsos);
36  }
37 
38  inline bool overlap(float phi, const GeometricSearchDet& gsdet, float phiWin) {
39  // introduce offset (extrapolated point and true propagated point differ by 0.0003 - 0.00033,
40  // due to thickness of Rod of 1 cm)
41  constexpr float phiOffset = 0.00034; //...TOBE CHECKED LATER...
42  phiWin += phiOffset;
43 
44  // detector phi range
45  std::pair<float, float> phiRange(phi - phiWin, phi + phiWin);
46 
47  return rangesIntersect(phiRange, gsdet.surface().phiSpan(), [](auto x, auto y) { return Geom::phiLess(x, y); });
48  }
49 
50 } // namespace barrelUtil
51 
52 #pragma GCC visibility pop
53 #endif
Vector3DBase< float, LocalTag >
MeasurementEstimator
Definition: MeasurementEstimator.h:19
TrajectoryStateOnSurface.h
GeomDet
Definition: GeomDet.h:27
min
T min(T a, T b)
Definition: MathUtil.h:58
VectorUtil.h
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
GeometricSearchDet.h
Surface::phiSpan
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:90
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MeasurementEstimator.h
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
barrelUtil::calculatePhiWindow
float calculatePhiWindow(float Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state)
Definition: BarrelUtil.h:15
Point3DBase< float, LocalTag >
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
Geom::phiLess
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
barrelUtil::overlap
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
Definition: BarrelUtil.h:38
PixelVTXMonitor_cfi.Xmax
Xmax
Definition: PixelVTXMonitor_cfi.py:8
GeomDet.h
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
barrelUtil
Definition: BarrelUtil.h:13
rangesIntersect
bool rangesIntersect(const Range &a, const Range &b)
Definition: rangesIntersect.h:14
barrelUtil::computeWindowSize
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: BarrelUtil.h:31
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricSearchDet
Definition: GeometricSearchDet.h:17
rangesIntersect.h
MeasurementEstimator::maximalLocalDisplacement
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0