CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions
TSCPBuilderNoMaterial Class Referencefinal

#include <TSCPBuilderNoMaterial.h>

Inheritance diagram for TSCPBuilderNoMaterial:
TrajectoryStateClosestToPointBuilder

Public Member Functions

TrajectoryStateClosestToPoint operator() (const FTS &originalFTS, const GlobalPoint &referencePoint) const override
 
TrajectoryStateClosestToPoint operator() (const TSOS &originalTSOS, const GlobalPoint &referencePoint) const override
 
 ~TSCPBuilderNoMaterial () override
 
- Public Member Functions inherited from TrajectoryStateClosestToPointBuilder
virtual ~TrajectoryStateClosestToPointBuilder ()
 

Private Types

typedef Point3DBase< double, GlobalTagGlobalPointDouble
 
typedef Vector3DBase< double, GlobalTagGlobalVectorDouble
 
typedef std::pair< bool, FreeTrajectoryStatePairBoolFTS
 

Private Member Functions

PairBoolFTS createFTSatTransverseImpactPoint (const FTS &originalFTS, const GlobalPoint &referencePoint) const
 
PairBoolFTS createFTSatTransverseImpactPointCharged (const FTS &originalFTS, const GlobalPoint &referencePoint) const
 
PairBoolFTS createFTSatTransverseImpactPointNeutral (const FTS &originalFTS, const GlobalPoint &referencePoint) const
 

Additional Inherited Members

- Public Types inherited from TrajectoryStateClosestToPointBuilder
typedef FreeTrajectoryState FTS
 
typedef TrajectoryStateOnSurface TSOS
 
- Static Public Member Functions inherited from TrajectoryStateClosestToPointBuilder
static bool positionEqual (const GlobalPoint &ptB, const GlobalPoint &ptA)
 
- Static Protected Member Functions inherited from TrajectoryStateClosestToPointBuilder
static TrajectoryStateClosestToPoint constructTSCP (const FTS &originalFTS, const GlobalPoint &referencePoint)
 

Detailed Description

This class builds a TrajectoryStateClosestToPoint given an original TrajectoryStateOnSurface or FreeTrajectoryState. This new state is then defined at the point of closest approach to the reference point. In case the propagation was not successful, this state can be invalid.

Definition at line 17 of file TSCPBuilderNoMaterial.h.

Member Typedef Documentation

◆ GlobalPointDouble

Definition at line 26 of file TSCPBuilderNoMaterial.h.

◆ GlobalVectorDouble

Definition at line 27 of file TSCPBuilderNoMaterial.h.

◆ PairBoolFTS

typedef std::pair<bool, FreeTrajectoryState> TSCPBuilderNoMaterial::PairBoolFTS
private

Definition at line 28 of file TSCPBuilderNoMaterial.h.

Constructor & Destructor Documentation

◆ ~TSCPBuilderNoMaterial()

TSCPBuilderNoMaterial::~TSCPBuilderNoMaterial ( )
inlineoverride

Definition at line 19 of file TSCPBuilderNoMaterial.h.

19 {}

Member Function Documentation

◆ createFTSatTransverseImpactPoint()

TSCPBuilderNoMaterial::PairBoolFTS TSCPBuilderNoMaterial::createFTSatTransverseImpactPoint ( const FTS originalFTS,
const GlobalPoint referencePoint 
) const
private

Definition at line 41 of file TSCPBuilderNoMaterial.cc.

42  {
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 }

References createFTSatTransverseImpactPointCharged(), createFTSatTransverseImpactPointNeutral(), MillePedeFileConverter_cfg::e, and FreeTrajectoryState::transverseCurvature().

Referenced by operator()().

◆ createFTSatTransverseImpactPointCharged()

TSCPBuilderNoMaterial::PairBoolFTS TSCPBuilderNoMaterial::createFTSatTransverseImpactPointCharged ( const FTS originalFTS,
const GlobalPoint referencePoint 
) const
private

Definition at line 54 of file TSCPBuilderNoMaterial.cc.

55  {
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 }

References anyDirection, FreeTrajectoryState::charge(), FreeTrajectoryState::curvilinearError(), HelixBarrelPlaneCrossingByCircle::direction(), FreeTrajectoryState::hasError(), MagneticField::inInverseGeV(), AnalyticalCurvilinearJacobian::jacobian(), HLTEgPhaseIITestSequence_cff::kappa, PV3DBase< T, PVType, FrameType >::mag(), GlobalTrajectoryParameters::magneticField(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), FreeTrajectoryState::parameters(), HelixBarrelPlaneCrossingByCircle::pathLength(), HelixBarrelPlaneCrossingByCircle::position(), FreeTrajectoryState::position(), makeMuonMisalignmentScenario::rot, alignCSCRings::s, FreeTrajectoryState::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), X, PV3DBase< T, PVType, FrameType >::x(), Basic3DVector< T >::x(), BeamSpotPI::Y, PV3DBase< T, PVType, FrameType >::y(), Basic3DVector< T >::y(), PV3DBase< T, PVType, FrameType >::z(), and Basic3DVector< T >::z().

Referenced by createFTSatTransverseImpactPoint().

◆ createFTSatTransverseImpactPointNeutral()

TSCPBuilderNoMaterial::PairBoolFTS TSCPBuilderNoMaterial::createFTSatTransverseImpactPointNeutral ( const FTS originalFTS,
const GlobalPoint referencePoint 
) const
private

Definition at line 121 of file TSCPBuilderNoMaterial.cc.

122  {
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 }

References FreeTrajectoryState::charge(), funct::cos(), FreeTrajectoryState::curvilinearError(), FreeTrajectoryState::hasError(), AnalyticalCurvilinearJacobian::jacobian(), GlobalTrajectoryParameters::magneticField(), CurvilinearTrajectoryError::matrix(), FreeTrajectoryState::momentum(), FreeTrajectoryState::parameters(), phi, PV3DBase< T, PVType, FrameType >::phi(), FreeTrajectoryState::position(), alignCSCRings::s, funct::sin(), funct::tan(), PV3DBase< T, PVType, FrameType >::theta(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by createFTSatTransverseImpactPoint().

◆ operator()() [1/2]

TrajectoryStateClosestToPoint TSCPBuilderNoMaterial::operator() ( const FTS originalFTS,
const GlobalPoint referencePoint 
) const
overridevirtual

Implements TrajectoryStateClosestToPointBuilder.

Definition at line 11 of file TSCPBuilderNoMaterial.cc.

12  {
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 }

References TrajectoryStateClosestToPointBuilder::constructTSCP(), createFTSatTransverseImpactPoint(), FreeTrajectoryState::position(), and TrajectoryStateClosestToPointBuilder::positionEqual().

◆ operator()() [2/2]

TrajectoryStateClosestToPoint TSCPBuilderNoMaterial::operator() ( const TSOS originalTSOS,
const GlobalPoint referencePoint 
) const
overridevirtual

Implements TrajectoryStateClosestToPointBuilder.

Definition at line 26 of file TSCPBuilderNoMaterial.cc.

27  {
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 }

References TrajectoryStateClosestToPointBuilder::constructTSCP(), createFTSatTransverseImpactPoint(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalPosition(), and TrajectoryStateClosestToPointBuilder::positionEqual().

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::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
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
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
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic3DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic3DVector.h:97
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
FreeTrajectoryState::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: FreeTrajectoryState.h:89
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
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
TrajectoryStateClosestToPoint
Definition: TrajectoryStateClosestToPoint.h:18
DDAxes::phi
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
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
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
TSCPBuilderNoMaterial::createFTSatTransverseImpactPoint
PairBoolFTS createFTSatTransverseImpactPoint(const FTS &originalFTS, const GlobalPoint &referencePoint) const
Definition: TSCPBuilderNoMaterial.cc:41