|
|
#include <SiStripFEDBufferGenerator.h>
|
void | fillChannelBuffer (std::vector< uint8_t > *channelBuffer, FEDReadoutMode mode, uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const |
|
void | fillClusterData (std::vector< uint8_t > *channelBuffer, uint8_t packetCode, const FEDStripData::ChannelData &data, const FEDReadoutMode mode) const |
|
void | fillClusterDataPreMixMode (std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data) const |
|
void | fillPreMixRawChannelBuffer (std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const |
|
void | fillRawChannelBuffer (std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled, const bool reorderData) const |
|
void | fillZeroSuppressedChannelBuffer (std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const |
|
void | fillZeroSuppressedLiteChannelBuffer (std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled, const FEDReadoutMode mode) const |
|
Definition at line 81 of file SiStripFEDBufferGenerator.h.
◆ FEDBufferPayloadCreator()
sistrip::FEDBufferPayloadCreator::FEDBufferPayloadCreator |
( |
const std::vector< bool > & |
enabledFEUnits, |
|
|
const std::vector< bool > & |
enabledChannels |
|
) |
| |
|
inline |
◆ createPayload()
◆ fillChannelBuffer()
void sistrip::FEDBufferPayloadCreator::fillChannelBuffer |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
FEDReadoutMode |
mode, |
|
|
uint8_t |
packetCode, |
|
|
const FEDStripData::ChannelData & |
data, |
|
|
const bool |
channelEnabled |
|
) |
| const |
|
private |
Definition at line 114 of file SiStripFEDBufferGenerator.cc.
124 switch (packetCode) {
160 std::ostringstream
ss;
161 ss <<
"Invalid readout mode " <<
mode;
References data, Exception, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, sistrip::PACKET_CODE_PROC_RAW, sistrip::PACKET_CODE_SCOPE, sistrip::PACKET_CODE_VIRGIN_RAW, sistrip::PACKET_CODE_VIRGIN_RAW10, sistrip::PACKET_CODE_VIRGIN_RAW8_BOTBOT, sistrip::PACKET_CODE_VIRGIN_RAW8_TOPBOT, sistrip::READOUT_MODE_PREMIX_RAW, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE, and contentValuesCheck::ss.
◆ fillClusterData()
Definition at line 321 of file SiStripFEDBufferGenerator.cc.
349 uint16_t clusterSize = 0;
350 std::size_t size_pos = 0;
351 uint16_t adc_pre = 0;
358 if (is10Bit && (clusterSize % 4)) {
359 channelBuffer->push_back(adc_pre);
361 (*channelBuffer)[size_pos] = clusterSize;
365 channelBuffer->push_back(
strip);
366 size_pos = channelBuffer->size();
367 channelBuffer->push_back(0);
370 channelBuffer->push_back(
adc & 0xFF);
372 if (clusterSize % 4 == 0) {
373 channelBuffer->push_back((
adc & 0x3FC) >> 2);
374 adc_pre = ((
adc & 0x3) << 6);
375 }
else if (clusterSize % 4 == 1) {
376 channelBuffer->push_back(adc_pre | ((
adc & 0x3F0) >> 4));
377 adc_pre = ((
adc & 0xF) << 4);
378 }
else if (clusterSize % 4 == 2) {
379 channelBuffer->push_back(adc_pre | ((
adc & 0x3C0) >> 6));
380 adc_pre = ((
adc & 0x3F) << 2);
381 }
else if (clusterSize % 4 == 3) {
382 channelBuffer->push_back(adc_pre | ((
adc & 0x300) >> 8));
383 channelBuffer->push_back(
adc & 0xFF);
388 }
else if (clusterSize) {
389 if (is10Bit && (clusterSize % 4)) {
390 channelBuffer->push_back(adc_pre);
392 (*channelBuffer)[size_pos] = clusterSize;
397 (*channelBuffer)[size_pos] = clusterSize;
398 if (is10Bit && (clusterSize % 4)) {
399 channelBuffer->push_back(adc_pre);
References ecalMGPA::adc(), data, ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, PresampleTask_cfi::nSamples, sistrip::PACKET_CODE_ZERO_SUPPRESSED, sistrip::PACKET_CODE_ZERO_SUPPRESSED10, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE, digitizers_cfi::strip, and sistrip::STRIPS_PER_APV.
◆ fillClusterDataPreMixMode()
void sistrip::FEDBufferPayloadCreator::fillClusterDataPreMixMode |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
const FEDStripData::ChannelData & |
data |
|
) |
| const |
|
private |
◆ fillPreMixRawChannelBuffer()
void sistrip::FEDBufferPayloadCreator::fillPreMixRawChannelBuffer |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
const FEDStripData::ChannelData & |
data, |
|
|
const bool |
channelEnabled |
|
) |
| const |
|
private |
Definition at line 286 of file SiStripFEDBufferGenerator.cc.
289 channelBuffer->reserve(50);
291 if (!channelEnabled) {
293 channelBuffer->push_back(7);
294 channelBuffer->push_back(0);
298 channelBuffer->insert(channelBuffer->end(), 4, 0);
303 channelBuffer->push_back(0xFF);
304 channelBuffer->push_back(0xFF);
308 const std::pair<uint16_t, uint16_t> medians =
data.getMedians();
309 channelBuffer->push_back(medians.first & 0xFF);
310 channelBuffer->push_back((medians.first & 0x300) >> 8);
311 channelBuffer->push_back(medians.second & 0xFF);
312 channelBuffer->push_back((medians.second & 0x300) >> 8);
316 const uint16_t length = channelBuffer->size();
317 (*channelBuffer)[0] = (length & 0xFF);
318 (*channelBuffer)[1] = ((length & 0x300) >> 8);
References data, and sistrip::PACKET_CODE_ZERO_SUPPRESSED.
◆ fillRawChannelBuffer()
void sistrip::FEDBufferPayloadCreator::fillRawChannelBuffer |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
const uint8_t |
packetCode, |
|
|
const FEDStripData::ChannelData & |
data, |
|
|
const bool |
channelEnabled, |
|
|
const bool |
reorderData |
|
) |
| const |
|
private |
Definition at line 167 of file SiStripFEDBufferGenerator.cc.
173 uint16_t channelLength = 0;
174 switch (packetCode) {
186 channelBuffer->reserve(channelLength);
188 channelBuffer->push_back(channelLength & 0xFF);
189 channelBuffer->push_back((channelLength & 0xF00) >> 8);
191 channelBuffer->push_back(packetCode);
193 uint16_t sampleValue_pre = 0;
194 for (uint16_t sampleNumber = 0; sampleNumber <
nSamples; sampleNumber++) {
195 const uint16_t sampleIndex =
197 const uint16_t sampleValue = (channelEnabled ?
data.getSample(sampleIndex) : 0);
198 switch (packetCode) {
200 channelBuffer->push_back(sampleValue & 0xFF);
201 channelBuffer->push_back((sampleValue & 0x300) >> 8);
204 if (sampleNumber % 4 == 0) {
205 channelBuffer->push_back((sampleValue & 0x3FC) >> 2);
206 }
else if (sampleNumber % 4 == 1) {
207 channelBuffer->push_back(((sampleValue_pre & 0x3) << 6) | ((sampleValue & 0x3F0) >> 4));
208 }
else if (sampleNumber % 4 == 2) {
209 channelBuffer->push_back(((sampleValue_pre & 0xF) << 4) | ((sampleValue & 0x3C0) >> 6));
210 }
else if (sampleNumber % 4 == 3) {
211 channelBuffer->push_back(((sampleValue_pre & 0x3F) << 2) | ((sampleValue & 0x300) >> 8));
212 channelBuffer->push_back(sampleValue & 0xFF);
214 sampleValue_pre = sampleValue;
217 channelBuffer->push_back((sampleValue & 0x3FC) >> 2);
220 channelBuffer->push_back((sampleValue & 0x1FE) >> 1);
References reco::ceil(), data, PresampleTask_cfi::nSamples, sistrip::PACKET_CODE_VIRGIN_RAW, sistrip::PACKET_CODE_VIRGIN_RAW10, sistrip::PACKET_CODE_VIRGIN_RAW8_BOTBOT, sistrip::PACKET_CODE_VIRGIN_RAW8_TOPBOT, and sistrip::FEDStripOrdering::physicalOrderForStripInChannel().
◆ fillZeroSuppressedChannelBuffer()
void sistrip::FEDBufferPayloadCreator::fillZeroSuppressedChannelBuffer |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
const uint8_t |
packetCode, |
|
|
const FEDStripData::ChannelData & |
data, |
|
|
const bool |
channelEnabled |
|
) |
| const |
|
private |
Definition at line 226 of file SiStripFEDBufferGenerator.cc.
230 channelBuffer->reserve(50);
232 if (!channelEnabled) {
234 channelBuffer->push_back(7);
235 channelBuffer->push_back(0);
237 channelBuffer->push_back(packetCode);
239 channelBuffer->insert(channelBuffer->end(), 4, 0);
244 channelBuffer->push_back(0xFF);
245 channelBuffer->push_back(0xFF);
247 channelBuffer->push_back(packetCode);
249 const std::pair<uint16_t, uint16_t> medians =
data.getMedians();
250 channelBuffer->push_back(medians.first & 0xFF);
251 channelBuffer->push_back((medians.first & 0x300) >> 8);
252 channelBuffer->push_back(medians.second & 0xFF);
253 channelBuffer->push_back((medians.second & 0x300) >> 8);
257 const uint16_t length = channelBuffer->size();
258 (*channelBuffer)[0] = (length & 0xFF);
259 (*channelBuffer)[1] = ((length & 0x300) >> 8);
References data, and sistrip::READOUT_MODE_ZERO_SUPPRESSED.
◆ fillZeroSuppressedLiteChannelBuffer()
void sistrip::FEDBufferPayloadCreator::fillZeroSuppressedLiteChannelBuffer |
( |
std::vector< uint8_t > * |
channelBuffer, |
|
|
const FEDStripData::ChannelData & |
data, |
|
|
const bool |
channelEnabled, |
|
|
const FEDReadoutMode |
mode |
|
) |
| const |
|
private |
Definition at line 262 of file SiStripFEDBufferGenerator.cc.
266 channelBuffer->reserve(50);
268 if (!channelEnabled) {
270 channelBuffer->push_back(2);
271 channelBuffer->push_back(0);
276 channelBuffer->push_back(0xFF);
277 channelBuffer->push_back(0xFF);
281 const uint16_t length = channelBuffer->size();
282 (*channelBuffer)[0] = (length & 0xFF);
283 (*channelBuffer)[1] = ((length & 0x300) >> 8);
References data, and ALCARECOPromptCalibProdSiPixelAli0T_cff::mode.
◆ operator()()
◆ channelsEnabled_
std::vector<bool> sistrip::FEDBufferPayloadCreator::channelsEnabled_ |
|
private |
◆ feUnitsEnabled_
std::vector<bool> sistrip::FEDBufferPayloadCreator::feUnitsEnabled_ |
|
private |
void fillRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled, const bool reorderData) const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
void fillClusterDataPreMixMode(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data) const
static uint8_t physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel)
FEDBufferPayload createPayload(FEDReadoutMode mode, uint8_t packetCode, const FEDStripData &data) const
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
static const uint8_t PACKET_CODE_SCOPE
void fillClusterData(std::vector< uint8_t > *channelBuffer, uint8_t packetCode, const FEDStripData::ChannelData &data, const FEDReadoutMode mode) const
constexpr int32_t ceil(float num)
void fillZeroSuppressedChannelBuffer(std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const
static const uint8_t PACKET_CODE_VIRGIN_RAW10
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10
std::vector< bool > feUnitsEnabled_
std::vector< bool > channelsEnabled_
static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT
static const uint8_t PACKET_CODE_PROC_RAW
static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT
void fillZeroSuppressedLiteChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled, const FEDReadoutMode mode) const
void fillPreMixRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const
static const uint16_t STRIPS_PER_APV
char data[epos_bytes_allocation]
static const uint16_t FEDCH_PER_FED
static const uint16_t FEDCH_PER_FEUNIT
void fillChannelBuffer(std::vector< uint8_t > *channelBuffer, FEDReadoutMode mode, uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled) const
static const uint8_t PACKET_CODE_VIRGIN_RAW
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT