CMS 3D CMS Logo

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  id_t id1, id2;
11  value_t x0, y0;
12  value_t x1, y1;
13  value_t x2, y2;
14  value_t x3, y3;
15  value_t sx, sy;
16  bool rotflag;
17  if (!(iss >> id1 >> x0 >> y0 >> x1 >> y1 >> id2 >> x2 >> y2 >> x3 >> y3 >> sy >> sx >> rotflag).fail()) {
18  idPair_.first = id1;
19  idPair_.second = id2;
20  if (!rotflag) {
21  measurementVec_.push_back(coord_t(x0, -y0));
22  measurementVec_.push_back(coord_t(x1, -y1));
23  measurementVec_.push_back(coord_t(x2, -y2));
24  measurementVec_.push_back(coord_t(x3, -y3));
25  } else {
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  sigma_x_ = sx;
32  sigma_y_ = sy;
33  isRotated_ = rotflag;
34  isValidFlag_ = true;
35  } else
36  isValidFlag_ = false;
37 }
38 
40  if (m > 0 && m < 5)
41  return measurementVec_[m - 1];
42  else
43  throw std::out_of_range("Attempt to access an inexistent measurement");
44 }
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_
def fail(errstr="")