CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
tkDetUtil Namespace Reference

Functions

float calculatePhiWindow (const MeasurementEstimator::Local2DVector &maxDistance, const TrajectoryStateOnSurface &ts, const BoundPlane &plane)
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
 
bool overlapInPhi (const GlobalPoint &crossPoint, const GeomDet &det, float phiWindow)
 

Function Documentation

float tkDetUtil::calculatePhiWindow ( const MeasurementEstimator::Local2DVector maxDistance,
const TrajectoryStateOnSurface ts,
const BoundPlane plane 
)

Definition at line 44 of file TkDetUtil.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), i, TrajectoryStateOnSurface::localPosition(), Geom::phiLess(), Geom::pi(), Surface::toGlobal(), PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::x(), PV2DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by computeWindowSize().

47  {
48 
49  LocalPoint start = ts.localPosition();
50  float corners[] = { plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
51  plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
52  plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()-maxDistance.y() )).barePhi(),
53  plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()-maxDistance.y() )).barePhi()
54  };
55 
56  float phimin = corners[0];
57  float phimax = phimin;
58  for ( int i = 1; i<4; i++) {
59  float cPhi = corners[i];
60  if ( Geom::phiLess(cPhi, phimin) ) { phimin = cPhi; }
61  if ( Geom::phiLess( phimax, cPhi) ) { phimax = cPhi; }
62  }
63  float phiWindow = phimax - phimin;
64  if ( phiWindow < 0.) { phiWindow += 2.*Geom::pi();}
65 
66  return phiWindow;
67  }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
int i
Definition: DBlmapReader.cc:9
T y() const
Definition: PV2DBase.h:40
T y() const
Definition: PV3DBase.h:57
T barePhi() const
Definition: PV3DBase.h:62
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:57
double pi()
Definition: Pi.h:31
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T x() const
Definition: PV2DBase.h:39
T x() const
Definition: PV3DBase.h:56
float tkDetUtil::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
)

Definition at line 31 of file TkDetUtil.cc.

References calculatePhiWindow(), MeasurementEstimator::maximalLocalDisplacement(), and GeomDet::surface().

Referenced by TECLayer::groupedCompatibleDetsV(), TIDRing::groupedCompatibleDetsV(), and CompositeTECWedge::groupedCompatibleDetsV().

34  {
35  const BoundPlane& startPlane = det->surface();
37  est.maximalLocalDisplacement( tsos, startPlane);
38  return calculatePhiWindow( maxDistance, tsos, startPlane);
39  }
float calculatePhiWindow(const MeasurementEstimator::Local2DVector &maxDistance, const TrajectoryStateOnSurface &ts, const BoundPlane &plane)
Definition: TkDetUtil.cc:44
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
bool tkDetUtil::overlapInPhi ( const GlobalPoint crossPoint,
const GeomDet det,
float  phiWindow 
)

Definition at line 21 of file TkDetUtil.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), phi, BoundSurface::phiSpan(), rangesIntersect(), and GeomDet::surface().

Referenced by CompositeTECWedge::searchNeighbors(), and TIDRing::searchNeighbors().

22  {
23  float phi = crossPoint.barePhi();
24  std::pair<float,float> phiRange(phi-phiWindow, phi+phiWindow);
25  std::pair<float,float> detPhiRange = det.surface().phiSpan();
26  // return rangesIntersect( phiRange, detPhiRange, boost::function<bool(float,float)>(&Geom::phiLess));
27  return rangesIntersect( phiRange, detPhiRange, PhiLess());
28  }
std::pair< float, float > const & phiSpan() const
Definition: BoundSurface.h:91
T barePhi() const
Definition: PV3DBase.h:62
bool rangesIntersect(const Range &a, const Range &b)
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: DDAxes.h:10