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

[QC-885] Modify reference check to also accept a TH1 … #2358

Merged
merged 26 commits into from
Jul 8, 2024

Conversation

Barthelemy
Copy link
Collaborator

… instead of a Canvas

  • also pass the database object from CheckRunner to CheckInterface and use it to implement a new method retrieveReference.

… of a Canvas

- also pass the database object from CheckRunner to CheckInterface and use it to implement a new method `retrieveReference`.
@Barthelemy Barthelemy changed the title [WIP] [QC-885] Modify reference check to also accept a TH1 … [QC-885] Modify reference check to also accept a TH1 … Jun 26, 2024
@Barthelemy
Copy link
Collaborator Author

@aferrero2707

@aferrero2707
Copy link
Contributor

@Barthelemy shall I test it locally and report back?

@Barthelemy
Copy link
Collaborator Author

@aferrero2707 good idea ! thanks
Also if you have any comment on the code as you wrote it

@aferrero2707
Copy link
Contributor

@Barthelemy I have loaclly compared the direct check you implemented with the check result from the ReferenceComparator output, and they perfectly match, so as far as I can tell the code is working as expected.

Here is a screenshot showing the result of the two check methods:
image

@Barthelemy
Copy link
Collaborator Author

@aferrero2707 Thanks a lot for checking. I have resolved the conflict as well.

@knopers8 I think that you can review it if you want

@knopers8
Copy link
Collaborator

knopers8 commented Jul 1, 2024

ok, i will have a look now

Copy link
Collaborator

@knopers8 knopers8 left a comment

Choose a reason for hiding this comment

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

Thank you! I have some suggestions to be discussed.

protected:
/// \brief Called each time mCustomParameters is updated.
virtual void configure() override;

/// \brief Retrieve a reference plot at the provided path, matching the give activity and for the provided run.
/// the activity is the current one, while the run number is the reference run.
std::shared_ptr<MonitorObject> retrieveReference(std::string path, int referenceRun, 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.

If there is only one correct/expected Activity that the user shall provide and the framework has the knowledge of it, why even ask the user to do it? Shouldn't the framework handle it?

Also, since the run numbers are unique, why even constrain the selection with the Activity? I don't understand what's the benefit, except that someone would want to fail if the reference run is from an earlier period than the current one. However, for such cases we should anyway produce more specific errors than could not find object, so we should handle it explicitly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@aferrero2707 I picked these parameters based on your code. Do you have an opinion?
I would tend to agree with Piotr.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Barthelemy @knopers8 indeed, I also agree. I would say that we need two parameters from the activity:

  • the provenance, as we do not want to mix online and async plots
  • the pass name, but that's only relevant for async, where the mechanism of reference runs might be a bit more difficult to put in place

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After discussing with Andrea as well, I came to the conclusion that we should keep the parameter activity, at least for the time being. Replacing it with provenance and pass opens the door to having more and more parameters that will match what the Activity contains in the end. Moreover, we cannot let the framework feed the activity because the CheckInterface does not store the activity. We could modify all the *Interface to start storing the activity but I believe that it would go beyond the scope of this PR.

What I did was to document what the activity parameter is.

Framework/include/QualityControl/ReferenceUtils.h Outdated Show resolved Hide resolved
Framework/include/QualityControl/ReferenceUtils.h Outdated Show resolved Hide resolved
Framework/include/QualityControl/RepoPathUtils.h Outdated Show resolved Hide resolved
Modules/Common/src/ReferenceComparatorCheck.cxx Outdated Show resolved Hide resolved
doc/Advanced.md Outdated Show resolved Hide resolved
doc/Advanced.md Outdated Show resolved Hide resolved
Framework/src/CheckInterface.cxx Outdated Show resolved Hide resolved
Barthelemy and others added 9 commits July 1, 2024 13:27
Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
- update the namespaces
@aferrero2707
Copy link
Contributor

@Barthelemy @knopers8 I basically agree on all suggestion from Piotr. I have also added a comment d=regarding the way the reference run number is retrieved in the checker, suggesting to make use of the extended check parameters for that.

For the rest, looks good to me.

Modules/Common/src/ReferenceComparatorCheck.cxx Outdated Show resolved Hide resolved
protected:
/// \brief Called each time mCustomParameters is updated.
virtual void configure() override;

/// \brief Retrieve a reference plot at the provided path, matching the give activity and for the provided run.
/// the activity is the current one, while the run number is the reference run.
std::shared_ptr<MonitorObject> retrieveReference(std::string path, int referenceRun, Activity activity);
Copy link
Contributor

Choose a reason for hiding this comment

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

@Barthelemy @knopers8 indeed, I also agree. I would say that we need two parameters from the activity:

  • the provenance, as we do not want to mix online and async plots
  • the pass name, but that's only relevant for async, where the mechanism of reference runs might be a bit more difficult to put in place

Framework/include/QualityControl/ReferenceUtils.h Outdated Show resolved Hide resolved
Modules/Common/src/ReferenceComparatorCheck.cxx Outdated Show resolved Hide resolved
@Barthelemy
Copy link
Collaborator Author

@knopers8 as discussed on Friday, I have replaced the runNumber + Activity with just Activity which should be the activity matching the reference plot. I agree with you that it makes more sense.

@knopers8 knopers8 enabled auto-merge (squash) July 8, 2024 06:33
@knopers8 knopers8 merged commit 90c35b1 into AliceO2Group:master Jul 8, 2024
6 of 7 checks passed
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.

3 participants