21 const IInterface* parent) :
22 base_class(
type, name, parent)
48 ATH_CHECK(detStore()->retrieve(sctDetManager,
"SCT"));
52 if (element->swapPhiReadoutDirection()) {
57 return StatusCode::SUCCESS;
137 ATH_MSG_INFO(
"SCT BytestreamCnv summary: unknown data-> "
142 ATH_MSG_INFO(
"SCT BytestreamCnv summary: ROD status word-> "
146 ATH_MSG_INFO(
"SCT BytestreamCnv summary: ROB status word-> "
150 ATH_MSG_INFO(
"SCT BytestreamCnv summary: ROB status word-> "
162 return StatusCode::SUCCESS;
171 const EventContext& ctx,
172 const std::vector<IdentifierHash>* vecHash)
const
176 const uint32_t robID{robFrag.rod_source_id()};
179 const uint32_t rodDataType{robFrag.rod_detev_type()};
180 const bool rodSimulatedData{
static_cast<bool>((rodDataType >> 20) & 0x1)};
181 if (rodSimulatedData)
ATH_CHECK(
addRODError(robID, SCT_ByteStreamErrors::RODSimulatedData, errs, ctx));
184 const bool superCondensedMode{
static_cast<bool>((rodDataType >> 21) & 0x1)};
186 StatusCode
sc{StatusCode::SUCCESS};
189 if (robFrag.nstatus()!=0) {
190 const uint32_t* robStatus;
191 robFrag.status(robStatus);
192 if ((*robStatus)!=0) {
193 ATH_MSG_DEBUG(
"ROB status word for robID " << std::hex << robID
194 <<
" is non-zero " << (*robStatus) << std::dec);
197 sc = StatusCode::RECOVERABLE;
199 if (((*robStatus) >> 27) & 0x1) {
200 ATH_MSG_DEBUG(
"ROB status word for robID " << std::hex << robID
201 << std::dec <<
" indicates data truncation.");
206 if ((((*robStatus) >> 29) & 0x1) or (((*robStatus) >> 31) & 0x1)) {
207 ATH_MSG_DEBUG(
"ROB status word for robID " << std::hex << robID
208 << std::dec <<
" indicates resource was masked off.");
218 const long unsigned int vecRODStatusSize{robFrag.rod_nstatus()};
220 robFrag.rod_status(vecRODStatus);
221 for (
long unsigned int i{0}; i<vecRODStatusSize; i++) {
222 const uint32_t statusWord{vecRODStatus[i]};
225 const int timClockError{
static_cast<int>((statusWord >> 16) & 0x1)};
226 const int bocClockError{
static_cast<int>((statusWord >> 17) & 0x1)};
227 if (timClockError or bocClockError) {
228 ATH_MSG_DEBUG(
" Clock error in ROD status word: " << timClockError <<
" " << bocClockError);
231 sc=StatusCode::RECOVERABLE;
243 cache.vecHash = vecHash;
246 const unsigned long int vecROBDataSize{robFrag.rod_ndata()};
247 if (vecROBDataSize > robFrag.payload_size_word()) {
248 ATH_MSG_WARNING(
"The ROB data does not seem to fit in the payload. Rejecting fragment (ndata size " << vecROBDataSize <<
" !< payload size " << robFrag.payload_size_word()
249 <<
" header size: " << robFrag.rod_header_size_word()
250 <<
" trailer size: " << robFrag.rod_trailer_size_word()
251 <<
" fragment size: " << robFrag.rod_fragment_size_word()
253 return StatusCode::RECOVERABLE;
255 robFrag.rod_data(vecROBData);
258 for (
unsigned long int i{0}; i<vecROBDataSize; i++) {
261 data16[0] = ((vecROBData[i] >> 16) & 0xFFFF);
262 data16[1] = ( vecROBData[i] & 0xFFFF);
264 for (
int n{0}; n<2; n++) {
265 bool hasError{
false};
266 if (((data16[n]>>13) & 0x7) == 0x1) {
267 bool breakNow{
false};
268 ATH_CHECK(
processHeader(data16[n], robID, data, rdoIDCont, dataItemsPool, cache, errs, hasError, breakNow, ctx));
269 if (hasError)
sc = StatusCode::RECOVERABLE;
273 else if (data16[n] & 0x8000) {
274 if (not data.foundHeader) {
275 ATH_MSG_INFO(
" Missing link header in ROD " << std::hex << robID << std::dec);
276 data.foundMissingLinkHeaderError =
true;
278 sc = StatusCode::RECOVERABLE;
282 if (superCondensedMode) {
284 if (hasError)
sc = StatusCode::RECOVERABLE;
287 else if (data.condensedMode) {
289 if (hasError)
sc = StatusCode::RECOVERABLE;
294 if (hasError)
sc = StatusCode::RECOVERABLE;
298 else if (((data16[n]>>13) & 0x7) == 0x0) {
300 if (hasError)
sc = StatusCode::RECOVERABLE;
303 else if (((data16[n]>>13) & 0x7) == 0x3) {
305 if (hasError)
sc = StatusCode::RECOVERABLE;
308 else if (((data16[n]>>13) & 0x7) == 0x2) {
310 if (hasError)
sc = StatusCode::RECOVERABLE;
317 sc = StatusCode::RECOVERABLE;
323 if (data.isStripValid()) {
324 if (not data.isSaved(
false) and data.isOldStripValid()) {
325 const int rdoMade{
makeRDO(
false, data, cache, dataItemsPool)};
327 sc = StatusCode::RECOVERABLE;
331 data.setSaved(
false, rdoMade);
338 if (data.foundMissingLinkHeaderError) {
339 ATH_CHECK(
addRODError(robID, SCT_ByteStreamErrors::MissingLinkHeaderError, errs, ctx, &(data.foundHashes)));
342 for (
auto& [hash, rdoColl] : data.rdoCollMap) {
343 if (rdoColl==
nullptr)
continue;
345 if (rdoColl->empty()) {
351 ATH_CHECK(data.writeHandleMap[hash].addOrDelete(std::move(rdoColl)));
354 if (
sc.isFailure())
ATH_MSG_DEBUG(
"One or more ByteStream errors found ");
367 if (rdoColl==
nullptr)
return 0;
369 int strip{isOld ? data.oldStrip : data.strip};
371 ATH_MSG_DEBUG(
"Cluster with " << data.groupSize <<
" strips, starting at strip " << (
strip & 0x7F) <<
" in Chip" << (
strip /
N_STRIPS_PER_SIDE) <<
" Side " << data.side <<
", (old side, old strip) = (" << data.oldSide <<
", " << data.oldStrip <<
")"
372 <<
" in collection " << data.linkIDHash <<
" (= " <<
m_cabling->getSerialNumberFromHash(data.linkIDHash) <<
") out of range. Will not make RDO");
378 if (data.linkIDHash == cache.skipHash) {
382 else if (data.linkIDHash != cache.lastHash) {
383 cache.lastHash = data.linkIDHash;
385 std::vector<IdentifierHash>::const_iterator hashIDIterator{
find(cache.vecHash->begin(),
386 cache.vecHash->end(),
388 if (hashIDIterator == cache.vecHash->end()) {
391 cache.skipHash = data.linkIDHash;
405 if (not
m_sctID->is_sct(digitID)) {
410 const unsigned int rawDataWord{
static_cast<unsigned int>(data.groupSize | (
strip << 11) | (data.timeBin <<22) | (data.errors << 25))};
412 ATH_MSG_DEBUG(
"Output Raw Data " << std::hex <<
" Coll " << data.collID.getString()
413 <<
":-> " <<
m_sctID->print_to_string(digitID) << std::dec);
420 (*sct_rdo) =
SCT3_RawData(digitID, rawDataWord, &(data.errorHit));
423 rdoColl->
push_back(std::make_unique<SCT3_RawData>(digitID, rawDataWord, &(data.errorHit)));
432 const EventContext& ctx,
433 const std::unordered_set<IdentifierHash>* foundHashes)
const
435 std::vector<IdentifierHash> hashIDs;
436 m_cabling->getHashesForRod(hashIDs, rodID);
440 if ((
error==SCT_ByteStreamErrors::MissingLinkHeaderError) and
441 foundHashes and foundHashes->count(hash)) {
451 const auto & [link0Good, link1Good] =
m_configTool->badLinks(hash, ctx);
453 const bool result{side==0 ? not link0Good : not link1Good};
454 if (result)
continue;
458 return StatusCode::SUCCESS;
466 const EventContext& ctx)
const
469 ATH_MSG_INFO(
"addSingleError hashID " << hashID <<
" is invalid.");
470 return StatusCode::SUCCESS;
477 std::pair<bool, bool> badLinks{
m_configTool->badLinks(hashID, ctx)};
479 bool result{(side==0 ? badLinks.first : badLinks.second) and (badLinks.first xor badLinks.second)};
484 m_sctID->get_other_side(hashID, otherSide);
486 ATH_MSG_DEBUG(
"Adding error to side " << 1-side <<
" for module with RX redundancy " << otherSide);
490 return StatusCode::SUCCESS;
496 unsigned int firstTempMaskedChip,
498 const EventContext& ctx)
const
501 ATH_MSG_INFO(
"setFirstTempMaskedChip hashID " << hashID <<
" is invalid.");
502 return StatusCode::RECOVERABLE;
504 if (firstTempMaskedChip==0) {
505 ATH_MSG_WARNING(
"setFirstTempMaskedChip: firstTempMaskedChip should be greater than 0. firstTempMaskedChip is "
506 << firstTempMaskedChip);
507 return StatusCode::RECOVERABLE;
517 unsigned int firstTempMaskedChipSide0{0};
518 if (hashID==hashSide0) firstTempMaskedChipSide0 = firstTempMaskedChip;
522 m_sctID->get_other_side(hashSide0, hashSide1);
523 unsigned int firstTempMaskedChipSide1{0};
524 if (hashID==hashSide1) firstTempMaskedChipSide1 = firstTempMaskedChip;
528 const std::pair<bool, bool> badLinks{
m_configTool->badLinks(hashID, ctx)};
529 if (badLinks.first xor badLinks.second) {
531 if (badLinks.first and not badLinks.second) {
535 else if (badLinks.second and not badLinks.first) {
539 else if (badLinks.first and badLinks.second) {
541 ATH_MSG_WARNING(
"setFirstTempMaskedChip: Both link-0 and link-1 are working. But Rx redundancy is used... Why?");
542 return StatusCode::RECOVERABLE;
546 ATH_MSG_WARNING(
"setFirstTempMaskedChip: Both link-0 and link-1 are broken. But data are coming... Why?");
547 return StatusCode::RECOVERABLE;
556 const unsigned long long fullSerialNumber{
m_cabling->getSerialNumberFromHash(hashID).to_ulonglong()};
558 fullSerialNumber==20220170200183 or
559 fullSerialNumber==20220330200606 or
560 fullSerialNumber==20220330200693
562 if (
type!=1)
ATH_MSG_WARNING(
"Link-0 is broken but modified module readingout link-0, inconsistent");
571 fullSerialNumber==20220170200653 or
572 fullSerialNumber==20220330200117 or
573 fullSerialNumber==20220330200209 or
574 fullSerialNumber==20220330200505 or
575 fullSerialNumber==20220330200637 or
576 fullSerialNumber==20220330200701
578 if (
type!=2)
ATH_MSG_WARNING(
"Link-1 is broken but modified module readingout link-1, inconsistent");
591 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
593 {6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5},
595 {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 6},
597 {6, 7, 8, 9, 10, 11, 1, 2, 3, 4, 5, 0}
614 ( 0<firstTempMaskedChipSide1 and firstTempMaskedChipSide1<=
N_CHIPS_PER_SIDE)) {
615 const unsigned int swapFirstTempMaskedChipSide0{firstTempMaskedChipSide0};
616 firstTempMaskedChipSide0 = firstTempMaskedChipSide1;
617 firstTempMaskedChipSide1 = swapFirstTempMaskedChipSide0;
620 if (firstTempMaskedChipSide0>0) {
621 for (
unsigned int iChip{firstTempMaskedChipSide0-1}; iChip<
N_CHIPS_PER_SIDE; iChip++) {
633 bool toBeMasked{
false};
635 int jChip{chipOrder[
type][iChip]};
636 if (jChip==
static_cast<int>(firstTempMaskedChip-1)) toBeMasked =
true;
649 <<
" SerialNumber " <<
m_cabling->getSerialNumberFromHash(hashID).str()
650 <<
" moduleID " << moduleID
651 <<
" barrel_ec " <<
m_sctID->barrel_ec(waferID)
652 <<
" layer_disk " <<
m_sctID->layer_disk(waferID)
653 <<
" eta_module " <<
m_sctID->eta_module(waferID)
654 <<
" phi_module " <<
m_sctID->phi_module(waferID)
655 <<
" side " <<
m_sctID->side(waferID)
656 <<
" firstTempMaskedChip " << firstTempMaskedChip);
657 return StatusCode::SUCCESS;
661 const uint32_t robID,
669 const EventContext& ctx)
const
671 StatusCode
sc{StatusCode::SUCCESS};
673 data.foundHeader =
true;
677 if (data.isStripValid()) {
678 if (not data.isSaved(
false) and data.isOldStripValid()) {
680 const int rdoMade{
makeRDO(
false, data, cache, dataItemsPool)};
686 data.setSaved(
false, rdoMade);
695 const int rodlinkNumber{
static_cast<int>(inData & 0x7F)};
698 data.linkNumber = (((rodlinkNumber >>4)&0x7)*12+(rodlinkNumber &0xF));
699 const uint32_t onlineID{(robID & 0xFFFFFF) | (data.linkNumber << 24)};
701 if ((onlineID ==0) or (data.linkNumber > 95)) {
704 ATH_MSG_DEBUG(
"Header: xxx Link number out of range (skipping following data)"
705 << std::dec << data.linkNumber);
710 hash =
m_cabling->getHashFromOnlineId(onlineID, ctx);
711 if (hash.is_valid()) {
712 data.setCollection(
m_sctID, hash, rdoIDCont, dataItemsPool, errs);
715 std::stringstream
msg;
716 msg <<std::hex << onlineID;
717 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " << hash <<
".");
721 if ((inData >> 7) & 0x1) {
722 ATH_MSG_DEBUG(
"Masked link " << onlineID <<
" " << data.linkIDHash);
726 if (inData & 0x800) {
727 ATH_MSG_DEBUG(
" Header: xxx TimeOut Error " << data.linkIDHash);
733 if (inData & 0x1000) {
734 ATH_MSG_DEBUG(
" Header: xxx Preamble Error " << data.linkIDHash);
740 if (inData & 0x400) {
741 ATH_MSG_DEBUG(
" Header: xxx LVL1 ID Error " << data.linkIDHash);
747 if (inData & 0x200) {
748 ATH_MSG_DEBUG(
" Header: xxx BCID Error " << data.linkIDHash);
754 if ((inData & 0xF) > 11) {
755 ATH_MSG_DEBUG(
" Header: xxx Error in formatter " << data.linkIDHash);
760 if (!hasError and not hash.is_valid()) {
761 std::stringstream
msg;
762 msg <<std::hex << onlineID;
763 ATH_MSG_WARNING(
"Rob fragment (rob=" << robID <<
") with invalid onlineID " <<
msg.str() <<
" -> " << hash <<
".");
767 data.condensedMode =
static_cast<bool>(inData & 0x100);
773 const uint32_t robID,
780 const EventContext& ctx)
const
782 StatusCode
sc{StatusCode::SUCCESS};
789 const int chip{(inData>>11) & 0x7};
790 data.side = ((inData>>14) & 0x1);
793 const int nStripsInWord{(inData & 0xF)+1};
796 << std::hex << inData);
804 bool secondSide{
false};
805 if ((data.side==1) and ((data.linkNumber%2)==0)) {
806 if (((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) and (data.groupSize>0)) {
808 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
814 data.setSaved(
true, rdoMade);
821 else if ((data.side==0) and ((data.linkNumber%2)!=0)) {
822 if (((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) and (data.groupSize>0)) {
824 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
830 data.setSaved(
true, rdoMade);
838 const uint32_t onlineID{(robID & 0xFFFFFF) | (data.linkNumber << 24)};
844 data.setCollection(
m_sctID, id_hash, rdoIDCont, dataItemsPool, errs);
847 if (data.groupSize == 0) {
851 if ((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) {
853 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
859 data.setSaved(
true, rdoMade);
863 data.groupSize += nStripsInWord;
869 const uint32_t robID,
876 const EventContext& ctx)
const
878 StatusCode
sc{StatusCode::SUCCESS};
880 const int chip{(inData>>11) & 0x7};
881 data.side = ((inData>>14) & 0x1);
886 << std::hex << inData);
894 bool secondSide{
false};
895 if ((data.side==1) and ((data.linkNumber%2)==0)) {
896 if (((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) and (data.groupSize>0)) {
898 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
904 data.setSaved(
true, rdoMade);
911 else if ((data.side==0) and ((data.linkNumber%2)!=0)) {
912 if (((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) and (data.groupSize>0)) {
914 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
920 data.setSaved(
true, rdoMade);
928 const uint32_t onlineID{(robID & 0xFFFFFF) | (data.linkNumber << 24)};
929 data.setCollection(
m_sctID,
m_cabling->getHashFromOnlineId(onlineID, ctx), rdoIDCont, dataItemsPool, errs);
932 if (data.groupSize == 0) {
936 if (not (inData & 0x1)) {
938 if ((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) {
940 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
946 data.setSaved(
true, rdoMade);
952 ATH_MSG_DEBUG(
" Hit condensed : xxx ERROR in 1-hit " << std::hex << inData);
953 data.errorHit.push_back(data.groupSize);
954 data.errors = (data.errors | 0x10);
958 data.groupSize = (data.groupSize>=2 ? data.groupSize : 1);
970 if ((data.strip!=data.oldStrip) or (data.side!=data.oldSide)) {
972 const int rdoMade{
makeRDO(
true, data, cache, dataItemsPool)};
978 data.setSaved(
true, rdoMade);
983 ATH_MSG_DEBUG(
" Hit condensed : xxx ERROR in 1st hit" << std::hex << inData);
984 data.errorHit.push_back(data.groupSize);
986 data.errors = (data.errors | 0x10);
990 ATH_MSG_DEBUG(
" Hit condensed : xxx ERROR in 2nd hit" << std::hex << inData);
991 data.errorHit.push_back(data.groupSize);
993 data.errors = (data.errors | 0x20);
1003 const uint32_t robID,
1010 const EventContext& ctx)
const
1012 StatusCode
sc{StatusCode::SUCCESS};
1015 if (not (inData & 0x8)) {
1017 chip = ((inData>>11) & 0x7);
1018 data.side = ((inData>>14) & 0x1);
1020 data.timeBin = (inData & 0x7);
1030 bool secondSide{
false};
1031 if ((data.side==1) and ((data.linkNumber%2)==0)) {
1035 else if ((data.side==0) and ((data.linkNumber%2)!=0)) {
1040 const uint32_t onlineID{(robID & 0xFFFFFF) | (data.linkNumber << 24)};
1041 data.setCollection(
m_sctID,
m_cabling->getHashFromOnlineId(onlineID, ctx), rdoIDCont, dataItemsPool, errs);
1044 const int rdoMade{
makeRDO(
false, data, cache, dataItemsPool)};
1045 if (rdoMade == -1) {
1050 data.setSaved(
false, rdoMade);
1055 if (inData & 0x80) {
1065 data.timeBin = (inData & 0x7);
1067 const int rdoMade1{
makeRDO(
false, data, cache, dataItemsPool)};
1068 if (rdoMade1 == -1) {
1073 data.setSaved(
false, rdoMade1);
1077 data.timeBin = ((inData >> 4) & 0x7);
1078 const int rdoMade2{
makeRDO(
false, data, cache, dataItemsPool)};
1079 if (rdoMade2 == -1) {
1084 data.setSaved(
false, rdoMade2);
1097 data.timeBin = (inData & 0x7);
1099 const int rdoMade{
makeRDO(
false, data, cache, dataItemsPool)};
1100 if (rdoMade == -1) {
1105 data.setSaved(
false, rdoMade);
1115 const uint32_t robID,
1119 const EventContext& ctx)
const
1121 StatusCode
sc{StatusCode::SUCCESS};
1123 if (not data.foundHeader) {
1124 ATH_MSG_INFO(
" Missing link header in ROD " << std::hex << robID << std::dec);
1125 data.foundMissingLinkHeaderError =
true;
1131 const int chip{(inData>>3) & 0xF};
1132 const int abcError{inData & 0x7};
1134 <<
" Error code abcError " << abcError <<
" Link Number (or Stream) " << data.linkNumber);
1137 if (abcError!=0x1 and abcError!=0x2 and abcError!=0x4 and abcError!=0x7) {
1138 ATH_MSG_DEBUG(
"ABCD error has an invalid error code " << abcError
1139 <<
" the 16-bit word is 0x" << std::hex << inData << std::dec
1140 <<
" for hash " << data.linkIDHash);
1145 const unsigned int sideABCDError{
static_cast<unsigned int>(chip/8)};
1146 if (data.linkIDHash.value()%2!=sideABCDError) {
1150 ATH_MSG_DEBUG(
"ABCD error and online ID have different side information for hash " << data.linkIDHash <<
". "
1151 << sideABCDError <<
" from ABCD error and " << data.linkIDHash.value()%2 <<
" from online ID");
1152 data.linkIDHash = (data.linkIDHash.value()/2)*2+sideABCDError;
1153 errs.
noerror(data.linkIDHash);
1157 ATH_MSG_DEBUG(
"ABCD error has an invalid chip 0x" << std::hex << chip << std::dec
1158 <<
" the 16-bit word is 0x" << std::hex << inData << std::dec
1159 <<
" for hash " << data.linkIDHash.value());
1163 if ( abcError==0x1)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Error1, errs, ctx));
1164 else if (abcError==0x2)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Error2, errs, ctx));
1165 else if (abcError==0x4)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Error4, errs, ctx));
1166 else if (abcError==0x7)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Error7, errs, ctx));
1168 else if (chip%8==1)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Chip1, errs, ctx));
1169 else if (chip%8==2)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Chip2, errs, ctx));
1170 else if (chip%8==3)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Chip3, errs, ctx));
1171 else if (chip%8==4)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Chip4, errs, ctx));
1172 else if (chip%8==5)
ATH_CHECK(
addSingleError(data.linkIDHash, SCT_ByteStreamErrors::ABCDError_Chip5, errs, ctx));
1182 const uint32_t robID,
1186 const EventContext& ctx)
const
1188 StatusCode
sc{StatusCode::SUCCESS};
1190 if (not data.foundHeader) {
1191 ATH_MSG_INFO(
" Missing link header in ROD " << std::hex << robID << std::dec);
1192 data.foundMissingLinkHeaderError =
true;
1198 ATH_MSG_DEBUG(
" xxx Raw Data Mode " << std::hex << inData << std::dec <<
": Config Data Mode ");
1212 const EventContext& ctx)
const
1214 StatusCode
sc{StatusCode::SUCCESS};
1224 data.foundHeader =
false;
1228 if (inData & 0x1000) {
1229 ATH_MSG_DEBUG(
" Trailer: xxx Trailer ERROR " << std::hex << inData);
1235 if (inData & 0x800) {
1239 ATH_MSG_DEBUG(
" Trailer: xxx Header-Trailer limit ERROR " << std::hex << inData);
1245 if (inData & 0x400) {
1247 ATH_MSG_DEBUG(
" Trailer: xxx Data Overflow ERROR " << std::hex << inData);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
InDetRawDataCollection< SCT_RDORawData > SCT_RDO_Collection
InDetRawDataContainer< InDetRawDataCollection< SCT_RDORawData > > SCT_RDO_Container
a typed memory pool that saves time spent allocation small object.
pointer nextElementPtr()
obtain the next available element in pool by pointer pool is resized if its limit has been reached On...
value_type push_back(value_type pElem)
IDC like storage for BS errors, TODO, customise implementation further so that we store int rather th...
This is a "hash" representation of an Identifier.
constexpr bool is_valid() const
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
virtual const SiDetectorElementCollection * getDetectorElementCollection() const override
access to whole collectiom
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
allows to accumulate errors in one fillColection call
void add(const IdentifierHash id, SCT_ByteStreamErrors::ErrorType etype)
void removeIfEmpty(const IdentifierHash id)
void noerror(const IdentifierHash id)
std::atomic_uint m_firstExpHitNumber
Total number of first strips with hit decoded in expanded mode.
std::atomic_uint m_singleCondHitNumber
Total number of single strips with hit decoded in condensed mode.
std::atomic_uint m_nHits
Total number of SCT hits in ByteStream.
ToolHandle< ISCT_ConfigurationConditionsTool > m_configTool
Service that keeps track of configuration conditions.
std::atomic_uint m_pairedCondHitNumber
Total number of paired strips with hit decoded in condensed mode.
StatusCode processCondensedHit(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process hit word in Condensed mode.
std::atomic_uint m_headNumber
Total number of decoded header data.
IdContext m_contextSCT
"Context" of an expanded identifier (ExpandedIdentifier) for compact or hash versions (Identifier32 o...
StatusCode processTrailer(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process trailer word.
std::atomic_uint m_headErrorFormatter
Total number of formatter errors in the header data.
std::atomic_uint m_headErrorLvl1ID
Total number of Lvl1ID errors in the header data.
StatusCode processSuperCondensedHit(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process hit word in Super-Condensed mode.
std::atomic_uint m_truncatedRODNumber
Total number of truncated ROBFragments.
std::atomic_uint m_flagErrorBit
Total number of flag error data.
std::atomic_uint m_maskedRODNumber
Total number of masked RDOs.
std::atomic_uint m_headErrorTimeout
Total number of timeout errors in the header data.
std::atomic_uint m_trailerErrorBit
Total number of trailer bit errors.
SCT_RodDecoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
StatusCode addRODError(uint32_t rodID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs, const EventContext &ctx, const std::unordered_set< IdentifierHash > *foundHashes=nullptr) const
Add an error for each wafer in the problematic ROD.
std::atomic_uint m_rodClockErrorNumber
Total number of ROD clock errors.
std::atomic_uint m_trailerErrorOverflow
Total number of overflow errors in the trailer data.
const SCT_ID * m_sctID
Identifier helper class for the SCT subdetector that creates compact Identifier objects and Identifie...
std::atomic_uint m_headErrorPreamble
Total number of preamble errors in the header data.
std::vector< bool > m_swapPhiReadoutDirection
Swap phi readout direction.
std::atomic_uint m_condHit1Error
Total number of first hit data errors.
virtual StatusCode finalize() override
Finalize.
std::atomic_uint m_chipNumberError
Total number of chip number errors.
virtual StatusCode initialize() override
Initialize.
std::atomic_uint m_maskedLinkNumber
Total number of masked links in the header data.
StatusCode setFirstTempMaskedChip(const IdentifierHash &hashID, unsigned int firstTempMaskedChip, SCT_RodDecoderErrorsHelper &errs, const EventContext &ctx) const
Set first temporarily masked chip information from byte stream trailer.
StatusCode processExpandedHit(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process hit word in Expanded mode.
std::atomic_uint m_nRDOs
Total number of SCT RDOs created.
std::atomic_uint m_unknownDataFormat
Total number of unknown data formats.
StatusCode addSingleError(const IdentifierHash &hashID, SCT_ByteStreamErrors::ErrorType error, SCT_RodDecoderErrorsHelper &errs, const EventContext &ctx) const
Add single eror.
std::atomic_uint m_headErrorBCID
Total number of BCID errors in the header data.
std::atomic_uint m_lastExpHitNumber
Total number of last consecutive strips with hit decoded in expanded mode.
ToolHandle< ISCT_CablingTool > m_cabling
Providing mappings of online and offline identifiers and also serial numbers.
std::atomic_uint m_trailerNumber
Total number of decoded trailer data.
StatusCode processHeader(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RDO_Container &rdoIDCont, DataPool< SCT3_RawData > *dataItemsPool, CacheHelper &cache, SCT_RodDecoderErrorsHelper &errs, bool &hasError, bool &breakNow, const EventContext &ctx) const
Process header word.
std::atomic_uint m_configDataBit
Total number of configuration data for raw data.
int makeRDO(const bool isOld, SharedData &data, CacheHelper &cache, DataPool< SCT3_RawData > *dataItemsPool) const
Builds RawData RDO and adds to RDO container.
virtual StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, SCT_RDO_Container &rdoIDCont, IDCInDetBSErrContainer &errs, DataPool< SCT3_RawData > *dataItemsPool, const EventContext &ctx, const std::vector< IdentifierHash > *vecHash=nullptr) const override
Fill SCT RDO Collection with decoded ROB data.
std::atomic_uint m_evenExpHitNumber
Total number of consecutive paired strips with hit decoded in expanded mode.
std::atomic_uint m_numMissingLinkHeader
Total number of missing link headers.
StatusCode processRawData(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process raw data word.
std::atomic_uint m_trailerErrorLimit
Total number of header trailer limit errors in the trailer data.
std::atomic_uint m_condHit2Error
Total number second hit data errors.
StatusCode processABCDError(const uint16_t inData, const uint32_t robID, SharedData &data, SCT_RodDecoderErrorsHelper &errs, bool &hasError, const EventContext &ctx) const
Process ABCD error.
std::string find(const std::string &s)
return a remapped string
const DataType * PointerType
eformat::ROBFragment< PointerType > ROBFragment
ErrorType
SCT byte stream error type enums used in SCT_RodDecoder, SCT_ByteStreamErrorsTool,...
ErrorType TempMaskedChipToBit(const int chip)
Temp object to help with trigger caching.
Struct to hold data shared in methods used in fillCollection method.