CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTRecSegment2D.cc
Go to the documentation of this file.
1 
9 /* This Class Header */
11 
12 /* Collaborating Class Header */
13 
14 /* C++ Headers */
15 #include <iostream>
16 using namespace std;
17 /* ====================================================================== */
18 
19 
20 /* static member definition */
22 
24 
25 /* Operations */
31  // if ( det().alignmentPositionError()) {
32  // LocalError lape =
33  // ErrorFrameTransformer().transform( det().alignmentPositionError()->globalError(),
34  // det().surface());
35  // m[0][0] = lv.xx();
36  // m[0][1] = 0.;
37  // m[1][1] = lp.xx()+lape.xx();
38  // } else {
39  m[0][0] = theCovMatrix[0][0];
40  m[0][1] = theCovMatrix[0][1];
41  m[1][1] = theCovMatrix[1][1];
42  //};
43 
44  //cout << "theCovMatrix elements " << theCovMatrix[0][0] << " , " << theCovMatrix[0][1] <<
45  // " , " << theCovMatrix[1][0] << " , " << theCovMatrix[1][1] << endl;
46 
47  return m;
48 
49 }
50 
51 
52 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits) :
53  RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits){
54 }
55 
57  LocalPoint &position, LocalVector &direction,
58  AlgebraicSymMatrix & covMatrix, double chi2,
59  std::vector<DTRecHit1D> &hits1D):
60  RecSegment(id), thePosition(position),theDirection(direction),
61  theCovMatrix(covMatrix),theChi2(chi2),theT0(0.),theVdrift(0.),theHits(hits1D){}
62 
63 /* Operations */
65  return LocalError(theCovMatrix[1][1],0.,0.);
66 }
67 
69  return LocalError(theCovMatrix[0][0],0.,0.);
70 }
71 
73  return theHits.size()-dimension();
74 }
75 
76 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
77  os << "Pos " << seg.localPosition() <<
78  " Dir: " << seg.localDirection() <<
79  " chi2/ndof: " << seg.chi2() << "/" << seg.degreesOfFreedom() ;
80  return os;
81 }
82 
83 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
84 
85  std::vector<const TrackingRecHit*> pointersOfRecHits;
86 
87  for(std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin();
88  rechit != theHits.end(); rechit++)
89  pointersOfRecHits.push_back( &(*rechit) );
90 
91  return pointersOfRecHits;
92 }
93 
94 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
95 
96  std::vector<TrackingRecHit*> pointersOfRecHits;
97 
98  for(std::vector<DTRecHit1D>::iterator rechit = theHits.begin();
99  rechit != theHits.end(); rechit++)
100  pointersOfRecHits.push_back( &(*rechit) );
101 
102  return pointersOfRecHits;
103 }
104 
105 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const {
106  return theHits;
107 }
108 
109 void DTRecSegment2D::update(std::vector<DTRecHit1D> & updatedRecHits){
110  theHits = updatedRecHits;
111 }
112 
114  thePosition= pos;
115 }
116 
119 }
120 
122  theCovMatrix = cov;
123 }
124 
125 void DTRecSegment2D::setChi2(const double& chi2) {
126  theChi2=chi2;
127 }
128 
129 void DTRecSegment2D::setT0(const double& t0){
130  theT0=t0;
131 }
132 
133 void DTRecSegment2D::setVdrift(const double& vdrift){
134  theVdrift=vdrift;
135 }
static bool isInitialized
virtual LocalError localPositionError() const
local position error in SL frame
void setChi2(const double &chi2)
virtual int degreesOfFreedom() const
return the DOF of the segment
virtual double chi2() const
the chi2 of the fit
virtual LocalError localDirectionError() const
the local direction error (xx,xy,yy) in SL frame: only xx is not 0.
std::vector< DTRecHit1D > theHits
void setCovMatrix(const AlgebraicSymMatrix &cov)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void update(std::vector< DTRecHit1D > &updatedRecHits)
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
CLHEP::HepMatrix AlgebraicMatrix
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
AlgebraicSymMatrix theCovMatrix
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
static AlgebraicMatrix theProjectionMatrix
virtual LocalPoint localPosition() const
local position in SL frame
Definition: DetId.h:20
virtual AlgebraicSymMatrix parametersError() const
LocalPoint thePosition
void setT0(const double &t0)
virtual int dimension() const
return 2. The dimension of the matrix
void setPosition(const LocalPoint &pos)
virtual LocalVector localDirection() const
the local direction in SL frame
CLHEP::HepSymMatrix AlgebraicSymMatrix
void setDirection(const LocalVector &dir)
LocalVector theDirection
void setVdrift(const double &vdrift)
dbl *** dir
Definition: mlp_gen.cc:35
double t0() const
Get the segment t0 (if recomputed, 0 is returned otherwise)