Go to the documentation of this file.00001
00009
00010 #include "DataFormats/DTRecHit/interface/DTRecSegment2D.h"
00011
00012
00013
00014
00015 #include <iostream>
00016 using namespace std;
00017
00018
00019
00020
00021 bool DTRecSegment2D::isInitialized(false);
00022
00023 AlgebraicMatrix DTRecSegment2D::theProjectionMatrix;
00024
00025
00026 AlgebraicSymMatrix DTRecSegment2D::parametersError() const {
00027 AlgebraicSymMatrix m(2);
00031
00032
00033
00034
00035
00036
00037
00038
00039 m[0][0] = theCovMatrix[0][0];
00040 m[0][1] = theCovMatrix[0][1];
00041 m[1][1] = theCovMatrix[1][1];
00042
00043
00044
00045
00046
00047 return m;
00048
00049 }
00050
00051 DTRecSegment2D::~DTRecSegment2D(){}
00052
00053 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits) :
00054 RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits){
00055 }
00056
00057 DTRecSegment2D::DTRecSegment2D(DetId id,
00058 LocalPoint &position, LocalVector &direction,
00059 AlgebraicSymMatrix & covMatrix, double chi2,
00060 std::vector<DTRecHit1D> &hits1D):
00061 RecSegment(id), thePosition(position),theDirection(direction),
00062 theCovMatrix(covMatrix),theChi2(chi2),theT0(0.),theVdrift(0.),theHits(hits1D){}
00063
00064
00065 LocalError DTRecSegment2D::localPositionError() const {
00066 return LocalError(theCovMatrix[1][1],0.,0.);
00067 }
00068
00069 LocalError DTRecSegment2D::localDirectionError() const{
00070 return LocalError(theCovMatrix[0][0],0.,0.);
00071 }
00072
00073 int DTRecSegment2D::degreesOfFreedom() const {
00074 return theHits.size()-dimension();
00075 }
00076
00077 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
00078 os << "Pos " << seg.localPosition() <<
00079 " Dir: " << seg.localDirection() <<
00080 " chi2/ndof: " << seg.chi2() << "/" << seg.degreesOfFreedom() ;
00081 return os;
00082 }
00083
00084 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
00085
00086 std::vector<const TrackingRecHit*> pointersOfRecHits;
00087
00088 for(std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin();
00089 rechit != theHits.end(); rechit++)
00090 pointersOfRecHits.push_back( &(*rechit) );
00091
00092 return pointersOfRecHits;
00093 }
00094
00095 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
00096
00097 std::vector<TrackingRecHit*> pointersOfRecHits;
00098
00099 for(std::vector<DTRecHit1D>::iterator rechit = theHits.begin();
00100 rechit != theHits.end(); rechit++)
00101 pointersOfRecHits.push_back( &(*rechit) );
00102
00103 return pointersOfRecHits;
00104 }
00105
00106 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const {
00107 return theHits;
00108 }
00109
00110 void DTRecSegment2D::update(std::vector<DTRecHit1D> & updatedRecHits){
00111 theHits = updatedRecHits;
00112 }
00113
00114 void DTRecSegment2D::setPosition(const LocalPoint& pos){
00115 thePosition= pos;
00116 }
00117
00118 void DTRecSegment2D::setDirection(const LocalVector& dir){
00119 theDirection=dir;
00120 }
00121
00122 void DTRecSegment2D::setCovMatrix(const AlgebraicSymMatrix& cov){
00123 theCovMatrix = cov;
00124 }
00125
00126 void DTRecSegment2D::setChi2(const double& chi2) {
00127 theChi2=chi2;
00128 }
00129
00130 void DTRecSegment2D::setT0(const double& t0){
00131 theT0=t0;
00132 }
00133
00134 void DTRecSegment2D::setVdrift(const double& vdrift){
00135 theVdrift=vdrift;
00136 }