62 throw cms::Exception(
"CocoaDBMgr::DumpCocoaResults DB not available");
74 "OpticalAlignmentsRcd");
77 <<
" current " << myDbService->
currentTime() <<
" end " << myDbService->
endOfTime() << std::endl;
83 "OpticalAlignmentsRcd");
95 std::cout <<
"OpticalAlignmentsRcd WRITTEN TO DB : " << nrcd << std::endl;
100 std::pair<Alignments*, AlignmentErrorsExtended*> dtali =
BuildAlignments(
true);
105 nrcd = dt_Alignments->
m_align.size();
116 std::cout <<
"DTAlignmentRcd WRITTEN TO DB : " << nrcd << std::endl;
121 &(*dt_AlignmentErrors), myDbService->
beginOfTime(), myDbService->
endOfTime(),
"DTAlignmentErrorExtendedRcd");
124 &(*dt_AlignmentErrors), appendTime,
"DTAlignmentErrorExtendedRcd");
127 std::cout <<
"DTAlignmentErrorExtendedRcd WRITTEN TO DB : " << nrcd << std::endl;
130 std::pair<Alignments*, AlignmentErrorsExtended*> cscali =
BuildAlignments(
false);
135 nrcd = csc_Alignments->
m_align.size();
143 std::cout <<
"CSCAlignmentRcd WRITTEN TO DB : " << nrcd << std::endl;
150 "CSCAlignmentErrorExtendedRcd");
153 &(*csc_AlignmentErrors), appendTime,
"CSCAlignmentErrorExtendedRcd");
156 std::cout <<
"CSCAlignmentErrorExtendedRcd WRITTEN TO DB : " << nrcd << std::endl;
168 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO " << opto->
name() << std::endl;
176 CLHEP::HepRotation parentRmGlobInv = inverseOf(opto->
parent()->
rmGlob());
177 centreLocal = parentRmGlobInv * centreLocal;
180 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting coord " << std::endl;
182 data.
x_.
value_ = centreLocal.x() / 100.;
187 data.
y_.
value_ = centreLocal.y() / 100.;
191 data.
z_.
value_ = centreLocal.z() / 100.;
210 const std::vector<Entry*>& theExtraEntryVector = opto->
ExtraEntryList();
211 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting entry " << std::endl;
213 std::vector<Entry*>::const_iterator ite;
214 for (ite = theExtraEntryVector.begin(); ite != theExtraEntryVector.end(); ++ite) {
216 extraEntry.
name_ = (*ite)->name();
218 extraEntry.
value_ = (*ite)->value();
219 extraEntry.
error_ = (*ite)->sigma();
220 extraEntry.
quality_ = (*ite)->quality();
222 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO done extra entry " << extraEntry.
name_ << std::endl;
233 return entry->
sigma();
239 if (entry1 == entry2)
254 static std::vector<OpticalObject*>::const_iterator ite;
255 for (ite = optolist.begin(); ite != optolist.end(); ++ite) {
256 if ((*ite)->type() ==
"system")
261 std::cout <<
"@@@@ OPTALIGNINFO TO BE WRITTEN TO DB " << data << std::endl;
274 static std::vector<OpticalObject*>::const_iterator ite;
275 for (ite = optolist.begin(); ite != optolist.end(); ++ite) {
276 if ((*ite)->type() ==
"system")
278 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite) << std::endl;
279 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite)->getCmsswID() << std::endl;
281 if ((*ite)->getCmsswID() > 0) {
282 std::cout <<
" cal fill alignments " << std::endl;
284 std::cout <<
" fill alignments " << std::endl;
288 std::cout <<
"CocoaDBMgr::BuildAlignments add alignmentError " << alignmentErrors->
m_alignError.size()
294 std::cout <<
"CocoaDBMgr::BuildAlignments end with n alignment " << alignments->
m_align.size()
295 <<
" n alignmentError " << alignmentErrors->
m_alignError.size() << std::endl;
296 return std::pair<Alignments*, AlignmentErrorsExtended*>(alignments, alignmentErrors);
302 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO " << opto->
name() << std::endl;
308 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO buildalign" << opto->
name() << std::endl;
311 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO alig built " << opto->
name() << std::endl;
320 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoErrorFromOptO " << opto->
name() << std::endl;
330 CLHEP::HepMatrix errm(3, 3);
332 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptOfill errm " << opto->
name() << std::endl;
333 errm(0, 0) =
GetEntryError(theCoordinateEntryVector[0]) / 100.;
334 errm(1, 1) =
GetEntryError(theCoordinateEntryVector[1]) / 100.;
335 errm(2, 2) =
GetEntryError(theCoordinateEntryVector[2]) / 100.;
336 errm(0, 1) =
GetEntryError(theCoordinateEntryVector[0], theCoordinateEntryVector[1]) / 100.;
337 errm(0, 2) =
GetEntryError(theCoordinateEntryVector[0], theCoordinateEntryVector[2]) / 100.;
338 errm(1, 2) =
GetEntryError(theCoordinateEntryVector[1], theCoordinateEntryVector[2]) / 100.;
343 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errm filled" << opto->
name() << std::endl;
347 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errms filled " << opto->
name() << std::endl;
351 std::cout << alignError <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO error built " << opto->
name() << std::endl;
const ALIuint getCmsswID() const
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
AlignTransformErrorExtended * GetAlignInfoErrorFromOptO(OpticalObject *opto)
const AlgebraicSymMatrix33 matrix() const
static ALIMatrix * GetAtWAMatrix()
static std::vector< OpticalObject * > & OptOList()
OpticalAlignments * BuildOpticalAlignments()
static GlobalOptionMgr * getInstance()
std::vector< AlignTransform > m_align
const std::vector< Entry * > & CoordinateEntryList() const
const CLHEP::HepRotation & rmGlob() const
static CocoaDBMgr * instance
std::vector< double > getLocalRotationAngles(const std::vector< Entry * > &entries) const
void appendSinceTime(T *payloadObj, cond::Time_t sinceTime, const std::string &recordName, bool withlogging=false)
unsigned long long Time_t
bool isNewTagRequest(const std::string &recordName)
std::vector< OpticalAlignInfo > opticalAlignments_
cond::Time_t beginOfTime() const
const OpticalObject * parent() const
AlignTransform * GetAlignInfoFromOptO(OpticalObject *opto)
double GetEntryError(const Entry *entry)
OpticalAlignInfo GetOptAlignInfoFromOptO(OpticalObject *opto)
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
std::vector< AlignTransformErrorExtended > m_alignError
static CocoaDBMgr * getInstance()
std::vector< OpticalAlignParam > extraEntries_
cond::Time_t endOfTime() const
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
const CLHEP::Hep3Vector & centreGlob() const
char data[epos_bytes_allocation]
cond::Time_t currentTime() const
const ALIstring & name() const
std::pair< Alignments *, AlignmentErrorsExtended * > BuildAlignments(bool bDT)
const std::vector< Entry * > & ExtraEntryList() const
const ALIstring & type() const