#include <Alignment/MuonAlignment/interface/MuonAlignmentInputSurveyDB.h>
Public Member Functions | |
MuonAlignmentInputSurveyDB (std::string dtLabel, std::string cscLabel) | |
MuonAlignmentInputSurveyDB () | |
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 |
Usage: <usage>
Definition at line 31 of file MuonAlignmentInputSurveyDB.h.
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB | ( | ) |
Definition at line 36 of file MuonAlignmentInputSurveyDB.cc.
00037 : m_dtLabel(""), m_cscLabel("") {}
MuonAlignmentInputSurveyDB::MuonAlignmentInputSurveyDB | ( | std::string | dtLabel, | |
std::string | cscLabel | |||
) |
Definition at line 39 of file MuonAlignmentInputSurveyDB.cc.
00040 : m_dtLabel(dtLabel), m_cscLabel(cscLabel) {}
MuonAlignmentInputSurveyDB::~MuonAlignmentInputSurveyDB | ( | ) | [virtual] |
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(), DetId::rawId(), SurveyError::rawId(), rot, AlignableSurface::setLength(), Alignable::setSurvey(), AlignableSurface::setWidth(), SurveyError::structureType(), Alignable::surface(), and AlignableSurface::width().
Referenced by newAlignableMuon().
00106 { 00107 const std::vector<Alignable*>& comp = ali->components(); 00108 00109 unsigned int nComp = comp.size(); 00110 00111 for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo_(comp[i], theSurveyIndex, theSurveyValues, theSurveyErrors); 00112 00113 const SurveyError& error = theSurveyErrors->m_surveyErrors[*theSurveyIndex]; 00114 00115 if ( ali->geomDetId().rawId() != error.rawId() || 00116 ali->alignableObjectId() != error.structureType() ) 00117 { 00118 throw cms::Exception("DatabaseError") 00119 << "Error reading survey info from DB. Mismatched id!"; 00120 } 00121 00122 const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[*theSurveyIndex].translation(); 00123 const CLHEP::HepRotation& rot = theSurveyValues->m_align[*theSurveyIndex].rotation(); 00124 00125 AlignableSurface surf( align::PositionType( pos.x(), pos.y(), pos.z() ), 00126 align::RotationType( rot.xx(), rot.xy(), rot.xz(), 00127 rot.yx(), rot.yy(), rot.yz(), 00128 rot.zx(), rot.zy(), rot.zz() ) ); 00129 00130 surf.setWidth( ali->surface().width() ); 00131 surf.setLength( ali->surface().length() ); 00132 00133 ali->setSurvey( new SurveyDet( surf, error.matrix() ) ); 00134 00135 (*theSurveyIndex)++; 00136 }
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(), iter, m_cscLabel, m_dtLabel, and output().
00065 { 00066 boost::shared_ptr<DTGeometry> dtGeometry = idealDTGeometry(iSetup); 00067 boost::shared_ptr<CSCGeometry> cscGeometry = idealCSCGeometry(iSetup); 00068 00069 edm::ESHandle<Alignments> dtSurvey; 00070 edm::ESHandle<SurveyErrors> dtSurveyError; 00071 edm::ESHandle<Alignments> cscSurvey; 00072 edm::ESHandle<SurveyErrors> cscSurveyError; 00073 iSetup.get<DTSurveyRcd>().get(m_dtLabel, dtSurvey); 00074 iSetup.get<DTSurveyErrorRcd>().get(m_dtLabel, dtSurveyError); 00075 iSetup.get<CSCSurveyRcd>().get(m_cscLabel, cscSurvey); 00076 iSetup.get<CSCSurveyErrorRcd>().get(m_cscLabel, cscSurveyError); 00077 00078 AlignableMuon *output = new AlignableMuon(&(*dtGeometry), &(*cscGeometry)); 00079 00080 unsigned int theSurveyIndex = 0; 00081 const Alignments *theSurveyValues = &*dtSurvey; 00082 const SurveyErrors *theSurveyErrors = &*dtSurveyError; 00083 std::vector<Alignable*> barrels = output->DTBarrel(); 00084 for (std::vector<Alignable*>::const_iterator iter = barrels.begin(); iter != barrels.end(); ++iter) { 00085 addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors); 00086 } 00087 00088 theSurveyIndex = 0; 00089 theSurveyValues = &*cscSurvey; 00090 theSurveyErrors = &*cscSurveyError; 00091 std::vector<Alignable*> endcaps = output->CSCEndcaps(); 00092 for (std::vector<Alignable*>::const_iterator iter = endcaps.begin(); iter != endcaps.end(); ++iter) { 00093 addSurveyInfo_(*iter, &theSurveyIndex, theSurveyValues, theSurveyErrors); 00094 } 00095 00096 return output; 00097 }
const MuonAlignmentInputSurveyDB& MuonAlignmentInputSurveyDB::operator= | ( | const MuonAlignmentInputSurveyDB & | ) | [private] |
std::string MuonAlignmentInputSurveyDB::m_cscLabel [private] |
std::string MuonAlignmentInputSurveyDB::m_dtLabel [private] |