Skip to content

Add support for more complicated mutlicopies in alignment

Nicholas Styles requested to merge nstyles/GeoModel:multicopyUpdates into main

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 a bool (to indicate that a volume should be a FullPhysVol and a transform an AlignableTransform) and an int (to indicate that addAlignment should be called, with a "level" indicated by the int to define at which level in the geometry hierarchy it should be considered when running alignment). A new property such as alignLevel should be added which initially duplicates the int version of alignable while the geometry versions are being moved over to the new syntax. Eventually, the handling old int property could be removed from the code (so it will be ignored if defined) and from newer versions of the .dtd file.

FYI @xilin @sroe

Merge request reports