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 
52 
53 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits) :
54  RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits){
55 }
56 
58  LocalPoint &position, LocalVector &direction,
59  AlgebraicSymMatrix & covMatrix, double chi2,
60  std::vector<DTRecHit1D> &hits1D):
61  RecSegment(id), thePosition(position),theDirection(direction),
62  theCovMatrix(covMatrix),theChi2(chi2),theT0(0.),theVdrift(0.),theHits(hits1D){}
63 
64 /* Operations */
66  return LocalError(theCovMatrix[1][1],0.,0.);
67 }
68 
70  return LocalError(theCovMatrix[0][0],0.,0.);
71 }
72 
74  return theHits.size()-dimension();
75 }
76 
77 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
78  os << "Pos " << seg.localPosition() <<
79  " Dir: " << seg.localDirection() <<
80  " chi2/ndof: " << seg.chi2() << "/" << seg.degreesOfFreedom() ;
81  return os;
82 }
83 
84 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
85 
86  std::vector<const TrackingRecHit*> pointersOfRecHits;
87 
88  for(std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin();
89  rechit != theHits.end(); rechit++)
90  pointersOfRecHits.push_back( &(*rechit) );
91 
92  return pointersOfRecHits;
93 }
94 
95 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
96 
97  std::vector<TrackingRecHit*> pointersOfRecHits;
98 
99  for(std::vector<DTRecHit1D>::iterator rechit = theHits.begin();
100  rechit != theHits.end(); rechit++)
101  pointersOfRecHits.push_back( &(*rechit) );
102 
103  return pointersOfRecHits;
104 }
105 
106 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const {
107  return theHits;
108 }
109 
110 void DTRecSegment2D::update(std::vector<DTRecHit1D> & updatedRecHits){
111  theHits = updatedRecHits;
112 }
113 
115  thePosition= pos;
116 }
117 
120 }
121 
123  theCovMatrix = cov;
124 }
125 
126 void DTRecSegment2D::setChi2(const double& chi2) {
127  theChi2=chi2;
128 }
129 
130 void DTRecSegment2D::setT0(const double& t0){
131  theT0=t0;
132 }
133 
134 void DTRecSegment2D::setVdrift(const double& vdrift){
135  theVdrift=vdrift;
136 }
static bool isInitialized
virtual LocalError localPositionError() const
local position error in SL frame
void setChi2(const double &chi2)
virtual ~DTRecSegment2D()
Destructor.
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)