Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDChannel_H  // {
0002 #define EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDChannel_H
0003 
0004 #include "EventFilter/Phase2TrackerRawToDigi/interface/Phase2TrackerFEDDAQHeader.h"
0005 #include "EventFilter/Phase2TrackerRawToDigi/interface/Phase2TrackerFEDDAQTrailer.h"
0006 #include <cstdint>
0007 
0008 namespace Phase2Tracker {
0009 
0010   // holds information about position of a channel in the buffer
0011   // for use by unpacker
0012   class Phase2TrackerFEDChannel {
0013     //forward declaration to avoid circular includes
0014     class Phase2TrackerFEDBuffer;
0015 
0016   public:
0017     Phase2TrackerFEDChannel(const uint8_t* const data, const size_t offset, const uint16_t length)
0018         : data_(data), offset_(offset), length_(length) {}
0019 
0020     //gets length from first 2 bytes (assuming normal FED channel)
0021     Phase2TrackerFEDChannel(const uint8_t* const data, const size_t offset);
0022     uint16_t length() const { return length_; }
0023     const uint8_t* data() const { return data_; }
0024     size_t offset() const { return offset_; }
0025     uint16_t cmMedian(const uint8_t apvIndex) const;
0026 
0027   private:
0028     friend class Phase2TrackerFEDBuffer;
0029     //third byte of channel data for normal FED channels
0030     uint8_t packetCode() const;
0031     const uint8_t* data_;
0032     size_t offset_;
0033     uint16_t length_;
0034   };  // end Phase2TrackerFEDChannel class
0035 
0036 }  // namespace Phase2Tracker
0037 
0038 #endif  // } end def EventFilter_Phase2TrackerRawToDigi_Phase2TrackerPhase2TrackerFEDChannel_H