File indexing completed on 2025-08-06 08:17:53
0001 #ifndef MICROMEGAS_MICROMEGASCALIBRATIONDATA_H
0002 #define MICROMEGAS_MICROMEGASCALIBRATIONDATA_H
0003
0004
0005
0006
0007
0008
0009 #include <trackbase/TrkrDefs.h>
0010
0011 #include <array>
0012 #include <map>
0013 #include <string>
0014
0015
0016 class MicromegasCalibrationData
0017 {
0018 public:
0019
0020
0021 MicromegasCalibrationData() = default;
0022
0023
0024
0025
0026
0027 void read( const std::string& );
0028
0029
0030 void set_pedestal( int , int , double );
0031
0032
0033 void set_rms( int , int , double );
0034
0035
0036
0037
0038
0039
0040
0041 void write( const std::string& ) const;
0042
0043
0044 double get_pedestal( int , int ) const;
0045
0046
0047 double get_rms( int , int ) const;
0048
0049
0050 double get_pedestal_mapped( TrkrDefs::hitsetkey , int ) const;
0051
0052
0053 double get_rms_mapped( TrkrDefs::hitsetkey , int ) const;
0054
0055
0056
0057 private:
0058
0059
0060 class calibration_data_t
0061 {
0062 public:
0063
0064 calibration_data_t() = default;
0065
0066 calibration_data_t( double pedestal, double rms ):
0067 m_pedestal( pedestal ),
0068 m_rms( rms )
0069 {}
0070
0071 double m_pedestal = 0;
0072 double m_rms = 0;
0073 };
0074
0075 static constexpr int m_nchannels_fee = 256;
0076 using calibration_vector_t = std::array<calibration_data_t,m_nchannels_fee>;
0077
0078
0079 using raw_calibration_map_t = std::map<int, calibration_vector_t>;
0080 raw_calibration_map_t m_raw_calibration_map;
0081
0082
0083 using mapped_calibration_map_t = std::map<TrkrDefs::hitsetkey,calibration_vector_t>;
0084 mapped_calibration_map_t m_mapped_calibration_map;
0085
0086 friend std::ostream& operator << (std::ostream&, const MicromegasCalibrationData& );
0087
0088 };
0089
0090 #endif