Digi identifier
When reading TDigiEvent, the m_intId field in mdc, tof, emc, muc, and cgem branches represents the electronics readout ID (TEID), also known as Identifier in BOSS. pybes3 provides methods to parse and calculate the digi ID for each detector.
Digi array parsing
Info
The MUC full digi parsing is still under development. Use the standalone digi ID parsing methods for MUC digis for now.
import pybes3.identifier as p3id
import uproot
# read raw digi array
mdc_digi = uproot.open("test.rtraw")["Event/TDigiEvent/m_mdcDigiCol"].array()
# parse whole digi array
mdc_digi = p3id.parse_mdc_digi(mdc_digi)
Standalone digi-ID parsing
When full digi array parsing is not necessary or not yet supported, use parse_xxx_id methods (where xxx is the detector name: cgem, mdc, tof, emc, muc) to parse only the digi ID:
import pybes3.identifier as p3id
import uproot
# read raw digi array
tof_digi = uproot.open("test.rtraw")["Event/TDigiEvent/m_tofDigiCol"].array()
emc_digi = uproot.open("test.rtraw")["Event/TDigiEvent/m_emcDigiCol"].array()
# parse digi ID
tof_id = p3id.parse_tof_id(tof_digi["m_intId"])
emc_id = p3id.parse_emc_id(emc_digi["m_intId"])
Info
parse_mdc_id and parse_emc_id currently return detector ID-related fields only.
Convert digi ID to a specific field
import pybes3.identifier as p3id
# get TOF part number
tof_part = p3id.tof_id_to_part(tof_digi["m_intId"])
# get EMC theta number
emc_theta = p3id.emc_id_to_theta(emc_digi["m_intId"])
# get detector gid from electronics ID
tof_gid = p3id.tof_id_to_gid(tof_digi["m_intId"])
See the Identifier API for all available methods.
Digi-ID calculation
To compute m_intId from geometry numbers, use get_xxx_id methods (where xxx is the detector name: cgem, mdc, tof, emc, muc):
import pybes3.identifier as p3id
# get TOF digi geometry numbers
part = tof_id["part"]
layer_or_module = tof_id["layer_or_module"]
phi_or_strip = tof_id["phi_or_strip"]
end = tof_id["end"]
# calculate TOF digi ID
tof_int_id = p3id.get_tof_id(part, layer_or_module, phi_or_strip, end)
Info
pybes3 uses a different convention for the TOF part number:
0,1,2for scintillator endcap 0, barrel, and endcap 13,4for MRPC endcap 0 and endcap 1
With this convention, TOF ID information can be decoded into 4 fields: part, layer_or_module, phi_or_strip, and end.