00001 #ifndef CondFormats_Alignment_SurveyError_H 00002 #define CondFormats_Alignment_SurveyError_H 00003 00019 #include "CondFormats/Alignment/interface/Definitions.h" 00020 00021 class SurveyError 00022 { 00023 typedef align::ErrorMatrix ErrorMatrix; 00024 typedef ErrorMatrix::value_type Scalar; 00025 00026 public: 00027 00028 inline SurveyError( 00029 uint8_t structureType = 0, // default unknown 00030 align::ID rawId = 0, // default unknown 00031 const ErrorMatrix& = ErrorMatrix() // default 0 00032 ); 00033 00034 inline uint8_t structureType() const; 00035 00036 inline align::ID rawId() const; 00037 00038 inline ErrorMatrix matrix() const; 00039 00040 private: 00041 00042 static const unsigned int nPar_ = ErrorMatrix::kRows; 00043 static const unsigned int size_ = nPar_ * (nPar_ + 1) / 2; 00044 00045 uint8_t m_structureType; 00046 align::ID m_rawId; 00047 00048 Scalar m_errors[size_]; 00049 }; 00050 00051 SurveyError::SurveyError(uint8_t structureType, 00052 align::ID rawId, 00053 const ErrorMatrix& cov): 00054 m_structureType(structureType), 00055 m_rawId(rawId) 00056 { 00057 const Scalar* data = cov.Array(); // lower triangular of cov 00058 00059 for (unsigned int i = 0; i < size_; ++i) m_errors[i] = data[i]; 00060 } 00061 00062 uint8_t SurveyError::structureType() const 00063 { 00064 return m_structureType; 00065 } 00066 00067 align::ID SurveyError::rawId() const 00068 { 00069 return m_rawId; 00070 } 00071 00072 SurveyError::ErrorMatrix SurveyError::matrix() const 00073 { 00074 return ErrorMatrix(m_errors, m_errors + size_); 00075 } 00076 00077 #endif