/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/PatCandidates/interface/LookupTableRecord.h
40 строк
1 KB
David
move away from boost::uint and boost::int
24 сен 2019, 12:09
24 сен 2019, 12:09
f67c449
Код
Авторство
О чём код?
#ifndef DataFormats_PatCandidates_interface_LookupTableRecord_h #define DataFormats_PatCandidates_interface_LookupTableRecord_h /** \class pat::LookupTableRecord LookupTableRecord.h "DataFormats/PatCandidates/interface/LookupTableRecord.h" * * \brief Class to store the result of a lookup table fetch, e.g. for efficiencies. * * Stores a value, an uncertainty and a bin index (needed to take into account correlations from multiple lookups) * * \author Giovanni Petrucciani * * */ #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1DFloat.h" #include <cstdint> namespace pat { class LookupTableRecord { public: LookupTableRecord() : value_(0), error_(0), bin_(0) {} LookupTableRecord(float value, float error, uint16_t bin = 0) : value_(value), error_(error), bin_(bin) {} LookupTableRecord(float value, uint16_t bin = 0) : value_(value), error_(0), bin_(bin) {} LookupTableRecord(const Measurement1DFloat &meas, uint16_t bin = 0) : value_(meas.value()), error_(meas.error()), bin_(bin) {} // Get the stored value float value() const { return value_; } // Get the uncertainty on the stored value (note: it CAN be ZERO) float error() const { return error_; } // Get the bin of the table used to compute this value (if available, otherwise 0) uint16_t bin() const { return bin_; } private: float value_, error_; uint16_t bin_; }; } // namespace pat #endif