CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TSCBLBuilderNoMaterial.cc
Go to the documentation of this file.
5 
6 using namespace std;
7 
9  const reco::BeamSpot& beamSpot) const {
11  bool status = ttmd.calculate(
12  originalFTS.parameters(),
13  GlobalTrajectoryParameters(GlobalPoint(beamSpot.position().x(), beamSpot.position().y(), beamSpot.position().z()),
14  GlobalVector(beamSpot.dxdz(), beamSpot.dydz(), 1.),
15  0,
16  &(originalFTS.parameters().magneticField())));
17  if (!status) {
18  LogDebug("TrackingTools|PatternTools")
19  << "TSCBLBuilderNoMaterial: Failure in TTMD when searching for PCA of track to beamline.\n"
20  << "TrajectoryStateClosestToBeamLine is now invalid.";
22  }
23 
24  pair<GlobalPoint, GlobalPoint> points = ttmd.points();
25 
26  GlobalPoint xTrack = points.first;
27  GlobalVector pTrack = GlobalVector(
28  GlobalVector::Cylindrical(originalFTS.momentum().perp(), ttmd.firstAngle(), originalFTS.momentum().z()));
29 
30  double s = ttmd.pathLength().first;
31 
32  FreeTrajectoryState theFTS;
33  if (originalFTS.hasError()) {
34  const AlgebraicSymMatrix55& errorMatrix = originalFTS.curvilinearError().matrix();
35  AnalyticalCurvilinearJacobian curvilinJacobian(originalFTS.parameters(), xTrack, pTrack, s);
36  const AlgebraicMatrix55& jacobian = curvilinJacobian.jacobian();
37  CurvilinearTrajectoryError cte(ROOT::Math::Similarity(jacobian, errorMatrix));
38 
39  theFTS = FreeTrajectoryState(
40  GlobalTrajectoryParameters(xTrack, pTrack, originalFTS.charge(), &(originalFTS.parameters().magneticField())),
41  cte);
42  } else {
43  theFTS = FreeTrajectoryState(
44  GlobalTrajectoryParameters(xTrack, pTrack, originalFTS.charge(), &(originalFTS.parameters().magneticField())));
45  }
46  return TrajectoryStateClosestToBeamLine(theFTS, points.second, beamSpot);
47 }
T perp() const
Definition: PV3DBase.h:69
const GlobalTrajectoryParameters & parameters() const
const AlgebraicMatrix55 & jacobian() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
list status
Definition: mps_update.py:107
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
double dydz() const
dydz slope
Definition: BeamSpot.h:80
T z() const
Definition: PV3DBase.h:61
std::pair< GlobalPoint, GlobalPoint > points() const override
GlobalVector momentum() const
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
std::pair< double, double > pathLength() const
const AlgebraicSymMatrix55 & matrix() const
const MagneticField & magneticField() const
const Point & position() const
position
Definition: BeamSpot.h:59
TrajectoryStateClosestToBeamLine operator()(const FTS &originalFTS, const reco::BeamSpot &beamSpot) const override
Global3DVector GlobalVector
Definition: GlobalVector.h:10
#define LogDebug(id)