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
RPAlignmentCorrectionData Class Reference

Alignment correction or result of alignment procedure for a single RP sensor. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds. More...

#include <RPAlignmentCorrectionData.h>

Public Types

typedef ROOT::Math::Rotation3D RotationMatrix
 

Public Member Functions

void add (const RPAlignmentCorrectionData &, bool sumErrors=true, bool addShR=true, bool addShZ=true, bool addRotZ=true)
 
RotationMatrix getRotationMatrix () const
 
const math::XYZVectorDgetTranslation () const
 
const math::XYZVectorDgetTranslationError () const
 
void normalizeRotationZ ()
 adds a multiple of 2pi, such that the rotation is then in range (-pi, +pi) More...
 
void print () const
 prints the contents on the screen More...
 
void readoutTranslationToXY (double dx, double dy)
 
double rot_z () const
 
double rot_z_e () const
 
double rotationZ () const
 
double rotationZError () const
 
 RPAlignmentCorrectionData (double sh_r, double sh_r_e, double sh_x, double sh_x_e, double sh_y, double sh_y_e, double sh_z, double sh_z_e, double rot_x, double rot_x_e, double rot_y, double rot_y_e, double rot_z, double rot_z_e)
 full constructor, shifts in mm, rotations in rad More...
 
 RPAlignmentCorrectionData (double sh_r, double sh_r_e, double sh_x, double sh_x_e, double sh_y, double sh_y_e, double sh_z, double sh_z_e, double rot_z, double rot_z_e)
 constructor TB alignment, shifts in mm, rotation in rad More...
 
 RPAlignmentCorrectionData (double sh_x=0., double sh_y=0., double sh_z=0., double rot_z=0.)
 no error constructor, shifts in mm, rotation in rad More...
 
void setRotationZ (double rot_z, double rot_z_e=0.)
 
void setTranslationR (double sh_r, double sh_r_e=0.)
 
void setTranslationZ (double sh_z, double sh_z_e=0.)
 
double sh_r () const
 
double sh_r_e () const
 
double sh_x () const
 
double sh_x_e () const
 
double sh_y () const
 
double sh_y_e () const
 
double sh_z () const
 
double sh_z_e () const
 
void xyTranslationToReadout (double dx, double dy)
 

Protected Attributes

double rotation_x
 
double rotation_x_error
 
double rotation_y
 
double rotation_y_error
 
double rotation_z
 
double rotation_z_error
 
math::XYZVectorD translation
 
math::XYZVectorD translation_error
 the uncertainty of shift in mm (if known) More...
 
double translation_r
 
double translation_r_error
 the uncertainty of readout-dir. translation More...
 

Detailed Description

Alignment correction or result of alignment procedure for a single RP sensor. Within the geometry description, every sensor (more generally every element) is given its translation and rotation. These two quantities shall be understood in local-to-global coordinate transform. That is, if r_l is a point in local coordinate system and x_g in global, then it holds.

   x_g = rotation * x_l + translation

This class presents an alignment correction to the translation and rotation. It follows these formulae:

   translation_final = translation_correction * translation_original
   rotation_final = rotation_correction * rotation_original

(see DetGeomDesc::ApplyAlignment)

Alignment corrections can be added, following this prescription:

   translation_final = translation_added * translation_original
   rotation_final = rotation_added * rotation_original

NB: As follows from the above definitions, all translations are in the global space. This means that the rotations do not act on them.

Besides the values of rotations and translations, this class contains also uncertainties for these paramaters (the _error data memebers).

The RP silicon sensors are strip detectors and as such they measure one coordinate only. Thus the basic outcome of any track-based alignment involves shifts in read-out direction. This class contains these values in the `_r' data members.

The rotation is parameterized by 3 rotation parameters, the matrix is obtained by calling ROOT::Math::RotationZYX(r_z, r_y, r_x), which corresponds to:

     | 1     0        0    |   | cos r_y  0  +sin r_y |   | cos r_z  -sin r_z  0 |
 R = | 0 cos r_x  -sin r_x | * |    0     1     0     | * | sin r_z  cos r_z   0 |
     | 0 sin r_x  cos r_x  |   |-sin r_y  0  cos r_y  |   |    0        0      1 |

Definition at line 59 of file RPAlignmentCorrectionData.h.

Member Typedef Documentation

typedef ROOT::Math::Rotation3D RPAlignmentCorrectionData::RotationMatrix

Definition at line 63 of file RPAlignmentCorrectionData.h.

Constructor & Destructor Documentation

RPAlignmentCorrectionData::RPAlignmentCorrectionData ( double  sh_r,
double  sh_r_e,
double  sh_x,
double  sh_x_e,
double  sh_y,
double  sh_y_e,
double  sh_z,
double  sh_z_e,
double  rot_x,
double  rot_x_e,
double  rot_y,
double  rot_y_e,
double  rot_z,
double  rot_z_e 
)

full constructor, shifts in mm, rotations in rad

Definition at line 18 of file RPAlignmentCorrectionData.cc.

20  :
23  rotation_x(rot_x), rotation_y(rot_y), rotation_z(rot_z),
25 {
26 }
double translation_r_error
the uncertainty of readout-dir. translation
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
RPAlignmentCorrectionData::RPAlignmentCorrectionData ( double  sh_r,
double  sh_r_e,
double  sh_x,
double  sh_x_e,
double  sh_y,
double  sh_y_e,
double  sh_z,
double  sh_z_e,
double  rot_z,
double  rot_z_e 
)

constructor TB alignment, shifts in mm, rotation in rad

Definition at line 30 of file RPAlignmentCorrectionData.cc.

31  :
36 {
37 }
double translation_r_error
the uncertainty of readout-dir. translation
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
RPAlignmentCorrectionData::RPAlignmentCorrectionData ( double  sh_x = 0.,
double  sh_y = 0.,
double  sh_z = 0.,
double  rot_z = 0. 
)

no error constructor, shifts in mm, rotation in rad

Definition at line 41 of file RPAlignmentCorrectionData.cc.

41  :
42  translation(sh_x, sh_y, sh_z), translation_error(0., 0., 0.),
46 {
47 }
double translation_r_error
the uncertainty of readout-dir. translation
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)

Member Function Documentation

void RPAlignmentCorrectionData::add ( const RPAlignmentCorrectionData a,
bool  sumErrors = true,
bool  addShR = true,
bool  addShZ = true,
bool  addRotZ = true 
)

merges (cumulates) alignements match between x, y and read-out shifts is not checked

Parameters
sumErrorsif it is true, old and new alignment uncertainties are summed (in quadrature) if it is false, the uncertainties of the parameter (i.e. not the object) will be used With the add... switches one can control which corrections are added.

TODO: proper adding of all three angles

Definition at line 51 of file RPAlignmentCorrectionData.cc.

References rotation_z, rotation_z_error, mathSSE::sqrt(), translation, translation_error, translation_r, and translation_r_error.

Referenced by RPAlignmentCorrectionsData::GetFullSensorCorrection(), and counter.Counter::register().

53 {
55 
56  //printf(">> RPAlignmentCorrectionData::Add, sumErrors = %i\n", sumErrors);
57 
58  bool addShXY = addShR;
59 
60  if (addShR) {
62  if (sumErrors)
64  else
66  }
67 
68  if (addShXY) {
69  translation.SetX(a.translation.X() + translation.X());
70  translation.SetY(a.translation.Y() + translation.Y());
71  if (sumErrors) {
74  } else {
77  }
78  }
79 
80  if (addShZ) {
81  translation.SetZ(a.translation.Z() + translation.Z());
82  if (sumErrors)
84  else
86  }
87 
88  if (addRotZ) {
90  if (sumErrors)
92  else
94  }
95 }
T sqrt(T t)
Definition: SSEVec.h:18
double translation_r_error
the uncertainty of readout-dir. translation
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
RotationMatrix RPAlignmentCorrectionData::getRotationMatrix ( ) const
inline
const math::XYZVectorD& RPAlignmentCorrectionData::getTranslation ( ) const
inline

Definition at line 101 of file RPAlignmentCorrectionData.h.

References translation.

Referenced by DetGeomDesc::ApplyAlignment(), and print().

102  { return translation; }
const math::XYZVectorD& RPAlignmentCorrectionData::getTranslationError ( ) const
inline

Definition at line 104 of file RPAlignmentCorrectionData.h.

References translation_error.

105  { return translation_error; }
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
void RPAlignmentCorrectionData::normalizeRotationZ ( )

adds a multiple of 2pi, such that the rotation is then in range (-pi, +pi)

Definition at line 149 of file RPAlignmentCorrectionData.cc.

References M_PI, and rotation_z.

150 {
151  rotation_z -= floor( (rotation_z + M_PI) / 2. / M_PI ) * 2. * M_PI;
152 }
#define M_PI
void RPAlignmentCorrectionData::print ( void  ) const

prints the contents on the screen

Definition at line 157 of file RPAlignmentCorrectionData.cc.

References getTranslation(), rot_z(), sh_r(), x, y, and z.

158 {
159  printf("shift: r=%.1f, x=%.1f, y=%.1f, z=%.1f, rotation: z=%.1f\n", sh_r()*1E3,
160  getTranslation().x()*1E3, getTranslation().y()*1E3, getTranslation().z()*1E3, rot_z()*1E3);
161 }
const math::XYZVectorD & getTranslation() const
void RPAlignmentCorrectionData::readoutTranslationToXY ( double  dx,
double  dy 
)

given (unit-length) readout direction vector (dx, dy), it converts 'translation_r' to x and y components of 'translation'

Definition at line 99 of file RPAlignmentCorrectionData.cc.

References translation, translation_error, translation_r, and translation_r_error.

100 {
101  double tr_z = translation.z();
102  translation.SetXYZ(translation_r*dx, translation_r*dy, tr_z);
103 
104  tr_z = translation_error.z();
106 }
double translation_r_error
the uncertainty of readout-dir. translation
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
double RPAlignmentCorrectionData::rot_z ( ) const
inline
double RPAlignmentCorrectionData::rot_z_e ( ) const
inline
double RPAlignmentCorrectionData::rotationZ ( ) const
inline

Definition at line 107 of file RPAlignmentCorrectionData.h.

References rotation_z.

double RPAlignmentCorrectionData::rotationZError ( ) const
inline

Definition at line 110 of file RPAlignmentCorrectionData.h.

References rotation_z_error.

void RPAlignmentCorrectionData::setRotationZ ( double  rot_z,
double  rot_z_e = 0. 
)
void RPAlignmentCorrectionData::setTranslationR ( double  sh_r,
double  sh_r_e = 0. 
)

Definition at line 125 of file RPAlignmentCorrectionData.cc.

References sh_r(), sh_r_e(), translation_r, and translation_r_error.

126 {
129 }
double translation_r_error
the uncertainty of readout-dir. translation
void RPAlignmentCorrectionData::setTranslationZ ( double  sh_z,
double  sh_z_e = 0. 
)

Definition at line 133 of file RPAlignmentCorrectionData.cc.

References translation, and translation_error.

134 {
135  translation.SetZ(sh_z);
137 }
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
double RPAlignmentCorrectionData::sh_r ( ) const
inline
double RPAlignmentCorrectionData::sh_r_e ( ) const
inline

Definition at line 119 of file RPAlignmentCorrectionData.h.

References translation_r_error.

Referenced by setTranslationR(), and RPAlignmentCorrectionsMethods::WriteXML().

120  { return translation_r_error; }
double translation_r_error
the uncertainty of readout-dir. translation
double RPAlignmentCorrectionData::sh_x ( ) const
inline

Definition at line 122 of file RPAlignmentCorrectionData.h.

References translation.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

123  { return translation.x(); }
double RPAlignmentCorrectionData::sh_x_e ( ) const
inline

Definition at line 125 of file RPAlignmentCorrectionData.h.

References translation_error.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

126  { return translation_error.x(); }
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
double RPAlignmentCorrectionData::sh_y ( ) const
inline

Definition at line 128 of file RPAlignmentCorrectionData.h.

References translation.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

129  { return translation.y(); }
double RPAlignmentCorrectionData::sh_y_e ( ) const
inline

Definition at line 131 of file RPAlignmentCorrectionData.h.

References translation_error.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

132  { return translation_error.y(); }
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
double RPAlignmentCorrectionData::sh_z ( ) const
inline

Definition at line 134 of file RPAlignmentCorrectionData.h.

References translation.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

135  { return translation.z(); }
double RPAlignmentCorrectionData::sh_z_e ( ) const
inline

Definition at line 137 of file RPAlignmentCorrectionData.h.

References translation_error.

Referenced by RPAlignmentCorrectionsMethods::WriteXML().

138  { return translation_error.z(); }
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)
void RPAlignmentCorrectionData::xyTranslationToReadout ( double  dx,
double  dy 
)

given (unit-length) readout direction vector (dx, dy), it removes the translation component perpendicular to the r-o direction, the parallel component is saved in 'translation_r'

Definition at line 110 of file RPAlignmentCorrectionData.cc.

References dot(), mathSSE::sqrt(), translation, translation_error, translation_r, and translation_r_error.

111 {
112  double dot = dx*translation.x() + dy*translation.y();
113  translation_r = dot;
114  translation.SetXYZ(dot*dx, dot*dy, translation.z());
115 
116  // there is a very high correlation between x and y components of translation_error
117  //double dot_error = sqrt(dx*dx * translation_error.x()*translation_error.x() + dy*dy * translation_error.y()*translation_error.y());
118  double dot_error = sqrt(translation_error.x()*translation_error.x() + translation_error.y()*translation_error.y());
119  translation_r_error = dot_error;
120  translation_error.SetXYZ(dot_error*dx, dot_error*dy, translation_error.z());
121 }
T sqrt(T t)
Definition: SSEVec.h:18
double translation_r_error
the uncertainty of readout-dir. translation
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
math::XYZVectorD translation_error
the uncertainty of shift in mm (if known)

Member Data Documentation

double RPAlignmentCorrectionData::rotation_x
protected

the three rotation angles in rad

Definition at line 82 of file RPAlignmentCorrectionData.h.

Referenced by getRotationMatrix().

double RPAlignmentCorrectionData::rotation_x_error
protected

the uncertainties of the three rotation angles in rad

Definition at line 86 of file RPAlignmentCorrectionData.h.

double RPAlignmentCorrectionData::rotation_y
protected

Definition at line 82 of file RPAlignmentCorrectionData.h.

Referenced by getRotationMatrix().

double RPAlignmentCorrectionData::rotation_y_error
protected

Definition at line 86 of file RPAlignmentCorrectionData.h.

double RPAlignmentCorrectionData::rotation_z
protected
double RPAlignmentCorrectionData::rotation_z_error
protected

Definition at line 86 of file RPAlignmentCorrectionData.h.

Referenced by add(), rot_z_e(), rotationZError(), and setRotationZ().

math::XYZVectorD RPAlignmentCorrectionData::translation
protected

shift in mm; in global XYZ frame, which is not affected by (alignment) rotations! currently implemented as ROOT::Math::DisplacementVector3D

Definition at line 68 of file RPAlignmentCorrectionData.h.

Referenced by add(), getTranslation(), readoutTranslationToXY(), setTranslationZ(), sh_x(), sh_y(), sh_z(), and xyTranslationToReadout().

math::XYZVectorD RPAlignmentCorrectionData::translation_error
protected

the uncertainty of shift in mm (if known)

Definition at line 71 of file RPAlignmentCorrectionData.h.

Referenced by add(), getTranslationError(), readoutTranslationToXY(), setTranslationZ(), sh_x_e(), sh_y_e(), sh_z_e(), and xyTranslationToReadout().

double RPAlignmentCorrectionData::translation_r
protected

translation in the readout direction, in mm; needed for track-based alignment results NOTE: no guarantee that its value would correspond to the 'translation' vector!

Definition at line 75 of file RPAlignmentCorrectionData.h.

Referenced by add(), readoutTranslationToXY(), setTranslationR(), sh_r(), and xyTranslationToReadout().

double RPAlignmentCorrectionData::translation_r_error
protected

the uncertainty of readout-dir. translation

Definition at line 78 of file RPAlignmentCorrectionData.h.

Referenced by add(), readoutTranslationToXY(), setTranslationR(), sh_r_e(), and xyTranslationToReadout().