CMS 3D CMS Logo

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

Referenced by computeWindowSize().

00047   {
00048     
00049     LocalPoint start = ts.localPosition();
00050     float corners[]  =  { plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
00051                           plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()+maxDistance.y() )).barePhi(),
00052                           plane.toGlobal(LocalPoint( start.x()-maxDistance.x(), start.y()-maxDistance.y() )).barePhi(),
00053                           plane.toGlobal(LocalPoint( start.x()+maxDistance.x(), start.y()-maxDistance.y() )).barePhi() 
00054     };
00055     
00056     float phimin = corners[0];
00057     float phimax = phimin;
00058     for ( int i = 1; i<4; i++) {
00059       float cPhi = corners[i];
00060       if ( Geom::phiLess(cPhi, phimin) ) { phimin = cPhi; }
00061       if ( Geom::phiLess( phimax, cPhi) ) { phimax = cPhi; }
00062     }
00063     float phiWindow = phimax - phimin;
00064     if ( phiWindow < 0.) { phiWindow +=  2.*Geom::pi();}
00065     
00066     return phiWindow;
00067   }

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 TIDRing::groupedCompatibleDetsV(), TECLayer::groupedCompatibleDetsV(), and CompositeTECWedge::groupedCompatibleDetsV().

00034   {
00035     const BoundPlane& startPlane = det->surface();  
00036     MeasurementEstimator::Local2DVector maxDistance = 
00037       est.maximalLocalDisplacement( tsos, startPlane);
00038     return calculatePhiWindow( maxDistance, tsos, startPlane);
00039   }

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().

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


Generated on Tue Jun 9 18:53:02 2009 for CMSSW by  doxygen 1.5.4