Cycle vs Activity?

Dear all

sorry for the ignorance. In the QcTasks I see that there are member functions for start/end of Cycle and Activity. What is a Cycle and what is an Activity? If you could provide an example in the context of a detector the chances that I get it may increase :slight_smile:

thanks a lot and have a nice weekend

guillermo

Dear Guillermo,

the activity is the overall activity of the QC task, starting the activity means starting, in your QualityControl workflow, the (O2) QC task. When starting the activity, the histograms are reset, hence your start from fresh and empty histograms. The task is then running in cycles, where in each cycle it looks for inputs and processes those within a given time window and after that time window publishes the histograms. Then, a new cycle is started without resetting the histograms.

You can find examples for the TPC in: alice/QualityControl/Modules/TPC/
(assuming "alice" is your main alice software repository).

E.g. you can have a look at src/PID.cxx and a corresponding configuration file run/tpcQCPID_sampled.json. In the json file, within the "tasks" section, you see the two lines:

  "cycleDurationSeconds": "10",
  "maxNumberCycles": "-1",

This sets the duration of each cycle to 10 seconds and the maximum number of cycles to “-1”, which is infinity, i.e. the task will run forever (unless it is stopped manually).

I hope, this helps!

Cheers,
Stefan

If may chime in:
What Stefan said is correct (thank you). Think of Activity as of a one lifetime of a QC task. That might correspond to one data-taking run, or a shorter period, if you keep it running just for half an hour during a longer data-taking run.

That it correct for small setups. However if we run a QC task in parallel on multiple nodes and then its result will have to be merged, we might invoke TaskInterface::reset() at the end of each cycle. That should clean the histograms, so we send only the last difference to be merged. Complete MonitorObjects, after merging, will still contain the complete data. These complete, merged MOs will go to Checks.

It is still to be decided if we merge only histogram differences or the full-history versions. If justified, we will support both possibilities.

Dear Stefan, Piotr

thanks a lot for the clarification …
but I still do not understand very well cycles and the relation with real data taking …

If I understand it correctly, during data taking the data from a given detector will be read out in time frames. Does a time frame should correspond to a cycle (assuming no downscaling from the sampling, that is that QC will process all the data)? If yes, how are they synchronised? (the units of cycles seems to be seconds, not time frames)

thanks again for your help
greetings from Prague and have a nice afternoon
guillermo

As far as I know, that it kind of true, but during the data processing we might actually have different granularity. There might be multiple messages flying around, corresponding to the same Timeframe.

These are not synchronised. The idea of “cycle” is to have your MonitorObjects regularly published and checked, in a constant time period which can be configured.
So QC tasks might receive and process data within certain time domain, but they send the most recent MonitorObjects in regular intervals, even when no input data arrives. Input and output time domains are totally independent.

Hi Piotr

thanks a lot, now it is clearer

have a nice day

guillermo