CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondFormats/Alignment/src/DetectorGlobalPosition.cc

Go to the documentation of this file.
00001 #include "CondFormats/Alignment/interface/DetectorGlobalPosition.h"
00002 
00003 #include "CondFormats/Alignment/interface/Alignments.h"
00004 #include "CondFormats/Alignment/interface/AlignTransform.h"
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 #include "FWCore/Utilities/interface/Exception.h"
00007 #include <vector>
00008 
00009 namespace align {
00010   const AlignTransform &DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id) {
00011     for (std::vector<AlignTransform>::const_iterator iter = allGlobals.m_align.begin();
00012          iter != allGlobals.m_align.end();
00013          ++iter) {
00014       if (iter->rawId() == id.rawId()) {
00015         return *iter;
00016       }
00017     }
00018 
00019     throw cms::Exception("RecordNotFound")
00020       << "DetId(" << id.rawId() << ") not found in GlobalPositionRcd" << std::endl;
00021   }
00022 }