#include <Alignment/MuonAlignment/interface/MuonAlignmentInputSurveyDB.h>
Public Member Functions | |
MuonAlignmentInputSurveyDB () | |
MuonAlignmentInputSurveyDB (std::string dtLabel, std::string cscLabel) | |
virtual AlignableMuon * | newAlignableMuon (const edm::EventSetup &iSetup) const |
virtual | ~MuonAlignmentInputSurveyDB () |
Private Member Functions | |
void | addSurveyInfo_ (Alignable *ali, unsigned int *theSurveyIndex, const Alignments *theSurveyValues, const SurveyErrors *theSurveyErrors) const |
MuonAlignmentInputSurveyDB (const MuonAlignmentInputSurveyDB &) | |
const MuonAlignmentInputSurveyDB & | operator= (const MuonAlignmentInputSurveyDB &) |
Private Attributes | |
std::string | m_cscLabel |
std::string | m_dtLabel |
Description: <one line="" class="" summary>="">
Usage: <usage>
Definition at line 31 of file MuonAlignmentInputSurveyDB.h.
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB | ( | ) |
Definition at line 36 of file MuonAlignmentInputSurveyDB.cc.
: m_dtLabel(""), m_cscLabel("") {}
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB | ( | std::string | dtLabel, |
std::string | cscLabel | ||
) |
Definition at line 39 of file MuonAlignmentInputSurveyDB.cc.
: m_dtLabel(dtLabel), m_cscLabel(cscLabel) {}
MuonAlignmentInputSurveyDB::~MuonAlignmentInputSurveyDB | ( | ) | [virtual] |
Definition at line 47 of file MuonAlignmentInputSurveyDB.cc.
{}
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB | ( | const MuonAlignmentInputSurveyDB & | ) | [private] |
void MuonAlignmentInputSurveyDB::addSurveyInfo_ | ( | Alignable * | ali, |
unsigned int * | theSurveyIndex, | ||
const Alignments * | theSurveyValues, | ||
const SurveyErrors * | theSurveyErrors | ||
) | const [private] |
Definition at line 103 of file MuonAlignmentInputSurveyDB.cc.
References Alignable::alignableObjectId(), Alignable::components(), error, Exception, Alignable::geomDetId(), i, AlignableSurface::length(), Alignments::m_align, SurveyErrors::m_surveyErrors, SurveyError::matrix(), pos, DetId::rawId(), SurveyError::rawId(), makeMuonMisalignmentScenario::rot, AlignableSurface::setLength(), Alignable::setSurvey(), AlignableSurface::setWidth(), SurveyError::structureType(), Alignable::surface(), and AlignableSurface::width().
Referenced by newAlignableMuon().
{ const std::vector<Alignable*>& comp = ali->components(); unsigned int nComp = comp.size(); for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo_(comp[i], theSurveyIndex, theSurveyValues, theSurveyErrors); const SurveyError& error = theSurveyErrors->m_surveyErrors[*theSurveyIndex]; if ( ali->geomDetId().rawId() != error.rawId() || ali->alignableObjectId() != error.structureType() ) { throw cms::Exception("DatabaseError") << "Error reading survey info from DB. Mismatched id!"; } const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[*theSurveyIndex].translation(); const CLHEP::HepRotation& rot = theSurveyValues->m_align[*theSurveyIndex].rotation(); AlignableSurface surf( align::PositionType( pos.x(), pos.y(), pos.z() ), align::RotationType( rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz() ) ); surf.setWidth( ali->surface().width() ); surf.setLength( ali->surface().length() ); ali->setSurvey( new SurveyDet( surf, error.matrix() ) ); (*theSurveyIndex)++; }
AlignableMuon * MuonAlignmentInputSurveyDB::newAlignableMuon | ( | const edm::EventSetup & | iSetup | ) | const [virtual] |
Reimplemented from MuonAlignmentInputMethod.
Definition at line 65 of file MuonAlignmentInputSurveyDB.cc.
References addSurveyInfo_(), align::AlignableMuon, AlignableMuon::CSCEndcaps(), AlignableMuon::DTBarrel(), edm::EventSetup::get(), MuonAlignmentInputMethod::idealCSCGeometry(), MuonAlignmentInputMethod::idealDTGeometry(), m_cscLabel, m_dtLabel, and convertSQLitetoXML_cfg::output.
{ boost::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup); boost::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup); edm::ESHandle<Alignments> dtSurvey; edm::ESHandle<SurveyErrors> dtSurveyError; edm::ESHandle<Alignments> cscSurvey; edm::ESHandle<SurveyErrors> cscSurveyError; iSetup.get<DTSurveyRcd>().get(m_dtLabel, dtSurvey); iSetup.get<DTSurveyErrorRcd>().get(m_dtLabel, dtSurveyError); iSetup.get<CSCSurveyRcd>().get(m_cscLabel, cscSurvey); iSetup.get<CSCSurveyErrorRcd>().get(m_cscLabel, cscSurveyError); AlignableMuon *output = new AlignableMuon(&(*dtGeometry), &(*cscGeometry)); unsigned int theSurveyIndex = 0; const Alignments *theSurveyValues = &*dtSurvey; const SurveyErrors *theSurveyErrors = &*dtSurveyError; std::vector<Alignable*> barrels = output->DTBarrel(); for (std::vector<Alignable*>::const_iterator iter = barrels.begin(); iter != barrels.end(); ++iter) { addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors); } theSurveyIndex = 0; theSurveyValues = &*cscSurvey; theSurveyErrors = &*cscSurveyError; std::vector<Alignable*> endcaps = output->CSCEndcaps(); for (std::vector<Alignable*>::const_iterator iter = endcaps.begin(); iter != endcaps.end(); ++iter) { addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors); } return output; }
const MuonAlignmentInputSurveyDB& MuonAlignmentInputSurveyDB::operator= | ( | const MuonAlignmentInputSurveyDB & | ) | [private] |
std::string MuonAlignmentInputSurveyDB::m_cscLabel [private] |
Definition at line 57 of file MuonAlignmentInputSurveyDB.h.
Referenced by newAlignableMuon().
std::string MuonAlignmentInputSurveyDB::m_dtLabel [private] |
Definition at line 57 of file MuonAlignmentInputSurveyDB.h.
Referenced by newAlignableMuon().