Skip to content

Commit

Permalink
commit forgotten change
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannimarchiori committed Sep 13, 2024
1 parent 43f3355 commit 88e9e20
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion RecCalorimeter/src/components/CreateCaloCells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,14 @@ StatusCode CreateCaloCells::execute(const EventContext&) const {

// 0. Clear all cells
if (m_addCellNoise) {
std::for_each(m_cellsMap.begin(), m_cellsMap.end(), [](std::pair<const uint64_t, double>& p) { p.second = 0; });
// if cells are not filtered, the map has same size in each event, equal to the total number
// of cells in the calorimeter, so we can just reset the values to 0
// if cells are filtered, during each event they are removed from the cellsMap, so one has to
// restore the initial map of all empty cells
if (!m_filterCellNoise)
std::for_each(m_cellsMap.begin(), m_cellsMap.end(), [](std::pair<const uint64_t, double>& p) { p.second = 0; });
else
m_cellsMap = m_emptyCellsMap;
} else {
m_cellsMap.clear();
}
Expand Down

0 comments on commit 88e9e20

Please sign in to comment.