|
| 1 | +\page refDataFormatsQualityControl Data Formats Quality Control |
| 2 | + |
| 3 | +Data formats for tagging good quality data for analysis. |
| 4 | + |
| 5 | +# Flagging time ranges |
| 6 | +## General idea |
| 7 | +* Each detector has its own CCDB (QCDB) entry - TimeRangeFlagCollection |
| 8 | +* The CCDB Entry validity will be run or fill, depending on the final data taking granularity |
| 9 | +* Each entry can define sub ranges (TimeRangeFlags) of certain data characteristics (FlagReasons) inside the CCDB Entry validity |
| 10 | +* Flags are defined in a common store, they are used to derive the Data Tags - the final filters for good quality data during analysis. |
| 11 | +* Data Tag are stored as CCDB entries. They might require different detectors and may suppress different flags dependent on the analysis type. |
| 12 | + |
| 13 | +## Implementation |
| 14 | + |
| 15 | +[Flag Reason](include/DataFormatsQualityControl/FlagReasons.h) is defined with an identifier number, a name and a 'bad quality' determinant. |
| 16 | +The latter decides if such a flag should mark the data quality as bad by default. |
| 17 | +FlagReasons can be created only with FlagReasonFactory, so that the list of available reasons is common and centralised. |
| 18 | +For example: |
| 19 | +``` |
| 20 | +id: 10 |
| 21 | +name: Limited Acceptance |
| 22 | +bad: true |
| 23 | +``` |
| 24 | + |
| 25 | +With [TimeRangeFlags](include/DataFormatsQualityControl/TimeRangeFlag.h) we can define the time range of a chosen FlagReason, add an additional comment and specify the source of this flag. |
| 26 | +For example: |
| 27 | +``` |
| 28 | +start: 1612707603626 |
| 29 | +end: 1613999652000 |
| 30 | +flag: Limited Acceptance |
| 31 | +comment: Sector B in TPC inactive |
| 32 | +source: o2::quality_control_modules::tpc::ClustersCheck |
| 33 | +``` |
| 34 | + |
| 35 | +[TimeRangeFlagCollection](include/DataFormatsQualityControl/TimeRangeFlagCollection.h) contains all TimeRangeFlags for the validity range (run or fill). |
| 36 | +TimeRangeFlags may overlap, e.g. if they use different FlagReasons and they are sorted by their start time. |
| 37 | +If certain period does not include any TimeRangeFlags with *bad* FlagReasons, then the data quality can be considered as good. |
| 38 | +The [TimeRangeFlagCollection test](test/testTimeRangeFlagCollection.cxx) shows the usage example. |
| 39 | + |
| 40 | +TimeRangeFlagCollections are supposed to be created automatically with QC Post-processing Tasks based on Quality Objects created by QC Checks. |
| 41 | +However, they might be created manually by QA experts as well. |
| 42 | +The procedure to do that has to be defined. |
| 43 | + |
| 44 | +## TODO |
| 45 | +* Define the complete list of available Flag Reasons |
| 46 | +* implement CCDB storage and access |
| 47 | + - define CCDB storage place e.g. |
| 48 | + * `<Detector>/QC/QualityFlags` |
| 49 | + * `Analysis/QualityFlags/<Detector>` |
| 50 | +* Data Tags Definitions and Data Tags |
| 51 | + |
| 52 | +### Notes on plans for Data Tags |
| 53 | + |
| 54 | +Data Tag definition has: |
| 55 | +* name |
| 56 | +* global suppression list for bad flag reasons (applies to all detectors) |
| 57 | +* global requirement list for not bad flag reasons |
| 58 | +* list of needed detectors, |
| 59 | +* list of suppression list and requirement list specific to detectors |
| 60 | + |
| 61 | +Example configurations |
| 62 | +```json |
| 63 | +{ |
| 64 | + "name": "CentralBarrelTrackingLimitedAcceptance", |
| 65 | + "globalRequiredDetectors" : [ "TPC", "ITS" ], |
| 66 | + "globalIgnoredFlags" : ["Limited acceptance", "asdf"], |
| 67 | + "globalRequiredFlags" : [], |
| 68 | + "detectorSpecificFlags" : [ |
| 69 | + { |
| 70 | + "name" : "TPC", |
| 71 | + "ignoredFlags" : [ "Reason X" ] |
| 72 | + } |
| 73 | + ] |
| 74 | +}, |
| 75 | +{ |
| 76 | + "name": "CentralBarrelTracking", |
| 77 | + "globalRequiredDetectors" : [ "TPC", "ITS" ], |
| 78 | + "globalIgnoredFlags" : [], |
| 79 | + "globalRequiredFlags" : [], |
| 80 | + "detectorSpecificFlags" : [] |
| 81 | +}, |
| 82 | +{ |
| 83 | + "name": "CentralBarrelTrackingOnlyLimitedAcceptanceinTPC", |
| 84 | + "globalRequiredDetectors" : [ "TPC", "ITS" ], |
| 85 | + "globalIgnoredFlags" : [], |
| 86 | + "detectorSpecificFlags" : [ |
| 87 | + { |
| 88 | + "name" : "TPC", |
| 89 | + "requiredFlags" : [ "Limited acceptance" ] |
| 90 | + } |
| 91 | +} |
| 92 | +] |
| 93 | +``` |
| 94 | + |
| 95 | +## Wishlist / Ideas |
| 96 | +* executable to add flags to the flag store |
| 97 | +* executable to extrags the flag store |
| 98 | +* summary of all masks for one TimeRangeFlagCollection |
| 99 | +* functionality to extract flags for a specific detector (from CCDB) |
| 100 | +* cut class to specify detectors and flags which to exclude |
0 commit comments