Skip to content

Commit e81c599

Browse files
authored
QC-1160 Update flag-related nomenclature (#2256)
* QC-1160 Update flag-related nomenclature There are some forward declarations that I had to get rid of for the time being, since C++ does not like combining aliases with forward declarations. They can be brought back after the migration is complete. * fix type * more typos
1 parent ca945e2 commit e81c599

82 files changed

Lines changed: 939 additions & 905 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Framework/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ add_library(O2QualityControl
8080
src/MonitorObjectCollection.cxx
8181
src/UpdatePolicyManager.cxx
8282
src/AdvancedWorkflow.cxx
83-
src/QualitiesToTRFCollectionConverter.cxx
83+
src/QualitiesToFlagCollectionConverter.cxx
8484
src/Calculators.cxx
8585
src/DataSourceSpec.cxx
8686
src/RootFileSink.cxx
@@ -278,7 +278,7 @@ set(TEST_SRCS
278278
test/testCheckWorkflow.cxx
279279
test/testWorkflow.cxx
280280
test/testRepoPathUtils.cxx
281-
test/testQualitiesToTRFCollectionConverter.cxx
281+
test/testQualitiesToFlagCollectionConverter.cxx
282282
test/testUserCodeInterface.cxx
283283
)
284284

Framework/include/QualityControl/CcdbDatabase.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CcdbDatabase : public DatabaseInterface
6767
// storage
6868
void storeMO(std::shared_ptr<const o2::quality_control::core::MonitorObject> q) override;
6969
void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> q) override;
70-
void storeTRFC(std::shared_ptr<const o2::quality_control::TimeRangeFlagCollection> trfc) override;
70+
void storeQCFC(std::shared_ptr<const o2::quality_control::QualityControlFlagCollection> qcfc) override;
7171
void storeAny(const void* obj, std::type_info const& typeInfo, std::string const& path, std::map<std::string, std::string> const& metadata,
7272
std::string const& detectorName, std::string const& taskName, long from = -1, long to = -1) override;
7373

@@ -80,9 +80,9 @@ class CcdbDatabase : public DatabaseInterface
8080
std::shared_ptr<o2::quality_control::core::MonitorObject> retrieveMO(std::string objectPath, std::string objectName, long timestamp = Timestamp::Current, const core::Activity& activity = {}) override;
8181
// retrieval - QO - deprecated
8282
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string qoPath, long timestamp = Timestamp::Current, const core::Activity& activity = {}) override;
83-
std::shared_ptr<o2::quality_control::TimeRangeFlagCollection> retrieveTRFC(const std::string& name, const std::string& detector, int runNumber = 0,
84-
const std::string& passName = "", const std::string& periodName = "",
85-
const std::string& provenance = "", long timestamp = -1) override;
83+
std::shared_ptr<o2::quality_control::QualityControlFlagCollection> retrieveQCFC(const std::string& name, const std::string& detector, int runNumber = 0,
84+
const std::string& passName = "", const std::string& periodName = "",
85+
const std::string& provenance = "", long timestamp = -1) override;
8686

8787
// retrieval - general
8888
std::string retrieveJson(std::string path, long timestamp, const std::map<std::string, std::string>& metadata) override;

Framework/include/QualityControl/DatabaseInterface.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@
2727
#include "QualityControl/QualityObject.h"
2828
#include "QualityControl/MonitorObject.h"
2929
#include "QualityControl/Activity.h"
30-
31-
namespace o2::quality_control
32-
{
33-
class TimeRangeFlagCollection;
34-
}
30+
#include <DataFormatsQualityControl/QualityControlFlagCollection.h>
3531

3632
namespace o2::quality_control::repository
3733
{
@@ -132,10 +128,10 @@ class DatabaseInterface
132128
virtual void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> qo) = 0;
133129

134130
/**
135-
* Stores the serialized TimeRangeFlagCollection in the database.
136-
* @param trfc The TimeRangeFlagCollection to serialize and store. It should contain correct time validity inside the object.
131+
* Stores the serialized QualityControlFlagCollection in the database.
132+
* @param qcfc The QualityControlFlagCollection to serialize and store. It should contain correct time validity inside the object.
137133
*/
138-
virtual void storeTRFC(std::shared_ptr<const o2::quality_control::TimeRangeFlagCollection> trfc) = 0;
134+
virtual void storeQCFC(std::shared_ptr<const o2::quality_control::QualityControlFlagCollection> qcfc) = 0;
139135
/**
140136
* \brief Look up a monitor object and return it.
141137
* Look up a monitor object and return it if found or nullptr if not.
@@ -156,12 +152,12 @@ class DatabaseInterface
156152
*/
157153
virtual std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string qoPath, long timestamp = Timestamp::Current, const core::Activity& activity = {}) = 0;
158154
/**
159-
* \brief Look up a TimeRangeFlagCollection object and return it.
160-
* Look up a TimeRangeFlagCollection and return it if found or nullptr if not.
155+
* \brief Look up a QualityControlFlagCollection object and return it.
156+
* Look up a QualityControlFlagCollection and return it if found or nullptr if not.
161157
*/
162-
virtual std::shared_ptr<o2::quality_control::TimeRangeFlagCollection> retrieveTRFC(const std::string& name, const std::string& detector, int runNumber = 0,
163-
const std::string& passName = "", const std::string& periodName = "",
164-
const std::string& provenance = "", long timestamp = Timestamp::Current) = 0;
158+
virtual std::shared_ptr<o2::quality_control::QualityControlFlagCollection> retrieveQCFC(const std::string& name, const std::string& detector, int runNumber = 0,
159+
const std::string& passName = "", const std::string& periodName = "",
160+
const std::string& provenance = "", long timestamp = Timestamp::Current) = 0;
165161
/**
166162
* \brief Look up an object and return it.
167163
* Look up an object and return it if found or nullptr if not. It is a raw pointer because we might need it to build a MO.

Framework/include/QualityControl/DummyDatabase.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class DummyDatabase : public DatabaseInterface
3939
// QualityObject
4040
void storeQO(std::shared_ptr<const o2::quality_control::core::QualityObject> q) override;
4141
std::shared_ptr<o2::quality_control::core::QualityObject> retrieveQO(std::string checkerName, long timestamp = -1, const core::Activity& activity = {}) override;
42-
// TRFC
43-
void storeTRFC(std::shared_ptr<const o2::quality_control::TimeRangeFlagCollection> trfc) override;
44-
std::shared_ptr<o2::quality_control::TimeRangeFlagCollection> retrieveTRFC(const std::string& name, const std::string& detector, int runNumber = 0,
45-
const std::string& passName = "", const std::string& periodName = "",
46-
const std::string& provenance = "", long timestamp = -1) override;
42+
// QCFC
43+
void storeQCFC(std::shared_ptr<const o2::quality_control::QualityControlFlagCollection> qcfc) override;
44+
std::shared_ptr<o2::quality_control::QualityControlFlagCollection> retrieveQCFC(const std::string& name, const std::string& detector, int runNumber = 0,
45+
const std::string& passName = "", const std::string& periodName = "",
46+
const std::string& provenance = "", long timestamp = -1) override;
4747
// General
4848
void* retrieveAny(std::type_info const& tinfo, std::string const& path,
4949
std::map<std::string, std::string> const& metadata, long timestamp = -1,

Framework/include/QualityControl/ObjectMetadataKeys.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ constexpr auto qcTaskName = "qc_task_name";
3535
constexpr auto qcTaskClass = "qc_task_class";
3636
constexpr auto qcQuality = "qc_quality";
3737
constexpr auto qcCheckName = "qc_check_name";
38-
constexpr auto qcTRFCName = "qc_trfc_name";
38+
constexpr auto qcQCFCName = "qc_qcfc_name";
3939
constexpr auto qcAdjustableEOV = "adjustableEOV"; // this is a keyword for the CCDB
4040
// QC Activity
4141
constexpr auto runType = "RunType";

Framework/include/QualityControl/QualitiesToTRFCollectionConverter.h renamed to Framework/include/QualityControl/QualitiesToFlagCollectionConverter.h

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,52 @@
1010
// or submit itself to any jurisdiction.
1111

1212
///
13-
/// \file QualitiesToTRFCollectionConverter.h
13+
/// \file QualitiesToFlagCollectionConverter.h
1414
/// \author Piotr Konopka
1515
///
1616

17-
#ifndef QUALITYCONTROL_QUALITIESTOTRFCOLLECTIONCONVERTER_H
18-
#define QUALITYCONTROL_QUALITIESTOTRFCOLLECTIONCONVERTER_H
17+
#ifndef QUALITYCONTROL_QUALITIESTOQCFCOLLECTIONCONVERTER_H
18+
#define QUALITYCONTROL_QUALITIESTOQCFCOLLECTIONCONVERTER_H
1919

20-
#include <DataFormatsQualityControl/TimeRangeFlag.h>
20+
#include <DataFormatsQualityControl/QualityControlFlag.h>
21+
#include <DataFormatsQualityControl/QualityControlFlagCollection.h>
2122
#include <memory>
2223
#include <vector>
2324

24-
namespace o2::quality_control
25-
{
26-
class TimeRangeFlagCollection;
27-
}
28-
2925
namespace o2::quality_control::core
3026
{
3127

3228
class QualityObject;
3329

34-
/// \brief Converts a set of chronologically provided Qualities from the same path into a TRFCollection.
35-
class QualitiesToTRFCollectionConverter
30+
/// \brief Converts a set of chronologically provided Qualities from the same path into a QualityControlFlagCollection.
31+
class QualitiesToFlagCollectionConverter
3632
{
3733
public:
38-
QualitiesToTRFCollectionConverter(std::unique_ptr<TimeRangeFlagCollection> trfc, std::string qoPath);
34+
QualitiesToFlagCollectionConverter(std::unique_ptr<QualityControlFlagCollection> qcfc, std::string qoPath);
3935

40-
~QualitiesToTRFCollectionConverter() = default;
36+
~QualitiesToFlagCollectionConverter() = default;
4137

42-
/// \brief Converts a Quality into TRFCollection. The converter should get Qualities in chronological order.
38+
/// \brief Converts a Quality into FlagCollection. The converter should get Qualities in chronological order.
4339
void operator()(const QualityObject&);
4440

45-
/// \brief Moves the final TRFCollection out and resets the converter.
46-
std::unique_ptr<TimeRangeFlagCollection> getResult();
41+
/// \brief Moves the final FlagCollection out and resets the converter.
42+
std::unique_ptr<QualityControlFlagCollection> getResult();
4743

4844
size_t getQOsIncluded() const;
4945
size_t getWorseThanGoodQOs() const;
5046

5147
private:
52-
std::string mQOPath; // this is only to indicate what is the missing Quality in TRF
48+
std::string mQOPath; // this is only to indicate what is the missing Quality in QC Flag
5349

54-
std::unique_ptr<TimeRangeFlagCollection> mConverted;
50+
std::unique_ptr<QualityControlFlagCollection> mConverted;
5551

5652
uint64_t mCurrentStartTime = 0;
5753
uint64_t mCurrentEndTime;
58-
std::vector<TimeRangeFlag> mCurrentTRFs;
54+
std::vector<QualityControlFlag> mCurrentFlags;
5955
size_t mQOsIncluded = 0;
6056
size_t mWorseThanGoodQOs = 0;
6157
};
6258

6359
} // namespace o2::quality_control::core
6460

65-
#endif //QUALITYCONTROL_QUALITIESTOTRFCOLLECTIONCONVERTER_H
61+
#endif // QUALITYCONTROL_QUALITIESTOQCFCOLLECTIONCONVERTER_H

Framework/include/QualityControl/Quality.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#include <map>
2323
#include <vector>
2424
#include <utility>
25-
#include <DataFormatsQualityControl/FlagReasons.h>
25+
#include <DataFormatsQualityControl/FlagType.h>
2626

2727
namespace o2::quality_control::core
2828
{
29-
using CommentedFlagReasons = std::vector<std::pair<FlagReason, std::string>>;
29+
using CommentedFlagTypes = std::vector<std::pair<FlagType, std::string>>;
3030

3131
/// \brief Class representing the quality of a MonitorObject.
3232
///
@@ -55,7 +55,7 @@ class Quality
5555
static const Quality Bad;
5656
static const unsigned int NullLevel;
5757

58-
/// \brief Sets the Quality (without Reasons or Metadata).
58+
/// \brief Sets the Quality (without Flags or Metadata).
5959
void set(const Quality&);
6060

6161
unsigned int getLevel() const;
@@ -106,20 +106,20 @@ class Quality
106106
/// \return the value corresponding to the key if it was found, default value otherwise
107107
std::string getMetadata(const std::string& key, const std::string& defaultValue) const;
108108

109-
/// \brief Associate the Quality with a new reason and an optional comment
109+
/// \brief Associate the Quality with a new flag and an optional comment
110110
/// \return reference to *this
111-
Quality& addReason(const FlagReason& reason, std::string comment = "");
112-
/// \brief Get the reasons with associated comments for the Quality
113-
/// \return reason, if exists
114-
const CommentedFlagReasons& getReasons() const;
111+
Quality& addFlag(const FlagType& flag, std::string comment = "");
112+
/// \brief Get the flags with associated comments for the Quality
113+
/// \return flag, if exists
114+
const CommentedFlagTypes& getFlags() const;
115115

116116
static Quality fromString(const std::string& str);
117117

118118
private:
119119
unsigned int mLevel; /// 0 is no quality, 1 is best quality, then it only goes downhill...
120120
std::string mName;
121121
std::map<std::string, std::string> mUserMetadata;
122-
std::vector<std::pair<FlagReason, std::string>> mReasons;
122+
std::vector<std::pair<FlagType, std::string>> mFlags;
123123

124124
ClassDef(Quality, 2);
125125
};

Framework/include/QualityControl/QualityObject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ class QualityObject : public TObject
114114
/// \return A string containing the path.
115115
std::string getPath() const;
116116

117-
/// \brief Associate the Quality with a new reason and an optional comment
117+
/// \brief Associate the Quality with a new flag and an optional comment
118118
/// \return reference to *this
119-
QualityObject& addReason(const FlagReason& reason, std::string comment = "");
119+
QualityObject& addFlag(const FlagType& flag, std::string comment = "");
120120
/// \brief Get the reasons with associated comments for the Quality
121121
/// \return reason, if exists
122-
const CommentedFlagReasons& getReasons() const;
122+
const CommentedFlagTypes& getFlags() const;
123123

124124
const std::string& getDetectorName() const;
125125
void setDetectorName(const std::string& detectorName);

Framework/include/QualityControl/RepoPathUtils.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@
2222
#include "QualityControl/MonitorObject.h"
2323
#include "QualityControl/QualityObject.h"
2424
#include <Common/Exceptions.h>
25-
26-
namespace o2::quality_control
27-
{
28-
class TimeRangeFlagCollection;
29-
}
25+
#include <DataFormatsQualityControl/QualityControlFlagCollection.h>
3026

3127
namespace o2::quality_control::core
3228
{
@@ -112,23 +108,23 @@ class RepoPathUtils
112108
}
113109

114110
/**
115-
* Compute and return the path to the TRFCollection.
116-
* Current algorithm does <provenance(qc)>/<detectorCode>/TRFC/<trfcName>
111+
* Compute and return the path to the FlagCollection.
112+
* Current algorithm does <provenance(qc)>/<detectorCode>/QCFC/<qcfcName>
117113
* @param detectorCode
118-
* @param trfcName
114+
* @param qcfcName
119115
* @param provenance
120-
* @return the path to the TRFCollection
116+
* @return the path to the QCFCollection
121117
*/
122-
static std::string getTrfcPath(const std::string& detectorCode,
123-
const std::string& trfcName,
118+
static std::string getQcfcPath(const std::string& detectorCode,
119+
const std::string& qcfcName,
124120
const std::string& provenance = "qc");
125121
/**
126-
* Compute and return the path to the TRFCollection.
127-
* Current algorithm does <provenance(qc)>/<detectorCode>/TRFC/<trfcName>
128-
* @param trfc
129-
* @return the path to the TRFCollection
122+
* Compute and return the path to the QCFCollection.
123+
* Current algorithm does <provenance(qc)>/<detectorCode>/QCFC/<qcfcName>
124+
* @param qcfc
125+
* @return the path to the QCFCollection
130126
*/
131-
static std::string getTrfcPath(const TimeRangeFlagCollection* trfc);
127+
static std::string getQcfcPath(const QualityControlFlagCollection* qcfc);
132128

133129
static constexpr auto allowedProvenancesMessage = R"(Allowed provenances are "qc" (real data processed synchronously), "qc_async" (real data processed asynchronously) and "qc_mc" (simulated data).)";
134130
static bool isProvenanceAllowed(const std::string& provenance);

0 commit comments

Comments
 (0)