1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
2 #define EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
4 #include "boost/cstdint.hpp"
26 FEDBuffer(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowBadBuffer =
false);
28 virtual void print(std::ostream& os)
const;
31 bool feGood(
const uint8_t internalFEUnitNum)
const;
36 bool fePresent(uint8_t internalFEUnitNum)
const;
38 virtual bool channelGood(
const uint8_t internalFEDannelNum,
const bool doAPVeCheck=
true)
const;
42 virtual bool doChecks(
bool doCRC=
true)
const;
61 bool checkStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
98 FEDZSChannelUnpacker(
const uint8_t* payload,
const size_t channelPayloadOffset,
const int16_t channelPayloadLength,
const size_t offsetIncrement=1);
102 static void throwUnorderedData(
const uint8_t currentStrip,
const uint8_t firstStripOfNewCluster);
121 uint16_t
adc()
const;
161 return feHeader_->checkChannelStatusBits(internalFEDChannelNum);
172 : data_(channel.
data()),
173 currentOffset_(channel.
offset()+3),
175 valuesLeft_((channel.length()-3)/2)
205 ++(*this);
return *
this;
213 valuesLeftInCluster_(0),
214 channelPayloadOffset_(0),
215 channelPayloadLength_(0)
220 currentOffset_(channelPayloadOffset),
221 offsetIncrement_(offsetIncrement),
223 valuesLeftInCluster_(0),
224 channelPayloadOffset_(channelPayloadOffset),
225 channelPayloadLength_(channelPayloadLength)
232 uint16_t length = channel.
length();
240 uint16_t length = channel.
length();
249 uint16_t length = channel.
length();
294 ++(*this);
return *
this;
305 #endif //ndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
static FEDRawChannelUnpacker procRawModeUnpacker(const FEDChannel &channel)
virtual bool doChecks() const
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 FEDZSChannelUnpacker preMixRawModeUnpacker(const FEDChannel &channel)
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)
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]
uint16_t adcPreMix() const
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
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
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