#include <SurveyDBUploader.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | endJob () |
Upload to DB. | |
SurveyDBUploader (const edm::ParameterSet &) | |
Set value & error tag names for survey records. | |
Private Types | |
typedef AlignTransform | SurveyValue |
typedef Alignments | SurveyValues |
Private Member Functions | |
void | getSurveyInfo (const Alignable *) |
Get survey info of an alignable in the detector. | |
Private Attributes | |
std::string | theErrorRcd |
SurveyErrors * | theErrors |
std::string | theValueRcd |
SurveyValues * | theValues |
Module for uploading survey info to the DB.
Usage: module uploader = SurveyDBUploader { string valueTag = "TrackerSurveyRcd" string errorTag = "TrackerSurveyErrorRcd" }
Definition at line 27 of file SurveyDBUploader.h.
typedef AlignTransform SurveyDBUploader::SurveyValue [private] |
Definition at line 30 of file SurveyDBUploader.h.
typedef Alignments SurveyDBUploader::SurveyValues [private] |
Definition at line 31 of file SurveyDBUploader.h.
SurveyDBUploader::SurveyDBUploader | ( | const edm::ParameterSet & | cfg | ) |
Set value & error tag names for survey records.
Definition at line 12 of file SurveyDBUploader.cc.
: theValueRcd( cfg.getParameter<std::string>("valueRcd") ), theErrorRcd( cfg.getParameter<std::string>("errorRcd") ), theValues(0), theErrors(0) { }
virtual void SurveyDBUploader::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [inline, virtual] |
void SurveyDBUploader::endJob | ( | void | ) | [virtual] |
Upload to DB.
Reimplemented from edm::EDAnalyzer.
Definition at line 20 of file SurveyDBUploader.cc.
References SurveyInputBase::detector(), Exception, getSurveyInfo(), edm::Service< T >::isAvailable(), Alignments::m_align, SurveyErrors::m_surveyErrors, theErrorRcd, theErrors, theValueRcd, and theValues.
{ theValues = new SurveyValues; theErrors = new SurveyErrors; theValues->m_align.reserve(65536); theErrors->m_surveyErrors.reserve(65536); getSurveyInfo( SurveyInputBase::detector() ); edm::Service<cond::service::PoolDBOutputService> poolDbService; if( poolDbService.isAvailable() ) { poolDbService->writeOne<SurveyValues> (theValues, poolDbService->currentTime(), theValueRcd); poolDbService->writeOne<SurveyErrors> (theErrors, poolDbService->currentTime(), theErrorRcd); } else throw cms::Exception("ConfigError") << "PoolDBOutputService is not available"; }
void SurveyDBUploader::getSurveyInfo | ( | const Alignable * | ali | ) | [private] |
Get survey info of an alignable in the detector.
Definition at line 44 of file SurveyDBUploader.cc.
References Alignable::alignableObjectId(), Alignable::components(), error, SurveyDet::errors(), i, Alignable::id(), Alignments::m_align, SurveyErrors::m_surveyErrors, pos, SurveyDet::position(), makeMuonMisalignmentScenario::rot, SurveyDet::rotation(), Alignable::survey(), theErrors, theValues, relativeConstraints::value, PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), PV3DBase< T, PVType, FrameType >::z(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().
Referenced by endJob().
{ const std::vector<Alignable*>& comp = ali->components(); unsigned int nComp = comp.size(); for (unsigned int i = 0; i < nComp; ++i) getSurveyInfo(comp[i]); const SurveyDet* survey = ali->survey(); const align::PositionType& pos = survey->position(); const align::RotationType& rot = survey->rotation(); SurveyValue value( CLHEP::Hep3Vector( pos.x(), pos.y(), pos.z() ), CLHEP::HepRotation ( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz() ) ), ali->id() ); SurveyError error( ali->alignableObjectId(), ali->id(), survey->errors() ); theValues->m_align.push_back(value); theErrors->m_surveyErrors.push_back(error); }
std::string SurveyDBUploader::theErrorRcd [private] |
Definition at line 56 of file SurveyDBUploader.h.
Referenced by endJob().
SurveyErrors* SurveyDBUploader::theErrors [private] |
Definition at line 59 of file SurveyDBUploader.h.
Referenced by endJob(), and getSurveyInfo().
std::string SurveyDBUploader::theValueRcd [private] |
Definition at line 55 of file SurveyDBUploader.h.
Referenced by endJob().
SurveyValues* SurveyDBUploader::theValues [private] |
Definition at line 58 of file SurveyDBUploader.h.
Referenced by endJob(), and getSurveyInfo().