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_CTPPSReadoutObjects_PPSTimingCalibration_h
11 #define CondFormats_CTPPSReadoutObjects_PPSTimingCalibration_h
12 
14 
15 #include <map>
16 #include <vector>
17 
19 {
20  public:
22  struct Key
23  {
25 
27  bool operator<( const Key& rhs ) const;
28  friend std::ostream& operator<<( std::ostream& os, const Key& key );
29 
31  };
32  //--------------------------------------------------------------------------
33 
34  using ParametersMap = std::map<Key,std::vector<double> >;
35  using TimingMap = std::map<Key,std::pair<double,double> >;
36 
37  PPSTimingCalibration() = default;
38  PPSTimingCalibration( const std::string& formula, const ParametersMap& params, const TimingMap& timeinfo ) :
39  formula_( formula ), parameters_( params ), timeInfo_( timeinfo ) {}
40  ~PPSTimingCalibration() = default;
41 
42  std::vector<double> parameters( int key1, int key2, int key3, int key4 ) const;
43  inline const std::string& formula() const { return formula_; }
44  double timeOffset( int key1, int key2, int key3, int key4 = -1 ) const;
45  double timePrecision( int key1, int key2, int key3, int key4 = -1 ) const;
46 
47  friend std::ostream& operator<<( std::ostream& os, const PPSTimingCalibration& data );
48 
49  private:
53 
55 };
56 
57 #endif
58 
bool operator<(const Key &rhs) const
Comparison operator.
std::map< Key, std::pair< double, double > > TimingMap
const std::string & formula() const
friend std::ostream & operator<<(std::ostream &os, const Key &key)
double timeOffset(int key1, int key2, int key3, int key4=-1) const
std::vector< double > parameters(int key1, int key2, int key3, int key4) const
std::map< Key, std::vector< double > > ParametersMap
Helper structure for indexing calibration data.
#define COND_SERIALIZABLE
Definition: Serializable.h:38
~PPSTimingCalibration()=default
PPSTimingCalibration()=default
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
PPSTimingCalibration(const std::string &formula, const ParametersMap &params, const TimingMap &timeinfo)
double timePrecision(int key1, int key2, int key3, int key4=-1) const