Skip to content

Conversation

@aferrero2707
Copy link
Contributor

The changes in the PR allow to use the ReferenceComparatorTask as a base class, providing access to the reference comparison plots for the derived classes.

A typical use case would be a post-processing task that produces some derived plots, which also need to compared with some reference.

With the current production code, this involves adding a dedicated ReferenceComparatorTask in the workflow, that fetches the plots from the post-processing task from the QCDB.

This commit allows to solve the above problem by deriving the post-processing task from the ReferenceComparatorTask, such that the reference comparison plots can be filled directly by the derived task, without going through the QCDB.

This is achieved with the following two changes:

  • addition of a function that exposes the reference comparison plots in the ReferenceComparatorTask interface
  • storage of the pointer to the reference histogram in the ReferenceComparatorPlot object, such that it does not need to be passed to the update() method

The PR also adds to the ReferenceUtils.h header file the functions that allow to access the current, reference and ratio plots from the TCanvas created by the ReferenceComparartorPlot class.

This is for example needed to allow custom checkers to access the output of the reference comparison.

@aferrero2707
Copy link
Contributor Author

aferrero2707 commented Jul 2, 2025

@Barthelemy @knopers8 @justonedev1 this is another PR related to the reference comparator task. I am preparing another PR for the MCH code that will make use of the new functionality introduced here, that is to compare some plots with their references within the post-processing task that creates the plots, without having to run a dedicated ReferenceComparatorTask (and without extra traffic to the QCDB).

Copy link
Collaborator

@Barthelemy Barthelemy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea !

I have just added a couple of trivial comments.

static TH1* getRatioPlotFromCanvas(TCanvas* canvas)
{
// Get the pad containing the current histogram, as well as the reference one in the case of 1-D plots
TPad* padHistRatio = (TPad*)canvas->GetPrimitive(TString::Format("%s_PadHistRatio", canvas->GetName()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not a dynamic_cast ?

static std::pair<TH1*, TH1*> getPlotsFromCanvas(TCanvas* canvas, std::string& message)
{
// Get the pad containing the current histogram, as well as the reference one in the case of 1-D plots
TPad* padHist = (TPad*)canvas->GetPrimitive(TString::Format("%s_PadHist", canvas->GetName()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not a dynamic_cast ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Barthelemy indeed, a dynamic cast is better.

Regarding the ReferenceUtils.h, is there a specific reason why the getReferencePlot() function was implemented as static? I did the same for the other two functions added here, but I am not 100% sure this is what you had in mind...

…asses

The changes allow to use the ReferenceComparatorTask as a base class,
providing access to the reference comparison plots for the derived classes.

A typical use case would be a post-processing task that produces some
derived plots, which also need to compared with some reference.
With the current production code, this involves adding a dedicated
ReferenceComparatorTask in the workflow, that fetches the plots from the
post-processing task from the QCDB.

This commit allows to solve the above problem by deriving the post-processing
task from the ReferenceComparatorTask, such that the reference comparison
plots can be filled directly by the derived task, without going through
the QCDB.

This is achieved with the following two changes:
* addition of a function that exposes the reference comparison plots in the ReferenceComparatorTask interface
* storage of the pointer to the reference histogram in the ReferenceComparatorPlot object, such that it does not need to be passed to the `update()` method
Add to the ReferenceUtils.h header file the functions that allow to access
the current, reference and ratio plots from the TCanvas created by the
ReferenceComparartorPlot class.

This will allow for example custom checkers to access the plots.
@aferrero2707 aferrero2707 force-pushed the common-expose-refcomp-plots branch from 9ba37f8 to e40c600 Compare July 4, 2025 09:33
@Barthelemy Barthelemy merged commit 473bb30 into AliceO2Group:master Jul 9, 2025
5 of 6 checks passed
aferrero2707 added a commit to AliceMCH/QualityControl that referenced this pull request Aug 5, 2025
The commit adds plots with quantities averaged over SOLAR links,
similar to the existing ones as function of Detection Elements.

It also adds comparisons of DE and SOLAR plots with reference ones,
using the code from AliceO2Group#2578
knopers8 pushed a commit that referenced this pull request Aug 8, 2025
* [MCH] added averaging over SOLAR links

Added computation of average quantities over SOLAR links, similar to
what is already implemented for the averaging over Detection Elements

* [MCH] added helper functions for handling SOLAR indexes and histogram decorations

* [MCH] updated Pedestals Task histogram decorations

The changes are needed to sync with the updated helper code

* [MCH] added plots as function of SOLAR links

The commit adds plots with quantities averaged over SOLAR links,
similar to the existing ones as function of Detection Elements.

It also adds comparisons of DE and SOLAR plots with reference ones,
using the code from #2578

* [MCH] added checkers for SOLAR-based plots

The code that checks the SOLAR-based plots is similar to that for the
DE-based ones. The checkers also fill a summary plot with the overall
quality of each SOLAR link, which are then aggregared by a dedicated task.

* [MCH] added aggregator task for DE and SOLAR qualities

The task combines the summary qualities for each DE and SOLAR link,
and uploads a CCDB object with the list of bad DE and SOLAR IDs.

The CCDB objects will be used to automatically reconfigure the bad links
during the data taking.

* [MCH] fixed clang errors

* [MCH] added review suggestions
knopers8 pushed a commit that referenced this pull request Aug 11, 2025
* [MCH] added averaging over SOLAR links

Added computation of average quantities over SOLAR links, similar to
what is already implemented for the averaging over Detection Elements

* [MCH] added helper functions for handling SOLAR indexes and histogram decorations

* [MCH] updated Pedestals Task histogram decorations

The changes are needed to sync with the updated helper code

* [MCH] added plots as function of SOLAR links

The commit adds plots with quantities averaged over SOLAR links,
similar to the existing ones as function of Detection Elements.

It also adds comparisons of DE and SOLAR plots with reference ones,
using the code from #2578

* [MCH] added checkers for SOLAR-based plots

The code that checks the SOLAR-based plots is similar to that for the
DE-based ones. The checkers also fill a summary plot with the overall
quality of each SOLAR link, which are then aggregared by a dedicated task.

* [MCH] added aggregator task for DE and SOLAR qualities

The task combines the summary qualities for each DE and SOLAR link,
and uploads a CCDB object with the list of bad DE and SOLAR IDs.

The CCDB objects will be used to automatically reconfigure the bad links
during the data taking.

* [MCH] fixed clang errors

* [MCH] added review suggestions
Barthelemy pushed a commit that referenced this pull request Aug 11, 2025
* [MCH] added averaging over SOLAR links

Added computation of average quantities over SOLAR links, similar to
what is already implemented for the averaging over Detection Elements

* [MCH] added helper functions for handling SOLAR indexes and histogram decorations

* [MCH] updated Pedestals Task histogram decorations

The changes are needed to sync with the updated helper code

* [MCH] added plots as function of SOLAR links

The commit adds plots with quantities averaged over SOLAR links,
similar to the existing ones as function of Detection Elements.

It also adds comparisons of DE and SOLAR plots with reference ones,
using the code from #2578

* [MCH] added checkers for SOLAR-based plots

The code that checks the SOLAR-based plots is similar to that for the
DE-based ones. The checkers also fill a summary plot with the overall
quality of each SOLAR link, which are then aggregared by a dedicated task.

* [MCH] added aggregator task for DE and SOLAR qualities

The task combines the summary qualities for each DE and SOLAR link,
and uploads a CCDB object with the list of bad DE and SOLAR IDs.

The CCDB objects will be used to automatically reconfigure the bad links
during the data taking.

* [MCH] fixed clang errors

* [MCH] added review suggestions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants