From 1220aec323614db1dc65474143b3fda2fa1995d7 Mon Sep 17 00:00:00 2001 From: Markus Fasel Date: Tue, 19 Jan 2021 09:52:50 +0100 Subject: [PATCH] [EMCAL-630] Fix assignment of energy and time - Energy must be protected only against negative energies - Time from the raw fit also only protected against negative entries - Cell converter needs to store amplitued and time from the raw fit results. --- Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx b/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx index 41e30aba9eca0..c710a33ffde05 100644 --- a/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx +++ b/Detectors/EMCAL/workflow/src/RawToCellConverterSpec.cxx @@ -131,15 +131,14 @@ void RawToCellConverterSpec::run(framework::ProcessingContext& ctx) int CellID = mGeometry->GetAbsCellIdFromCellIndexes(iSM, iRow, iCol); // define the conatiner for the fit results, and perform the raw fitting using the stadnard raw fitter - double amp = 0., time = 0.; o2::emcal::CaloFitResults fitResults = mRawFitter->evaluate(chan.getBunches(), 0, 0); - if (fitResults.getAmp() > 0) { + if (fitResults.getAmp() < 0) { fitResults.setAmp(0.); } if (fitResults.getTime() < 0) { fitResults.setTime(0.); } - currentCellContainer->emplace_back(CellID, amp * CONVADCGEV, time, chantype); + currentCellContainer->emplace_back(CellID, fitResults.getAmp() * CONVADCGEV, fitResults.getTime(), chantype); } } }