CMS 3D CMS Logo

Phase2TrackerFEDHeader.h
Go to the documentation of this file.
1 #ifndef EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDHeader_H // {
2 #define EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDHeader_H
3 
6 #include <cstdint>
7 #include <vector>
8 
9 namespace Phase2Tracker {
10 
11  // tracker headers for new CBC system
13  public:
15 
16  explicit Phase2TrackerFEDHeader(const uint8_t* headerPointer);
17 
18  // getters:
19  inline uint8_t getDataFormatVersion() const { return dataFormatVersion_; }
20  inline READ_MODE getDebugMode() const { return debugMode_; }
21 
22  inline uint8_t getEventType() const { return eventType_; }
23  inline FEDReadoutMode getReadoutMode() const { return readoutMode_; }
24  inline uint8_t getConditionData() const { return conditionData_; }
25  inline uint8_t getDataType() const { return dataType_; }
26 
27  inline uint64_t getGlibStatusCode() const { return glibStatusCode_; }
28  inline uint16_t getNumberOfCBC() const { return numberOfCBC_; }
29 
30  // get pointer to Payload data after tracker head
31  const uint8_t* getPointerToData() const { return pointerToData_; }
32  // get Front-End Status (16 bits) ==> 16 bool
33  std::vector<bool> frontendStatus() const;
34 
35  inline uint8_t getTrackerHeaderSize() const { return trackerHeaderSize_; }
36 
37  // CBC status bits, according to debug mode
38  // (empty, 1bit per CBC, 8bits per CBC)
39  std::vector<uint8_t> CBCStatus() const;
40 
41  private:
42  // readers: read info from Tracker Header and store in local variables
43 
44  // version number (4 bits)
45  uint8_t dataFormatVersion() const;
46  // debug level (2 bits) :
47  // 01 = full debug, 10 = CBC error mode, 00 = summary mode
48  READ_MODE debugMode() const;
49  // event type (4 bits):
50  // RAW/ZS, condition data, data type (real or simulated)
51  uint8_t eventType() const;
52  // get readout mode (first bit of the above)
54  uint8_t conditionData() const;
55  uint8_t dataType() const;
56  // glib status registers code (38 bits)
57  uint64_t glibStatusCode() const;
58  // number of CBC chips (8 bits)
59  uint16_t numberOfCBC() const;
60  // get tracker size (see function) and pointer to end of header. Also sets the TrackerHeaderSize.
61  const uint8_t* pointerToData();
62 
63  private:
64  void init();
65  const uint8_t* trackerHeader_; // pointer to the begining of Tracker Header
66  const uint8_t* pointerToData_; // pointer next to end of Tracker Header
67  uint8_t trackerHeaderSize_; // Tracker Header in bytes
70  uint8_t dataFormatVersion_; // shoud be 1
71  READ_MODE debugMode_; // debug, error, sumary ...
72  uint8_t eventType_; // contains readoutMode_, conditionData_ and dataType_
73  FEDReadoutMode readoutMode_; // proc raw or zero suppress
74  uint8_t conditionData_; // condition data present or not
75  uint8_t dataType_; // data fake or real
76  uint64_t glibStatusCode_; // glib status registers
77  uint16_t numberOfCBC_; // Total number of connected CBC
78 
79  }; // end of Phase2TrackerFEDHeader class
80 } // namespace Phase2Tracker
81 #endif // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDHeader_H
std::vector< uint8_t > CBCStatus() const
FEDReadoutMode
Definition: utils.h:95
unsigned long long uint64_t
Definition: Time.h:13