CMS 3D CMS Logo

DTRecSegment2D.cc
Go to the documentation of this file.
1 
7 /* This Class Header */
9 
10 /* Collaborating Class Header */
11 
12 /* C++ Headers */
13 #include <iostream>
14 using namespace std;
15 /* ====================================================================== */
16 
17 /* static member definition */
18 
19 //This function is only used to initialize theProjectionMatrix at load time
22  theProjectionMatrix[0][1] = 1;
23  theProjectionMatrix[1][3] = 1;
24  return theProjectionMatrix;
25 }
27 
28 /* Operations */
34  // if ( det().alignmentPositionError()) {
35  // LocalError lape =
36  // ErrorFrameTransformer().transform( det().alignmentPositionError()->globalError(),
37  // det().surface());
38  // m[0][0] = lv.xx();
39  // m[0][1] = 0.;
40  // m[1][1] = lp.xx()+lape.xx();
41  // } else {
42  m[0][0] = theCovMatrix[0][0];
43  m[0][1] = theCovMatrix[0][1];
44  m[1][1] = theCovMatrix[1][1];
45  //};
46 
47  //cout << "theCovMatrix elements " << theCovMatrix[0][0] << " , " << theCovMatrix[0][1] <<
48  // " , " << theCovMatrix[1][0] << " , " << theCovMatrix[1][1] << endl;
49 
50  return m;
51 }
52 
54 
55 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits)
56  : RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits) {}
57 
60  LocalVector& direction,
61  AlgebraicSymMatrix& covMatrix,
62  double chi2,
63  std::vector<DTRecHit1D>& hits1D)
64  : RecSegment(id),
65  thePosition(position),
66  theDirection(direction),
67  theCovMatrix(covMatrix),
68  theChi2(chi2),
69  theT0(0.),
70  theVdrift(0.),
71  theHits(hits1D) {}
72 
73 /* Operations */
75 
77 
78 int DTRecSegment2D::degreesOfFreedom() const { return theHits.size() - dimension(); }
79 
80 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
81  os << "Pos " << seg.localPosition() << " Dir: " << seg.localDirection() << " chi2/ndof: " << seg.chi2() << "/"
82  << seg.degreesOfFreedom();
83  return os;
84 }
85 
86 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
87  std::vector<const TrackingRecHit*> pointersOfRecHits;
88 
89  for (std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin(); rechit != theHits.end(); rechit++)
90  pointersOfRecHits.push_back(&(*rechit));
91 
92  return pointersOfRecHits;
93 }
94 
95 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
96  std::vector<TrackingRecHit*> pointersOfRecHits;
97 
98  for (std::vector<DTRecHit1D>::iterator rechit = theHits.begin(); rechit != theHits.end(); rechit++)
99  pointersOfRecHits.push_back(&(*rechit));
100 
101  return pointersOfRecHits;
102 }
103 
104 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const { return theHits; }
105 
106 void DTRecSegment2D::update(std::vector<DTRecHit1D>& updatedRecHits) { theHits = updatedRecHits; }
107 
109 
111 
113 
114 void DTRecSegment2D::setChi2(const double& chi2) { theChi2 = chi2; }
115 
116 void DTRecSegment2D::setT0(const double& t0) { theT0 = t0; }
117 
118 void DTRecSegment2D::setVdrift(const double& vdrift) { theVdrift = vdrift; }
void setChi2(const double &chi2)
LocalPoint localPosition() const override
local position in SL frame
int dimension() const override
return 2. The dimension of the matrix
LocalVector localDirection() const override
the local direction in SL frame
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)
double chi2() const override
the chi2 of the fit
std::vector< DTRecHit1D > theHits
void setCovMatrix(const AlgebraicSymMatrix &cov)
void update(std::vector< DTRecHit1D > &updatedRecHits)
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:79
CLHEP::HepMatrix AlgebraicMatrix
static const AlgebraicMatrix theProjectionMatrix
LocalError localDirectionError() const override
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
AlgebraicSymMatrix theCovMatrix
AlgebraicSymMatrix parametersError() const override
LocalError localPositionError() const override
local position error in SL frame
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
static AlgebraicMatrix initTheProjectionMatrix()
Definition: DetId.h:17
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
LocalPoint thePosition
void setT0(const double &t0)
int degreesOfFreedom() const override
return the DOF of the segment
static int position[264][3]
Definition: ReadPGInfo.cc:289
void setPosition(const LocalPoint &pos)
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
LocalVector theDirection
void setVdrift(const double &vdrift)
ostream & operator<<(ostream &os, const DTRecSegment2D &seg)
~DTRecSegment2D() override
Destructor.