diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx index 87ac7c1ed8331b205d73ab0bb0011dc5dfbd3beb..3607f5e1b0c5ff11f74435934e689865e7f7321b 100644 --- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx +++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx @@ -744,7 +744,7 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, double ElossID = 0.; double ElossCalo = 0.; double ElossMS = 0.; - for(auto m : *caloTSOS) { + for(const auto *m : *caloTSOS) { if(m->materialEffectsOnTrack()) { const Trk::MaterialEffectsOnTrack* meot = dynamic_cast<const Trk::MaterialEffectsOnTrack*>(m->materialEffectsOnTrack()); if(meot) { @@ -1434,7 +1434,7 @@ Trk::TrkMaterialProviderTool::modifyTSOSvector(const std::vector<const Trk::Trac typePatternDeposit.set(Trk::TrackStateOnSurface::CaloDeposit); //typePatternDeposit.set(Trk::TrackStateOnSurface::Scatterer); - for(auto m : *matvec) { + for(const auto *m : *matvec) { if(!m->trackParameters()) { ATH_MSG_WARNING("No trackparameters on TrackStateOnSurface "); @@ -1839,7 +1839,7 @@ void Trk::TrkMaterialProviderTool::getMopAndIoniEnergyLoss(const std::vector<con double deltaE_rad_tot = 0.; double sigmaDeltaE_rad_tot =0.; - for(auto m : *matvec) { + for(const auto *m : *matvec) { if(!m->trackParameters()) { ATH_MSG_WARNING("No trackparameters on TrackStateOnSurface "); continue; diff --git a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx index 3cfad1df30fe154ad8daf28751266315cd1b1b68..7c06c26505ac4b84972b0580fab2b7befeb86666 100644 --- a/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx +++ b/Tracking/TrkTools/TrkParticleCreator/src/TrackParticleCreatorTool.cxx @@ -824,7 +824,7 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s // Attempt to fill the position enums - will necessarily be a bit of a hack, since we don't have all the information. std::vector< xAOD::ParameterPosition> positions; bool firstMeasurement = false; - for (auto parameter : trackParticle.trackParameters()){ + for (const auto *parameter : trackParticle.trackParameters()){ if (!firstMeasurement && parameter && !parameter->associatedSurface().isFree()){ // if the surface isn't free, it must belong to a detector element => measurement firstMeasurement=true; @@ -926,7 +926,7 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s setNumberOfUsedHits(*trackparticle,summary->numberOfUsedHitsdEdx()); setNumberOfOverflowHits(*trackparticle,summary->numberOfOverflowHitsdEdx()); } - auto beamspot = CacheBeamSpotData(Gaudi::Hive::currentContext()); + const auto *beamspot = CacheBeamSpotData(Gaudi::Hive::currentContext()); if (beamspot) { setTilt(*trackparticle,beamspot->beamTilt(0),beamspot->beamTilt(1)); } @@ -987,7 +987,7 @@ TrackParticleCreatorTool::TrackParticleCreatorTool(const std::string& t, const s MagField::AtlasFieldCache fieldCache; fieldCondObj->getInitializedCache (fieldCache); - for ( auto param : parameters ){ + for ( const auto *param : parameters ){ std::vector<float>& values = parametersVec[numParam]; values.resize(6); const Amg::Vector3D & pos = param->position();