File indexing completed on 2024-04-06 12:02:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef CondFormats_PPSObjects_PPSTimingCalibration_h
0011 #define CondFormats_PPSObjects_PPSTimingCalibration_h
0012
0013 #include "CondFormats/Serialization/interface/Serializable.h"
0014
0015 #include <map>
0016 #include <vector>
0017
0018 class PPSTimingCalibration {
0019 public:
0020
0021 struct Key {
0022 int db, sampic, channel, cell;
0023
0024
0025 bool operator<(const Key& rhs) const;
0026 friend std::ostream& operator<<(std::ostream& os, const Key& key);
0027
0028 COND_SERIALIZABLE;
0029 };
0030
0031
0032 using ParametersMap = std::map<Key, std::vector<double> >;
0033 using TimingMap = std::map<Key, std::pair<double, double> >;
0034
0035 PPSTimingCalibration() = default;
0036 PPSTimingCalibration(const std::string& formula, const ParametersMap& params, const TimingMap& timeinfo)
0037 : formula_(formula), parameters_(params), timeInfo_(timeinfo) {}
0038 ~PPSTimingCalibration() = default;
0039
0040 std::vector<double> parameters(int key1, int key2, int key3, int key4) const;
0041 inline const std::string& formula() const { return formula_; }
0042 double timeOffset(int key1, int key2, int key3, int key4 = -1) const;
0043 double timePrecision(int key1, int key2, int key3, int key4 = -1) const;
0044
0045 friend std::ostream& operator<<(std::ostream& os, const PPSTimingCalibration& data);
0046
0047 private:
0048 std::string formula_;
0049 ParametersMap parameters_;
0050 TimingMap timeInfo_;
0051
0052 COND_SERIALIZABLE;
0053 };
0054
0055 #endif