CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TrackingRecHitPropagator Class Reference

#include <TrackingRecHitPropagator.h>

Public Member Functions

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

Private Attributes

const AnalyticalPropagatorthePropagator
 

Detailed Description

Definition at line 21 of file TrackingRecHitPropagator.h.

Constructor & Destructor Documentation

◆ TrackingRecHitPropagator()

TrackingRecHitPropagator::TrackingRecHitPropagator ( const MagneticField magf)
inline

◆ ~TrackingRecHitPropagator()

TrackingRecHitPropagator::~TrackingRecHitPropagator ( )
inline

Definition at line 27 of file TrackingRecHitPropagator.h.

27 { delete thePropagator; }

References thePropagator.

Member Function Documentation

◆ project()

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

Definition at line 30 of file TrackingRecHitPropagator.h.

33  {
34  TkClonerImpl hc = static_cast<TkTransientTrackingRecHitBuilder const*>(builder)->cloner();
35 
36  //1) propagate the best possible track parameters to the surface of the hit you want to "move" using a AnalyticalPropagator ;
37  //2) create LocalTrajectoryParameters with the local x,y of the hit and direction + momentum from the propagated track parameters;
38  //3) create a LocalTrajectoryError matrix which is 0 except for the local x,y submatrix, which is filled with the hit errors;
39  //4) create a TSOS from the result of 2) and 3) and propagate it to the reference surface;
40  //5) create a new hit with the local x,y subspace of the result of 4)
41  if (!ts.isValid())
42  return std::make_shared<InvalidTrackingRecHit>(*hit->det(), TrackingRecHit::missing);
43  // LogTrace("SiTrackerMultiRecHitUpdator") << "the tsos is valid";
44  //check if the ts lays or not on the destination surface and in case propagate it
45  TrajectoryStateOnSurface propagated = ts;
46  if (hit->surface() != &(ts.surface()))
47  propagated = thePropagator->propagate(ts, *(hit->surface()));
48  if (!propagated.isValid())
49  return std::make_shared<InvalidTrackingRecHit>(*hit->det(), TrackingRecHit::missing);
50  // LogTrace("SiTrackerMultiRecHitUpdator") << "the propagate tsos is valid";
51  // LogTrace("SiTrackerMultiRecHitUpdator") << "Original: position: "<<hit->parameters()<<" error: "<<hit->parametersError()<<std::endl;
52  //clone the original hit with this state
53  TrackingRecHit::RecHitPointer updatedOriginal = hc.makeShared(hit, propagated);
54  // LogTrace("SiTrackerMultiRecHitUpdator") << "New: position: "<<updatedOriginal->parameters()<<" error: "<<updatedOriginal->parametersError()<<std::endl;
55 
56  // LogTrace("SiTrackerMultiRecHitUpdator") << "rechit cloned";
57  LocalTrajectoryParameters ltp(updatedOriginal->localPosition(), propagated.localMomentum(), propagated.charge());
59  ltem(3, 3) = (updatedOriginal->parametersError())(1, 1);
60  ltem(4, 4) = (updatedOriginal->parametersError())(2, 2);
61  ltem(3, 4) = (updatedOriginal->parametersError())(1, 2);
62  // LogTrace("SiTrackerMultiRecHitUpdator") <<"The cov matrix: "<<ltem<<std::endl;
63  LocalTrajectoryError lte(ltem);
64  // LogTrace("SiTrackerMultiRecHitUpdator") <<"Original cov matrix: "<<lte.matrix()<<std::endl;
65  TrajectoryStateOnSurface hit_state(ltp, lte, propagated.surface(), propagated.magneticField());
66  TrajectoryStateOnSurface projected_hit_state = thePropagator->propagate(hit_state, det.surface());
67  if (!projected_hit_state.isValid())
68  return std::make_shared<InvalidTrackingRecHit>(*hit->det(), TrackingRecHit::missing);
69  LocalPoint p = projected_hit_state.localPosition();
70  LocalError e = projected_hit_state.localError().positionError();
71  // LogTrace("SiTrackerMultiRecHitUpdator") << "position: "<<p<<" error: "<<e<<std::endl;
72  //AlgebraicSymMatrix55 projm=projected_hit_state.localError().matrix();
73  // for(int i=0;i<5;i++){
74  // LogTrace("SiTrackerMultiRecHitUpdator") <<"cov matrix: "<<projm<<std::endl;
75  // }
76  return ResultingHit::build(p, e, &det, updatedOriginal->det(), updatedOriginal, this);
77  }

References newFWLiteAna::build, TrajectoryStateOnSurface::charge(), MillePedeFileConverter_cfg::e, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localMomentum(), TrajectoryStateOnSurface::magneticField(), TkClonerImpl::makeShared(), TrackingRecHit::missing, AlCaHLTBitMon_ParallelJobs::p, AnalyticalPropagator::propagate(), GeomDet::surface(), TrajectoryStateOnSurface::surface(), and thePropagator.

Referenced by GenericProjectedRecHit2D::clone(), and SiTrackerMultiRecHitUpdator::update().

Member Data Documentation

◆ thePropagator

const AnalyticalPropagator* TrackingRecHitPropagator::thePropagator
private
TrajectoryStateOnSurface::localMomentum
LocalVector localMomentum() const
Definition: TrajectoryStateOnSurface.h:75
anyDirection
Definition: PropagationDirection.h:4
TkClonerImpl::makeShared
TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const &hit, TrajectoryStateOnSurface const &tsos) const override
Definition: TkClonerImpl.cc:64
TrajectoryStateOnSurface::charge
TrackCharge charge() const
Definition: TrajectoryStateOnSurface.h:68
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
newFWLiteAna.build
build
Definition: newFWLiteAna.py:126
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
TrackingRecHitPropagator::thePropagator
const AnalyticalPropagator * thePropagator
Definition: TrackingRecHitPropagator.h:80
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Point3DBase< float, LocalTag >
AnalyticalPropagator_cfi.AnalyticalPropagator
AnalyticalPropagator
Definition: AnalyticalPropagator_cfi.py:3
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
LocalError
Definition: LocalError.h:12
TrackingRecHit::missing
Definition: TrackingRecHit.h:47
TkClonerImpl
Definition: TkClonerImpl.h:12
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
TrajectoryStateOnSurface::magneticField
const MagneticField * magneticField() const
Definition: TrajectoryStateOnSurface.h:62
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
hit
Definition: SiStripHitEffFromCalibTree.cc:88
AnalyticalPropagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37