Allow XML initialization for optical connection
Refactored the configuration pipeline to improve clarity, consistency, and robustness in RD53 chip handling.
Changes with copy_ph2_acf_files
- Updated
search_rd53_keyto recursively detect all RD53 flavour keys and validate their consistency. Raises an error if multiple types are found. - Improved
update_rd53to ensure the correct replacement of RD53Bv1 with RD53Bv2 when required. Added proper error handling for missing or malformed XML structures. - Added
uncomment_lpGBT_section_if_optical - Cleaned up
get_filesto better handle hybrid/chip structures, preserve default NTC settings, and support clean XML formatting. - Added validation to prevent ambiguous RD53 configurations.
These changes make the system more robust against malformed inputs and more maintainable going forward. It supports both electrical and optical configurations. The following configurations are allowed:
# for optical connection
config_dict = {
"OpticalGroup":{
"X": { # id
"FMCId" : "L12" # optional
"lpGBT" : {"version": 1, "ChipAddress": "0x70"} # required
"Hybrid": {
"0": {...} # should only have one instance
}
}
}
# for electrical connection
config_dict = {
"OpticalGroup":{
"X": { # id
"FMCId" : "L12" # optional
"Hybrid": {
"0": {...}, # multiple instances are allowed
"1": {...},
...
} # must not have any lpGBT configuration
}
}
# for electrical conneciton, simplified configuration without optical group
hybrid_dict = {
"Hybrid": {
"0": {...},
"1": {...},
...
}
Add a loop over the optical group.
Edited by Fanqiang Meng