CMS 3D CMS Logo

Phase2TrackerFEDBuffer.h
Go to the documentation of this file.
1 #ifndef EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDBuffer_H // {
2 #define EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDBuffer_H
3 
8 #include <cstdint>
9 #include <vector>
10 #include <map>
11 
12 namespace Phase2Tracker {
13 
15  public:
16  // gets data of one tracker FED to check, analyze and sort it
17  Phase2TrackerFEDBuffer(const uint8_t* fedBuffer, const size_t fedBufferSize);
19 
20  //dump buffer to stream
21  void dump(std::ostream& os) const { printHex(buffer_, bufferSize_, os); }
22 
23  //methods to get parts of the buffer
24  FEDDAQHeader daqHeader() const { return daqHeader_; }
25  FEDDAQTrailer daqTrailer() const { return daqTrailer_; }
26  size_t bufferSize() const { return bufferSize_; }
28  const Phase2TrackerFEDChannel& channel(const uint8_t internalPhase2TrackerFEDChannelNum) const {
29  return channels_[internalPhase2TrackerFEDChannelNum];
30  }
31  std::map<uint32_t, uint32_t> conditionData() const;
32 
33  //methods to get info from DAQ header from FEDDAQHeader class
35  uint32_t daqLvl1ID() const { return daqHeader_.l1ID(); }
36  uint16_t daqBXID() const { return daqHeader_.bxID(); }
37  uint16_t daqSourceID() const { return daqHeader_.sourceID(); }
38 
39  //methods to get info from DAQ trailer from FEDDAQTrailer class
41  uint32_t daqEventLengthInBytes() const { return daqTrailer_.eventLengthInBytes(); }
42  uint16_t daqCRC() const { return daqTrailer_.crc(); }
43  FEDTTSBits daqTTSState() const { return daqTrailer_.ttsBits(); }
44 
45  //methods to get info from the tracker header using Phase2TrackerFEDHeader class
47  inline const uint8_t* getPointerToPayload() const { return trackerHeader_.getPointerToData(); }
48  inline const uint8_t* getPointerToCondData() const { return condDataPointer_; }
49  inline const uint8_t* getPointerToTriggerData() const { return triggerPointer_; }
50 
51  private:
52  const uint8_t* buffer_;
53  const size_t bufferSize_;
54  std::vector<Phase2TrackerFEDChannel> channels_;
58  const uint8_t* payloadPointer_;
59  const uint8_t* condDataPointer_;
60  const uint8_t* triggerPointer_;
61  void findChannels();
62 
64  public:
65  // check methods
66  inline bool doChecks() const { return true; } // FEDBuffer
67  inline bool checkNoFEOverflows() const { return true; } // FEDBufferBase
68  inline bool doCorruptBufferChecks() const { return true; } // FEDBuffer
69 
70  }; // end of FEDBuffer class
71 
72 } // namespace Phase2Tracker
73 
74 #endif // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDBuffer_H
Phase2Tracker::Phase2TrackerFEDBuffer::getPointerToCondData
const uint8_t * getPointerToCondData() const
Definition: Phase2TrackerFEDBuffer.h:48
Phase2Tracker::Phase2TrackerFEDBuffer::doChecks
bool doChecks() const
Definition: Phase2TrackerFEDBuffer.h:66
Phase2Tracker::Phase2TrackerFEDChannel
Definition: Phase2TrackerFEDChannel.h:12
Phase2Tracker::FEDDAQTrailer::ttsBits
FEDTTSBits ttsBits() const
Definition: Phase2TrackerFEDDAQTrailer.cc:43
Phase2Tracker::Phase2TrackerFEDBuffer::daqTrailer_
FEDDAQTrailer daqTrailer_
Definition: Phase2TrackerFEDBuffer.h:56
Phase2Tracker::FEDDAQTrailer
Definition: Phase2TrackerFEDDAQTrailer.h:30
Phase2Tracker::FEDDAQHeader::eventType
FEDDAQEventType eventType() const
Definition: Phase2TrackerFEDDAQHeader.cc:43
Phase2Tracker::Phase2TrackerFEDBuffer::daqHeader
FEDDAQHeader daqHeader() const
Definition: Phase2TrackerFEDBuffer.h:24
Phase2Tracker::Phase2TrackerFEDBuffer::daqEventLengthIn64bitWords
uint32_t daqEventLengthIn64bitWords() const
Definition: Phase2TrackerFEDBuffer.h:40
Phase2Tracker::FEDDAQTrailer::eventLengthIn64BitWords
uint32_t eventLengthIn64BitWords() const
Definition: Phase2TrackerFEDDAQTrailer.h:90
Phase2Tracker::FEDDAQHeader
Definition: Phase2TrackerFEDDAQHeader.h:30
Phase2Tracker::Phase2TrackerFEDBuffer::daqSourceID
uint16_t daqSourceID() const
Definition: Phase2TrackerFEDBuffer.h:37
Phase2Tracker::Phase2TrackerFEDBuffer::condDataPointer_
const uint8_t * condDataPointer_
Definition: Phase2TrackerFEDBuffer.h:59
Phase2Tracker::Phase2TrackerFEDBuffer::doCorruptBufferChecks
bool doCorruptBufferChecks() const
Definition: Phase2TrackerFEDBuffer.h:68
Phase2Tracker::FEDDAQHeader::l1ID
uint32_t l1ID() const
Definition: Phase2TrackerFEDDAQHeader.h:74
Phase2Tracker::Phase2TrackerFEDHeader::getPointerToData
const uint8_t * getPointerToData() const
Definition: Phase2TrackerFEDHeader.h:31
Phase2Tracker::Phase2TrackerFEDBuffer::daqEventType
FEDDAQEventType daqEventType() const
Definition: Phase2TrackerFEDBuffer.h:34
Phase2Tracker::FEDDAQTrailer::crc
uint16_t crc() const
Definition: Phase2TrackerFEDDAQTrailer.h:96
Phase2Tracker::Phase2TrackerFEDBuffer::daqTTSState
FEDTTSBits daqTTSState() const
Definition: Phase2TrackerFEDBuffer.h:43
Phase2TrackerFEDChannel.h
Phase2Tracker::Phase2TrackerFEDBuffer::daqEventLengthInBytes
uint32_t daqEventLengthInBytes() const
Definition: Phase2TrackerFEDBuffer.h:41
Phase2Tracker::FEDReadoutMode
FEDReadoutMode
Definition: utils.h:95
Phase2Tracker::Phase2TrackerFEDBuffer::daqBXID
uint16_t daqBXID() const
Definition: Phase2TrackerFEDBuffer.h:36
Phase2Tracker::Phase2TrackerFEDBuffer::~Phase2TrackerFEDBuffer
~Phase2TrackerFEDBuffer()
Definition: Phase2TrackerFEDBuffer.cc:33
Phase2Tracker::Phase2TrackerFEDBuffer::triggerPointer_
const uint8_t * triggerPointer_
Definition: Phase2TrackerFEDBuffer.h:60
Phase2Tracker::Phase2TrackerFEDBuffer::payloadPointer_
const uint8_t * payloadPointer_
Definition: Phase2TrackerFEDBuffer.h:58
Phase2TrackerFEDDAQHeader.h
Phase2Tracker::Phase2TrackerFEDBuffer::dump
void dump(std::ostream &os) const
Definition: Phase2TrackerFEDBuffer.h:21
Phase2Tracker::Phase2TrackerFEDBuffer::getPointerToPayload
const uint8_t * getPointerToPayload() const
Definition: Phase2TrackerFEDBuffer.h:47
Phase2Tracker::FEDDAQEventType
FEDDAQEventType
Definition: Phase2TrackerFEDDAQHeader.h:15
Phase2Tracker::FEDDAQTrailer::eventLengthInBytes
uint32_t eventLengthInBytes() const
Definition: Phase2TrackerFEDDAQTrailer.h:94
Phase2Tracker::Phase2TrackerFEDBuffer::daqCRC
uint16_t daqCRC() const
Definition: Phase2TrackerFEDBuffer.h:42
Phase2TrackerFEDDAQTrailer.h
Phase2Tracker::Phase2TrackerFEDBuffer
Definition: Phase2TrackerFEDBuffer.h:14
Phase2Tracker::Phase2TrackerFEDBuffer::buffer_
const uint8_t * buffer_
Definition: Phase2TrackerFEDBuffer.h:52
Phase2Tracker::Phase2TrackerFEDBuffer::checkNoFEOverflows
bool checkNoFEOverflows() const
Definition: Phase2TrackerFEDBuffer.h:67
Phase2Tracker::Phase2TrackerFEDBuffer::findChannels
void findChannels()
Definition: Phase2TrackerFEDBuffer.cc:35
Phase2Tracker::Phase2TrackerFEDBuffer::Phase2TrackerFEDBuffer
Phase2TrackerFEDBuffer(const uint8_t *fedBuffer, const size_t fedBufferSize)
Definition: Phase2TrackerFEDBuffer.cc:9
Phase2Tracker::Phase2TrackerFEDBuffer::channels_
std::vector< Phase2TrackerFEDChannel > channels_
Definition: Phase2TrackerFEDBuffer.h:54
Phase2Tracker::Phase2TrackerFEDHeader
Definition: Phase2TrackerFEDHeader.h:12
Phase2Tracker::Phase2TrackerFEDBuffer::trackerHeader_
Phase2TrackerFEDHeader trackerHeader_
Definition: Phase2TrackerFEDBuffer.h:57
Phase2Tracker::Phase2TrackerFEDBuffer::bufferSize
size_t bufferSize() const
Definition: Phase2TrackerFEDBuffer.h:26
Phase2Tracker::FEDDAQHeader::sourceID
uint16_t sourceID() const
Definition: Phase2TrackerFEDDAQHeader.h:78
Phase2Tracker::Phase2TrackerFEDBuffer::conditionData
std::map< uint32_t, uint32_t > conditionData() const
Definition: Phase2TrackerFEDBuffer.cc:140
Phase2Tracker::Phase2TrackerFEDBuffer::readoutMode
FEDReadoutMode readoutMode() const
Definition: Phase2TrackerFEDBuffer.cc:194
Phase2Tracker::Phase2TrackerFEDBuffer::daqLvl1ID
uint32_t daqLvl1ID() const
Definition: Phase2TrackerFEDBuffer.h:35
Phase2Tracker::Phase2TrackerFEDBuffer::getPointerToTriggerData
const uint8_t * getPointerToTriggerData() const
Definition: Phase2TrackerFEDBuffer.h:49
Phase2Tracker::Phase2TrackerFEDBuffer::daqHeader_
FEDDAQHeader daqHeader_
Definition: Phase2TrackerFEDBuffer.h:55
Phase2Tracker::FEDTTSBits
FEDTTSBits
Definition: Phase2TrackerFEDDAQTrailer.h:15
Phase2Tracker::printHex
void printHex(const void *pointer, const size_t lengthInBytes, std::ostream &os)
Definition: utils.h:58
Phase2TrackerFEDHeader.h
Phase2Tracker::Phase2TrackerFEDBuffer::daqTrailer
FEDDAQTrailer daqTrailer() const
Definition: Phase2TrackerFEDBuffer.h:25
Phase2Tracker
Definition: Phase2TrackerFEDBuffer.h:12
Phase2Tracker::Phase2TrackerFEDBuffer::channel
const Phase2TrackerFEDChannel & channel(const uint8_t internalPhase2TrackerFEDChannelNum) const
Definition: Phase2TrackerFEDBuffer.h:28
Phase2Tracker::Phase2TrackerFEDBuffer::trackerHeader
Phase2TrackerFEDHeader trackerHeader() const
Definition: Phase2TrackerFEDBuffer.h:27
Phase2Tracker::Phase2TrackerFEDBuffer::bufferSize_
const size_t bufferSize_
Definition: Phase2TrackerFEDBuffer.h:53
Phase2Tracker::FEDDAQHeader::bxID
uint16_t bxID() const
Definition: Phase2TrackerFEDDAQHeader.h:76