1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
2 #define EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
4 #include "boost/cstdint.hpp"
24 FEDBuffer(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowBadBuffer =
false);
26 virtual void print(std::ostream& os)
const;
29 bool feGood(
const uint8_t internalFEUnitNum)
const;
34 bool fePresent(uint8_t internalFEUnitNum)
const;
36 virtual bool channelGood(
const uint8_t internalFEDannelNum,
const bool doAPVeCheck=
true)
const;
59 bool checkStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
94 FEDZSChannelUnpacker(
const uint8_t* payload,
const size_t channelPayloadOffset,
const int16_t channelPayloadLength);
98 static void throwUnorderedData(
const uint8_t currentStrip,
const uint8_t firstStripOfNewCluster);
116 uint16_t
adc()
const;
156 return feHeader_->checkChannelStatusBits(internalFEDChannelNum);
167 : data_(channel.
data()),
168 currentOffset_(channel.
offset()+3),
170 valuesLeft_((channel.length()-3)/2)
200 ++(*this);
return *
this;
207 valuesLeftInCluster_(0),
208 channelPayloadOffset_(0),
209 channelPayloadLength_(0)
214 currentOffset_(channelPayloadOffset),
216 valuesLeftInCluster_(0),
217 channelPayloadOffset_(channelPayloadOffset),
218 channelPayloadLength_(channelPayloadLength)
225 uint16_t length = channel.
length();
233 uint16_t length = channel.
length();
273 ++(*this);
return *
this;
284 #endif //ndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
static FEDRawChannelUnpacker procRawModeUnpacker(const FEDChannel &channel)
std::auto_ptr< FEDFEHeader > feHeader_
bool checkFEUnitLengths() const
static FEDZSChannelUnpacker zeroSuppressedModeUnpacker(const FEDChannel &channel)
bool checkStatusBits(const uint8_t internalFEDChannelNum) const
static void throwBadChannelLength(const uint16_t length)
FEDBuffer(const uint8_t *fedBuffer, const size_t fedBufferSize, const bool allowBadBuffer=false)
virtual bool doCorruptBufferChecks() const
virtual void print(std::ostream &os) const
bool checkFEPayloadsPresent() const
static FEDRawChannelUnpacker scopeModeUnpacker(const FEDChannel &channel)
void readNewClusterInfo()
static FEDRawChannelUnpacker virginRawModeUnpacker(const FEDChannel &channel)
FEDRawChannelUnpacker(const FEDChannel &channel)
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void throwBadClusterLength()
static void throwUnorderedData(const uint8_t currentStrip, const uint8_t firstStripOfNewCluster)
virtual bool doChecks() const
const FEDFEHeader * feHeader() const
virtual bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck=true) const
bool feGoodWithoutAPVEmulatorCheck(const uint8_t internalFEUnitNum) const
bool fePresent_[FEUNITS_PER_FED]
const uint8_t * payloadPointer_
bool fePresent(uint8_t internalFEUnitNum) const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED
uint8_t sampleNumber() const
uint16_t channelPayloadLength_
virtual std::string checkSummary() const
unsigned int offset(bool)
uint8_t valuesLeftInCluster_
uint16_t channelPayloadOffset_
FEDRawChannelUnpacker & operator++()
bool checkChannelPacketCodes() const
uint8_t sampleNumber() const
FEDZSChannelUnpacker & operator++()
static FEDZSChannelUnpacker zeroSuppressedLiteModeUnpacker(const FEDChannel &channel)
uint8_t nFEUnitsPresent() const
bool checkFEUnitAPVAddresses() const
const uint8_t * data() const
uint8_t getCorrectPacketCode() const
bool checkChannelLengthsMatchBufferLength() const
char data[epos_bytes_allocation]
bool checkAllChannelStatusBits() const
static void throwBadChannelLength(const uint16_t length)
uint16_t calculateFEUnitLength(const uint8_t internalFEUnitNumber) const
bool checkChannelLengths() const
bool feGood(const uint8_t internalFEUnitNum) const
bool feOverflow(const uint8_t internalFEUnitNum) const