Skip to content

Commit 35f585c

Browse files
AlexWilkinsonnnAndyChappell
authored andcommitted
refactor color iter logic
1 parent 6fb1f82 commit 35f585c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

larpandoracontent/LArMonitoring/VisualMonitoringAlgorithm.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,18 @@ void VisualMonitoringAlgorithm::VisualizeCaloHitList(const std::string &listName
218218
volIdToCaloHits[volId].push_back(pCaloHit);
219219
}
220220

221-
[[maybe_unused]] int colorIter{0};
221+
#ifdef MONITORING
222+
Color colorIter{BLACK};
222223
for (const auto &[volId, caloHitListPartition] : volIdToCaloHits)
223224
{
224225
const std::string label{(listName.empty() ? "CurrentCaloHits" : listName) +
225226
", volId (" + std::to_string(volId.first) + ", " + std::to_string(volId.second) + ")"};
226-
PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &caloHitListPartition, label.c_str(),
227-
static_cast<Color>(++colorIter) < AUTO ? static_cast<Color>(colorIter)
228-
: (colorIter % static_cast<int>(AUTO)) == 0 ? static_cast<Color>(++colorIter % static_cast<int>(AUTO))
229-
: static_cast<Color>(colorIter % static_cast<int>(AUTO))));
227+
PANDORA_MONITORING_API(VisualizeCaloHits(this->GetPandora(), &caloHitListPartition, label.c_str(), colorIter));
228+
colorIter = static_cast<Color>(static_cast<int>(colorIter) + 1);
229+
if (colorIter >= AUTO)
230+
colorIter = BLACK;
230231
}
232+
#endif
231233
}
232234

233235
//------------------------------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)