Skip to content

Commit

Permalink
[QC-1049] Clear QualityTask members before initializing (#2092)
Browse files Browse the repository at this point in the history
* Remove unused member of QualityTask

* [QC-1049] Clear QualityTask member before initializing

In case of the Start->Stop->Start, the later emplace calls in the initialize method were not effective, since values already existed for given keys.
Thus, old histograms and trends were used instead.
  • Loading branch information
knopers8 authored Jan 22, 2024
1 parent 53ac15e commit c012aa5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Modules/Common/include/Common/QualityTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ class QualityTask : public quality_control::postprocessing::PostProcessingInterf
std::unordered_map<std::string, int> mColors;
/// \brief numerical IDs associated to each quality state (Good/Medium/Bad/Null)
std::unordered_map<std::string, int> mQualityIDs;
/// \brief messages associated to each quality state (Good/Medium/Bad/Null)
std::unordered_map<std::string, std::string> mCheckerMessages;
/// \brief Quality Objects histograms
std::unordered_map<std::string, std::unique_ptr<TH1F>> mHistograms;
/// \brief Quality Objects trends
Expand Down
7 changes: 7 additions & 0 deletions Modules/Common/src/QualityTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ static void setQualityLabels(TH1F* h)

void QualityTask::initialize(quality_control::postprocessing::Trigger t, framework::ServiceRegistryRef services)
{
mLatestTimestamps.clear();
mColors.clear();
mQualityIDs.clear();
mHistograms.clear();
mTrends.clear();
mQualityCanvas.reset();

mColors[Quality::Null.getName()] = kViolet - 6;
mColors[Quality::Bad.getName()] = kRed;
mColors[Quality::Medium.getName()] = kOrange - 3;
Expand Down

0 comments on commit c012aa5

Please sign in to comment.