69 ATH_MSG_FATAL(
"Needs ether Digits or CalibDigits or AccDigits or AccCalibDigit Key");
70 return StatusCode::FAILURE;
74 ATH_MSG_FATAL(
"Could not have both CalibDigits, AccCalibDigits Key");
75 return StatusCode::FAILURE;
80 return StatusCode::FAILURE;
91 std::set<unsigned> fts;
93 fts.insert({0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31});
96 fts.insert({0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24});
108 ATH_MSG_INFO(
"Adding feedthrough Barrel/Endcap=" << iBE <<
" pos/neg=" << iPN <<
" FT=" << iFT
118 std::set<HWIdentifier> subcaloFTs;
122 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
130 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
137 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
143 return StatusCode::FAILURE;
148 if (subcaloFTs.find(*it)==subcaloFTs.end())
154 ATH_MSG_WARNING(
"Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
166 return StatusCode::SUCCESS;
179 digits=digitsHdl.
ptr();
185 ATH_CHECK(cdigitsHdl.
record(std::make_unique<LArCalibDigitContainer>()));
186 cdigits=cdigitsHdl.
ptr();
192 ATH_CHECK(accdigitsHdl.
record(std::make_unique<LArAccumulatedDigitContainer>()));
193 accdigits=accdigitsHdl.
ptr();
199 ATH_CHECK(caccdigitsHdl.
record(std::make_unique<LArAccumulatedCalibDigitContainer>()));
200 caccdigits=caccdigitsHdl.
ptr();
206 ATH_CHECK(febHeadersHdl.
record(std::make_unique<LArFebHeaderContainer>()));
207 febHeaders=febHeadersHdl.
ptr();
213 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
214 eformat::helper::build_toc(*fullEvent, rawEventTOC);
215 auto larRobs=rawEventTOC.find(eformat::LAR);
216 if (larRobs==rawEventTOC.end()) {
218 return StatusCode::SUCCESS;
222 std::unique_ptr<LArRodBlockStructure> rodBlock;
223 uint16_t rodMinorVersion=0x0;
224 uint32_t rodBlockType=0x0;
232 return StatusCode::FAILURE;
236 for (
const uint32_t* robPtr : larRobs->second) {
238 ATH_MSG_VERBOSE(
"Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () <<
" with " << std::dec << rob.rod_fragment_size_word() <<
"ROB words");
240 if (rob.rod_fragment_size_word() <3) {
241 ATH_MSG_ERROR(
"Encountered corrupt ROD fragment, less than 3 words!");
243 return StatusCode::FAILURE;
246 }
else if(rob.rob_source_id()& 0x1000 ){
247 ATH_MSG_VERBOSE(
" skip Latome fragment with source ID "<< std::hex << rob.rob_source_id());
252 eformat::helper::Version ver(rob.rod_version());
254 if (rodBlock==
nullptr || rodMinorVersion !=ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
255 rodMinorVersion=ver.minor_version();
256 rodBlockType=rob.rod_detev_type()&0xff;
257 ATH_MSG_VERBOSE(
"Found version " << rodMinorVersion <<
" of Rod Block Type " << rodBlockType);
258 if (rodBlockType==10) {
261 else if (rodBlockType==7 || rodBlockType==2) {
262 if(rodMinorVersion>=6) {
265 ATH_MSG_ERROR(
"Found unsupported ROD Block version " << rodMinorVersion
266 <<
" of ROD block type " << rodBlockType);
270 ATH_MSG_ERROR(
"Found unsupported Rod block type " << rodBlockType <<
" in ROB sourceId: 0x" << std::hex << rob.rob_source_id () << std::dec
271 <<
", ROD source ID: 0x" << rob.rod_source_id() << std::dec);
273 return StatusCode::FAILURE;
279 const uint32_t* pData=rob.rod_data();
280 const uint32_t nData=rob.rod_ndata();
281 if (!rodBlock->setFragment(pData,nData)) {
282 ATH_MSG_ERROR(
"Failed to assign fragment pointer to LArRodBlockStructure");
283 return StatusCode::FAILURE;
287 const uint32_t onsum = rodBlock->onlineCheckSum();
288 const uint32_t offsum = rodBlock->offlineCheckSum();
292 ATH_MSG_ERROR(
"offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
294 return StatusCode::FAILURE;
306 return StatusCode::FAILURE;
312 const auto ftId=
m_onlineId->feedthrough_Id(fId);
314 ATH_MSG_DEBUG(
"Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<
" not in preselection. Ignored.");
320 const int NthisFebChannel=
m_onlineId->channelInSlotMax(fId);
326 std::vector<short> samples;
327 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
328 if (fcNb>=NthisFebChannel)
330 if (samples.size()==0)
continue;
344 std::vector<short> samples;
345 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
346 if (fcNb>=NthisFebChannel)
348 if (samples.size()==0)
continue;
349 dac = rodBlock->getDAC();
350 delay = rodBlock->getDelay();
351 ispulsed = rodBlock->getPulsed(fcNb);
362 std::vector<uint64_t> samplesSum;
363 std::vector<uint64_t> samples2Sum;
365 while (rodBlock->getNextAccumulatedDigit(fcNb,samplesSum,samples2Sum,gain)) {
366 if (fcNb>=NthisFebChannel)
368 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
369 nTrigger = rodBlock->getNTrigger();
386 uint16_t ispulsed_int;
389 std::vector<uint64_t> samplesSum;
390 std::vector<uint64_t> samples2Sum;
392 while (rodBlock->getNextAccumulatedCalibDigit(fcNb,samplesSum,samples2Sum,itmp,gain)) {
393 if (fcNb>=NthisFebChannel)
395 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
398 dac = rodBlock->getDAC();
399 delay = rodBlock->getDelay();
400 nTrigger = rodBlock->getNTrigger();
401 nstep = rodBlock->getNStep();
402 istep = rodBlock->getStepIndex();
404 const std::vector<HWIdentifier>& calibChannelIDs = calibMap->
calibSlotLine(cId);
405 for(std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); csl_it!=calibChannelIDs.end();++csl_it){
406 uint32_t calibLine =
m_onlineId->channel(*csl_it);
407 ispulsed=rodBlock->getPulsed(calibLine);
408 ispulsed_int=( ispulsed_int | ((uint16_t)ispulsed<<bitShift) );
418 std::unique_ptr<LArFebHeader> larFebHeader(
new LArFebHeader(fId));
420 febHeaders->
push_back(std::move(larFebHeader));
423 }
while (rodBlock->nextFEB());
425 return StatusCode::SUCCESS;