CMS 3D CMS Logo

TSCPBuilderNoMaterial.cc
Go to the documentation of this file.
10 
12  const GlobalPoint& referencePoint) const {
13  if (positionEqual(referencePoint, originalFTS.position()))
14  return constructTSCP(originalFTS, referencePoint);
15 
16  // Now do the propagation or whatever...
17 
18  PairBoolFTS newStatePair = createFTSatTransverseImpactPoint(originalFTS, referencePoint);
19  if (newStatePair.first) {
20  return constructTSCP(newStatePair.second, referencePoint);
21  } else {
23  }
24 }
25 
27  const GlobalPoint& referencePoint) const {
28  if (positionEqual(referencePoint, originalTSOS.globalPosition()))
29  return constructTSCP(*originalTSOS.freeState(), referencePoint);
30 
31  // Now do the propagation
32 
33  PairBoolFTS newStatePair = createFTSatTransverseImpactPoint(*originalTSOS.freeState(), referencePoint);
34  if (newStatePair.first) {
35  return constructTSCP(newStatePair.second, referencePoint);
36  } else {
38  }
39 }
40 
42  const FTS& originalFTS, const GlobalPoint& referencePoint) const {
43  //
44  // Straight line approximation? |rho|<1.e-10 equivalent to ~ 1um
45  // difference in transversal position at 10m.
46  //
47  if (fabs(originalFTS.transverseCurvature()) < 1.e-10) {
48  return createFTSatTransverseImpactPointNeutral(originalFTS, referencePoint);
49  } else {
50  return createFTSatTransverseImpactPointCharged(originalFTS, referencePoint);
51  }
52 }
53 
55  const FTS& originalFTS, const GlobalPoint& referencePoint) const {
56  GlobalVector pvecOrig = originalFTS.momentum();
57  GlobalPoint xvecOrig = originalFTS.position();
58  double kappa = originalFTS.transverseCurvature();
59  double pxOrig = pvecOrig.x();
60  double pyOrig = pvecOrig.y();
61  double pzOrig = pvecOrig.z();
62  double xOrig = xvecOrig.x();
63  double yOrig = xvecOrig.y();
64  double zOrig = xvecOrig.z();
65 
66  // double fac = 1./originalFTS.charge()/MagneticField::inInverseGeV(referencePoint).z();
67  double fac = 1. / originalFTS.charge() / (originalFTS.parameters().magneticField().inInverseGeV(referencePoint).z());
68  GlobalVectorDouble xOrig2Centre = GlobalVectorDouble(fac * pyOrig, -fac * pxOrig, 0.);
69  GlobalVectorDouble xOrigProj = GlobalVectorDouble(xOrig, yOrig, 0.);
70  GlobalVectorDouble xRefProj = GlobalVectorDouble(referencePoint.x(), referencePoint.y(), 0.);
71  GlobalVectorDouble deltax = xRefProj - xOrigProj - xOrig2Centre;
72  GlobalVectorDouble ndeltax = deltax.unit();
73 
75  Surface::PositionType pos(referencePoint);
76  // Need to define plane with orientation as the
77  // ImpactPointSurface
78  GlobalVector X(ndeltax.x(), ndeltax.y(), ndeltax.z());
79  GlobalVector Y(0., 0., 1.);
81  BoundPlane* plane = new BoundPlane(pos, rot);
82  // Using Teddy's HelixBarrelPlaneCrossingByCircle for general barrel planes.
83  // A large variety of other,
84  // direct solutions turned out to be not so stable numerically.
85  HelixBarrelPlaneCrossingByCircle planeCrossing(HelixPlaneCrossing::PositionType(xOrig, yOrig, zOrig),
86  HelixPlaneCrossing::DirectionType(pxOrig, pyOrig, pzOrig),
87  kappa,
88  direction);
89  std::pair<bool, double> propResult = planeCrossing.pathLength(*plane);
90  if (!propResult.first) {
91  edm::LogWarning("TSCPBuilderNoMaterial") << "Propagation to perigee plane failed!";
92  return PairBoolFTS(false, FreeTrajectoryState());
93  }
94  double s = propResult.second;
95  HelixPlaneCrossing::PositionType xGen = planeCrossing.position(s);
96  GlobalPoint xPerigee = GlobalPoint(xGen.x(), xGen.y(), xGen.z());
97  // direction (reconverted to GlobalVector, renormalised)
98  HelixPlaneCrossing::DirectionType pGen = planeCrossing.direction(s);
99  pGen *= pvecOrig.mag() / pGen.mag();
100  GlobalVector pPerigee = GlobalVector(pGen.x(), pGen.y(), pGen.z());
101  delete plane;
102 
103  if (originalFTS.hasError()) {
104  const AlgebraicSymMatrix55& errorMatrix = originalFTS.curvilinearError().matrix();
105  AnalyticalCurvilinearJacobian curvilinJacobian(originalFTS.parameters(), xPerigee, pPerigee, s);
106  const AlgebraicMatrix55& jacobian = curvilinJacobian.jacobian();
107  CurvilinearTrajectoryError cte(ROOT::Math::Similarity(jacobian, errorMatrix));
108 
109  return PairBoolFTS(
110  true,
112  xPerigee, pPerigee, originalFTS.charge(), &(originalFTS.parameters().magneticField())),
113  cte));
114  } else {
115  return PairBoolFTS(true,
117  xPerigee, pPerigee, originalFTS.charge(), &(originalFTS.parameters().magneticField()))));
118  }
119 }
120 
122  const FTS& originalFTS, const GlobalPoint& referencePoint) const {
123  GlobalPoint xvecOrig = originalFTS.position();
124  double phi = originalFTS.momentum().phi();
125  double theta = originalFTS.momentum().theta();
126  double xOrig = xvecOrig.x();
127  double yOrig = xvecOrig.y();
128  double zOrig = xvecOrig.z();
129  double xR = referencePoint.x();
130  double yR = referencePoint.y();
131 
132  double s2D = (xR - xOrig) * cos(phi) + (yR - yOrig) * sin(phi);
133  double s = s2D / sin(theta);
134  double xGen = xOrig + s2D * cos(phi);
135  double yGen = yOrig + s2D * sin(phi);
136  double zGen = zOrig + s2D / tan(theta);
137  GlobalPoint xPerigee = GlobalPoint(xGen, yGen, zGen);
138 
139  GlobalVector pPerigee = originalFTS.momentum();
140 
141  if (originalFTS.hasError()) {
142  const AlgebraicSymMatrix55& errorMatrix = originalFTS.curvilinearError().matrix();
143  AnalyticalCurvilinearJacobian curvilinJacobian(originalFTS.parameters(), xPerigee, pPerigee, s);
144  const AlgebraicMatrix55& jacobian = curvilinJacobian.jacobian();
145  CurvilinearTrajectoryError cte(ROOT::Math::Similarity(jacobian, errorMatrix));
146 
147  return PairBoolFTS(
148  true,
150  xPerigee, pPerigee, originalFTS.charge(), &(originalFTS.parameters().magneticField())),
151  cte));
152  } else {
153  return PairBoolFTS(true,
155  xPerigee, pPerigee, originalFTS.charge(), &(originalFTS.parameters().magneticField()))));
156  }
157 }
Vector3DBase
Definition: Vector3DBase.h:8
TSCPBuilderNoMaterial::createFTSatTransverseImpactPointCharged
PairBoolFTS createFTSatTransverseImpactPointCharged(const FTS &originalFTS, const GlobalPoint &referencePoint) const
Definition: TSCPBuilderNoMaterial.cc:54
TkRotation< float >
FreeTrajectoryState::momentum
GlobalVector momentum() const
Definition: FreeTrajectoryState.h:68
anyDirection
Definition: PropagationDirection.h:4
AnalyticalCurvilinearJacobian::jacobian
const AlgebraicMatrix55 & jacobian() const
Definition: AnalyticalCurvilinearJacobian.h:51
AnalyticalCurvilinearJacobian
Definition: AnalyticalCurvilinearJacobian.h:21
FreeTrajectoryState.h
MessageLogger.h
FreeTrajectoryState::hasError
bool hasError() const
Definition: FreeTrajectoryState.h:77
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
X
#define X(str)
Definition: MuonsGrabber.cc:38
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
FreeTrajectoryState::charge
TrackCharge charge() const
Definition: FreeTrajectoryState.h:69
AnalyticalCurvilinearJacobian.h
FreeTrajectoryState::position
GlobalPoint position() const
Definition: FreeTrajectoryState.h:67
HLTEgPhaseIITestSequence_cff.kappa
kappa
Definition: HLTEgPhaseIITestSequence_cff.py:1343
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TrajectoryStateExceptions.h
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrajectoryStateClosestToPointBuilder::positionEqual
static bool positionEqual(const GlobalPoint &ptB, const GlobalPoint &ptA)
Definition: TrajectoryStateClosestToPointBuilder.h:26
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
HelixBarrelPlaneCrossingByCircle::pathLength
std::pair< bool, double > pathLength(const Plane &) override
Definition: HelixBarrelPlaneCrossingByCircle.cc:47
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic3DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic3DVector.h:97
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TrajectoryStateOnSurface::freeState
FreeTrajectoryState const * freeState(bool withErrors=true) const
Definition: TrajectoryStateOnSurface.h:58
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
Surface.h
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
TSCPBuilderNoMaterial::operator()
TrajectoryStateClosestToPoint operator()(const FTS &originalFTS, const GlobalPoint &referencePoint) const override
Definition: TSCPBuilderNoMaterial.cc:11
TSCPBuilderNoMaterial::GlobalVectorDouble
Vector3DBase< double, GlobalTag > GlobalVectorDouble
Definition: TSCPBuilderNoMaterial.h:27
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
MagneticField::inInverseGeV
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
HelixBarrelPlaneCrossingByCircle::direction
DirectionType direction(double s) const override
Definition: HelixBarrelPlaneCrossingByCircle.cc:168
HelixBarrelPlaneCrossingByCircle
Definition: HelixBarrelPlaneCrossingByCircle.h:13
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
FreeTrajectoryState::parameters
const GlobalTrajectoryParameters & parameters() const
Definition: FreeTrajectoryState.h:79
TSCPBuilderNoMaterial::PairBoolFTS
std::pair< bool, FreeTrajectoryState > PairBoolFTS
Definition: TSCPBuilderNoMaterial.h:28
TrajectoryStateClosestToPointBuilder::constructTSCP
static TrajectoryStateClosestToPoint constructTSCP(const FTS &originalFTS, const GlobalPoint &referencePoint)
Definition: TrajectoryStateClosestToPointBuilder.h:29
MagneticField.h
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
TSCPBuilderNoMaterial.h
DDAxes::phi
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
HelixBarrelPlaneCrossingByCircle::position
PositionType position(double s) const override
Definition: HelixBarrelPlaneCrossingByCircle.cc:149
BoundPlane
Plane BoundPlane
Definition: Plane.h:94
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
BoundPlane
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Basic3DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic3DVector.h:94
BeamSpotPI::Y
Definition: BeamSpotPayloadInspectorHelper.h:32
GlobalTrajectoryParameters::magneticField
const MagneticField & magneticField() const
Definition: GlobalTrajectoryParameters.h:106
BoundPlane.h
TSCPBuilderNoMaterial::createFTSatTransverseImpactPointNeutral
PairBoolFTS createFTSatTransverseImpactPointNeutral(const FTS &originalFTS, const GlobalPoint &referencePoint) const
Definition: TSCPBuilderNoMaterial.cc:121
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
Basic3DVector::z
T z() const
Cartesian z coordinate.
Definition: extBasic3DVector.h:100
FreeTrajectoryState::transverseCurvature
double transverseCurvature() const
Definition: FreeTrajectoryState.h:71
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Basic3DVector< float >
CurvilinearTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: CurvilinearTrajectoryError.h:61
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HelixBarrelPlaneCrossingByCircle.h
TSCPBuilderNoMaterial::createFTSatTransverseImpactPoint
PairBoolFTS createFTSatTransverseImpactPoint(const FTS &originalFTS, const GlobalPoint &referencePoint) const
Definition: TSCPBuilderNoMaterial.cc:41