HcalUMNioDigi

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#ifndef DATAFORMATS_HCALDIGI_HCALUMNIODIGI_H
#define DATAFORMATS_HCALDIGI_HCALUMNIODIGI_H 1

#include <vector>
#include <cstdint>
#include <ostream>

/** \class HcalUMNioDigi
  *  
  * This class contains the readout data from the uMNio uTCA card as
  * when used for orbit gap operations.
  *
  * \author J. Mans - Minnesota
  */
class HcalUMNioDigi {
public:
  HcalUMNioDigi();
  HcalUMNioDigi(const uint16_t* ptr, int words);
  HcalUMNioDigi(const std::vector<uint16_t>& words);

  uint32_t runNumber() const;
  uint32_t orbitNumber() const;
  uint16_t bunchNumber() const;
  uint32_t eventNumber() const;

  uint8_t eventType() const;
  uint16_t spillCounter() const;
  bool isSpill() const;

  bool invalid() const { return (payload_.size() < 16) || (payload_[6] & 0xF000) != 0x2000; }

  int numberUserWords() const;
  uint16_t idUserWord(int iword) const;
  uint32_t valueUserWord(int iword) const;
  bool hasUserWord(int id) const;
  uint32_t getUserWord(int id) const;
  bool getUserWord(int id, uint32_t& value) const;

private:
  std::vector<uint16_t> payload_;
};

std::ostream& operator<<(std::ostream&, const HcalUMNioDigi&);

#endif