218 FEDErrors lFedErrors;
231 bool lDataExist = lFedErrors.checkDataPresent(fedData);
236 std::unique_ptr<const sistrip::FEDBuffer>
buffer;
238 if (!lFedErrors.fillFatalFEDErrors(fedData,0)) {
244 bool channelLengthsOK = buffer->checkChannelLengthsMatchBufferLength();
245 bool channelPacketCodesOK = buffer->checkChannelPacketCodes();
246 bool feLengthsOK = buffer->checkFEUnitLengths();
247 if ( !channelLengthsOK ||
248 !channelPacketCodesOK ||
254 std::ostringstream infoStream;
258 infoStream <<
" --- Processing FED #" <<
fedId << std::endl;
262 std::vector<CMHistograms::CMvalues>
values;
264 for (
unsigned int iCh = 0;
277 uint32_t lDetId = lConnection.
detId();
278 unsigned short nChInModule = lConnection.
nApvPairs();
282 bool lFailUnpackerChannelCheck = !buffer->channelGood(iCh,
true) && connected;
284 if (lFailUnpackerChannelCheck) {
313 std::ostringstream lMode;
314 lMode << buffer->readoutMode();
316 std::cout <<
"Readout mode: " << lMode.str() << std::endl;
320 std::pair<uint16_t,uint16_t> medians = std::pair<uint16_t,uint16_t>(0,0);
322 if (lMode.str().find(
"Zero suppressed") != lMode.str().npos && lMode.str().find(
"lite") == lMode.str().npos) medians = std::pair<uint16_t,uint16_t>(lChannel.
cmMedian(0),lChannel.
cmMedian(1));
324 CMHistograms::CMvalues lVal;
325 lVal.ChannelID = iCh;
326 lVal.Medians = std::pair<uint16_t,uint16_t>(medians.first,medians.second);
337 if (lChannel.
length() > 7) {
338 infoStream <<
"Medians for channel #" << iCh <<
" (length " << lChannel.
length() <<
"): " << medians.first <<
", " << medians.second << std::endl;
342 values.push_back(lVal);
345 fillMaps(lDetId,nChInModule,medians);
347 prevMedians_[
fedId][iCh] = std::pair<uint16_t,uint16_t>(medians.first,medians.second);
355 lTime =
static_cast<float>(iEvent.
id().
event());
360 lTime =
static_cast<float>(
evt_);
EventNumber_t event() const
std::pair< uint16_t, uint16_t > prevMedians_[FEDNumbering::MAXSiStripFEDID+1][sistrip::FEDCH_PER_FED]
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const uint32_t invalid32_
void fillMaps(uint32_t aDetId, unsigned short aChInModule, std::pair< uint16_t, uint16_t > aMedians)
size_t size() const
Lenght of the data buffer in bytes.
uint16_t cmMedian(const uint8_t apvIndex) const
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void updateCabling(const edm::EventSetup &eventSetup)
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
edm::EDGetTokenT< FEDRawDataCollection > rawDataToken_
const uint16_t & nApvPairs() const
const SiStripFedCabling * cabling_
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
T const * product() const
bool fillWithLocalEvtNum_