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