Is there a way to access the time when the given data was collected based on the digit file?
We would like to run QC (not only PostProcessing) on the old data (CTFs->digits), but for this we need a filling scheme from when the data was collected. Ideally, get timestamp from digit file and pull proper filling scheme from CCDB.
However, maybe there is another way to achieve our aim, we know for instance the runNumber so from automatic matching it to fillNumber it would be possible to construct the query which would return correct filling scheme?
No, digit files don’t have timing info. The correct way is to run the ctf-based workflow with o2-tfidinfo-writer-workflow piped to the global workflow. This will create a o2_tfidinfo.root file containing the run and timing info for every TF processed.
After that you can run any workflow using the results of the previous workflow (e.g. digits) by passing an option --hbfutils-config o2_tfidinfo.root.
The framework will take care of injecting the run/timing info into the DPL headers used by the DPL CCDB fetcher to query CCDB objects.
sorry, I don’t understand what you mean: if you are running with ctf-reader, then the time and 1st orbit of every TF in injected into the DPL header. With the o2-fv0-digit-reader-workflow the same can be achieved by providing the o2_tfidinfo.root extracted during CTF processing. How do you access CCDB in the QC? Are you using DPL fetcher (in this case it knows how to extract the timestamp from the headers) or BasicCCDBManager (where you need to set the timestamp by hand)?
We run the o2-fv0-digit-reader-workflow with the o2_tfidinfo.root but still cannot get filing scheme objects with the proper timestamp from CCDB. I think we need to make something more in the code to make it. Sebastian pointed me to similar discussion
You never set the timestamp to CcdbApi therefore it is querying with the timestamp of now. The approximate timestamp (up 1s precision) can be extracted from the o2::framework::ProcessingContext& pc, e.g. pc.services().get<o2::framework::TimingInfo>().creation.
I am not familiar enough with the QC framework to tell if it is available in the PostProcessing task, perhaps @pkonopka can comment. If it is not, then you need to extract the info you need from the CCDB objects during TF processing and use it in the postprocessing.
Note that we are trying to eliminate the usage of custom CCDB queries in the workflows, instead, the DPL CCDB fetched should be used, see CCDB_intro - Google Präsentationen for the reference.
Ok, using pc.services().get<o2::framework::TimingInfo>().creation is exactly what we were searching for, thank you @shahoian !
I don’t know how strictly you want to eliminate custom CCDB queries, in our case we need it only for 1 object per cycle (5 min).
@pkonopka in another topic, linked by Jacek, field Activity::start was mentioned as a potential solution – do you have any update on that?
Activity::start is now accesible to QC tasks. The value comes from the config files and could be overwritten with --override-values "qc.config.Activity.start=123434" and it is done this way for QC in MC.
At P2 the SOR is not propagated yet.