CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SurveyPxbImage.cc
Go to the documentation of this file.
2 
3 #include <stdexcept>
4 #include <utility>
5 #include <sstream>
6 #include <vector>
8 
9 void SurveyPxbImage::fill(std::istringstream &iss)
10 {
11  id_t id1, id2;
12  value_t x0, y0;
13  value_t x1, y1;
14  value_t x2, y2;
15  value_t x3, y3;
16  value_t sx, sy;
17  bool rotflag;
18  if(! (iss >> id1 >> x0 >> y0 >> x1 >> y1
19  >> id2 >> x2 >> y2 >> x3 >> y3
20  >> sy >> sx >> rotflag).fail())
21  {
22  idPair_.first = id1;
23  idPair_.second = id2;
24  if (!rotflag)
25  {
26  measurementVec_.push_back(coord_t(x0,-y0));
27  measurementVec_.push_back(coord_t(x1,-y1));
28  measurementVec_.push_back(coord_t(x2,-y2));
29  measurementVec_.push_back(coord_t(x3,-y3));
30  }
31  else
32  {
33  measurementVec_.push_back(coord_t(-x0,y0));
34  measurementVec_.push_back(coord_t(-x1,y1));
35  measurementVec_.push_back(coord_t(-x2,y2));
36  measurementVec_.push_back(coord_t(-x3,y3));
37  }
38  sigma_x_ = sx;
39  sigma_y_ = sy;
40  isRotated_ = rotflag;
41  isValidFlag_ = true;
42  }
43  else
44  isValidFlag_ = false;
45 }
46 
48 {
49  if (m>0 && m<5)
50  return measurementVec_[m-1];
51  else
52  throw std::out_of_range("Attempt to access an inexistent measurement");
53 }
54 
value_t sigma_x_
Gaussian errors.
void fill(std::istringstream &iss)
Point3DBase< value_t, LocalTag > coord_t
bool isRotated_
Flag if the image was rotated or not.
bool isValidFlag_
Validity Flag.
std::vector< coord_t > measurementVec_
Vector to hold four measurements.
unsigned int id_t
const coord_t getCoord(count_t m)
idPair_t idPair_