Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a generic reference histogram comparator #2317

Merged

Conversation

aferrero2707
Copy link
Contributor

@aferrero2707 aferrero2707 commented May 30, 2024

The code introduces some tools that allow to compare the plots produced by given task(s) with that of a reference run:

  • ReferenceComparatorTask draws histograms with their reference superimposed, as well as the ratio between histograms and reference
  • ReferenceComparatorCheck compares the histograms with their corresponding reference, and assesses their compatibility. The comparison is performed by a dynamically loadable module that provides the actual comparison algorithm
  • ReferenceComparatorPlot is an utility class to draw the current and reference histograms, and their ratio
  • ObjectComparator* are dynamically loadable modules than implement different histogram comparison methods
    Three examples are provided:
    • ObjectComparatorDeviation evaluates the average relative difference between the histogram bins
    • ObjectComparatorChi2 compares the histograms using a chi2-based test
    • ObjectComparatorKolmogorov compares the histograms using a Kolmogorov test

This is an example of output of the task and checker, also showing the flags associated to the quality objects:
image

@aferrero2707 aferrero2707 force-pushed the common-add-reference-plots-comparator branch 3 times, most recently from c18cd63 to f1e582f Compare June 2, 2024 10:11
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.

Very nice Andrea. I have only a few comments that I let you review. Nothing big. Thank you

Modules/Common/include/Common/ReferenceComparatorPlot.h Outdated Show resolved Hide resolved
Modules/Common/include/Common/ReferenceComparatorPlot.h Outdated Show resolved Hide resolved
doc/PostProcessing.md Outdated Show resolved Hide resolved
Modules/Common/src/ObjectComparatorChi2.cxx Outdated Show resolved Hide resolved
Modules/Common/src/ObjectComparatorDeviation.cxx Outdated Show resolved Hide resolved
Modules/Common/src/ReferenceComparatorPlot.cxx Outdated Show resolved Hide resolved
//
// Helper function for retrieving the last MonitorObject for a give run number

static std::shared_ptr<MonitorObject> getMOFromRun(repository::DatabaseInterface* qcdb, std::string fullPath, uint32_t run, Activity activity)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should consider moving this to the Framework probably.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fullPath could also be a reference here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reference added.

Modules/Common/src/ReferenceComparatorTask.cxx Outdated Show resolved Hide resolved
//
// Helper function for retrieving the last MonitorObject for a give run number

static std::shared_ptr<MonitorObject> getMOFromRun(repository::DatabaseInterface* qcdb, std::string fullPath, uint32_t run, Activity activity)
Copy link
Collaborator

Choose a reason for hiding this comment

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

fullPath could also be a reference here

The code introduces some tools that allow to compare the plots produced by given task(s) with that of a reference run:
- `ReferenceComparatorTask` draws histograms with their reference superimposed, as well as the ratio between histograms and reference
- `ReferenceComparatorCheck` compares the histograms with their corresponding reference, and assesses their compatibility. The comparison is performed by a dynamically loadable module that provides the actual comparison algorithm
- `ReferenceComparatorPlot` is an utility class to draw the current and reference histograms, and their ratio
- `ObjectComparator*` are dynamically loadable modules than implement different histogram comparison methods
  Three examples are provided:
    - `ObjectComparatorDeviation` evaluates the average relative difference between the histogram bins
    - `ObjectComparatorChi2` compares the histograms using a chi2-based test
    - `ObjectComparatorKolmogorov` compares the histograms using a Kolmogorov test
@aferrero2707 aferrero2707 force-pushed the common-add-reference-plots-comparator branch from f1e582f to 916d1ce Compare June 16, 2024 07:39
@aferrero2707
Copy link
Contributor Author

@Barthelemy I have pushed an update that should address all the comments, let me know if anything is still missing. Thanks a lot!

@Barthelemy Barthelemy merged commit c88c616 into AliceO2Group:master Jun 18, 2024
7 checks passed
@Barthelemy
Copy link
Collaborator

all good, thanks !

@aferrero2707 aferrero2707 deleted the common-add-reference-plots-comparator branch June 18, 2024 16:02
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