Tango database interface
C++ interface to the Tango database of the Slow Control System.
The Slow Control System (SCS) of the BM@N experiment is based on the Tango Controls toolkit, and the hardware parameters of the detectors and the facility (e.g. high voltages, currents, magnetic field) are archived in the Tango database. The TangoData class reads the archived parameters for a time interval or a run range, prints and draws them and calculates their average values to use them in the data processing.
The names of the parameters can be found in the Web viewer of the SCS (bmn-tango.jinr.int). The Grafana interface of the slow control team (bmn-sc.jinr.ru) is also available to view the data, but only in the JINR network.
Files
- TangoData.h(.cxx) - TangoData class to read, print and draw the parameters, and auxiliary classes: TangoTimeParameter (value(s) of the parameter at a time point), TangoTimeInterval (time interval)
- TangoConnection.h(.cxx) - connection to the Tango database
- tango_db_settings.h - connection settings of the Tango database (PostgreSQL); the old MySQL database is used automatically for the data before 2020-03-25
- examples - example macros (see examples)
Parameter names
A Tango parameter is defined as domain/family/member/attribute, e.g. fhcal/hv/hv_1/vch_2_1. TangoData takes:
- system_name - Tango domain (e.g. "magnet", "fhcal", "gem")
- parameter_name - Tango attribute (e.g. "ch_1", "vch_2_1", "vmon_0")
- member_name - Tango member (e.g. "hv_1", "mod_0"), or "family/member" if the member name is not unique in the domain (e.g. "caen_232/mod_2" for CSC or "plane1_top/adcsc_7_temp" for FSD), empty string - the member is not used in the search
Reading the parameters
TangoData tango(
"2026-03-01 10:00:00",
"2026-03-01 11:00:00",
"magnet",
"ch_1");
TangoData tango_runs(9, 9696, 9730,
"fhcal",
"vch_2_1",
"hv_1");
if (tango_runs.GetTangoData() == nullptr)
cout << "ERROR: Tango data were not obtained" << endl;
Every Tango time point is a transition to a new value, i.e. the value is valid up to the next time point. GetTangoData() returns TObjArray of TangoTimeParameter objects; the first point is the value valid at the start time (if the parameter was archived before), the last point is the value valid at the end time. Note that the last archived value is extended up to the end time, even if the archiving was stopped before it.
Main functions
- PrintTangoDataConsole(), PrintTangoArrayConsole(vector) - print the values of the parameter or a set of parameters
- PrintTangoDataMultiGraph(), PrintTangoArrayMultiGraph(vector) - draw the channels of an array parameter or a set of parameters as line graphs (steps) in 2D or 3D view
- PrintTangoDataSurface() - draw an array parameter as a 2D surface
- PrintTangoArraySurface(vector) - draw a set of parameters (e.g. channels of FHCal or GEM high voltage) as a 2D histogram: X - time, Y - channel, Z - value; "SURF1" (surface), "LEGO2" (columns), "COLZ" (color map) or other draw options
- GetAverageTangoData() - time-weighted average value over the whole time interval
- GetRunAverageTangoData() - time-weighted average value only over the time of the runs (for the run range)
- SearchTangoIntervals(), PrintTangoIntervalConsole() - get and print the time intervals where a numeric or boolean parameter satisfies a condition (e.g. trips of the detectors or switched off channels: pw_N == 0 for GEM)
The canvases are named by the displayed data and the kind of view, e.g. fhcal_hv_1_vch_2_1_to_vch_2_10_p9_r9696_9730_surf1, so drawing the same data in the same view replaces the canvas. In the drawing of a set of parameters, the channels are numbered by their index in the vector.
Library
Built into the TangoData library; the ROOT dictionary is defined in TangoDataLinkDef.h.