CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TrackingRecHitPropagator Class Reference

#include <TrackingRecHitPropagator.h>

Public Member Functions

template<class ResultingHit >
TransientTrackingRecHit::RecHitPointer project (const TransientTrackingRecHit::ConstRecHitPointer hit, const GeomDet &det, const TrajectoryStateOnSurface ts) const
 
 TrackingRecHitPropagator (const MagneticField *magf)
 
 ~TrackingRecHitPropagator ()
 

Private Attributes

const AnalyticalPropagatorthePropagator
 

Detailed Description

Definition at line 18 of file TrackingRecHitPropagator.h.

Constructor & Destructor Documentation

TrackingRecHitPropagator::TrackingRecHitPropagator ( const MagneticField magf)
inline
TrackingRecHitPropagator::~TrackingRecHitPropagator ( )
inline

Definition at line 24 of file TrackingRecHitPropagator.h.

References thePropagator.

24 {delete thePropagator;}
const AnalyticalPropagator * thePropagator

Member Function Documentation

template<class ResultingHit >
TransientTrackingRecHit::RecHitPointer TrackingRecHitPropagator::project ( const TransientTrackingRecHit::ConstRecHitPointer  hit,
const GeomDet det,
const TrajectoryStateOnSurface  ts 
) const
inline

Definition at line 26 of file TrackingRecHitPropagator.h.

References InvalidTransientRecHit::build(), newFWLiteAna::build, TrajectoryStateOnSurface::charge(), alignCSCRings::e, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::magneticField(), AlCaHLTBitMon_ParallelJobs::p, AnalyticalPropagator::propagate(), GeomDet::surface(), TrajectoryStateOnSurface::surface(), and thePropagator.

28  {
29  //1) propagate the best possible track parameters to the surface of the hit you want to "move" using a AnalyticalPropagator ;
30  //2) create LocalTrajectoryParameters with the local x,y of the hit and direction + momentum from the propagated track parameters;
31  //3) create a LocalTrajectoryError matrix which is 0 except for the local x,y submatrix, which is filled with the hit errors;
32  //4) create a TSOS from the result of 2) and 3) and propagate it to the reference surface;
33  //5) create a new hit with the local x,y subspace of the result of 4)
34  if (!ts.isValid()) return InvalidTransientRecHit::build(hit->det());
35  // LogTrace("SiTrackerMultiRecHitUpdator") << "the tsos is valid";
36  //check if the ts lays or not on the destination surface and in case propagate it
37  TrajectoryStateOnSurface propagated =ts;
38  if (hit->surface() != &(ts.surface())) propagated = thePropagator->propagate(ts, *(hit->surface()));
39  if (!propagated.isValid()) return InvalidTransientRecHit::build(hit->det());
40  // LogTrace("SiTrackerMultiRecHitUpdator") << "the propagate tsos is valid";
41  // LogTrace("SiTrackerMultiRecHitUpdator") << "Original: position: "<<hit->parameters()<<" error: "<<hit->parametersError()<<std::endl;
42  //clone the original hit with this state
43  TransientTrackingRecHit::RecHitPointer updatedOriginal = hit->clone(propagated);
44  // LogTrace("SiTrackerMultiRecHitUpdator") << "New: position: "<<updatedOriginal->parameters()<<" error: "<<updatedOriginal->parametersError()<<std::endl;
45 
46  // LogTrace("SiTrackerMultiRecHitUpdator") << "rechit cloned";
47  LocalTrajectoryParameters ltp(updatedOriginal->localPosition(), propagated.localMomentum(), propagated.charge());
49  ltem(3,3) = (updatedOriginal->parametersError())(1,1);
50  ltem(4,4) = (updatedOriginal->parametersError())(2,2);
51  ltem(3,4) = (updatedOriginal->parametersError())(1,2);
52  // LogTrace("SiTrackerMultiRecHitUpdator") <<"The cov matrix: "<<ltem<<std::endl;
53  LocalTrajectoryError lte(ltem);
54  // LogTrace("SiTrackerMultiRecHitUpdator") <<"Original cov matrix: "<<lte.matrix()<<std::endl;
55  TrajectoryStateOnSurface hit_state(ltp, lte, propagated.surface(), propagated.magneticField());
56  TrajectoryStateOnSurface projected_hit_state = thePropagator->propagate(hit_state, det.surface());
57  if (!projected_hit_state.isValid()) return InvalidTransientRecHit::build(hit->det());
58  LocalPoint p = projected_hit_state.localPosition();
59  LocalError e = projected_hit_state.localError().positionError();
60  // LogTrace("SiTrackerMultiRecHitUpdator") << "position: "<<p<<" error: "<<e<<std::endl;
61  //AlgebraicSymMatrix55 projm=projected_hit_state.localError().matrix();
62  // for(int i=0;i<5;i++){
63  // LogTrace("SiTrackerMultiRecHitUpdator") <<"cov matrix: "<<projm<<std::endl;
64  // }
65  return ResultingHit::build(p, e, &det, updatedOriginal->det(), updatedOriginal, this);
66  }
TrajectoryStateOnSurface propagate(const FreeTrajectoryState &fts, const Plane &plane) const
propagation to plane
static RecHitPointer build(const GeomDet *geom, Type type=TrackingRecHit::missing, const DetLayer *layer=0)
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const MagneticField * magneticField() const
LocalVector localMomentum() const
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const Surface & surface() const
const AnalyticalPropagator * thePropagator

Member Data Documentation

const AnalyticalPropagator* TrackingRecHitPropagator::thePropagator
private