Skip to content

Master make MultiTrajectory default constructible

This MR is a followup of !63302 (closed) and adds option for ActsTrk::MTJ to be default constructed. In such case it owns the backends (i.e. allocates & destroys them). A nice implementation suggests by @akraszna was unfortunately impossible if we want to support ConstMTJ "viewing" MutableMTJ (i.e. have shallow copy construction). Issue is that we explicitly would want the pointers to be shared in this case (exactly what uniqe_ptr is trying to avoid). And shared_ptr is also not an option if backends are sullied externally. So good old raw pointers.

In the future we may actually remove this functionality entirely if Acts clients do not need it. See: https://github.com/acts-project/acts/issues/2154 But for now this will get us going with the migration to Atlas backends in Acts tracking.

FI @pagessin @ncalace @adye @emoyse @wolter (and tag further if needed)

Reviewers, please check only the first commit. The second one is just code formatting. @wolter and I are using different editors and the formatting became strangely inconsistent.

/srv/athena/Tracking/Acts/ActsTrkEvent/test/MultiTrajectoryBasic_test.cxx: In constructor 'EventDataMultiTrajectory::EmptyMTJ::EmptyMTJ()':
/srv/athena/Tracking/Acts/ActsTrkEvent/test/MultiTrajectoryBasic_test.cxx:183:55: error: use of deleted function 'ActsTrk::MultiTrajectory<true>::MultiTrajectory(const ActsTrk::MultiTrajectory<true>&)'
  183 |     ActsTrk::ConstMultiTrajectory mtest2(*ro_mtj.get());
      |                                                       ^
In file included from /srv/athena/Tracking/Acts/ActsTrkEvent/test/MultiTrajectoryBasic_test.cxx:16:
/srv/athena/Tracking/Acts/ActsTrkEvent/ActsTrkEvent/MultiTrajectory.h:62:7: note: 'ActsTrk::MultiTrajectory<true>::MultiTrajectory(const ActsTrk::MultiTrajectory<true>&)' is implicitly deleted because the
 default definition would be ill-formed:
   62 | class MultiTrajectory final
      |       ^~~~~~~~~~~~~~~
/srv/athena/Tracking/Acts/ActsTrkEvent/ActsTrkEvent/MultiTrajectory.h:62:7: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = xAOD::TrackS
tateAuxContainer_v1; _Dp = std::default_delete<xAOD::TrackStateAuxContainer_v1>]'
In file included from /cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/include/c++/11.2.0/memory:76,
                 from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/Boost/1.78.0-e77cf/x86_64-centos7-gcc11-opt/include/boost/test/data/monomorphic/delayed.
hpp:23,
                 from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/Boost/1.78.0-e77cf/x86_64-centos7-gcc11-opt/include/boost/test/data/monomorphic.hpp:25,
                 from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/Boost/1.78.0-e77cf/x86_64-centos7-gcc11-opt/include/boost/test/data/dataset.hpp:16,
                 from /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc11-opt/sw/lcg/releases/Boost/1.78.0-e77cf/x86_64-centos7-gcc11-opt/include/boost/test/data/test_case.hpp:17,
                 from /srv/athena/Tracking/Acts/ActsTrkEvent/test/MultiTrajectoryBasic_test.cxx:6:
/cvmfs/sft.cern.ch/lcg/releases/gcc/11.2.0-8a51a/x86_64-centos7/include/c++/11.2.0/bits/unique_ptr.h:468:7: note: declared here
  468 |       unique_ptr(const unique_ptr&) = delete;
      |       ^~~~~~~~~~

Merge request reports