13 #include "eformat/Version.h"
14 #include "eformat/index.h"
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});
109 ATH_MSG_INFO(
"Adding feedthrough Barrel/Endcap=" << iBE <<
" pos/neg=" << iPN <<
" FT=" << iFT
119 std::set<HWIdentifier> subcaloFTs;
144 return StatusCode::FAILURE;
146 std::cout <<
"set sizes:" << subcaloFTs.size() <<
", " <<
m_vFinalPreselection.size() << std::endl;
150 if (subcaloFTs.find(*
it)==subcaloFTs.end())
156 ATH_MSG_WARNING(
"Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
168 return StatusCode::SUCCESS;
181 digits=digitsHdl.
ptr();
187 ATH_CHECK(cdigitsHdl.
record(std::make_unique<LArCalibDigitContainer>()));
188 cdigits=cdigitsHdl.
ptr();
194 ATH_CHECK(accdigitsHdl.
record(std::make_unique<LArAccumulatedDigitContainer>()));
195 accdigits=accdigitsHdl.
ptr();
201 ATH_CHECK(caccdigitsHdl.
record(std::make_unique<LArAccumulatedCalibDigitContainer>()));
202 caccdigits=caccdigitsHdl.
ptr();
208 ATH_CHECK(febHeadersHdl.
record(std::make_unique<LArFebHeaderContainer>()));
209 febHeaders=febHeadersHdl.
ptr();
215 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
216 eformat::helper::build_toc(*fullEvent, rawEventTOC);
218 if (larRobs==rawEventTOC.end()) {
220 return StatusCode::SUCCESS;
224 std::unique_ptr<LArRodBlockStructure> rodBlock;
234 return StatusCode::FAILURE;
238 for (
const uint32_t* robPtr : larRobs->second) {
240 ATH_MSG_VERBOSE(
"Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () <<
" with " << std::dec << rob.rod_fragment_size_word() <<
"ROB words");
242 if (rob.rod_fragment_size_word() <3) {
243 ATH_MSG_ERROR(
"Encountered corrupt ROD fragment, less than 3 words!");
245 return StatusCode::FAILURE;
248 }
else if(rob.rob_source_id()& 0x1000 ){
249 ATH_MSG_VERBOSE(
" skip Latome fragment with source ID "<< std::hex << rob.rob_source_id());
254 eformat::helper::Version
ver(rob.rod_version());
256 if (rodBlock==
nullptr || rodMinorVersion !=
ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
257 rodMinorVersion=
ver.minor_version();
258 rodBlockType=rob.rod_detev_type()&0xff;
259 ATH_MSG_VERBOSE(
"Found version " << rodMinorVersion <<
" of Rod Block Type " << rodBlockType);
260 if (rodBlockType==10) {
263 else if (rodBlockType==7 || rodBlockType==2) {
264 if(rodMinorVersion>=6) {
267 ATH_MSG_ERROR(
"Found unsupported ROD Block version " << rodMinorVersion
268 <<
" of ROD block type " << rodBlockType);
272 ATH_MSG_ERROR(
"Found unsupported Rod block type " << rodBlockType <<
" in ROB sourceId: 0x" << std::hex << rob.rob_source_id () << std::dec
273 <<
", ROD source ID: 0x" << rob.rod_source_id() << std::dec);
275 return StatusCode::FAILURE;
281 const uint32_t* pData=rob.rod_data();
282 const uint32_t nData=rob.rod_ndata();
284 ATH_MSG_ERROR(
"Failed to assign fragment pointer to LArRodBlockStructure");
285 return StatusCode::FAILURE;
294 ATH_MSG_ERROR(
"offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
296 return StatusCode::FAILURE;
308 return StatusCode::FAILURE;
316 ATH_MSG_DEBUG(
"Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<
" not in preselection. Ignored.");
328 std::vector<short> samples;
330 if (fcNb>=NthisFebChannel)
332 if (samples.size()==0)
continue;
346 std::vector<short> samples;
348 if (fcNb>=NthisFebChannel)
350 if (samples.size()==0)
continue;
364 std::vector<uint64_t> samplesSum;
365 std::vector<uint64_t> samples2Sum;
368 if (fcNb>=NthisFebChannel)
370 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
391 std::vector<uint64_t> samplesSum;
392 std::vector<uint64_t> samples2Sum;
395 if (fcNb>=NthisFebChannel)
397 if (samplesSum.size()==0 || samples2Sum.size()==0)
continue;
406 const std::vector<HWIdentifier>& calibChannelIDs = calibMap->
calibSlotLine(cId);
407 for(std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); csl_it!=calibChannelIDs.end();++csl_it){
410 ispulsed_int=( ispulsed_int | ((
uint16_t)ispulsed<<bitShift) );
420 std::unique_ptr<LArFebHeader> larFebHeader(
new LArFebHeader(fId));
422 febHeaders->
push_back(std::move(larFebHeader));
427 return StatusCode::SUCCESS;