CMS 3D CMS Logo

EmulatedME0Segment.cc
Go to the documentation of this file.
1 
8 #include <iostream>
9 
10 EmulatedME0Segment::EmulatedME0Segment(const LocalPoint& origin, const LocalVector& direction, const AlgebraicSymMatrix& errors, const double chi2) :
11  theOrigin(origin),
12  theLocalDirection(direction), theCovMatrix(errors), theChi2(chi2) {
13 }
14 
16 
18  return LocalError(theCovMatrix[2][2], theCovMatrix[2][3], theCovMatrix[3][3]);
19 }
20 
22  return LocalError(theCovMatrix[0][0], theCovMatrix[0][1], theCovMatrix[1][1]);
23 }
24 
25 
27  // For consistency with DT and what we require for the TrackingRecHit interface,
28  // the order of the parameters in the returned vector should be (dx/dz, dy/dz, x, z)
29 
31 
32  result[0] = theLocalDirection.x()/theLocalDirection.z();
33  result[1] = theLocalDirection.y()/theLocalDirection.z();
34  result[2] = theOrigin.x();
35  result[3] = theOrigin.y();
36 
37  return result;
38 }
39 
40 namespace{
42  AlgebraicMatrix m( 4, 5, 0);
43  m[0][1] = 1;
44  m[1][2] = 1;
45  m[2][3] = 1;
46  m[3][4] = 1;
47  return m;
48  }
49 };
50 
51 namespace{
53 };
54 
56  return theProjectionMatrix;
57 }
58 
59 
60 
61 //
63  std::cout << *this << std::endl;
64 }
65 
66 std::ostream& operator<<(std::ostream& os, const EmulatedME0Segment& seg) {
67  os << "EmulatedME0Segment: local pos = " << seg.localPosition() <<
68  " posErr = (" << sqrt(seg.localPositionError().xx())<<","<<sqrt(seg.localPositionError().yy())<<
69  "0,)\n"<<
70  " dir = " << seg.localDirection() <<
71  " dirErr = (" << sqrt(seg.localDirectionError().xx())<<","<<sqrt(seg.localDirectionError().yy())<<
72  "0,)\n";
73  return os;
74 }
float xx() const
Definition: LocalError.h:24
LocalVector localDirection() const override
Local direction.
EmulatedME0Segment()
Default constructor.
std::ostream & operator<<(std::ostream &os, const EmulatedME0Segment &seg)
LocalError localPositionError() const override
T y() const
Definition: PV3DBase.h:63
~EmulatedME0Segment() override
Destructor.
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
LocalPoint localPosition() const override
CLHEP::HepMatrix AlgebraicMatrix
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix projectionMatrix() const override
The projection matrix relates the trajectory state parameters to the segment parameters().
AlgebraicMatrix createStaticMatrix()
Definition: CSCSegment.cc:70
CLHEP::HepSymMatrix AlgebraicSymMatrix
LocalVector theLocalDirection
AlgebraicVector parameters() const override
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
Definition: errors.py:1
LocalError localDirectionError() const override
Error on the local direction.
AlgebraicSymMatrix theCovMatrix
T x() const
Definition: PV3DBase.h:62