Skip to content

Make DualUseConfig/ConfigAccumulator CA-compatible and create CA FullAlgorithmTest instances

Teng Jian Khoo requested to merge khoo/athena:CP-ConfigBlock-CA into main

Due to some details of how DualUseConfig generates tools and services, it was not possible to run the CP alg config functions in a ComponentAccumulator athena job natively. This MR fixes that by:

  • Using the CompFactory for all Athena component generation in DualUseConfig. This is already compatible with both legacy and CA.
  • Avoiding any AppMgr imports if we are in a ComponentAccumulator environment. The ToolSvc and SvcMgr appends are left to the ComponentAccumulator infrastructure instead.
  • To make the ConfigAccumulator ComponentAccumulator-friendly, we also have to avoid += for appending algs to sequences. So in a ComponentAccumulator environment, we now create a ComponentAccumulator object and use this for all appends. Integrating the full sequence configuration into a job then simply involves merging the ComponentAccumulator from the ConfigAccumulator into the job-level ComponentAccumulator.

To make this neater, there are now two bool variables defined in DualUseConfig to avoid having to have try/except blocks everywhere.

Three test cases are added to check the ConfigBlock execution, via a python FullConfigTest_CA.py executable. I opted not to make the makeBlahSequence setup actually run, because makeSequenceOld is littered with algSeq += sequence operations that are incompatible with the ComponentAccumulator environment.

I did make AnaAlgSequence possible to create in a ComponentAccumulator environment job, which required adding __slots__ otherwise the parent class __slots__ block adding attributes to the subclass, but given the above, this is a bit irrelevant.

Merge request reports