CMS 3D CMS Logo

TransverseImpactPointExtrapolator.cc
Go to the documentation of this file.
4 
11 
13 
15 
17  : thePropagator(new AnalyticalPropagator(field, anyDirection)) {}
18 
21 }
22 
24  const GlobalPoint& vtx) const {
25  return doExtrapolation(fts, vtx, *thePropagator);
26 }
27 
29  const GlobalPoint& vtx) const {
30  if (!tsos.isValid())
31  return tsos;
32  return doExtrapolation(tsos, vtx, *thePropagator);
33 }
34 
36  const GlobalPoint& vtx,
37  const Propagator& p) const {
38  //
39  // set propagator for bidirectional propagation
40  //
41  std::unique_ptr<Propagator> p_cloned = SetPropagationDirection(p, anyDirection);
42  return doExtrapolation(fts, vtx, *(p_cloned.get()));
43 }
44 
46  const GlobalPoint& vtx,
47  const Propagator& p) const {
48  if (!tsos.isValid())
49  return tsos;
50  //
51  // set propagator for bidirectional propagation
52  //
53  std::unique_ptr<Propagator> p_cloned = SetPropagationDirection(p, anyDirection);
54  return doExtrapolation(tsos, vtx, *(p_cloned.get()));
55 }
56 
58  const GlobalPoint& vtx,
59  const Propagator& p) const {
60  //
61  // Compute tip surface
62  //
63  if (fabs(tsos.freeState()->transverseCurvature()) < 1.E-6) {
64  LogDebug("TransverseImpactPointExtrapolator") << "negligeable curvature: using a trick to extrapolate:\n" << tsos;
65 
66  //0T field probably
67  //x is perpendicular to the momentum
68  GlobalVector xLocal = GlobalVector(-tsos.globalMomentum().y(), tsos.globalMomentum().x(), 0).unit();
69  //y along global Z
70  GlobalVector yLocal(0., 0., 1.);
71  //z accordingly
72  GlobalVector zLocal(xLocal.cross(yLocal));
73 
74  const Surface::PositionType& origin(vtx);
75  Surface::RotationType rotation(xLocal, yLocal, zLocal);
77 
78  return p.propagate(*tsos.freeState(), *surface);
79  } else {
81  tipSurface(tsos.globalPosition(), tsos.globalMomentum(), 1. / tsos.transverseCurvature(), vtx);
82  //
83  // propagate
84  //
85  return p.propagate(tsos, *surface);
86  }
87 }
88 
90  const GlobalPoint& vtx,
91  const Propagator& p) const {
92  //
93  // Compute tip surface
94  //
95  if (fabs(fts.transverseCurvature()) < 1.E-6) {
96  LogDebug("TransverseImpactPointExtrapolator") << "negligeable curvature: using a trick to extrapolate:\n" << fts;
97 
98  //0T field probably
99  //x is perpendicular to the momentum
100  GlobalVector xLocal = GlobalVector(-fts.momentum().y(), fts.momentum().x(), 0).unit();
101  //y along global Z
102  GlobalVector yLocal(0., 0., 1.);
103  //z accordingly
104  GlobalVector zLocal(xLocal.cross(yLocal));
105 
106  const Surface::PositionType& origin(vtx);
107  Surface::RotationType rotation(xLocal, yLocal, zLocal);
109 
110  return p.propagate(fts, *surface);
111  } else {
113  tipSurface(fts.position(), fts.momentum(), 1. / fts.transverseCurvature(), vtx);
114  //
115  // propagate
116  //
117  return p.propagate(fts, *surface);
118  }
119 }
120 
122  const GlobalVector& momentum,
123  const double& signedTransverseRadius,
124  const GlobalPoint& vertex) const {
125  LogDebug("TransverseImpactPointExtrapolator") << position << "\n"
126  << momentum << "\n"
127  << "signedTransverseRadius : " << signedTransverseRadius << "\n"
128  << vertex;
129 
130  typedef Point2DBase<double, GlobalTag> PositionType2D;
131  typedef Vector2DBase<double, GlobalTag> DirectionType2D;
132 
133  PositionType2D x0(position.x(), position.y());
134  DirectionType2D t0(-momentum.y(), momentum.x());
135  t0 = t0 / t0.mag();
136 
137  PositionType2D xc(x0 + signedTransverseRadius * t0);
138 
139  DirectionType2D vtxDirection(xc.x() - vertex.x(), xc.y() - vertex.y());
140  double vtxDistance = vtxDirection.mag();
141 
142  const Surface::PositionType& origin(vertex);
143  GlobalVector xLocal(vtxDirection.x() / vtxDistance, vtxDirection.y() / vtxDistance, 0.);
144  if (vtxDistance < fabs(signedTransverseRadius)) {
145  LogDebug("TransverseImpactPointExtrapolator") << "Inverting the x axis.";
146  xLocal = -xLocal;
147  }
148  GlobalVector yLocal(0., 0., 1.);
149  GlobalVector zLocal(xLocal.cross(yLocal));
150  if (zLocal.dot(momentum) < 0.) {
151  LogDebug("TransverseImpactPointExtrapolator") << "Inverting the y,z frame.";
152  yLocal = -yLocal;
153  zLocal = -zLocal;
154  }
155  Surface::RotationType rotation(xLocal, yLocal, zLocal);
156 
157  LogDebug("TransverseImpactPointExtrapolator") << "plane center: " << origin << "\n"
158  << "plane rotation axis:\n"
159  << xLocal << "\n"
160  << yLocal << "\n"
161  << zLocal << "\n"
162  << "x0: " << x0 << "\n"
163  << "t0: " << t0 << "\n"
164  << "xc: " << xc << "\n"
165  << "vtxDirection: " << vtxDirection;
166 
167  return PlaneBuilder().plane(origin, rotation);
168 }
Vector3DBase
Definition: Vector3DBase.h:8
TransverseImpactPointExtrapolator::doExtrapolation
TrajectoryStateOnSurface doExtrapolation(const TrajectoryStateOnSurface tsos, const GlobalPoint &vtx, const Propagator &u) const
extrapolation of (multi) TSOS with (internal or user-supplied) propagator
Definition: TransverseImpactPointExtrapolator.cc:57
Point2DBase
Definition: Point2DBase.h:9
TkRotation< float >
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateOnSurface.h
anyDirection
Definition: PropagationDirection.h:4
FreeTrajectoryState.h
MessageLogger.h
TransverseImpactPointExtrapolator::tipSurface
ReferenceCountingPointer< Plane > tipSurface(const GlobalPoint &position, const GlobalVector &momentum, const double &signedTransverseRadius, const GlobalPoint &vtx) const
computation of the TIP surface
Definition: TransverseImpactPointExtrapolator.cc:121
TransverseImpactPointExtrapolator::TransverseImpactPointExtrapolator
TransverseImpactPointExtrapolator()
constructor with default geometrical propagator
Definition: TransverseImpactPointExtrapolator.cc:14
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
Point2DBase.h
SetPropagationDirection
std::unique_ptr< Propagator > SetPropagationDirection(Propagator const &iprop, PropagationDirection dir)
Definition: HelperPropagatorUtility.cc:5
TrajectoryStateOnSurface::transverseCurvature
double transverseCurvature() const
Definition: TrajectoryStateOnSurface.h:70
ReferenceCountingPointer< Plane >
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PlaneBuilder.h
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
Surface.h
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
FrontierCondition_GT_autoExpress_cfi.t0
t0
Definition: FrontierCondition_GT_autoExpress_cfi.py:149
Vector2DBase
Definition: Vector2DBase.h:8
Vector2DBase.h
Point3DBase< float, GlobalTag >
Propagator::setPropagationDirection
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
TransverseImpactPointExtrapolator::thePropagator
DeepCopyPointerByClone< Propagator > thePropagator
Definition: TransverseImpactPointExtrapolator.h:66
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
AnalyticalPropagator.h
PlaneBuilder::plane
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
PropagationDirection.h
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
AnalyticalPropagator
Definition: AnalyticalPropagator.h:22
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:19
TransverseImpactPointExtrapolator.h
TransverseImpactPointExtrapolator::extrapolate
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation with default (=geometrical) propagator
Definition: TransverseImpactPointExtrapolator.cc:23
PlaneBuilder
Definition: PlaneBuilder.h:13
MagneticField
Definition: MagneticField.h:19
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54