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;
145 std::cout <<
"set sizes:" << subcaloFTs.size() <<
", " <<
m_vFinalPreselection.size() << std::endl;
149 if (subcaloFTs.find(*it)==subcaloFTs.end())
155 ATH_MSG_WARNING(
"Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
167 return StatusCode::SUCCESS;
180 digits=digitsHdl.
ptr();
186 ATH_CHECK(cdigitsHdl.
record(std::make_unique<LArCalibDigitContainer>()));
187 cdigits=cdigitsHdl.
ptr();
193 ATH_CHECK(accdigitsHdl.
record(std::make_unique<LArAccumulatedDigitContainer>()));
194 accdigits=accdigitsHdl.
ptr();
200 ATH_CHECK(caccdigitsHdl.
record(std::make_unique<LArAccumulatedCalibDigitContainer>()));
201 caccdigits=caccdigitsHdl.
ptr();
207 ATH_CHECK(febHeadersHdl.
record(std::make_unique<LArFebHeaderContainer>()));
208 febHeaders=febHeadersHdl.
ptr();
214 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
215 eformat::helper::build_toc(*fullEvent, rawEventTOC);
216 auto larRobs=rawEventTOC.find(eformat::LAR);
217 if (larRobs==rawEventTOC.end()) {
219 return StatusCode::SUCCESS;
223 std::unique_ptr<LArRodBlockStructure> rodBlock;
224 uint16_t rodMinorVersion=0x0;
225 uint32_t rodBlockType=0x0;
233 return StatusCode::FAILURE;
237 for (
const uint32_t* robPtr : larRobs->second) {
239 ATH_MSG_VERBOSE(
"Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () <<
" with " << std::dec << rob.rod_fragment_size_word() <<
"ROB words");
241 if (rob.rod_fragment_size_word() <3) {
242 ATH_MSG_ERROR(
"Encountered corrupt ROD fragment, less than 3 words!");
244 return StatusCode::FAILURE;
247 }
else if(rob.rob_source_id()& 0x1000 ){
248 ATH_MSG_VERBOSE(
" skip Latome fragment with source ID "<< std::hex << rob.rob_source_id());
253 eformat::helper::Version ver(rob.rod_version());
255 if (rodBlock==
nullptr || rodMinorVersion !=ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
256 rodMinorVersion=ver.minor_version();
257 rodBlockType=rob.rod_detev_type()&0xff;
258 ATH_MSG_VERBOSE(
"Found version " << rodMinorVersion <<
" of Rod Block Type " << rodBlockType);
259 if (rodBlockType==10) {
262 else if (rodBlockType==7 || rodBlockType==2) {
263 if(rodMinorVersion>=6) {
266 ATH_MSG_ERROR(
"Found unsupported ROD Block version " << rodMinorVersion
267 <<
" of ROD block type " << rodBlockType);
271 ATH_MSG_ERROR(
"Found unsupported Rod block type " << rodBlockType <<
" in ROB sourceId: 0x" << std::hex << rob.rob_source_id () << std::dec
272 <<
", ROD source ID: 0x" << rob.rod_source_id() << std::dec);
274 return StatusCode::FAILURE;
280 const uint32_t* pData=rob.rod_data();
281 const uint32_t nData=rob.rod_ndata();
282 if (!rodBlock->setFragment(pData,nData)) {
283 ATH_MSG_ERROR(
"Failed to assign fragment pointer to LArRodBlockStructure");
284 return StatusCode::FAILURE;
288 const uint32_t onsum = rodBlock->onlineCheckSum();
289 const uint32_t offsum = rodBlock->offlineCheckSum();
293 ATH_MSG_ERROR(
"offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
295 return StatusCode::FAILURE;
307 return StatusCode::FAILURE;
313 const auto ftId=
m_onlineId->feedthrough_Id(fId);
315 ATH_MSG_DEBUG(
"Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<
" not in preselection. Ignored.");
321 const int NthisFebChannel=
m_onlineId->channelInSlotMax(fId);
327 std::vector<short> samples;
328 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
329 if (fcNb>=NthisFebChannel)
331 if (samples.size()==0)
continue;
345 std::vector<short> samples;
346 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
347 if (fcNb>=NthisFebChannel)
349 if (samples.size()==0)
continue;
350 dac = rodBlock->getDAC();
351 delay = rodBlock->getDelay();
352 ispulsed = rodBlock->getPulsed(fcNb);
363 std::vector<uint64_t> samplesSum;
364 std::vector<uint64_t> samples2Sum;
366 while (rodBlock->getNextAccumulatedDigit(fcNb,samplesSum,samples2Sum,gain)) {
367 if (fcNb>=NthisFebChannel)
369 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
370 nTrigger = rodBlock->getNTrigger();
387 uint16_t ispulsed_int;
390 std::vector<uint64_t> samplesSum;
391 std::vector<uint64_t> samples2Sum;
393 while (rodBlock->getNextAccumulatedCalibDigit(fcNb,samplesSum,samples2Sum,itmp,gain)) {
394 if (fcNb>=NthisFebChannel)
396 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
399 dac = rodBlock->getDAC();
400 delay = rodBlock->getDelay();
401 nTrigger = rodBlock->getNTrigger();
402 nstep = rodBlock->getNStep();
403 istep = rodBlock->getStepIndex();
405 const std::vector<HWIdentifier>& calibChannelIDs = calibMap->
calibSlotLine(cId);
406 for(std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); csl_it!=calibChannelIDs.end();++csl_it){
407 uint32_t calibLine =
m_onlineId->channel(*csl_it);
408 ispulsed=rodBlock->getPulsed(calibLine);
409 ispulsed_int=( ispulsed_int | ((uint16_t)ispulsed<<bitShift) );
419 std::unique_ptr<LArFebHeader> larFebHeader(
new LArFebHeader(fId));
421 febHeaders->
push_back(std::move(larFebHeader));
424 }
while (rodBlock->nextFEB());
426 return StatusCode::SUCCESS;