MuonReconstruction - Refactor the treatment of writing segments to disk
Hello everybody,
this MR cleans up the usage of the MuonSegments in the reconstruction:
- Thus far, the
Trk::Segmentsfrom the Moore chain were converted toxAOD::MuonSegment. The reconstruction algorithm downstream retrieving these segments link back to theTrk::Segmentagain which makes this conversion quite pointless, as we have to consider that this container won't be dumped to disk as the segments have to be merged later with the ones from the MuGirl chain. The algorithms relying on thexaodMuonSegmentsare switched to retrieve theTrk::Segmentcontainer (closes ATLASRECTS-6445) directly. - Until now, the final
MuonSegmentContainerwas created by theMuonCreatorAlg, which copied by default the Moore segment container and then added to it the MuGirl segments here and there. However, there is more than oneMuonCreatorAlgchain active, such that we duplicate these segments written to disk, in principle, if they were scheduled for write-out. TheMuonSegMergerAlgis introduced to take over the job. Segments from all muon authors and chains are copied to a common segment container, which will become later the MuonSegmentContainer. These are referred to as persistent segments. To avoid that we have to recreate allMuonCandidates&TagBasemaps, theMuonTagToSegMapauxiliary class is added providing a link between the transient and persistent version of associated muon segments. It should be noted that theMuonSegmentContainernow only contains segments that are somehow used in the reconstruction chain. There might be duplicates originating from theMuGirl<->MuTagIMOorMuGril<->STACOambiguities, which are not considered by the algorithm. - To not cut the possibilities of analyses exploiting segments that did not grow to a full muon candidate, all remaining segments are dumped into the
UnAssocMuonSegmentscontainer. Ambiguities between different segment candidates are optionally resolved. - For one reason or another, the segment container from the Low-beta reconstruction chain has not been written to the AOD thus far. This container is now added
A quick comparison of the q442 outputs:
165.396 kb 15.371 kb 0.031 kb 10.760 500 StauSegments (DataVector<xAOD::MuonSegment_v1>) [Muon]
317.167 kb 103.154 kb 0.206 kb 3.075 500 MuonSegments (DataVector<xAOD::MuonSegment_v1>) [Muon]
2264.361 kb 927.048 kb 1.854 kb 2.443 500 UnAssocMuonSegments (DataVector<xAOD::MuonSegment_v1>) [*Unknown*]
vs. current master
2904.281 kb 1153.210 kb 2.306 kb 2.518 500 MuonSegments (DataVector<xAOD::MuonSegment_v1>) [Muon]
Note to the L1 shifter: The last commit is the unleash of the clang-formater, a.k.a the kraken.
Edited by Johannes Junggeburth