CMS 3D CMS Logo

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(), pi, dqm_diff::start, Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV2DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by computeWindowSize().

  {
    
    LocalPoint start = ts.localPosition();
    float corners[]  =  { plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
                          plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
                          plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()-maxDistance.y() )).barePhi(),
                          plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()-maxDistance.y() )).barePhi() 
    };
    
    float phimin = corners[0];
    float phimax = phimin;
    for ( int i = 1; i<4; i++) {
      float cPhi = corners[i];
      if ( Geom::phiLess(cPhi, phimin) ) { phimin = cPhi; }
      if ( Geom::phiLess( phimax, cPhi) ) { phimax = cPhi; }
    }
    float phiWindow = phimax - phimin;
    if ( phiWindow < 0.) { phiWindow +=  2.*Geom::pi();}
    
    return phiWindow;
  }
float tkDetUtil::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
)
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().

  {
    float phi = crossPoint.barePhi();
    std::pair<float,float> phiRange(phi-phiWindow, phi+phiWindow);
    std::pair<float,float> detPhiRange = det.surface().phiSpan(); 
    //   return rangesIntersect( phiRange, detPhiRange, boost::function<bool(float,float)>(&Geom::phiLess));
    return rangesIntersect( phiRange, detPhiRange, PhiLess());
  }