27#define DO_NOT_USE_MUON_TAG true
40 const IInterface* parent)
53 declareInterface<TileROD_Decoder>(
this);
55 for (std::atomic<const uint32_t*>& p : m_OFPtrs) {
145 std::ostringstream os;
148 std::vector<int> v = { 0x10d };
156 os <<
" (frag IDs):";
159 os <<
" 0x" << std::hex << fragID << std::dec;
163 ATH_MSG_INFO(
"Enable channel remapping for demonstrator modules" << os.str());
187 for (
int i=0; i<24; ++i) {
191 for (
int i=24; i<48; i+=3) {
208 for (
int i=24; i<30; ++i) {
211 for (
int i=42; i<48; ++i) {
216 return StatusCode::SUCCESS;
221 for (
unsigned int i = 0; i < 4; ++i) {
228 return StatusCode::SUCCESS;
237 return *(p +
a) & (1 <<
r);
247 uint32_t sizeOverhead,
249 const uint32_t* p,
pDigiVec & pDigits,
250 int frag_id,
int drawer_type)
const {
255 const uint32_t *
data;
262 int size = *(p) - sizeOverhead;
264 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
274 for (
int i = 0; i < size; ++i) {
275 uint32_t w =
data[i];
276 if (allFF && w!=0xFFFFFFFF) {
280 if (all00 && w != 0) {
286 uint32_t status = (all00 | allFF);
287 digitsMetaData[6].push_back( status );
296 if (sizeOverhead == 2 && (version == 0x2 || version == 0x1)) {
297 if (size > 178 && size < 205)
299 else if (size > 274 && size < 405) size = 275;
309 int channelCount = chipCount * 3;
312 int blockSize = size / chipCount;
316 int wordsPerChip = 0;
318 int dataWordsPerChip = 0;
323 static std::atomic<int> savedDigiMode = -1;
325 int digiMode = savedDigiMode;
327 if (digiMode < 0 && size > 0) {
328 digiMode =
m_d2Bytes.getDigiMode(
data, chipCount, blockSize);
329 savedDigiMode = digiMode;
332 if (digiMode > 0 || (digiMode < 0 && blockSize == 17)) {
339 wordsPerChip = (blockSize - 1) / 2;
341 dataWordsPerChip = wordsPerChip - 1;
346 gainOffset = wordsPerChip;
350 wordsPerChip = blockSize - 1;
352 dataWordsPerChip = wordsPerChip - 1;
358 if (
msgLvl(MSG::VERBOSE)) {
359 msg(MSG::VERBOSE) <<
"Unpacking TileDigits, ID=0x" << MSG::hex << frag
360 <<
", size=" << MSG::dec << size <<
endmsg;
362 msg(MSG::VERBOSE) <<
" chips=" << chipCount <<
endmsg;
363 msg(MSG::VERBOSE) <<
" channels=" << channelCount <<
endmsg;
364 msg(MSG::VERBOSE) <<
" block size=" << blockSize <<
endmsg;
365 msg(MSG::VERBOSE) <<
" words/chip=" << wordsPerChip <<
endmsg;
366 msg(MSG::VERBOSE) <<
" data/chip=" << dataWordsPerChip <<
endmsg;
367 msg(MSG::VERBOSE) <<
" gain offs=" << gainOffset <<
endmsg;
368 msg(MSG::VERBOSE) <<
" mode=" << digiMode <<
endmsg;
379 std::array< std::vector<float>, 3 > digiVec;
382 uint32_t bcid =
m_d2Bytes.getBCID(
data, chipCount, blockSize);
384 if (gainOffset > 0) {
387 std::vector<uint32_t>& chipHeaderLow = digitsMetaData[2];
388 std::vector<uint32_t>& chipCRCLow = digitsMetaData[3];
389 std::vector<uint32_t>& chipHeaderHigh = digitsMetaData[4];
390 std::vector<uint32_t>& chipCRCHigh = digitsMetaData[5];
393 for (chip = 0; chip < chipCount; ++chip) {
399 for (n = 0; n < 3; ++n) {
401 channel = chip * 3 + n;
402 if (
remap) channel = chmap[channel];
407 pDigits.push_back(td);
413 digiVec =
m_d2Bytes.getDigits(
data + 1 + gainOffset, dataWordsPerChip);
415 for (n = 0; n < 3; ++n) {
417 channel = chip * 3 + n;
418 if (
remap) channel = chmap[channel];
423 pDigits.push_back(td);
429 chipHeaderLow.push_back(*
data);
430 chipCRCLow.push_back(*(
data + gainOffset - 1));
431 chipHeaderHigh.push_back(*(
data + gainOffset));
432 chipCRCHigh.push_back(*(
data + blockSize - 1));
439 pDigits.reserve(pDigits.size() + 48);
440 std::vector<uint32_t>& chipHeader = digitsMetaData[2];
441 std::vector<uint32_t>& chipCRC = digitsMetaData[3];
444 for (chip = 0; chip < chipCount; ++chip) {
449 <<
" CRC $" << *(
data + blockSize - 1) );
451 for (n = 0; n < 3; ++n) {
453 channel = chip * 3 + n;
454 if (
remap) channel = chmap[channel];
458 adcID =
m_tileHWID->adc_id(drawerID, channel, gain);
464 <<
" BCID: " << MSG::hex <<
m_d2Bytes.getBCID(
data, chipCount, blockSize) << MSG::dec
465 <<
" Data={" << (
int) digiVec[n][0]
466 <<
"," << (
int) digiVec[n][1]
467 <<
"," << (
int) digiVec[n][2]
468 <<
"," << (
int) digiVec[n][3]
469 <<
"," << (
int) digiVec[n][4]
470 <<
"," << (
int) digiVec[n][5]
471 <<
"," << (
int) digiVec[n][6] <<
"}" );
474 pDigits.push_back(td);
479 chipHeader.push_back(*
data);
480 chipCRC.push_back(*(
data + blockSize - 1));
488 int extra = size - (
data - p) + 2;
494 <<
" data words, while size from header is " << size
495 <<
" data words (plus " << sizeOverhead <<
" words overhead)" );
499 if (
msgLvl(MSG::VERBOSE)) {
500 msg(MSG::VERBOSE) <<
"Trailer 0x" << MSG::hex
502 for (
int i = 2; i < extra; ++i) {
503 msg(MSG::VERBOSE) <<
" 0x" <<
data[i];
509 if ((
data[0] & 0xffff) != (
data[0] >> 16)) {
510 msg(MSG::VERBOSE) << MSG::hex <<
"Trailer numbers do not match: "
513 if ((
data[0] & 0xffff) == 0xffff)
514 msg(MSG::VERBOSE) <<
"Found barrel trailer" <<
endmsg;
515 else if ((
data[0] & 0xffff) == 0xfff)
516 msg(MSG::VERBOSE) <<
"Found extended barrel trailer" <<
endmsg;
518 msg(MSG::VERBOSE) << MSG::hex <<
"Unexpected trailer number: "
525 if ((
data[1] & 0xffff) != (
data[1] >> 16)) {
526 msg(MSG::VERBOSE) <<
"Trailer CRC numbers do not match" <<
endmsg;
528 msg(MSG::VERBOSE) << MSG::hex <<
"Found CRC 0x" << (
data[1] & 0xffff)
536 digitsMetaData[0].push_back(size);
537 digitsMetaData[0].push_back(frag);
538 digitsMetaData[0].push_back(bcid);
539 for (
int i = 0; i < extra; ++i) {
540 digitsMetaData[1].push_back(
data[i]);
542 if (sizeOverhead == 2 && (version == 0x2 || version == 0x1)) {
543 digitsMetaData[1].push_back(p[2]);
546 if (dataWordsPerChip > 15) {
552 uint32_t sizeOverhead,
556 int frag_id,
int drawer_type)
const {
558 int size = *(p) - sizeOverhead;
560 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
563 int frag1version = (*(p + 1) >> 31) & 0x1;
564 int nbchanformat1 = ((*(p + 1)) >> 24) & 0x3F;
568 digitsMetaData[0].push_back(size);
569 digitsMetaData[0].push_back(frag);
570 digitsMetaData[0].push_back(0);
572 if (frag1version == 0) {
575 int nsamp = (*(p) >> 8) & 0x0F;
576 int words_per_chan = nsamp + 1;
577 int nchan = 2 * size / words_per_chan;
579 if (2 * size != nchan * words_per_chan || nchan <= 0 || nchan > 48) {
581 ATH_MSG_WARNING(
"Digi frag type=1 fragId=0x" << MSG::hex << frag << MSG::dec
582 <<
" Nsamp=" << nsamp
583 <<
" Nchan=" << nchan
584 <<
" Wrong Size=" << size );
590 std::vector<float> digiVec(nsamp);
591 pDigits.reserve(nchan);
593 const uint16_t* p16 =
reinterpret_cast<const uint16_t *
>(p);
595 for (
int ch = 0; ch < nchan; ++ch) {
597 int channel = (*p16) & 0xFF;
598 if (
remap) channel = chmap[channel];
599 int nsamp1 = (*(p16) >> 8) & 0x0F;
600 int gain = (*p16) >> 15;
603 for (
int samp = 0; samp < nsamp; ++samp) {
604 digiVec[samp] = *p16++;
607 if (channel < 48 && nsamp1 == nsamp) {
610 pDigits.push_back(td);
613 ATH_MSG_WARNING(
"Digi frag type=1 fragId=0x" << MSG::hex << frag << MSG::dec
615 <<
" channel=" << channel
616 <<
" nsamp=" << nsamp1 <<
"/" << nsamp );
620 if (
msgLvl(MSG::VERBOSE)) {
621 msg(MSG::VERBOSE) << MSG::hex <<
"Frag: $" << frag << MSG::dec
625 for (
int samp = 0; samp < nsamp; ++samp) {
626 msg(MSG::VERBOSE) <<
" " << (int) digiVec[samp];
628 msg(MSG::VERBOSE) <<
"} " << MSG::hex;
629 for (
int samp = 0; samp < nsamp / 2 + 1; ++samp) {
630 msg(MSG::VERBOSE) << (int) *p++ <<
" ";
637 else if (frag1version == 1) {
641 int SizeOfFrag1 = size * 2;
642 int nbchanformat2 = (SizeOfFrag1 - (3 * nbchanformat1)) / 5;
644 int nchan = nbchanformat1 + nbchanformat2;
646 if ((nchan) > 48 || ((nbchanformat1 * 3) + (nbchanformat2 * 5) > SizeOfFrag1)) {
648 ATH_MSG_WARNING(
"Digi frag type=1 fragId=0x" << MSG::hex << frag << MSG::dec
649 <<
" frag1Version=" << frag1version
650 <<
" Nsamp=" << nsamp
651 <<
" NchanFormat1=" << nbchanformat1
652 <<
" NchanFormat2=" << nbchanformat2
653 <<
" Wrong Size=" << size);
659 std::vector<float> digiVec(nsamp);
660 pDigits.reserve(nchan);
671 for (
int chf1 = 0; chf1 < nbchanformat1; ++chf1) {
673 channel = ((*p >> 26) & 0x3F);
675 channel = ((*p >> 10) & 0x3F);
676 if (
remap) channel = chmap[channel];
680 if (ptr16index == 1) {
681 word1 = (uint16_t) ((*p >> 16) & 0xFFFF);
682 word2 = (uint16_t) (*p & 0xFFFF);
683 word3 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
687 else if (ptr16index == 0) {
688 word1 = (uint16_t) (*p & 0xFFFF);
689 word2 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
690 word3 = (uint16_t) (*(p + 1) & 0xFFFF);
694 uint16_t Smin = (word1 & 0x3FF);
696 digiVec[0] = ((word3 >> 4) & 0xF) + Smin;
697 digiVec[1] = ((word3 >> 0) & 0xF) + Smin;
698 digiVec[2] = ((word3 >> 8) & 0xF) + Smin;
699 digiVec[3] = ((word3 >> 12) & 0xF) + Smin;
700 digiVec[4] = ((word2 >> 4) & 0xF) + Smin;
701 digiVec[5] = ((word2 >> 0) & 0xF) + Smin;
702 digiVec[6] = ((word2 >> 8) & 0xF) + Smin;
706 sDigits.at(channel) = td;
709 if (
msgLvl(MSG::VERBOSE)) {
710 msg(MSG::VERBOSE) << MSG::hex <<
"Frag: $" << frag << MSG::dec
714 for (
int samp = 0; samp < 7; ++samp) {
715 msg(MSG::VERBOSE) <<
" " << (int) digiVec[samp];
717 msg(MSG::VERBOSE) <<
"} " << MSG::hex
718 <<
" WORD1: " << word1
719 <<
" WORD2: " << word2
720 <<
" WORD3: " << word3 << MSG::dec <<
endmsg;
724 for (
int chf2 = 0; chf2 < nbchanformat2; ++chf2) {
726 channel = ((*p) & 0x3F);
728 channel = ((*(p + 1) >> 16) & 0x3F);
729 if (
remap) channel = chmap[channel];
731 if (ptr16index == 1) {
732 word1 = (uint16_t) ((*p >> 16) & 0xFFFF);
733 word2 = (uint16_t) ((*p) & 0xFFFF);
734 word3 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
735 word4 = (uint16_t) (*(p + 1) & 0xFFFF);
736 word5 = (uint16_t) ((*(p + 2) >> 16) & 0xFFFF);
738 }
else if (ptr16index == 0) {
739 word1 = (uint16_t) ((*p) & 0xFFFF);
740 word2 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
741 word3 = (uint16_t) (*(p + 1) & 0xFFFF);
742 word4 = (uint16_t) ((*(p + 2) >> 16) & 0xFFFF);
743 word5 = (uint16_t) (*(p + 2) & 0xFFFF);
747 int gain = ((word2 >> 6) & 0x1);
749 digiVec[0] = ((word1 << 9) & 0x200) + ((word2 >> 7) & 0x1FF);
750 digiVec[1] = (word1 >> 1) & 0x3FF;
751 digiVec[2] = (word4 << 5 & 0x3E0) + ((word1 >> 11) & 0x1F);
752 digiVec[3] = (word4 >> 5) & 0x3FF;
753 digiVec[4] = ((word3 << 1) & 0x3FE) + ((word4 >> 15) & 0x1);
754 digiVec[5] = ((word5 << 7) & 0x380) + ((word3 >> 9) & 0x7F);
755 digiVec[6] = (word5 >> 3) & 0x3FF;
759 sDigits.at(channel) = td;
760 p += (2 + ptr16index);
762 if (
msgLvl(MSG::VERBOSE)) {
763 msg(MSG::VERBOSE) << MSG::hex <<
"Frag: $" << frag << MSG::dec
767 for (
int samp = 0; samp < nsamp; ++samp) {
768 msg(MSG::VERBOSE) <<
" " << (int) digiVec[samp];
770 msg(MSG::VERBOSE) <<
"} " << MSG::hex
771 <<
" WORD1: " << word1
772 <<
" WORD2: " << word2
773 <<
" WORD3: " << word3
774 <<
" WORD4: " << word4
775 <<
" WORD5: " << word5 << MSG::dec <<
endmsg;
779 for (
uint i = 0; i < sDigits.size(); i++) {
781 if (td) pDigits.push_back(td);
788 uint32_t sizeOverhead,
791 int frag_id,
int )
const {
795 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
805 int wc = sizeOverhead;
811 unsigned int w = (*p);
823 pChannel.push_back(
rc);
841 << wc <<
" != " <<
count );
851 uint32_t sizeOverhead,
854 int frag_id,
int )
const {
858 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
867 const uint32_t* pMap = p + 2;
869 const short* p16 =
reinterpret_cast<const short *
>(p);
872 short wc16 = 4 + sizeOverhead * 2;
886 pChannel.push_back(
rc);
889 <<
" ch " << ch <<
" " << MSG::hex
890 <<
"0x" << *p16 << *(p16+1) << *(p16+2) << MSG::dec
905 if (wc16 != 2 *
count) {
909 << wc16 <<
" != 2*" <<
count );
919 uint32_t sizeOverhead,
924 int frag_id,
int drawer_type)
const
929 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
940 int wc = sizeOverhead;
948 unsigned int w = (*p);
951 int ch1 = (
remap) ? chmap[ch] : ch;
965 pChannel.push_back(
rc);
980 rawchannelMetaData[6].push_back( all00 | allFF );
986 << wc <<
" != " <<
count );
998 uint32_t sizeOverhead,
1001 const uint32_t* p,
pDigiVec & pDigits,
1003 int frag_id,
int drawer_type)
const
1008 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1011 int size_L2 = (*(p + 1) >> (32 - 2 - 3)) & 0x7;
1015 digitsMetaData[0].push_back(
count);
1016 digitsMetaData[0].push_back(frag);
1017 digitsMetaData[0].push_back(0);
1020 const uint32_t* ptrFrag =
reinterpret_cast<const uint32_t*
> (p - 1);
1024 int wc = sizeOverhead;
1025 int bc = (size_L2 * 32 + 48) / 8;
1029 std::vector<float> digiVec(7);
1033 for (
int ch = 0; ch < 48; ++ch) {
1034 int size =
m_rc2bytes5.get_size_code(ChanData[ch].code);
1035 int gain = ChanData[ch].
gain;
1036 int ch1 = (
remap) ? chmap[ch] : ch;
1040 for (
int i = 0; i < 7; ++i) digiVec[i] = ChanData[ch].s[i];
1042 pDigits.push_back(td);
1046 int format =
m_rc2bytes5.get_format(ChanData[ch].code);
1048 float ene = ChanData[ch].
ene;
1049 float time = ChanData[ch].
time;
1052 pChannel.push_back(
rc);
1066 << wc <<
" != " <<
count );
1070 }
else if (wc <
count) {
1073 <<
" words in frag" );
1077 <<
" words in frag" );
1085 uint32_t size = (*p) - 1;
1087 std::vector<uint32_t>
data;
1089 const uint32_t* data_end = p + size;
1093 data.push_back(*(++p));
1096 while (p < data_end) {
1097 uint32_t ppr_size = (*p) - 2;
1099 data.push_back(*(p));
1100 data.push_back(*(++p));
1103 std::for_each(p, p + ppr_size, [&
data] (uint32_t v) {
1104 data.push_back((ntohs(v >> 16) << 16) | (ntohs(v & 0xFFFF)));
1114 uint32_t sizeOverhead,
1116 const uint32_t* p,
pDigiVec & pDigits,
1117 int frag_id,
int drawer_type)
const
1119 int size = *(p)- sizeOverhead;
1120 const uint32_t*
data = p+2;
1122 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1132 for (
int i = 0; i < size; ++i) {
1133 uint32_t w =
data[i];
1134 if (allFF && w!=0xFFFFFFFF) {
1138 if (all00 && w != 0) {
1144 uint32_t status = (all00 | allFF);
1145 digitsMetaData[6].push_back( status );
1154 unsigned int moduleID[Tile::MAX_MINIDRAWER] = {0};
1155 unsigned int runType[Tile::MAX_MINIDRAWER] = {0};
1157 unsigned int runNumber[Tile::MAX_MINIDRAWER] = {0};
1159 unsigned int pedestalHi[Tile::MAX_MINIDRAWER] = {0};
1160 unsigned int pedestalLo[Tile::MAX_MINIDRAWER] = {0};
1162 unsigned int chargeInjected[Tile::MAX_MINIDRAWER] = {0};
1163 unsigned int timeInjected[Tile::MAX_MINIDRAWER] = {0};
1164 unsigned int capacitor[Tile::MAX_MINIDRAWER] = {0};
1166 uint32_t bcid[Tile::MAX_MINIDRAWER] = {0};
1167 uint32_t l1id[Tile::MAX_MINIDRAWER] = {0};
1169 uint32_t ecr[Tile::MAX_MINIDRAWER] = {0};
1170 uint32_t bcr[Tile::MAX_MINIDRAWER] = {0};
1172 uint32_t fragmentID[Tile::MAX_MINIDRAWER] = {0};
1173 uint32_t packetVersion[Tile::MAX_MINIDRAWER] = {0};
1177 int mdFragmentSize = (*data) & 0xFFFF;
1178 int sampleNumber = mdFragmentSize / Tile::MAX_MINIDRAWER_CHAN;
1180 std::vector<std::vector<std::vector<float>>> samples(Tile::MAX_GAIN,
1181 std::vector<std::vector<float>>(Tile::MAX_CHAN,
1182 std::vector<float>(sampleNumber)));
1184 const uint32_t*
const end_data =
data + size;
1185 while (
data < end_data) {
1186 if (*
data == 0x12345678 ) {
1187 mdFragmentSize = (*(
data - 2)) & 0xFFFF;
1189 if ((++
data < end_data)) {
1191 version = (((*
data >> 16) & 0xFFFF) == 0) ? 1 : 0;
1192 int mdSizeOverhead = (version == 0) ? 10 : 11;
1193 int delta = mdFragmentSize - (sampleNumber * Tile::MAX_MINIDRAWER_CHAN + mdSizeOverhead);
1195 ATH_MSG_WARNING(
"FRAG6: Unexpected MD fragment size " << mdFragmentSize <<
" => "
1196 << sampleNumber <<
" samples will be unpacked and last "
1197 << delta <<
" words will be ignored ");
1200 unsigned int miniDrawer = -1;
1203 const uint32_t* trailer =
data + mdFragmentSize - 4;
1204 if (trailer < end_data && *trailer == 0x87654321) {
1206 unsigned int paramsSize = 3;
1208 unsigned int fragSize = *
data & 0xFF;
1209 paramsSize = (*
data >> 8 ) & 0xFF;
1211 miniDrawer = *(
data + 4) & 0xFF;
1213 moduleID[miniDrawer] = (*
data >> 16) & 0xFF;
1214 runType[miniDrawer] = (*
data >> 24) & 0xFF;
1215 if (fragSize != sampleNumber * Tile::MAX_MINIDRAWER_CHAN) {
1217 <<
"] has unexpected fragment size: " << fragSize
1218 <<
" correct value for " << sampleNumber
1219 <<
" samples is " << sampleNumber * Tile::MAX_MINIDRAWER_CHAN);
1222 if (paramsSize == 3){
1223 runNumber[miniDrawer] = *(++
data);
1225 pedestalLo[miniDrawer] = *(++
data) & 0xFFF;
1226 pedestalHi[miniDrawer] = (*
data >> 12 ) & 0xFFF;
1228 chargeInjected[miniDrawer] = *(++
data) & 0xFFF;
1229 timeInjected[miniDrawer] = (*
data >> 12) & 0xFF;
1230 capacitor[miniDrawer] = (*
data >> 20) & 0x1;
1234 <<
"] has unexpected number of parameter words: " << paramsSize
1235 <<
" => ignore them !!!");
1239 bcid[miniDrawer] = (*(++
data) >> 16) & 0xFFFF;
1240 l1id[miniDrawer] = *(++
data) & 0xFFFFFF;
1241 ecr[miniDrawer] = (*
data >> 24) & 0xFF;
1245 miniDrawer = *(
data + 1) & 0xFF;
1247 packetVersion[miniDrawer] = (*data) & 0xFF;
1248 fragmentID[miniDrawer] = (*
data >> 8) & 0xFF;
1250 bcid[miniDrawer] = (*(++
data) >> 8) & 0xFFF;
1251 moduleID[miniDrawer] = (*
data >> 20) & 0xFFF;
1253 l1id[miniDrawer] = *(++
data) & 0xFFFFFF;
1254 ecr[miniDrawer] = (*
data >> 24) & 0xFF;
1256 bcr[miniDrawer] = *(++
data);
1259 if (packetVersion[miniDrawer] == 1) {
1260 pedestalLo[miniDrawer] = *(++
data) & 0xFFF;
1261 pedestalHi[miniDrawer] = (*
data >> 12 ) & 0xFFF;
1262 runType[miniDrawer] = (*
data >> 24) & 0xFF;
1264 runNumber[miniDrawer] = *(++
data);
1266 runNumber[miniDrawer] = *(++
data);
1268 pedestalLo[miniDrawer] = *(++
data) & 0xFFF;
1269 pedestalHi[miniDrawer] = (*
data >> 12 ) & 0xFFF;
1270 runType[miniDrawer] = (*
data >> 24) & 0xFF;
1273 chargeInjected[miniDrawer] = *(++
data) & 0xFFF;
1274 timeInjected[miniDrawer] = (*
data >> 12) & 0xFF;
1275 capacitor[miniDrawer] = (*
data >> 20) & 0x1;
1278 if (
msgLvl(MSG::VERBOSE)) {
1279 msg(MSG::VERBOSE) <<
"FRAG6: Found MD[" << miniDrawer <<
"] fragment"
1280 <<
", Run type: " << runType[miniDrawer]
1281 <<
", Module ID: " << moduleID[miniDrawer]
1282 <<
", BCID: " << bcid[miniDrawer]
1283 <<
", L1ID: " << l1id[miniDrawer]
1284 <<
", ECR: " << ecr[miniDrawer];
1286 msg(MSG::VERBOSE) <<
", BCR: " << bcr[miniDrawer]
1287 <<
", Packet version: " << packetVersion[miniDrawer]
1288 <<
", Fragment ID: " << fragmentID[miniDrawer];
1293 if (paramsSize == 3) {
1294 msg(MSG::VERBOSE) <<
"FRAG6: MD[" << miniDrawer <<
"] Parameters:"
1295 <<
" Run number: " << runNumber[miniDrawer]
1296 <<
", Ppedestal Lo: " << pedestalLo[miniDrawer]
1297 <<
", Ppedestal Hi: " << pedestalHi[miniDrawer]
1298 <<
", Charge injected: " << chargeInjected[miniDrawer]
1299 <<
", Time injected: " << timeInjected[miniDrawer]
1300 <<
", Capacitor: " << capacitor[miniDrawer] <<
endmsg;
1304 const uint16_t* sample =
reinterpret_cast<const uint16_t *
> (++
data);
1306 for (
int gain = 1; gain > -1; --gain) {
1307 int start_channel(miniDrawer * Tile::MAX_MINIDRAWER_CHAN);
1308 int end_channel(start_channel + Tile::MAX_MINIDRAWER_CHAN);
1309 for (
int channel = start_channel; channel < end_channel; ++channel) {
1311 for (
int samplesIdx = 0; samplesIdx<sampleNumber; ++samplesIdx) {
1312 samples[gain][channel][samplesIdx] = (*sample & 0x0FFF);
1322 ATH_MSG_WARNING(
"FRAG6: Not found correct MD[" << miniDrawer <<
"] fragment trailer: => skip it!!!");
1330 pDigits.reserve(Tile::MAX_GAIN * Tile::MAX_CHAN);
1333 for (
unsigned int gain = 0; gain < Tile::MAX_GAIN; ++gain) {
1335 for (
unsigned int channel = 0; channel < Tile::MAX_CHAN; ++channel) {
1336 int ch1 = (
remap) ? chmap[channel] : channel;
1338 adcID =
m_tileHWID->adc_id(drawerID, ch1, gain);
1339 std::vector<float> digiVec(&samples[gain][channel][0], &samples[gain][channel][sampleNumber]);
1340 pDigits.push_back(
new TileDigits(adcID, digiVec));
1347 digitsMetaData[1].insert(digitsMetaData[1].end(), &l1id[0], &l1id[Tile::MAX_MINIDRAWER]);
1348 digitsMetaData[1].insert(digitsMetaData[1].end(), &bcid[0], &bcid[Tile::MAX_MINIDRAWER]);
1349 digitsMetaData[1].insert(digitsMetaData[1].end(), &moduleID[0], &moduleID[Tile::MAX_MINIDRAWER]);
1350 digitsMetaData[1].insert(digitsMetaData[1].end(), &runType[0], &runType[Tile::MAX_MINIDRAWER]);
1351 digitsMetaData[1].insert(digitsMetaData[1].end(), &runNumber[0], &runNumber[Tile::MAX_MINIDRAWER]);
1352 digitsMetaData[1].insert(digitsMetaData[1].end(), &pedestalLo[0], &pedestalLo[Tile::MAX_MINIDRAWER]);
1353 digitsMetaData[1].insert(digitsMetaData[1].end(), &pedestalHi[0], &pedestalHi[Tile::MAX_MINIDRAWER]);
1354 digitsMetaData[1].insert(digitsMetaData[1].end(), &chargeInjected[0], &chargeInjected[Tile::MAX_MINIDRAWER]);
1355 digitsMetaData[1].insert(digitsMetaData[1].end(), &timeInjected[0], &timeInjected[Tile::MAX_MINIDRAWER]);
1356 digitsMetaData[1].insert(digitsMetaData[1].end(), &capacitor[0], &capacitor[Tile::MAX_MINIDRAWER]);
1357 digitsMetaData[1].insert(digitsMetaData[1].end(), &ecr[0], &ecr[Tile::MAX_MINIDRAWER]);
1359 digitsMetaData[1].insert(digitsMetaData[1].end(), &bcr[0], &bcr[Tile::MAX_MINIDRAWER]);
1360 digitsMetaData[1].insert(digitsMetaData[1].end(), &packetVersion[0], &packetVersion[Tile::MAX_MINIDRAWER]);
1361 digitsMetaData[1].insert(digitsMetaData[1].end(), &fragmentID[0], &fragmentID[Tile::MAX_MINIDRAWER]);
1369 int ,
int drawer_type)
const {
1378 rawchannelMetaData[0].push_back(w & 0xFFFF);
1380 rawchannelMetaData[0].push_back((w >> 16) & 0x7FFF);
1382 rawchannelMetaData[0].push_back(0xDEAD);
1385 if (drawer_type == 2) {
1386 ATH_MSG_WARNING(
"Demo->Legacy remapping for Ext.Barrel not yet implemented for DQ fragment");
1389 for (
int i = 0; i < (size - 4); ++i) {
1391 rawchannelMetaData[i + 1].push_back(w & 0xFFFF);
1392 rawchannelMetaData[i + 1].push_back(w >> 16);
1400 uint16_t& mask,
int ,
int drawer_type)
const {
1403 if (size < 9)
return;
1406 uint16_t frag = (*(++p)) & 0xfff;
1408 const uint16_t* w =
reinterpret_cast<const uint16_t*
> (++p);
1430 if (mask != rob_bcid && mask > 0) {
1436 if (mask & 0x0002) {
1441 if (drawer_type == 2) {
1442 ATH_MSG_WARNING(
"Demo->Legacy remapping for Ext.Barrel not yet implemented for DQ fragment");
1445 if (mask & 0x00F0) {
1446 uint16_t BCIDerr = mask;
1449 if ((frag == 0x30E) || frag == 0x411) {
1456 if (BCIDerr & 0xF) ++n_badMB;
1468 uint16_t fe_mask = *w++;
1478 if ((frag > 0x2FF)) {
1479 if ((frag == 0x30E) || frag == 0x411) fe_mask <<= 1;
1480 fe_mask = (fe_mask & 0xFF) | ((fe_mask & 0xF00) << 2);
1492 int frag_id,
int )
const {
1497 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1500 nDrawer[0] = frag & 0x3F;
1501 nDrawer[1] = (frag & 0xFC0) >> 6;
1506 uint32_t Mu_energy0;
1507 uint32_t Mu_energy1;
1508 uint32_t Mu_energy2;
1509 uint32_t Mu_pattern;
1511 uint32_t Mu_quality;
1513 std::vector<float> sumE[2];
1514 std::vector<unsigned int> word[2];
1515 std::vector<float>
eta[2];
1516 std::vector<float> energy0[2];
1517 std::vector<float> energy1[2];
1518 std::vector<float> energy2[2];
1519 std::vector<unsigned int> quality[2];
1522 constexpr float eta_LB[9] = {
1523 ((0.00f + 2 * 0.05f) / 3),
1524 ((0.20f + 2 * 0.15f) / 3),
1525 ((0.20f + 2 * 0.25f) / 3),
1526 ((0.40f + 2 * 0.35f) / 3),
1527 ((0.40f + 2 * 0.45f) / 3),
1528 ((0.40f + 2 * 0.55f) / 3),
1529 ((0.60f + 2 * 0.55f) / 3),
1530 ((0.60f + 2 * 0.65f) / 3),
1531 ((0.60f + 2 * 0.75f) / 3)
1534 constexpr float eta_EB[17] = {
1535 ((1.00f + 1.05f + 1.15f) / 3),
1536 ((1.00f + 1.15f + 1.15f) / 3),
1537 ((1.00f + 1.15f + 1.25f) / 3),
1538 ((1.00f + 1.25f + 1.15f) / 3),
1539 ((1.00f + 1.25f + 1.25f) / 3),
1540 ((1.00f + 1.25f + 1.35f) / 3),
1541 ((1.20f + 1.05f + 1.15f) / 3),
1542 ((1.20f + 1.15f + 1.15f) / 3),
1543 ((1.20f + 1.15f + 1.25f) / 3),
1544 ((1.20f + 1.25f + 1.15f) / 3),
1545 ((1.20f + 1.25f + 1.25f) / 3),
1546 ((1.20f + 1.25f + 1.35f) / 3),
1547 ((1.20f + 1.35f + 1.25f) / 3),
1548 ((1.20f + 1.35f + 1.35f) / 3),
1549 ((1.20f + 1.35f + 1.45f) / 3),
1550 ((1.20f + 1.45f + 1.35f) / 3),
1551 ((1.20f + 1.45f + 1.45f) / 3)
1555 sumE[0].push_back((
float) ((int32_t) (*p++) - 9000));
1556 sumE[1].push_back((
float) ((int32_t) (*p++) - 9000));
1560 int NMuons = (int) (size - 5) / 2;
1562 for (
int mu = 0; mu < NMuons; ++mu) {
1566 Mu_energy2 = w & 0x1FFFFFF;
1567 Mu_pattern = (w >> 25) & 0x1F;
1568 Mu_drawer = (w >> 30) & 1;
1569 Mu_quality = w >> 31;
1571 word[Mu_drawer].push_back(w);
1575 Mu_energy0 = w & 0xFFFF;
1576 Mu_energy1 = w >> 16;
1578 word[Mu_drawer].push_back(w);
1581 switch (frag >> 12) {
1583 eta[Mu_drawer].push_back(eta_LB[Mu_pattern]);
1586 eta[Mu_drawer].push_back(-eta_LB[Mu_pattern]);
1589 eta[Mu_drawer].push_back(eta_EB[Mu_pattern]);
1592 eta[Mu_drawer].push_back(-eta_EB[Mu_pattern]);
1600 energy0[Mu_drawer].push_back(Mu_energy0 / 2.);
1601 energy1[Mu_drawer].push_back(Mu_energy1 / 2.);
1602 energy2[Mu_drawer].push_back(Mu_energy2 / 2.);
1605 quality[Mu_drawer].push_back(Mu_quality);
1610 for (
unsigned int i = 0; i < 2; ++i) {
1613 int fragId = (((frag & 0xF000) >> 4) | nDrawer[i]);
1616 (*pL2[
m_hashFunc(fragId)]).setEt(std::move(sumE[i]));
1619 (*pL2[
m_hashFunc(fragId)]).setMu(std::move(
eta[i]), std::move(energy0[i]), std::move(energy1[i]), std::move(energy2[i]),
1620 std::move(quality[i]), std::move(word[i]));
1628 int frag_id,
int )
const {
1633 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1638 uint32_t Mu_energy0;
1639 uint32_t Mu_energy1;
1640 uint32_t Mu_energy2;
1641 uint32_t Mu_pattern;
1643 uint32_t Mu_quality;
1645 std::vector<unsigned int> word;
1646 std::vector<float>
eta;
1647 std::vector<float> energy0;
1648 std::vector<float> energy1;
1649 std::vector<float> energy2;
1650 std::vector<unsigned int> quality;
1652 constexpr float eta_LB[9] = {
1653 ((0.00f + 2 * 0.05f) / 3),
1654 ((0.20f + 2 * 0.15f) / 3),
1655 ((0.20f + 2 * 0.25f) / 3),
1656 ((0.40f + 2 * 0.35f) / 3),
1657 ((0.40f + 2 * 0.45f) / 3),
1658 ((0.40f + 2 * 0.55f) / 3),
1659 ((0.60f + 2 * 0.55f) / 3),
1660 ((0.60f + 2 * 0.65f) / 3),
1661 ((0.60f + 2 * 0.75f) / 3)
1664 constexpr float eta_EB[17] = {
1665 ((1.00f + 1.05f + 1.15f) / 3),
1666 ((1.00f + 1.15f + 1.15f) / 3),
1667 ((1.00f + 1.15f + 1.25f) / 3),
1668 ((1.00f + 1.25f + 1.15f) / 3),
1669 ((1.00f + 1.25f + 1.25f) / 3),
1670 ((1.00f + 1.25f + 1.35f) / 3),
1671 ((1.20f + 1.05f + 1.15f) / 3),
1672 ((1.20f + 1.15f + 1.15f) / 3),
1673 ((1.20f + 1.15f + 1.25f) / 3),
1674 ((1.20f + 1.25f + 1.15f) / 3),
1675 ((1.20f + 1.25f + 1.25f) / 3),
1676 ((1.20f + 1.25f + 1.35f) / 3),
1677 ((1.20f + 1.35f + 1.25f) / 3),
1678 ((1.20f + 1.35f + 1.35f) / 3),
1679 ((1.20f + 1.35f + 1.45f) / 3),
1680 ((1.20f + 1.45f + 1.35f) / 3),
1681 ((1.20f + 1.45f + 1.45f) / 3)
1685 std::vector<float> sumE(1, (
float) ((int32_t) (*p++) - 9000));
1686 (*pL2[
m_hashFunc(frag)]).setEt(std::move(sumE));
1690 int NMuons = (int) (size - 4) / 2;
1692 for (
int mu = 0; mu < NMuons; ++mu) {
1696 Mu_energy2 = w & 0x1FFFFFF;
1697 Mu_pattern = (w >> 25) & 0x1F;
1699 Mu_quality = w >> 31;
1705 Mu_energy0 = w & 0xFFFF;
1706 Mu_energy1 = w >> 16;
1711 switch (frag >> 8) {
1713 eta.push_back(eta_LB[Mu_pattern]);
1716 eta.push_back(-eta_LB[Mu_pattern]);
1719 eta.push_back(eta_EB[Mu_pattern]);
1722 eta.push_back(-eta_EB[Mu_pattern]);
1730 energy0.push_back(Mu_energy0 / 2.);
1731 energy1.push_back(Mu_energy1 / 2.);
1732 energy2.push_back(Mu_energy2 / 2.);
1735 quality.push_back(Mu_quality);
1740 (*pL2[
m_hashFunc(frag)]).setMu(std::move(
eta), std::move(energy0),
1741 std::move(energy1), std::move(energy2), std::move(quality), std::move(word));
1748 int frag_id,
int )
const {
1753 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1756 nDrawer[0] = frag & 0x3F;
1757 nDrawer[1] = (frag & 0xFC0) >> 6;
1762 uint32_t Mu_energy0;
1763 uint32_t Mu_energy1;
1764 uint32_t Mu_energy2;
1765 uint32_t Mu_pattern;
1767 uint32_t Mu_quality;
1769 std::vector<unsigned int> word[2];
1770 std::vector<float>
eta[2];
1771 std::vector<float> energy0[2];
1772 std::vector<float> energy1[2];
1773 std::vector<float> energy2[2];
1774 std::vector<unsigned int> quality[2];
1776 constexpr float eta_LB[9] = {
1777 ((0.00f + 2 * 0.05f) / 3),
1778 ((0.20f + 2 * 0.15f) / 3),
1779 ((0.20f + 2 * 0.25f) / 3),
1780 ((0.40f + 2 * 0.35f) / 3),
1781 ((0.40f + 2 * 0.45f) / 3),
1782 ((0.40f + 2 * 0.55f) / 3),
1783 ((0.60f + 2 * 0.55f) / 3),
1784 ((0.60f + 2 * 0.65f) / 3),
1785 ((0.60f + 2 * 0.75f) / 3)
1788 constexpr float eta_EB[17] = {
1789 ((1.00f + 1.05f + 1.15f) / 3),
1790 ((1.00f + 1.15f + 1.15f) / 3),
1791 ((1.00f + 1.15f + 1.25f) / 3),
1792 ((1.00f + 1.25f + 1.15f) / 3),
1793 ((1.00f + 1.25f + 1.25f) / 3),
1794 ((1.00f + 1.25f + 1.35f) / 3),
1795 ((1.20f + 1.05f + 1.15f) / 3),
1796 ((1.20f + 1.15f + 1.15f) / 3),
1797 ((1.20f + 1.15f + 1.25f) / 3),
1798 ((1.20f + 1.25f + 1.15f) / 3),
1799 ((1.20f + 1.25f + 1.25f) / 3),
1800 ((1.20f + 1.25f + 1.35f) / 3),
1801 ((1.20f + 1.35f + 1.25f) / 3),
1802 ((1.20f + 1.35f + 1.35f) / 3),
1803 ((1.20f + 1.35f + 1.45f) / 3),
1804 ((1.20f + 1.45f + 1.35f) / 3),
1805 ((1.20f + 1.45f + 1.45f) / 3)
1808 int NMuons = (int) (size - 3) / 2;
1810 for (
int mu = 0; mu < NMuons; ++mu) {
1814 Mu_energy2 = w & 0x1FFFFFF;
1815 Mu_pattern = (w >> 25) & 0x1F;
1816 Mu_drawer = (w >> 30) & 1;
1817 Mu_quality = w >> 31;
1819 word[Mu_drawer].push_back(w);
1823 Mu_energy0 = w & 0xFFFF;
1824 Mu_energy1 = w >> 16;
1826 word[Mu_drawer].push_back(w);
1829 switch (frag >> 12) {
1831 eta[Mu_drawer].push_back(eta_LB[Mu_pattern]);
1834 eta[Mu_drawer].push_back(-eta_LB[Mu_pattern]);
1837 eta[Mu_drawer].push_back(eta_EB[Mu_pattern]);
1840 eta[Mu_drawer].push_back(-eta_EB[Mu_pattern]);
1848 energy0[Mu_drawer].push_back(Mu_energy0 / 2.);
1849 energy1[Mu_drawer].push_back(Mu_energy1 / 2.);
1850 energy2[Mu_drawer].push_back(Mu_energy2 / 2.);
1853 quality[Mu_drawer].push_back(Mu_quality);
1858 for (
unsigned int i = 0; i < 2; ++i) {
1861 int fragId = (((frag & 0xF000) >> 4) | nDrawer[i]);
1863 (*pL2[
m_hashFunc(fragId)]).setMu(std::move(
eta[i]), std::move(energy0[i]), std::move(energy1[i]), std::move(energy2[i]),
1864 std::move(quality[i]), std::move(word[i]));
1873 int frag_id,
int )
const {
1878 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1883 uint32_t Mu_energy0;
1884 uint32_t Mu_energy1;
1885 uint32_t Mu_energy2;
1886 uint32_t Mu_pattern;
1888 uint32_t Mu_quality;
1890 std::vector<unsigned int> word;
1891 std::vector<float>
eta;
1892 std::vector<float> energy0;
1893 std::vector<float> energy1;
1894 std::vector<float> energy2;
1895 std::vector<unsigned int> quality;
1897 constexpr float eta_LB[9] = {
1898 ((0.00f + 2 * 0.05f) / 3),
1899 ((0.20f + 2 * 0.15f) / 3),
1900 ((0.20f + 2 * 0.25f) / 3),
1901 ((0.40f + 2 * 0.35f) / 3),
1902 ((0.40f + 2 * 0.45f) / 3),
1903 ((0.40f + 2 * 0.55f) / 3),
1904 ((0.60f + 2 * 0.55f) / 3),
1905 ((0.60f + 2 * 0.65f) / 3),
1906 ((0.60f + 2 * 0.75f) / 3)
1909 constexpr float eta_EB[17] = {
1910 ((1.00f + 1.05f + 1.15f) / 3),
1911 ((1.00f + 1.15f + 1.15f) / 3),
1912 ((1.00f + 1.15f + 1.25f) / 3),
1913 ((1.00f + 1.25f + 1.15f) / 3),
1914 ((1.00f + 1.25f + 1.25f) / 3),
1915 ((1.00f + 1.25f + 1.35f) / 3),
1916 ((1.20f + 1.05f + 1.15f) / 3),
1917 ((1.20f + 1.15f + 1.15f) / 3),
1918 ((1.20f + 1.15f + 1.25f) / 3),
1919 ((1.20f + 1.25f + 1.15f) / 3),
1920 ((1.20f + 1.25f + 1.25f) / 3),
1921 ((1.20f + 1.25f + 1.35f) / 3),
1922 ((1.20f + 1.35f + 1.25f) / 3),
1923 ((1.20f + 1.35f + 1.35f) / 3),
1924 ((1.20f + 1.35f + 1.45f) / 3),
1925 ((1.20f + 1.45f + 1.35f) / 3),
1926 ((1.20f + 1.45f + 1.45f) / 3)
1929 int NMuons = (int) (size - 3) / 2;
1931 for (
int mu = 0; mu < NMuons; ++mu) {
1935 Mu_energy2 = w & 0x1FFFFFF;
1936 Mu_pattern = (w >> 25) & 0x1F;
1938 Mu_quality = w >> 31;
1944 Mu_energy0 = w & 0xFFFF;
1945 Mu_energy1 = w >> 16;
1950 switch (frag >> 8) {
1952 eta.push_back(eta_LB[Mu_pattern]);
1955 eta.push_back(-eta_LB[Mu_pattern]);
1958 eta.push_back(eta_EB[Mu_pattern]);
1961 eta.push_back(-eta_EB[Mu_pattern]);
1969 energy0.push_back(Mu_energy0 / 2.);
1970 energy1.push_back(Mu_energy1 / 2.);
1971 energy2.push_back(Mu_energy2 / 2.);
1974 quality.push_back(Mu_quality);
1979 (*pL2[
m_hashFunc(frag)]).setMu(std::move(
eta), std::move(energy0),
1980 std::move(energy1), std::move(energy2), std::move(quality), std::move(word));
1987 int frag_id,
int )
const {
1991 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
1994 nDrawer[0] = frag & 0x3F;
1995 nDrawer[1] = (frag & 0xFC0) >> 6;
1999 for (
unsigned int i = 0; i < 2; ++i) {
2001 int fragId = (((frag & 0xF000) >> 4) | nDrawer[i]);
2003 float sumE = (float) ((int32_t) (*p) - 9000);
2004 (*pL2[
m_hashFunc(fragId)]).setEt(std::vector<float>{sumE});
2014 int frag_id,
int )
const {
2018 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
2022 std::vector<float> sumE(1);
2024 sumE[0] = (float) ((int32_t) (*p) - 9000);
2025 (*pL2[
m_hashFunc(frag)]).setEt(std::move(sumE));
2039 const uint32_t *pData;
2055 bool errorFlag =
false;
2057 if ((*pData & 0xFF000000) == 0x20000000) {
2061 reqAmp = *pData & 0xFFFF;
2065 reqAmp = *pData & 0xFFFF;
2070 filt = (((*pData >> 16) & 7) ^ 7) + 2;
2072 filt = 9 - (((*pData >> 17) & 1) * 4 + ((*pData >> 18) & 1) * 2 + ((*pData >> 19) & 1));
2075 if (((*pData >> 16) & 1) == 1) filt = 0;
2077 if (filt > 8) filt -= 8;
2092 if ((*pData & 0xFF000000) == 0x21000000) {
2094 measAmp = *pData & 0xFFF;
2109 if ((*pData & 0xFF000000) == 0x22000000) {
2113 tdc1 = (*pData >> 16) & 0xF;
2114 tdc2 = (*pData >> 20) & 0xF;
2117 tdc1 = *pData & 0xFFFF;
2133 if ((*pData & 0xFF000000) == 0x23000000) {
2137 tdc2 = (*pData >> 12) & 0xFFF;
2138 tdc1 = *pData & 0xFFF;
2142 tdc2 = *pData & 0xFFFF;
2158 if ((*pData & 0xFF000000) == 0x44000000) {
2160 chan0 = 4095 - (*pData & 0xFFF);
2161 chan1 = 4095 - ((*pData >> 12) & 0xFFF);
2174 if ((*pData & 0xFF000000) == 0x45000000) {
2176 chan2 = 4095 - (*pData & 0xFFF);
2177 chan3 = 4095 - ((*pData >> 12) & 0xFFF);
2190 if ((*pData & 0xFF000000) == 0x46000000) {
2192 chan4 = 4095 - (*pData & 0xFFF);
2193 chan5 = 4095 - ((*pData >> 12) & 0xFFF);
2206 if ((*pData & 0xFF000000) == 0x47000000) {
2219 int meanPed_diode1 = 0;
2220 int rmsPed_diode1 = 0;
2222 double MeanPed_diode1 = 0;
2223 double RmsPed_diode1 = 0;
2225 rmsPed_diode1 = *pData & 0xFFFF;
2226 meanPed_diode1 = (*pData >> 16) & 0xFFFF;
2228 MeanPed_diode1 =
static_cast<double>(meanPed_diode1) * 0.1;
2230 RmsPed_diode1 =
static_cast<double>(rmsPed_diode1) * 0.01;
2234 int meanPed_diode2 = 0;
2235 int rmsPed_diode2 = 0;
2237 double MeanPed_diode2 = 0;
2238 double RmsPed_diode2 = 0;
2240 rmsPed_diode2 = *pData & 0xFFFF;
2241 meanPed_diode2 = (*pData >> 16) & 0xFFFF;
2243 MeanPed_diode2 =
static_cast<double>(meanPed_diode2) * 0.1;
2245 RmsPed_diode2 =
static_cast<double>(rmsPed_diode2) * 0.01;
2249 int meanPed_diode3 = 0;
2250 int rmsPed_diode3 = 0;
2252 double MeanPed_diode3 = 0;
2253 double RmsPed_diode3 = 0;
2255 rmsPed_diode3 = *pData & 0xFFFF;
2256 meanPed_diode3 = (*pData >> 16) & 0xFFFF;
2258 MeanPed_diode3 =
static_cast<double>(meanPed_diode3) * 0.1;
2260 RmsPed_diode3 =
static_cast<double>(rmsPed_diode3) * 0.01;
2264 int meanPed_diode4 = 0;
2265 int rmsPed_diode4 = 0;
2267 double MeanPed_diode4 = 0;
2268 double RmsPed_diode4 = 0;
2270 rmsPed_diode4 = *pData & 0xFFFF;
2271 meanPed_diode4 = (*pData >> 16) & 0xFFFF;
2273 MeanPed_diode4 =
static_cast<double>(meanPed_diode4) * 0.1;
2275 RmsPed_diode4 =
static_cast<double>(rmsPed_diode4) * 0.01;
2279 int meanPed_pmt1 = 0;
2280 int rmsPed_pmt1 = 0;
2282 double MeanPed_pmt1 = 0;
2283 double RmsPed_pmt1 = 0;
2285 rmsPed_pmt1 = *pData & 0xFFFF;
2286 meanPed_pmt1 = (*pData >> 16) & 0xFFFF;
2288 MeanPed_pmt1 =
static_cast<double>(meanPed_pmt1) * 0.1;
2290 RmsPed_pmt1 =
static_cast<double>(rmsPed_pmt1) * 0.01;
2294 int meanPed_pmt2 = 0;
2295 int rmsPed_pmt2 = 0;
2297 double MeanPed_pmt2 = 0;
2298 double RmsPed_pmt2 = 0;
2300 rmsPed_pmt2 = *pData & 0xFFFF;
2301 meanPed_pmt2 = (*pData >> 16) & 0xFFFF;
2303 MeanPed_pmt2 =
static_cast<double>(meanPed_pmt2) * 0.1;
2305 RmsPed_pmt2 =
static_cast<double>(rmsPed_pmt2) * 0.01;
2309 time_t lastPedMeas = *pData;
2316 int meanAlpha_diode1 = 0;
2317 int rmsAlpha_diode1 = 0;
2319 double MeanAlpha_diode1 = 0;
2320 double RmsAlpha_diode1 = 0;
2322 rmsAlpha_diode1 = *pData & 0xFFFF;
2323 meanAlpha_diode1 = (*pData >> 16) & 0xFFFF;
2325 MeanAlpha_diode1 =
static_cast<double>(meanAlpha_diode1) * 0.1;
2327 RmsAlpha_diode1 =
static_cast<double>(rmsAlpha_diode1) * 0.01;
2331 int meanAlpha_diode2 = 0;
2332 int rmsAlpha_diode2 = 0;
2334 double MeanAlpha_diode2 = 0;
2335 double RmsAlpha_diode2 = 0;
2337 rmsAlpha_diode2 = *pData & 0xFFFF;
2338 meanAlpha_diode2 = (*pData >> 16) & 0xFFFF;
2340 MeanAlpha_diode2 =
static_cast<float>(meanAlpha_diode2) * 0.1;
2342 RmsAlpha_diode2 =
static_cast<float>(rmsAlpha_diode2) * 0.01;
2348 int meanAlpha_diode3 = 0;
2349 int rmsAlpha_diode3 = 0;
2351 double MeanAlpha_diode3 = 0;
2352 double RmsAlpha_diode3 = 0;
2354 rmsAlpha_diode3 = *pData & 0xFFFF;
2355 meanAlpha_diode3 = (*pData >> 16) & 0xFFFF;
2357 MeanAlpha_diode3 =
static_cast<double>(meanAlpha_diode3) * 0.1;
2359 RmsAlpha_diode3 =
static_cast<double>(rmsAlpha_diode3) * 0.01;
2363 int meanAlpha_diode4 = 0;
2364 int rmsAlpha_diode4 = 0;
2366 double MeanAlpha_diode4 = 0;
2367 double RmsAlpha_diode4 = 0;
2369 rmsAlpha_diode4 = *pData & 0xFFFF;
2370 meanAlpha_diode4 = (*pData >> 16) & 0xFFFF;
2372 MeanAlpha_diode4 =
static_cast<double>(meanAlpha_diode4) * 0.1;
2374 RmsAlpha_diode4 =
static_cast<double>(rmsAlpha_diode4) * 0.01;
2378 time_t lastAlphaMeas = *pData;
2455 double DiodeTemp = 0;
2457 diodeTemp = *pData & 0xFFF;
2458 seconds1 = (*pData >> 12) & 0xFFFFF;
2460 DiodeTemp =
static_cast<double>(diodeTemp) * 0.1;
2469 boxTemp = *pData & 0xFFF;
2470 seconds2 = (*pData >> 12) & 0xFFFFF;
2472 BoxTemp =
static_cast<double>(boxTemp) * 0.1;
2481 hum = *pData & 0xFFF;
2482 seconds3 = (*pData >> 12) & 0xFFFFF;
2484 Hum =
static_cast<double>(hum) * 0.1;
2493 gasFlow = *pData & 0xFFF;
2494 seconds4 = (*pData >> 12) & 0xFFFFF;
2496 GasFlow =
static_cast<double>(gasFlow) * 0.1;
2503 PLCstatus = *pData & 0xFFF;
2505 int alphaPos = PLCstatus & 0x7;
2506 int LVdiodes = (PLCstatus >> 0x3) & 0x1;
2507 int HVpmts = (PLCstatus >> 0x4) & 0x3;
2508 int shutter = (PLCstatus >> 0x6) & 0x3;
2509 int interLock = (PLCstatus >> 0x8) & 0x1;
2510 int alarm = (PLCstatus >> 0x9) & 0x7;
2512 laserObject.
setPmt(0, chan4, tdc1, MeanPed_pmt1, RmsPed_pmt1, 0);
2514 laserObject.
setPmt(1, chan5, tdc2, MeanPed_pmt2, RmsPed_pmt2, 0);
2516 laserObject.
setDiode(0, chan0, MeanPed_diode1, RmsPed_diode1, MeanAlpha_diode1, RmsAlpha_diode1, 0, 0, 0);
2518 laserObject.
setDiode(1, chan1, MeanPed_diode2, RmsPed_diode2, MeanAlpha_diode2, RmsAlpha_diode2, 0, 0, 0);
2520 laserObject.
setDiode(2, chan2, MeanPed_diode3, RmsPed_diode3, MeanAlpha_diode3, RmsAlpha_diode3, 0, 0, 0);
2522 laserObject.
setDiode(3, chan3, MeanPed_diode4, RmsPed_diode4, MeanAlpha_diode4, RmsAlpha_diode4, 0, 0, 0);
2524 laserObject.
setControl(DiodeTemp, seconds1, BoxTemp, seconds2, GasFlow, seconds4, Hum, seconds3, lastPedMeas, lastAlphaMeas);
2526 laserObject.
setLaser(counter, reqAmp, measAmp, filt, 0, 1);
2528 laserObject.
setPLC(alphaPos, LVdiodes, HVpmts, shutter, interLock, alarm);
2534 uint32_t sizeOverhead,
2548 int maxn=size+2-sizeOverhead;
2549 for(
int n=0; n<maxn; ++n){
2550 ATH_MSG_DEBUG(
"WORD " << n <<
" (" << n+11 <<
") : (DEC) " << p[n] <<
" (HEX) 0x" << MSG::hex << p[n] << MSG::dec );
2560 ATH_MSG_DEBUG(
"SETTING DAQ TYPE IN DECODER = " << MSG::hex <<
"0x" <<
int(p[2]) <<
" " << MSG::dec <<
int(p[2]));
2563 int idiode = (p[4]>>16);
2564 int intensity = (p[4]&0xFFFF);
2565 int filter = (p[5]>>16) & 0x000F;
2566 bool qdctimeout = !((p[5]>>31) & 0x1);
2567 bool tdctimeout = !((p[5]>>30) & 0x1);
2569 int timing = (p[5] & 0xFFFF);
2572 laserObject.
setLaser(countr, idiode, intensity, filter, timing, 2);
2573 laserObject.
setControl(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99);
2574 laserObject.
setPLC(-99,-99,-99,-99,-99,-99);
2582 ATH_MSG_DEBUG(
"laserObject.setLaser: " << MSG::dec <<
"COUNTER=" << countr <<
" | "
2583 <<
"I_DIODE=" << idiode <<
" | "
2584 <<
"FILTERN=" << filter <<
" | "
2585 <<
"TIMINGD=" << timing <<
" | "
2586 <<
"DAQTYPE=" << daqtyp );
2593 static const int HG=0;
2594 static const int LG=1;
2596 const uint32_t *word = p+7;
2601 las[adc++] = 8500 - ((*word) & 0xFFFF);
2602 las[adc++] = 8500 - ((*word) >> 16);
2607 int TDC0 = (*word) & 0xFFFF;
2608 int TDC1 = (*word) >> 16;
2616 double nevt = double(p[128]);
2617 if(p[128]==0 || (p[128]==3072 && p[32]<21504000) ) {
2619 ATH_MSG_DEBUG(
"Nevents= " << p[128] <<
" => assuming 1024");
2627 for(
int channel=0;channel<16;++channel) {
2636 sum[channel*2+HG] = *(word++);
2637 sum[channel*2+LG] = *(word++);
2639 uint32_t lsb0 = *(word++);
2640 uint32_t msb0 = *(word++);
2641 uint32_t lsb1 = *(word++);
2642 uint32_t msb1 = *(word++);
2643 uint64_t MSB0 = (uint64_t) msb0 << 32;
2644 uint64_t MSB1 = (uint64_t) msb1 << 32;
2645 uint64_t SSQ0 = MSB0 | lsb0;
2646 uint64_t SSQ1 = MSB1 | lsb1;
2648 ssq[channel*2+HG] = SSQ0;
2649 ssq[channel*2+LG] = SSQ1;
2652 ped[channel*2+HG] = double(sum[channel*2+HG])/nevt;
2653 ped[channel*2+LG] = double(sum[channel*2+LG])/nevt;
2655 std[channel*2+HG] = double(ssq[channel*2+HG])/nevt - ped[channel*2+HG]*ped[channel*2+HG];
2656 std[channel*2+LG] = double(ssq[channel*2+LG])/nevt - ped[channel*2+LG]*ped[channel*2+LG];
2657 if (
std[channel*2+HG]>0.0)
std[channel*2+HG] = sqrt(
std[channel*2+HG]);
2658 if (
std[channel*2+LG]>0.0)
std[channel*2+LG] = sqrt(
std[channel*2+LG]);
2665 laserObject.
setCalib(channel,
int(p[31]),
double(sum[channel*2+LG]),
double(ssq[channel*2+LG]), nevt,
TileID::LOWGAIN);
2666 laserObject.
setCalib(channel,
int(p[31]),
double(sum[channel*2+HG]),
double(ssq[channel*2+HG]), nevt,
TileID::HIGHGAIN);
2670 ATH_MSG_DEBUG(
"PED CHAN=" << channel <<
" GAIN=LG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::LOWGAIN,0) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::LOWGAIN,0) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::LOWGAIN,0) <<
" N=" << laserObject.
getN(channel,
TileID::LOWGAIN,0) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::LOWGAIN,0) );
2671 ATH_MSG_DEBUG(
"PED CHAN=" << channel <<
" GAIN=HG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::HIGHGAIN,0) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::HIGHGAIN,0) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::HIGHGAIN,0) <<
" N=" << laserObject.
getN(channel,
TileID::HIGHGAIN,0) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::HIGHGAIN,0) );
2673 ATH_MSG_DEBUG(
"PED CHAN=" << channel <<
" GAIN=LG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::LOWGAIN,1) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::LOWGAIN,1) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::LOWGAIN,1) <<
" N=" << laserObject.
getN(channel,
TileID::LOWGAIN,1) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::LOWGAIN,1) );
2674 ATH_MSG_DEBUG(
"PED CHAN=" << channel <<
" GAIN=HG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::HIGHGAIN,1) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::HIGHGAIN,1) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::HIGHGAIN,1) <<
" N=" << laserObject.
getN(channel,
TileID::HIGHGAIN,1) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::HIGHGAIN,1) );
2676 ATH_MSG_DEBUG(
"LED CHAN=" << channel <<
" GAIN=LG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::LOWGAIN,2) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::LOWGAIN,2) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::LOWGAIN,2) <<
" N=" << laserObject.
getN(channel,
TileID::LOWGAIN,2) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::LOWGAIN,2) );
2677 ATH_MSG_DEBUG(
"LED CHAN=" << channel <<
" GAIN=HG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::HIGHGAIN,2) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::HIGHGAIN,2) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::HIGHGAIN,2) <<
" N=" << laserObject.
getN(channel,
TileID::HIGHGAIN,2) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::HIGHGAIN,2) );
2679 ATH_MSG_DEBUG(
"ALP CHAN=" << channel <<
" GAIN=LG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::LOWGAIN,3) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::LOWGAIN,3) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::LOWGAIN,3) <<
" N=" << laserObject.
getN(channel,
TileID::LOWGAIN,3) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::LOWGAIN,3) );
2680 ATH_MSG_DEBUG(
"ALP CHAN=" << channel <<
" GAIN=HG" <<
" TYPE=" << laserObject.
getType(channel,
TileID::HIGHGAIN,3) <<
" MEAN=" << laserObject.
getMean(channel,
TileID::HIGHGAIN,3) <<
" SIGMA=" << laserObject.
getSigma(channel,
TileID::HIGHGAIN,3) <<
" N=" << laserObject.
getN(channel,
TileID::HIGHGAIN,3) <<
" isSet?=" << laserObject.
isSet(channel,
TileID::HIGHGAIN,3) );
2682 ATH_MSG_DEBUG(MSG::hex << msb0 <<
" + " << lsb0 <<
" => " << SSQ0 <<
2683 MSG::dec <<
" >>> D" << channel <<
"(HG)"
2685 << sum[channel*2+HG]
2688 << ped[channel*2+HG]
2690 << ssq[channel*2+HG]
2693 <<
std[channel*2+0]);
2694 ATH_MSG_DEBUG(MSG::hex << msb1 <<
" + " << lsb1 <<
" => " << SSQ1 <<
2695 MSG::dec <<
" >>> D" << channel <<
"(LG)"
2697 << sum[channel*2+LG]
2700 << ped[channel*2+LG]
2702 << ssq[channel*2+LG]
2705 <<
std[channel*2+LG]);
2708 ped[channel*2+0] = 8500. - ped[channel*2+0];
2709 ped[channel*2+1] = 8500. - ped[channel*2+1];
2714 memset(ped,0,
sizeof(ped));
2715 memset(
std,0,
sizeof(
std));
2719 for(
int channel=0;channel<16;++channel){
2720 ATH_MSG_DEBUG(
"HG CHANNEL " << channel <<
": sig=" << las[HG+channel*2] <<
" ped=" << ped[HG+channel*2] <<
"+/-" <<
std[HG+channel*2]);
2721 ATH_MSG_DEBUG(
"LG CHANNEL " << channel <<
": sig=" << las[LG+channel*2] <<
" ped=" << ped[LG+channel*2] <<
"+/-" <<
std[LG+channel*2]);
2726 ATH_MSG_DEBUG(
"SHORT FRAGMENT, size=" << p[0] <<
" type=0x" << MSG::hex << p[1] << MSG::dec);
2727 memset(ped,0,
sizeof(ped));
2728 memset(
std,0,
sizeof(
std));
2742 for(
int diode=0;diode<10;++diode){
2789 uint32_t sizeOverhead,
2797 uint32_t idAndType = *(p + 1);
2798 int bs_frag = idAndType & 0xFFFF;
2799 bool is16ChannelType = (idAndType >> 16) & 1;
2800 bool is32ChannelType = (idAndType >> 17) & 1;
2803 int datasize =
count - sizeOverhead;
2805 if (
msgLvl(MSG::VERBOSE)) {
2806 msg(MSG::VERBOSE) <<
"Unpacking Beam Elements, ID=0x" << MSG::hex << frag_id <<
" BS frag=0x" << bs_frag
2807 <<
", size=" << MSG::dec << datasize;
2808 for (
int ch = 0; ch < datasize; ++ch) {
2809 if (0 == ch % 8)
msg(MSG::VERBOSE) <<
endmsg;
2810 msg(MSG::VERBOSE) << p[ch] <<
" ";
2815 if (datasize <= 0)
return;
2817 int frag = (frag_id>=0) ? frag_id : bs_frag;
2829 if (!(is16ChannelType || is32ChannelType)) {
2830 uint32_t prev = 0xFF;
2831 std::vector<uint32_t> adc;
2832 for (
int c = 0; c < datasize; ++c) {
2833 uint32_t time = *p & 0xFFFF;
2834 uint32_t flag = *p >> 16;
2835 uint32_t chan = (flag >> 1) & 0x0F;
2836 uint32_t
bad = (flag >> 5) & 0x01;
2841 pBeam.push_back(
rc);
2846 adc.push_back(time);
2852 pBeam.push_back(
rc);
2864 uint32_t prev = 0xFF;
2865 std::vector<uint32_t> adc;
2866 for (
int c = 0; c < datasize; ++c) {
2867 uint32_t chan = is16ChannelType ? (*p >> 17) & 0x3FF
2868 : (*p >> 16) & 0x7FF;
2872 uint32_t time = *p & 0x1FFF;
2873 if (prev != chan && ((is16ChannelType && chan < 16) || (is32ChannelType && chan < 32))) {
2877 pBeam.push_back(
rc);
2882 adc.push_back(time);
2885 if ((is16ChannelType && prev < 16) || (is32ChannelType && prev < 32)) {
2888 pBeam.push_back(
rc);
2897 uint32_t val, channel[16][16];
2898 int nmodule = 4, nchan, nsamp, ch;
2900 nchan = nmodule * 4;
2901 nsamp = datasize / nmodule;
2904 <<
", nsamp=" << nsamp);
2906 if (nmodule * nsamp == datasize) {
2908 for (
int m = 0; m < nmodule; ++m) {
2910 for (
int s = 0; s < nsamp; ++s) {
2912 for (
int c = 0; c < 4; ++c) {
2915 channel[ch][s] = val & 0xFF;
2922 for (ch = 0; ch < nchan; ++ch) {
2924 std::vector<uint32_t> adc;
2926 for (
int s = 0; s < nsamp; ++s) {
2927 adc.push_back(channel[ch][s]);
2930 pBeam.push_back(
rc);
2939#ifndef LASER_OBJ_FRAG
2940#define LASER_OBJ_FRAG 0x016
2942#ifndef LASER2_OBJ_FRAG
2943#define LASER2_OBJ_FRAG 0x017
2949 std::vector<uint32_t> digits;
2950 for (
int ch = 0; ch < datasize; ++ch) {
2951 digits.push_back((*p));
2956 pBeam.push_back(
rc);
2965 if (is16ChannelType || is32ChannelType) {
2966 uint32_t prev = 0xFF;
2967 std::vector<uint32_t> adc;
2968 for (
int c = 0; c < datasize; ++c) {
2969 uint32_t chan = is16ChannelType ? (*p >> 17) & 0x3FF
2970 : (*p >> 16) & 0x7FF;
2975 uint32_t amplitude = *p & 0x1FFF;
2976 if (prev != chan && ((is16ChannelType && chan < 16) || (is32ChannelType && chan < 32))) {
2980 pBeam.push_back(
rc);
2985 adc.push_back(amplitude);
2988 if ((is16ChannelType && prev < 16) || (is32ChannelType && prev < 32)) {
2991 pBeam.push_back(
rc);
3003 int chmax = (datasize > 16) ? 15 : datasize;
3004 for (
int ch = 0; ch < chmax; ++ch) {
3007 pBeam.push_back(
rc);
3010 if (chmax != datasize) {
3011 std::vector<uint32_t> digits;
3012 for (
int ch = chmax; ch < datasize; ++ch) {
3013 digits.push_back((*p));
3018 pBeam.push_back(
rc);
3032 ATH_MSG_FATAL(
"RawEvent passed to 'convert'-function is a null pointer!" );
3033 return StatusCode::FAILURE;
3040 uint32_t total_sub =
re->nchildren();
3042 if (
msgLvl(MSG::VERBOSE)) {
3043 msg(MSG::VERBOSE) <<
"Full Event: " <<
endmsg;
3044 msg(MSG::VERBOSE) << MSG::hex <<
"Full source ID: " <<
re->source_id()
3046 msg(MSG::VERBOSE) <<
"Fragment size in words: " <<
re->fragment_size_word() <<
endmsg;
3047 msg(MSG::VERBOSE)<<
"# of rob frags: " << total_sub <<
endmsg;
3050 for (uint32_t i_rob = 0; i_rob < total_sub; ++i_rob) {
3051 const uint32_t* p_rob;
3052 re->child(p_rob, i_rob);
3055 eformat::helper::SourceIdentifier
id = eformat::helper::SourceIdentifier(robFrag.source_id());
3056 unsigned int subDetId =
id.subdetector_id();
3058 if (subDetId >= 0x50 && subDetId < 0x60) {
3065 if (
msgLvl(MSG::VERBOSE)) {
3066 msg(MSG::VERBOSE) <<
"convertL2: " << L2Cnt->
size()
3067 <<
" TileL2 objects created" <<
endmsg;
3072 for (; ind != last; ++ind) {
3073 msg(MSG::VERBOSE) <<
"Ind " << num++ <<
" " << (std::string) (*(*ind)) <<
endmsg;
3077 return StatusCode::SUCCESS;
3081 uint32_t version = rob->rod_version() & 0xFFFF;
3086 const uint32_t * p =
get_data(rob);
3087 int fragmin = 0xFFF, fragmax = -1;
3091 uint32_t sizeOverhead = 2;
3093 bool V3format = (*(p) == 0xff1234ff);
3094 if (!V3format && version>0xff) {
3097 ATH_MSG_WARNING(
"fillCollectionL2( corrupted frag separator 0x" << MSG::hex << (*p) <<
" instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec );
3113 uint32_t
count = *(p);
3115 uint32_t idAndType = *(p + 1);
3116 uint32_t bs_frag_id = idAndType & 0xFFFF;
3117 int frag = hid2re->getOfflineFragID(bs_frag_id);
3118 if (frag<0) frag = bs_frag_id;
3119 const std::vector<uint32_t> & drawer_info = hid2re->getDrawerInfo(frag);
3120 int drawer_type = drawer_info.size()>2 ?
static_cast<int>(drawer_info[2]) : -1;
3121 if (frag < fragmin) fragmin = frag;
3122 if (frag > fragmax) fragmax = frag;
3123 DataType = (idAndType & 0x30000000) >> 28;
3125 int type = (*(p + 1) >> 16) & 0xFF;
3129 for (; wc < size; ++wc, ++cnt, ++p) {
3130 if ((*p) == 0xff1234ff) {
3138 msg(MSG::WARNING) <<
"Frag " << MSG::hex <<
"0x" << frag
3139 << MSG::dec <<
" has unexpected size: " <<
count;
3141 msg(MSG::WARNING) <<
" skipping " << cnt <<
" words to the next frag" <<
endmsg;
3143 msg(MSG::WARNING) <<
" ignoring " << cnt <<
" words till the end of ROD frag" <<
endmsg;
3151 if (
unpack_frag4L2(version, sizeOverhead, p, v, frag, drawer_type)) {
3161 }
else if ((
type >> 4) == 1) {
3187 int frag = *(p + 1) & 0xFFFF;
3188 ATH_MSG_WARNING(
"Unknown frag type=" <<
type <<
" for frag=" << frag <<
" bs_frag=" << bs_frag_id);
3201 ATH_MSG_WARNING(
"Incorrect ROD size: " << wc <<
" words instead of " << size );
3208 if (
m_L2Builder->process(fragmin, fragmax, &v).isFailure()) {
3220 const uint32_t * p =
get_data(rob);
3221 const uint32_t ROB_to_decode = ((*p) & 0xFFFF);
3222 const uint32_t virtualROBJump = ((*p) >> 16) >> 2;
3223 if (size < ROB_to_decode * virtualROBJump + 1) {
3225 <<
"; virtualROBJump=" << virtualROBJump
3226 <<
"; ROB_to_decode=" << ROB_to_decode );
3233 std::vector<float> sumE(3, 0.0);
3234 uint32_t idAndType, bs_frag_id;
3235 int frag, hash,
unit;
3237 for (
size_t irob = 0; irob < ROB_to_decode; ++irob) {
3238 for (
size_t drawInRob = 0; drawInRob < virtualROBJump; ++drawInRob) {
3241 bs_frag_id = idAndType & 0xFFF;
3242 frag = hid2re->getOfflineFragID(bs_frag_id);
3243 if (frag<0) frag = bs_frag_id;
3247 unit = (idAndType >> (32 - 2)) & 0x3;
3252 (v[hash])->setEt(std::vector<float>(sumE));
3268 ATH_MSG_FATAL(
"RawEvent passed to 'convert'-function is a null pointer!" );
3269 return StatusCode::FAILURE;
3276 uint32_t total_sub =
re->nchildren();
3278 if (
msgLvl(MSG::VERBOSE)) {
3279 msg(MSG::VERBOSE) <<
"Full Event: " <<
endmsg;
3280 msg(MSG::VERBOSE) << MSG::hex <<
"Full source ID: " <<
re->source_id() << MSG::dec <<
endmsg;
3281 msg(MSG::VERBOSE) <<
"Fragment size in words: " <<
re->fragment_size_word() <<
endmsg;
3282 msg(MSG::VERBOSE) <<
"# of rob frags: " << total_sub <<
endmsg;
3285 for (uint32_t i_rob = 0; i_rob < total_sub; ++i_rob) {
3286 const uint32_t* p_rob;
3287 re->child(p_rob, i_rob);
3290 eformat::helper::SourceIdentifier
id = eformat::helper::SourceIdentifier(
3291 robFrag.rod_source_id());
3292 unsigned int subDetId =
id.subdetector_id();
3294 if (subDetId >= 0x50 && subDetId < 0x60) {
3299 return StatusCode::SUCCESS;
3305 uint32_t version = rob->rod_version() & 0xFFFF;
3310 const uint32_t * p =
get_data(rob);
3314 " size = " << size <<
3315 " pointer = " << p );
3322 uint32_t sizeOverhead = 2;
3323 bool V3format = (*(p) == 0xff1234ff);
3324 if (!V3format && version>0) {
3327 ATH_MSG_WARNING(
"fillTileLaserObj: corrupted frag separator 0x" << MSG::hex << (*p) <<
" instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec );
3336 if(V3format)
ATH_MSG_DEBUG(
"tile flag found! size overhead = " << sizeOverhead);
3337 else ATH_MSG_DEBUG(
"tile flag not found! size overhead = " << sizeOverhead);
3341 uint32_t
count = *(p);
3343 int frag = *(p + 1) & 0xFFFF;
3344 int type = *(p + 1) >> 16;
3346 ATH_MSG_DEBUG( wc <<
" / " << size <<
" HEX = 0x" << MSG::hex <<
count <<
" DEC = " << MSG::dec <<
count <<
" ( FRAG , TYPE ) = " << frag <<
" , " <<
type );
3350 for (; wc < size; ++wc, ++cnt, ++p) {
3351 if ((*p) == 0xff1234ff) {
3352 ATH_MSG_DEBUG(
"DATA POINTER: HEX = " << MSG::hex << (*p) <<
" DEC = " << MSG::dec << (*p) );
3360 msg(MSG::WARNING) <<
"Frag: " << MSG::hex <<
"0x" << frag << MSG::dec
3361 <<
" has unexpected size: " <<
count;
3363 msg(MSG::WARNING) <<
" skiping " << cnt <<
" words to the next frag" <<
endmsg;
3365 msg(MSG::WARNING) <<
" ignoring " << cnt <<
" words till the end of ROD frag" <<
endmsg;
3371 ATH_MSG_DEBUG(
"DECODER" <<
" " <<
"FRAG=" << frag <<
" TYPE=" <<
type <<
" SIZE=" << size <<
" FOUND!" );
3373 if (frag == 0x16 &&
type == 0x20){
3375 const int LASTROD_BCID = rob->rod_bc_id();
3376 v.setBCID(LASTROD_BCID);
3381 }
else if (size>24) {
3387 if (frag == 0x17 &&
type == 0x20){
3389 const int LASTROD_BCID = rob->rod_bc_id();
3390 v.setBCID(LASTROD_BCID);
3403 ATH_MSG_WARNING(
"Incorrect ROD size: " << wc <<
" words instead of " << size );
3416 uint32_t version = rob->rod_version() & 0xFFFF;
3418 uint32_t
error = 0x0;
3422 const std::vector<uint32_t> & drawer_info = hid2reHLT->
getDrawerInfo(frag_id);
3423 int bs_frag_id = drawer_info.size()>1 ?
static_cast<int>(drawer_info[1]) : frag_id;
3424 int drawer_type = drawer_info.size()>2 ?
static_cast<int>(drawer_info[2]) : -1;
3435 const uint32_t * p =
get_data(rob);
3437 uint16_t rob_bcid = ((rob->rod_bc_id() & 0x7FFF) | 0x8000);
3439 uint32_t sizeOverhead = 2;
3441 bool V3format = (*(p) == 0xff1234ff);
3442 if (!V3format && version>0xff) {
3445 ATH_MSG_WARNING(
"fillCollectionHLT: corrupted frag separator 0x" << MSG::hex << (*p) <<
" instead of 0xff1234ff in ROB 0x" << rob->rod_source_id() << MSG::dec );
3455 bool correctAmplitude =
false;
3457 uint16_t DQuality = 0x0;
3458 bool fragFound =
false;
3459 bool DQfragMissing =
true;
3467 uint32_t
count = *(p);
3469 uint32_t idAndType = *(p + 1);
3470 int frag = (idAndType & 0xFFFF);
3471 int type = (idAndType & 0xFF0000) >> 16;
3475 for (; wc < size; ++wc, ++cnt, ++p) {
3476 if ((*p) == 0xff1234ff) {
3484 msg(MSG::WARNING) <<
"Frag: " << MSG::hex <<
"0x" << frag << MSG::dec
3485 <<
" has unexpected size: " <<
count;
3487 msg(MSG::WARNING) <<
" skipping " << cnt <<
" words to the next frag" <<
endmsg;
3489 msg(MSG::WARNING) <<
" ignoring " << cnt <<
" words till the end of ROD frag" <<
endmsg;
3497 if (frag == bs_frag_id) {
3502 DQfragMissing =
false;
3503 correctAmplitude =
false;
3504 unpack_frag2HLT(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
3508 DQfragMissing =
false;
3509 correctAmplitude =
false;
3510 unpack_frag3HLT(version, sizeOverhead, p, pChannel, frag_id, drawer_type);
3515 int unit = (idAndType & 0xC0000000) >> 30;
3517 int DataType = (idAndType & 0x30000000) >> 28;
3521 of2 = ((idAndType & 0x4000000) != 0);
3522 int nIter = (idAndType & 0x3000000) >> 24;
3523 correctAmplitude = (!nIter);
3528 DQfragMissing =
false;
3529 correctAmplitude =
false;
3532 const_cast<Gaudi::Property<std::vector<int>
> &> (
m_demoFragIDs ) = {};
3533 ATH_MSG_INFO(
"Disable channel remapping for demonstrator in MC");
3544 int unit = (idAndType & 0xC0000000) >> 30;
3546 of2 = ((idAndType & 0x4000000) != 0);
3547 correctAmplitude =
true;
3555 DQfragMissing =
false;
3556 unpack_fragAHLT(version, p, rob_bcid, DQuality, frag_id, drawer_type);
3570 if (DQfragMissing && !masked_drawer)
error |= 0x40000;
3573 if (masked_drawer) DQuality = 0x0;
3575 pChannel, v, DQuality, d0cells, MBTS);
3576 }
else if (!masked_drawer)
error |= 0x20000;
3583 bool correctAmplitude,
3586 const uint16_t DQuality,
3590 typedef FRwChVec::const_iterator ITERATOR;
3592 float ener, time, qual = 0;
3594 std::vector<TileCell*> cell2Double;
3595 cell2Double.reserve(23);
3599 if (DQuality == 0xffff)
error |= 0x80000;
3602 int ros = (frag_id >> 8);
3603 int drawer = (frag_id & 0x3F);
3605 unsigned int channelIdx;
3606 unsigned int adcIdx;
3611 if (pChannel.size() > 0) {
3625 cell->setTime_nonvirt(-100.0F);
3626 cell->setQuality_nonvirt(
static_cast<unsigned char>(255), 0, 0);
3627 cell->setQuality_nonvirt(
static_cast<unsigned char>(255), 0, 1);
3633 ITERATOR rawItr = pChannel.begin();
3634 ITERATOR end = pChannel.end();
3638 channelIdx = rawItr->channel();
3639 bool no_dmu_mask =
true;
3641 if (DQuality >> (channelIdx / 3) & 0x1) no_dmu_mask =
false;
3644 adcIdx = rawItr->adc();
3645 qual = rawItr->quality();
3646 bool do_mask =
false;
3648 ener = rawItr->amplitude();
3649 time = rawItr->time();
3652 if (recalibrate && ener!=0.0F) {
3653 ener =
m_tileToolEmscale->channelCalib(drawerIdx, channelIdx, adcIdx, ener, rChUnit,
3657 if (correctAmplitude) {
3675 d0cells.
m_D0channeg[drawer].
set(channelIdx, adcIdx, ener, time, qual);
3679 d0cells.
m_D0chanpos[drawer].
set(channelIdx, adcIdx, ener, time, qual);
3687 int MBTS_chan=((ros>2)?-1:43);
3689 for (; rawItr != end; ++rawItr) {
3691 const int rw2cell =
m_Rw2Cell[sec][idxraw];
3692 if (rw2cell != -1) {
3695 channelIdx = rawPtr->
channel();
3696 bool no_dmu_mask =
true;
3698 if (DQuality >> (channelIdx / 3) & 0x1) no_dmu_mask =
false;
3700 adcIdx = rawPtr->
adc();
3706 time = rawPtr->
time();
3709 if (recalibrate && ener!=0.0F) {
3710 ener =
m_tileToolEmscale->channelCalib(drawerIdx, channelIdx, adcIdx, ener, rChUnit,
3714 if (correctAmplitude) {
3737 cell2Double.push_back(pCell);
3743 }
else if (MBTS_chan<0) MBTS_chan=rawPtr->
channel();
3753 if (MBTS && MBTS_chan >= 0) {
3755 unsigned int idx = it !=
m_mapMBTS.end() ? it->second : 0u;
3756 if (idx < (*MBTS).size()) {
3760 adcIdx = rawCh.
adc();
3762 float time = rawCh.
time();
3773 if (correctAmplitude) {
3798 for (std::vector<TileCell*>::const_iterator d_it = cell2Double.begin();
3799 d_it != cell2Double.end(); ++d_it) {
3803 int gain = (*d_it)->gain1() | (*d_it)->gain2();
3804 unsigned char qual = (*d_it)->qual1() & (*d_it)->qual2();
3806 float ener = (*d_it)->e();
3807 float time = (*d_it)->time();
3810 (*d_it)->setEnergy_nonvirt(ener, ener, gain, gain);
3811 (*d_it)->setQuality_nonvirt(qual, qbit, 0);
3812 (*d_it)->setQuality_nonvirt(qual, qbit, 1);
3813 if (time == -100.0F) (*d_it)->setTime_nonvirt(0.0F);
3820 unsigned sizeOverhead,
3829 int wc = sizeOverhead;
3832 unsigned int w = (*p);
3836 pChannel.emplace_back(ch
3843 pChannel.emplace_back(ch, 1U, 0.0F, 0.0F, 0.0F);
3862 uint32_t sizeOverhead,
3878 const uint32_t* pMap = p + 2;
3880 const short* p16 =
reinterpret_cast<const short *
>(p);
3883 short wc16 = 4 + sizeOverhead * 2;
3885 for (
unsigned int ch = 0U; ch < 48U; ++ch) {
3888 pChannel.emplace_back(ch
3906 pChannel.emplace_back(ch, 1U, 0.0F, 0.0F, 0.0F);
3910 if (wc16 % 2 == 1) {
3914 if (wc16 != 2 *
count) {
3918 << wc16 <<
" != 2*" <<
count );
3928 uint32_t sizeOverhead,
3932 int frag_id,
int drawer_type)
const
3937 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
3942 int wc = sizeOverhead;
3944 unsigned int ch1 = (
remap) ? chmap[ch] : ch;
3945 unsigned int w = (*p);
3947 pChannel.emplace_back(ch1
3954 pChannel.emplace_back(ch1, 1U, 0.0F, 0.0F, 0.0F);
3965 << wc <<
" != " <<
count );
3975 uint32_t sizeOverhead,
3979 int frag_id,
int drawer_type)
const
3984 int frag = (frag_id>0) ? frag_id : *(p + 1) & 0xFFFF;
3987 int size_L2 = (*(p + 1) >> (32 - 2 - 3)) & 0x7;
3990 int wc = sizeOverhead;
3991 const uint16_t* ptr_bad =
reinterpret_cast<const uint16_t*
> (p + 48 + size_L2);
3992 uint16_t bad_bits[3] = { ptr_bad[1], ptr_bad[0], ptr_bad[3] };
3995 int fmt,
bad, gain(0), ene_bin(0), time_bin(0), quality;
3997 float ene(0.0), time(0.0);
3999 unsigned int ch = 0U;
4000 for (
unsigned int i = 0U; i < 3U; ++i) {
4001 uint16_t bad16 = ~bad_bits[i];
4002 for (
unsigned int j = 0U; j < 16U; ++j) {
4011 bad = (bad16 & 0x1);
4014 unsigned int ch1 = (
remap) ? chmap[ch] : ch;
4015 pChannel.emplace_back(ch1, gain, ene, time, quality);
4028 << wc <<
" != " <<
count );
4038 uint32_t sizeOverhead,
4041 int frag_id,
int )
const {
4045 uint32_t idAndType = *(p + 1);
4046 int frag = (frag_id>0) ? frag_id : idAndType & 0xFFFF;
4047 int unit = (idAndType >> (32 - 2)) & 0x3;
4049#ifdef DO_NOT_USE_MUON_TAG
4064 int size_L2 = size - sizeOverhead - 48;
4067 std::vector<float> sumE;
4068 sumE.reserve(size_L2);
4072 (*pL2[
m_hashFunc(frag)]).setEt(std::move(sumE));
4084 int frag_id,
int )
const {
4086 uint32_t idAndType = *(p + 1);
4087 int frag = (frag_id>0) ? frag_id : idAndType & 0xFFFF;
4088 int unit = (idAndType >> (32 - 2)) & 0x3;
4089 int size_L2 = (idAndType >> (32 - 2 - 3)) & 0x7;
4091#ifdef DO_NOT_USE_MUON_TAG
4104 int drawer = (frag & 0x3F);
4105 int ros = (frag >> 8);
4113 uint16_t* ptr_bad = (uint16_t*)(p + 48 + size_L2);
4114 uint16_t bad_bits[3] = {ptr_bad[1], ptr_bad[0], ptr_bad[3]};
4117 int fmt, gain(0), ene_bin(0), time_bin(0);
4119 float ene(0.0), time(0.0);
4122 for (
int i = 0; i < 3; ++i) {
4123 uint16_t bad16 = ~bad_bits[i];
4124 for (
int j = 0; j < 16; ++j) {
4133 bad[ch] = (bad16 & 0x1); bad16 >>= 1;
4145 std::vector<double> EtaMuons;
4146 std::vector<double> EMuons0;
4147 std::vector<double> EMuons1;
4148 std::vector<double> EMuons2;
4149 std::vector<unsigned int> qf;
4150 std::vector<unsigned int> word;
4153 case TileHWID::BARREL_POS:
m_L2Builder->MTagLB(ros,drawer,E_MeV,Gain,
bad,EtaMuons,EMuons0,EMuons1,EMuons2,qf,word);
break;
4154 case TileHWID::BARREL_NEG:
m_L2Builder->MTagLB(ros,drawer,E_MeV,Gain,
bad,EtaMuons,EMuons0,EMuons1,EMuons2,qf,word);
break;
4155 case TileHWID::EXTBAR_POS:
m_L2Builder->MTagEB(ros,drawer,E_MeV,Gain,
bad,EtaMuons,EMuons0,EMuons1,EMuons2,qf,word);
break;
4156 case TileHWID::EXTBAR_NEG:
m_L2Builder->MTagEB(ros,drawer,E_MeV,Gain,
bad,EtaMuons,EMuons0,EMuons1,EMuons2,qf,word);
break;
4157 default:
ATH_MSG_WARNING(
"unpack_frag5L2: incorrect ros value: " << ros );
4160 (*pL2[
m_hashFunc(frag)]).setMu(std::move(EtaMuons), std::move(EMuons0),
4161 std::move(EMuons1), std::move(EMuons2), std::move(qf), std::move(word));
4167 std::vector<float> sumE;
4168 sumE.reserve(size_L2);
4172 (*pL2[
m_hashFunc(frag)]).setEt(std::move(sumE));
4183 for (
int i = 0; i < 64; ++i) {
4196 int ros = (frag_id >> 8);
4197 bool barrel ( (ros==1) || (ros==2) );
4199 int drawer = (frag_id & 0xFF);
4201 if ( !pCell )
return;
4206 (pCell)->setEnergy_nonvirt(0.0F, 0.0F, 0, 0);
4207 (pCell)->setTime_nonvirt(0.0F);
4208 (pCell)->setQuality_nonvirt(
static_cast<unsigned char>(255), 0, 0);
4209 (pCell)->setQuality_nonvirt(
static_cast<unsigned char>(255), 0, 1);
4220 (pCell)->setEnergy(amp2, amp2, gain2, gain2);
4221 (pCell)->setTime(time2);
4222 (pCell)->setQuality(qual2, qbit2, 0);
4223 (pCell)->setQuality(qual2, qbit2, 1);
4237 (pCell)->setEnergy(amp1, amp1, gain1, gain1);
4238 (pCell)->setTime(time1);
4239 (pCell)->setQuality(qual1, qbit1, 0);
4240 (pCell)->setQuality(qual1, qbit1, 1);
4252 (pCell)->setEnergy(amp1, amp2, gain1, gain2);
4253 (pCell)->setTime(time1);
4254 (pCell)->setTime(time2, 1);
4255 (pCell)->setQuality(qual1, qbit1, 0);
4256 (pCell)->setQuality(qual2, qbit2, 1);
4276 SmartIF<IProperty> propertyServer{service(
"ByteStreamCnvSvc")};
4277 if (propertyServer) {
4279 std::vector<std::string> vecProp;
4280 StringArrayProperty vecProperty(
"ROD2ROBmap", vecProp);
4282 if (propertyServer->getProperty(&vecProperty).isSuccess()) {
4284 if (vecProperty.value().size() % 2 == 1) {
4286 <<
" means that we'll scan event for all fragments to create proper map" );
4288 SmartIF<IROBDataProviderSvc> robSvc{service(
"ROBDataProviderSvc")};
4290 const eformat::FullEventFragment<const uint32_t*> *
event = robSvc->getEvent(Gaudi::Hive::currentContext());
4292 event->check_tree();
4295 ATH_MSG_DEBUG(
"Bad event, mapping might be incomplete! " );
4300 }
else if (vecProperty.value().size() == 0) {
4302 <<
" means that predefined mapping for run " <<
m_fullTileRODs <<
" will be used " );
4304 ATH_MSG_DEBUG(
"Apply additional remapping for " << vecProperty.value().size()/2 <<
" fragments from jobOptions ");
4305 m_hid2re->setROD2ROBmap(vecProperty.value(),
msg());
4326 <<
" => assume unit=" << (
unit & 3) );
4331 size_t id = (drawerIdx << 2 |
unit);
4332 const uint32_t* ofptr = m_OFPtrs[id];
4338 ofptr = m_OFPtrs[id];
4343 const EventContext &ctx = Gaudi::Hive::currentContext();
4345 std::vector<uint32_t>& ofw = m_OFWeights[id];
4347 ATH_MSG_DEBUG(
"getOFC fragId: 0x" << MSG::hex << fragId << MSG::dec <<
" Unit: " <<
unit);
4352 std::vector<double>
a(7), b(7), c(7), g(7), dg(7);
4354 for (
int ch = 0; ch < 48; ++ch) {
4355 for (
int gain = 0; gain < 2; ++gain) {
4364 double calib =
m_tileToolEmscale->channelCalibOnl(drawerIdx, ch, gain, 1.0, chan_unit);
4366 if (
unit != 0 && gain) calib *= 64.0;
4368 for (
int i = 0; i < 7; ++i) {
4385 ofptr = m_OFPtrs[id] = ofw.data();
4400 ATH_MSG_DEBUG(
" TileROD_Decoder::fillCollection_TileMuRcv_Digi " );
4404 bool b_digiTmdb =
false;
4406 uint32_t version = rob->rod_version() & 0xFFFF;
4407 uint32_t sourceid = rob->rod_source_id();
4408 int size = rob->rod_ndata();
4410 uint32_t sfrag_version = 0x0;
4411 uint32_t sfrag_type = 0x0;
4416 ATH_MSG_DEBUG(
" Trying DECODER over source ID: "<<MSG::hex<<
" 0x"<<sourceid<<MSG::dec<<
" size of full fragment: "<<size );
4418 while ( wc < size ) {
4420 if ((*p) == 0xff1234ff) b_sof=
true;
4422 ATH_MSG_DEBUG(
" Start of sub-fragment word: "<<MSG::hex<<(*p)<<MSG::dec<<
" false/true: "<<b_sof );
4426 sfrag_size = *(p+1);
4428 sfrag_version = *(p+2) & 0xFFFF;
4429 sfrag_type = *(p+2) >> 16;
4433 if (sfrag_type==0x40) {
4435 ATH_MSG_DEBUG( MSG::hex<<
" DECODER sub-fragment VERSION= 0x"<<sfrag_version<<
" TYPE= 0x"<<sfrag_type<< MSG::dec<<
" SIZE="<<sfrag_size<<
" FOUND! " );
4460 ATH_MSG_DEBUG(
" TileROD_Decoder::fillCollection_TileMuRcv_RawChannel " );
4464 bool b_rcTmdb =
false;
4466 uint32_t version = rob->rod_version() & 0xFFFF;
4467 uint32_t sourceid = rob->rod_source_id();
4468 int size = rob->rod_ndata();
4471 uint32_t sfrag_version = 0x0;
4472 uint32_t sfrag_type = 0x0;
4477 ATH_MSG_DEBUG(
" Trying DECODER over source ID: "<<MSG::hex<<
" 0x"<<sourceid<<MSG::dec<<
" size of full fragment: "<<size );
4479 while ( wc < size ) {
4481 if ((*p) == 0xff1234ff) b_sof=
true;
4482 ATH_MSG_DEBUG(
" Start of sub-fragment word : "<<MSG::hex<< (*p)<<MSG::dec<<
" false/true : "<<b_sof );
4486 sfrag_size = *(p+1);
4488 sfrag_version = *(p+2) & 0xFFFF;
4489 sfrag_type = *(p+2) >> 16;
4496 if (sfrag_type==0x40) {
4497 ATH_MSG_DEBUG(MSG::hex<<
" DECODER sub-fragment VERSION= 0x"<<sfrag_version<<
" TYPE= 0x"<<sfrag_type<<MSG::dec<<
" SIZE="<<sfrag_size<<
" FOUND! Keep on looking for 0x41.");
4498 offset = sfrag_size;
4501 }
else if (sfrag_type==0x41) {
4503 ATH_MSG_DEBUG(MSG::hex<<
" DECODER sub-fragment VERSION= 0x"<<sfrag_version<<
" TYPE= 0x"<<sfrag_type<<MSG::dec<<
" SIZE="<<sfrag_size<<
" FOUND!");
4508 ATH_MSG_DEBUG(MSG::hex<<
" DECODER sub-fragment VERSION= 0x"<<sfrag_version<<
" TYPE= 0x"<<sfrag_type<<MSG::dec<<
" SIZE="<<sfrag_size<<
" FOUND!");
4530 ATH_MSG_DEBUG(
"TileROD_Decoder::fillCollection_FELIX_Digi" );
4532 uint32_t version = rob->rod_version() & 0xFFFF;
4533 uint32_t sizeOverhead = 3;
4547 const uint32_t*
const end_data =
data + size;
4550 const std::vector<uint32_t> & drawer_info = hid2re->getDrawerInfo(frag_id);
4551 int bs_frag_id = drawer_info.size()>1 ?
static_cast<int>(drawer_info[1]) : frag_id;
4552 int drawer_type = drawer_info.size()>2 ?
static_cast<int>(drawer_info[2]) : -1;
4554 while (
data < end_data) {
4556 if ((*
data) == 0xff1234ff) {
4558 uint32_t idAndType = *(
data + 2);
4559 int frag = (idAndType & 0x0FFF);
4560 int type = (idAndType>>16)& 0xFF;
4561 if (
type == 0x06 && (frag == bs_frag_id)) {
4563 ATH_MSG_DEBUG( MSG::hex <<
"Found FELIX sub-fragment ID=0x" << frag
4564 <<
" type=0x" <<
type << MSG::dec
4565 <<
" size=" <<
count );
4567 unpack_frag6(version, sizeOverhead, digitsMetaData, correct_data.data(), pDigits, frag_id, drawer_type);
4570 digitsMetaData[0].push_back(
count);
4571 digitsMetaData[0].push_back(frag);
4572 digitsMetaData[0].push_back(0);
4582 uint32_t bsflags = 0;
4586 make_copy(bsflags, rChType, rChUnit, digitsMetaData, rawchannelMetaData,
4587 rob, pDigits, pChannel, coll,
nullptr);
4599 ATH_MSG_FATAL(
"RawEvent passed to 'convert'-function is a null pointer!" );
4600 return StatusCode::FAILURE;
4603 uint32_t total_sub =
re->nchildren();
4605 for (uint32_t i_rob = 0; i_rob < total_sub; ++i_rob) {
4606 const uint32_t* p_rob;
4607 re->child(p_rob, i_rob);
4611 uint32_t sourceid = robFrag.source_id();
4612 uint32_t modid = sourceid >> 16;
4615 if ((modid == 0x51 || modid == 0x52 || modid == 0x53 || modid == 0x54) && (sourceid & 0xf00)) {
4620 return StatusCode::SUCCESS;
4625 ATH_MSG_DEBUG(
"TileROD_Decoder::fillContainer_TileMuRcv_Decision" );
4629 bool b_deciTmdb =
false;
4631 uint32_t version = rob->rod_version() & 0xFFFF;
4632 uint32_t sourceid = rob->rod_source_id();
4633 int size = rob->rod_ndata();
4636 uint32_t sfrag_version = 0x0;
4637 uint32_t sfrag_type = 0x0;
4641 std::vector<const uint32_t *> pFragTmdb;
4643 ATH_MSG_DEBUG(
" Trying DECODER over source ID: " << MSG::hex
4644 <<
" 0x" << sourceid << MSG::dec
4645 <<
" full fragment size " << size );
4647 while ( wc < size ) {
4649 if ((*p) == 0xff1234ff) b_sof=
true;
4651 ATH_MSG_DEBUG(
" start of sub-fragment word : " << MSG::hex << (*p) << MSG::dec <<
" false/true : " << b_sof );
4655 sfrag_size = *(p + 1);
4657 sfrag_version = *(p + 2) & 0xFFFF;
4658 sfrag_type = *(p + 2) >> 16;
4664 if (sfrag_type == 0x40) {
4665 ATH_MSG_DEBUG( MSG::hex <<
" DECODER sub-fragment VERSION=" << sfrag_version
4666 <<
" TYPE=" << sfrag_type << MSG::dec
4667 <<
" SIZE=" << sfrag_size
4668 <<
" FOUND! Keep on looking for 0x42.");
4669 offset = sfrag_size;
4672 }
else if (sfrag_type == 0x41) {
4673 ATH_MSG_DEBUG( MSG::hex <<
" DECODER sub-fragment VERSION=" << sfrag_version
4674 <<
" TYPE=" << sfrag_type << MSG::dec
4675 <<
" SIZE=" << sfrag_size
4676 <<
" FOUND! Keep on looking for 0x42.");
4677 offset = sfrag_size;
4680 }
else if (sfrag_type == 0x42) {
4682 ATH_MSG_DEBUG( MSG::hex <<
" DECODER sub-fragment VERSION=" << sfrag_version
4683 <<
" TYPE=" << sfrag_type << MSG::dec
4684 <<
" SIZE=" <<sfrag_size <<
" FOUND!");
4694 if (b_deciTmdb)
unpack_frag42( sourceid, version, p, sfrag_size-3, cont);
4702 int ros = (collid >> 8);
4703 int drawer = collid & 0xff;
4706 int nmod = (ros > 2) ? 8 : 4;
4707 int nchan = 4 * datasize / nmod / nsamp;
4709 int nsamp1 = nsamp - 1;
4711 std::vector<float> digits(nsamp);
4721 int wpos = (collid % nmod) * nchan;
4722 int jump = nchan * nmod;
4723 const unsigned char * adc =
reinterpret_cast<const unsigned char *
>(p);
4725 for (
int i = 0; i < nchan; ++i) {
4726 for (
int j = 0; j < nsamp; ++j) {
4727 digits[nsamp1 - j] = adc[wpos + jump * j];
4735 if (
msgLvl(MSG::DEBUG)) {
4736 msg(MSG::DEBUG) <<
"TileROD_Decoder::unpack_frag40 frag: 0x" << MSG::hex << collid << MSG::dec
4737 <<
" version: " << version <<
endmsg;
4739 int pos = coll.
size() - nchan;
4740 const char * strchannel[13] = {
" d5L ",
" d5R ",
" d6L ",
" d6R ",
4741 " xxx ",
" d0x ",
" d1L ",
" d1R ",
" d2L ",
" d2R ",
" d3L ",
" d3R ",
" xxx " };
4742 int nchmax = (ros > 2) ? 4 : 8;
4743 for (
int i = 0; i < nchan; ++i) {
4744 const std::vector<float> & sample = coll.
at(pos + i)->samples();
4745 std::stringstream
ss;
4746 for (
const auto & val : sample) {
4747 ss << std::setw(5) << int(val);
4749 msg(MSG::DEBUG) <<
" ros:" << ros
4750 <<
" drawer:" << drawer
4751 <<
" ch:" << i << strchannel[std::min(i, nchmax)+nchmax-4] <<
ss.str() <<
endmsg;
4760 int ros=(collid>>8);
4761 int drawer=collid&0xff;
4763 float calFactorADC2MeV = 1.0;
4765 int nmod = (ros>2)?8:4;
4766 int nchan = datasize / nmod;
4768 int wpos = (collid % nmod) * nchan;
4781 const int32_t * pp =
reinterpret_cast<const int32_t *
>(p);
4783 for (
int i = 0; i < nchan; ++i) {
4800 const int16_t * pp =
reinterpret_cast<const int16_t *
>(p);
4802 for (
int i = 0; i < nchan; ++i) {
4810 if (
msgLvl(MSG::DEBUG)) {
4811 msg(MSG::DEBUG) <<
" TileROD_Decoder::unpack_frag41 frag: 0x" << MSG::hex << collid << MSG::dec
4812 <<
" version: " << version <<
endmsg;
4814 int nbits = (version == 0) ? 32 : 16;
4815 msg(MSG::DEBUG) <<
" position of " << nbits <<
"-bit word inside sub-fragment 0x41: " << wpos <<
endmsg;
4816 int pos = coll.
size() - nchan;
4817 const char * strchannel[13] = {
" d5L ",
" d5R ",
" d6L ",
" d6R ",
4818 " xxx ",
" d0x ",
" d1L ",
" d1R ",
" d2L ",
" d2R ",
" d3L ",
" d3R ",
" xxx " };
4819 int nchmax = (ros > 2) ? 4 : 8;
4820 for (
int i = 0; i < nchan; ++i) {
4821 msg(MSG::DEBUG) <<
" ros:" << ros
4822 <<
" drawer:" << drawer
4823 <<
" ch:" << i << strchannel[std::min(i, nchmax)+nchmax-4] << coll.
at(pos + i)->amplitude() <<
endmsg;
4871 int drawer = (sourceid & 0xf0000) >> 8;
4875 drawer |= ((sourceid & 0x0000f) << 2);
4876 word = (datasize > 0) ? p[0] : 0;
4880 drawer |= ((sourceid & 0x0000f) << 3);
4883 word = (p[1] << 20) | ((p[0] >> 8) & 0xff000) | ((p[0] >> 4) & 0xfff);
4885 word = ((p[1] & 0xfff) << 12) | (p[0] & 0xfff);
4887 bcid = ((p[1] >> 4) & 0xf00) | ((p[0] >> 24) & 0xf0) | ((p[0] >> 12) & 0xf);
4892 drawer |= (bcid<<16) ;
4894 std::vector<bool>
result(nbit);
4895 for (
int j = 0; j < nmod; ++j) {
4896 for (
int k = nbit-1; k >= 0; --k) {
4914 if (
msgLvl(MSG::DEBUG)) {
4916 else msg(MSG::DEBUG) <<
"TMDB version for RUN3 simulation (2020)" <<
endmsg;
4918 msg(MSG::DEBUG) <<
" TileROD_Decoder::unpack_frag42 source ID: 0x" << MSG::hex << sourceid << MSG::dec
4919 <<
" version: " << version <<
" bcid | drawer " << MSG::hex << drawer <<
endmsg;
4921 for (
size_t j = v.size() - nmod; j < v.size(); ++j) {
4922 const std::vector<bool> &
r = v[j]->GetDecision();
4923 std::stringstream
ss;
4924 for (
const bool val :
r) {
4925 ss << std::setw(2) << val;
4927 msg(MSG::DEBUG) << MSG::hex <<
"0x" << v[j]->GetID() << MSG::dec <<
ss.str() <<
endmsg;
const boost::regex re(r_e)
Scalar eta() const
pseudorapidity method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
char data[hepevt_bytes_allocation_ATLAS]
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
TileContainer< TileMuonReceiverObj > TileMuonReceiverContainer
TileContainer< TileL2 > TileL2Container
bool Format6(const std::vector< double > &a, const std::vector< double > &b, const std::vector< double > &c, const std::vector< double > &g, const std::vector< double > &h, unsigned int channel_index, int phase, double calibration, std::vector< unsigned int > &OFC, bool verbose)
Format6.
static const InterfaceID IID_ITileROD_Decoder("TileROD_Decoder", 1, 0)
unsigned char qbitfun(float t, float a, float b)
bool chan_order1(const TileFastRawChannel &a, const TileFastRawChannel &b)
bool chan_order(TileRawData *a, TileRawData *b)
const float QUALITY_THRESHOLD
#define Frag5_unpack_reco_bin(w, code, gain, amp, time)
unpack_reco_bin
#define Frag5_unpack_bin2sum(unit, amp_bin)
unpack_bin2sum
#define Frag5_unpack_bin2reco(unit, gain, amp_bin, amp, time_bin, time)
unpack_bin2reco
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
float time() const
get time (data member)
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
IdentifierHash onl2() const
cell online identifier 2
DataModel_detail::const_iterator< DataVector > const_iterator
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
const_iterator begin() const noexcept
size_type size() const noexcept
int getMaxChannels(void) const
Static class providing several utility functions and constants.
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
void setQuality_nonvirt(unsigned char qual, unsigned char qbit, int pmt)
void addEnergy(float e, int pmt, int gain)
set energy and gain for one PMT
void setTime_nonvirt(float t)
virtual void setEnergy(float ene) override final
set total energy, reset eneDiff to zero (final override of CaloCell method)
virtual void setTime(float t) override final
set cell time, reset timeDiff
void set(unsigned int channel, unsigned int adc, float amplitude, float time, float quality)
unsigned int adc(void) const
float quality(void) const
float amplitude(void) const
unsigned int channel(void) const
const std::vector< uint32_t > & getDrawerInfo(int frag_id) const
void setDaqType(const unsigned int daqtype)
int getType(int chan, int gain, int type) const
void setCalib(int chan, int type, double sumXinQDC, double sumX2inQDC, int nevts, int gain)
void setPmt(const unsigned int pmt, const int pmAdc, const int tdc, const double pmPedestal, const double pmSigmaPedestal, const unsigned int gain)
void setCalibType(int type)
int getN(int chan, int gain, int type) const
double getMean(int chan, int gain, int type) const
void setTimeouts(const bool qdc, const bool tdc)
void setDiode(const unsigned int diode, const int diodeAdc, const double diodePedestal, const double diodeSigmaPedestal, const double alpha, const double sigmaAlpha, const double pedestalAlpha, const double sigmaPedAlpha, const unsigned int gain)
void setPLC(const int alphaPos, const double LVdiodes, const double HVpmts, const int shutter, const int interlock, const int alarm)
void setControl(const double pumpDiodeTemp, const int timeLastMeasP, const double diodeBoxTemp, const int timeLastMeasD, const double gasFlux, const int timeLastMeasG, const double humidity, const int timeLastMeasH, const time_t lastPedMeas, const time_t lastAlphaMeas)
bool isSet(int chan, int gain, int type) const
void setLaser(const int Counter, const int diodeCurrOrd, const int diodeCurrMeas, const int filtNumber, const int timingDelay, const int version)
double getSigma(int chan, int gain, int type) const
void unpack_frag11(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag11 decodes tile subfragment type 0x11.
std::vector< int > m_Rw2Pmt[4]
void make_copy(uint32_t bsflags, TileFragHash::TYPE rChType, TileRawChannelUnit::UNIT rChUnit, DigitsMetaData_t &digitsMetaData, RawChannelMetaData_t &rawchannelMetaData, const ROBData *rob, pDigiVec &pDigits, pRwChVec &pChannel, TileBeamElemCollection &v, TileBeamElemContainer *container) const
uint32_t fillCollectionHLT(const ROBData *rob, TileCellCollection &v, D0CellsHLT &d0cells, TileCellCollection *MBTS, const TileHid2RESrcID *hid2reHLT) const
std::vector< int > m_demoChanEB
void mergeD0cellsHLT(const D0CellsHLT &d0cells, TileCellCollection &) const
float m_ampMinThresh_pC
correct amplitude if it's above amplitude threshold (in pC)
Gaudi::Property< float > m_allowedTimeMin
void fillTileLaserObj(const ROBData *rob, TileLaserObject &v) const
void unpack_frag14(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag14 decodes tile subfragment type 0x14.
bool m_checkMaskedDrawers
SG::ReadCondHandleKey< TileHid2RESrcID > m_hid2RESrcIDKey
TileHid2RESrcID * m_hid2re
StatusCode convert(const RawEvent *re, TileL2Container *L2Cnt) const
void unpack_frag42(uint32_t sourceid, uint32_t version, const uint32_t *p, int size, TileMuonReceiverContainer &v) const
std::vector< uint32_t > get_correct_data(const uint32_t *p) const
void unpack_frag5(uint32_t version, uint32_t sizeOverhead, unsigned int unit, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag5 decodes tile subfragment type 0x4.
void unpack_frag15(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag15 decodes tile subfragment type 0x15.
std::vector< TileDigits * > pDigiVec
void unpack_frag12(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag12 decodes tile subfragment type 0x12.
void updateAmpThreshold(int run=-1)
void unpack_frag41(uint32_t collid, uint32_t version, const uint32_t *p, int size, TileRawChannelCollection &coll) const
static const InterfaceID & interfaceID()
AlgTool InterfaceID.
uint32_t make_copyHLT(bool of2, TileRawChannelUnit::UNIT rChUnit, bool correctAmplitude, const FRwChVec &pChannel, TileCellCollection &v, const uint16_t DQuality, D0CellsHLT &d0cells, TileCellCollection *MBTS) const
friend class TileHid2RESrcID
Gaudi::Property< int > m_maxWarningPrint
void fillContainer_TileMuRcv_Decision(const ROBData *rob, TileMuonReceiverContainer &v) const
Gaudi::Property< int > m_maxErrorPrint
void unpack_frag3(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag3 decodes tile subfragment type 0x3.
void unpack_frag4(uint32_t version, uint32_t sizeOverhead, unsigned int unit, RawChannelMetaData_t &rawchannelMetaData, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag4 decodes tile subfragment type 0x4.
void unpack_frag4HLT(uint32_t version, uint32_t sizeOverhead, unsigned int unit, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag4HLT decodes tile subfragment type 0x4 for the high level trigger (HLT).
TileRawChannel2Bytes5 m_rc2bytes5
void unpack_frag1(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag1 decodes tile subfragment type 0x1.
void unpack_frag10(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag10 decodes tile subfragment type 0x10.
void fillCollectionL2(const ROBData *rob, TileL2Container &v) const
const TileHWID * m_tileHWID
std::vector< std::vector< uint32_t > > RawChannelMetaData_t
Gaudi::Property< float > m_ampMinThresh
Gaudi::Property< float > m_timeMinThresh
Gaudi::Property< bool > m_useFrag5Reco
std::map< unsigned int, unsigned int > m_mapMBTS
std::mutex m_OFWeightMutex
TileRawChannel2Bytes m_rc2bytes
void printWarningCounter(bool printIfNoWarning)
std::vector< TileFastRawChannel > FRwChVec
TileRawChannel2Bytes4 m_rc2bytes4
void loadMBTS(std::map< unsigned int, unsigned int > &mapMBTS, int MBTS_channel)
ToolHandle< TileL2Builder > m_L2Builder
TileDigits2Bytes m_d2Bytes
bool unpack_frag4L2(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag4L2 decodes tile subfragment type 0x4 and extract transverse energy from this fragment
unsigned int m_maxChannels
ToolHandle< TileCondToolOfcCool > m_tileCondToolOfcCool
std::vector< int > m_Rw2Cell[4]
Gaudi::Property< float > m_allowedTimeMax
void unpack_frag6(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag6 decodes tile subfragment type 0x6.
TileHid2RESrcID * m_hid2reHLT
void fillCollection_TileMuRcv_RawChannel(const ROBData *rob, TileRawChannelCollection &v) const
Gaudi::Property< std::vector< int > > m_demoFragIDs
void unpack_frag16(uint32_t version, const uint32_t *p, TileLaserObject &v) const
unpack_frag16 decodes tile subfragment type 0x16 or 0x20.
virtual StatusCode finalize()
void unpack_fragAHLT(uint32_t version, const uint32_t *p, uint16_t rob_bcid, uint16_t &mask, int fragID, int demoType) const
unpack_fragAHLT decodes tile subfragment type 0XA.
void unpack_frag2(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_frag2 decodes tile subfragment type 0x2.
std::vector< int > m_list_of_masked_drawers
virtual ~TileROD_Decoder()
destructor
const uint32_t * get_data(const ROBData *rob) const
Gaudi::Property< bool > m_verbose
StatusCode convertTMDBDecision(const RawEvent *re, TileMuonReceiverContainer *tileMuRcv) const
std::atomic< int > m_ErrorCounter
void unpack_frag40(uint32_t collid, uint32_t version, const uint32_t *p, int size, TileDigitsCollection &coll) const
unpacking methods dedicated to the TMDB ROD format sub-fragments 0x40 0x41 0x42
ToolHandle< ITileBadChanTool > m_tileBadChanTool
std::vector< std::vector< uint32_t > > DigitsMetaData_t
void unpack_frag17(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, TileLaserObject &v) const
unpack_frag17 decodes tile subfragment type 0x17 or 0x20.
std::vector< TileRawChannel * > pRwChVec
void fillCollectionL2ROS(const ROBData *rob, TileL2Container &v) const
void fillCollection_TileMuRcv_Digi(const ROBData *rob, TileDigitsCollection &v) const
bool checkBit(const uint32_t *p, int chan) const
check the bitmap for a channel
void unpack_frag3HLT(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag3HLT decodes tile subfragment type 0x3 for the high level trigger (HLT).
ToolHandle< TileCondToolEmscale > m_tileToolEmscale
void printErrorCounter(bool printIfNoError)
void unpack_frag5HLT(uint32_t version, uint32_t sizeOverhead, unsigned int unit, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag5HLT decodes tile subfragment type 0x5 for the high level trigger (HLT).
Gaudi::Property< float > m_timeMaxThresh
void unpack_frag0(uint32_t version, uint32_t sizeOverhead, DigitsMetaData_t &digitsMetaData, const uint32_t *p, pDigiVec &pDigits, int fragID, int demoType) const
unpack_frag0 decodes tile subfragment type 0x0.
virtual StatusCode initialize()
std::vector< TileBeamElem * > pBeamVec
bool unpack_frag5L2(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag5L2 decodes tile subfragment type 0x5 and extract transverse energy from this fragment
TileROD_Decoder(const std::string &type, const std::string &name, const IInterface *parent)
constructor
void setLaserVersion(TileLaserObject &laserObject) const
ToolHandle< TileCondToolTiming > m_tileToolTiming
float m_ampMinThresh_MeV
correct amplitude if it's above amplitude threshold (in MeV)
Gaudi::Property< bool > m_useFrag5Raw
Gaudi::Property< unsigned int > m_fullTileRODs
ServiceHandle< TileCablingSvc > m_cablingSvc
uint32_t data_size(const ROBData *rob, uint32_t &error) const
void unpack_frag13(uint32_t version, const uint32_t *p, TileL2Container &v, int fragID, int demoType) const
unpack_frag13 decodes tile subfragment type 0x13.
eformat::ROBFragment< const uint32_t * > ROBData
convert ROD Data words into either TileCell or TileRawChannel.
Gaudi::Property< bool > m_ignoreFrag4HLT
std::vector< int > m_demoChanLB
const uint32_t * getOFW(int fragId, int unit) const
getOFW returns Optimal Filtering Weights for Frag5 decoder loaded from COOL for correspondent units.
TileRawChannel2Bytes2 m_rc2bytes2
std::atomic< int > m_WarningCounter
StatusCode convertLaser(const RawEvent *re, TileLaserObject *TileLaserObj) const
void fillCollection_FELIX_Digi(const ROBData *rob, TileDigitsCollection &v) const
void unpack_brod(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, pBeamVec &pBeam, int fragID) const
unpack_brod decodes all ancillary tile subfragments coming from beam ROD at the testbeam or LASTROD i...
Gaudi::Property< bool > m_suppressDummyFragments
void unpack_frag2HLT(uint32_t version, uint32_t sizeOverhead, const uint32_t *p, FRwChVec &pChannel, int fragID, int demoType) const
unpack_frag2HLT decodes tile subfragment type 0x2 for the high level trigger (HLT).
void unpack_fragA(uint32_t version, RawChannelMetaData_t &rawchannelMetaData, const uint32_t *p, pRwChVec &pChannel, int fragID, int demoType) const
unpack_fragA decodes tile subfragment type 0XA.
static double correctAmp(double phase, bool of2=true)
Amplitude correction factor according to the time when using weights for tau=0 without iterations.
@ OnlineMegaElectronVolts
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
std::map< std::string, std::string > remap
list of directories to be explicitly remapped
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
TileFastRawChannel m_D0channeg[64]
TileFastRawChannel m_D0chanpos[64]