67 throw cms::Exception(
"CocoaDBMgr::DumpCocoaResults DB not available");
76 "OpticalAlignmentsRcd");
83 "OpticalAlignmentsRcd");
101 std::pair< Alignments*,AlignmentErrorsExtended*> dtali =
BuildAlignments(1);
106 nrcd = dt_Alignments->
m_align.size();
125 "DTAlignmentErrorExtendedRcd");
129 "DTAlignmentErrorExtendedRcd");
134 std::pair< Alignments*,AlignmentErrorsExtended*> cscali =
BuildAlignments(0);
139 nrcd = csc_Alignments->
m_align.size();
153 if ( myDbService->
isNewTagRequest(
"CSCAlignmentErrorExtendedRcd" ) ) {
157 "CSCAlignmentErrorExtendedRcd");
161 "CSCAlignmentErrorExtendedRcd");
177 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO " << opto->
name() << std::endl;
185 CLHEP::HepRotation parentRmGlobInv = inverseOf( opto->
parent()->
rmGlob() );
186 centreLocal = parentRmGlobInv * centreLocal;
189 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting coord " <<std::endl;
191 data.
x_.
value_= centreLocal.x() / 100.;
196 data.
y_.
value_= centreLocal.y() / 100.;
200 data.
z_.
value_= centreLocal.z() / 100.;
220 const std::vector< Entry* > theExtraEntryVector = opto->
ExtraEntryList();
std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting entry " << std::endl;
222 std::vector< Entry* >::const_iterator ite;
223 for( ite = theExtraEntryVector.begin(); ite != theExtraEntryVector.end(); ++ite ) {
225 extraEntry.
name_ = (*ite)->name();
227 extraEntry.
value_ = (*ite)->value();
228 extraEntry.
error_ = (*ite)->sigma();
229 extraEntry.
quality_ = (*ite)->quality();
231 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO done extra entry " << extraEntry.
name_ << std::endl;
245 return entry->
sigma();
269 static std::vector< OpticalObject* >::const_iterator ite;
270 for(ite = optolist.begin(); ite != optolist.end(); ++ite ){
271 if( (*ite)->type() ==
"system" )
continue;
275 std::cout <<
"@@@@ OPTALIGNINFO TO BE WRITTEN TO DB " 292 static std::vector< OpticalObject* >::const_iterator ite;
293 for(ite = optolist.begin(); ite != optolist.end(); ++ite ){
294 if( (*ite)->type() ==
"system" )
continue;
295 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite) << std::endl;
296 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite)->getCmsswID() << std::endl;
298 if( (*ite)->getCmsswID() > 0 ) {
299 std::cout <<
" cal fill alignments " << std::endl;
301 std::cout <<
" fill alignments " << std::endl;
305 std::cout <<
"CocoaDBMgr::BuildAlignments add alignmentError " << alignmentErrors->
m_alignError.size() << std::endl;
310 return std::pair< Alignments*,AlignmentErrorsExtended*>(alignments,alignmentErrors);
323 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO buildalign" << opto->
name() << std::endl;
326 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO alig built " << opto->
name() << std::endl;
350 CLHEP::HepMatrix errm(3,3);
352 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptOfill errm " << opto->
name() << std::endl;
353 errm(0,0) =
GetEntryError( theCoordinateEntryVector[0] ) / 100.;
354 errm(1,1) =
GetEntryError( theCoordinateEntryVector[1] ) / 100.;
355 errm(2,2) =
GetEntryError( theCoordinateEntryVector[2] ) / 100.;
356 errm(0,1) =
GetEntryError( theCoordinateEntryVector[0], theCoordinateEntryVector[1] ) / 100.;
357 errm(0,2) =
GetEntryError( theCoordinateEntryVector[0], theCoordinateEntryVector[2] ) / 100.;
358 errm(1,2) =
GetEntryError( theCoordinateEntryVector[1], theCoordinateEntryVector[2] ) / 100.;
363 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errm filled" << opto->
name() << std::endl;
367 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errms filled " << opto->
name() << std::endl;
371 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 std::vector< Entry * > & ExtraEntryList() const
const AlgebraicSymMatrix33 matrix() const
static ALIMatrix * GetAtWAMatrix()
OpticalAlignments * BuildOpticalAlignments()
const std::vector< Entry * > & CoordinateEntryList() const
static GlobalOptionMgr * getInstance()
std::vector< AlignTransform > m_align
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)
static std::vector< OpticalObject * > & OptOList()
std::vector< AlignTransformErrorExtended > m_alignError
static CocoaDBMgr * getInstance()
std::vector< OpticalAlignParam > extraEntries_
cond::Time_t endOfTime() const
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)
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
const ALIstring & type() const