CMS 3D CMS Logo

CTPPSRPAlignmentCorrectionData.cc
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of CMS-TOTEM PPS offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 * Helena Malbouisson
7 * Clemencia Mora Herrera
8 *
9 ****************************************************************************/
10 
12 
14 
15 #include <Math/RotationZYX.h>
16 
17 using namespace std;
18 
19 //----------------------------------------------------------------------------------------------------
20 
21 CTPPSRPAlignmentCorrectionData::CTPPSRPAlignmentCorrectionData(double _sh_x, double _sh_x_u, double _sh_y, double _sh_y_u, double _sh_z, double _sh_z_u,
22  double _rot_x, double _rot_x_u, double _rot_y, double _rot_y_u, double _rot_z, double _rot_z_u) :
23  sh_x(_sh_x), sh_y(_sh_y), sh_z(_sh_z),
24  sh_x_unc(_sh_x_u), sh_y_unc(_sh_y_u), sh_z_unc(_sh_z_u),
25  rot_x(_rot_x), rot_y(_rot_y), rot_z(_rot_z),
26  rot_x_unc(_rot_x_u), rot_y_unc(_rot_y_u), rot_z_unc(_rot_z_u)
27 {
28 }
29 
30 //----------------------------------------------------------------------------------------------------
31 
32 CTPPSRPAlignmentCorrectionData::CTPPSRPAlignmentCorrectionData(double _sh_x, double _sh_y, double _sh_z,
33  double _rot_x, double _rot_y, double _rot_z) :
34  sh_x(_sh_x), sh_y(_sh_y), sh_z(_sh_z),
35  rot_x(_rot_x), rot_y(_rot_y), rot_z(_rot_z)
36 {
37 }
38 
39 //----------------------------------------------------------------------------------------------------
40 
41 void CTPPSRPAlignmentCorrectionData::add(const CTPPSRPAlignmentCorrectionData &a, bool sumErrors, bool addSh, bool addRot)
42 {
43  if (addSh)
44  {
45  sh_x += a.sh_x;
46  sh_y += a.sh_y;
47  sh_z += a.sh_z;
48 
49  if (sumErrors)
50  {
54  }
55  }
56 
57  if (addRot)
58  {
59  rot_x += a.rot_x;
60  rot_y += a.rot_y;
61  rot_z += a.rot_z;
62 
63  if (sumErrors)
64  {
68  }
69  }
70 }
71 
72 //----------------------------------------------------------------------------------------------------
73 
74 std::ostream& operator<<(std::ostream& s, const CTPPSRPAlignmentCorrectionData &corr)
75 {
76  s << fixed
77  << "shift (um) " << std::setprecision(1)
78  << "x = " << corr.getShX()*1E3 << " +- " << corr.getShXUnc()*1E3
79  << ", y = " << corr.getShY()*1E3 << " +- " << corr.getShYUnc()*1E3
80  << ", z = " << corr.getShZ()*1E3 << " +- " << corr.getShZUnc()*1E3
81  << ", rotation (mrad) " << std::setprecision(1)
82  << "x = " << corr.getRotX()*1E3 << " +- " << corr.getRotXUnc()*1E3
83  << ", y = " << corr.getRotY()*1E3 << " +- " << corr.getRotYUnc()*1E3
84  << ", z = " << corr.getRotZ()*1E3 << " +- " << corr.getRotZUnc()*1E3;
85 
86  return s;
87 }
std::ostream & operator<<(std::ostream &s, const CTPPSRPAlignmentCorrectionData &corr)
T sqrt(T t)
Definition: SSEVec.h:18
CTPPSRPAlignmentCorrectionData(double _sh_x, double _sh_x_u, double _sh_y, double _sh_y_u, double _sh_z, double _sh_z_u, double _rot_x, double _rot_x_u, double _rot_y, double _rot_y_u, double _rot_z, double _rot_z_u)
full constructor, shifts in mm, rotations in rad
JetCorrectorParameters corr
Definition: classes.h:5
double a
Definition: hdecay.h:121
void add(const CTPPSRPAlignmentCorrectionData &, bool sumErrors=true, bool addSh=true, bool addRot=true)
Alignment correction for an element of the CT-PPS detector. 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.