Add support for more complicated mutlicopies in alignment
In the process of developing ITk alignment, it was observed that some multicopies caused issues when it was attempted to add the alignable
property. This turned out to be because if more than one transform is defined within a multicopy, the assumed location of various items in the vector of objects to process is incorrect.
To handle this, a more robust approach is taken by actively looking for the required objects in the vector, to use the correct one if found. While this is a bit less efficient, this code is anyway not performance critical as it will only run once per job (and is anyway still pretty fast).
Not addressed here, but to be followed up in later MRs:
- The behavior of multicopy when a
loopvar
is not used does not seem correct regarding alignment. Following up with the original author - it can be confusing that
alignable
can be both abool
(to indicate that a volume should be a FullPhysVol and a transform an AlignableTransform) and anint
(to indicate thataddAlignment
should be called, with a "level" indicated by theint
to define at which level in the geometry hierarchy it should be considered when running alignment). A new property such asalignLevel
should be added which initially duplicates theint
version ofalignable
while the geometry versions are being moved over to the new syntax. Eventually, the handling oldint
property could be removed from the code (so it will be ignored if defined) and from newer versions of the .dtd file.