CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
virtual LocalPoint localPosition() const
float xx() const
Definition: LocalError.h:24
EmulatedME0Segment()
Default constructor.
T y() const
Definition: PV3DBase.h:63
virtual ~EmulatedME0Segment()
Destructor.
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
AlgebraicVector parameters() const
Parameters of the segment, for the track fit in the order (dx/dz, dy/dz, x, y )
tuple result
Definition: mps_fire.py:84
LocalError localDirectionError() const
Error on the local direction.
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
LocalVector localDirection() const
Local direction.
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix createStaticMatrix()
Definition: CSCSegment.cc:70
CLHEP::HepSymMatrix AlgebraicSymMatrix
LocalVector theLocalDirection
tuple cout
Definition: gather_cfg.py:145
LocalError localPositionError() const
AlgebraicMatrix projectionMatrix() const
The projection matrix relates the trajectory state parameters to the segment parameters().
AlgebraicSymMatrix theCovMatrix
T x() const
Definition: PV3DBase.h:62