64 double posX = record->
getDouble(
"POSX") * Gaudi::Units::mm;
65 double posY = record->
getDouble(
"POSY") * Gaudi::Units::mm;
66 double posZ = record->
getDouble(
"POSZ") * Gaudi::Units::mm;
67 double rotX = record->
getDouble(
"ROTX") * Gaudi::Units::degree;
68 double rotY = record->
getDouble(
"ROTY") * Gaudi::Units::degree;
69 double rotZ = record->
getDouble(
"ROTZ") * Gaudi::Units::degree;
70 int rotOrder = record->
getInt(
"ROTORDER");
73 GeoTrf::Translate3D
transform(posX, posY, posZ);
76 if (rotX == 0 && rotY == 0 && rotZ == 0) {
85 int ixyz1 = rotOrder / 100 - 1;
86 int ixyz2 = (rotOrder % 100) / 10 - 1;
87 int ixyz3 = (rotOrder % 10) - 1;
89 if (ixyz1 < 0 || ixyz1 > 2 ||
90 ixyz2 < 0 || ixyz2 > 2 ||
91 ixyz3 < 0 || ixyz3 > 2) {
92 std::cout <<
"ERROR: Invalid rotation order:" << rotOrder << std::endl;
99 GeoTrf::Transform3D* xformList[3] = {
100 nullptr,
nullptr,
nullptr
102 if (rotX != 0) xformList[0] =
new GeoTrf::RotateX3D(rotX);
103 if (rotY != 0) xformList[1] =
new GeoTrf::RotateY3D(rotY);
104 if (rotZ != 0) xformList[2] =
new GeoTrf::RotateZ3D(rotZ);
106 GeoTrf::Transform3D rotation(GeoTrf::Transform3D::Identity());
107 if (xformList[ixyz1]) rotation = *(xformList[ixyz1]) * rotation;
108 if (xformList[ixyz2]) rotation = *(xformList[ixyz2]) * rotation;
109 if (xformList[ixyz3]) rotation = *(xformList[ixyz3]) * rotation;