Skip to content
corrodis edited this page May 25, 2024 · 5 revisions

EPICS

The DAQ monitoring channels have the prefix Mu2e, followed by TDAQ_system, so TDAQ_crv for the CRV stand-alone DAQ.

EPICs settings

EPICS specific Metric Manager Settings

These settings are added through the metricsParametersLink to the epics daqMetricsLink (in artdaq processed, and FESupervisors/LinkToSupervisorTable)

  • channel_name_prefix=Mu2e: this will add the system prefix; for the mu2e systems, this needs to be present and set to Mu2e; the TDAQ_crv part doesn't need to be specified; it will be added by default
  • subsystem=(don't specify): only used for the artdaq epics channels (in the MetricAlarmThresholdsLink) used to generate the .dbg files from the otsdaq settings. If present, it sets the subsystem field in the .dbg files. The Mu2e should not be part of the .dbg files because it's added by our ioc. For mu2e, we should not specify this parameter. In this case, TDAQ_subsystem is used (as needed to match our conventions)

EPICs PV (process variable) and archiver channel creation

EPIC channels (PVs) are generated through .dbg files. At the DAQ configuration step, the SlowControlsSupervisor, (tries to) collect all EPIC PVs and generates corresponding .dbg files in $OTSDAQ_EPICS_DATA. This path should point to /home/mu2ecrv/daq/ots_v3/mu2e-dcs/apps/OTSReader/db/ (/home/mu2edcs/mu2e-dcs/apps/OTSReader/db if we are not running outside of the mu2e network, see here.). If there are changes in the files, a dirtyFlag.txt file is created (it contains "1"). On mu2e-dcs-01, there is a cron job checking for that flag; if present, all PVs are reloaded from the present files. The ioc is restarted. This ensures that the PVs are present in EPICs.

In addition, the SlowControlsSupervisor creates a corresponding channel (matching the PV name) in the archiver database: dcs_archive, running on mu2e-dcs-01:5434. In the CRV wideband setup, we keep an ssh tunnel to mu2e-dcs-01 open, so the database is available at localhost:5434.

Defining the EPIC PVs

In our setup, the SlowControlsSupervisor collects the PVs from two sources:

The slow controls channels, which are periodically read are defined in the SlowControlsChannelTable, linked in DTC and ROC FE. Where they are linked, defined the "loc" part in the channel name. For the slow controls PVs, SlowControlsMetricManagerChannelNamePreamble needs to be set to TDAQ_crv (for the artdaq PVs that is hard coded).

The second source are artdaq PVs. The actual channels/PVs are defined in the artdaq processes and potentially in the modules run in these processes. If we want to use them in EPICs, we need to manually add them for the EPIC PV and archiver channel creation. These PVs/channels are defined in MetricsAlarmThresholdTable linked in the corresponding artdaq processes (in the ARTDAQSupervisor). An individual .dbg file is created for each artdaq process type. If no subsystem in the EPIC-specific metrics manager is specified, TDAQ_crv is used by default.

One comment of caution, that the board reader PVs have an additional frament_id=1 in their name, so for example Mu2e:TDAQ_crv:br08l:1:Fragment_Rate.

Copy .dbg and dirtyFlag to mu2e-dcs-01

When working on a machine inside the mu2e network, /home/mu2edcs/mu2e-dcs/apps/OTSReader/db is the network mounted home and hence available on mu2e-dcs01 for processing. At wideband (mu2edaq08) we are outside of that network and need to copy the data over by hand. This is done with a script called syncWithDcs01.sh (in /home/mu2ecrv/daq/ots_v3/mu2e-dcs/apps/OTSReader/db). In addition to copying the files, it combines all the artdaq processes .dbg files into one used by the ioc called crv_artdaq-ai.dbg.