69 throw cms::Exception(
"CocoaDBMgr::DumpCocoaResults DB not available");
78 "OpticalAlignmentsRcd");
85 "OpticalAlignmentsRcd");
103 std::pair< Alignments*,AlignmentErrorsExtended*> dtali =
BuildAlignments(1);
108 nrcd = dt_Alignments->
m_align.size();
127 "DTAlignmentErrorExtendedRcd");
131 "DTAlignmentErrorExtendedRcd");
136 std::pair< Alignments*,AlignmentErrorsExtended*> cscali =
BuildAlignments(0);
141 nrcd = csc_Alignments->
m_align.size();
155 if ( myDbService->
isNewTagRequest(
"CSCAlignmentErrorExtendedRcd" ) ) {
159 "CSCAlignmentErrorExtendedRcd");
163 "CSCAlignmentErrorExtendedRcd");
179 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO " << opto->
name() << std::endl;
187 CLHEP::HepRotation parentRmGlobInv = inverseOf( opto->
parent()->
rmGlob() );
188 centreLocal = parentRmGlobInv * centreLocal;
191 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting coord " <<std::endl;
193 data.
x_.
value_= centreLocal.x() / 100.;
198 data.
y_.
value_= centreLocal.y() / 100.;
202 data.
z_.
value_= centreLocal.z() / 100.;
222 const std::vector< Entry* > theExtraEntryVector = opto->
ExtraEntryList();
std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO starting entry " << std::endl;
224 std::vector< Entry* >::const_iterator ite;
225 for( ite = theExtraEntryVector.begin(); ite != theExtraEntryVector.end(); ++ite ) {
227 extraEntry.
name_ = (*ite)->name();
229 extraEntry.
value_ = (*ite)->value();
230 extraEntry.
error_ = (*ite)->sigma();
231 extraEntry.
quality_ = (*ite)->quality();
233 std::cout <<
" CocoaDBMgr::GetOptAlignInfoFromOptO done extra entry " << extraEntry.
name_ << std::endl;
247 return entry->
sigma();
271 static std::vector< OpticalObject* >::const_iterator ite;
272 for(ite = optolist.begin(); ite != optolist.end(); ++ite ){
273 if( (*ite)->type() ==
"system" )
continue;
277 std::cout <<
"@@@@ OPTALIGNINFO TO BE WRITTEN TO DB "
294 static std::vector< OpticalObject* >::const_iterator ite;
295 for(ite = optolist.begin(); ite != optolist.end(); ++ite ){
296 if( (*ite)->type() ==
"system" )
continue;
297 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite) << std::endl;
298 std::cout <<
"CocoaDBMgr::BuildAlignments getCmsswID " << (*ite)->getCmsswID() << std::endl;
300 if( (*ite)->getCmsswID() > 0 ) {
301 std::cout <<
" cal fill alignments " << std::endl;
303 std::cout <<
" fill alignments " << std::endl;
307 std::cout <<
"CocoaDBMgr::BuildAlignments add alignmentError " << alignmentErrors->
m_alignError.size() << std::endl;
312 return std::pair< Alignments*,AlignmentErrorsExtended*>(alignments,alignmentErrors);
325 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO buildalign" << opto->
name() << std::endl;
328 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO alig built " << opto->
name() << std::endl;
352 CLHEP::HepMatrix errm(3,3);
354 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptOfill errm " << opto->
name() << std::endl;
355 errm(0,0) =
GetEntryError( theCoordinateEntryVector[0] ) / 100.;
356 errm(1,1) =
GetEntryError( theCoordinateEntryVector[1] ) / 100.;
357 errm(2,2) =
GetEntryError( theCoordinateEntryVector[2] ) / 100.;
358 errm(0,1) =
GetEntryError( theCoordinateEntryVector[0], theCoordinateEntryVector[1] ) / 100.;
359 errm(0,2) =
GetEntryError( theCoordinateEntryVector[0], theCoordinateEntryVector[2] ) / 100.;
360 errm(1,2) =
GetEntryError( theCoordinateEntryVector[1], theCoordinateEntryVector[2] ) / 100.;
365 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errm filled" << opto->
name() << std::endl;
369 std::cout <<
"@@@ CocoaDBMgr::GetAlignInfoFromOptO errms filled " << opto->
name() << std::endl;
373 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
static ALIMatrix * GetAtWAMatrix()
const AlgebraicSymMatrix33 & matrix() const
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
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