CMS 3D CMS Logo

Public Types | Public Member Functions

TrackingRecHitProjector< ResultingHit > Class Template Reference

#include <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
RecHitPointer project (const TransientTrackingRecHit &hit, const GeomDet &det, const GlobalVector &gdir) const
RecHitPointer project (const TransientTrackingRecHit &hit, const GeomDet &det) 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]
template<class ResultingHit>
RecHitPointer TrackingRecHitProjector< ResultingHit >::project ( const TransientTrackingRecHit hit,
const GeomDet det,
const GlobalVector gdir 
) const [inline]

Definition at line 27 of file TrackingRecHitProjector.h.

References newFWLiteAna::build, delta, TransientTrackingRecHit::det(), TransientTrackingRecHit::globalPosition(), TrackingRecHit::localPositionError(), LocalError::rotate(), GeomDet::surface(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

                                                          {
    const BoundPlane& gluedPlane = det.surface();
    const BoundPlane& hitPlane = hit.det()->surface();

    // check if the planes are parallel
    //const float epsilon = 1.e-7; // corresponds to about 0.3 miliradian but cannot be reduced
                                 // because of float precision

    //if (fabs(gluedPlane.normalVector().dot( hitPlane.normalVector())) < 1-epsilon) {
    //       std::cout << "TkGluedMeasurementDet plane not parallel to DetUnit plane: dot product is " 
    //     << gluedPlane.normalVector().dot( hitPlane.normalVector()) << endl;
    // FIXME: throw the appropriate exception here...
    //throw MeasurementDetException("TkGluedMeasurementDet plane not parallel to DetUnit plane");
    //}

    double delta = gluedPlane.localZ( hitPlane.position());
    LocalVector ldir = gluedPlane.toLocal(gdir);
    LocalPoint lhitPos = gluedPlane.toLocal( hit.globalPosition());
    LocalPoint projectedHitPos = lhitPos - ldir * delta/ldir.z();

    LocalVector hitXAxis = gluedPlane.toLocal( hitPlane.toGlobal( LocalVector(1,0,0)));
    LocalError hitErr = hit.localPositionError();
    if (gluedPlane.normalVector().dot( hitPlane.normalVector()) < 0) {
      // the two planes are inverted, and the correlation element must change sign
      hitErr = LocalError( hitErr.xx(), -hitErr.xy(), hitErr.yy());
    }
    LocalError rotatedError = hitErr.rotate( hitXAxis.x(), hitXAxis.y());
    
    return ResultingHit::build( projectedHitPos, rotatedError, &det, hit.det(), hit);
  }
template<class ResultingHit>
RecHitPointer TrackingRecHitProjector< ResultingHit >::project ( const TransientTrackingRecHit hit,
const GeomDet det 
) const [inline]