224 return StatusCode::SUCCESS;
235 int bunchId = eventInfo->
bcid();
241 return StatusCode::SUCCESS;
247 if (!bunchCrossing) {
249 return StatusCode::FAILURE;
257 if (!bccd->isFilled(bunchId)) {
260 return StatusCode::SUCCESS;
268 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
269 if (eventIndex < 0)
return StatusCode::FAILURE;
275 return StatusCode::SUCCESS;
280 if (larDigitContainer->
empty()) {
283 return StatusCode::SUCCESS;
289 return StatusCode::SUCCESS;
294 if (rawChannelContainer->empty()) {
297 return StatusCode::SUCCESS;
305 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
306 return StatusCode::FAILURE;
313 return StatusCode::FAILURE;
320 return StatusCode::FAILURE;
329 return StatusCode::FAILURE;
337 return StatusCode::FAILURE;
351 const std::map<unsigned int,uint16_t>& febErrorMap = larFebErrorSummary->
get_all_febs();
352 std::map<unsigned int, const LArRawChannel*> channelsToKeep;
354 for (LArRawChannelContainer::const_iterator channel = rawChannelContainer->begin();
355 channel != rawChannelContainer->end(); ++channel)
358 if (
m_bcMask.cellShouldBeMasked(bcCont,channel->channelID()))
continue;
362 if (!hash.is_valid()) {
363 ATH_MSG_FATAL (
"Found a LArRawChannel whose HWIdentifier (" << channel->channelID()
364 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
365 return StatusCode::FAILURE;
367 channelsToKeep[hash] = &*channel;
373 const Identifier id = cabling->cnvToIdentifier(channelID);
375 info =
m_dumperTool->makeCellInfo(channelID,
id, caloDetElement);
382 std::map<HWIdentifier, LArOFIterResultsContainer::const_iterator> ofcResultPosition;
384 for (LArOFIterResultsContainer::const_iterator ofResult = ofIterResult->begin();
385 ofResult != ofIterResult->end(); ++ofResult)
386 ofcResultPosition[ofResult->getChannelID()] = ofResult;
389 <<
" " << (ofIterResult ? ofIterResult->size() : 0) <<
" "
390 << rawChannelContainer->size() <<
" " << channelsToKeep.size() );
396 digit != larDigitContainer->
end(); ++digit)
401 std::map<unsigned int, const LArRawChannel*>::const_iterator findChannel = channelsToKeep.find(hash);
402 if (findChannel == channelsToKeep.end())
continue;
416 const bool connected = cabling->isOnlineConnected(channelID);
420 float pedestal = pedestals->
pedestal(channelID, gain);
421 float pedestalRMS = pedestals->
pedestalRMS(channelID, gain);
423 const std::vector<short>& samples = (*digit)->samples();
425 for (
short sample : samples)
431 const Identifier id = cabling->cnvToIdentifier(channelID);
437 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
438 info =
m_dumperTool->makeCellInfo(channelID,
id, caloDetElement);
440 histCont =
m_samples->makeNewHistory(hash, info);
446 unsigned int status = 0xFFFFFFFF;
448 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
449 noise = noiseCDO->
getNoise(
id,gain);
453 if (findError != febErrorMap.end()) {
454 unsigned int febErrWord = findError->second;
455 status = status & (febErrWord >> 17);
464 ATH_MSG_WARNING (
"AutoCorr object is not of type LArAutoCorrComplete!" );
466 autoCorr = autoCorrObj->
autoCorr(channelID, gain);
469 if (!info->shape((*digit)->gain()))
470 info->setShape((*digit)->gain(),
m_dumperTool->retrieveShape(channelID, gain));
473 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
474 if (eventIndex < 0)
return StatusCode::FAILURE;
480 rawChannel->
time()/
double(1000),
484 noise, pedestal, pedestalRMS, status);
497 const auto ramp=adc2MeV->
ADC2MEV(channelID,gain);
498 data->setADCMax(rawChannel->
energy()/ramp[1]);
505 std::map<unsigned int, const LArRawSC*> scToKeep;
510 return StatusCode::SUCCESS;
514 if (hdlSC->empty()) {
516 return StatusCode::SUCCESS;
522 return StatusCode::SUCCESS;
526 if (hdlrecoSC->empty()) {
528 return StatusCode::SUCCESS;
534 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
535 return StatusCode::FAILURE;
545 ATH_MSG_ERROR(
"Failed to retrieve pedestal cond obj for SC");
546 return StatusCode::FAILURE;
549 std::map<unsigned int, std::pair<float, std::pair<float,float> > > channelsToKeepSC;
551 for (
const LArRawSC* rawSC : *hdlSC) {
554 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
556 const std::vector<unsigned short>& bcids = rawSC->bcids();
557 const std::vector<int>& energies = rawSC->energies();
558 const std::vector<bool>& satur = rawSC->satur();
562 float defValue = -99999999.;
564 const size_t nBCIDs = bcids.size();
566 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
568 if(i==nBCIDs)
continue;
569 if (satur[i])
continue;
573 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
577 if (!hash.is_valid()) {
578 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
579 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
580 return StatusCode::FAILURE;
583 channelsToKeepSC[hash] = std::make_pair(scEne, std::make_pair(defValue,defValue));
592 info =
m_dumperToolSC->makeCellInfo(channelID,
id, caloDetElement);
598 ATH_MSG_INFO(
"SC to keep in this event: "<<channelsToKeepSC.size());
600 for (
const LArRawSC* rawSC : *hdlrecoSC) {
602 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
604 if (!hash.is_valid()) {
605 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
606 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
607 return StatusCode::FAILURE;
611 if (channelsToKeepSC.find(hash) == channelsToKeepSC.end())
continue;
613 const std::vector<unsigned short>& bcids = rawSC->bcids();
614 const std::vector<int>& energies = rawSC->energies();
615 const std::vector<int>& tauenergies = rawSC->tauEnergies();
619 float scTim = -99999999.;
621 const size_t nBCIDs = bcids.size();
623 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
625 if(i==nBCIDs)
continue;
629 if(tauenergies.size() && scEne != 0) scTim = tauenergies[i] / scEne;
631 channelsToKeepSC[hash].second = std::make_pair(scEne, scTim);
640 info =
m_dumperToolSC->makeCellInfo(channelID,
id, caloDetElement);
650 return StatusCode::SUCCESS;
655 if (larSCDigitContainer->
empty()) {
658 return StatusCode::SUCCESS;
662 digit != larSCDigitContainer->
end(); ++digit)
667 std::map<unsigned int, std::pair<float, std::pair<float,float> > >
::const_iterator findChannel = channelsToKeepSC.find(hash);
668 if (findChannel == channelsToKeepSC.end())
continue;
671 float pedestal = pedestalsSC->
pedestal((*digit)->channelID(), 0);
673 const std::vector<short>& samples = (*digit)->samples();
675 for (
short sample : samples)
686 if (!caloDetElement) caloDetElement = caloMgrSC->
get_element(
id);
687 info =
m_dumperToolSC->makeCellInfo((*digit)->channelID(),
id, caloDetElement);
689 histCont =
m_samples->makeNewHistorySC(hash, info);
695 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
696 if (eventIndex < 0)
return StatusCode::FAILURE;
701 findChannel->second.first,
702 findChannel->second.second.second,
703 findChannel->second.second.first,
714 return StatusCode::SUCCESS;