CMS 3D CMS Logo

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