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

◆ coord_t

Definition at line 17 of file SurveyPxbImage.h.

◆ count_t

typedef unsigned int SurveyPxbImage::count_t

Definition at line 14 of file SurveyPxbImage.h.

◆ id_t

typedef unsigned int SurveyPxbImage::id_t

Definition at line 15 of file SurveyPxbImage.h.

◆ idPair_t

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

Definition at line 18 of file SurveyPxbImage.h.

◆ value_t

typedef double SurveyPxbImage::value_t

Definition at line 16 of file SurveyPxbImage.h.

Member Enumeration Documentation

◆ location

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() [1/2]

SurveyPxbImage::SurveyPxbImage ( )

◆ SurveyPxbImage() [2/2]

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.

51 : isValidFlag_(false) { fill(iss); };

References fill().

Member Function Documentation

◆ fill()

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

Definition at line 9 of file SurveyPxbImage.cc.

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 }

References globals_cff::id1, globals_cff::id2, idPair_, isRotated_, isValidFlag_, measurementVec_, sigma_x_, sigma_y_, fftjetcommon_cfi::sx, fftjetcommon_cfi::sy, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, testProducerWithPsetDescEmpty_cfi::y1, and testProducerWithPsetDescEmpty_cfi::y2.

Referenced by SurveyPxbImage().

◆ getCoord()

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.

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 }

References visualization-live-secondInstance_cfg::m, and measurementVec_.

◆ getIdFirst()

id_t SurveyPxbImage::getIdFirst ( )
inline

Get Id of first module.

Definition at line 56 of file SurveyPxbImage.h.

56 { return idPair_.first; };

References idPair_.

◆ getIdPair()

const idPair_t SurveyPxbImage::getIdPair ( )
inline

Get Id pair.

Definition at line 60 of file SurveyPxbImage.h.

60 { return idPair_; };

References idPair_.

◆ getIdSecond()

id_t SurveyPxbImage::getIdSecond ( )
inline

Get Id of second module.

Definition at line 58 of file SurveyPxbImage.h.

58 { return idPair_.second; };

References idPair_.

◆ getSigmaX()

value_t SurveyPxbImage::getSigmaX ( )
inline

Get Gaussian error in u direction.

Definition at line 68 of file SurveyPxbImage.h.

68 { return sigma_x_; }

References sigma_x_.

◆ getSigmaY()

value_t SurveyPxbImage::getSigmaY ( )
inline

Get Gaussian error in u direction.

Definition at line 71 of file SurveyPxbImage.h.

71 { return sigma_y_; }

References sigma_y_.

◆ isValid()

bool SurveyPxbImage::isValid ( void  )
inline

returns validity flag

Definition at line 74 of file SurveyPxbImage.h.

74 { return isValidFlag_; };

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

Member Data Documentation

◆ idPair_

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

◆ isRotated_

bool SurveyPxbImage::isRotated_
protected

Flag if the image was rotated or not.

Definition at line 84 of file SurveyPxbImage.h.

Referenced by fill().

◆ isValidFlag_

bool SurveyPxbImage::isValidFlag_
protected

Validity Flag.

Definition at line 87 of file SurveyPxbImage.h.

Referenced by fill().

◆ measurementVec_

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

◆ sigma_x_

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

◆ sigma_y_

value_t SurveyPxbImage::sigma_y_
protected
SurveyPxbImage::ul
Definition: SurveyPxbImage.h:23
SurveyPxbImage::sigma_x_
value_t sigma_x_
Gaussian errors.
Definition: SurveyPxbImage.h:81
SurveyPxbImage::coord_t
Point3DBase< value_t, LocalTag > coord_t
Definition: SurveyPxbImage.h:17
SurveyPxbImage::sigma_y_
value_t sigma_y_
Definition: SurveyPxbImage.h:81
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
globals_cff.id1
id1
Definition: globals_cff.py:33
SurveyPxbImage::measurementVec_
std::vector< coord_t > measurementVec_
Vector to hold four measurements.
Definition: SurveyPxbImage.h:74
SurveyPxbImage::ur
Definition: SurveyPxbImage.h:25
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
SurveyPxbImage::lr
Definition: SurveyPxbImage.h:24
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
SurveyPxbImage::id_t
unsigned int id_t
Definition: SurveyPxbImage.h:15
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
SurveyPxbImage::ll
Definition: SurveyPxbImage.h:22
SurveyPxbImage::idPair_
idPair_t idPair_
Definition: SurveyPxbImage.h:91
fftjetcommon_cfi.sy
sy
Definition: fftjetcommon_cfi.py:203
SurveyPxbImage::fill
void fill(std::istringstream &iss)
Definition: SurveyPxbImage.cc:9
SurveyPxbImage::value_t
double value_t
Definition: SurveyPxbImage.h:16
SurveyPxbImage::isRotated_
bool isRotated_
Flag if the image was rotated or not.
Definition: SurveyPxbImage.h:84
globals_cff.id2
id2
Definition: globals_cff.py:34
SurveyPxbImage::isValidFlag_
bool isValidFlag_
Validity Flag.
Definition: SurveyPxbImage.h:87
fftjetcommon_cfi.sx
sx
Definition: fftjetcommon_cfi.py:202