# timeStamp in asynchronous QC (e.g. for TaskInterface::retrieveCondition(Any) calls)

**URL:** <https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250>\
**Category:** O² FLP\
**Tags:** quality-control\
**Created:** [June 27, 2022, 2:15pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250 "2022-06-27T14:15:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [June 27, 2022, 2:15pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/1 "2022-06-27T14:15:38Z")

</div>

Hi,

I have a QC task that needs to read some condition data from CCDB (e.g. `GLO/GRP/BunchFilling`). When using that task in a synchronous workflow all is fine as I get the condition for the current running conditions (aka timeStamp=-1=now). But when running an asynchronous workflow (starting from CTFs), I’d want to use the timeStamp of the CTF I’m reading and not “now”. How can I achieve that ?

Thanks,

---

<div class="post-metadata">

**Author:** ![shahoian](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@shahoian](https://alice-talk.web.cern.ch/u/shahoian)\
**Post date:** [June 27, 2022, 2:26pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/2 "2022-06-27T14:26:02Z")

</div>

Hi,

CTF injects to DataProcessingHeader the original creation time of the TF stored during sync. processing.  
This was introduced in Nov.2021, for the CTFs of global runs of the pilot beam the time is injected from the special lookup table.

---

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [June 27, 2022, 2:49pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/3 "2022-06-27T14:49:09Z")

</div>

ok, yes, I guess I can use

```auto
auto creationTime = o2::header::get<o2::framework::DataProcessingHeader*>(some input)->creation;

```

in my task’s `monitorData` method. But then I’d have to implement the logic of knowing if the condition object is still valid or not, right ? (to know if I must call retrieveCondition again or not, as I guess it would not be a good idea to call it at each call to `monitorData`?)

There seem to be a `start` field in the `Activity` object : is it supposed to be useable for that purpose maybe ? (@bvonhall ?)

---

<div class="post-metadata">

**Author:** ![shahoian](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@shahoian](https://alice-talk.web.cern.ch/u/shahoian)\
**Post date:** [June 27, 2022, 3:19pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/4 "2022-06-27T15:19:13Z")

</div>

But why don’t you use the DPL CCDB fetcher?

---

<div class="post-metadata">

**Author:** ![bvonhall](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/bvonhall/32/8_2.png) [@bvonhall](https://alice-talk.web.cern.ch/u/bvonhall)\
**Post date:** [June 27, 2022, 3:24pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/5 "2022-06-27T15:24:12Z")

</div>

> [@laphecet](#):
>
> There seem to be a `start` field in the `Activity` object : is it supposed to be useable for that purpose maybe ? (@bvonhall ?)

Just answering this bit: yes, it should be that.

---

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [June 27, 2022, 3:59pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/6 "2022-06-27T15:59:29Z")

</div>

Well, because I don’t see how to tweak the inputs in the QC to add a condition one . Somehow the handling of the inputs is “automatic” in the QC framework. Or at least that’s how I’ve used them so far 😉

---

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [June 27, 2022, 3:59pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/7 "2022-06-27T15:59:59Z")

</div>

but is it supposed to be filled by someone ?

---

<div class="post-metadata">

**Author:** ![bvonhall](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/bvonhall/32/8_2.png) [@bvonhall](https://alice-talk.web.cern.ch/u/bvonhall)\
**Post date:** [June 28, 2022, 9:36am UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/8 "2022-06-28T09:36:53Z")

</div>

I think so, but @pkonopka can say more.

---

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [June 28, 2022, 1:28pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/9 "2022-06-28T13:28:44Z")

</div>

@shahoian any advice on how to actually use the CCDB fetcher in a QC task ?

---

<div class="post-metadata">

**Author:** ![shahoian](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@shahoian](https://alice-talk.web.cern.ch/u/shahoian)\
**Post date:** [June 28, 2022, 1:40pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/10 "2022-06-28T13:40:19Z")

</div>

I guess one should request the CCDB inputs via jsons but I don’t know if/how one can indicate there that these are ccdbParamSpec types. @bvonhall or @eulisse may suggest.

---

<div class="post-metadata">

**Author:** ![pkonopka](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@pkonopka](https://alice-talk.web.cern.ch/u/pkonopka)\
**Post date:** [July 4, 2022, 6:52am UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/11 "2022-07-04T06:52:46Z")

</div>

This is how to specify a condition input in the string format, which we use in QC config files:

> <https://github.com/AliceO2Group/AliceO2/blob/dev/Framework/Core/COOKBOOK.md#building-a-data-query-by-string>

> There seem to be a `start` field in the `Activity` object : is it supposed to be useable for that purpose maybe ? (@bvonhall ?)

Unfortunately this is a placeholder yet, since we were not able to get the SOR time from some central service. It will be done, but I can’t give you an ETA at this moment.

---

<div class="post-metadata">

**Author:** ![laphecet](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/laphecet/32/12_2.png) [@laphecet](https://alice-talk.web.cern.ch/u/laphecet)\
**Post date:** [July 8, 2022, 12:36pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/12 "2022-07-08T12:36:03Z")

</div>

Hi Piotr,

Sorry for the late reaction.  
So, if I understand correctly, if I were to put e.g. “geometry:GLO/Config/Geometry/0?lifetime=condition” in the `query` parameter of the `datasource` of my task, then the retrieval of the condition would be done automatically for me.  
And also with the correct timestamp (that of the data being read) or not (yet) ?

Cheers,

---

<div class="post-metadata">

**Author:** ![pkonopka](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/p/e47774/32.png) [@pkonopka](https://alice-talk.web.cern.ch/u/pkonopka)\
**Post date:** [July 11, 2022, 5:50am UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/13 "2022-07-11T05:50:27Z")

</div>

Yes, that would be my expectation, though I have not tried it out myself, so please watch out for bugs.

---

<div class="post-metadata">

**Author:** ![jotwinow](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/j/8dc957/32.png) [@jotwinow](https://alice-talk.web.cern.ch/u/jotwinow)\
**Post date:** [August 26, 2022, 2:05pm UTC](https://alice-talk.web.cern.ch/t/timestamp-in-asynchronous-qc-e-g-for-taskinterface-retrievecondition-any-calls/1250/14 "2022-08-26T14:05:47Z")

</div>

Did you manage to run it? @shahoian @pkonopka @laphecet

We have faced the same problem with the FIT QC. @sbysiak
