channel mapping - E1039-Collaboration/e1039-wiki GitHub Wiki

How to Update Channel Mapping

The channel mapping here defines the ID relation between readout channel and detector element. The concept of the (current) channel mapping is described in DocDB 5497. This page materially explains how to update the channel mapping. The update operation is usually done by the online software manager, but can be done by subsystem expert.

Taiwan TDC

A readout channel is specified with [ROC, TDC, channel] and a detector element with [detector, element]. Below are all the subsystems using Taiwan TDC.

Subsystem Channel-Map Directory
Hodoscope ??
DP hodo ??
Trigger ??
Chamber /data2/chambers/mapping/channel_mapping
Prop Tube ??

Format of Mapping Info

There are several steps in managing the mapping info. The format of the mapping info varies with the steps in order to absorb the difference between subsystems.

  • OrgSub: It is the original info on the mapping of each subsystem. It is managed by its expert, together with all past versions, change logs and applicable run ranges. Any format is fine, which can contain extra fields such as cable ID.
  • TsvSub: It contains only the five fields (i.e. ROC, TDC, channel, detector, element) separated by tab. There should be a script per subsystem that converts an OrgSub file to a TsvSub file.
  • TsvAll: It contains the mapping of all subsystems. There is a script to create it by merging TsvSub of all subsystems.
  • DB: It contains the identical info as TsvAll. The decoder (and all other processes) accesses this, not TsvAll. There is a script to create it from TsvAll.

Mapping Name

TsvAll must be given a unique name (or ID). It can be any string but is usually a 10-digit number as "[year][month][day][serial]".

Update Procedure

We assume, as an example, the name of the latest mapping is 2020012301 and that of the new one you are creating is 2020113001.

  1. Create a new OrgSub file and convert it to TsvSub. The procedure should be documented per subsystem.
  2. Create a directory for the new mapping, by copying the previous one:
    cd /data2/e1039/resource/chan_map/taiwan
    cp -a 2020012301 2020113001
    
  3. Copy the new TsvSub file ("cham.tsv" as example) into the directory:
    cd 2020113001
    cp -p /path/to/cham.tsv sub/
    
  4. Edit 00readme.txt to explain the change you made.
  5. Create TsvAll:
    ./merge.sh
    
  6. Add a run range for the new mapping by editing run_range.tsv.
  7. Upload the new mapping to MySQL DB, by using a wrapper script:
    /data2/e1039/core/default/macros/packages/geom_svc/upload-param.sh chan taiwan 2020113001
    

V1495 TDC

To be written.

Main-DAQ Scaler

To be written.