-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QC-1160 Move to the new names for QC flags
Needs new QC release. The documentation will be updated in a separate PR.
- Loading branch information
Showing
18 changed files
with
461 additions
and
563 deletions.
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
File renamed without changes.
73 changes: 0 additions & 73 deletions
73
DataFormats/QualityControl/include/DataFormatsQualityControl/FlagReasons.h
This file was deleted.
Oops, something went wrong.
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
22 changes: 0 additions & 22 deletions
22
DataFormats/QualityControl/include/DataFormatsQualityControl/FlagTypeFactory.h
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,23 +9,23 @@ | |
// granted to it by virtue of its status as an Intergovernmental Organization | ||
// or submit itself to any jurisdiction. | ||
|
||
/// \file FlagReasonFactory.h | ||
/// \brief A class to create FlagReasons based on the predefined CSV list. | ||
/// \file FlagTypeFactory.h | ||
/// \brief A class to create FlagTypes based on the predefined CSV list. | ||
/// \author Piotr Konopka, [email protected] | ||
|
||
#ifndef O2_FLAGREASONFACTORY_H | ||
#define O2_FLAGREASONFACTORY_H | ||
#ifndef O2_FLAGTYPEFACTORY_H | ||
#define O2_FLAGTYPEFACTORY_H | ||
|
||
#include "DataFormatsQualityControl/FlagReasons.h" | ||
#include "DataFormatsQualityControl/FlagType.h" | ||
|
||
namespace o2::quality_control | ||
{ | ||
|
||
class FlagReasonFactory { | ||
class FlagTypeFactory { | ||
public: | ||
FlagReasonFactory() = delete; | ||
@CSV_FLAG_REASONS@ | ||
FlagTypeFactory() = delete; | ||
@CSV_FLAG_TYPES@ | ||
}; | ||
|
||
} // namespace o2::quality_control | ||
#endif // O2_FLAGREASONFACTORY_H | ||
#endif // O2_FLAGTYPEFACTORY_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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,76 @@ | |
#ifndef O2_QUALITYCONTROL_QCFLAG_H | ||
#define O2_QUALITYCONTROL_QCFLAG_H | ||
|
||
#include "DataFormatsQualityControl/TimeRangeFlag.h" | ||
/// \file QualityControlFlag.h | ||
/// \brief Class to define a flag type with a time range and comments | ||
/// \author Jens Wiechula, [email protected] | ||
/// \author Piotr Konopka, [email protected] | ||
|
||
namespace o2::quality_control | ||
// System includes | ||
#include <iosfwd> | ||
#include <string> | ||
|
||
// ROOT includes | ||
#include <Rtypes.h> | ||
|
||
#include <MathUtils/detail/Bracket.h> | ||
|
||
#include "DataFormatsQualityControl/FlagType.h" | ||
#include "DataFormatsQualityControl/FlagTypeFactory.h" | ||
|
||
namespace o2 | ||
{ | ||
using QualityControlFlag = o2::quality_control::TimeRangeFlag; | ||
} | ||
namespace quality_control | ||
{ | ||
|
||
/// \class QualityControlFlag | ||
/// A Class for associating a bit mask with a time range | ||
class QualityControlFlag | ||
{ | ||
public: | ||
using time_type = uint64_t; | ||
using RangeInterval = o2::math_utils::detail::Bracket<time_type>; | ||
|
||
QualityControlFlag() = default; | ||
QualityControlFlag(QualityControlFlag const&) = default; | ||
QualityControlFlag(time_type start, time_type end, FlagType flag, std::string comment = "", std::string source = "Unknown"); | ||
|
||
time_type getStart() const { return mInterval.getMin(); } | ||
time_type getEnd() const { return mInterval.getMax(); } | ||
RangeInterval& getInterval() { return mInterval; } | ||
FlagType getFlag() const { return mFlag; } | ||
const std::string& getComment() const { return mComment; } | ||
const std::string& getSource() const { return mSource; } | ||
|
||
void setStart(time_type start) { mInterval.setMin(start); } | ||
void setEnd(time_type end) { mInterval.setMax(end); } | ||
void setInterval(RangeInterval interval) { mInterval = interval; } | ||
void setFlag(FlagType flag) { mFlag = flag; } | ||
void setComment(const std::string& comment) { mComment = comment; } | ||
void setSource(const std::string& source) { mSource = source; } | ||
|
||
/// equal operator | ||
bool operator==(const QualityControlFlag& rhs) const; | ||
|
||
/// comparison operators | ||
bool operator<(const QualityControlFlag& rhs) const; | ||
bool operator>(const QualityControlFlag& rhs) const; | ||
|
||
/// write data to ostream | ||
void streamTo(std::ostream& output) const; | ||
|
||
/// overloading output stream operator | ||
friend std::ostream& operator<<(std::ostream& output, const QualityControlFlag& data); | ||
|
||
private: | ||
RangeInterval mInterval = {}; ///< time interval of the masked range | ||
FlagType mFlag; ///< flag reason | ||
std::string mComment = ""; ///< optional comment, which may extend the reason | ||
std::string mSource = "Unknown"; ///< optional (but encouraged) source of the flag (e.g. Qc Check name) | ||
|
||
ClassDefNV(QualityControlFlag, 1); | ||
}; | ||
|
||
} // namespace quality_control | ||
} // namespace o2 | ||
#endif // O2_QUALITYCONTROL_QCFLAG_H |
Oops, something went wrong.