43 std::set<unsigned> fts;
45 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});
48 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});
61 ATH_MSG_INFO(
"Adding feedthrough Barrel/Endcap=" << iBE <<
" pos/neg=" << iPN <<
" FT=" << iFT
63 <<
" " << std::hex << finalFTId << std::dec <<
")");
72 std::set<HWIdentifier> subcaloFTs;
76 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
84 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
91 subcaloFTs.insert(
m_onlineId->feedthrough_Id(febid));
97 return StatusCode::FAILURE;
99 std::cout <<
"set sizes:" << subcaloFTs.size() <<
", " <<
m_vFinalPreselection.size() << std::endl;
103 if (subcaloFTs.find(*it)==subcaloFTs.end())
109 ATH_MSG_WARNING(
"Apparently inconistent configuration of FT preselections. No preselection left after intersecting 'SubCaloPreselection' with 'PosNeg/BE/FT' preselection");
121 return StatusCode::SUCCESS;
131 ATH_CHECK(rawChannelsHdl.
record(std::make_unique<LArRawChannelContainer>()));
132 rawChannels=rawChannelsHdl.
ptr();
133 rawChannels->reserve(182468);
139 digits=digitsHdl.
ptr();
145 ATH_CHECK(febHeadersHdl.
record(std::make_unique<LArFebHeaderContainer>()));
146 febHeaders=febHeadersHdl.
ptr();
152 std::map<eformat::SubDetectorGroup, std::vector<const uint32_t*> > rawEventTOC;
153 eformat::helper::build_toc(*fullEvent, rawEventTOC);
154 auto larRobs=rawEventTOC.find(eformat::LAR);
155 if (larRobs==rawEventTOC.end()) {
156 ATH_MSG_DEBUG(
"No LAr data found in this event. Recording empty LArRawChannelContainer");
157 return StatusCode::SUCCESS;
161 std::unique_ptr<LArRodBlockStructure> rodBlock;
162 uint16_t rodMinorVersion=0x0;
163 uint32_t rodBlockType=0x0;
166 for (
const uint32_t* robPtr : larRobs->second) {
168 ATH_MSG_VERBOSE(
"Decoding ROB fragment 0x" << std::hex << rob.rob_source_id () <<
" with " << std::dec << rob.rod_fragment_size_word() <<
" ROB words");
170 if (rob.rod_fragment_size_word() <3) {
172 ATH_MSG_ERROR(
"Encountered corrupt ROD fragment, less than 3 words!");
173 return StatusCode::FAILURE;
177 }
else if(rob.rob_source_id()& 0x1000 ){
181 }
else if(!(rob.rod_source_id()>>12& 0x0F)
182 && !((rob.rod_source_id()>>20) == 4) ){
184 ATH_MSG_WARNING(
"Found not LAr fragment " <<
" event: "<<ctx.eventID().event_number());
186 ATH_MSG_WARNING(
"Rob source id.: 0x"<< std::hex << rob.rob_source_id () <<std::dec <<
" ROD Source id: 0x"<<std::hex<<rob.rod_source_id()<<std::dec<<
" Lvl1ID: "<<eventInfo->extendedLevel1ID());
191 eformat::helper::Version ver(rob.rod_version());
193 if (rodBlock==
nullptr || rodMinorVersion !=ver.minor_version() || rodBlockType!=(rob.rod_detev_type()&0xff)) {
194 rodMinorVersion=ver.minor_version();
195 rodBlockType=rob.rod_detev_type()&0xff;
196 ATH_MSG_VERBOSE(
"Found version " << rodMinorVersion <<
" of Rod Block Type " << rodBlockType);
197 if (rodBlockType==4) {
198 switch(rodMinorVersion) {
208 ATH_MSG_ERROR(
"Found unsupported ROD Block version " << rodMinorVersion
209 <<
" of ROD block type " << rodBlockType <<
". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
210 return StatusCode::FAILURE;
213 ATH_MSG_WARNING(
"Found unsupported ROD Block version " << rodMinorVersion
214 <<
" of ROD block type " << rodBlockType <<
". ROD Source id: 0x" <<std::hex<<rob.rod_source_id());
219 else if (rodBlockType==2) {
220 switch(rodMinorVersion) {
228 ATH_MSG_WARNING(
"Found unsupported ROD Block version " << rodMinorVersion
229 <<
" of ROD block type " << rodBlockType);
235 const uint32_t* pData=rob.rod_data();
236 const uint32_t nData=rob.rod_ndata();
239 ATH_MSG_ERROR(
"ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec <<
" reports data block size 0");
240 return StatusCode::FAILURE;
243 ATH_MSG_WARNING(
"ROD 0x"<<std::hex<<rob.rod_source_id() << std::dec <<
" reports data block size 0");
248 if (!rodBlock || !rodBlock->setFragment(pData,nData)) {
250 ATH_MSG_ERROR(
"Failed to assign fragment pointer to LArRodBlockStructure");
251 return StatusCode::FAILURE;
254 ATH_MSG_WARNING(
"Failed to assign fragment pointer to LArRodBlockStructure");
260 const uint32_t onsum = rodBlock->onlineCheckSum();
261 const uint32_t offsum = rodBlock->offlineCheckSum();
266 ATH_MSG_ERROR(
"offline checksum = 0x" << MSG::hex << offsum << MSG::dec);
267 return StatusCode::FAILURE;
280 return StatusCode::FAILURE;
288 const auto ftId=
m_onlineId->feedthrough_Id(fId);
290 ATH_MSG_DEBUG(
"Feedthrough with id " << MSG::hex << ftId << MSG::dec <<
" not in preselection. Ignored.");
293 ATH_MSG_DEBUG(
"Feedthrough with id " << MSG::hex << ftId << MSG::dec <<
" is preselected.");
297 const int NthisFebChannel=
m_onlineId->channelInSlotMax(fId);
306 while (rodBlock->getNextEnergy(fcNb,energy,time,quality,gain)) {
307 if (fcNb>=NthisFebChannel)
311 uint16_t iquality = 0;
315 iquality = (quality & 0xFFFF);
317 rawChannels->emplace_back(cId, energy, time, iquality, iprovenance, (
CaloGain::CaloGain)gain);
325 std::vector<short> samples;
326 while (rodBlock->getNextRawData(fcNb,samples,gain)) {
327 if (fcNb>=NthisFebChannel)
329 if (samples.size()==0)
continue;
338 std::unique_ptr<LArFebHeader> larFebHeader(
new LArFebHeader(fId));
340 febHeaders->
push_back(std::move(larFebHeader));
343 }
while (rodBlock->nextFEB());
345 return StatusCode::SUCCESS;