![]() |
![]() |
#include <Alignment/SurveyAnalysis/plugins/SurveyMisalignmentInput.h>
Public Member Functions | |
virtual void | beginJob (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 |
Definition at line 21 of file SurveyMisalignmentInput.h.
SurveyMisalignmentInput::SurveyMisalignmentInput | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 16 of file SurveyMisalignmentInput.cc.
00016 : 00017 textFileName( cfg.getParameter<std::string>("textFileName") ) 00018 { 00019 }
Add survey info to an alignable.
Definition at line 42 of file SurveyMisalignmentInput.cc.
References align::AlignableDetUnit, Alignable::alignableObjectId(), Alignable::components(), e, error, getAlignableSurface(), i, Alignable::id(), it, python::trackProbabilityAnalysis_cff::parameters, edm::second(), Alignable::setSurvey(), Alignable::surface(), and uIdMap.
Referenced by beginJob().
00043 { 00044 00045 const align::Alignables& comp = ali->components(); 00046 unsigned int nComp = comp.size(); 00047 for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo(comp[i]); 00048 00049 SurveyInputTextReader::MapType::const_iterator it 00050 = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId())); 00051 00052 align::ErrorMatrix error; 00053 00054 if (it != uIdMap.end()){ 00055 //survey error values 00056 const align::Scalars& parameters = (it)->second; 00057 //sets the errors for the hierarchy level 00058 double* errorData = error.Array(); 00059 for (unsigned int i = 0; i < 21; ++i){errorData[i] = parameters[i+6];} 00060 00061 //because record only needs global value of modules 00062 if (ali->alignableObjectId() == align::AlignableDetUnit){ 00063 // fill survey values 00064 ali->setSurvey( new SurveyDet(getAlignableSurface(ali->id()), error) ); 00065 } 00066 else{ 00067 ali->setSurvey( new SurveyDet(ali->surface(), error) ); 00068 } 00069 } 00070 else{ 00071 //fill 00072 error = ROOT::Math::SMatrixIdentity(); 00073 ali->setSurvey( new SurveyDet(ali->surface(), error*(1e-6)) ); 00074 } 00075 //std::cout << "UniqueId: " << id.first << ", " << id.second << std::endl; 00076 //std::cout << error << std::endl; 00077 00078 }
void SurveyMisalignmentInput::beginJob | ( | 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, SurveyInputBase::detector(), edm::EventSetup::get(), SurveyInputTextReader::readFile(), textFileName, uIdMap, and SurveyInputTextReader::UniqueIdMap().
00022 { 00023 00024 edm::ESHandle<GeometricDet> geom; 00025 setup.get<IdealGeometryRecord>().get(geom); 00026 TrackerGeometry* tracker = TrackerGeomBuilderFromGeometricDet().build(&*geom); 00027 addComponent(new AlignableTracker( tracker ) ); 00028 00029 edm::LogInfo("SurveyMisalignmentInput") << "Starting!"; 00030 // Retrieve alignment[Error]s from DBase 00031 setup.get<TrackerAlignmentRcd>().get( alignments ); 00032 00033 //Get map from textreader 00034 SurveyInputTextReader dataReader; 00035 dataReader.readFile( textFileName ); 00036 uIdMap = dataReader.UniqueIdMap(); 00037 00038 addSurveyInfo( detector() ); 00039 }
AlignableSurface SurveyMisalignmentInput::getAlignableSurface | ( | align::ID | id | ) | [private] |
Get alignable surface from misalignments.db.
Definition at line 80 of file SurveyMisalignmentInput.cc.
References alignments, it, and rot.
Referenced by addSurveyInfo().
00081 { 00082 std::vector<AlignTransform>::const_iterator it; 00083 00084 for (it = alignments->m_align.begin(); it != alignments->m_align.end(); ++it) 00085 { 00086 if (id == (*it).rawId()) 00087 { 00088 align::PositionType position( (*it).translation().x(), (*it).translation().y(), (*it).translation().z() ); 00089 CLHEP::HepRotation rot( (*it).rotation() ); 00090 align::RotationType rotation( rot.xx(), rot.xy(), rot.xz(), 00091 rot.yx(), rot.yy(), rot.yz(), 00092 rot.zx(), rot.zy(), rot.zz() ); 00093 return AlignableSurface(position,rotation); 00094 } 00095 } 00096 00097 return AlignableSurface(); 00098 }
Definition at line 41 of file SurveyMisalignmentInput.h.
Referenced by beginJob(), and getAlignableSurface().
std::string SurveyMisalignmentInput::textFileName [private] |
Definition at line 37 of file SurveyMisalignmentInput.h.
Referenced by addSurveyInfo(), and beginJob().