Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:13

0001 #include "Alignment/SurveyAnalysis/interface/SurveyPxbImage.h"
0002 
0003 #include <stdexcept>
0004 #include <utility>
0005 #include <sstream>
0006 #include <vector>
0007 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0008 
0009 void SurveyPxbImage::fill(std::istringstream &iss) {
0010   id_t id1, id2;
0011   value_t x0, y0;
0012   value_t x1, y1;
0013   value_t x2, y2;
0014   value_t x3, y3;
0015   value_t sx, sy;
0016   bool rotflag;
0017   if (!(iss >> id1 >> x0 >> y0 >> x1 >> y1 >> id2 >> x2 >> y2 >> x3 >> y3 >> sy >> sx >> rotflag).fail()) {
0018     idPair_.first = id1;
0019     idPair_.second = id2;
0020     if (!rotflag) {
0021       measurementVec_.push_back(coord_t(x0, -y0));
0022       measurementVec_.push_back(coord_t(x1, -y1));
0023       measurementVec_.push_back(coord_t(x2, -y2));
0024       measurementVec_.push_back(coord_t(x3, -y3));
0025     } else {
0026       measurementVec_.push_back(coord_t(-x0, y0));
0027       measurementVec_.push_back(coord_t(-x1, y1));
0028       measurementVec_.push_back(coord_t(-x2, y2));
0029       measurementVec_.push_back(coord_t(-x3, y3));
0030     }
0031     sigma_x_ = sx;
0032     sigma_y_ = sy;
0033     isRotated_ = rotflag;
0034     isValidFlag_ = true;
0035   } else
0036     isValidFlag_ = false;
0037 }
0038 
0039 const SurveyPxbImage::coord_t SurveyPxbImage::getCoord(count_t m) {
0040   if (m > 0 && m < 5)
0041     return measurementVec_[m - 1];
0042   else
0043     throw std::out_of_range("Attempt to access an inexistent measurement");
0044 }