CMS 3D CMS Logo

List of all members | Public Member Functions
TrajectoryExtrapolatorToLine Class Reference

#include <TrajectoryExtrapolatorToLine.h>

Public Member Functions

TrajectoryStateOnSurface extrapolate (const FreeTrajectoryState &fts, const Line &L, const Propagator &p) const
 extrapolation with user-supplied propagator More...
 

Detailed Description

Definition at line 8 of file TrajectoryExtrapolatorToLine.h.

Member Function Documentation

◆ extrapolate()

TrajectoryStateOnSurface TrajectoryExtrapolatorToLine::extrapolate ( const FreeTrajectoryState fts,
const Line L,
const Propagator p 
) const

extrapolation with user-supplied propagator

Definition at line 9 of file TrajectoryExtrapolatorToLine.cc.

11  {
12  DeepCopyPointerByClone<Propagator> p(aPropagator.clone());
13  p->setPropagationDirection(anyDirection);
14 
15  FreeTrajectoryState fastFts(fts.parameters(), fts.curvilinearError());
16  GlobalVector T1 = fastFts.momentum().unit();
17  GlobalPoint T0 = fastFts.position();
18  double distance = 9999999.9;
19  double old_distance;
20  int n_iter = 0;
21  bool refining = true;
22 
23  LogDebug("TrajectoryExtrapolatorToLine") << "START REFINING";
24  while (refining) {
25  LogDebug("TrajectoryExtrapolatorToLine") << "Refining cycle...";
26  // describe orientation of target surface on basis of track parameters
27  n_iter++;
28  Line T(T0, T1);
29  GlobalPoint B = T.closerPointToLine(L);
30  old_distance = distance;
31 
32  //create surface
33  GlobalPoint BB = B + 0.3 * (T0 - B);
35  GlobalVector XX(T1.y(), -T1.x(), 0.);
36  GlobalVector YY(T1.cross(XX));
39  LogDebug("TrajectoryExtrapolatorToLine") << "Current plane position: " << surface->toGlobal(LocalPoint(0., 0., 0.));
40  LogDebug("TrajectoryExtrapolatorToLine") << "Current plane normal: " << surface->toGlobal(LocalVector(0, 0, 1));
41  LogDebug("TrajectoryExtrapolatorToLine") << "Current momentum: " << T1;
42 
43  // extrapolate fastFts to target surface
44  TrajectoryStateOnSurface tsos = p->propagate(fastFts, *surface);
45 
46  if (!tsos.isValid()) {
47  LogDebug("TrajectoryExtrapolatorToLine") << "TETL - extrapolation failed";
48  return tsos;
49  } else {
50  T0 = tsos.globalPosition();
51  T1 = tsos.globalMomentum().unit();
52  GlobalVector D = L.distance(T0);
53  distance = D.mag();
54  if (fabs(old_distance - distance) < 0.000001) {
55  refining = false;
56  }
57  if (old_distance - distance < 0.) {
58  refining = false;
59  LogDebug("TrajectoryExtrapolatorToLine") << "TETL- stop to skip loops";
60  }
61  }
62  }
63  //
64  // Now propagate with errors and (not for the moment) perform rotation
65  //
66  // Origin of local system: point of closest approach on the line
67  // (w.r.t. to tangent to helix at last iteration)
68  //
69  Line T(T0, T1);
70  GlobalPoint origin(L.closerPointToLine(T));
71  //
72  // Axes of local system:
73  // x from line to helix at closest approach
74  // z along the helix
75  // y to complete right-handed system
76  //
77  GlobalVector ZZ(T1.unit());
78  GlobalVector YY(ZZ.cross(T0 - origin).unit());
79  GlobalVector XX(YY.cross(ZZ));
82  TrajectoryStateOnSurface tsos = p->propagate(fts, *surface);
83 
84  return tsos;
85 }

References anyDirection, TtFullHadDaughter::B, Plane::build(), Propagator::clone(), FreeTrajectoryState::curvilinearError(), HLT_FULL_cff::distance, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), dttmaxenums::L, LogDebug, AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::parameters(), makeMuonMisalignmentScenario::rot, Vector3DBase< T, FrameTag >::unit(), XX, AlignmentPI::YY, and AlignmentPI::ZZ.

Referenced by TSCBLBuilderWithPropagator::operator()().

Vector3DBase
Definition: Vector3DBase.h:8
TkRotation< float >
dttmaxenums::L
Definition: DTTMax.h:29
anyDirection
Definition: PropagationDirection.h:4
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
AlignmentPI::YY
Definition: AlignmentPayloadInspectorHelper.h:46
ReferenceCountingPointer< Plane >
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
DeepCopyPointerByClone< Propagator >
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
Point3DBase< float, GlobalTag >
Plane::build
static PlanePointer build(Args &&... args)
Definition: Plane.h:33
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
Line
Definition: Line.h:10
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
T
long double T
Definition: Basic3DVectorLD.h:48
AlignmentPI::ZZ
Definition: AlignmentPayloadInspectorHelper.h:46
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7799
XX
double XX[2]
Definition: herwig.h:145
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54