|
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include "GaudiKernel/IInterface.h"
11 #include "GaudiKernel/MsgStream.h"
12 #include "GaudiKernel/StatusCode.h"
42 static const InterfaceID IID_IJepByteStreamV2Tool(
"JepByteStreamV2Tool", 1, 1);
46 return IID_IJepByteStreamV2Tool;
52 const std::string&
name,
55 m_robDataProvider(
"ROBDataProviderSvc",
name),
56 m_jemMaps(
"LVL1::JemMappingTool/JemMappingTool"),
57 m_errorTool(
"LVL1BS::L1CaloErrorByteStreamTool/L1CaloErrorByteStreamTool"),
58 m_channels(44), m_crates(2), m_modules(16), m_frames(8), m_locations(4),
60 m_subDetector(
eformat::TDAQ_CALO_JET_PROC_DAQ)
62 declareInterface<JepByteStreamV2Tool>(
this);
65 "Crate/Module/Channel to Eta/Phi/Layer mapping tool");
67 "Tool to collect errors for monitoring");
70 "Offset of JEP crate numbers in bytestream");
72 "Offset of JEP crate numbers in RDOs");
74 "The number of S-Links per crate");
78 "ROB fragment source identifiers");
82 "Format version number in sub-block header");
84 "Format identifier (0-1) in sub-block header");
86 "The number of slices in the simulation");
88 "If >0, the number of slices in bytestream");
90 "Minimum crate number, allows partial output");
92 "Maximum crate number, allows partial output");
116 return StatusCode::SUCCESS;
123 return StatusCode::SUCCESS;
129 const std::string& sgKey,
132 const std::vector<uint32_t>& vID(
sourceIDs());
135 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"JepByteStreamV2Tool");
136 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
137 return convert(sgKey, robFrags, collection);
141 const std::string& sgKey,
151 const std::string& sgKey,
154 const std::vector<uint32_t>& vID(
sourceIDs());
157 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"JepByteStreamV2Tool");
158 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
159 return convert(sgKey, robFrags, collection);
163 const std::string& sgKey,
173 const std::string& sgKey,
176 const std::vector<uint32_t>& vID(
sourceIDs());
179 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"JepByteStreamV2Tool");
180 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
181 return convert(sgKey, robFrags, collection);
185 const std::string& sgKey,
195 const std::string& sgKey,
198 const std::vector<uint32_t>& vID(
sourceIDs());
201 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"JepByteStreamV2Tool");
202 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
203 return convert(sgKey, robFrags, collection);
207 const std::string& sgKey,
218 const std::string& sgKey,
221 const std::vector<uint32_t>& vID(
sourceIDs());
224 m_robDataProvider->getROBData(Gaudi::Hive::currentContext(), vID, robFrags,
"JepByteStreamV2Tool");
225 ATH_MSG_DEBUG(
"Number of ROB fragments:" << robFrags.size());
226 return convert(sgKey, robFrags, collection);
230 const std::string& sgKey,
244 return StatusCode::FAILURE;
253 "JepByteStreamV2") );
292 int timeslicesNew = 1;
301 if (
module%modulesPerSlink == 0) {
302 const int daqOrRoi = 0;
303 const int slink =
module/modulesPerSlink;
305 msg() <<
"Treating crate " << hwCrate
306 <<
" slink " << slink <<
endmsg;
319 msg(MSG::ERROR) <<
"Inconsistent number of slices or "
320 <<
"triggered slice offsets in data for crate "
321 << hwCrate <<
" slink " << slink <<
endmsg;
322 return StatusCode::FAILURE;
329 <<
"Slices/offset: " << timeslices <<
" " << trigJem;
330 if (timeslices != timeslicesNew) {
331 msg() <<
" modified to " << timeslicesNew <<
" " << trigJemNew;
336 userHeader.
setJem(trigJemNew);
340 theROD->push_back(userHeader.
header());
351 hwCrate,
module, timeslicesNew);
353 if (neutralFormat)
break;
367 std::vector<int> emData;
368 std::vector<int> hadData;
369 std::vector<int> emErrors;
370 std::vector<int> hadErrors;
378 const int index = ( neutralFormat ) ? 0 :
slice;
395 subBlock->
setStatus(failingBCN, gLinkTimeout, gLinkDown,
396 moduleError, fIFOOverflow, bCNMismatch,
397 gLinkProtocol, gLinkParity);
408 std::vector<unsigned int> exVec;
409 std::vector<unsigned int> eyVec;
410 std::vector<unsigned int> etVec;
415 const int index = ( neutralFormat ) ? 0 :
slice;
427 if ( !subBlock->
pack()) {
428 msg(MSG::ERROR) <<
"JEM sub-block packing failed" <<
endmsg;
429 return StatusCode::FAILURE;
432 msg() <<
"JEM sub-block data words: "
435 subBlock->
write(theROD);
452 const int cmxEnergyVersion = 3;
462 if (neutralFormat)
break;
476 std::vector<unsigned int> ex;
477 std::vector<unsigned int> ey;
478 std::vector<unsigned int>
et;
479 std::vector<int> exErr;
480 std::vector<int> eyErr;
481 std::vector<int> etErr;
500 const int index = ( neutralFormat ) ? 0 :
slice;
505 exError, eyError, etError);
514 exError, eyError, etError);
524 for (;
pos != cmxEnergyBlocks.
end(); ++
pos) {
526 if ( !subBlock->
pack()) {
527 msg(MSG::ERROR) <<
"CMX-Energy sub-block packing failed" <<
endmsg;
528 return StatusCode::FAILURE;
531 msg() <<
"CMX-Energy sub-block data words: "
534 subBlock->
write(theROD);
539 for (
int jem = 0; jem <
m_modules; ++jem) {
540 for (
int frame = 0; frame <
m_frames; ++frame) {
542 const int key =
tobKey(crate, jem, frame, loc);
545 std::vector<int> energyLarge;
546 std::vector<int> energySmall;
547 std::vector<int>
error;
548 std::vector<unsigned int> presence;
560 const int index = ( neutralFormat ) ? 0 :
slice;
563 energySmall[
slice], err0);
585 std::vector<unsigned int> hits0;
586 std::vector<unsigned int> hits1;
587 std::vector<int> err0;
588 std::vector<int> err1;
608 const int index = ( neutralFormat ) ? 0 :
slice;
619 jos = cmxJetBlocks.
begin();
620 for (; jos != cmxJetBlocks.
end(); ++jos) {
622 if ( !subBlock->
pack()) {
623 msg(MSG::ERROR) <<
"CMX-Jet sub-block packing failed" <<
endmsg;
624 return StatusCode::FAILURE;
627 msg() <<
"CMX-Jet sub-block data words: "
630 subBlock->
write(theROD);
634 return StatusCode::SUCCESS;
651 for (
int slink = 0; slink < maxSlinks; ++slink)
653 const int daqOrRoi = 0;
673 const std::string& sgKey,
680 const std::string
flag(
"Overlap");
681 const std::string::size_type
pos = sgKey.find(
flag);
683 (
pos == std::string::npos ||
pos != sgKey.length() -
flag.length()) ? 0 : 1;
698 std::set<uint32_t> dupCheck;
701 for (; rob != robEnd; ++rob) {
705 msg() <<
"Treating ROB fragment " << robCount <<
endmsg;
710 uint32_t robid = (*rob)->source_id();
711 if ((*rob)->nstatus() > 0) {
713 (*rob)->status(robData);
716 if (
debug)
msg() <<
"ROB status error - skipping fragment" <<
endmsg;
723 if (!dupCheck.insert(robid).second) {
734 (*rob)->rod_data(payloadBeg);
735 payloadEnd = payloadBeg + (*rob)->rod_ndata();
743 const uint32_t sourceID = (*rob)->rod_source_id();
752 msg() <<
"Wrong source identifier in data: ROD "
753 << MSG::hex << sourceID <<
" ROB " << robid
760 const int minorVersion = (*rob)->rod_version() & 0xffff;
767 msg() <<
"Treating crate " << rodCrate
779 const int headerWords = userHeader.
words();
780 if (headerWords != 1) {
782 if (
debug)
msg() <<
"Unexpected number of user header words: "
786 for (
int i = 0;
i < headerWords; ++
i) ++
payload;
788 int trigJem = userHeader.
jem();
790 msg() <<
"Minor format version number: " << MSG::hex
791 << minorVersion << MSG::dec <<
endmsg
792 <<
"JEM triggered slice offset: " << trigJem <<
endmsg;
798 while (
payload != payloadEnd) {
808 cmxJetSubBlock.
clear();
810 if (cmxJetSubBlock.
crate() != rodCrate) {
811 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
824 cmxEnergySubBlock.
clear();
826 if (cmxEnergySubBlock.
crate() != rodCrate) {
827 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
848 if (jemSubBlock.
crate() != rodCrate) {
849 if (
debug)
msg() <<
"Inconsistent crate number in ROD source ID"
867 return StatusCode::SUCCESS;
880 const int hwCrate = subBlock->
crate();
884 const int timeslices = subBlock->
timeslices();
885 const int sliceNum = subBlock->
slice();
887 msg() <<
"CMX-Energy: Crate " << hwCrate
889 <<
" Firmware " << firmware
890 <<
" Summing " << summing
891 <<
" Total slices " << timeslices
892 <<
" Slice " << sliceNum <<
endmsg;
894 if (timeslices <= trigJem) {
895 if (
debug)
msg() <<
"Triggered CMX slice from header "
896 <<
"inconsistent with number of slices: "
897 << trigJem <<
", " << timeslices <<
endmsg;
901 if (timeslices <= sliceNum) {
902 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
903 << timeslices <<
", " << sliceNum <<
endmsg;
911 msg() <<
"CMX-Energy sub-block unpacking failed: " << errMsg <<
endmsg;
923 std::vector<unsigned int>& exVec(
ld.uintVec0);
924 std::vector<unsigned int>& eyVec(
ld.uintVec1);
925 std::vector<unsigned int>& etVec(
ld.uintVec2);
926 std::vector<int>& exErrVec(
ld.intVec0);
927 std::vector<int>& eyErrVec(
ld.intVec1);
928 std::vector<int>& etErrVec(
ld.intVec2);
931 const int ssError = derr.
error();
932 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
933 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
961 exErr = exErrBits.
error();
962 eyErr = eyErrBits.
error();
963 etErr = etErrBits.
error();
985 ex = subBlock->
hits(
slice, hitType, sumType);
990 exErr = exErrBits.
error();
991 eyErr = eyErrBits.
error();
992 etErr = etErrBits.
error();
993 if (ex || ey ||
et || exErr || eyErr || etErr) {
996 exVec.assign(timeslices, 0);
997 eyVec.assign(timeslices, 0);
998 etVec.assign(timeslices, 0);
999 exErrVec.assign(timeslices, 0);
1000 eyErrVec.assign(timeslices, 0);
1001 etErrVec.assign(timeslices, 0);
1005 exErrVec[
slice] = exErr;
1006 eyErrVec[
slice] = eyErr;
1007 etErrVec[
slice] = etErr;
1009 std::make_unique<LVL1::CMXEtSums>(swCrate,
source, etVec, exVec, eyVec,
1010 etErrVec, exErrVec, eyErrVec, trigJem);
1012 data.m_cmxEtMap.insert(std::make_pair(
key, sumsp.get()));
1013 data.m_cmxEtCollection->push_back(std::move(sumsp));
1015 exVec = sums->
ExVec();
1016 eyVec = sums->
EyVec();
1017 etVec = sums->
EtVec();
1021 const int nsl = exVec.size();
1022 if (timeslices != nsl) {
1023 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
1029 exErrVec[
slice] != 0 || eyErrVec[
slice] != 0 ||
1030 etErrVec[
slice] != 0) {
1038 exErrVec[
slice] = exErr;
1039 eyErrVec[
slice] = eyErr;
1040 etErrVec[
slice] = etErr;
1041 sums->
addEx(exVec, exErrVec);
1042 sums->
addEy(eyVec, eyErrVec);
1043 sums->
addEt(etVec, etErrVec);
1061 const int hwCrate = subBlock->
crate();
1065 const int timeslices = subBlock->
timeslices();
1066 const int sliceNum = subBlock->
slice();
1068 msg() <<
"CMX-Jet: Crate " << hwCrate
1070 <<
" Firmware " << firmware
1071 <<
" Summing " << summing
1072 <<
" Total slices " << timeslices
1073 <<
" Slice " << sliceNum <<
endmsg;
1075 if (timeslices <= trigJem) {
1076 if (
debug)
msg() <<
"Triggered CMX slice from header "
1077 <<
"inconsistent with number of slices: "
1078 << trigJem <<
", " << timeslices <<
endmsg;
1082 if (timeslices <= sliceNum) {
1083 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
1084 << timeslices <<
", " << sliceNum <<
endmsg;
1092 msg() <<
"CMX-Jet sub-block unpacking failed: " << errMsg <<
endmsg;
1104 std::vector<int>& energyLgVec(
ld.intVec0);
1105 std::vector<int>& energySmVec(
ld.intVec1);
1106 std::vector<int>& errorVec(
ld.intVec2);
1107 std::vector<unsigned int>& presenceMapVec(
ld.uintVec0);
1108 std::vector<unsigned int>& hit0Vec(
ld.uintVec0);
1109 std::vector<unsigned int>& hit1Vec(
ld.uintVec1);
1110 std::vector<int>& err0Vec(
ld.intVec0);
1111 std::vector<int>& err1Vec(
ld.intVec1);
1114 const int ssError = derr.
error();
1115 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1116 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1124 for (
int jem = 0; jem <
m_modules; ++jem) {
1126 for (
int tob = 0; tob <
m_maxTobs; ++tob) {
1130 if (energyLarge == 0 && energySmall == 0 &&
error == 0)
break;
1132 const int frame = subBlock->
frame(
slice, jem, tob);
1136 if (neutralFormat) {
1145 const int key =
tobKey(crate, jem, frame, loc);
1148 energyLgVec.assign(timeslices, 0);
1149 energySmVec.assign(timeslices, 0);
1150 errorVec.assign(timeslices, 0);
1151 presenceMapVec.assign(timeslices, 0);
1152 energyLgVec[
slice] = energyLarge;
1153 energySmVec[
slice] = energySmall;
1155 presenceMapVec[
slice] = presenceMap;
1157 std::make_unique<LVL1::CMXJetTob>(swCrate, jem, frame, loc,
1158 energyLgVec, energySmVec, errorVec,
1159 presenceMapVec, trigJem);
1163 energyLgVec =
tb->energyLgVec();
1164 energySmVec =
tb->energySmVec();
1165 errorVec =
tb->errorVec();
1166 presenceMapVec =
tb->presenceMapVec();
1167 const int nsl = energyLgVec.size();
1168 if (timeslices != nsl) {
1169 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
1174 if (energyLgVec[
slice] != 0 || energySmVec[
slice] != 0 ||
1175 errorVec[
slice] != 0 || presenceMapVec[
slice] != 0) {
1180 energyLgVec[
slice] = energyLarge;
1181 energySmVec[
slice] = energySmall;
1183 presenceMapVec[
slice] = presenceMap;
1184 tb->addTob(energyLgVec, energySmVec, errorVec, presenceMapVec);
1203 const unsigned int hit0 = subBlock->
hits(
slice, sourceId, 0);
1204 const unsigned int hit1 = subBlock->
hits(
slice, sourceId, 1);
1213 err0 = err0Bits.
error();
1214 err1 = err1Bits.
error();
1215 if (hit0 || hit1 || err0 || err1) {
1218 hit0Vec.assign(timeslices, 0);
1219 hit1Vec.assign(timeslices, 0);
1220 err0Vec.assign(timeslices, 0);
1221 err1Vec.assign(timeslices, 0);
1222 hit0Vec[
slice] = hit0;
1223 hit1Vec[
slice] = hit1;
1224 err0Vec[
slice] = err0;
1225 err1Vec[
slice] = err1;
1227 std::make_unique<LVL1::CMXJetHits>(swCrate,
source, hit0Vec, hit1Vec,
1228 err0Vec, err1Vec, trigJem);
1237 const int nsl = hit0Vec.size();
1238 if (timeslices != nsl) {
1239 if (
debug)
msg() <<
"Inconsistent number of slices in sub-blocks"
1244 if (hit0Vec[
slice] != 0 || hit1Vec[
slice] != 0 ||
1245 err0Vec[
slice] != 0 || err1Vec[
slice] != 0) {
1250 hit0Vec[
slice] = hit0;
1251 hit1Vec[
slice] = hit1;
1252 err0Vec[
slice] = err0;
1253 err1Vec[
slice] = err1;
1254 jh->
addHits(hit0Vec, hit1Vec, err0Vec, err1Vec);
1274 const int hwCrate = subBlock->
crate();
1276 const int timeslices = subBlock->
timeslices();
1277 const int sliceNum = subBlock->
slice();
1279 msg() <<
"JEM: Crate " << hwCrate
1281 <<
" Total slices " << timeslices
1282 <<
" Slice " << sliceNum <<
endmsg;
1284 if (timeslices <= trigJem) {
1285 if (
debug)
msg() <<
"Triggered JEM slice from header "
1286 <<
"inconsistent with number of slices: "
1287 << trigJem <<
", " << timeslices <<
endmsg;
1291 if (timeslices <= sliceNum) {
1292 if (
debug)
msg() <<
"Total slices inconsistent with slice number: "
1293 << timeslices <<
", " << sliceNum <<
endmsg;
1301 msg() <<
"JEM sub-block unpacking failed: " << errMsg <<
endmsg;
1312 std::vector<unsigned int>& exVec(
ld.uintVec0);
1313 std::vector<unsigned int>& eyVec(
ld.uintVec1);
1314 std::vector<unsigned int>& etVec(
ld.uintVec2);
1317 const int ssError = derr.
error();
1318 std::vector<int>
dummy(timeslices);
1319 const int sliceBeg = ( neutralFormat ) ? 0 : sliceNum;
1320 const int sliceEnd = ( neutralFormat ) ? timeslices : sliceNum + 1;
1330 if (jetEle.
data() || ssError) {
1335 if (
layer ==
ld.coreOverlap) {
1339 const unsigned int key =
ld.elementKey.jeKey(phi, eta);
1341 std::make_unique<LVL1::JetElement>(phi, eta,
dummy,
dummy,
key,
1344 jedata.
m_jeMap.insert(std::make_pair(
key, jep.get()));
1347 const std::vector<int>& emEnergy(je->
emEnergyVec());
1349 const std::vector<int>& emError(je->
emErrorVec());
1350 const std::vector<int>& hadError(je->
hadErrorVec());
1351 const int nsl = emEnergy.size();
1352 if (timeslices != nsl) {
1354 msg() <<
"Inconsistent number of slices in sub-blocks"
1360 if (emEnergy[
slice] != 0 || hadEnergy[
slice] != 0 ||
1361 emError[
slice] != 0 || hadError[
slice] != 0) {
1362 if (
debug)
msg() <<
"Duplicate data for slice "
1370 const int linkError = jetEle.
linkError();
1380 msg(
MSG::VERBOSE) <<
"Non-zero data but no channel mapping for channel "
1395 const unsigned int ex = subBlock->
ex(
slice);
1396 const unsigned int ey = subBlock->
ey(
slice);
1397 const unsigned int et = subBlock->
et(
slice);
1401 exVec.assign(timeslices, 0);
1402 eyVec.assign(timeslices, 0);
1403 etVec.assign(timeslices, 0);
1408 std::make_unique<LVL1::JEMEtSums>(swCrate,
module, etVec, exVec, eyVec,
1413 exVec = sums->
ExVec();
1414 eyVec = sums->
EyVec();
1415 etVec = sums->
EtVec();
1416 const int nsl = exVec.size();
1417 if (timeslices != nsl) {
1419 msg() <<
"Inconsistent number of slices in sub-blocks"
1426 if (
debug)
msg() <<
"Duplicate data for slice "
1452 const int frame,
const int loc)
const
1454 return ((((((crate<<4)+jem)<<3)+frame)<<2)+loc);
1465 const unsigned int key = elementKey.
jeKey(phi, eta);
1466 ConstJetElementMap::const_iterator mapIter = jeMap.find(
key);
1467 if (mapIter != jeMap.end())
return mapIter->second;
1476 const unsigned int key = elementKey.
jeKey(phi, eta);
1477 JetElementMap::const_iterator mapIter =
data.m_jeMap.find(
key);
1478 if (mapIter !=
data.m_jeMap.end())
return mapIter->second;
1489 ConstEnergySumsMap::const_iterator mapIter = etMap.find(crate*
m_modules +
module);
1490 if (mapIter != etMap.end())
return mapIter->second;
1499 if (mapIter !=
data.m_etMap.end())
return mapIter->second;
1509 ConstCmxTobMap::const_iterator mapIter = cmxTobMap.find(
key);
1510 if (mapIter != cmxTobMap.end())
return mapIter->second;
1515 const int key)
const
1517 CmxTobMap::const_iterator mapIter =
data.m_cmxTobMap.find(
key);
1518 if (mapIter !=
data.m_cmxTobMap.end())
return mapIter->second;
1529 ConstCmxHitsMap::const_iterator mapIter = cmxHitsMap.find(crate*100 +
source);
1530 if (mapIter != cmxHitsMap.end())
return mapIter->second;
1538 CmxHitsMap::const_iterator mapIter =
data.m_cmxHitsMap.find(crate*100 +
source);
1539 if (mapIter !=
data.m_cmxHitsMap.end())
return mapIter->second;
1550 ConstCmxSumsMap::const_iterator mapIter = cmxEtMap.find(crate*100 +
source);
1551 if (mapIter != cmxEtMap.end())
return mapIter->second;
1559 CmxSumsMap::const_iterator mapIter =
data.m_cmxEtMap.find(crate*100 +
source);
1560 if (mapIter !=
data.m_cmxEtMap.end())
return mapIter->second;
1575 for (;
pos != pose; ++
pos) {
1578 jeMap.insert(std::make_pair(
key, je));
1593 for (;
pos != pose; ++
pos) {
1597 etMap.insert(std::make_pair(
key, sums));
1605 const tobCollection,
1609 if (tobCollection) {
1612 for (;
pos != pose; ++
pos) {
1615 const int jem = tob->
jem();
1616 const int frame = tob->
frame();
1618 const int key =
tobKey(crate, jem, frame, loc);
1619 cmxTobMap.insert(std::make_pair(
key, tob));
1627 const hitCollection,
1631 if (hitCollection) {
1634 for (;
pos != pose; ++
pos) {
1637 const int key = crate*100 +
hits->source();
1638 cmxHitsMap.insert(std::make_pair(
key,
hits));
1653 for (;
pos != pose; ++
pos) {
1656 const int key = crate*100 + sums->
source();
1657 cmxEtMap.insert(std::make_pair(
key, sums));
1665 const int modulesPerSlink,
1685 if ( !je )
continue;
1686 const int numdat = 5;
1687 std::vector<int> sums(numdat);
1688 std::vector<int> sizes(numdat);
1704 const int peak = je->
peak();
1705 for (
int i = 0;
i < numdat; ++
i) {
1706 if (sums[
i] == 0)
continue;
1710 }
else if (
slices != sizes[
i] || trigJ != peak)
return false;
1715 const int numdat = 3;
1716 std::vector<unsigned int> sums(numdat);
1717 std::vector<int> sizes(numdat);
1719 (
et->ExVec()).end(), 0);
1721 (
et->EyVec()).end(), 0);
1723 (
et->EtVec()).end(), 0);
1724 sizes[0] = (
et->ExVec()).
size();
1725 sizes[1] = (
et->EyVec()).
size();
1726 sizes[2] = (
et->EtVec()).
size();
1727 const int peak =
et->peak();
1728 for (
int i = 0;
i < numdat; ++
i) {
1729 if (sums[
i] == 0)
continue;
1733 }
else if (
slices != sizes[
i] || trigJ != peak)
return false;
1739 for (
int jem =
module; jem <
module + modulesPerSlink; ++jem) {
1740 for (
int frame = 0; frame <
m_frames; ++frame) {
1742 const int key =
tobKey(crate, jem, frame, loc);
1745 const int numdat = 4;
1746 std::vector<int> sums(numdat);
1747 std::vector<int> sizes(numdat);
1760 const int peak = tob->
peak();
1761 for (
int i = 0;
i < numdat; ++
i) {
1762 if (sums[
i] == 0)
continue;
1766 }
else if (
slices != sizes[
i] || trigJ != peak)
return false;
1774 const int maxDataID = (maxDataID1 > maxDataID2) ? maxDataID1 : maxDataID2;
1776 const int numdat = 6;
1777 std::vector<unsigned int> sums(numdat);
1778 std::vector<int> sizes(numdat);
1783 (
hits->hitsVec0()).end(), 0);
1785 (
hits->hitsVec1()).end(), 0);
1787 (
hits->errorVec0()).end(), 0);
1789 (
hits->errorVec1()).end(), 0);
1790 sizes[0] = (
hits->hitsVec0()).
size();
1791 sizes[1] = (
hits->hitsVec1()).
size();
1792 sizes[2] = (
hits->errorVec0()).
size();
1793 sizes[3] = (
hits->errorVec1()).
size();
1794 const int peak =
hits->peak();
1795 for (
int i = 0;
i < 4; ++
i) {
1796 if (sums[
i] == 0)
continue;
1800 }
else if (
slices != sizes[
i] || trigJ != peak)
return false;
1806 (
et->ExVec()).end(), 0);
1808 (
et->EyVec()).end(), 0);
1810 (
et->EtVec()).end(), 0);
1812 (
et->ExErrorVec()).end(), 0);
1814 (
et->EyErrorVec()).end(), 0);
1816 (
et->EtErrorVec()).end(), 0);
1817 sizes[0] = (
et->ExVec()).
size();
1818 sizes[1] = (
et->EyVec()).
size();
1819 sizes[2] = (
et->EtVec()).
size();
1820 sizes[3] = (
et->ExErrorVec()).
size();
1821 sizes[4] = (
et->EyErrorVec()).
size();
1822 sizes[5] = (
et->EtErrorVec()).
size();
1823 const int peak =
et->peak();
1824 for (
int i = 0;
i < numdat; ++
i) {
1825 if (sums[
i] == 0)
continue;
1829 }
else if (
slices != sizes[
i] || trigJ != peak)
return false;
JemJetElement jetElement(int slice, int channel) const
Return jet element for given channel.
unsigned int presenceMap(int slice, int jem) const
Return presence map for given JEM.
const std::vector< unsigned int > & ExVec() const
returns module Ex sum
uint16_t minorVersionPreLS1() const
Return last ROD header minor version for pre-LS1 data.
char data[hepevt_bytes_allocation_ATLAS]
int slink(uint32_t code) const
Return slink from unpacked moduleID.
void clear()
Clear all data.
Extra patterns decribing particle interation process.
Const iterator class for DataVector/DataList.
int peak() const
returns peak slice number
JEM jet element dataword class.
void setEtHits(int slice, HitsType hType, SumType sType, unsigned int map)
Store hits map for given hits type and sum type.
int frame(int slice, int jem, int tob) const
Return frame for given jem and tob.
const std::vector< int > & emEnergyVec() const
Return data for all slices.
int unpackErrorCode() const
Return the unpacking error code.
void setTob(int slice, int jem, int frame, int loc, int energyLarge, int energySmall, int error)
Store TOB (RoI) data for given JEM, frame, local coord.
unsigned int ey(int slice) const
Return energy subsum Ey.
void addSlice(int slice, int emEnergy, int hadEnergy, int emError, int hadError, int linkError)
add data for one timeslice.
Template class for assembling a full atlas raw event from subfragments.
virtual unsigned int jeKey(const xAOD::TriggerTower &tower)
returns key of passed tower
int source() const
returns data source
static int peak(int oldPeak, int oldSlices, int newSlices)
Return new triggered slice offset.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
const DataVector< CMXJetTob > * CmxTobs() const
Return pointer to CMX TOBs collection.
int peak() const
return triggered slice offset
int parityBits(int slice, int jem) const
Return parity bits for given JEM.
bool unpack()
Unpack data.
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
const std::vector< unsigned int > & presenceMapVec() const
returns presence maps
void addEy(const std::vector< unsigned int > &Ey, const std::vector< int > &EyError)
Update Ey sum.
void clear()
Clear all data.
void write(FullEventAssembler< L1CaloSrcIdMap >::RODDATA *theROD) const
Output complete packed sub-block to ROD vector.
bool msgLvl(const MSG::Level lvl) const
uint32_t getRobID(uint32_t rod_id) const
Make a ROB Source ID from a ROD source ID.
int frame() const
returns frame number
const std::vector< unsigned int > & EyVec() const
returns module Ey sum
OFFLINE_FRAGMENTS_NAMESPACE::PointerType read(const OFFLINE_FRAGMENTS_NAMESPACE::PointerType beg, const OFFLINE_FRAGMENTS_NAMESPACE::PointerType end)
Input complete packed sub-block from ROD array.
int module() const
returns module number
int energyLarge(int slice, int jem, int tob) const
Return energy large window size for given jem and tob.
const std::vector< unsigned int > & hitsVec1() const
returns hits1
void addEy(const std::vector< unsigned int > &Ey)
Update Ey sum.
const std::vector< int > & energyLgVec() const
For multi-slice readout.
static bool cmxBlock(uint32_t word)
Determine if header word corresponds to CMX.
const std::vector< int > & ExErrorVec() const
returns module Ex errors
const std::vector< int > & EtErrorVec() const
returns module ET errors
const std::vector< int > & energySmVec() const
returns energy small window
const std::vector< unsigned int > & EtVec() const
Access multi-slice data.
void clear()
Clear all data.
const std::vector< int > & hadEnergyVec() const
return Had energy vector reference (all timeslices)
int jem() const
returns JEM number
const std::vector< unsigned int > & hitsVec0() const
For multi-slice readout.
bool unpack()
Unpack data.
Jet elements are the inputs to the Jet, ETmiss and ETsum triggers.
static void data(const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices)
Return modified data vector<int>
unsigned int hits(int slice, int source, int flag) const
Return hit/topo counts for given source ID and HL flag.
int crate() const
returns crate number
(Non-const) Iterator class for DataVector/DataList.
int localCoord(int slice, int jem, int tob) const
Return Local coordinate for given jem and tob.
int crate() const
Data accessors.
Jet/Energy Processor container for writing bytestream post-LS1.
::StatusCode StatusCode
StatusCode definition for legacy code.
void set(ErrorBit bit, int value=1)
Set an error bit or data.
const std::vector< int > & errorVec1() const
returns error1
unsigned int et(int slice) const
Return energy subsum Et.
int crate(uint32_t code) const
Return crate from unpacked moduleID.
const DataVector< JEMEtSums > * EnergySums() const
Return pointer to energy sums collection.
void setSubsums(int slice, int jem, unsigned int ex, unsigned int ey, unsigned int et, int exError, int eyError, int etError)
Store energy subsums and errors for given JEM.
std::vector< const ROBF * > VROBFRAG
void setEnergySubsums(int slice, unsigned int ex, unsigned int ey, unsigned int et)
Store energy subsum data.
const std::vector< int > & errorVec() const
returns error
const std::vector< int > & errorVec0() const
returns error0
double eta() const
Eta of centre of JetElement.
static SubBlockWordType wordType(uint32_t word)
Word identification.
int error() const
Return the full error word.
std::string unpackErrorMsg() const
Return the unpacking error message for printing.
const DataVector< CMXJetHits > * CmxHits() const
Return pointer to CMX hit sums collection.
void addHits(const std::vector< unsigned int > &hits0, const std::vector< unsigned int > &hits1, const std::vector< int > &error0, const std::vector< int > &error1)
Add data to existing object.
The JetElementKey object provides the key for each JetElement depending on its eta,...
@ MISSING_ET_SIG_STANDARD
uint16_t minorVersion() const
Return ROD header minor version to use when writing BS.
Sub-Block class for CMX-Jet data post LS1.
int tobError(int slice, int jem, int tob) const
Return error bit for given jem and tob.
int dataWords() const
Return number of data words.
unsigned int ex(int slice) const
Return energy subsum Ex.
uint32_t subStatus() const
Return Sub-status word.
const std::vector< int > & EyErrorVec() const
returns module Ey errors
value_type push_back(value_type pElem)
Add an element to the end of the collection.
CMXEtSums object stores Et sums from the Energy CMXs.
void setPresenceMap(int slice, int jem, unsigned int map)
Store presence map.
const std::vector< unsigned int > & ExVec() const
returns module Ex sum
const std::vector< int > & hadErrorVec() const
return Had error vector reference (all timeslices)
void setParityBits(int slice, int jem, int parity)
Store parity bits for neutral format.
static CmxFirmwareCode cmxType(uint32_t word)
CMX differentiation (CMX_CP, CMX_JET, or CMX_ENERGY)
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Sub-Block class for JEM data post LS1.
eformat::SubDetector subDet(uint32_t code) const
Return sub-detector for given ID.
void setCmxHeader(int version, int format, int slice, int crate, int summing, int firmware, int position, int timeslices)
Store CMX header.
void addEt(const std::vector< unsigned int > &Et)
Update ET sum.
int timeslices() const
Return number of timeslices.
TOB data received by the merger modules.
void setRodMinorVersion(uint16_t m)
change the ROD minor version
double phi() const
Phi of centre of JetElement.
const std::vector< unsigned int > & EyVec() const
returns module Ey sum
void addEt(const std::vector< unsigned int > &Et, const std::vector< int > &EtError)
Add data to existing objects.
unsigned int energy(int slice, int jem, EnergyType eType) const
Return energy subsum for given JEM and energy type.
void fillJetElement(int slice, const JemJetElement &jetEle)
Store jet element data.
unsigned int hits(int slice, HitsType hType, SumType sType) const
Return hits map for given hits type and sum type.
const DataVector< CMXEtSums > * CmxSums() const
Return pointer to CMX energy sums collection.
uint32_t getRodID(int crate, int slink, int daqOrRoi, eformat::SubDetector subdet) const
Make a ROD Source ID.
const std::vector< unsigned int > & EtVec() const
returns module ET sum
void addEx(const std::vector< unsigned int > &Ex, const std::vector< int > &ExError)
Update Ex sum.
void addEx(const std::vector< unsigned int > &Ex)
Update Ex sum.
void setJemHeader(int version, int format, int slice, int crate, int module, int timeslices)
Store JEM header.
int crate() const
Data accessors.
std::vector< uint32_t > RODDATA
ROD data as a vector of unsigned int.
const std::vector< int > & emErrorVec() const
return Em error vector reference (all timeslices)
int get(ErrorBit bit) const
Return an error bit or data.
const std::vector< int > & linkErrorVec() const
return link error vector reference (all timeslices)
int maxSlinks() const
Return the maximum possible number of slinks.
void setHits(int slice, int source, int flag, unsigned int hits, int error)
Store hit counts for given source ID and HL flag.
bool unpack()
Unpack data.
int location() const
returns location
Sub-Block class for CMX-Energy data post LS1.
void setStatus(uint32_t failingBCN, bool glinkTimeout, bool glinkDown, bool upstreamError, bool daqOverflow, bool bcnMismatch, bool glinkProtocol, bool glinkParity)
Store error status trailer.
int daqOrRoi(uint32_t code) const
Return daqOrRoi from unpacked moduleID.
int hitsError(int slice, int source, int flag) const
Return hit error for given source ID and HL flag.
int error(int slice, int jem, EnergyType eType) const
Return energy subsum error for given JEM and energy type.
RODDATA * getRodData(uint32_t id)
get a block of ROD data
int energySmall(int slice, int jem, int tob) const
Return energy small window size for given jem and tob.
Summary of JEP (Jet) hits produced by the merger modules.
const DataVector< JetElement > * JetElements() const
Return pointer to jet element collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.