#include <SurveyInputTrackerFromDB.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
Read ideal tracker geometry from DB. | |
SurveyInputTrackerFromDB (const edm::ParameterSet &) | |
Private Member Functions | |
void | addSurveyInfo (Alignable *) |
Add survey info to an alignable. | |
Private Attributes | |
std::string | textFileName |
SurveyInputTextReader::MapType | uIdMap |
Class to read ideal tracker from DB.
Definition at line 16 of file SurveyInputTrackerFromDB.h.
SurveyInputTrackerFromDB::SurveyInputTrackerFromDB | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 20 of file SurveyInputTrackerFromDB.cc.
: textFileName( cfg.getParameter<std::string>("textFileName") ) { }
void SurveyInputTrackerFromDB::addSurveyInfo | ( | Alignable * | ali | ) | [private] |
Add survey info to an alignable.
Definition at line 61 of file SurveyInputTrackerFromDB.cc.
References Alignable::alignableObjectId(), Alignable::components(), error, i, Alignable::id(), Basic3DVector< T >::mag(), Alignable::move(), Parameters::parameters, Alignable::rotateInLocalFrame(), edm::second(), Alignable::setSurvey(), Alignable::surface(), AlignableSurface::toGlobal(), 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]); align::ErrorMatrix error; SurveyInputTextReader::MapType::const_iterator it = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId())); if (it != uIdMap.end()){ const align::Scalars& parameters = (it)->second; //move the surface //displacement align::LocalVector lvector (parameters[0], parameters[1], parameters[2]); align::GlobalVector gvector = ali->surface().toGlobal(lvector); ali->move(gvector); //rotation Basic3DVector<align::Scalar> rot_aa(parameters[3], parameters[4], parameters[5]); align::RotationType rotation(rot_aa, rot_aa.mag()); ali->rotateInLocalFrame(rotation); //sets the errors for the hierarchy level double* errorData = error.Array(); for (unsigned int i = 0; i < 21; ++i){errorData[i] = parameters[i+6];} ali->setSurvey( new SurveyDet(ali->surface(), error*(1e-6)) ); } else { error = ROOT::Math::SMatrixIdentity(); ali->setSurvey( new SurveyDet(ali->surface(), error * 1e-6) ); } }
void SurveyInputTrackerFromDB::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | setup | ||
) | [virtual] |
Read ideal tracker geometry from DB.
Implements SurveyInputBase.
Definition at line 25 of file SurveyInputTrackerFromDB.cc.
References SurveyInputBase::addComponent(), addSurveyInfo(), Alignable::alignmentErrors(), Alignable::alignments(), TrackerGeomBuilderFromGeometricDet::build(), SurveyInputBase::detector(), relativeConstraints::geom, edm::EventSetup::get(), edm::Service< T >::isAvailable(), SurveyInputTextReader::readFile(), textFileName, SurveyInputBase::theFirstEvent, patCandidatesForDimuonsSequences_cff::tracker, uIdMap, and SurveyInputTextReader::UniqueIdMap().
{ if (theFirstEvent) { // std::cout << "***************ENTERING INITIALIZATION******************" << std::endl; //Get map from textreader SurveyInputTextReader dataReader; dataReader.readFile( textFileName ); uIdMap = dataReader.UniqueIdMap(); edm::ESHandle<GeometricDet> geom; setup.get<IdealGeometryRecord>().get(geom); TrackerGeometry* tracker = TrackerGeomBuilderFromGeometricDet().build(&*geom); addComponent( new AlignableTracker( tracker ) ); addSurveyInfo( detector() ); //write out to a DB ... Alignments* myAlignments = detector()->alignments(); AlignmentErrors* myAlignmentErrors = detector()->alignmentErrors(); // 2. Store alignment[Error]s to DB edm::Service<cond::service::PoolDBOutputService> poolDbService; // Call service if( !poolDbService.isAvailable() ) // Die if not available throw cms::Exception("NotAvailable") << "PoolDBOutputService not available"; poolDbService->writeOne<Alignments>( myAlignments, poolDbService->beginOfTime(), "TrackerAlignmentRcd" ); poolDbService->writeOne<AlignmentErrors>( myAlignmentErrors, poolDbService->beginOfTime(), "TrackerAlignmentErrorRcd" ); theFirstEvent = false; } }
std::string SurveyInputTrackerFromDB::textFileName [private] |
Definition at line 35 of file SurveyInputTrackerFromDB.h.
Referenced by analyze().
Definition at line 33 of file SurveyInputTrackerFromDB.h.
Referenced by addSurveyInfo(), and analyze().