Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:20

0001 #ifndef DataFormats_FEDRawData_FEDHeader_h
0002 #define DataFormats_FEDRawData_FEDHeader_h
0003 
0004 /** \class FEDHeader
0005  *  Helper class to interpret/create FED header words.
0006  *
0007  *  \author N. Amapane - CERN, R. Mommsen - FNAL
0008  */
0009 
0010 #include <cstdint>
0011 
0012 struct fedh_struct;
0013 
0014 class FEDHeader {
0015 public:
0016   /// Constructor
0017   FEDHeader(const unsigned char* header);
0018 
0019   /// Destructor
0020   ~FEDHeader();
0021 
0022   /// Event Trigger type identifier
0023   uint8_t triggerType() const;
0024 
0025   /// Level-1 event number generated by the TTC system
0026   uint32_t lvl1ID() const;
0027 
0028   /// The bunch crossing number
0029   uint16_t bxID() const;
0030 
0031   /// Identifier of the FED
0032   uint16_t sourceID() const;
0033 
0034   /// Version identifier of the FED data format
0035   uint8_t version() const;
0036 
0037   /// 0 -> the current header word is the last one.
0038   /// 1-> other header words can follow
0039   /// (always 1 for ECAL)
0040   bool moreHeaders() const;
0041 
0042   /// Check that the header is OK
0043   bool check() const;
0044 
0045   /// Set all fields in the header
0046   static void set(unsigned char* header,
0047                   uint8_t triggerType,
0048                   uint32_t lvl1ID,
0049                   uint16_t bxID,
0050                   uint16_t sourceID,
0051                   uint8_t version = 0,
0052                   bool moreHeaders = false);
0053 
0054   static const uint32_t length;
0055 
0056 private:
0057   const fedh_struct* theHeader;
0058 };
0059 #endif  // DataFormats_FEDRawData_FEDHeader_h