#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 |
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") ) { }
void SurveyMisalignmentInput::addSurveyInfo | ( | Alignable * | ali | ) | [private] |
Add survey info to an alignable.
Definition at line 45 of file SurveyMisalignmentInput.cc.
References align::AlignableDetUnit, Alignable::alignableObjectId(), Alignable::components(), 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(), SurveyInputTextReader::readFile(), textFileName, SurveyInputBase::theFirstEvent, patCandidatesForDimuonsSequences_cff::tracker, uIdMap, and SurveyInputTextReader::UniqueIdMap().
{ if (theFirstEvent) { edm::ESHandle<GeometricDet> geom; setup.get<IdealGeometryRecord>().get(geom); TrackerGeometry* tracker = TrackerGeomBuilderFromGeometricDet().build(&*geom); addComponent(new AlignableTracker( tracker ) ); 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 83 of file SurveyMisalignmentInput.cc.
References alignments, and position.
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().
Definition at line 38 of file SurveyMisalignmentInput.h.
Referenced by addSurveyInfo(), and analyze().