705 def testEDMList(edm_list, error_on_edmdetails = True):
707 Checks EDM list entries for serialization and configuration compliance.
711 _noAuxList = [
"xAOD::" + contType
for contType
in [
"TrigConfKeys",
"BunchConfKey"]]
713 cgen = clidGenerator(
"",
False)
715 found_allow_truncation =
False
716 serializable_names = []
717 serializable_names_no_label = []
718 serializable_names_no_properties = []
720 for i, edm
in enumerate(edm_list):
724 log.error(
"EDM entry too short for " + edm[0])
728 serializable_name = edm[0]
729 serializable_name_no_label = re.sub(
r"\#.*",
"", serializable_name)
730 serializable_name_no_properties = serializable_name.split(
'.')[0]
732 serializable_names.append(serializable_name)
733 serializable_names_no_label.append(serializable_name_no_label)
734 serializable_names_no_properties.append(serializable_name_no_properties)
738 log.error(
"no CLID for " + serializable_name)
742 if "Aux" not in serializable_name
and "." in serializable_name:
743 log.error(
"A '.' found in non-Aux container name " + serializable_name)
747 if "Aux" in serializable_name
and "Aux." not in serializable_name:
748 log.error(
"no final Aux. in label for " + serializable_name)
752 if serializable_name.count(
"#") != 1:
753 log.error(
"Invalid naming structure for " + serializable_name)
757 if serializable_name.startswith(
"xAOD")
and "Aux" not in serializable_name:
758 cont_type,cont_name = serializable_name.split(
"#")
759 if cont_type
not in _noAuxList:
761 if len(edm_list) == i+1:
763 cont_to_test =
"nothing"
765 cont_to_test = edm_list[i+1][0].
split(
".")[0]+
"."
766 cont_type_short = cont_type.replace(
"Container",
"")
767 pattern = re.compile(cont_type_short+
r".*Aux.*\#"+cont_name+
"Aux.")
768 if not pattern.match(cont_to_test):
770 shallow_pattern = re.compile(
"xAOD::ShallowAuxContainer#"+cont_name+
"Aux.")
771 if not shallow_pattern.match(cont_to_test):
774 log.error(
"Expected relevant Aux container following interface container %s, but found %s instead.",serializable_name,cont_to_test)
779 if len(edm_list[i+1]) > 1
and cont_to_test.count(
"#") == 1:
780 contname_to_test = cont_to_test.split(
"#")[1]
781 targets_to_test =
set(edm_list[i+1][1].
split())
782 if len(targets ^ targets_to_test) > 0:
783 log.error(
"Targets of %s (%s) and %s (%s) do not match",cont_name,targets,contname_to_test,targets_to_test)
787 if i>0
and "Aux" in serializable_name
and "Aux" in edm_list[i-1][0]:
788 log.error(f
"Aux container {serializable_name} needs to folow the "
789 "associated interface container in the EDM list")
794 file_types = edm[1].
split()
795 for file_type
in file_types:
796 if file_type
not in AllowedOutputFormats:
797 log.error(
"unknown file type " + file_type +
" for " + serializable_name)
799 for higher_level,required_lower_level
in [(
'AOD',
'ESD'), (
'SLIM',
'AODFULL')]:
800 if higher_level
in file_type
and required_lower_level
not in file_types:
801 log.error(
"Target list for %s containing '%s' must also contain lower level target '%s'.",serializable_name,file_type,required_lower_level)
805 tags = edm[3]
if len(edm) > 3
else None
806 allow_truncation_flag =
False
808 allow_truncation_flag = allowTruncation
in tags
809 if allow_truncation_flag:
810 found_allow_truncation =
True
812 if found_allow_truncation
and not allow_truncation_flag:
813 log.error(
"All instances of 'allowTruncation' need to be at the END of the EDM serialisation list")
820 if not len(
set(serializable_names_no_properties)) == len(serializable_names_no_properties):
821 log.error(
"Duplicates in EDM list! Duplicates found:")
822 import collections.abc
823 for item, count
in collections.Counter(serializable_names_no_properties).
items():
825 log.error(
str(count) +
"x: " +
str(item))
829 for EDMDetail
in EDMDetailsRun3.keys():
830 if EDMDetail
not in serializable_names_no_label:
831 msg =
"EDMDetail for " + EDMDetail +
" does not correspond to any name in TriggerList"
832 if error_on_edmdetails: