# DPL device without data source within DPL

**URL:** <https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824>\
**Category:** O²\
**Tags:** dpl, quality-control\
**Created:** [February 2, 2021, 8:42am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824 "2021-02-02T08:42:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tklemenz](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/tklemenz/32/115_2.png) [@tklemenz](https://alice-talk.web.cern.ch/u/tklemenz)\
**Post date:** [February 2, 2021, 8:42am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/1 "2021-02-02T08:42:37Z")

</div>

Hi,

I want to do a QC workflow that runs continuously and periodically takes data from the CCDB (via the `CDBInterface`) and publishes results.

Now I am wondering how one can set up a workflow with a task that does not have a data source from within the DPL.

Whenever I remove the data source from the config file (or leave the data source part empty) I get complaints that `dataSource` (or `type`) is missing when setting up the workflow with `o2-qc --config json://path/to/config/file`. Probably my config is very wrong for such a task and I assume the solution is trivial but I don’t know how it works.  
I am using [this config file](https://cernbox.cern.ch/index.php/s/Sp7aP6OcRAqXLqJ).

Thanks for any help!

Cheers,  
Thomas

---

<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:** [February 4, 2021, 8:55am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/2 "2021-02-04T08:55:15Z")

</div>

Hi Thomas,

The first idea that comes to my mind is that you should probably use a `post-processing` task for such a use case. It is asynchronous with regards to the data flow, it runs periodically.

@pkonopka what do you think ?  
Cheers,  
Barth

---

<div class="post-metadata">

**Author:** ![tklemenz](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/tklemenz/32/115_2.png) [@tklemenz](https://alice-talk.web.cern.ch/u/tklemenz)\
**Post date:** [February 4, 2021, 8:58am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/3 "2021-02-04T08:58:22Z")

</div>

Hi Barth,

this sounds reasonable. I will give it a try.

Cheers,  
Thomas

---

<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:** [February 4, 2021, 9:15am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/4 "2021-02-04T09:15:36Z")

</div>

> [@bvonhall](#):
>
> @pkonopka what do you think ?

Yes, at least the Post-processing in QC was designed to do exactly that.

---

<div class="post-metadata">

**Author:** ![tklemenz](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/tklemenz/32/115_2.png) [@tklemenz](https://alice-talk.web.cern.ch/u/tklemenz)\
**Post date:** [February 4, 2021, 11:02am UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/5 "2021-02-04T11:02:09Z")

</div>

I need to figure out some settings but in principle this solves the described issue.

Thanks a lot!  
Cheers,  
Thomas

---

<div class="post-metadata">

**Author:** ![tklemenz](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/tklemenz/32/115_2.png) [@tklemenz](https://alice-talk.web.cern.ch/u/tklemenz)\
**Post date:** [February 5, 2021, 12:52pm UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/6 "2021-02-05T12:52:22Z")

</div>

Hi,

sorry to reactivate this solved thread. I am now doing a `post-processing` task. In the `update` function of the `PostProcessingInterface` I see that there is a `ServiceRegistry` object that I can access. The comment of that function says

```auto
\param services Interface containing optional interfaces, for example DatabaseInterface

```

so I assume I can get data from the database. I simply do not know how. Is there a function from the `ServiceRegistry` object that does the trick? I could not find an obvious one.

What I would like to get is an object from the CCDB whenever the `update` function is called and then do operations on the data within the function. The object is not a `TObject` in case that matters (to be specific: it is `o2::tpc::CalDet<float>`). For testing purposes I got the data via the `o2::tpc::CDBInterface` which is missing a bit of functionality to meet the requirements here and we won’t need to implement that now if the `ServiceRegistry` object can do that anyway.

Just to make clear: This is no `TrendingTask`.

Any help is very much appreciated.  
Cheers,  
Thomas

---

<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:** [February 5, 2021, 1:47pm UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/7 "2021-02-05T13:47:29Z")

</div>

You can retrieve the `DatabaseInterface` with:

```auto
  auto& qcdb = services.get<repository::DatabaseInterface>();

```

similarly to the [TrendingTask](https://github.com/AliceO2Group/QualityControl/blob/dd1b9e14a64275989f2b00626f1f942812c713c3/Framework/src/TrendingTask.cxx#L57). However, `DatabaseInterface` does not allow to retrieve objects which don’t inherit `TObject`. The changes you need should appear together with [https://alice.its.cern.ch/jira/browse/QC-348](https://alice.its.cern.ch/jira/browse/QC-348) (@bvonhall), but for now, to be able to proceed, you could use the [CcdbApi](https://github.com/AliceO2Group/AliceO2/tree/dev/CCDB) . You can just instantiate it on your own in your post-processing task, it allows to retrieve any object which has a dictionary as far as i remember.  
I hope this helps, let me know if something is not clear.  
Cheers!

---

<div class="post-metadata">

**Author:** ![tklemenz](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/tklemenz/32/115_2.png) [@tklemenz](https://alice-talk.web.cern.ch/u/tklemenz)\
**Post date:** [February 5, 2021, 1:49pm UTC](https://alice-talk.web.cern.ch/t/dpl-device-without-data-source-within-dpl/824/8 "2021-02-05T13:49:44Z")

</div>

Thanks a lot, I will have a look!

Cheers,  
Thomas
