Skip to content

Commit 20f07e6

Browse files
pnwkwdavidrohr
authored andcommitted
Optimize calorimeter energy aggregation in EventDisplay
1 parent 2d72a1b commit 20f07e6

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

EventVisualisation/Scripts/.o2eve_config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ phos.barrel.radius: 550
4040
phos.tower.color: 65
4141
phos.tower.noise 1
4242
phos.tower.scale: 1
43-
phos.tower.size.eta: 0.0143
44-
phos.tower.size.phi: 0.0143
43+
phos.tower.size.eta: 0.0046
44+
phos.tower.size.phi: 0.00478
4545
phos.tower.max.height: 80
4646
phos.tower.max.val.abs: 50
4747

EventVisualisation/View/src/EventManager.cxx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ void EventManager::displayVisualisationEvent(VisualisationEvent& event, const st
281281

282282
void EventManager::displayCalorimeters(VisualisationEvent& event, const std::string& detectorName)
283283
{
284-
int size = event.getCaloCount();
285-
if (size > 0) {
286-
const std::string detector = detectorName == "EMC" ? "emcal" : "phos";
284+
if (event.getCaloCount() > 0) {
287285
struct CaloInfo {
288286
std::string name;
289287
std::string configColor;
@@ -333,9 +331,7 @@ void EventManager::displayCalorimeters(VisualisationEvent& event, const std::str
333331
};
334332
std::unordered_map<std::pair<float, float>, float, pair_hash> map; // sum up entries for the same tower
335333
for (const auto& calo : event.getCalorimetersSpan()) {
336-
auto key = std::make_pair(calo.getEta(), calo.getPhi());
337-
map.try_emplace(key, 0);
338-
map[key] = map[key] + calo.getEnergy();
334+
map[std::make_pair(calo.getEta(), calo.getPhi())] += calo.getEnergy();
339335
}
340336

341337
for (const auto& entry : map) {

0 commit comments

Comments
 (0)