Skip to content

Commit e347ff6

Browse files
authored
Merge fca52d7 into sapling-pr-archive-ktf
2 parents acc4f09 + fca52d7 commit e347ff6

File tree

25 files changed

+1495
-64
lines changed

25 files changed

+1495
-64
lines changed

CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/DataFormats/Detectors/CPV @peressounko @kharlov
3030
/DataFormats/Detectors/CTP @lietava
3131
/DataFormats/Detectors/EMCAL @mfasDa @jokonig
32-
/DataFormats/Detectors/FIT @jotwinow @afurs @andreasmolander @arvindkhuntia @mslupeck
32+
/DataFormats/Detectors/FIT @jotwinow @afurs @andreasmolander @sahilupadhyaya92
3333
/DataFormats/Detectors/FOCAL @maxrauch @mfasDa @iarsene @matthiasrichter
3434
/DataFormats/Detectors/GlobalTracking @shahor02
3535
/DataFormats/Detectors/GlobalTrackingWorkflow @shahor02
@@ -59,7 +59,7 @@
5959
/Detectors/Calibration @chiarazampolli @shahor02
6060
/Detectors/CPV @peressounko @kharlov
6161
/Detectors/EMCAL @mfasDa @jokonig
62-
/Detectors/FIT @jotwinow @afurs @andreasmolander @arvindkhuntia @mslupeck
62+
/Detectors/FIT @jotwinow @afurs @andreasmolander @sahilupadhyaya92
6363
/Detectors/FOCAL @maxrauch @mfasDa @iarsene @matthiasrichter
6464
/Detectors/Geometry @sawenzel @shahor02
6565
/Detectors/GlobalTracking @shahor02

Detectors/MUON/MCH/Conditions/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ o2_add_executable(
3737
O2::MCHGlobalMapping
3838
)
3939

40+
o2_add_executable(
41+
scan-hvlv-ccdb
42+
COMPONENT_NAME mch
43+
SOURCES src/scan-hvlv-ccdb.cxx
44+
PUBLIC_LINK_LIBRARIES
45+
O2::CCDB
46+
O2::CommonUtils
47+
O2::DetectorsDCS
48+
O2::MCHConditions
49+
O2::MCHStatus
50+
)
51+
4052
if(BUILD_TESTING)
4153
o2_add_test(
4254
dcs-aliases

Detectors/MUON/MCH/Conditions/README.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Those objects are stored at the following CCDB paths :
1717
- MCH/Calib/BadChannel
1818
- MCH/Calib/RejectList
1919

20-
The BadChannel and RejectList objects can be uploaded, e.g. for debug purposes, using the `o2-mch-bad-channels-ccdb` program :
20+
# o2-mch-bad-channels-ccdb
21+
22+
The BadChannel and RejectList objects can be uploaded, e.g. for debug purposes, using the `o2-mch-bad-channels-ccdb` program:
2123

2224
```shell
2325
$ o2-mch-bad-channels-ccdb --help
@@ -46,10 +48,57 @@ Usage:
4648
-a [ --alias ] arg DCS alias (HV or LV) to reject
4749
```
4850

49-
For instance, to create in a local CCDB a RejectList object which declares solar number 32 as bad, from Tuesday 1 November 2022 00:00:01 UTC to Saturday 31 December 2022 23:59:59, use :
51+
For instance, to create in a local CCDB a RejectList object which declares solar number 32 as bad, from Tuesday 1 November 2022 00:00:01 UTC to Saturday 31 December 2022 23:59:59, use:
5052

5153
```shell
5254
$ o2-mch-bad-channels-ccdb -p -s 32 -t RejectList --starttimestamp 1667260801000 --endtimestamp 1672531199000
5355
```
5456

5557
The program will search the reference CCDB (defined with `--referenceccdb`) for existing objects valid during this period and propose you to either overwrite them or update them. In the first case, a single object will be created, valid for the whole period, containing only the new bad channels. In the second case, as many objects as necessary will be created with appropriate validity ranges, adding the new bad channels to the existing ones.
58+
59+
# o2-mch-scan-hvlv-ccdb
60+
61+
the HV or LV DCS datapoints stored in the CCDB (http://alice-ccdb.cern.ch) can be scanned using the `o2-mch-scan-hvlv-ccdb` program:
62+
63+
```shell
64+
$ o2-mch-scan-hvlv-ccdb -h
65+
This program scans HV or LV channels looking for issues
66+
Usage:
67+
-h [ --help ] produce help message
68+
-r [ --runs ] arg run(s) to scan (comma separated list of runs
69+
or ASCII file with one run per line)
70+
-c [ --channels ] arg channel(s) to scan ("HV" or "LV" or comma
71+
separated list of (part of) DCS aliases)
72+
--configKeyValues arg Semicolon separated key=value strings to
73+
change HV thresholds
74+
-d [ --duration ] arg (=0) minimum duration (ms) of HV/LV issues to
75+
consider
76+
-w [ --warning ] arg (=1) warning level (0, 1 or 2)
77+
-p [ --print ] arg (=1) print level (0, 1, 2 or 3)
78+
-o [ --output ] arg (=scan.root) output root file name
79+
```
80+
81+
It takes as input a list of runs and a list of either HV or LV channels to scan. **Note that it will scan the CCDB from the begining of the first run to the end of the last one, which can represent quite of lot of files.** More details about the options are given below.
82+
83+
It produces as output a list of detected issues, with time, duration and affected runs, and a root file with the displays of the data points per channel per chamber for a visual inspection. Issues are triggered when HV/LV values go below a given threshold. For HV channels it also compares the issues found by the internal algorithm with the ones found by [Detectors/MUON/MCH/Status/src/HVStatusCreator.cxx](../Status/src/HVStatusCreator.cxx).
84+
85+
For instance, to scan all HV channels for runs 545222 and 545223 and detect issues of a minimum duration of 10s, use:
86+
```shell
87+
o2-mch-scan-hvlv-ccdb -r 545222,545223 -c HV -d 10000
88+
```
89+
90+
### channel input formats:
91+
* "HV" to scan all HV channels
92+
* "LV" to scan all LV channels
93+
* comma separated list of (part of) DCS aliases, which must be all of the same type, i.e contain either Quad/Slat (type = HV), or Group/an/di/Sol (type = LV)
94+
95+
### warning levels:
96+
* 0: no warning
97+
* 1: check data points timestamp w.r.t. HV/LV file validity range with ±5s tolerance
98+
* 2: check data points timestamp w.r.t. HV/LV file validity range without tolerance
99+
100+
### print levels:
101+
* 0: print detected issues
102+
* 1: same as 0 + print validity range of runs and HV/LV files
103+
* 2: same as 1 + print the first and last data points of each selected channel
104+
* 3: same as 1 + print all the data points of each selected channel

Detectors/MUON/MCH/Conditions/src/bad-channels-ccdb.cxx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,12 @@ std::set<uint64_t> listTSWhenBadChannelsChange(const std::string ccdbUrl, const
100100
std::string currentETag{};
101101
for (auto itTS = tsChanges.begin(); itTS != tsChanges.end();) {
102102
auto headers = api.retrieveHeaders(source, metadata, *itTS);
103-
if (headers["ETag"] == currentETag) {
103+
if (headers["ETag"].empty()) {
104+
std::cout << "- Warning: missing file" << std::endl;
105+
auto validUntil = (std::next(itTS) != tsChanges.end()) ? *std::next(itTS) : endTimestamp;
106+
std::cout << fmt::format(" validity range: {} - {}\n", *itTS, validUntil);
107+
++itTS;
108+
} else if (headers["ETag"] == currentETag) {
104109
itTS = tsChanges.erase(itTS);
105110
} else {
106111
if (verbose) {
@@ -129,6 +134,19 @@ BadChannelsVector queryBadChannels(const std::string ccdbUrl,
129134
std::map<std::string, std::string> metadata;
130135
auto source = ccdbPath(badChannelType);
131136
auto* badChannels = api.retrieveFromTFileAny<BadChannelsVector>(source, metadata, timestamp);
137+
if (badChannels == nullptr) {
138+
std::cout << "do you want to proceed anyway? [y/n] ";
139+
std::string response{};
140+
while (true) {
141+
std::cin >> response;
142+
if (response == "y") {
143+
std::cout << "number of bad channels = 0" << std::endl;
144+
return {};
145+
} else if (response == "n") {
146+
exit(3);
147+
}
148+
}
149+
}
132150
std::cout << "number of bad channels = " << badChannels->size() << std::endl;
133151
if (verbose) {
134152
for (const auto& badChannel : *badChannels) {

0 commit comments

Comments
 (0)