Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicromegasCalibrationData.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MicromegasCalibrationData.h
1 #ifndef MICROMEGAS_MICROMEGASCALIBRATIONDATA_H
2 #define MICROMEGAS_MICROMEGASCALIBRATIONDATA_H
3 
9 #include <trackbase/TrkrDefs.h>
10 
11 #include <array>
12 #include <map>
13 #include <string>
14 
17 {
18  public:
19 
21  MicromegasCalibrationData() = default;
22 
24 
25 
27  void read( const std::string& /*filename*/ );
28 
30  void set_pedestal( int /*fee*/, int /*channel*/, double /*value*/ );
31 
33  void set_rms( int /*fee*/, int /*channel*/, double /*value*/ );
34 
36 
38 
39 
41  void write( const std::string& /*filename*/ ) const;
42 
44  double get_pedestal( int /*fee*/, int /*channel*/ ) const;
45 
47  double get_rms( int /*fee*/, int /*channel*/ ) const;
48 
50  double get_pedestal_mapped( TrkrDefs::hitsetkey /*hitsetkey*/, int /*strip*/ ) const;
51 
53  double get_rms_mapped( TrkrDefs::hitsetkey /*hitsetkey*/, int /*strip*/ ) const;
54 
56 
57  private:
58 
61  {
62  public:
63 
64  calibration_data_t() = default;
65 
66  calibration_data_t( double pedestal, double rms ):
67  m_pedestal( pedestal ),
68  m_rms( rms )
69  {}
70 
71  double m_pedestal = 0;
72  double m_rms = 0;
73  };
74 
75  static constexpr int m_nchannels_fee = 256;
76  using calibration_vector_t = std::array<calibration_data_t,m_nchannels_fee>;
77 
79  using raw_calibration_map_t = std::map<int, calibration_vector_t>;
81 
83  using mapped_calibration_map_t = std::map<TrkrDefs::hitsetkey,calibration_vector_t>;
85 
86  friend std::ostream& operator << (std::ostream&, const MicromegasCalibrationData& );
87 
88 };
89 
90 #endif