Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-22 01:53:17

0001 /****************************************************************************
0002  *
0003  * This is a part of CTPPS offline software.
0004  * Authors:
0005  *   Christopher Misan
0006  *   Filip Dej
0007  *   Laurent Forthomme
0008  *
0009  ****************************************************************************/
0010 
0011 #ifndef CondFormats_PPSObjects_PPSTimingCalibrationLUT_h
0012 #define CondFormats_PPSObjects_PPSTimingCalibrationLUT_h
0013 
0014 #include "CondFormats/Serialization/interface/Serializable.h"
0015 
0016 #include <map>
0017 #include <vector>
0018 
0019 class PPSTimingCalibrationLUT {
0020 public:
0021   /// Helper structure for indexing calibration data
0022   struct Key {
0023     int sector, station, plane, channel;
0024 
0025     /// Comparison operator
0026     bool operator<(const Key& rhs) const;
0027     friend std::ostream& operator<<(std::ostream& os, const Key& key);
0028 
0029     COND_SERIALIZABLE;
0030   };
0031   //--------------------------------------------------------------------------
0032 
0033   using BinMap = std::map<Key, std::vector<double> >;
0034 
0035   PPSTimingCalibrationLUT() = default;
0036   PPSTimingCalibrationLUT(const BinMap& binMap) : binMap_(binMap) {}
0037   ~PPSTimingCalibrationLUT() = default;
0038 
0039   std::vector<double> bins(int key1, int key2, int key3, int key4) const;
0040 
0041   friend std::ostream& operator<<(std::ostream& os, const PPSTimingCalibrationLUT& data);
0042 
0043 private:
0044   BinMap binMap_;
0045 
0046   COND_SERIALIZABLE;
0047 };
0048 
0049 #endif