221 const EventContext& ctx = Gaudi::Hive::currentContext();
225 return StatusCode::SUCCESS;
236 int bunchId = eventInfo->
bcid();
242 return StatusCode::SUCCESS;
248 if (!bunchCrossing) {
250 return StatusCode::FAILURE;
258 if (!bccd->isFilled(bunchId)) {
261 return StatusCode::SUCCESS;
269 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
270 if (eventIndex < 0)
return StatusCode::FAILURE;
276 return StatusCode::SUCCESS;
281 if (larDigitContainer->
empty()) {
284 return StatusCode::SUCCESS;
290 return StatusCode::SUCCESS;
295 if (rawChannelContainer->empty()) {
298 return StatusCode::SUCCESS;
306 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
307 return StatusCode::FAILURE;
314 return StatusCode::FAILURE;
321 return StatusCode::FAILURE;
330 return StatusCode::FAILURE;
338 return StatusCode::FAILURE;
352 const std::map<unsigned int,uint16_t>& febErrorMap = larFebErrorSummary->
get_all_febs();
353 std::map<unsigned int, const LArRawChannel*> channelsToKeep;
355 for (LArRawChannelContainer::const_iterator channel = rawChannelContainer->begin();
356 channel != rawChannelContainer->end(); ++channel)
359 if (
m_bcMask.cellShouldBeMasked(bcCont,channel->channelID()))
continue;
363 if (!hash.is_valid()) {
364 ATH_MSG_FATAL (
"Found a LArRawChannel whose HWIdentifier (" << channel->channelID()
365 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
366 return StatusCode::FAILURE;
368 channelsToKeep[hash] = &*channel;
374 const Identifier id = cabling->cnvToIdentifier(channelID);
376 info =
m_dumperTool->makeCellInfo(channelID,
id, caloDetElement);
383 std::map<HWIdentifier, LArOFIterResultsContainer::const_iterator> ofcResultPosition;
385 for (LArOFIterResultsContainer::const_iterator ofResult = ofIterResult->begin();
386 ofResult != ofIterResult->end(); ++ofResult)
387 ofcResultPosition[ofResult->getChannelID()] = ofResult;
390 <<
" " << (ofIterResult ? ofIterResult->size() : 0) <<
" "
391 << rawChannelContainer->size() <<
" " << channelsToKeep.size() );
397 digit != larDigitContainer->
end(); ++digit)
402 std::map<unsigned int, const LArRawChannel*>::const_iterator findChannel = channelsToKeep.find(hash);
403 if (findChannel == channelsToKeep.end())
continue;
417 const bool connected = cabling->isOnlineConnected(channelID);
421 float pedestal = pedestals->
pedestal(channelID, gain);
422 float pedestalRMS = pedestals->
pedestalRMS(channelID, gain);
424 const std::vector<short>& samples = (*digit)->samples();
426 for (
short sample : samples)
432 const Identifier id = cabling->cnvToIdentifier(channelID);
438 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
439 info =
m_dumperTool->makeCellInfo(channelID,
id, caloDetElement);
441 histCont =
m_samples->makeNewHistory(hash, info);
447 unsigned int status = 0xFFFFFFFF;
449 if (!caloDetElement) caloDetElement = caloMgr->
get_element(
id);
450 noise = noiseCDO->
getNoise(
id,gain);
454 if (findError != febErrorMap.end()) {
455 unsigned int febErrWord = findError->second;
456 status = status & (febErrWord >> 17);
465 ATH_MSG_WARNING (
"AutoCorr object is not of type LArAutoCorrComplete!" );
467 autoCorr = autoCorrObj->
autoCorr(channelID, gain);
470 if (!info->shape((*digit)->gain()))
471 info->setShape((*digit)->gain(),
m_dumperTool->retrieveShape(channelID, gain));
474 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
475 if (eventIndex < 0)
return StatusCode::FAILURE;
481 rawChannel->
time()/
double(1000),
485 noise, pedestal, pedestalRMS, status);
498 const auto ramp=adc2MeV->
ADC2MEV(channelID,gain);
499 data->setADCMax(rawChannel->
energy()/ramp[1]);
506 std::map<unsigned int, const LArRawSC*> scToKeep;
511 return StatusCode::SUCCESS;
515 if (hdlSC->empty()) {
517 return StatusCode::SUCCESS;
523 return StatusCode::SUCCESS;
527 if (hdlrecoSC->empty()) {
529 return StatusCode::SUCCESS;
535 ATH_MSG_ERROR(
"Do not have cabling object LArOnOffIdMapping" );
536 return StatusCode::FAILURE;
546 ATH_MSG_ERROR(
"Failed to retrieve pedestal cond obj for SC");
547 return StatusCode::FAILURE;
550 std::map<unsigned int, std::pair<float, std::pair<float,float> > > channelsToKeepSC;
552 for (
const LArRawSC* rawSC : *hdlSC) {
555 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
557 const std::vector<unsigned short>& bcids = rawSC->bcids();
558 const std::vector<int>& energies = rawSC->energies();
559 const std::vector<bool>& satur = rawSC->satur();
563 float defValue = -99999999.;
565 const size_t nBCIDs = bcids.size();
567 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
569 if(i==nBCIDs)
continue;
570 if (satur[i])
continue;
574 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
578 if (!hash.is_valid()) {
579 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
580 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
581 return StatusCode::FAILURE;
584 channelsToKeepSC[hash] = std::make_pair(scEne, std::make_pair(defValue,defValue));
593 info =
m_dumperToolSC->makeCellInfo(channelID,
id, caloDetElement);
599 ATH_MSG_INFO(
"SC to keep in this event: "<<channelsToKeepSC.size());
601 for (
const LArRawSC* rawSC : *hdlrecoSC) {
603 if (
m_bcMaskSC.cellShouldBeMasked(bcCont,rawSC->hardwareID()))
continue;
605 if (!hash.is_valid()) {
606 ATH_MSG_FATAL (
"Found a LArRawSC whose HWIdentifier (" << rawSC->hardwareID()
607 <<
") does not correspond to a valid hash -- returning StatusCode::FAILURE." );
608 return StatusCode::FAILURE;
612 if (channelsToKeepSC.find(hash) == channelsToKeepSC.end())
continue;
614 const std::vector<unsigned short>& bcids = rawSC->bcids();
615 const std::vector<int>& energies = rawSC->energies();
616 const std::vector<int>& tauenergies = rawSC->tauEnergies();
620 float scTim = -99999999.;
622 const size_t nBCIDs = bcids.size();
624 for (i = 0; i < nBCIDs && bcids[i] != bunchId; i++)
626 if(i==nBCIDs)
continue;
630 if(tauenergies.size() && scEne != 0) scTim = tauenergies[i] / scEne;
632 channelsToKeepSC[hash].second = std::make_pair(scEne, scTim);
641 info =
m_dumperToolSC->makeCellInfo(channelID,
id, caloDetElement);
651 return StatusCode::SUCCESS;
656 if (larSCDigitContainer->
empty()) {
659 return StatusCode::SUCCESS;
663 digit != larSCDigitContainer->
end(); ++digit)
668 std::map<unsigned int, std::pair<float, std::pair<float,float> > >
::const_iterator findChannel = channelsToKeepSC.find(hash);
669 if (findChannel == channelsToKeepSC.end())
continue;
672 float pedestal = pedestalsSC->
pedestal((*digit)->channelID(), 0);
674 const std::vector<short>& samples = (*digit)->samples();
676 for (
short sample : samples)
687 if (!caloDetElement) caloDetElement = caloMgrSC->
get_element(
id);
688 info =
m_dumperToolSC->makeCellInfo((*digit)->channelID(),
id, caloDetElement);
690 histCont =
m_samples->makeNewHistorySC(hash, info);
696 eventIndex =
makeEvent(eventData,
run, event, lumiBlock, bunchId);
697 if (eventIndex < 0)
return StatusCode::FAILURE;
702 findChannel->second.first,
703 findChannel->second.second.second,
704 findChannel->second.second.first,
715 return StatusCode::SUCCESS;