Skip to content

Move sometimes-unused energy loss object into conditional

Stewart Martin-Haugh requested to merge smh/athena:energyloss_temporary into master

eloss was created in all cases, but only used if m_trkUtils was true. This is visible as a lot of temporary allocations in heaptrack:

6429342 temporary allocations of 6438407 allocations in total (99.86%) from
std::_MakeUniq<>::__single_object std::make_unique<>(double&, double&, double&, double&, double&, double&, double&, double&, double&)
  at /cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/include/c++/8.3.0/bits/unique_ptr.h:831
  in /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-04-29T2101/Athena/22.0.33/InstallArea/x86_64-centos7-gcc8-opt/lib/libTrkExTools.so
Trk::EnergyLossUpdator::energyLoss(Trk::MaterialProperties const&, double, double, Trk::PropDirection, Trk::ParticleHypothesis, bool, bool) const
  at /build/atnight/localbuilds/nightlies/Athena/master/athena/Tracking/TrkExtrapolation/TrkExTools/src/EnergyLossUpdator.cxx:144
1118204 temporary allocations of 1118204 allocations in total (100.00%) from:
    Trk::MaterialEffectsUpdator::updateImpl(Trk::MaterialEffectsUpdator::Cache&, Trk::ParametersBase<> const*, Trk::MaterialProperties const&, double, Trk::PropDirection, Trk::ParticleHypothesis, Trk::Mat
      at /build/atnight/localbuilds/nightlies/Athena/master/athena/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx:508
      in /cvmfs/atlas-nightlies.cern.ch/repo/sw/master_Athena_x86_64-centos7-gcc8-opt/2021-04-29T2101/Athena/22.0.33/InstallArea/x86_64-centos7-gcc8-opt/lib/libTrkExTools.so
    Trk::MaterialEffectsUpdator::preUpdateImpl(Trk::MaterialEffectsUpdator::Cache&, Trk::ParametersBase<> const*, Trk::Layer const&, Trk::PropDirection, Trk::ParticleHypothesis, Trk::MaterialUpdateMode) c
      at /build/atnight/localbuilds/nightlies/Athena/master/athena/Tracking/TrkExtrapolation/TrkExTools/src/MaterialEffectsUpdator.cxx:419

Interesting that this doesn't flag any compilation warnings. cc @rbielski @amete

Merge request reports