Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:18

0001 #ifndef DATAFORMATS_HCALDIGI_HCALUMNIODIGI_H
0002 #define DATAFORMATS_HCALDIGI_HCALUMNIODIGI_H 1
0003 
0004 #include <vector>
0005 #include <cstdint>
0006 #include <ostream>
0007 
0008 /** \class HcalUMNioDigi
0009   *  
0010   * This class contains the readout data from the uMNio uTCA card as
0011   * when used for orbit gap operations.
0012   *
0013   * \author J. Mans - Minnesota
0014   */
0015 class HcalUMNioDigi {
0016 public:
0017   HcalUMNioDigi();
0018   HcalUMNioDigi(const uint16_t* ptr, int words);
0019   HcalUMNioDigi(const std::vector<uint16_t>& words);
0020 
0021   uint32_t runNumber() const;
0022   uint32_t orbitNumber() const;
0023   uint16_t bunchNumber() const;
0024   uint32_t eventNumber() const;
0025 
0026   uint8_t eventType() const;
0027   uint16_t spillCounter() const;
0028   bool isSpill() const;
0029 
0030   bool invalid() const { return (payload_.size() < 16) || (payload_[6] & 0xF000) != 0x2000; }
0031 
0032   int numberUserWords() const;
0033   uint16_t idUserWord(int iword) const;
0034   uint32_t valueUserWord(int iword) const;
0035   bool hasUserWord(int id) const;
0036   uint32_t getUserWord(int id) const;
0037   bool getUserWord(int id, uint32_t& value) const;
0038 
0039 private:
0040   std::vector<uint16_t> payload_;
0041 };
0042 
0043 std::ostream& operator<<(std::ostream&, const HcalUMNioDigi&);
0044 
0045 #endif