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(), phimax, phimin, 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 
)

Definition at line 31 of file TkDetUtil.cc.

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

Referenced by TECLayer::groupedCompatibleDetsV().

  {
    const BoundPlane& startPlane = det->surface();  
    MeasurementEstimator::Local2DVector maxDistance = 
      est.maximalLocalDisplacement( tsos, startPlane);
    return calculatePhiWindow( maxDistance, tsos, startPlane);
  }
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());
  }