Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:40

0001 #ifndef GctBlockHeader_h_
0002 #define GctBlockHeader_h_
0003 
0004 /*!
0005 * \class GctBlockHeader
0006 * \brief Simple class for holding the basic attributes of an 32-bit block header.
0007 * * 
0008 * \author Robert Frazier
0009 */
0010 
0011 // C++ headers
0012 #include <ostream>
0013 #include <cstdint>
0014 
0015 class GctBlockHeader {
0016 public:
0017   /* PUBLIC METHODS */
0018 
0019   /// Constructor. Don't use directly - use the generateBlockHeader() method in GctFormatTranslateBase-derived classes.
0020   /*! \param valid Flag if this is a known and valid header .*/
0021   GctBlockHeader(uint32_t blockId, uint32_t blockLength, uint32_t nSamples, uint32_t bxId, uint32_t eventId, bool valid);
0022 
0023   /// Destructor.
0024   ~GctBlockHeader(){};
0025 
0026   /// Get the block ID
0027   uint32_t blockId() const { return m_blockId; }
0028 
0029   /// Get the fundamental block length (for 1 time sample)
0030   uint32_t blockLength() const { return m_blockLength; }
0031 
0032   /// Get the number of time samples
0033   uint32_t nSamples() const { return m_nSamples; }
0034 
0035   /// Get the bunch crossing ID
0036   uint32_t bxId() const { return m_bxId; }
0037 
0038   /// Get the event ID
0039   uint32_t eventId() const { return m_eventId; }
0040 
0041   /// Returns true if it's valid block header - i.e. if the header is known and can be unpacked.
0042   bool valid() const { return m_valid; }
0043 
0044 private:
0045   /* PRIVATE METHODS */
0046 
0047   /* PRIVATE MEMBER DATA */
0048 
0049   uint32_t m_blockId;  ///< The Block ID
0050 
0051   uint32_t m_blockLength;  ///< The fundamental block length (for 1 time sample)
0052 
0053   uint32_t m_nSamples;  ///< The number of time-samples
0054 
0055   uint32_t m_bxId;  ///< The bunch-crossing ID
0056 
0057   uint32_t m_eventId;  ///< The event ID
0058 
0059   bool m_valid;  ///< Is this a valid block header
0060 };
0061 
0062 #include <vector>
0063 typedef std::vector<GctBlockHeader> GctBlockHeaderCollection;
0064 
0065 std::ostream& operator<<(std::ostream& os, const GctBlockHeader& h);
0066 
0067 #endif /* GctBlockHeader_h_ */