Class to hold one picture of the BPix survey. More...
#include <SurveyPxbImage.h>
Public Types | |
typedef Point3DBase< value_t, LocalTag > | coord_t |
typedef unsigned int | count_t |
typedef unsigned int | id_t |
typedef std::pair< id_t, id_t > | idPair_t |
enum | location { ll, ul, lr, ur } |
| |
typedef double | value_t |
Public Member Functions | |
void | fill (std::istringstream &iss) |
const coord_t | getCoord (count_t m) |
const id_t | getIdFirst () |
Get Id of first module. | |
const idPair_t | getIdPair () |
Get Id pair. | |
const id_t | getIdSecond () |
Get Id of second module. | |
const value_t | getSigmaX () |
Get Gaussian error in u direction. | |
const value_t | getSigmaY () |
Get Gaussian error in u direction. | |
bool | isValid () |
returns validity flag | |
SurveyPxbImage (std::istringstream &iss) | |
SurveyPxbImage () | |
Protected Attributes | |
idPair_t | idPair_ |
bool | isRotated_ |
Flag if the image was rotated or not. | |
bool | isValidFlag_ |
Validity Flag. | |
std::vector< coord_t > | measurementVec_ |
Vector to hold four measurements. | |
value_t | sigma_x_ |
Gaussian errors. | |
value_t | sigma_y_ |
Class to hold one picture of the BPix survey.
Definition at line 12 of file SurveyPxbImage.h.
typedef Point3DBase<value_t, LocalTag> SurveyPxbImage::coord_t |
Definition at line 18 of file SurveyPxbImage.h.
typedef unsigned int SurveyPxbImage::count_t |
Reimplemented in SurveyPxbImageLocalFit.
Definition at line 15 of file SurveyPxbImage.h.
typedef unsigned int SurveyPxbImage::id_t |
Definition at line 16 of file SurveyPxbImage.h.
typedef std::pair<id_t,id_t> SurveyPxbImage::idPair_t |
Definition at line 19 of file SurveyPxbImage.h.
typedef double SurveyPxbImage::value_t |
Definition at line 17 of file SurveyPxbImage.h.
SurveyPxbImage::SurveyPxbImage | ( | ) |
SurveyPxbImage::SurveyPxbImage | ( | std::istringstream & | iss | ) | [inline] |
Constructor from a string stream.
Observe the ordering: A line needs to be of the form rawID1 y_1_1 x_1_1 y_2_1 x_2_1 rawId2 y_1_2 x_1_2 y_2_2 x_2_2 sigma_y sigma_x
x_i_1
denoting the left, x_i_2
the right module. The data is then mapped to
-------------++-------------- (1) +||+ (3) || left module || right module || || (0) +||+ (2) -------------++--------------
where (i)
refers to the entry in the std::vector measurements
Therefore the mapping is as follows:
y_1_1, x_1_1 -> (0)
y_2_1, x_2_1 -> (1)
y_1_2, x_1_2 -> (2)
y_2_2, x_2_2 -> (3)
The sigmas denote the Gaussian error of the measurement in the u and v coordinate Definition at line 52 of file SurveyPxbImage.h.
References fill().
: isValidFlag_(false) { fill(iss); };
void SurveyPxbImage::fill | ( | std::istringstream & | iss | ) |
Definition at line 9 of file SurveyPxbImage.cc.
References cmsPerfPublish::fail(), idPair_, isRotated_, isValidFlag_, measurementVec_, sigma_x_, and sigma_y_.
Referenced by SurveyPxbImage().
{ id_t id1, id2; value_t x0, y0; value_t x1, y1; value_t x2, y2; value_t x3, y3; value_t sx, sy; bool rotflag; if(! (iss >> id1 >> x0 >> y0 >> x1 >> y1 >> id2 >> x2 >> y2 >> x3 >> y3 >> sy >> sx >> rotflag).fail()) { idPair_.first = id1; idPair_.second = id2; if (!rotflag) { measurementVec_.push_back(coord_t(x0,-y0)); measurementVec_.push_back(coord_t(x1,-y1)); measurementVec_.push_back(coord_t(x2,-y2)); measurementVec_.push_back(coord_t(x3,-y3)); } else { measurementVec_.push_back(coord_t(-x0,y0)); measurementVec_.push_back(coord_t(-x1,y1)); measurementVec_.push_back(coord_t(-x2,y2)); measurementVec_.push_back(coord_t(-x3,y3)); } sigma_x_ = sx; sigma_y_ = sy; isRotated_ = rotflag; isValidFlag_ = true; } else isValidFlag_ = false; }
const SurveyPxbImage::coord_t SurveyPxbImage::getCoord | ( | count_t | m | ) |
Get coordinate of a measurement
m | number of mark |
Definition at line 47 of file SurveyPxbImage.cc.
References measurementVec_.
{ if (m>0 && m<5) return measurementVec_[m-1]; else throw std::out_of_range("Attempt to access an inexistent measurement"); }
const id_t SurveyPxbImage::getIdFirst | ( | ) | [inline] |
Get Id
of first module.
Definition at line 60 of file SurveyPxbImage.h.
References idPair_.
{ return idPair_.first; };
const idPair_t SurveyPxbImage::getIdPair | ( | ) | [inline] |
Get Id
pair.
Definition at line 64 of file SurveyPxbImage.h.
References idPair_.
{ return idPair_; };
const id_t SurveyPxbImage::getIdSecond | ( | ) | [inline] |
Get Id
of second module.
Definition at line 62 of file SurveyPxbImage.h.
References idPair_.
{ return idPair_.second; };
const value_t SurveyPxbImage::getSigmaX | ( | ) | [inline] |
Get Gaussian error in u direction.
Definition at line 72 of file SurveyPxbImage.h.
References sigma_x_.
{ return sigma_x_; }
const value_t SurveyPxbImage::getSigmaY | ( | ) | [inline] |
Get Gaussian error in u direction.
Definition at line 75 of file SurveyPxbImage.h.
References sigma_y_.
{ return sigma_y_; }
bool SurveyPxbImage::isValid | ( | void | ) | [inline] |
idPair_t SurveyPxbImage::idPair_ [protected] |
Pair to hold the Id's of the involved modules first: module with lower Id
Definition at line 96 of file SurveyPxbImage.h.
Referenced by fill(), getIdFirst(), getIdPair(), and getIdSecond().
bool SurveyPxbImage::isRotated_ [protected] |
Flag if the image was rotated or not.
Definition at line 89 of file SurveyPxbImage.h.
Referenced by fill().
bool SurveyPxbImage::isValidFlag_ [protected] |
std::vector<coord_t> SurveyPxbImage::measurementVec_ [protected] |
Vector to hold four measurements.
Definition at line 78 of file SurveyPxbImage.h.
Referenced by SurveyPxbImageLocalFit::doFit(), fill(), and getCoord().
value_t SurveyPxbImage::sigma_x_ [protected] |
Gaussian errors.
Definition at line 86 of file SurveyPxbImage.h.
Referenced by SurveyPxbImageLocalFit::doFit(), fill(), SurveyPxbImageLocalFit::getSigma(), and getSigmaX().
value_t SurveyPxbImage::sigma_y_ [protected] |
Definition at line 86 of file SurveyPxbImage.h.
Referenced by SurveyPxbImageLocalFit::doFit(), fill(), SurveyPxbImageLocalFit::getSigma(), and getSigmaY().