|
| 1 | +/****************************************************************************** |
| 2 | + * Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH * |
| 3 | + * Copyright (C) 2022-2024 Members of R3B Collaboration * |
| 4 | + * * |
| 5 | + * This software is distributed under the terms of the * |
| 6 | + * GNU General Public Licence (GPL) version 3, * |
| 7 | + * copied verbatim in the file "LICENSE". * |
| 8 | + * * |
| 9 | + * In applying this license GSI does not waive the privileges and immunities * |
| 10 | + * granted to it by virtue of its status as an Intergovernmental Organization * |
| 11 | + * or submit itself to any jurisdiction. * |
| 12 | + ******************************************************************************/ |
| 13 | + |
| 14 | +// --------------------------------------------------------------- |
| 15 | +// ----- R3BHmpMappedData ----- |
| 16 | +// ----- Created 17/04/2025 by L. Rose ----- |
| 17 | +// --------------------------------------------------------------- |
| 18 | + |
| 19 | +#pragma once |
| 20 | + |
| 21 | +#include <TObject.h> |
| 22 | +#include <cstdint> |
| 23 | +#include <iostream> |
| 24 | +#include <string> |
| 25 | + |
| 26 | +class R3BHmpMappedData : public TObject |
| 27 | +{ |
| 28 | + public: |
| 29 | + // Default Constructor |
| 30 | + R3BHmpMappedData() = default; |
| 31 | + |
| 32 | + /** Standard Constructor |
| 33 | + HMP_TSYS_LO // Slow control computer time Low bits |
| 34 | + HMP_TSYS_HI // Slow control computer time High bits |
| 35 | + HMP_VOLT1 // Voltage channel 1 |
| 36 | + HMP_VOLT2 // Voltage channel 2 |
| 37 | + HMP_VOLT3 // Voltage channel 3 |
| 38 | + HMP_VOLT4 // Voltage channel 4 |
| 39 | + HMP_CURR1 // Current channel 1 |
| 40 | + HMP_CURR2 // Current channel 2 |
| 41 | + HMP_CURR3 // Current channel 3 |
| 42 | + HMP_CURR4 // Current channel 4 |
| 43 | + **/ |
| 44 | + |
| 45 | + explicit R3BHmpMappedData(uint32_t TSYS_LO, |
| 46 | + uint32_t TSYS_HI, |
| 47 | + uint32_t volt1, |
| 48 | + uint32_t curr1, |
| 49 | + uint32_t volt2, |
| 50 | + uint32_t curr2, |
| 51 | + uint32_t volt3, |
| 52 | + uint32_t curr3, |
| 53 | + uint32_t volt4, |
| 54 | + uint32_t curr4); |
| 55 | + |
| 56 | + // Destructor |
| 57 | + virtual ~R3BHmpMappedData() = default; |
| 58 | + |
| 59 | + // Accessors with [[nodiscard]] |
| 60 | + [[nodiscard]] inline const uint32_t GetTSLO() const { return fTSLO; } |
| 61 | + [[nodiscard]] inline const uint32_t GetTSHI() const { return fTSHI; } |
| 62 | + [[nodiscard]] inline const uint32_t GetVolt1() const { return fVolt1; } |
| 63 | + [[nodiscard]] inline const uint32_t GetCurr1() const { return fCurr1; } |
| 64 | + [[nodiscard]] inline const uint32_t GetVolt2() const { return fVolt2; } |
| 65 | + [[nodiscard]] inline const uint32_t GetCurr2() const { return fCurr2; } |
| 66 | + [[nodiscard]] inline const uint32_t GetVolt3() const { return fVolt3; } |
| 67 | + [[nodiscard]] inline const uint32_t GetCurr3() const { return fCurr3; } |
| 68 | + [[nodiscard]] inline const uint32_t GetVolt4() const { return fVolt4; } |
| 69 | + [[nodiscard]] inline const uint32_t GetCurr4() const { return fCurr4; } |
| 70 | + |
| 71 | + // Support for printing |
| 72 | + [[nodiscard]] std::string toString() const; |
| 73 | + void Print(const Option_t*) const override; |
| 74 | + |
| 75 | + protected: |
| 76 | + uint32_t fTSLO = 0; |
| 77 | + uint32_t fTSHI = 0; |
| 78 | + uint32_t fVolt1 = 0; |
| 79 | + uint32_t fCurr1 = 0; |
| 80 | + uint32_t fVolt2 = 0; |
| 81 | + uint32_t fCurr2 = 0; |
| 82 | + uint32_t fVolt3 = 0; |
| 83 | + uint32_t fCurr3 = 0; |
| 84 | + uint32_t fVolt4 = 0; |
| 85 | + uint32_t fCurr4 = 0; |
| 86 | + |
| 87 | + public: |
| 88 | + ClassDefOverride(R3BHmpMappedData, 1); // NOLINT |
| 89 | +}; |
| 90 | + |
| 91 | +// Operator overloading for printing R3BHmpMappedData |
| 92 | +std::ostream& operator<<(std::ostream& os, const R3BHmpMappedData& data); |
0 commit comments