CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Attributes
SurveyPxbImage Class Reference

Class to hold one picture of the BPix survey. More...

#include <SurveyPxbImage.h>

Inheritance diagram for SurveyPxbImage:
SurveyPxbImageLocalFit

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_tidPair_t
 
enum  location { ll, ul, lr, ur }
 enum to help access specific locations on a picture More...
 
typedef double value_t
 

Public Member Functions

void fill (std::istringstream &iss)
 
const coord_t getCoord (count_t m)
 
id_t getIdFirst ()
 Get Id of first module. More...
 
const idPair_t getIdPair ()
 Get Id pair. More...
 
id_t getIdSecond ()
 Get Id of second module. More...
 
value_t getSigmaX ()
 Get Gaussian error in u direction. More...
 
value_t getSigmaY ()
 Get Gaussian error in u direction. More...
 
bool isValid ()
 returns validity flag More...
 
 SurveyPxbImage ()
 
 SurveyPxbImage (std::istringstream &iss)
 

Protected Attributes

idPair_t idPair_
 
bool isRotated_
 Flag if the image was rotated or not. More...
 
bool isValidFlag_
 Validity Flag. More...
 
std::vector< coord_tmeasurementVec_
 Vector to hold four measurements. More...
 
value_t sigma_x_
 Gaussian errors. More...
 
value_t sigma_y_
 

Detailed Description

Class to hold one picture of the BPix survey.

Definition at line 12 of file SurveyPxbImage.h.

Member Typedef Documentation

Definition at line 18 of file SurveyPxbImage.h.

typedef unsigned int SurveyPxbImage::count_t

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.

Member Enumeration Documentation

enum to help access specific locations on a picture

Enumerator
ll 
ul 
lr 
ur 

Definition at line 22 of file SurveyPxbImage.h.

22  {
23  ll, // lower left mark (0)
24  ul, // upper left mark (1)
25  lr, // lower right mark (2)
26  ur // upper right mark (3)
27  };

Constructor & Destructor Documentation

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().

52  : isValidFlag_(false)
53  {
54  fill(iss);
55  };
void fill(std::istringstream &iss)
bool isValidFlag_
Validity Flag.

Member Function Documentation

void SurveyPxbImage::fill ( std::istringstream &  iss)

Definition at line 9 of file SurveyPxbImage.cc.

References idPair_, isRotated_, isValidFlag_, measurementVec_, sigma_x_, and sigma_y_.

Referenced by SurveyPxbImage().

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 }
value_t sigma_x_
Gaussian errors.
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
idPair_t idPair_
const SurveyPxbImage::coord_t SurveyPxbImage::getCoord ( count_t  m)

Get coordinate of a measurement

Parameters
mnumber of mark

Definition at line 47 of file SurveyPxbImage.cc.

References measurementVec_.

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 }
std::vector< coord_t > measurementVec_
Vector to hold four measurements.
id_t SurveyPxbImage::getIdFirst ( )
inline

Get Id of first module.

Definition at line 60 of file SurveyPxbImage.h.

References idPair_.

60 { return idPair_.first; };
idPair_t idPair_
const idPair_t SurveyPxbImage::getIdPair ( )
inline

Get Id pair.

Definition at line 64 of file SurveyPxbImage.h.

References idPair_.

64 { return idPair_; };
idPair_t idPair_
id_t SurveyPxbImage::getIdSecond ( )
inline

Get Id of second module.

Definition at line 62 of file SurveyPxbImage.h.

References idPair_.

62 { return idPair_.second; };
idPair_t idPair_
value_t SurveyPxbImage::getSigmaX ( )
inline

Get Gaussian error in u direction.

Definition at line 72 of file SurveyPxbImage.h.

References sigma_x_.

72 { return sigma_x_; }
value_t sigma_x_
Gaussian errors.
value_t SurveyPxbImage::getSigmaY ( )
inline

Get Gaussian error in u direction.

Definition at line 75 of file SurveyPxbImage.h.

References sigma_y_.

75 { return sigma_y_; }
bool SurveyPxbImage::isValid ( void  )
inline

returns validity flag

Definition at line 78 of file SurveyPxbImage.h.

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

78 { return isValidFlag_; };
bool isValidFlag_
Validity Flag.

Member Data Documentation

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

Validity Flag.

Definition at line 92 of file SurveyPxbImage.h.

Referenced by fill().

std::vector<coord_t> SurveyPxbImage::measurementVec_
protected

Vector to hold four measurements.

Definition at line 78 of file SurveyPxbImage.h.

Referenced by fill(), and getCoord().

value_t SurveyPxbImage::sigma_x_
protected

Gaussian errors.

Definition at line 86 of file SurveyPxbImage.h.

Referenced by fill(), SurveyPxbImageLocalFit::getSigma(), and getSigmaX().

value_t SurveyPxbImage::sigma_y_
protected

Definition at line 86 of file SurveyPxbImage.h.

Referenced by fill(), SurveyPxbImageLocalFit::getSigma(), and getSigmaY().