Skip to content

Commit

Permalink
TPC: Update Quality Aggregator
Browse files Browse the repository at this point in the history
  • Loading branch information
mlesch authored and wiechula committed Aug 4, 2023
1 parent d52f191 commit 0e4007f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Modules/TPC/src/TPCAggregator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ std::map<std::string, Quality> TPCAggregator::aggregate(QualityObjectsMapType& q
AggregatorMetaData[Quality::Bad.getName()] = "";
AggregatorMetaData[Quality::Medium.getName()] = "";
AggregatorMetaData[Quality::Good.getName()] = "";
AggregatorMetaData["Comment"] = "";

std::unordered_map<std::string, std::string> AggregatorComment;
AggregatorComment[Quality::Null.getName()] = "";
AggregatorComment[Quality::Bad.getName()] = "";
AggregatorComment[Quality::Medium.getName()] = "";
AggregatorComment[Quality::Good.getName()] = "";

// we return the worse quality of all the objects we receive, but we preserve all FlagReasons
Quality current = Quality::Good;
Expand All @@ -61,7 +66,7 @@ std::map<std::string, Quality> TPCAggregator::aggregate(QualityObjectsMapType& q
insertQOName(qoMetaDataComment, insertTitle);

AggregatorMetaData[qo->getQuality().getName()] += qoMetaData;
AggregatorMetaData["Comment"] += qoMetaDataComment;
AggregatorComment[qo->getQuality().getName()] += qoMetaDataComment;

if (qo->getQuality().isWorseThan(current)) {
current.set(qo->getQuality());
Expand All @@ -73,7 +78,7 @@ std::map<std::string, Quality> TPCAggregator::aggregate(QualityObjectsMapType& q
current.addMetadata(Quality::Medium.getName(), AggregatorMetaData[Quality::Medium.getName()]);
current.addMetadata(Quality::Good.getName(), AggregatorMetaData[Quality::Good.getName()]);
current.addMetadata(Quality::Null.getName(), AggregatorMetaData[Quality::Null.getName()]);
current.addMetadata("Comment", AggregatorMetaData["Comment"]);
current.addMetadata("Comment", AggregatorComment[current.getName()]);

return { { mName, current } };
}
Expand Down

0 comments on commit 0e4007f

Please sign in to comment.