CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/Alignment/SurveyAnalysis/src/SurveyPxbImage.cc

Go to the documentation of this file.
00001 #include "Alignment/SurveyAnalysis/interface/SurveyPxbImage.h"
00002 
00003 #include <stdexcept>
00004 #include <utility>
00005 #include <sstream>
00006 #include <vector>
00007 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00008 
00009 void SurveyPxbImage::fill(std::istringstream &iss)
00010 {
00011   id_t id1, id2;
00012   value_t x0, y0;
00013   value_t x1, y1;
00014   value_t x2, y2;
00015   value_t x3, y3;
00016   value_t sx, sy;
00017   bool rotflag;
00018   if(! (iss >> id1 >> x0 >> y0 >> x1 >> y1
00019             >> id2 >> x2 >> y2 >> x3 >> y3
00020             >> sy >> sx >> rotflag).fail())
00021     {
00022       idPair_.first = id1;
00023       idPair_.second = id2;
00024       if (!rotflag)
00025       {
00026           measurementVec_.push_back(coord_t(x0,-y0));
00027           measurementVec_.push_back(coord_t(x1,-y1));
00028           measurementVec_.push_back(coord_t(x2,-y2));
00029           measurementVec_.push_back(coord_t(x3,-y3));
00030       }
00031       else
00032       {
00033           measurementVec_.push_back(coord_t(-x0,y0));
00034           measurementVec_.push_back(coord_t(-x1,y1));
00035           measurementVec_.push_back(coord_t(-x2,y2));
00036           measurementVec_.push_back(coord_t(-x3,y3));
00037       }
00038       sigma_x_ = sx;
00039       sigma_y_ = sy;
00040       isRotated_ = rotflag;
00041       isValidFlag_ = true;
00042     }
00043   else
00044     isValidFlag_ = false;
00045 }
00046 
00047 const SurveyPxbImage::coord_t SurveyPxbImage::getCoord(count_t m)
00048 {
00049   if (m>0 && m<5)
00050     return measurementVec_[m-1];
00051   else
00052     throw std::out_of_range("Attempt to access an inexistent measurement");
00053 }
00054