CMS 3D CMS Logo

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, LocalTagcoord_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 17 of file SurveyPxbImage.h.

typedef unsigned int SurveyPxbImage::count_t

Definition at line 14 of file SurveyPxbImage.h.

typedef unsigned int SurveyPxbImage::id_t

Definition at line 15 of file SurveyPxbImage.h.

typedef std::pair<id_t, id_t> SurveyPxbImage::idPair_t

Definition at line 18 of file SurveyPxbImage.h.

typedef double SurveyPxbImage::value_t

Definition at line 16 of file SurveyPxbImage.h.

Member Enumeration Documentation

enum to help access specific locations on a picture

Enumerator
ll 
ul 
lr 
ur 

Definition at line 21 of file SurveyPxbImage.h.

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

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 51 of file SurveyPxbImage.h.

References fill().

51 : isValidFlag_(false) { fill(iss); };
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 cmsPerfPublish::fail(), globals_cff::id1, globals_cff::id2, idPair_, isRotated_, isValidFlag_, measurementVec_, sigma_x_, sigma_y_, fftjetcommon_cfi::sx, fftjetcommon_cfi::sy, globals_cff::x1, and globals_cff::x2.

Referenced by SurveyPxbImage().

9  {
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 }
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_
def fail(errstr="")
const SurveyPxbImage::coord_t SurveyPxbImage::getCoord ( count_t  m)

Get coordinate of a measurement

Parameters
mnumber of mark

Definition at line 39 of file SurveyPxbImage.cc.

References measurementVec_.

Referenced by getIdPair().

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

Get Id of first module.

Definition at line 56 of file SurveyPxbImage.h.

References idPair_.

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

Get Id pair.

Definition at line 60 of file SurveyPxbImage.h.

References getCoord(), idPair_, and funct::m.

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

Get Id of second module.

Definition at line 58 of file SurveyPxbImage.h.

References idPair_.

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

Get Gaussian error in u direction.

Definition at line 68 of file SurveyPxbImage.h.

References sigma_x_.

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

Get Gaussian error in u direction.

Definition at line 71 of file SurveyPxbImage.h.

References sigma_y_.

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

returns validity flag

Definition at line 74 of file SurveyPxbImage.h.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

74 { 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 91 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 84 of file SurveyPxbImage.h.

Referenced by fill().

bool SurveyPxbImage::isValidFlag_
protected

Validity Flag.

Definition at line 87 of file SurveyPxbImage.h.

Referenced by fill().

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

Vector to hold four measurements.

Definition at line 74 of file SurveyPxbImage.h.

Referenced by SurveyPxbImageLocalFit::doFit(), fill(), and getCoord().

value_t SurveyPxbImage::sigma_x_
protected

Gaussian errors.

Definition at line 81 of file SurveyPxbImage.h.

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

value_t SurveyPxbImage::sigma_y_
protected