CMS 3D CMS Logo

TrackingRecHitProjector< ResultingHit > Class Template Reference

#include <TrackingTools/TransientTrackingRecHit/interface/TrackingRecHitProjector.h>

List of all members.

Public Types

typedef
TransientTrackingRecHit::RecHitPointer 
RecHitPointer

Public Member Functions

RecHitPointer project (const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const


Detailed Description

template<class ResultingHit>
class TrackingRecHitProjector< ResultingHit >

Definition at line 8 of file TrackingRecHitProjector.h.


Member Typedef Documentation

template<class ResultingHit>
typedef TransientTrackingRecHit::RecHitPointer TrackingRecHitProjector< ResultingHit >::RecHitPointer

Definition at line 11 of file TrackingRecHitProjector.h.


Member Function Documentation

template<class ResultingHit>
RecHitPointer TrackingRecHitProjector< ResultingHit >::project ( const TransientTrackingRecHit hit,
const GeomDet det,
const TrajectoryStateOnSurface ts 
) const [inline]

Definition at line 13 of file TrackingRecHitProjector.h.

References TransientTrackingRecHit::det(), Vector3DBase< T, FrameTag >::dot(), TrajectoryStateOnSurface::globalParameters(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::localPositionError(), Plane::localZ(), GlobalTrajectoryParameters::momentum(), Plane::normalVector(), GloballyPositioned< T >::position(), LocalError::rotate(), GeomDet::surface(), Surface::toGlobal(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by CkfDebugger::analyseRecHitExistance(), TkGluedMeasurementDet::checkHitProjection(), ProjectedRecHit2D::clone(), TkGluedMeasurementDet::projectOnGluedDet(), and TkGluedMeasurementDet::recHits().

00015                                                                    {
00016 
00017     GlobalVector gdir = ts.globalParameters().momentum();
00018     const BoundPlane& gluedPlane = det.surface();
00019     const BoundPlane& hitPlane = hit.det()->surface();
00020 
00021     // check if the planes are parallel
00022     //const float epsilon = 1.e-7; // corresponds to about 0.3 miliradian but cannot be reduced
00023                                  // because of float precision
00024 
00025     //if (fabs(gluedPlane.normalVector().dot( hitPlane.normalVector())) < 1-epsilon) {
00026     //       std::cout << "TkGluedMeasurementDet plane not parallel to DetUnit plane: dot product is " 
00027     //     << gluedPlane.normalVector().dot( hitPlane.normalVector()) << endl;
00028     // FIXME: throw the appropriate exception here...
00029     //throw MeasurementDetException("TkGluedMeasurementDet plane not parallel to DetUnit plane");
00030     //}
00031 
00032     double delta = gluedPlane.localZ( hitPlane.position());
00033     LocalVector ldir = gluedPlane.toLocal(gdir);
00034     LocalPoint lhitPos = gluedPlane.toLocal( hit.globalPosition());
00035     LocalPoint projectedHitPos = lhitPos - ldir * delta/ldir.z();
00036 
00037     LocalVector hitXAxis = gluedPlane.toLocal( hitPlane.toGlobal( LocalVector(1,0,0)));
00038     LocalError hitErr = hit.localPositionError();
00039     if (gluedPlane.normalVector().dot( hitPlane.normalVector()) < 0) {
00040       // the two planes are inverted, and the correlation element must change sign
00041       hitErr = LocalError( hitErr.xx(), -hitErr.xy(), hitErr.yy());
00042     }
00043     LocalError rotatedError = hitErr.rotate( hitXAxis.x(), hitXAxis.y());
00044     
00045     return ResultingHit::build( projectedHitPos, rotatedError, &det, hit.det(), hit);
00046   }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:34:13 2009 for CMSSW by  doxygen 1.5.4