![]() |
Project
|
Local example workflow with local CCDB (running on port 6464) :
In order to test the processing of their datapoints, subsystems can, for instance, setup a basic workflow chain consisting of a simulator, a processor and a ccdb populator.
The simulator must create a message containing a vector of DataPointCompositeObject for the detector. The processor then does "something" with those data points, and creates a set of object pairs (clbInfo,clbPayload) that are transmitted to the ccdb populator to be uploaded to the CCDB.
The ccdb populator is an existing workflow that can be reused by any susbsystem. The processor is of course detector specific and must be written accordingly. The simulator is also detector specific in the sense that each detector has a different set of datapoints to be simulated. It can be written from scratch if so desired, but it can also be written with the help of getDCSRandomGeneratorSpec
function (defined in the Detectors/DCS/testWorkflow/include/DCStestWorkflow/DCSRandomDataGeneratorSpec.h
include file) for cases where random generation of data points is sufficient.
It then boils down to :
A concrete example can be found in the Detectors/TOF/calibration/testWorkflow
dir : tof-calibration-dcs-sim-workflow
.
It is the proxy to connect to the DCS machine. For test purposes, you can run with either hard-coded DPs (–test-mode), or reading a configuration entry from CCDB, which can be created with testWorkflow/macros/makeCCDBEntryForDCS.C
. To validate the retrieval of data, you can attach the workflow o2-dcs-data-client
, e.g.:
This is a proxy to import the detector configuration files from DCS server into the DPL. A simple test is
to receive from the CHANFROM
DCS channel the configuration file name (starting with detector name) and the file itself and inject them as DPL messages with specs <DET>/DCS_CONFIG_NAME/0
and <DET>/DCS_CONFIG_FILE/0
respectively. The o2-dcs-config-consumer-test-workflow
is a dummy processing device which just consumes such messages for the detector <DET>
.
If the CHANACK
string is not empty, then the acknowledgment string OK
will be sent to this channel on every reception of the DCS message.
While the real exchange will be with the DCS server, for the local tests one can use the DCS server emulator
. As a prerequisite, this will require building the ccpzmq
package which is in the alidist but is not dependency of the O2
:
Then, one should load it together with O2, e.g. alienv load cppzmq/latest O2/latest
and compile locally the emulator code, e.g.:
This will compile tree executables dcssend
, dcsclient
and dcssendDPs. The former one is the DCS server emulator
which has the following options:
You can use it as e.g.:
In case the process should end upon successful sending of the object, add -q true
. This is helpful e.g. in case several objects should be sent from a script. Otherwise the object is sent over and over again.
Then, in other terminal you can run your DCS config processor, as described above (make sure the ports of sender and receiver are consistent. In case of problems you can validate the receiving process using dcsclient
test utility (emulates o2-dcs-config-proxy ...
workflow by receiving the file from the DCS server
and sending it an acknowledgment):
The dcssendDPs
can be used to emulate the DCS DPs data coming from the ADAPOS server.