-
Notifications
You must be signed in to change notification settings - Fork 151
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
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1a6b31d
[QC-885] Modify ReferenceComparatorCheck to also accept a TH1 instead…
Barthelemy 603a00c
format
Barthelemy 626e7c4
add beautify and doc
Barthelemy d23cfcd
Format
Barthelemy 714a486
Format
Barthelemy 466a984
cout
Barthelemy a1ad044
Update ReferenceComparatorCheck.cxx
Barthelemy 4755f09
Update Advanced.md
Barthelemy d6cb6e1
Update Advanced.md
Barthelemy 6f9e9ef
Update DevelopersTips.md
Barthelemy 4b1c4d4
Merge branch 'master' into ref-plot-check
Barthelemy 142565f
Update Framework/include/QualityControl/ReferenceUtils.h
Barthelemy 71e7460
Update Modules/Common/src/ReferenceComparatorCheck.cxx
Barthelemy 591aa86
Update doc/Advanced.md
Barthelemy 5523798
Update doc/Advanced.md
Barthelemy 81a00d1
Update ReferenceComparatorCheck.cxx
Barthelemy 5262cce
Update ReferenceComparatorCheck.cxx
Barthelemy ee37571
- use int for the run
Barthelemy 3c62749
format
Barthelemy da08db6
return a tuple
Barthelemy 1ffb5ed
format
Barthelemy f84803a
return null quality if no reference run number is provided.
Barthelemy 3da5995
extraction
Barthelemy da17738
- Keep the activity parameter but document it
Barthelemy 371a1a6
Use extended parameters.
Barthelemy fd93cdf
pass only 1 activity for reference and not the reference run + the cu…
Barthelemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
// All rights not expressly granted are reserved. | ||
// | ||
// This software is distributed under the terms of the GNU General Public | ||
// License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
// | ||
// In applying this license CERN does not waive the privileges and immunities | ||
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// | ||
/// \file ReferenceComparatorUtils.h | ||
/// \author Andrea Ferrero and Barthelemy von Haller | ||
/// | ||
|
||
#ifndef QUALITYCONTROL_ReferenceComparatorUtils_H | ||
#define QUALITYCONTROL_ReferenceComparatorUtils_H | ||
|
||
#include <memory> | ||
#include "QualityControl/MonitorObject.h" | ||
#include "QualityControl/DatabaseInterface.h" | ||
#include "QualityControl/Activity.h" | ||
#include "QualityControl/ActivityHelpers.h" | ||
#include "QualityControl/QcInfoLogger.h" | ||
#include "QualityControl/RepoPathUtils.h" | ||
|
||
namespace o2::quality_control_modules::common | ||
Barthelemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
|
||
//_________________________________________________________________________________________ | ||
// | ||
// Get the reference plot for a given MonitorObject path | ||
|
||
static std::shared_ptr<quality_control::core::MonitorObject> getReferencePlot(quality_control::repository::DatabaseInterface* qcdb, std::string& fullPath, uint32_t referenceRun, quality_control::core::Activity activity) | ||
{ | ||
uint64_t timeStamp = 0; | ||
activity.mId = referenceRun; | ||
const auto filterMetadata = quality_control::core::activity_helpers::asDatabaseMetadata(activity, false); | ||
const auto objectValidity = qcdb->getLatestObjectValidity(activity.mProvenance + "/" + fullPath, filterMetadata); | ||
if (objectValidity.isValid()) { | ||
timeStamp = objectValidity.getMax() - 1; | ||
} else { | ||
ILOG(Warning, Devel) << "Could not find the object '" << fullPath << "' for run " << activity.mId << ENDM; | ||
return nullptr; | ||
} | ||
|
||
std::string path; | ||
std::string name; | ||
if (!o2::quality_control::core::RepoPathUtils::splitObjectPath(fullPath, path, name)) { | ||
return nullptr; | ||
} | ||
return qcdb->retrieveMO(path, name, timeStamp, activity); | ||
Barthelemy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
} // namespace o2::quality_control_modules::common | ||
|
||
#endif // QUALITYCONTROL_ReferenceComparatorUtils_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 thancould not find object
, so we should handle it explicitly.There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
There was a problem hiding this comment.
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 withprovenance
andpass
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.