You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optionally select CTFs in timestamps or orbits range
New option
--ir-frames-files <root_file_with_IRFrames_to_select>
allows to push to DPL only those TFs which overlap with the
<runnumber> <range-min> <range-max>
(separators can be any whitespace, comma or semicolon) records provided
via text file (assuming that there are some entries for a given run,
otherwise the option is ignored).
Multiple ranges per run and multiple runs can be mentioned in a single
input file. The range limits can be indicated either as a UNIX
timestamp in ms or as an orbit number (in the fill the run belongs to).
In case an option --invert-irframe-selection is provided, the selections above are inverted:
TFs matching some of the provided ranges will be discarded, while the rest will be pushed to the DPL
At the end of the processing the ctf-writer will create a local file ctf_read_ntf.txt containing only
the number of TFs pushed to the DPL.
In case no TF passed the selections above, this file will contain 0.
Copy file name to clipboardExpand all lines: Detectors/CTF/README.md
+37-11Lines changed: 37 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,14 @@ comma-separated list of detectors to read, Overrides skipDet
95
95
```
96
96
comma-separated list of detectors to skip
97
97
98
+
99
+
By default an exception will be thrown if detector is requested but missing in the CTF. To enable injection of the empty output in such case one should use option `--allow-missing-detectors`.
100
+
101
+
```
102
+
--ctf-data-subspec arg (=0)
103
+
```
104
+
allows to alter the `subSpecification` used to send the CTFDATA from the reader to decoders. Non-0 value must be used in case the data extracted by the CTF-reader should be processed and stored in new CTFs (in order to avoid clash of CTFDATA messages of the reader and writer).
105
+
98
106
```
99
107
--max-tf arg (=-1)
100
108
```
@@ -141,31 +149,34 @@ There is a possibility to read remote root files directly, w/o caching them loca
141
149
2) provide proper regex to define remote files, e.g. for the example above: `--remote-regex "^root://.+/eos/aliceo2/.+"`.
142
150
3) pass an option `--copy-cmd no-copy`.
143
151
152
+
## Selective TF reading
153
+
144
154
```
145
155
--select-ctf-ids <id's of CTFs to select>
146
156
```
147
157
This is a `ctf-reader` device local option allowing selective reading of particular CTFs. It is useful when dealing with CTF files containing multiple TFs. The comma-separated list of increasing CTFs indices must be provided in the format parsed by the `RangeTokenizer<int>`, e.g. `1,4-6,...`.
148
158
Note that the index corresponds not to the entry of the TF in the CTF tree but to the reader own counter incremented throught all input files (e.g. if the 10 CTF files with 20 TFs each are provided for the input and the selection of TFs
149
159
`0,2,22,66` is provided, the reader will inject to the DPL the TFs at entries 0 and 2 from the 1st CTF file, entry 5 of the second file, entry 6 of the 3d and will finish the job.
150
160
151
-
For the ITS and MFT entropy decoding one can request either to decompose clusters to digits and send them instead of clusters (via `o2-ctf-reader-workflow` global options `--its-digits` and `--mft-digits` respectively)
152
-
or to apply the noise mask to decoded clusters (or decoded digits). If the masking (e.g. via option `--its-entropy-decoder " --mask-noise "`) is requested, user should provide to the entropy decoder the noise mask file (eventually will be loaded from CCDB) and cluster patterns decoding dictionary (if the clusters were encoded with patterns IDs).
will decode ITS and MFT data, decompose on the fly ITS clusters to digits, mask the noisy pixels with the provided masks, recluster remaining ITS digits and send the new clusters out, together with unchanged MFT clusters.
164
+
This option (used for skimming) allow to push to DPL only those TFs which overlap with selected BC-ranges provided via input root file (for various formats see `o2::utils::IRFrameSelector::loadIRFrames` method).
will send decompose clusters to digits and send ben out after masking the noise for the MFT, while ITS clusters will be sent as decoded.
162
-
163
-
By default an exception will be thrown if detector is requested but missing in the CTF. To enable injection of the empty output in such case one should use option `--allow-missing-detectors`.
169
+
This option allows to push to DPL only those TFs which overlap with the `<runnumber> <range-min> <range-max>` (separators can be any whitespace, comma or semicolon) records provided via text file (assuming that there are some entries for a given run, otherwise the option is ignored).
170
+
Multiple ranges per run and multiple runs can be mentioned in a single input file. The range limits can be indicated either as a UNIX timestamp in `ms` or as an orbit number (in the fill the run belongs to).
164
171
172
+
In case an option
165
173
```
166
-
--ctf-data-subspec arg (=0)
174
+
--invert-irframe-selection
167
175
```
168
-
allows to alter the `subSpecification` used to send the CTFDATA from the reader to decoders. Non-0 value must be used in case the data extracted by the CTF-reader should be processed and stored in new CTFs (in order to avoid clash of CTFDATA messages of the reader and writer).
176
+
is provided, the selections above are inverted: TFs matching some of the provided ranges will be discarded, while the rest will be pushed to the DPL
177
+
178
+
At the end of the processing the `ctf-writer` will create a local file `ctf_read_ntf.txt` containing only the number of TFs pushed to the DPL.
179
+
In case no TF passed the selections above, this file will contain 0.
169
180
170
181
## Support for externally provided encoding dictionaries
171
182
@@ -201,3 +212,18 @@ Additionally, one may throttle on the free SHM by providing an option to the rea
201
212
202
213
Note that by default the reader reads into the memory the CTF data and prepares all output messages but injects them only once the rate-limiter allows that.
203
214
With the option `--limit-tf-before-reading` set also the preparation of the data to inject will be conditioned by the green light from the rate-limiter.
215
+
216
+
217
+
## Modifying ITS/MFT CTF output
218
+
219
+
For the ITS and MFT entropy decoding one can request either to decompose clusters to digits and send them instead of clusters (via `o2-ctf-reader-workflow` global options `--its-digits` and `--mft-digits` respectively)
220
+
or to apply the noise mask to decoded clusters (or decoded digits). If the masking (e.g. via option `--its-entropy-decoder " --mask-noise "`) is requested, user should provide to the entropy decoder the noise mask file (eventually will be loaded from CCDB) and cluster patterns decoding dictionary (if the clusters were encoded with patterns IDs).
will decode ITS and MFT data, decompose on the fly ITS clusters to digits, mask the noisy pixels with the provided masks, recluster remaining ITS digits and send the new clusters out, together with unchanged MFT clusters.
LOGP(fatal, "Failed to open selected run/timespans file {}", mInput.fileRunTimeSpans);
228
+
}
229
+
std::string line;
230
+
size_t cntl = 0, cntr = 0;
231
+
while (std::getline(inputFile, line)) {
232
+
cntl++;
233
+
for (char& ch : line) { // Replace semicolons and tabs with spaces for uniform processing
234
+
if (ch == ';' || ch == '\t' || ch == ',') {
235
+
ch = '';
236
+
}
237
+
}
238
+
o2::utils::Str::trim(line);
239
+
if (line.size() < 1 || line[0] == '#') {
240
+
continue;
241
+
}
242
+
auto tokens = o2::utils::Str::tokenize(line, '');
243
+
auto logError = [&cntl, &line]() { LOGP(error, "Expected format for selection is tripplet <run> <range_min> <range_max>, failed on line#{}: {}", cntl, line); };
244
+
if (tokens.size() >= 3) {
245
+
int run = 0;
246
+
long rmin, rmax;
247
+
try {
248
+
run = std::stoi(tokens[0]);
249
+
rmin = std::stol(tokens[1]);
250
+
rmax = std::stol(tokens[2]);
251
+
} catch (...) {
252
+
logError();
253
+
continue;
254
+
}
255
+
256
+
constexprlong ISTimeStamp = 1514761200000L;
257
+
int convmn = rmin > ISTimeStamp ? 1 : 0, convmx = rmax > ISTimeStamp ? 1 : 0; // values above ISTimeStamp are timestamps (need to be converted to orbits)
258
+
if (rmin > rmax) {
259
+
LOGP(fatal, "Provided range limits are not in increasing order, entry is {}", line);
260
+
}
261
+
if (mConvRunTimeRangesToOrbits == -1) {
262
+
if (convmn != convmx) {
263
+
LOGP(fatal, "Provided range limits should be both consistent either with orbit number or with unix timestamp in ms, entry is {}", line);
264
+
}
265
+
mConvRunTimeRangesToOrbits = convmn; // need to convert to orbit if time
if (mConvRunTimeRangesToOrbits != convmn || mConvRunTimeRangesToOrbits != convmx) {
269
+
LOGP(fatal, "Provided range limits should are not consistent with previously determined {} input, entry is {}", mConvRunTimeRangesToOrbits == 1 ? "timestamps" : "orbits", line);
270
+
}
271
+
}
272
+
273
+
mRunTimeRanges[run].emplace_back(rmin, rmax);
274
+
cntr++;
275
+
} else {
276
+
logError();
277
+
}
278
+
}
279
+
LOGP(info, "Read {} time-spans for {} runs from {}", cntr, mRunTimeRanges.size(), mInput.fileRunTimeSpans);
0 commit comments