Skip to content

Commit

Permalink
fixup! added test and proper parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Aug 27, 2024
1 parent 180b777 commit 078b1d9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Framework/include/QualityControl/TrendingTaskConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct TrendingTaskConfig : PostProcessingConfig {

bool producePlotsOnUpdate{};
bool resumeTrend{};
bool trendOnlyIfAllInputsAreAvailable{ false };
bool trendIfAllInputs{ false };
std::vector<Plot> plots;
std::vector<DataSource> dataSources;
};
Expand Down
4 changes: 2 additions & 2 deletions Framework/src/TrendingTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void TrendingTask::update(Trigger t, framework::ServiceRegistryRef services)
auto& qcdb = services.get<repository::DatabaseInterface>();

const auto allSourcesInvoked = trendValues(t, qcdb);
if (mConfig.producePlotsOnUpdate && (!mConfig.trendOnlyIfAllInputsAreAvailable || allSourcesInvoked)) {
if (mConfig.producePlotsOnUpdate && (!mConfig.trendIfAllInputs || allSourcesInvoked)) {
generatePlots();
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ bool TrendingTask::trendValues(const Trigger& t, repository::DatabaseInterface&
}
}

if (!mConfig.trendOnlyIfAllInputsAreAvailable || wereAllSourcesInvoked) {
if (!mConfig.trendIfAllInputs || wereAllSourcesInvoked) {
mTrend->Fill();
}

Expand Down
2 changes: 1 addition & 1 deletion Framework/src/TrendingTaskConfig.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TrendingTaskConfig::TrendingTaskConfig(std::string id, const boost::property_tre
{
producePlotsOnUpdate = config.get<bool>("qc.postprocessing." + id + ".producePlotsOnUpdate", true);
resumeTrend = config.get<bool>("qc.postprocessing." + id + ".resumeTrend", false);
trendOnlyIfAllInputsAreAvailable = config.get<bool>("qc.postprocessing." + id + ".trendOnlyIfAllInputsAreAvailable", false);
trendIfAllInputs = config.get<bool>("qc.postprocessing." + id + ".trendIfAllInputs", false);

for (const auto& [_, plotConfig] : config.get_child("qc.postprocessing." + id + ".plots")) {
// since QC-1155 we allow for more than one graph in a single plot (canvas). we support both the new and old ways
Expand Down
4 changes: 2 additions & 2 deletions Framework/test/testTrendingTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ TEST_CASE("test_trending_task")
"active": "true",
"taskName": "TestTrendingTask",
"className": "o2::quality_control::postprocessing::TrendingTask",
"trendOnlyIfAllInputsAreAvailable": true,
"trendIfAllInputs": true,
"moduleName": "QualityControl",
"detectorName": "TST",
"dataSources": [
Expand Down Expand Up @@ -134,7 +134,7 @@ TEST_CASE("test_trending_task")
repository->truncate("qc/TST/MO/" + taskName, "*");
repository->truncate("qc/TST/QO", checkName);

// Test "trendOnlyIfAllInputsAreAvailable". There should not be anything in DB so we don't have any input sources available
// Test "trendIfAllInputs". There should not be anything in DB so we don't have any input sources available
{
auto objectManager = std::make_shared<ObjectsManager>(taskName, "o2::quality_control::postprocessing::TrendingTask", "TST", "");
ServiceRegistry services;
Expand Down
2 changes: 1 addition & 1 deletion doc/PostProcessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ use the boolean flag `"producePlotsOnUpdate"`.

To pick up the last existing trend which matches the specified Activity, set `"resumeTrend"` to `"true"`.

To generate plots only when all input objects are available, set `"trendOnlyIfAllInputsAreAvailable"`.
To generate plots only when all input objects are available, set `"trendIfAllInputs"`.

### The SliceTrendingTask class
The `SliceTrendingTask` is a complementary task to the standard `TrendingTask`. This task allows the trending of canvas objects that hold multiple histograms (which have to be of the same dimension, e.g. TH1) and the slicing of histograms. The latter option allows the user to divide a histogram into multiple subsections along one or two dimensions which are trended in parallel to each other. The task has specific reductors for `TH1` and `TH2` objects which are `o2::quality_control_modules::common::TH1SliceReductor` and `o2::quality_control_modules::common::TH2SliceReductor`.
Expand Down

0 comments on commit 078b1d9

Please sign in to comment.