CMS 3D CMS Logo

PPSTimingCalibration.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * This is a part of CTPPS offline software.
4  * Authors:
5  * Filip Dej
6  * Laurent Forthomme
7  *
8  ****************************************************************************/
9 
10 #ifndef CondFormats_PPSObjects_PPSTimingCalibration_h
11 #define CondFormats_PPSObjects_PPSTimingCalibration_h
12 
14 
15 #include <map>
16 #include <vector>
17 
19 public:
21  struct Key {
23 
25  bool operator<(const Key& rhs) const;
26  friend std::ostream& operator<<(std::ostream& os, const Key& key);
27 
29  };
30  //--------------------------------------------------------------------------
31 
32  using ParametersMap = std::map<Key, std::vector<double> >;
33  using TimingMap = std::map<Key, std::pair<double, double> >;
34 
35  PPSTimingCalibration() = default;
37  : formula_(formula), parameters_(params), timeInfo_(timeinfo) {}
38  ~PPSTimingCalibration() = default;
39 
40  std::vector<double> parameters(int key1, int key2, int key3, int key4) const;
41  inline const std::string& formula() const { return formula_; }
42  double timeOffset(int key1, int key2, int key3, int key4 = -1) const;
43  double timePrecision(int key1, int key2, int key3, int key4 = -1) const;
44 
45  friend std::ostream& operator<<(std::ostream& os, const PPSTimingCalibration& data);
46 
47 private:
51 
53 };
54 
55 #endif
std::map< Key, std::pair< double, double > > TimingMap
double timeOffset(int key1, int key2, int key3, int key4=-1) const
friend std::ostream & operator<<(std::ostream &os, const Key &key)
friend std::ostream & operator<<(std::ostream &os, const PPSTimingCalibration &data)
Helper structure for indexing calibration data.
bool operator<(const Key &rhs) const
Comparison operator.
double timePrecision(int key1, int key2, int key3, int key4=-1) const
std::vector< double > parameters(int key1, int key2, int key3, int key4) const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
~PPSTimingCalibration()=default
PPSTimingCalibration()=default
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::map< Key, std::vector< double > > ParametersMap
PPSTimingCalibration(const std::string &formula, const ParametersMap &params, const TimingMap &timeinfo)
const std::string & formula() const