171 LogDebug(
"Alignment") <<
" CocoaDBMgr::GetOptAlignInfoFromOptO " << opto->
name();
179 CLHEP::HepRotation parentRmGlobInv = inverseOf(opto->
parent()->
rmGlob());
180 centreLocal = parentRmGlobInv * centreLocal;
183 LogDebug(
"Alignment") <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting coord ";
184 if (theCoordinateEntryVector.size() == 6) {
185 const Entry*
const translationX = theCoordinateEntryVector.at(0);
187 translationXDataForDB.
name_ = translationX->name();
188 translationXDataForDB.
dim_type_ = translationX->type();
189 translationXDataForDB.
value_ = centreLocal.x() * 1._m;
191 translationXDataForDB.
quality_ = translationX->quality();
192 data.x_ = translationXDataForDB;
194 const Entry*
const translationY = theCoordinateEntryVector.at(1);
196 translationYDataForDB.
name_ = translationY->name();
197 translationYDataForDB.
dim_type_ = translationY->type();
198 translationYDataForDB.
value_ = centreLocal.y() * 1._m;
200 translationYDataForDB.
quality_ = translationY->quality();
201 data.y_ = translationYDataForDB;
203 const Entry*
const translationZ = theCoordinateEntryVector.at(2);
205 translationZDataForDB.
name_ = translationZ->name();
206 translationZDataForDB.
dim_type_ = translationZ->type();
207 translationZDataForDB.
value_ = centreLocal.z() * 1._m;
209 translationZDataForDB.
quality_ = translationZ->quality();
210 data.z_ = translationZDataForDB;
214 if (anglocal.size() == 3) {
215 const Entry*
const rotationX = theCoordinateEntryVector.at(3);
217 rotationXDataForDB.
name_ = rotationX->name();
218 rotationXDataForDB.
dim_type_ = rotationX->type();
219 rotationXDataForDB.
value_ = anglocal.at(0);
221 rotationXDataForDB.
quality_ = rotationX->quality();
222 data.angx_ = rotationXDataForDB;
224 const Entry*
const rotationY = theCoordinateEntryVector.at(4);
226 rotationYDataForDB.
name_ = rotationY->name();
227 rotationYDataForDB.
dim_type_ = rotationY->type();
228 rotationYDataForDB.
value_ = anglocal.at(1);
230 rotationYDataForDB.
quality_ = rotationY->quality();
231 data.angy_ = rotationYDataForDB;
233 const Entry*
const rotationZ = theCoordinateEntryVector.at(5);
235 rotationZDataForDB.
name_ = rotationZ->name();
236 rotationZDataForDB.
dim_type_ = rotationZ->type();
237 rotationZDataForDB.
value_ = anglocal.at(2);
239 rotationZDataForDB.
quality_ = rotationZ->quality();
240 data.angz_ = rotationZDataForDB;
244 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting entry " << std::endl;
247 extraEntry.
name_ = myDBExtraEntry->name();
248 extraEntry.
dim_type_ = myDBExtraEntry->type();
249 extraEntry.
value_ = myDBExtraEntry->value();
250 extraEntry.
error_ = myDBExtraEntry->sigma();
252 extraEntry.
value_ *= 1._m;
253 extraEntry.
error_ *= 1._m;
255 extraEntry.
quality_ = myDBExtraEntry->quality();
256 data.extraEntries_.emplace_back(extraEntry);
257 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO done extra entry " << extraEntry.
name_ << std::endl;