CMS 3D CMS Logo

AnalyticalImpactPointExtrapolator.cc
Go to the documentation of this file.
9 
10 // #include "CommonDet/DetUtilities/interface/DetailedDetTimer.h"
11 
13  : thePropagator(new AnalyticalPropagator(field, anyDirection)), theField(field) {}
14 
16  const MagneticField* field)
17  : thePropagator(propagator.clone()), theField(field) {
19 }
20 
22  const GlobalPoint& vtx) const {
23  // static TimingReport::Item& timer = detailedDetTimer("AnalyticalImpactPointExtrapolator");
24  // TimeMe t(timer,false);
25 
26  return extrapolateSingleState(fts, vtx);
27 }
28 
30  const GlobalPoint& vtx) const {
31  if (tsos.isValid())
32  return extrapolateFullState(tsos, vtx);
33  else
34  return tsos;
35 }
36 
38  const GlobalPoint& vertex) const {
39  //
40  // first determine IP plane using propagation with (single) FTS
41  // could be optimised (will propagate errors even if duplicated below)
42  //
44  if (!singleState.isValid() || tsos.singleState())
45  return singleState;
46  //
47  // propagate multiTsos to plane found above
48  //
49  return thePropagator->propagate(tsos, singleState.surface());
50 }
51 
53  const GlobalPoint& vertex) const {
54  //
55  // initialisation of position, momentum and transverse curvature
56  //
57  GlobalPoint x(fts.position());
58  GlobalVector p(fts.momentum());
59  double rho = fts.transverseCurvature();
60  //
61  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
62  // difference in transversal position at 10m.
63  //
64  double s(0);
65  if (fabs(rho) < 1.e-10) {
66  GlobalVector dx(p.dot(vertex - x) / p.mag2() * p);
67  x += dx;
68  float sign = p.dot(dx);
69  s = sign > 0 ? dx.mag() : -dx.mag();
70  }
71  //
72  // Helix case
73  //
74  else {
77  IterativeHelixExtrapolatorToLine extrapolator(helixPos, helixDir, rho, anyDirection);
78  if (!propagateWithHelix(extrapolator, vertex, x, p, s))
79  return TrajectoryStateOnSurface();
80  }
81  //
82  // Define target surface: origin on line, x_local from line
83  // to helix at closest approach, z_local along the helix
84  // and y_local to complete right-handed system
85  //
86  GlobalVector zLocal(p.unit());
87  GlobalVector yLocal(zLocal.cross(x - vertex).unit());
88  GlobalVector xLocal(yLocal.cross(zLocal));
89  Surface::RotationType rot(xLocal, yLocal, zLocal);
91  //
92  // Compute propagated state
93  //
95  if (fts.hasError()) {
96  //
97  // compute jacobian
98  //
99  AnalyticalCurvilinearJacobian analyticalJacobian(fts.parameters(), gtp.position(), gtp.momentum(), s);
101  ROOT::Math::Similarity(analyticalJacobian.jacobian(), fts.curvilinearError().matrix()));
102  return TrajectoryStateOnSurface(gtp, cte, *surface);
103  } else {
104  //
105  // return state without errors
106  //
107  return TrajectoryStateOnSurface(gtp, *surface);
108  }
109 }
110 
112  const GlobalPoint& vertex,
113  GlobalPoint& x,
114  GlobalVector& p,
115  double& s) const {
116  //
117  // save absolute value of momentum
118  //
119  double pmag(p.mag());
120  //
121  // get path length to solution
122  //
123  std::pair<bool, double> propResult = extrapolator.pathLength(vertex);
124  if (!propResult.first)
125  return false;
126  s = propResult.second;
127  //
128  // get point and (normalised) direction from path length
129  //
130  HelixLineExtrapolation::PositionType xGen = extrapolator.position(s);
132  //
133  // Fix normalisation and convert back to GlobalPoint / GlobalVector
134  //
135  x = GlobalPoint(xGen);
136  pGen *= pmag / pGen.mag();
137  p = GlobalVector(pGen);
138  //
139  return true;
140 }
Vector3DBase
Definition: Vector3DBase.h:8
IterativeHelixExtrapolatorToLine.h
TkRotation< float >
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
TrajectoryStateOnSurface.h
TrajectoryStateOnSurface::freeTrajectoryState
FreeTrajectoryState const * freeTrajectoryState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:60
anyDirection
Definition: PropagationDirection.h:4
AnalyticalCurvilinearJacobian
Definition: AnalyticalCurvilinearJacobian.h:21
FreeTrajectoryState.h
AnalyticalImpactPointExtrapolator::propagateWithHelix
bool propagateWithHelix(const IterativeHelixExtrapolatorToLine &extrapolator, const GlobalPoint &vertex, GlobalPoint &x, GlobalVector &p, double &s) const
the actual propagation to a new point & momentum vector
Definition: AnalyticalImpactPointExtrapolator.cc:111
AnalyticalImpactPointExtrapolator::extrapolateSingleState
TrajectoryStateOnSurface extrapolateSingleState(const FreeTrajectoryState &fts, const GlobalPoint &vertex) const
extrapolation of (single) FTS
Definition: AnalyticalImpactPointExtrapolator.cc:52
AnalyticalImpactPointExtrapolator.h
FreeTrajectoryState::hasError
bool hasError() const
Definition: FreeTrajectoryState.h:77
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FreeTrajectoryState::charge
TrackCharge charge() const
Definition: FreeTrajectoryState.h:69
AnalyticalImpactPointExtrapolator::AnalyticalImpactPointExtrapolator
AnalyticalImpactPointExtrapolator(const MagneticField *field)
constructor with default geometrical propagator
Definition: AnalyticalImpactPointExtrapolator.cc:12
IterativeHelixExtrapolatorToLine
Definition: IterativeHelixExtrapolatorToLine.h:13
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
IterativeHelixExtrapolatorToLine::pathLength
std::pair< bool, double > pathLength(const GlobalPoint &point) const override
Definition: IterativeHelixExtrapolatorToLine.cc:37
AnalyticalCurvilinearJacobian.h
ReferenceCountingPointer< Plane >
DDAxes::x
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
Basic3DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic3DVector.h:116
Propagator
Definition: Propagator.h:44
Plane.h
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PlaneBuilder.h
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
clone
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
IterativeHelixExtrapolatorToLine::position
PositionType position(double s) const override
Definition: IterativeHelixExtrapolatorToLine.cc:128
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
Propagator::setPropagationDirection
virtual void setPropagationDirection(PropagationDirection dir)
Definition: Propagator.h:130
DDAxes::rho
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
AnalyticalImpactPointExtrapolator::extrapolateFullState
TrajectoryStateOnSurface extrapolateFullState(const TrajectoryStateOnSurface tsos, const GlobalPoint &vertex) const
extrapolation of (multi) TSOS
Definition: AnalyticalImpactPointExtrapolator.cc:37
AnalyticalPropagator.h
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
AnalyticalImpactPointExtrapolator::extrapolate
TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &fts, const GlobalPoint &vtx) const
extrapolation from FreeTrajectoryState
Definition: AnalyticalImpactPointExtrapolator.cc:21
PlaneBuilder::plane
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
AnalyticalPropagator
Definition: AnalyticalPropagator.h:22
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
TrajectoryStateOnSurface::singleState
bool singleState() const
Definition: TrajectoryStateOnSurface.h:86
genVertex_cff.x
x
Definition: genVertex_cff.py:12
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
IterativeHelixExtrapolatorToLine::direction
DirectionType direction(double s) const override
Definition: IterativeHelixExtrapolatorToLine.cc:174
AnalyticalImpactPointExtrapolator::theField
const MagneticField * theField
Definition: AnalyticalImpactPointExtrapolator.h:53
TrajectoryStateOnSurface::surface
const SurfaceType & surface() const
Definition: TrajectoryStateOnSurface.h:78
PlaneBuilder
Definition: PlaneBuilder.h:13
MagneticField
Definition: MagneticField.h:19
PVValHelper::dx
Definition: PVValidationHelpers.h:48
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
Basic3DVector< float >
CurvilinearTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: CurvilinearTrajectoryError.h:61
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
AnalyticalImpactPointExtrapolator::thePropagator
DeepCopyPointerByClone< Propagator > thePropagator
Definition: AnalyticalImpactPointExtrapolator.h:52
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37