CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripFEDBufferGenerator.cc
Go to the documentation of this file.
3 #include <cstring>
4 #include <stdexcept>
5 
6 namespace sistrip {
7 
8  //FEDStripData
9 
10  FEDStripData::FEDStripData(bool dataIsAlreadyConvertedTo8Bit, const size_t samplesPerChannel)
11  : data_(FEDCH_PER_FED,ChannelData(dataIsAlreadyConvertedTo8Bit,samplesPerChannel))
12  {
13  if (samplesPerChannel > SCOPE_MODE_MAX_SCOPE_LENGTH) {
14  std::ostringstream ss;
15  ss << "Scope length " << samplesPerChannel << " is too long. "
16  << "Max scope length is " << SCOPE_MODE_MAX_SCOPE_LENGTH << ".";
17  throw cms::Exception("FEDBufferGenerator") << ss.str();
18  }
19  }
20 
22  {
23  try {
24  return data_.at(internalFEDChannelNum);
25  } catch (const std::out_of_range&) {
26  std::ostringstream ss;
27  ss << "Channel index out of range. (" << uint16_t(internalFEDChannelNum) << ") "
28  << "Index should be in internal numbering scheme (0-95). ";
29  throw cms::Exception("FEDBufferGenerator") << ss.str();
30  }
31  }
32 
33  void FEDStripData::ChannelData::setSample(const uint16_t sampleNumber, const uint16_t value)
34  {
35  if (value > 0x3FF) {
36  std::ostringstream ss;
37  ss << "Sample value (" << value << ") is too large. Maximum allowed is 1023. ";
38  throw cms::Exception("FEDBufferGenerator") << ss.str();
39  }
40  try {
41  data_.at(sampleNumber) = value;
42  } catch (const std::out_of_range&) {
43  std::ostringstream ss;
44  ss << "Sample index out of range. "
45  << "Requesting sample " << sampleNumber
46  << " when channel has only " << data_.size() << " samples.";
47  throw cms::Exception("FEDBufferGenerator") << ss.str();
48  }
49  }
50 
51  //FEDBufferPayload
52 
53  FEDBufferPayload::FEDBufferPayload(const std::vector< std::vector<uint8_t> >& channelBuffers)
54  {
55  //calculate size of buffer and allocate enough memory
56  uint32_t totalSize = 0;
57  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
58  for (uint8_t iCh = 0; iCh < FEDCH_PER_FEUNIT; iCh++) {
59  totalSize += channelBuffers[iFE*FEDCH_PER_FEUNIT+iCh].size();
60  }
61  //if it does not finish on a 64Bit word boundary then take into account padding
62  if (totalSize%8) {
63  totalSize = ((totalSize/8) + 1)*8;
64  }
65  }
66  data_.resize(totalSize);
67  size_t indexInBuffer = 0;
68  feLengths_.reserve(FEUNITS_PER_FED);
69  //copy channel data into buffer with padding and update lengths
70  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
71  const size_t lengthAtStartOfFEUnit = indexInBuffer;
72  //insert data for FE unit
73  for (uint8_t iCh = 0; iCh < FEDCH_PER_FEUNIT; iCh++) {
74  appendToBuffer(&indexInBuffer,channelBuffers[iFE*FEDCH_PER_FEUNIT+iCh].begin(),channelBuffers[iFE*FEDCH_PER_FEUNIT+iCh].end());
75  }
76  //store length
77  feLengths_.push_back(indexInBuffer-lengthAtStartOfFEUnit);
78  //add padding
79  while (indexInBuffer % 8) appendToBuffer(&indexInBuffer,0);
80  }
81  }
82 
83  const uint8_t* FEDBufferPayload::data() const
84  {
85  //vectors are guarenteed to be contiguous
86  if (lengthInBytes()) return &data_[0];
87  //return NULL if there is no data yet
88  else return NULL;
89  }
90 
91  uint16_t FEDBufferPayload::getFELength(const uint8_t internalFEUnitNum) const
92  {
93  try{
94  return feLengths_.at(internalFEUnitNum);
95  } catch (const std::out_of_range&) {
96  std::ostringstream ss;
97  ss << "Invalid FE unit number " << internalFEUnitNum << ". "
98  << "Number should be in internal numbering scheme (0-7). ";
99  throw cms::Exception("FEDBufferGenerator") << ss.str();
100  }
101  }
102 
104  {
105  std::vector< std::vector<uint8_t> > channelBuffers(FEDCH_PER_FED,std::vector<uint8_t>());
106  for (size_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
107  if (!feUnitsEnabled_[iCh/FEDCH_PER_FEUNIT]) continue;
108  fillChannelBuffer(&channelBuffers[iCh],mode,data.channel(iCh),channelsEnabled_[iCh]);
109  }
110  return FEDBufferPayload(channelBuffers);
111  }
112 
113  void FEDBufferPayloadCreator::fillChannelBuffer(std::vector<uint8_t>* channelBuffer, const FEDReadoutMode mode,
114  const FEDStripData::ChannelData& data, const bool channelEnabled) const
115  {
116  switch (mode) {
117  case READOUT_MODE_SCOPE:
118  fillRawChannelBuffer(channelBuffer,PACKET_CODE_SCOPE,data,channelEnabled,false);
119  break;
121  fillRawChannelBuffer(channelBuffer,PACKET_CODE_VIRGIN_RAW,data,channelEnabled,true);
122  break;
124  fillRawChannelBuffer(channelBuffer,PACKET_CODE_PROC_RAW,data,channelEnabled,false);
125  break;
127  fillZeroSuppressedChannelBuffer(channelBuffer,data,channelEnabled);
128  break;
130  fillZeroSuppressedLiteChannelBuffer(channelBuffer,data,channelEnabled);
131  break;
133  fillPreMixRawChannelBuffer(channelBuffer,data,channelEnabled);
134  break;
135  default:
136  std::ostringstream ss;
137  ss << "Invalid readout mode " << mode;
138  throw cms::Exception("FEDBufferGenerator") << ss.str();
139  break;
140  }
141  }
142 
143  void FEDBufferPayloadCreator::fillRawChannelBuffer(std::vector<uint8_t>* channelBuffer,
144  const uint8_t packetCode,
146  const bool channelEnabled,
147  const bool reorderData) const
148  {
149  const uint16_t nSamples = data.size();
150  //2 bytes per sample + packet code + 2 bytes for length
151  const uint16_t channelLength = nSamples*2 + 3;
152  channelBuffer->reserve(channelLength);
153  //length (max length is 0xFFF)
154  channelBuffer->push_back( channelLength & 0xFF );
155  channelBuffer->push_back( (channelLength & 0xF00) >> 8 );
156  //packet code
157  channelBuffer->push_back(packetCode);
158  //channel samples
159  for (uint16_t sampleNumber = 0; sampleNumber < nSamples; sampleNumber++) {
160  const uint16_t sampleIndex = ( reorderData ? FEDStripOrdering::physicalOrderForStripInChannel(sampleNumber) : sampleNumber );
161  const uint16_t sampleValue = (channelEnabled ? data.getSample(sampleIndex) : 0);
162  channelBuffer->push_back(sampleValue & 0xFF);
163  channelBuffer->push_back((sampleValue & 0x300) >> 8);
164  }
165  }
166 
167  void FEDBufferPayloadCreator::fillZeroSuppressedChannelBuffer(std::vector<uint8_t>* channelBuffer,
169  const bool channelEnabled) const
170  {
171  channelBuffer->reserve(50);
172  //if channel is disabled then create empty channel header and return
173  if (!channelEnabled) {
174  //min length 7
175  channelBuffer->push_back(7);
176  channelBuffer->push_back(0);
177  //packet code
178  channelBuffer->push_back(PACKET_CODE_ZERO_SUPPRESSED);
179  //4 bytes of medians
180  channelBuffer->insert(channelBuffer->end(),4,0);
181  return;
182  }
183  //if channel is not empty
184  //add space for channel length
185  channelBuffer->push_back(0xFF); channelBuffer->push_back(0xFF);
186  //packet code
187  channelBuffer->push_back(PACKET_CODE_ZERO_SUPPRESSED);
188  //add medians
189  const std::pair<uint16_t,uint16_t> medians = data.getMedians();
190  channelBuffer->push_back(medians.first & 0xFF);
191  channelBuffer->push_back((medians.first & 0x300) >> 8);
192  channelBuffer->push_back(medians.second & 0xFF);
193  channelBuffer->push_back((medians.second & 0x300) >> 8);
194  //clusters
195  fillClusterData(channelBuffer,data);
196  //set length
197  const uint16_t length = channelBuffer->size();
198  (*channelBuffer)[0] = (length & 0xFF);
199  (*channelBuffer)[1] = ((length & 0x300) >> 8);
200  }
201 
202  void FEDBufferPayloadCreator::fillZeroSuppressedLiteChannelBuffer(std::vector<uint8_t>* channelBuffer,
204  const bool channelEnabled) const
205  {
206  channelBuffer->reserve(50);
207  //if channel is disabled then create empty channel header and return
208  if (!channelEnabled) {
209  //min length 2
210  channelBuffer->push_back(2);
211  channelBuffer->push_back(0);
212  return;
213  }
214  //if channel is not empty
215  //add space for channel length
216  channelBuffer->push_back(0xFF); channelBuffer->push_back(0xFF);
217  //clusters
218  fillClusterData(channelBuffer,data);
219  //set length
220  const uint16_t length = channelBuffer->size();
221  (*channelBuffer)[0] = (length & 0xFF);
222  (*channelBuffer)[1] = ((length & 0x300) >> 8);
223  }
224 
225  void FEDBufferPayloadCreator::fillPreMixRawChannelBuffer(std::vector<uint8_t>* channelBuffer,
227  const bool channelEnabled) const
228  {
229  channelBuffer->reserve(50);
230  //if channel is disabled then create empty channel header and return
231  if (!channelEnabled) {
232  //min length 7
233  channelBuffer->push_back(7);
234  channelBuffer->push_back(0);
235  //packet code
236  channelBuffer->push_back(PACKET_CODE_ZERO_SUPPRESSED);
237  //4 bytes of medians
238  channelBuffer->insert(channelBuffer->end(),4,0);
239  return;
240  }
241  //if channel is not empty
242  //add space for channel length
243  channelBuffer->push_back(0xFF); channelBuffer->push_back(0xFF);
244  //packet code
245  channelBuffer->push_back(PACKET_CODE_ZERO_SUPPRESSED);
246  //add medians
247  const std::pair<uint16_t,uint16_t> medians = data.getMedians();
248  channelBuffer->push_back(medians.first & 0xFF);
249  channelBuffer->push_back((medians.first & 0x300) >> 8);
250  channelBuffer->push_back(medians.second & 0xFF);
251  channelBuffer->push_back((medians.second & 0x300) >> 8);
252  //clusters
253  fillClusterDataPreMixMode(channelBuffer,data);
254  //set length
255  const uint16_t length = channelBuffer->size();
256  (*channelBuffer)[0] = (length & 0xFF);
257  (*channelBuffer)[1] = ((length & 0x300) >> 8);
258  }
259 
260  void FEDBufferPayloadCreator::fillClusterData(std::vector<uint8_t>* channelBuffer, const FEDStripData::ChannelData& data) const
261  {
262  uint16_t clusterSize = 0;
263  const uint16_t nSamples = data.size();
264  for( uint16_t strip = 0; strip < nSamples; ++strip) {
265  const uint8_t adc = data.get8BitSample(strip);
266 
267  if(adc) {
268  if( clusterSize==0 || strip == STRIPS_PER_APV ) {
269  if(clusterSize) {
270  *(channelBuffer->end() - clusterSize - 1) = clusterSize ;
271  clusterSize = 0;
272  }
273  channelBuffer->push_back(strip);
274  channelBuffer->push_back(0); //clustersize
275  }
276  channelBuffer->push_back(adc);
277  ++clusterSize;
278  }
279 
280  else if(clusterSize) {
281  *(channelBuffer->end() - clusterSize - 1) = clusterSize ;
282  clusterSize = 0;
283  }
284  }
285  if(clusterSize) *(channelBuffer->end() - clusterSize - 1) = clusterSize ;
286  }
287 
288  void FEDBufferPayloadCreator::fillClusterDataPreMixMode(std::vector<uint8_t>* channelBuffer, const FEDStripData::ChannelData& data) const
289  {
290  uint16_t clusterSize = 0;
291  const uint16_t nSamples = data.size();
292  for( uint16_t strip = 0; strip < nSamples; ++strip) {
293  const uint16_t adc = data.get10BitSample(strip);
294 
295  if(adc) {
296  if( clusterSize==0 || strip == STRIPS_PER_APV ) {
297  if(clusterSize) {
298  *(channelBuffer->end() - 2*clusterSize - 1) = clusterSize ;
299  clusterSize = 0;
300  }
301  channelBuffer->push_back(strip);
302  channelBuffer->push_back(0); //clustersize
303  }
304  channelBuffer->push_back(adc & 0xFF);
305  channelBuffer->push_back((adc & 0x0300) >> 8);
306 
307  ++clusterSize;
308  }
309 
310  else if(clusterSize) {
311  *(channelBuffer->end() - 2*clusterSize - 1) = clusterSize ;
312  clusterSize = 0;
313  }
314  }
315  if(clusterSize) {
316  *(channelBuffer->end() - 2*clusterSize - 1) = clusterSize ;
317  }
318  }
319 
320  //FEDBufferGenerator
321 
322  FEDBufferGenerator::FEDBufferGenerator(const uint32_t l1ID, const uint16_t bxID,
323  const std::vector<bool>& feUnitsEnabled, const std::vector<bool>& channelsEnabled,
324  const FEDReadoutMode readoutMode, const FEDHeaderType headerType, const FEDBufferFormat bufferFormat,
325  const FEDDAQEventType evtType, const FEDDataType dataType)
326  : defaultDAQHeader_(l1ID,bxID,0,evtType),
327  defaultDAQTrailer_(0,0),
328  defaultTrackerSpecialHeader_(bufferFormat,readoutMode,headerType,dataType),
329  defaultFEHeader_(FEDFEHeader::newFEHeader(headerType)),
330  feUnitsEnabled_(feUnitsEnabled),
331  channelsEnabled_(channelsEnabled)
332  {
333  if (!defaultFEHeader_.get()) {
334  std::ostringstream ss;
335  ss << "Bad header format: " << headerType;
336  throw cms::Exception("FEDBufferGenerator") << ss.str();
337  }
338  }
339 
340  bool FEDBufferGenerator::getFEUnitEnabled(const uint8_t internalFEUnitNumber) const
341  {
342  try {
343  return feUnitsEnabled_.at(internalFEUnitNumber);
344  } catch (const std::out_of_range&) {
345  std::ostringstream ss;
346  ss << "Invalid FE unit number " << internalFEUnitNumber << ". Should be in internal numbering scheme (0-7)";
347  throw cms::Exception("FEDBufferGenerator") << ss.str();
348  }
349  }
350 
351  bool FEDBufferGenerator::getChannelEnabled(const uint8_t internalFEDChannelNumber) const
352  {
353  try {
354  return channelsEnabled_.at(internalFEDChannelNumber);
355  } catch (const std::out_of_range&) {
356 
357  std::ostringstream ss;
358  ss << "Invalid channel number " << internalFEDChannelNumber << ". "
359  << "Should be in internal numbering scheme (0-95)";
360  throw cms::Exception("FEDBufferGenerator") << ss.str();
361  }
362  }
363 
364  FEDBufferGenerator& FEDBufferGenerator::setFEUnitEnable(const uint8_t internalFEUnitNumber, const bool enabled)
365  {
366  try {
367  feUnitsEnabled_.at(internalFEUnitNumber) = enabled;
368  } catch (const std::out_of_range&) {
369  std::ostringstream ss;
370  ss << "Invalid FE unit number " << internalFEUnitNumber << ". "
371  << "Should be in internal numbering scheme (0-7)";
372  throw cms::Exception("FEDBufferGenerator") << ss.str();
373  }
374  return *this;
375  }
376 
377  FEDBufferGenerator& FEDBufferGenerator::setChannelEnable(const uint8_t internalFEDChannelNumber, const bool enabled)
378  {
379  try {
380  channelsEnabled_.at(internalFEDChannelNumber) = enabled;
381  } catch (const std::out_of_range&) {
382  std::ostringstream ss;
383  ss << "Invalid channel number " << internalFEDChannelNumber << ". "
384  <<"Should be in internal numbering scheme (0-95)";
385  throw cms::Exception("FEDBufferGenerator") << ss.str();
386  }
387  return *this;
388  }
389 
390  FEDBufferGenerator& FEDBufferGenerator::setFEUnitEnables(const std::vector<bool>& feUnitEnables)
391  {
392  if (feUnitEnables.size() != FEUNITS_PER_FED) {
393  std::ostringstream ss;
394  ss << "Setting FE enable vector with vector which is the wrong size. Size is " << feUnitEnables.size()
395  << " it must be " << FEUNITS_PER_FED << "." << std::endl;
396  throw cms::Exception("FEDBufferGenerator") << ss.str();
397  }
398  feUnitsEnabled_ = feUnitEnables;
399  return *this;
400  }
401 
402  FEDBufferGenerator& FEDBufferGenerator::setChannelEnables(const std::vector<bool>& channelEnables)
403  {
404  if (channelEnables.size() != FEDCH_PER_FED) {
405  std::ostringstream ss;
406  ss << "Setting FED channel enable vector with vector which is the wrong size. Size is " << channelEnables.size()
407  << " it must be " << FEDCH_PER_FED << "." << std::endl;
408  throw cms::Exception("FEDBufferGenerator") << ss.str();
409  }
410  channelsEnabled_ = channelEnables;
411  return *this;
412  }
413 
414  void FEDBufferGenerator::generateBuffer(FEDRawData* rawDataObject, const FEDStripData& data, const uint16_t sourceID) const
415  {
416  //deal with disabled FE units and channels properly (FE enables, status bits)
418  std::auto_ptr<FEDFEHeader> fedFeHeader(defaultFEHeader_->clone());
419  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
420  const bool enabled = feUnitsEnabled_[iFE];
421  tkSpecialHeader.setFEEnableForFEUnit(iFE,enabled);
422  if (!enabled) {
423  for (uint8_t iFEUnitChannel = 0; iFEUnitChannel < FEDCH_PER_FEUNIT; iFEUnitChannel++) {
424  fedFeHeader->setChannelStatus(iFE,iFEUnitChannel,FEDChannelStatus(0));
425  }
426  }
427  }
428  for (uint8_t iCh = 0; iCh < FEDCH_PER_FED; iCh++) {
429  if (!channelsEnabled_[iCh]) {
430  fedFeHeader->setChannelStatus(iCh,FEDChannelStatus(0));
431  }
432  }
433  //set the source ID
435  daqHeader.setSourceID(sourceID);
436  //build payload
438  const FEDBufferPayload payload = payloadPacker(getReadoutMode(),data);
439  //fill FE lengths
440  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
441  fedFeHeader->setFEUnitLength(iFE,payload.getFELength(iFE));
442  }
443  //resize buffer
444  rawDataObject->resize(bufferSizeInBytes(*fedFeHeader,payload));
445  //fill buffer
446  fillBuffer(rawDataObject->data(),daqHeader,defaultDAQTrailer_,tkSpecialHeader,*fedFeHeader,payload);
447  }
448 
449  void FEDBufferGenerator::fillBuffer(uint8_t* pointerToStartOfBuffer,
450  const FEDDAQHeader& daqHeader,
451  const FEDDAQTrailer& daqTrailer,
452  const TrackerSpecialHeader& tkSpecialHeader,
453  const FEDFEHeader& feHeader,
454  const FEDBufferPayload& payload)
455  {
456  //set the length in the DAQ trailer
457  const size_t lengthInBytes = bufferSizeInBytes(feHeader,payload);
458  FEDDAQTrailer updatedDAQTrailer(daqTrailer);
459  updatedDAQTrailer.setEventLengthIn64BitWords(lengthInBytes/8);
460  //copy pieces into buffer in order
461  uint8_t* bufferPointer = pointerToStartOfBuffer;
462  memcpy(bufferPointer,daqHeader.data(),8);
463  bufferPointer += 8;
464  memcpy(bufferPointer,tkSpecialHeader.data(),8);
465  bufferPointer += 8;
466  memcpy(bufferPointer,feHeader.data(),feHeader.lengthInBytes());
467  bufferPointer += feHeader.lengthInBytes();
468  memcpy(bufferPointer,payload.data(),payload.lengthInBytes());
469  bufferPointer += payload.lengthInBytes();
470  memcpy(bufferPointer,updatedDAQTrailer.data(),8);
471  //update CRC
472  const uint16_t crc = calculateFEDBufferCRC(pointerToStartOfBuffer,lengthInBytes);
473  updatedDAQTrailer.setCRC(crc);
474  memcpy(bufferPointer,updatedDAQTrailer.data(),8);
475  //word swap if necessary
476  if (tkSpecialHeader.wasSwapped()) {
477  for (size_t i = 0; i < 8; i++) {
478  bufferPointer[i] = bufferPointer[i^4];
479  }
480  }
481  }
482 
483 }
int adc(sample_type sample)
get the ADC sample (12 bits)
static uint8_t physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel)
FEDBufferGenerator & setChannelEnables(const std::vector< bool > &channelsEnabled)
void fillClusterDataPreMixMode(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data) const
virtual size_t lengthInBytes() const =0
void fillZeroSuppressedChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const
void setSample(const uint16_t sampleNumber, const uint16_t adcValue)
int i
Definition: DBlmapReader.cc:9
void generateBuffer(FEDRawData *rawDataObject, const FEDStripData &data, const uint16_t sourceID) const
static const uint8_t PACKET_CODE_SCOPE
FEDBufferPayload(const std::vector< std::vector< uint8_t > > &channelBuffers)
static size_t bufferSizeInBytes(const FEDFEHeader &feHeader, const FEDBufferPayload &payload)
void fillClusterData(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data) const
FEDStripData(const std::vector< ChannelData > &data)
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
#define NULL
Definition: scimark2.h:8
uint16_t calculateFEDBufferCRC(const uint8_t *buffer, const size_t lengthInBytes)
FEDReadoutMode getReadoutMode() const
const uint8_t * data() const
uint16_t get10BitSample(const uint16_t sampleNumber) const
uint8_t get8BitSample(const uint16_t sampleNumber) const
const uint8_t * data() const
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
TrackerSpecialHeader & setFEEnableForFEUnit(const uint8_t internalFEUnitNum, const bool enabled)
FEDDAQTrailer & setEventLengthIn64BitWords(const uint32_t eventLengthIn64BitWords)
FEDBufferGenerator & setFEUnitEnables(const std::vector< bool > &feUnitsEnabled)
FEDDAQTrailer & setCRC(const uint16_t crc)
void resize(size_t newsize)
Definition: FEDRawData.cc:32
std::pair< uint16_t, uint16_t > getMedians() const
static const uint16_t FEUNITS_PER_FED
uint16_t getFELength(const uint8_t internalFEUnitNum) const
#define end
Definition: vmac.h:37
FEDBufferGenerator & setChannelEnable(const uint8_t internalFEDChannelNumber, const bool enabled)
void fillRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const uint8_t packetCode, const FEDStripData::ChannelData &data, const bool channelEnabled, const bool reorderData) const
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, const FEDDataType dataType=DATA_TYPE_FAKE)
FEDBufferPayload createPayload(const FEDReadoutMode mode, const FEDStripData &data) const
void fillZeroSuppressedLiteChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const
static const uint8_t PACKET_CODE_PROC_RAW
ChannelData & channel(const uint8_t internalFEDChannelNum)
static const uint16_t FEDCH_PER_FEUNIT
uint16_t getSample(const uint16_t sampleNumber) const
std::auto_ptr< FEDFEHeader > defaultFEHeader_
void fillPreMixRawChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDStripData::ChannelData &data, const bool channelEnabled) const
FEDDAQHeader & setSourceID(const uint16_t sourceID)
FEDBufferGenerator & setFEUnitEnable(const uint8_t internalFEUnitNumber, const bool enabled)
virtual const uint8_t * data() const =0
bool getFEUnitEnabled(const uint8_t internalFEUnitNumber) const
#define begin
Definition: vmac.h:30
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static const uint16_t FEDCH_PER_FED
static const uint16_t STRIPS_PER_APV
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
static void fillBuffer(uint8_t *pointerToStartOfBuffer, const FEDDAQHeader &daqHeader, const FEDDAQTrailer &daqTrailer, const TrackerSpecialHeader &tkSpecialHeader, const FEDFEHeader &feHeader, const FEDBufferPayload &payload)
std::vector< ChannelData > data_
void fillChannelBuffer(std::vector< uint8_t > *channelBuffer, const FEDReadoutMode mode, const FEDStripData::ChannelData &data, const bool channelEnabled) const
bool getChannelEnabled(const uint8_t internalFEDChannelNumber) const
static const uint16_t SCOPE_MODE_MAX_SCOPE_LENGTH
TrackerSpecialHeader defaultTrackerSpecialHeader_
static const uint8_t PACKET_CODE_VIRGIN_RAW