|
|
Go to the documentation of this file. 1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBufferGenerator_H
2 #define EventFilter_SiStripRawToDigi_SiStripFEDBufferGenerator_H
25 const std::pair<uint16_t, uint16_t> medians = std::make_pair<uint16_t>(0, 0));
29 std::pair<uint16_t, uint16_t>
getMedians()
const;
33 uint16_t
getSample(
const uint16_t sampleNumber)
const;
35 uint8_t
get8BitSample(
const uint16_t sampleNumber, uint16_t nBotBitsToDrop)
const;
37 void setSample(
const uint16_t sampleNumber,
const uint16_t adcValue);
39 uint16_t&
operator[](
const size_t sampleNumber);
40 const uint16_t&
operator[](
const size_t sampleNumber)
const;
68 const uint8_t*
data()
const;
70 uint16_t
getFELength(
const uint8_t internalFEUnitNum)
const;
75 std::vector<uint8_t>::const_iterator
start,
76 std::vector<uint8_t>::const_iterator finish);
97 const bool channelEnabled)
const;
100 const uint8_t packetCode,
102 const bool channelEnabled,
103 const bool reorderData)
const;
106 const uint8_t packetCode,
108 const bool channelEnabled)
const;
111 const bool channelEnabled,
115 const bool channelEnabled)
const;
130 const uint16_t bxID = 0,
131 const std::vector<bool>& feUnitsEnabled = std::vector<bool>(
FEUNITS_PER_FED,
true),
132 const std::vector<bool>& channelsEnabled = std::vector<bool>(
FEDCH_PER_FED,
true),
170 uint8_t packetCode)
const;
175 static void fillBuffer(uint8_t* pointerToStartOfBuffer,
215 const std::pair<uint16_t, uint16_t> medians)
216 : medians_(medians), data_(
numberOfSamples, 0), dataIs8Bit_(dataIsAlreadyConvertedTo8Bit) {}
221 return data_[sampleNumber];
226 return const_cast<uint16_t&>(std::as_const(*
this)[sampleNumber]);
239 return data_[sampleNumber];
243 uint16_t
sample = getSample(sampleNumber) >> nBotBitsToDrop;
258 return (0xFF & getSample(sampleNumber));
260 const uint16_t
sample = getSample(sampleNumber);
281 std::vector<uint8_t>::const_iterator
start,
282 std::vector<uint8_t>::const_iterator finish) {
283 for (std::vector<uint8_t>::const_iterator iVal =
start; iVal != finish; iVal++) {
284 appendToBuffer(pIndexInBuffer, *iVal);
291 const std::vector<bool>& channelsEnabled)
292 : feUnitsEnabled_(feUnitsEnabled), channelsEnabled_(channelsEnabled) {}
363 #endif //ndef EventFilter_SiStripRawToDigi_FEDBufferGenerator_H
uint8_t get8BitSample(const uint16_t sampleNumber, uint16_t nBotBitsToDrop) const
void fillRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled, const bool reorderData) const
FEDDAQHeader & daqHeader()
static void fillBuffer(uint8_t *pointerToStartOfBuffer, const FEDDAQHeader &daqHeader, const FEDDAQTrailer &daqTrailer, const TrackerSpecialHeader &tkSpecialHeader, const FEDFEHeader &feHeader, const FEDBufferPayload &payload)
void fillClusterDataPreMixMode(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data) const
FEDHeaderType getHeaderType() const
bool getChannelEnabled(const uint8_t internalFEDChannelNumber) const
std::vector< uint8_t > data_
std::pair< uint16_t, uint16_t > medians_
FEDDAQHeader defaultDAQHeader_
void appendToBuffer(size_t *pIndexInBuffer, const uint8_t value)
void setMedians(const std::pair< uint16_t, uint16_t > values)
std::vector< bool > channelsEnabled_
TrackerSpecialHeader & trackerSpecialHeader()
FEDBufferPayload createPayload(FEDReadoutMode mode, uint8_t packetCode, const FEDStripData &data) const
FEDBufferPayload operator()(FEDReadoutMode mode, uint8_t packetCode, const FEDStripData &data) const
std::vector< uint16_t > feLengths_
std::vector< uint16_t > data_
uint16_t get10BitSample(const uint16_t sampleNumber) const
FEDBufferGenerator & setReadoutMode(const FEDReadoutMode newReadoutMode)
static size_t bufferSizeInBytes(const FEDFEHeader &feHeader, const FEDBufferPayload &payload)
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
uint16_t getSample(const uint16_t sampleNumber) const
void fillClusterData(std::vector< uint8_t > *channelBuffer, uint8_t packetCode, const FEDStripData::ChannelData &data, const FEDReadoutMode mode) const
FEDDAQEventType getDAQEventType() const
FEDStripData(const std::vector< ChannelData > &data)
std::unique_ptr< FEDFEHeader > defaultFEHeader_
FEDDAQTrailer & daqTrailer()
void fillZeroSuppressedChannelBuffer(std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const
FEDBufferGenerator & setChannelEnable(const uint8_t internalFEDChannelNumber, const bool enabled)
FEDBufferGenerator & setBufferFormat(const FEDBufferFormat newBufferFormat)
FEDReadoutMode getReadoutMode() const
std::vector< bool > feUnitsEnabled_
std::vector< bool > channelsEnabled_
std::pair< uint16_t, uint16_t > getMedians() const
FEDBufferGenerator & setFEUnitEnables(const std::vector< bool > &feUnitsEnabled)
static const uint16_t FEUNITS_PER_FED
uint16_t & operator[](const size_t sampleNumber)
ChannelData(bool dataIsAlreadyConvertedTo8Bit, const size_t numberOfSamples, const std::pair< uint16_t, uint16_t > medians=std::make_pair< uint16_t >(0, 0))
FEDBufferGenerator & setDAQEventType(const FEDDAQEventType newDAQEventType)
FEDBufferPayloadCreator(const std::vector< bool > &enabledFEUnits, const std::vector< bool > &enabledChannels)
size_t lengthInBytes() const
static const uint16_t STRIPS_PER_FEDCH
const uint8_t * data() const
FEDDAQTrailer defaultDAQTrailer_
ChannelData & channel(const uint8_t internalFEDChannelNum)
FEDBufferGenerator & setHeaderType(const FEDHeaderType newHeaderType)
FEDBufferGenerator & setFEUnitEnable(const uint8_t internalFEUnitNumber, const bool enabled)
ChannelData & operator[](const uint8_t internalFEDChannelNum)
void fillZeroSuppressedLiteChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled, const FEDReadoutMode mode) const
TrackerSpecialHeader defaultTrackerSpecialHeader_
uint16_t getFELength(const uint8_t internalFEUnitNum) const
FEDBufferPayload(const std::vector< std::vector< uint8_t > > &channelBuffers)
FEDBufferGenerator & setL1ID(const uint32_t newL1ID)
void fillPreMixRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const
std::vector< bool > feUnitsEnabled_
FEDBufferGenerator(const uint32_t l1ID=0, const uint16_t bxID=0, const std::vector< bool > &feUnitsEnabled=std::vector< bool >(FEUNITS_PER_FED, true), const std::vector< bool > &channelsEnabled=std::vector< bool >(FEDCH_PER_FED, true), const FEDReadoutMode readoutMode=READOUT_MODE_ZERO_SUPPRESSED, const FEDHeaderType headerType=HEADER_TYPE_FULL_DEBUG, const FEDBufferFormat bufferFormat=BUFFER_FORMAT_OLD_SLINK, const FEDDAQEventType evtType=DAQ_EVENT_TYPE_PHYSICS)
void generateBuffer(FEDRawData *rawDataObject, const FEDStripData &data, uint16_t sourceID, uint8_t packetCode) const
FEDBufferGenerator & setBXID(const uint16_t newBXID)
FEDBufferFormat getBufferFormat() const
FEDBufferGenerator & setChannelEnables(const std::vector< bool > &channelsEnabled)
char data[epos_bytes_allocation]
static const uint16_t FEDCH_PER_FED
bool getFEUnitEnabled(const uint8_t internalFEUnitNumber) const
void fillChannelBuffer(std::vector< uint8_t > *channelBuffer, FEDReadoutMode mode, uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const
void setSample(const uint16_t sampleNumber, const uint16_t adcValue)
std::vector< ChannelData > data_