CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkDetUtil.cc
Go to the documentation of this file.
1 #include "TkDetUtil.h"
2 
6 
7 
8 namespace tkDetUtil {
9 
10  float computeWindowSize( const GeomDet* det,
11  const TrajectoryStateOnSurface& tsos,
12  const MeasurementEstimator& est)
13  {
14  const Plane& startPlane = det->surface();
16  est.maximalLocalDisplacement( tsos, startPlane);
17  return calculatePhiWindow( maxDistance, tsos, startPlane);
18  }
19 
20 
21  float
23  const TrajectoryStateOnSurface& ts,
24  const Plane& plane)
25  {
26 
28  float corners[] = { plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
29  plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
30  plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()-maxDistance.y() )).barePhi(),
31  plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()-maxDistance.y() )).barePhi()
32  };
33 
34  float phimin = corners[0];
35  float phimax = phimin;
36  for ( int i = 1; i<4; i++) {
37  float cPhi = corners[i];
38  if ( Geom::phiLess(cPhi, phimin) ) { phimin = cPhi; }
39  if ( Geom::phiLess( phimax, cPhi) ) { phimax = cPhi; }
40  }
41  float phiWindow = phimax - phimin;
42  if ( phiWindow < 0.) { phiWindow += 2.*Geom::pi();}
43 
44  return phiWindow;
45  }
46 
47 
48 
49 
50 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
int i
Definition: DBlmapReader.cc:9
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
T y() const
Definition: PV2DBase.h:46
T y() const
Definition: PV3DBase.h:63
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
Definition: Plane.h:17
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: TkDetUtil.cc:10
T barePhi() const
Definition: PV3DBase.h:68
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:23
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
double pi()
Definition: Pi.h:31
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
float calculatePhiWindow(const MeasurementEstimator::Local2DVector &maxDistance, const TrajectoryStateOnSurface &ts, const Plane &plane)
Definition: TkDetUtil.cc:22
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62