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
00052 DTRecSegment2D::DTRecSegment2D(DetId id, const vector<DTRecHit1D>& hits) :
00053 RecSegment(id), theChi2(0.0), theT0(0.), theVdrift(0.), theHits(hits){
00054 }
00055
00056 DTRecSegment2D::DTRecSegment2D(DetId id,
00057 LocalPoint &position, LocalVector &direction,
00058 AlgebraicSymMatrix & covMatrix, double chi2,
00059 std::vector<DTRecHit1D> &hits1D):
00060 RecSegment(id), thePosition(position),theDirection(direction),
00061 theCovMatrix(covMatrix),theChi2(chi2),theT0(0.),theVdrift(0.),theHits(hits1D){}
00062
00063
00064 LocalError DTRecSegment2D::localPositionError() const {
00065 return LocalError(theCovMatrix[1][1],0.,0.);
00066 }
00067
00068 LocalError DTRecSegment2D::localDirectionError() const{
00069 return LocalError(theCovMatrix[0][0],0.,0.);
00070 }
00071
00072 int DTRecSegment2D::degreesOfFreedom() const {
00073 return theHits.size()-dimension();
00074 }
00075
00076 ostream& operator<<(ostream& os, const DTRecSegment2D& seg) {
00077 os << "Pos " << seg.localPosition() <<
00078 " Dir: " << seg.localDirection() <<
00079 " chi2/ndof: " << seg.chi2() << "/" << seg.degreesOfFreedom() ;
00080 return os;
00081 }
00082
00083 std::vector<const TrackingRecHit*> DTRecSegment2D::recHits() const {
00084
00085 std::vector<const TrackingRecHit*> pointersOfRecHits;
00086
00087 for(std::vector<DTRecHit1D>::const_iterator rechit = theHits.begin();
00088 rechit != theHits.end(); rechit++)
00089 pointersOfRecHits.push_back( &(*rechit) );
00090
00091 return pointersOfRecHits;
00092 }
00093
00094 std::vector<TrackingRecHit*> DTRecSegment2D::recHits() {
00095
00096 std::vector<TrackingRecHit*> pointersOfRecHits;
00097
00098 for(std::vector<DTRecHit1D>::iterator rechit = theHits.begin();
00099 rechit != theHits.end(); rechit++)
00100 pointersOfRecHits.push_back( &(*rechit) );
00101
00102 return pointersOfRecHits;
00103 }
00104
00105 std::vector<DTRecHit1D> DTRecSegment2D::specificRecHits() const {
00106 return theHits;
00107 }
00108
00109 void DTRecSegment2D::update(std::vector<DTRecHit1D> & updatedRecHits){
00110 theHits = updatedRecHits;
00111 }
00112
00113 void DTRecSegment2D::setPosition(const LocalPoint& pos){
00114 thePosition= pos;
00115 }
00116
00117 void DTRecSegment2D::setDirection(const LocalVector& dir){
00118 theDirection=dir;
00119 }
00120
00121 void DTRecSegment2D::setCovMatrix(const AlgebraicSymMatrix& cov){
00122 theCovMatrix = cov;
00123 }
00124
00125 void DTRecSegment2D::setChi2(const double& chi2) {
00126 theChi2=chi2;
00127 }
00128
00129 void DTRecSegment2D::setT0(const double& t0){
00130 theT0=t0;
00131 }
00132
00133 void DTRecSegment2D::setVdrift(const double& vdrift){
00134 theVdrift=vdrift;
00135 }