MpdEmcCalibParams.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //--------------------------------------------------------------------
  2. //
  3. // Description:
  4. // MPD EMC calibration parameters
  5. //
  6. //
  7. // Author List:
  8. // D.Peresunko
  9. //
  10. //--------------------------------------------------------------------
  11. #ifndef MPDEMCCALIBPARAMS_H
  12. #define MPDEMCCALIBPARAMS_H
  13. #include <array>
  14. #include "TObject.h"
  15. class TH2;
  16. class MpdEmcCalibParams: public TObject
  17. {
  18. public:
  19. /// \brief Constructor
  20. MpdEmcCalibParams() = default;
  21. /// \brief Destructor
  22. ~MpdEmcCalibParams() = default;
  23. /// \brief Get energy calibration coefficients
  24. /// \param cellID Absolute ID of cell
  25. /// \return energy calibration coefficient of the cell
  26. float GetGain(unsigned int cellID) { return fGainCalib.at(cellID); }
  27. /// \brief Set High Gain energy calibration coefficient
  28. /// \param cellID Absolute ID of cell
  29. /// \param c is the calibration coefficient
  30. void SetGain(unsigned int cellID, float c) { fGainCalib[cellID] = c; }
  31. /// \brief Set energy calibration coefficients in the form of 2D histogram
  32. /// \param 2D(phi,-z...z) histogram with calibration coefficients
  33. /// \return Is successful
  34. bool SetGain(TH2* h);
  35. /// \brief Get High Gain time calibration coefficients
  36. /// \param cellID Absolute ID of cell
  37. /// \return high gain time calibration coefficient of the cell
  38. float GetTimeCalib(unsigned int cellID) { return fTimeCalib.at(cellID); }
  39. /// \brief Set High Gain time calibration coefficient
  40. /// \param cellID Absolute ID of cell
  41. /// \param t is the calibration coefficient
  42. void SetTimeCalib(unsigned int cellID, float t) { fTimeCalib[cellID] = t; }
  43. /// \brief Set time calibration coefficients in the form of 2D histogram
  44. /// \param 2D(phi,-z..z) histogram with calibration coefficients
  45. /// \return Is successful
  46. bool SetTimeCalib(TH2* h);
  47. private:
  48. static constexpr int NCHANNELS = 38400; ///< Number of channels
  49. std::array<float, NCHANNELS> fGainCalib; ///< Container for the gain calibration coefficients
  50. std::array<float, NCHANNELS> fTimeCalib; ///< Container for the High Gain time calibration coefficients
  51. ClassDefNV(MpdEmcCalibParams, 1);
  52. };
  53. #endif