File indexing completed on 2024-04-06 12:01:55
0001 #ifndef CondFormats_Alignment_SurveyError_H
0002 #define CondFormats_Alignment_SurveyError_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "CondFormats/Serialization/interface/Serializable.h"
0020
0021 #include "CondFormats/Alignment/interface/Definitions.h"
0022
0023 class SurveyError {
0024 typedef align::ErrorMatrix ErrorMatrix;
0025 typedef ErrorMatrix::value_type Scalar;
0026
0027 public:
0028 inline SurveyError(uint8_t structureType = 0,
0029 align::ID rawId = 0,
0030 const ErrorMatrix& = ErrorMatrix()
0031 );
0032
0033 inline uint8_t structureType() const;
0034
0035 inline align::ID rawId() const;
0036
0037 inline ErrorMatrix matrix() const;
0038
0039 private:
0040 static const unsigned int nPar_ = ErrorMatrix::kRows;
0041 static const unsigned int size_ = nPar_ * (nPar_ + 1) / 2;
0042
0043 uint8_t m_structureType;
0044 align::ID m_rawId;
0045
0046 Scalar m_errors[size_];
0047
0048 COND_SERIALIZABLE;
0049 };
0050
0051 SurveyError::SurveyError(uint8_t structureType, align::ID rawId, const ErrorMatrix& cov)
0052 : m_structureType(structureType), m_rawId(rawId) {
0053 const Scalar* data = cov.Array();
0054
0055 for (unsigned int i = 0; i < size_; ++i)
0056 m_errors[i] = data[i];
0057 }
0058
0059 uint8_t SurveyError::structureType() const { return m_structureType; }
0060
0061 align::ID SurveyError::rawId() const { return m_rawId; }
0062
0063 SurveyError::ErrorMatrix SurveyError::matrix() const { return ErrorMatrix(m_errors, m_errors + size_); }
0064
0065 #endif