CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions
TrackingRecHitProjector< ResultingHit > Class Template Reference

#include <TrackingRecHitProjector.h>

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
 
RecHitPointer project (const TransientTrackingRecHit &hit, const GeomDet &det, const GlobalVector &gdir) 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 14 of file TrackingRecHitProjector.h.

References TrajectoryStateOnSurface::globalParameters(), and GlobalTrajectoryParameters::momentum().

Referenced by CkfDebugger::analyseRecHitExistance(), TrackingRecHitProjector< ResultingHit >::project(), and ctfseeding::HitExtractorSTRP::project().

16  {
17 
19  return project(hit, det, gdir);
20  }
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
const GlobalTrajectoryParameters & globalParameters() const
template<class ResultingHit>
RecHitPointer TrackingRecHitProjector< ResultingHit >::project ( const TransientTrackingRecHit hit,
const GeomDet det 
) const
inline

Definition at line 21 of file TrackingRecHitProjector.h.

References TransientTrackingRecHit::globalPosition(), and TrackingRecHitProjector< ResultingHit >::project().

22  {
23  GlobalVector gdir = hit.globalPosition() - GlobalPoint(0,0,0);
24  return project(hit, det, gdir);
25  }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
RecHitPointer project(const TransientTrackingRecHit &hit, const GeomDet &det, const TrajectoryStateOnSurface &ts) const
virtual GlobalPoint globalPosition() const =0
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().

29  {
30  const BoundPlane& gluedPlane = det.surface();
31  const BoundPlane& hitPlane = hit.det()->surface();
32 
33  // check if the planes are parallel
34  //const float epsilon = 1.e-7; // corresponds to about 0.3 miliradian but cannot be reduced
35  // because of float precision
36 
37  //if (fabs(gluedPlane.normalVector().dot( hitPlane.normalVector())) < 1-epsilon) {
38  // std::cout << "TkGluedMeasurementDet plane not parallel to DetUnit plane: dot product is "
39  // << gluedPlane.normalVector().dot( hitPlane.normalVector()) << endl;
40  // FIXME: throw the appropriate exception here...
41  //throw MeasurementDetException("TkGluedMeasurementDet plane not parallel to DetUnit plane");
42  //}
43 
44  double delta = gluedPlane.localZ( hitPlane.position());
45  LocalVector ldir = gluedPlane.toLocal(gdir);
46  LocalPoint lhitPos = gluedPlane.toLocal( hit.globalPosition());
47  LocalPoint projectedHitPos = lhitPos - ldir * delta/ldir.z();
48 
49  LocalVector hitXAxis = gluedPlane.toLocal( hitPlane.toGlobal( LocalVector(1,0,0)));
50  LocalError hitErr = hit.localPositionError();
51  if (gluedPlane.normalVector().dot( hitPlane.normalVector()) < 0) {
52  // the two planes are inverted, and the correlation element must change sign
53  hitErr = LocalError( hitErr.xx(), -hitErr.xy(), hitErr.yy());
54  }
55  LocalError rotatedError = hitErr.rotate( hitXAxis.x(), hitXAxis.y());
56 
57  return ResultingHit::build( projectedHitPos, rotatedError, &det, hit.det(), hit);
58  }
dbl * delta
Definition: mlp_gen.cc:36
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
virtual const GeomDet * det() const =0
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
float xy() const
Definition: LocalError.h:25
virtual GlobalPoint globalPosition() const =0
float yy() const
Definition: LocalError.h:26
T z() const
Definition: PV3DBase.h:64
virtual LocalError localPositionError() const =0
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:39
T x() const
Definition: PV3DBase.h:62