|
| 1 | +/** |
| 2 | + * \brief Data product to store a timestamp from the DAQ system |
| 3 | + * |
| 4 | + * \author Henry Lay (h.lay@lancaster.ac.uk) |
| 5 | + * \author Vu Chi Lan Nguyen (vclnguyen1@sheffield.ac.uk) |
| 6 | + */ |
| 7 | + |
| 8 | +#ifndef SBND_DAQTIMESTAMP_HH |
| 9 | +#define SBND_DAQTIMESTAMP_HH |
| 10 | + |
| 11 | +#include <stdint.h> |
| 12 | +#include <string> |
| 13 | +#include <array> |
| 14 | + |
| 15 | +namespace sbnd::timing { |
| 16 | + |
| 17 | + class DAQTimestamp { |
| 18 | + |
| 19 | + uint32_t fChannel; ///< Hardware channel |
| 20 | + uint64_t fTimestamp; ///< Timestamp of signal [ns] |
| 21 | + uint64_t fOffset; ///< Channel specific offset [ns] |
| 22 | + std::string fName; ///< Name of channel input |
| 23 | + |
| 24 | + public: |
| 25 | + |
| 26 | + /** |
| 27 | + * Default constructor. |
| 28 | + */ |
| 29 | + DAQTimestamp(); |
| 30 | + |
| 31 | + /** |
| 32 | + * Constructor to set all parameters |
| 33 | + * |
| 34 | + * @param channel Hardware channel |
| 35 | + * @param timestamp Timestamp of signal [ns] |
| 36 | + * @param offset Channel specific offset [ns] |
| 37 | + * @param name Name of channel input |
| 38 | + */ |
| 39 | + DAQTimestamp(uint32_t channel, uint64_t timestamp, uint64_t offset, std::string name); |
| 40 | + |
| 41 | + /** |
| 42 | + * Constructor to set all parameters, using array for name |
| 43 | + * |
| 44 | + * @param channel Hardware channel |
| 45 | + * @param timestamp Timestamp of signal [ns] |
| 46 | + * @param offset Channel specific offset [ns] |
| 47 | + * @param name Name of channel input |
| 48 | + */ |
| 49 | + DAQTimestamp(uint32_t channel, uint64_t timestamp, uint64_t offset, std::array<char, 8> name); |
| 50 | + |
| 51 | + /** |
| 52 | + * Destructor |
| 53 | + */ |
| 54 | + virtual ~DAQTimestamp(); |
| 55 | + |
| 56 | + /** |
| 57 | + * Getters |
| 58 | + */ |
| 59 | + uint32_t Channel() const; |
| 60 | + uint64_t Timestamp() const; |
| 61 | + uint64_t Offset() const; |
| 62 | + std::string Name() const; |
| 63 | + |
| 64 | + /** |
| 65 | + * Setters |
| 66 | + */ |
| 67 | + void SetChannel(uint32_t channel); |
| 68 | + void SetTimestamp(uint64_t timestamp); |
| 69 | + void SetOffset(uint64_t offset); |
| 70 | + void SetName(std::string name); |
| 71 | + }; |
| 72 | +} |
| 73 | + |
| 74 | +#endif |
0 commit comments