#include <SurveyMisalignmentInput.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
Read ideal tracker geometry from DB. | |
SurveyMisalignmentInput (const edm::ParameterSet &) | |
Private Member Functions | |
void | addSurveyInfo (Alignable *) |
Add survey info to an alignable. | |
AlignableSurface | getAlignableSurface (align::ID) |
Get alignable surface from misalignments.db. | |
Private Attributes | |
edm::ESHandle< Alignments > | alignments |
std::string | textFileName |
const edm::ParameterSet | theParameterSet |
SurveyInputTextReader::MapType | uIdMap |
Class to misaligned tracker from DB.
Definition at line 21 of file SurveyMisalignmentInput.h.
SurveyMisalignmentInput::SurveyMisalignmentInput | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 16 of file SurveyMisalignmentInput.cc.
: textFileName( cfg.getParameter<std::string>("textFileName") ), theParameterSet( cfg ) {}
void SurveyMisalignmentInput::addSurveyInfo | ( | Alignable * | ali | ) | [private] |
Add survey info to an alignable.
Definition at line 51 of file SurveyMisalignmentInput.cc.
References align::AlignableDetUnit, Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), alignCSCRings::e, error, getAlignableSurface(), i, Alignable::id(), Parameters::parameters, edm::second(), Alignable::setSurvey(), Alignable::surface(), and uIdMap.
Referenced by analyze().
{ const align::Alignables& comp = ali->components(); unsigned int nComp = comp.size(); for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo(comp[i]); SurveyInputTextReader::MapType::const_iterator it = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId())); align::ErrorMatrix error; if (it != uIdMap.end()){ //survey error values const align::Scalars& parameters = (it)->second; //sets the errors for the hierarchy level double* errorData = error.Array(); for (unsigned int i = 0; i < 21; ++i){errorData[i] = parameters[i+6];} //because record only needs global value of modules if (ali->alignableObjectId() == align::AlignableDetUnit){ // fill survey values ali->setSurvey( new SurveyDet(getAlignableSurface(ali->id()), error) ); } else{ ali->setSurvey( new SurveyDet(ali->surface(), error) ); } } else{ //fill error = ROOT::Math::SMatrixIdentity(); ali->setSurvey( new SurveyDet(ali->surface(), error*(1e-6)) ); } //std::cout << "UniqueId: " << id.first << ", " << id.second << std::endl; //std::cout << error << std::endl; }
void SurveyMisalignmentInput::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | setup | ||
) | [virtual] |
Read ideal tracker geometry from DB.
Implements SurveyInputBase.
Definition at line 21 of file SurveyMisalignmentInput.cc.
References SurveyInputBase::addComponent(), addSurveyInfo(), alignments, TrackerGeomBuilderFromGeometricDet::build(), SurveyInputBase::detector(), relativeConstraints::geom, edm::EventSetup::get(), edm::ESHandle< T >::product(), SurveyInputTextReader::readFile(), textFileName, SurveyInputBase::theFirstEvent, theParameterSet, patCandidatesForDimuonsSequences_cff::tracker, uIdMap, and SurveyInputTextReader::UniqueIdMap().
{ if (theFirstEvent) { //Retrieve tracker topology from geometry edm::ESHandle<TrackerTopology> tTopoHandle; setup.get<IdealGeometryRecord>().get(tTopoHandle); const TrackerTopology* const tTopo = tTopoHandle.product(); edm::ESHandle<GeometricDet> geom; setup.get<IdealGeometryRecord>().get(geom); TrackerGeometry* tracker = TrackerGeomBuilderFromGeometricDet().build(&*geom, theParameterSet); addComponent(new AlignableTracker( tracker, tTopo )); edm::LogInfo("SurveyMisalignmentInput") << "Starting!"; // Retrieve alignment[Error]s from DBase setup.get<TrackerAlignmentRcd>().get( alignments ); //Get map from textreader SurveyInputTextReader dataReader; dataReader.readFile( textFileName ); uIdMap = dataReader.UniqueIdMap(); addSurveyInfo( detector() ); theFirstEvent = false; } }
AlignableSurface SurveyMisalignmentInput::getAlignableSurface | ( | align::ID | id | ) | [private] |
Get alignable surface from misalignments.db.
Definition at line 89 of file SurveyMisalignmentInput.cc.
References alignments, position, makeMuonMisalignmentScenario::rot, and idealTransformation::rotation.
Referenced by addSurveyInfo().
{ std::vector<AlignTransform>::const_iterator it; for (it = alignments->m_align.begin(); it != alignments->m_align.end(); ++it) { if (id == (*it).rawId()) { align::PositionType position( (*it).translation().x(), (*it).translation().y(), (*it).translation().z() ); CLHEP::HepRotation rot( (*it).rotation() ); align::RotationType rotation( rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz() ); return AlignableSurface(position,rotation); } } return AlignableSurface(); }
Definition at line 42 of file SurveyMisalignmentInput.h.
Referenced by analyze(), and getAlignableSurface().
std::string SurveyMisalignmentInput::textFileName [private] |
Definition at line 40 of file SurveyMisalignmentInput.h.
Referenced by analyze().
const edm::ParameterSet SurveyMisalignmentInput::theParameterSet [private] |
Definition at line 50 of file SurveyMisalignmentInput.h.
Referenced by analyze().
Definition at line 38 of file SurveyMisalignmentInput.h.
Referenced by addSurveyInfo(), and analyze().