From f4e98ab0091c5bc009c73e4fba9feb2c2649069b Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 14 Jan 2022 14:13:27 +0100 Subject: [PATCH 1/2] IExtrapolator rm legacy / fallback Event Context unaware methods --- .../src/CaloClusterVertexFractionMaker.cxx | 44 +- .../src/DQTMuonIDTrackTool.cxx | 46 +- .../src/InDetAlignFillTrack.cxx | 8 +- .../src/DetailedIDNtupleTool.cxx | 10 +- .../src/IDPerfMonZmumu.cxx | 9 +- .../InDetV0Finder/src/InDetV0FinderTool.cxx | 7 +- .../src/TRT_SeededTrackFinder.cxx | 6 +- .../src/CompetingPixelClustersOnTrackTool.cxx | 13 +- .../src/CompetingSCT_ClustersOnTrackTool.cxx | 12 +- .../CompetingTRT_DriftCirclesOnTrackTool.cxx | 16 +- .../src/DivisiveMultiSeedFinder.cxx | 24 +- .../src/HistogrammingMultiSeedFinder.cxx | 20 +- .../src/SlidingWindowMultiSeedFinder.cxx | 20 +- .../src/InDetTrackClusterCleaningTool.cxx | 34 +- .../src/InDetTrackZ0SortingTool.cxx | 26 +- .../src/InDetJetFitterUtils.cxx | 8 +- .../src/JetFitterTrackSelectorTool.cxx | 6 +- .../src/InDetTestBLayerTool.cxx | 12 +- .../src/InDetTestPixelLayerTool.cxx | 14 +- .../src/InDetAmbiScoringTool.cxx | 4 +- .../src/InDetNNScoringTool.cxx | 4 +- .../Root/InDetTrackSelectionTool.cxx | 6 +- .../src/InDetDetailedTrackSelectorTool.cxx | 20 +- .../src/InDetIsoTrackSelectorTool.cxx | 12 +- .../src/InDetTrackSelectorTool.cxx | 7 +- .../src/SeedToTrackConversionTool.cxx | 7 +- .../src/TRT_SegmentToTrackTool.cxx | 12 +- .../src/TRT_TrackExtensionToolCosmics.cxx | 19 +- .../src/TRTTrackHoleSearchTool.cxx | 7 +- .../src/AthTruthSelectionTool.cxx | 11 +- .../src/InDetPhysValTruthDecoratorAlg.cxx | 7 +- .../MSVertexTools/src/MSVertexRecoTool.cxx | 6 +- .../src/MuonTrackSummaryHelperTool.cxx | 8 +- .../src/MuonTrackExtrapolationTool.cxx | 29 +- .../src/RpcTrackAnaAlg.cxx | 23 +- .../src/TgcRawDataMonitorAlgorithm.cxx | 10 +- .../MuonPRDTest/src/MDTPRDValAlg.cxx | 12 +- .../src/egammaTraversedMaterialFillerTool.cxx | 14 +- .../src/TrackStateOnSurfaceDecorator.cxx | 73 +- .../BTagging/src/BTagTrackAugmenterAlg.cxx | 4 +- .../src/ExtrapolateMuonToIPTool.cxx | 12 +- .../src/MuTagMatchingTool.cxx | 11 +- .../TrackToVertex/src/TrackToVertex.cxx | 14 +- .../NewVrtSecInclusiveTool/src/Utilities.cxx | 9 +- .../VrtSecInclusive/details/Utilities.h | 18 +- .../VKalVrt/VrtSecInclusive/src/Utilities.cxx | 9 +- .../src/egammaTrkRefitterTool.cxx | 4 +- .../ISF_ParSimTools/src/ISPtoPerigeeTool.cxx | 9 +- .../ISF_TrackingTools/src/TrkExtrapolator.cxx | 7 +- .../TBRec/src/TBExtrapolTrackToCaloTool.cxx | 21 +- .../src/BeamspotVertexPreProcessor.cxx | 28 +- .../TrkExAlgs/src/CETmaterial.cxx | 36 +- .../src/CombinedExtrapolatorTest.cxx | 26 +- .../src/EnergyLossExtrapolationValidation.cxx | 47 +- .../TrkExAlgs/src/ExtrapolationValidation.cxx | 67 +- .../src/ExtrapolatorComparisonTest.cxx | 28 +- .../TrkExAlgs/src/ExtrapolatorTest.cxx | 41 +- .../TrkExInterfaces/IExtrapolator.h | 654 +++++++----------- .../TrkExInterfaces/IExtrapolator.icc | 319 --------- .../src/InDetDynamicNoiseAdjustment.cxx | 4 +- .../src/TrackFitInputPreparator.cxx | 30 +- .../src/GlobalChi2Fitter.cxx | 45 +- .../src/ForwardKalmanFitter.cxx | 32 +- .../src/ForwardRefTrackKalmanFitter.cxx | 12 +- .../src/KalmanOutlierRecovery_InDet.cxx | 34 +- .../src/KalmanPiecewiseAnnealingFilter.cxx | 12 +- .../TrkKalmanFitter/src/KalmanSmoother.cxx | 7 +- .../TrkFitter/TrkRefitAlg/src/ReFitTrack.cxx | 11 +- .../TrkiPatFitter/src/MaterialAllocator.cxx | 48 +- .../src/GeantFollowerHelper.cxx | 13 +- .../src/GeantFollowerMSHelper.cxx | 48 +- .../src/TrkMaterialProviderTool.cxx | 35 +- .../TrkTruthToTrack/src/TruthToTrack.cxx | 26 +- .../src/TruthTrackRecordToTrack.cxx | 26 +- .../src/PerigeeParametersNtupleTool.cxx | 9 +- .../TrkV0Fitter/src/TrkV0VertexFitter.cxx | 31 +- .../src/VKalExtPropagator.cxx | 29 +- .../TrkVertexAnalysisUtils/src/V0Tools.cxx | 17 +- .../src/FastVertexFitter.cxx | 7 +- .../src/FullLinearizedTrackFactory.cxx | 10 +- .../src/ImpactPoint3dEstimator.cxx | 13 +- .../src/TrackToVertexIPEstimator.cxx | 19 +- .../src/DummyVertexSmoother.cxx | 14 +- .../src/TrigFastTrackFinder.cxx | 7 +- .../TrigL2MuonSA/src/FtfRoadDefiner.cxx | 8 +- .../TrigAlgorithms/TrigmuComb/src/muComb.cxx | 5 +- .../src/MuonMatchingTool.cxx | 8 +- .../src/TrackPropagationHelper.cxx | 14 +- 88 files changed, 1247 insertions(+), 1317 deletions(-) delete mode 100644 Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.icc diff --git a/Calorimeter/CaloTrackUtils/src/CaloClusterVertexFractionMaker.cxx b/Calorimeter/CaloTrackUtils/src/CaloClusterVertexFractionMaker.cxx index b3ffa163387..8b395348f41 100755 --- a/Calorimeter/CaloTrackUtils/src/CaloClusterVertexFractionMaker.cxx +++ b/Calorimeter/CaloTrackUtils/src/CaloClusterVertexFractionMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // in contrary to CaloClusterVertexFractionMakerAthAlg this is a CaloClusterCollectionProcessor and not an Athena Algorithm @@ -88,7 +88,7 @@ StatusCode CaloClusterVertexFractionMaker::initialize() } StatusCode -CaloClusterVertexFractionMaker::execute(const EventContext& /*ctx*/, +CaloClusterVertexFractionMaker::execute(const EventContext& ctx, xAOD::CaloClusterContainer* caloClusterContainer) const { const VxContainer* primcontainer(nullptr); @@ -128,20 +128,42 @@ CaloClusterVertexFractionMaker::execute(const EventContext& /*ctx*/, else lastTrackParametersInID = trackParametersVector.at(0); // the perigee // very simplified way for now to decide to extrapolate a track to barrel or endcap - if (theTrackParticle->eta() > 1.35) // track most likely in endcap A, extrapolate track to a disc at ID exist in positive z direction + if (theTrackParticle->eta() > + 1.35) // track most likely in endcap A, extrapolate track to a + // disc at ID exist in positive z direction { - trackParameters_atCaloEntrance = dynamic_cast(m_extrapolator->extrapolate(*lastTrackParametersInID, *m_discSurface_atCaloEntrance_positiveZ, Trk::alongMomentum, true, Trk::pion)); -// std::cout << "CaloClusterVertexFractionMaker " << theTrackParticle->eta() << " extrapolate to endcap A " << trackParameters_atCaloEntrance << std::endl; - } else if (theTrackParticle->eta() < -1.35) // track most likely in endcap C, extrapolate track to a disc at ID exist in negative z direction + trackParameters_atCaloEntrance = + dynamic_cast(m_extrapolator->extrapolate( + ctx, + *lastTrackParametersInID, + *m_discSurface_atCaloEntrance_positiveZ, + Trk::alongMomentum, + true, + Trk::pion)); + } else if (theTrackParticle->eta() < + -1.35) // track most likely in endcap C, extrapolate track + // to a disc at ID exist in negative z direction { - trackParameters_atCaloEntrance = dynamic_cast(m_extrapolator->extrapolate(*lastTrackParametersInID, *m_discSurface_atCaloEntrance_negativeZ, Trk::alongMomentum, true, Trk::pion)); -// std::cout << "CaloClusterVertexFractionMaker " << theTrackParticle->eta() << " extrapolate to endcap C " << trackParameters_atCaloEntrance << std::endl; + trackParameters_atCaloEntrance = + dynamic_cast(m_extrapolator->extrapolate( + ctx, + *lastTrackParametersInID, + *m_discSurface_atCaloEntrance_negativeZ, + Trk::alongMomentum, + true, + Trk::pion)); } else // track is in barrel, extrapolate to cylinder at ID exit { - trackParameters_atCaloEntrance = dynamic_cast(m_extrapolator->extrapolate(*lastTrackParametersInID, *m_cylinderSurface_atCaloEntrance, Trk::alongMomentum, true, Trk::pion)); -// std::cout << "CaloClusterVertexFractionMaker " << theTrackParticle->eta() << " extrapolate to barrel " << trackParameters_atCaloEntrance << std::endl; + trackParameters_atCaloEntrance = + dynamic_cast( + m_extrapolator->extrapolate(ctx, + *lastTrackParametersInID, + *m_cylinderSurface_atCaloEntrance, + Trk::alongMomentum, + true, + Trk::pion)); } - if (trackParameters_atCaloEntrance!=nullptr) { + if (trackParameters_atCaloEntrance != nullptr) { m_trkParticleEta_atCaloEntrance->push_back(trackParameters_atCaloEntrance->position().eta()); m_trkParticlePhi_atCaloEntrance->push_back(trackParameters_atCaloEntrance->position().phi()); ATH_MSG_DEBUG( "At calo entrance R(1150mm) " << *trackParameters_atCaloEntrance ); diff --git a/DataQuality/DataQualityTools/src/DQTMuonIDTrackTool.cxx b/DataQuality/DataQualityTools/src/DQTMuonIDTrackTool.cxx index 09e8dea268e..6d957f3f4db 100644 --- a/DataQuality/DataQualityTools/src/DQTMuonIDTrackTool.cxx +++ b/DataQuality/DataQualityTools/src/DQTMuonIDTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** @@ -337,10 +337,11 @@ StatusCode DQTMuonIDTrackTool::fillHistograms() { ATH_MSG_DEBUG("in fillHists()"); StatusCode sc; + const EventContext& ctx = Gaudi::Hive::currentContext(); ////////////////////////////////////////////////////// - SG::ReadHandle muons(m_MuonContainerKey); + SG::ReadHandle muons(m_MuonContainerKey,ctx); if(! muons.isValid()) { ATH_MSG_WARNING( "No Container with name " << "Muons" << " found in evtStore" ); return StatusCode::SUCCESS; @@ -452,13 +453,21 @@ StatusCode DQTMuonIDTrackTool::fillHistograms() const Trk::TrackParameters *measPerigee(0); if (premeasPerigee) { - ATH_MSG_WARNING("idPerigee? " << idPerigee << " " << idPerigee->associatedSurface()); - ATH_MSG_WARNING("premeasPerigee? " << premeasPerigee->associatedSurface()); - measPerigee = m_extrapolator->extrapolate(**muontracksItr,(idPerigee->associatedSurface()),Trk::anyDirection,true,Trk::pion); - ATH_MSG_WARNING("measPerigee? " << measPerigee); - if (!measPerigee) { - ATH_MSG_WARNING( "Extrapolation failed 1!!" ); - } + ATH_MSG_WARNING("idPerigee? " << idPerigee << " " + << idPerigee->associatedSurface()); + ATH_MSG_WARNING("premeasPerigee? " + << premeasPerigee->associatedSurface()); + measPerigee = + m_extrapolator->extrapolate(ctx, + **muontracksItr, + (idPerigee->associatedSurface()), + Trk::anyDirection, + true, + Trk::pion); + ATH_MSG_WARNING("measPerigee? " << measPerigee); + if (!measPerigee) { + ATH_MSG_WARNING("Extrapolation failed 1!!"); + } } if (idPerigee!=0 && measPerigee!=0) { @@ -485,14 +494,21 @@ StatusCode DQTMuonIDTrackTool::fillHistograms() const Trk::Perigee *idPerigee2 = &((*idtracksItr2)->perigeeParameters()); const Trk::Perigee *measPerigee2 = &((*muontracksItr2)->perigeeParameters()); - + if (measPerigee2) { - measPerigee2 = dynamic_cast(m_extrapolator->extrapolate(*measPerigee2,(idPerigee2->associatedSurface()),Trk::anyDirection,false,Trk::muon)); - if (!measPerigee2) { - ATH_MSG_WARNING( "Extrapolation failed 2!!" ); - } + measPerigee2 = dynamic_cast( + m_extrapolator->extrapolate( + ctx, + *measPerigee2, + (idPerigee2->associatedSurface()), + Trk::anyDirection, + false, + Trk::muon)); + if (!measPerigee2) { + ATH_MSG_WARNING("Extrapolation failed 2!!"); + } } - + if (idPerigee2!=0 && measPerigee2!=0) { // We should pay attention only to opposite sign tracks for forming masses diff --git a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx index 061bd93585c..851a1414ff7 100644 --- a/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx +++ b/InnerDetector/InDetAlignTools/InDetAlignGenTools/src/InDetAlignFillTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////////////// @@ -198,7 +198,8 @@ StatusCode InDetAlignFillTrack::FillTrack() { ATH_MSG_DEBUG("In FillTrack()"); ATH_MSG_DEBUG(" event " << m_events); StatusCode sc; - + + const EventContext& ctx = Gaudi::Hive::currentContext(); const TrackCollection* tracks;// = new TrackCollection; const TrackCollection* Uptracks;// = new TrackCollection; const TrackCollection* Lowtracks;// = new TrackCollection; @@ -448,7 +449,8 @@ StatusCode InDetAlignFillTrack::FillTrack() { ATH_MSG_DEBUG("Distance between perigee and generated vertex exceeds tolerance (" << 1.e-4 << " mm)... Extrapolating!"); - generatedTrackPerigee = m_extrapolator->extrapolateDirectly(*productionVertexTrackParams, + generatedTrackPerigee = m_extrapolator->extrapolateDirectly(ctx, + *productionVertexTrackParams, perigeeSurface, Trk::anyDirection, false, diff --git a/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx b/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx index 3583cf8e947..b9c500b078f 100644 --- a/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx +++ b/InnerDetector/InDetAlignment/InDetAlignNtupleTools/src/DetailedIDNtupleTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkEventPrimitives/FitQuality.h" @@ -107,7 +107,7 @@ namespace InDet { void DetailedIDNtupleTool::dumpTrack(int itrk, const Trk::AlignTrack* alignTrack) { ATH_MSG_DEBUG("In dumpTrack()"); Trk::AlignTrack::AlignTrackType type = alignTrack->type(); - + const EventContext& ctx = Gaudi::Hive::currentContext(); // if hope to dump all the tracks, should set: // m_storeNormalRefittedOnly = false, m_storeConstrainedOnly=false if ((m_storeNormalRefittedOnly && (type != Trk::AlignTrack::NormalRefitted)) || @@ -162,7 +162,7 @@ namespace InDet { m_original_theta = invalidParameterValue; m_original_qoverp = invalidParameterValue; m_original_pt =invalidParameterValue; - m_original_eta = -999.; + m_original_eta = -999.; m_original_chi2 = invalidChiSq; m_original_chi2prob = invalidChiSq; m_original_ndof = invalidDegreesOfFreedom; @@ -298,7 +298,7 @@ namespace InDet { const Trk::PerigeeSurface persf(refPoint); const Trk::Perigee* originalPerigeeAtRef = - dynamic_cast(m_extrapolator->extrapolate(*originalTrack, persf)); + dynamic_cast(m_extrapolator->extrapolate(ctx, *originalTrack, persf)); if (!originalPerigeeAtRef) { const Trk::Perigee* originalTrackPerigee = originalTrack->perigeeParameters(); if (originalTrackPerigee && ((originalTrackPerigee->associatedSurface())) == persf) { @@ -317,7 +317,7 @@ namespace InDet { } const Trk::Perigee* PerigeeAtRef = - dynamic_cast(m_extrapolator->extrapolate(*alignTrack, persf)); + dynamic_cast(m_extrapolator->extrapolate(ctx, *alignTrack, persf)); if (!PerigeeAtRef) { const Trk::Perigee* alignTrackPerigee = alignTrack->perigeeParameters(); if (alignTrackPerigee && ((alignTrackPerigee->associatedSurface())) == persf) { diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx index e81a00a2d75..aedda941553 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZmumu.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ //================================================================================== @@ -1665,7 +1665,6 @@ StatusCode IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, const xAOD ATH_MSG_DEBUG("* FillRecParameters * Empty Track: trackp_for_unbias. Skipping."); return StatusCode::FAILURE; } - const Trk::Perigee* trkPerigee = track->perigeeParameters(); const Trk::Perigee* trk_for_unbiasPerigee = &(trackp_for_unbias->perigeeParameters()); @@ -1803,6 +1802,9 @@ StatusCode IDPerfMonZmumu::FillRecParameters(const Trk::Track* track, const xAOD //================================================================================== StatusCode IDPerfMonZmumu::FillTruthParameters(const xAOD::TrackParticle* trackParticle) { + + + const EventContext& ctx = Gaudi::Hive::currentContext(); if (!trackParticle ){//|| !trackParticle->vertex()){ ATH_MSG_WARNING("-- FillTruthParameters -- Empty Trackparticle. Skipping."); return StatusCode::FAILURE; @@ -1873,7 +1875,8 @@ StatusCode IDPerfMonZmumu::FillTruthParameters(const xAOD::TrackParticle* trackP SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; Trk::PerigeeSurface persf( beamSpotHandle->beamPos() ); - const Trk::TrackParameters* tP = m_extrapolator->extrapolate(cParameters,persf, Trk::anyDirection, false); + const Trk::TrackParameters* tP = m_extrapolator->extrapolate(ctx, + cParameters,persf, Trk::anyDirection, false); double px = 0; diff --git a/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx b/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx index b5f4c04cffc..eef07ac4add 100755 --- a/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx +++ b/InnerDetector/InDetRecAlgs/InDetV0Finder/src/InDetV0FinderTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -713,6 +713,7 @@ bool InDetV0FinderTool::doFit(const xAOD::TrackParticle* track1, const xAOD::Tra { bool pass = false; double srxy = startingPoint.perp(); + const EventContext& ctx = Gaudi::Hive::currentContext(); if (srxy <= m_maxsxy) { double massKshort_i=2000001., massLambda_i=2000001., massLambdabar_i=2000001.; @@ -721,11 +722,11 @@ bool InDetV0FinderTool::doFit(const xAOD::TrackParticle* track1, const xAOD::Tra std::vector > cleanup; const Trk::TrackParameters* extrapolatedPerigee1(nullptr); const Trk::TrackParameters* extrapolatedPerigee2(nullptr); - extrapolatedPerigee1 = m_extrapolator->extrapolate(track1->perigeeParameters(), perigeeSurface); + extrapolatedPerigee1 = m_extrapolator->extrapolate(ctx,track1->perigeeParameters(), perigeeSurface); if (extrapolatedPerigee1 == nullptr) extrapolatedPerigee1 = &track1->perigeeParameters(); else cleanup.push_back(std::unique_ptr(extrapolatedPerigee1)); - extrapolatedPerigee2 = m_extrapolator->extrapolate(track2->perigeeParameters(), perigeeSurface); + extrapolatedPerigee2 = m_extrapolator->extrapolate(ctx,track2->perigeeParameters(), perigeeSurface); if (extrapolatedPerigee2 == nullptr) extrapolatedPerigee2 = &track2->perigeeParameters(); else cleanup.push_back(std::unique_ptr(extrapolatedPerigee2)); diff --git a/InnerDetector/InDetRecAlgs/TRT_SeededTrackFinder/src/TRT_SeededTrackFinder.cxx b/InnerDetector/InDetRecAlgs/TRT_SeededTrackFinder/src/TRT_SeededTrackFinder.cxx index 28dd90cdc52..49f5ec1c327 100644 --- a/InnerDetector/InDetRecAlgs/TRT_SeededTrackFinder/src/TRT_SeededTrackFinder.cxx +++ b/InnerDetector/InDetRecAlgs/TRT_SeededTrackFinder/src/TRT_SeededTrackFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -308,7 +308,9 @@ InDet::TRT_SeededTrackFinder::execute_r (const EventContext& ctx) const{ Trk::PerigeeSurface perigeeSurface(beamSpotPosition); // uses perigee on track or extrapolates, no material in any case, we cut on impacts - const Trk::TrackParameters* parm = m_extrapolator->extrapolateDirectly(*input, perigeeSurface); + const Trk::TrackParameters* parm = m_extrapolator->extrapolateDirectly(ctx, + *input, + perigeeSurface); const Trk::Perigee* extrapolatedPerigee = dynamic_cast (parm ); if (!extrapolatedPerigee) { ATH_MSG_WARNING("Extrapolation of perigee failed, this should never happen" ); diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx index ad474e4ac8d..9eb0b8ecaf1 100755 --- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingPixelClustersOnTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -111,7 +111,8 @@ const InDet::CompetingPixelClustersOnTrack* InDet::CompetingPixelClustersOnTrack const std::list< const Trk::PrepRawData* >& RIO_List, const Trk::TrackParameters& trkPar, const Trk::IWeightCalculator::AnnealingFactor beta ) const { - + + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_DEBUG("********* in createCompetingROT() ********** "); // vector of ROTs std::vector< const InDet::PixelClusterOnTrack* >* ROTvector = new std::vector; @@ -168,7 +169,8 @@ const InDet::CompetingPixelClustersOnTrack* InDet::CompetingPixelClustersOnTrack // first create trkParameter on the Surface of the RIO // extrapolate to RIO surface ATH_MSG_VERBOSE("Try to propagate TrackParameters to RIO surface"); - newTrackParameters = m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), *detElementSurface, + newTrackParameters = m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), *detElementSurface, Trk::anyDirection, // propagate in any direction false, //do noBoundaryCheck! Trk::nonInteracting); // without material interaction @@ -277,7 +279,7 @@ void InDet::CompetingPixelClustersOnTrackTool::updateCompetingROT( ) const { // TODO: if recreateROTs==true call standard createCompROT method - + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_DEBUG("********* in updateCompetingROT() **********"); // cast baseCompROT to CompPixelClusterOnTrack: @@ -320,7 +322,8 @@ void InDet::CompetingPixelClustersOnTrackTool::updateCompetingROT( // clone TrkParameters without error to force the extrapolator to do propagation without error matrix const Trk::TrackParameters* trkParWithoutError = trkPar.clone(); ATH_MSG_VERBOSE("Try to propagate TrackParameters to compROT surface"); - newTrackParameters = m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), compROT->associatedSurface(), + newTrackParameters = m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), compROT->associatedSurface(), Trk::anyDirection, // propagate in any direction false, //do noBoundaryCheck! Trk::nonInteracting); // without material interaction diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx index beb213bc524..c98da54ded1 100755 --- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingSCT_ClustersOnTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -110,6 +110,7 @@ const InDet::CompetingSCT_ClustersOnTrack* InDet::CompetingSCT_ClustersOnTrackTo const Trk::TrackParameters& trkPar, const Trk::IWeightCalculator::AnnealingFactor beta ) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_DEBUG("********* in createCompetingROT() ********** "); // vector of ROTs std::vector< const InDet::SCT_ClusterOnTrack* > ROTvector; @@ -165,7 +166,8 @@ const InDet::CompetingSCT_ClustersOnTrack* InDet::CompetingSCT_ClustersOnTrackTo std::unique_ptr trkParWithoutError{trkPar.clone()}; // extrapolate to RIO surface ATH_MSG_VERBOSE("Try to propagate TrackParameters to compROT surface"); - newTrackParameters.reset(m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), + newTrackParameters.reset(m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), *detElementSurface, Trk::anyDirection, // propagate in any direction false, //do noBoundaryCheck! @@ -265,7 +267,8 @@ void InDet::CompetingSCT_ClustersOnTrackTool::updateCompetingROT( const Trk::IWeightCalculator::AnnealingFactor beta //const bool recreateROTs=false ) const { - + + const EventContext& ctx = Gaudi::Hive::currentContext(); // TODO: if recreateROTs==true call standard createCompROT method ATH_MSG_DEBUG("********* in updateCompetingROT() **********"); @@ -309,7 +312,8 @@ void InDet::CompetingSCT_ClustersOnTrackTool::updateCompetingROT( // clone TrkParameters without error to force the extrapolator to do propagation without error matrix std::unique_ptr trkParWithoutError{trkPar.clone()}; ATH_MSG_VERBOSE("Try to propagate TrackParameters to compROT surface"); - newTrackParameters.reset(m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), + newTrackParameters.reset(m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), compROT->associatedSurface(), Trk::anyDirection, // propagate in any direction false, //do noBoundaryCheck! diff --git a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx index cef6454ee6d..a2492f31532 100755 --- a/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/InDetCompetingRIOsOnTrackTool/src/CompetingTRT_DriftCirclesOnTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -98,6 +98,7 @@ const InDet::CompetingTRT_DriftCirclesOnTrack* InDet::CompetingTRT_DriftCirclesO const Trk::TrackParameters& trkPar, const Trk::IWeightCalculator::AnnealingFactor beta ) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_DEBUG("********* in createCompetingROT() ********** "); // get trkPar error in localZ for locZ cut double trkParErrorLocZ = 2.; @@ -181,10 +182,11 @@ const InDet::CompetingTRT_DriftCirclesOnTrack* InDet::CompetingTRT_DriftCirclesO // first create trkParameter on the Surface of the RIO // extrapolate to RIO surface ATH_MSG_VERBOSE("Try to propagate TrackParameters to RIO surface"); - newTrackParameters = m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), *RIOsurfacePointer, - Trk::anyDirection, // propagate in any direction - false, //do noBoundaryCheck! - Trk::noHypothesis); // without material interaction + newTrackParameters = m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), *RIOsurfacePointer, + Trk::anyDirection, // propagate in any direction + false, //do noBoundaryCheck! + Trk::noHypothesis); // without material interaction if (!newTrackParameters){ ATH_MSG_ERROR("TrackParameters could not be propagated to PrepRawData surface"); delete ROTvector; @@ -469,6 +471,7 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT( //const bool recreateROTs=false ) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); // TODO: if recreateROTs==true call standard createCompROT method ATH_MSG_DEBUG("********* in updateCompetingROT() **********"); @@ -540,7 +543,8 @@ void InDet::CompetingTRT_DriftCirclesOnTrackTool::updateCompetingROT( ATH_MSG_VERBOSE("Try to propagate TrackParameters to ROT surface"); ATH_MSG_VERBOSE("Try to propagate TrackParameters to RIO surface"); delete newTrackParameters; - newTrackParameters = m_extrapolator->extrapolateDirectly((trkParWithoutError ? *trkParWithoutError : trkPar), *ROTsurfacePointer, + newTrackParameters = m_extrapolator->extrapolateDirectly(ctx, + (trkParWithoutError ? *trkParWithoutError : trkPar), *ROTsurfacePointer, Trk::anyDirection, // propagate in any direction //Trk::alongMomentum, // propagate in any direction false, //do noBoundaryCheck! diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx index c5af16f66fd..0ff637176a3 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/DivisiveMultiSeedFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetMultipleVertexSeedFinder/DivisiveMultiSeedFinder.h" @@ -93,12 +93,13 @@ namespace InDet std::vector< std::vector > DivisiveMultiSeedFinder::seeds(const std::vector& tracks )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); //step 1: preselection std::vector preselectedTracks(0); std::vector::const_iterator tr = tracks.begin(); std::vector::const_iterator tre = tracks.end(); - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx}; Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<position()); - const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(*preselectedTracks[indexOfSorted[0]], + const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(ctx, *preselectedTracks[indexOfSorted[0]], perigeeSurface,Trk::anyDirection,true, Trk::pion); double lastTrackZ0 = -999.; @@ -144,7 +145,7 @@ namespace InDet //looping over container for(unsigned int i=0;iextrapolate(*preselectedTracks[indexOfSorted[i]], + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx,*preselectedTracks[indexOfSorted[i]], perigeeSurface,Trk::anyDirection,true, Trk::pion); double currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; @@ -246,7 +247,7 @@ namespace InDet std::vector< std::vector > DivisiveMultiSeedFinder::seeds(const std::vector& tracks )const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); // std::cout<<"Number of tracks received: "<::const_iterator tre = tracks.end(); //selecting with respect to the beam spot - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx }; Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()< tmp_cluster(0); Trk::PerigeeSurface perigeeSurface(beamposition->position()); - const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(preselectedTracks[indexOfSorted[0]]->definingParameters(), + const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(ctx,preselectedTracks[indexOfSorted[0]]->definingParameters(), perigeeSurface,Trk::anyDirection,true, Trk::pion); double lastTrackZ0 = -999.; @@ -312,7 +313,7 @@ namespace InDet //looping over container for(unsigned int i=0;iextrapolate(preselectedTracks[indexOfSorted[i]]->definingParameters(), + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, preselectedTracks[indexOfSorted[i]]->definingParameters(), perigeeSurface,Trk::anyDirection,true, Trk::pion); double currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; @@ -424,6 +425,7 @@ namespace InDet std::vector< std::vector > DivisiveMultiSeedFinder::seeds(const std::vector& tracks )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); // std::cout<<"Number of tracks received: "< beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey,ctx }; beamposition->setPosition(beamSpotHandle->beamVtx().position()); beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); @@ -484,7 +486,7 @@ namespace InDet std::vector tmp_cluster(0); Trk::PerigeeSurface perigeeSurface(beamposition->position()); - const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(*preselectedTracks[indexOfSorted[0]], + const Trk::TrackParameters * exPerigee = m_extrapolator->extrapolate(ctx,*preselectedTracks[indexOfSorted[0]], perigeeSurface,Trk::anyDirection,true, Trk::pion); double lastTrackZ0 = -999.; @@ -502,7 +504,7 @@ namespace InDet //looping over container for(unsigned int i=0;iextrapolate(*preselectedTracks[indexOfSorted[i]], + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx,*preselectedTracks[indexOfSorted[i]], perigeeSurface,Trk::anyDirection,true, Trk::pion); diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx index 3f17911b0f0..c2200655921 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/HistogrammingMultiSeedFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetMultipleVertexSeedFinder/HistogrammingMultiSeedFinder.h" @@ -82,14 +82,14 @@ namespace InDet std::vector< std::vector > HistogrammingMultiSeedFinder::seeds(const std::vector& tracks )const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); //step 1: preselection std::vector preselectedTracks(0); std::vector::const_iterator tr = tracks.begin(); std::vector::const_iterator tre = tracks.end(); //beamposition - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx }; Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<extrapolate(**p_tr,perigeeSurface,Trk::anyDirection,true, Trk::pion); + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, **p_tr,perigeeSurface,Trk::anyDirection,true, Trk::pion); double currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; @@ -244,14 +244,14 @@ namespace InDet std::vector< std::vector > HistogrammingMultiSeedFinder::seeds(const std::vector& tracks )const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); //step 1: preselection std::vector preselectedTracks(0); std::vector::const_iterator tr = tracks.begin(); std::vector::const_iterator tre = tracks.end(); //beamposition - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey,ctx }; Trk::RecVertex beamrecposition(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr, &beamrecposition)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamrecposition.position()<extrapolate((*p_tr)->definingParameters(), + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, (*p_tr)->definingParameters(), perigeeSurface,Trk::anyDirection,true, Trk::pion); double currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; @@ -408,7 +408,7 @@ namespace InDet std::vector< std::vector > HistogrammingMultiSeedFinder::seeds(const std::vector& tracks )const { // std::cout<<"Number of tracks received: "< preselectedTracks(0); @@ -416,7 +416,7 @@ namespace InDet xAOD::Vertex * beamposition = new xAOD::Vertex(); - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey,ctx }; beamposition->setPosition(beamSpotHandle->beamVtx().position()); beamposition->setCovariancePosition(beamSpotHandle->beamVtx().covariancePosition()); @@ -474,7 +474,7 @@ namespace InDet for(;p_tr != p_tre; ++p_tr) { - const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(**p_tr, + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, **p_tr, perigeeSurface,Trk::anyDirection,true, Trk::pion); double currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx index f5b87237ccd..50e476bfe28 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinder/src/SlidingWindowMultiSeedFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetMultipleVertexSeedFinder/SlidingWindowMultiSeedFinder.h" @@ -87,11 +87,12 @@ namespace InDet std::vector< std::vector > SlidingWindowMultiSeedFinder::seeds(const std::vector& tracks )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector preselectedTracks(0); std::vector::const_iterator tr = tracks.begin(); std::vector::const_iterator tre = tracks.end(); - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx }; Trk::RecVertex beamRecVertex(beamSpotHandle->beamVtx()); for(;tr!=tre;++tr) if(m_trkFilter->decision(**tr,&beamRecVertex)) preselectedTracks.push_back(*tr); if(msgLvl(MSG::DEBUG))msg(MSG::DEBUG)<<"Beam spot position is: "<< beamRecVertex.position()<extrapolate(*preselectedTracks[indexOfSorted[0]],perigeeSurface,Trk::anyDirection,true, Trk::pion); + m_extrapolator->extrapolate(ctx, *preselectedTracks[indexOfSorted[0]],perigeeSurface,Trk::anyDirection,true, Trk::pion); float lastTrackZ0 = -999.; if(exPerigee) { lastTrackZ0 = exPerigee->parameters()[Trk::z0]; delete exPerigee; } @@ -143,7 +144,7 @@ namespace InDet if(m_useMaxInCluster) addingDistance = 0.; for(unsigned int i=0;iextrapolate(*preselectedTracks[indexOfSorted[i]], + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, *preselectedTracks[indexOfSorted[i]], perigeeSurface,Trk::anyDirection,true, Trk::pion); float currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; @@ -189,6 +190,7 @@ namespace InDet std::vector< std::vector > SlidingWindowMultiSeedFinder::seeds(const std::vector& tracks )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector preselectedTracks(0); std::vector::const_iterator tr = tracks.begin(); std::vector::const_iterator tre = tracks.end(); @@ -234,7 +236,7 @@ namespace InDet const Trk::TrackParameters * exPerigee(nullptr); Trk::PerigeeSurface perigeeSurface(beamVertex->position()); - exPerigee = m_extrapolator->extrapolate(preselectedTracks[indexOfSorted[0]]->definingParameters(), + exPerigee = m_extrapolator->extrapolate(ctx,preselectedTracks[indexOfSorted[0]]->definingParameters(), perigeeSurface,Trk::anyDirection,true, Trk::pion); float lastTrackZ0 = -999.; @@ -258,7 +260,7 @@ namespace InDet for(unsigned int i=0;iextrapolate(preselectedTracks[indexOfSorted[i]]->definingParameters(), + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx,preselectedTracks[indexOfSorted[i]]->definingParameters(), perigeeSurface,Trk::anyDirection,true, Trk::pion); float currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; @@ -307,7 +309,7 @@ namespace InDet std::vector< std::vector > SlidingWindowMultiSeedFinder::seeds(const std::vector& tracks )const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); //step 1: preselection std::vector preselectedTracks(0); @@ -365,7 +367,7 @@ std::vector< std::vector > SlidingWindowMultiSeedF const Trk::TrackParameters * exPerigee(nullptr); Trk::PerigeeSurface perigeeSurface(beamposition->position()); - exPerigee = m_extrapolator->extrapolate(*preselectedTracks[indexOfSorted[0]], + exPerigee = m_extrapolator->extrapolate(ctx, *preselectedTracks[indexOfSorted[0]], perigeeSurface,Trk::anyDirection,true, Trk::pion); float lastTrackZ0 = -999.; @@ -390,7 +392,7 @@ std::vector< std::vector > SlidingWindowMultiSeedF for(unsigned int i=0;iextrapolate(*preselectedTracks[indexOfSorted[i]], + const Trk::TrackParameters * lexPerigee = m_extrapolator->extrapolate(ctx, *preselectedTracks[indexOfSorted[i]], perigeeSurface,Trk::anyDirection,true, Trk::pion); float currentTrackZ0 = lexPerigee->parameters()[Trk::z0]; delete lexPerigee; diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackClusterCleaningTool.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackClusterCleaningTool.cxx index 149ee10458b..d99857de06e 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackClusterCleaningTool.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackClusterCleaningTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetMultipleVertexSeedFinderUtils/InDetTrackClusterCleaningTool.h" @@ -43,6 +43,7 @@ namespace InDet clusterAndOutliers(const std::vector& cluster, const Trk::Vertex * reference )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector clusterSeed(0); std::vector outliers(0); double z_center = 0; @@ -57,9 +58,10 @@ namespace InDet { const Trk::TrackParameters * perigee(nullptr); if(!reference) perigee = (*i)->perigeeParameters(); - else perigee = m_extrapolator->extrapolate(**i,perigeeSurface, - Trk::anyDirection,true, - Trk::pion); + else perigee = m_extrapolator->extrapolate(ctx, + **i,perigeeSurface, + Trk::anyDirection,true, + Trk::pion); if(perigee) { @@ -83,12 +85,11 @@ namespace InDet if(!reference) measPerigee=(*i)->perigeeParameters(); else{ - //here we want to make an extrapolation - measPerigee = m_extrapolator->extrapolate(**i, - perigeeSurface,Trk::anyDirection, - true, Trk::pion); + //here we want to make an extrapolation + measPerigee = m_extrapolator->extrapolate( + ctx, **i, perigeeSurface, Trk::anyDirection, true, Trk::pion); } - + if(measPerigee) { double z0 = measPerigee->parameters()[Trk::z0]; @@ -116,6 +117,7 @@ namespace InDet InDetTrackClusterCleaningTool::clusterAndOutliers(const std::vector& cluster, const Trk::Vertex * reference)const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector clusterSeed(0); std::vector outliers(0); @@ -135,7 +137,8 @@ namespace InDet { const Trk::TrackParameters * perigee(nullptr); if(!reference) perigee = &((*i)->definingParameters()); - else perigee = m_extrapolator->extrapolate((*i)->definingParameters(),perigeeSurface,Trk::anyDirection,true, Trk::pion); + else perigee = m_extrapolator->extrapolate(ctx, + (*i)->definingParameters(),perigeeSurface,Trk::anyDirection,true, Trk::pion); if(perigee) { @@ -158,7 +161,8 @@ namespace InDet { const Trk::TrackParameters * measPerigee(nullptr); if(!reference) measPerigee = &((*i)->definingParameters()); - else measPerigee = m_extrapolator->extrapolate((*i)->definingParameters(),perigeeSurface,Trk::anyDirection,true, Trk::pion); + else measPerigee = m_extrapolator->extrapolate(ctx, + (*i)->definingParameters(),perigeeSurface,Trk::anyDirection,true, Trk::pion); if(nullptr!=measPerigee) { @@ -189,7 +193,7 @@ namespace InDet std::pair, std::vector > InDetTrackClusterCleaningTool::clusterAndOutliers(std::vector cluster, const xAOD::Vertex * reference) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector clusterSeed(0); std::vector outliers(0); @@ -209,7 +213,8 @@ namespace InDet { const Trk::TrackParameters * perigee(nullptr); - perigee = m_extrapolator->extrapolate(**i,perigeeSurface,Trk::anyDirection,true, Trk::pion); + perigee = m_extrapolator->extrapolate(ctx, + **i,perigeeSurface,Trk::anyDirection,true, Trk::pion); if(perigee) { @@ -231,7 +236,8 @@ namespace InDet for(std::vector::const_iterator i = inb; i != ine; ++i) { const Trk::TrackParameters * measPerigee(nullptr); - measPerigee = m_extrapolator->extrapolate(**i,perigeeSurface,Trk::anyDirection,true, Trk::pion); + measPerigee = m_extrapolator->extrapolate(ctx, + **i,perigeeSurface,Trk::anyDirection,true, Trk::pion); if(nullptr!=measPerigee) { diff --git a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackZ0SortingTool.cxx b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackZ0SortingTool.cxx index b47776c08fa..069326ef8d9 100644 --- a/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackZ0SortingTool.cxx +++ b/InnerDetector/InDetRecTools/InDetMultipleVertexSeedFinderUtils/src/InDetTrackZ0SortingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetMultipleVertexSeedFinderUtils/InDetTrackZ0SortingTool.h" @@ -45,6 +45,7 @@ namespace InDet std::vector InDetTrackZ0SortingTool::sortedIndex(const std::vector& tracks, const Trk::Vertex * reference )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::map mapOfZ0; std::vector::const_iterator tb = tracks.begin(); std::vector::const_iterator te = tracks.end(); @@ -58,7 +59,9 @@ namespace InDet //here we want to make an extrapolation Trk::PerigeeSurface perigeeSurface(reference->position()); - perigee = m_extrapolator->extrapolate(**tb,perigeeSurface, + perigee = m_extrapolator->extrapolate( + ctx, + **tb,perigeeSurface, Trk::anyDirection,true, Trk::pion); }//end of extrapolation block @@ -89,6 +92,7 @@ namespace InDet std::vector InDetTrackZ0SortingTool::sortedIndex(const std::vector& tracks, const Trk::Vertex * reference )const { + const EventContext& ctx = Gaudi::Hive::currentContext(); // std::vector no_perigee(0); std::map mapOfZ0; @@ -105,9 +109,11 @@ namespace InDet { //here we want to make an extrapolation Trk::PerigeeSurface perigeeSurface(reference->position()); - perigee = m_extrapolator->extrapolate((*tb)->definingParameters(), - perigeeSurface, - Trk::anyDirection,true, Trk::pion); + perigee = m_extrapolator->extrapolate( + ctx, + (*tb)->definingParameters(), + perigeeSurface, + Trk::anyDirection,true, Trk::pion); }//end of extrapolation block if(perigee) @@ -143,7 +149,7 @@ namespace InDet std::vector InDetTrackZ0SortingTool::sortedIndex(const std::vector& tracks,const xAOD::Vertex * reference) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); // std::vector no_perigee(0); std::map mapOfZ0; std::vector::const_iterator tb = tracks.begin(); @@ -157,9 +163,11 @@ namespace InDet //here we want to make an extrapolation Trk::PerigeeSurface perigeeSurface(reference->position()); - perigee = m_extrapolator->extrapolate(**tb, - perigeeSurface, - Trk::anyDirection,true, Trk::pion); + perigee = m_extrapolator->extrapolate( + ctx, + **tb, + perigeeSurface, + Trk::anyDirection,true, Trk::pion); if(perigee) { diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx index 0f0ae57470c..104fe04d2eb 100644 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/InDetJetFitterUtils.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -470,7 +470,7 @@ namespace InDet std::pair InDetJetFitterUtils::getD0andZ0IP(const Trk::TrackParameters & trackPerigee, const Trk::Vertex & vertexToExtrapolateTo) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); if (!m_linearizedTrackFactoryIsAvailable) { msg(MSG::ERROR) << "Cannot perform requested extrapolation. No extrapolator defined...Returning 0 compatibility..." << endmsg; @@ -479,7 +479,9 @@ namespace InDet Trk::PerigeeSurface mySurface(vertexToExtrapolateTo.position()); - const Trk::TrackParameters* newMeasPerigee= m_extrapolator->extrapolateDirectly(trackPerigee,mySurface); + const Trk::TrackParameters* newMeasPerigee= m_extrapolator->extrapolateDirectly(ctx, + trackPerigee, + mySurface); if (newMeasPerigee==nullptr) { msg(MSG::WARNING) << " Extrapolation failed. Wrong d0 and z0 returned " << endmsg; diff --git a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx index 4dc7a0436ed..b42c984c169 100644 --- a/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx +++ b/InnerDetector/InDetRecTools/InDetSecVxFinderTool/src/JetFitterTrackSelectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetSecVxFinderTool/JetFitterTrackSelectorTool.h" #include @@ -115,7 +115,9 @@ using namespace InDet; // Recomputing Perigee w.r.t PV Trk::PerigeeSurface mySurface( primaryVertex.position() ); - std::unique_ptr myMeasuredPerigee(m_extrapolator->extrapolate( track,mySurface )); + std::unique_ptr myMeasuredPerigee(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(),track,mySurface )); + if ( !myMeasuredPerigee) { ATH_MSG_DEBUG( " Extrapolation to primary vertex failed. Skipping track " ); compatibilityDecorator ( track ) = 0.; diff --git a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx index 8cf7ec0b888..681073470c6 100644 --- a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetTestBLayer/InDetTestBLayerTool.h" @@ -321,10 +321,12 @@ InDet::InDetTestBLayerTool::getTrackStateOnPixelLayerInfo( startParameters = track->perigeeParameters()->clone(); } else if (track->trackParameters()->front()) { startParameters = - m_extrapolator->extrapolate(*(track->trackParameters()->front()), - Trk::PerigeeSurface(), - Trk::anyDirection, - false); + m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *(track->trackParameters()->front()), + Trk::PerigeeSurface(), + Trk::anyDirection, + false); } if (!startParameters) { diff --git a/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx b/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx index a0eccff8c0a..058303428d4 100644 --- a/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "AthenaBaseComps/AthAlgTool.h" @@ -468,10 +468,12 @@ InDet::InDetTestPixelLayerTool::getTrackStateOnPixelLayerInfo( startParameters = track->perigeeParameters()->clone(); } else if (track->trackParameters()->front()) { startParameters = - m_extrapolator->extrapolate(*(track->trackParameters()->front()), - Trk::PerigeeSurface(), - Trk::anyDirection, - false); + m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *(track->trackParameters()->front()), + Trk::PerigeeSurface(), + Trk::anyDirection, + false); } if (!startParameters) { @@ -631,7 +633,7 @@ InDet::InDetTestPixelLayerTool::getPixelLayerParameters( // extrapolate stepwise to this parameter (be careful, sorting might be wrong) std::vector> paramList = - m_extrapolator->extrapolateStepwise( + m_extrapolator->extrapolateStepwise(Gaudi::Hive::currentContext(), *trackpar, BiggerThanPixelLayerSurface, Trk::alongMomentum, false); if (paramList.empty()) { diff --git a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx index 94fdf6cdefc..a5370475c0a 100755 --- a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetAmbiScoringTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////// @@ -327,7 +327,7 @@ Trk::TrackScore InDet::InDetAmbiScoringTool::simpleScore( const Trk::Track& trac // uses perigee on track or extrapolates, no material in any case, we cut on impacts // add back extrapolation without errors - std::unique_ptr parm( m_extrapolator->extrapolateDirectly(*input, perigeeSurface) ); + std::unique_ptr parm( m_extrapolator->extrapolateDirectly(ctx,*input, perigeeSurface) ); const Trk::Perigee*extrapolatedPerigee = dynamic_cast (parm.get()); if (!extrapolatedPerigee) { diff --git a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetNNScoringTool.cxx b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetNNScoringTool.cxx index b29eb1c678f..6d6e38e7747 100755 --- a/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetNNScoringTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackScoringTools/src/InDetNNScoringTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////// @@ -325,7 +325,7 @@ Trk::TrackScore InDet::InDetNNScoringTool::simpleScore( const Trk::Track& track, // uses perigee on track or extrapolates, no material in any case, we cut on impacts // add back extrapolation without errors { - std::unique_ptr parm( m_extrapolator->extrapolateDirectly(*input, perigeeSurface) ); + std::unique_ptr parm( m_extrapolator->extrapolateDirectly(ctx, *input, perigeeSurface) ); const Trk::Perigee*extrapolatedPerigee = dynamic_cast (parm.get()); if (!extrapolatedPerigee) { diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetTrackSelectionTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetTrackSelectionTool.cxx index 00d39cce064..cce575013a3 100644 --- a/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetTrackSelectionTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSelectionTool/Root/InDetTrackSelectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetTrackSelectionTool/InDetTrackSelectionTool.h" @@ -976,7 +976,9 @@ InDet::InDetTrackSelectionTool::accept( const Trk::Track& track, std::unique_ptr paramsAtVertex; if (vertex) { Trk::PerigeeSurface perigeeSurface(vertex->position()); - paramsAtVertex.reset(m_extrapolator->extrapolate(*perigee,perigeeSurface, + paramsAtVertex.reset(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *perigee,perigeeSurface, Trk::anyDirection,true, track.info().particleHypothesis()) ); perigee = paramsAtVertex.get(); diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx index 1db37d7e57c..26e06dc3d36 100644 --- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetDetailedTrackSelectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetTrackSelectorTool/InDetDetailedTrackSelectorTool.h" @@ -224,7 +224,12 @@ namespace InDet return false; } } - const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate(*firstmeaspar,perigeeSurface,Trk::anyDirection,true,track.info().particleHypothesis() ); + const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *firstmeaspar, + perigeeSurface, + Trk::anyDirection, + true, + track.info().particleHypothesis() ); const Trk::Perigee* extrapolatedPerigee = extrapolatedParameters ? dynamic_cast(extrapolatedParameters) : nullptr; if (!extrapolatedPerigee || !extrapolatedPerigee->covariance() ) { ATH_MSG_WARNING( "Track Selector failed to extrapolate track to the vertex: " << myVertex->position() ); @@ -402,7 +407,11 @@ namespace InDet ATH_MSG_VERBOSE ("Extrapolating to position: " << myVertex->position()[0] << " , " << myVertex->position()[1] << " , " << myVertex->position()[2]); const Trk::TrackParameters* extrapolatedParameters= firstmeaspar ? - m_extrapolator->extrapolate(*firstmeaspar,perigeeSurface,Trk::anyDirection,true,Trk::pion ) : nullptr; + m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *firstmeaspar, + perigeeSurface, + Trk::anyDirection, + true,Trk::pion ) : nullptr; extrapolatedPerigee = extrapolatedParameters ? dynamic_cast(extrapolatedParameters) : nullptr; if (extrapolatedPerigee==nullptr || !extrapolatedPerigee->covariance()) { ATH_MSG_WARNING( "Track Selector failed to extrapolate track to the vertex: " << myVertex->position() ); @@ -641,7 +650,10 @@ namespace InDet } Trk::PerigeeSurface perigeeSurface( getPosOrBeamSpot(vertex) ); - const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate(perigee,perigeeSurface,Trk::anyDirection,true,Trk::pion ); + const Trk::TrackParameters* extrapolatedParameters= m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + perigee,perigeeSurface, + Trk::anyDirection,true,Trk::pion); const Trk::Perigee* extrapolatedPerigee = extrapolatedParameters ? dynamic_cast(extrapolatedParameters) : nullptr; if (extrapolatedPerigee==nullptr) { ATH_MSG_WARNING( "Extrapolation to the vertex failed: " << perigeeSurface << std::endl << perigee ); diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetIsoTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetIsoTrackSelectorTool.cxx index a89d0425286..acf6cd891ed 100644 --- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetIsoTrackSelectorTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetIsoTrackSelectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetTrackSelectorTool/InDetIsoTrackSelectorTool.h" @@ -110,10 +110,12 @@ bool InDet::InDetIsoTrackSelectorTool::decision(const Trk::AtaStraightLine& atl, const Trk::StraightLineSurface& alSurface = atl.associatedSurface(); // no surface: bail out // get the track to the BeamLine Parameters ( given by AtaStrainghtLine) - const Trk::TrackParameters* trackAtBL = m_extrapolator->extrapolate(trackPars, - alSurface, - Trk::anyDirection, - false); + const Trk::TrackParameters* trackAtBL = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + trackPars, + alSurface, + Trk::anyDirection, + false); // no parameterisation : bail out if (!trackAtBL) return false; // d0,z0 wrt BL for reference and track diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrackSelectorTool.cxx index 2da4fc05d94..ade7bb9e67e 100644 --- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrackSelectorTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetTrackSelectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "InDetTrackSelectorTool/InDetTrackSelectorTool.h" @@ -145,7 +145,10 @@ bool InDetTrackSelectorTool::decision(const Trk::TrackParameters * track, const perigee = dynamic_cast(track); else { Trk::PerigeeSurface perigeeSurface(vertex->position()); - perigee = dynamic_cast(m_extrapolator->extrapolate(*track,perigeeSurface,Trk::anyDirection,true,hyp)); + perigee = dynamic_cast(m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *track, + perigeeSurface, + Trk::anyDirection,true,hyp)); } if(nullptr == perigee || !perigee->covariance() ) { diff --git a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx index 3a4a66551fe..6b582c4a326 100644 --- a/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx +++ b/InnerDetector/InDetRecTools/SeedToTrackConversionTool/src/SeedToTrackConversionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -98,6 +98,7 @@ void InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(SeedToTrackConver const int& mtrk, const std::vector& Sp) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); ++m_totseed; // accumulate all seeds if (mtrk>0) ++m_survived; // survided seeds std::vector prdsInSp; @@ -107,7 +108,7 @@ void InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(SeedToTrackConver if (prds.second && prds.first != prds.second) prdsInSp.push_back(prds.second); } Trk::PerigeeSurface persurf; - std::unique_ptr per(m_extrapolator->extrapolate(*Tp, persurf, Trk::anyDirection, false, Trk::nonInteracting)); + std::unique_ptr per(m_extrapolator->extrapolate(ctx,*Tp, persurf, Trk::anyDirection, false, Trk::nonInteracting)); std::unique_ptr prevpar(Tp->uniqueClone()); if (per) { std::bitset typePattern; @@ -117,7 +118,7 @@ void InDet::SeedToTrackConversionTool::executeSiSPSeedSegments(SeedToTrackConver traj.push_back(pertsos); for (const Trk::PrepRawData* prd: prdsInSp) { const Trk::Surface& surf = prd->detectorElement()->surface(prd->identify()); - std::unique_ptr thispar(m_extrapolator->extrapolate(*prevpar, surf, Trk::alongMomentum, false, Trk::nonInteracting)); + std::unique_ptr thispar(m_extrapolator->extrapolate(ctx,*prevpar, surf, Trk::alongMomentum, false, Trk::nonInteracting)); if (thispar) { std::bitset typePattern; typePattern.set(Trk::TrackStateOnSurface::Measurement); diff --git a/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx b/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx index e2c011b3058..e4236b8325e 100644 --- a/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx +++ b/InnerDetector/InDetRecTools/TRT_SegmentToTrackTool/src/TRT_SegmentToTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TRT_SegmentToTrackTool/TRT_SegmentToTrackTool.h" @@ -200,7 +200,7 @@ namespace InDet { Trk::PerigeeSurface perigeeSurface(perigeePosition); // --- turn parameters into perigee... auto perParm = std::unique_ptr(dynamic_cast( - m_extrapolator->extrapolate(*segPar, perigeeSurface))); + m_extrapolator->extrapolate(ctx, *segPar, perigeeSurface))); if (perParm) { ATH_MSG_VERBOSE("Perigee version of Parameters : " << (*segPar)); } else { @@ -363,7 +363,7 @@ namespace InDet { Trk::PerigeeSurface perigeeSurface(perigeePosition); // -- get perigee const Trk::Perigee* tempper = dynamic_cast( - m_extrapolator->extrapolateDirectly(*segPar, perigeeSurface)); + m_extrapolator->extrapolateDirectly(ctx, *segPar, perigeeSurface)); if (!tempper) { ATH_MSG_DEBUG("Could not produce perigee"); delete segPar; @@ -551,7 +551,7 @@ namespace InDet { *surfforpar); Trk::PerigeeSurface persurf; const Trk::TrackParameters* extrappar = - m_extrapolator->extrapolateDirectly(ataline, persurf); + m_extrapolator->extrapolateDirectly(ctx, ataline, persurf); // now get parameters if (extrappar) { @@ -681,7 +681,9 @@ namespace InDet { std::move(fcovmat)).release(); // now take parameters at first measurement and exptrapolate to perigee - const Trk::TrackParameters *newperpar = m_extrapolator->extrapolate(*updatedPars,perTrack->associatedSurface(), + const Trk::TrackParameters *newperpar = m_extrapolator->extrapolate(ctx, + *updatedPars, + perTrack->associatedSurface(), Trk::anyDirection,false,Trk::nonInteracting); delete updatedPars; updatedPars = nullptr; diff --git a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx index 6a6398a1b2d..52d301e9ad1 100755 --- a/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackExtensionTool_xk/src/TRT_TrackExtensionToolCosmics.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -493,19 +493,30 @@ InDet::TRT_TrackExtensionToolCosmics::findBoundarySurface(const Trk::TrackParame InDet::TRT_TrackExtensionToolCosmics::EventData &event_data) const { - const Trk::TrackParameters* test=m_extrapolator->extrapolateDirectly(*m_propagator,par,*event_data.m_trtcylinder,dir,true,Trk::muon); + const EventContext& ctx = Gaudi::Hive::currentContext(); + const Trk::TrackParameters* test=m_extrapolator->extrapolateDirectly(ctx, + *m_propagator, + par, + *event_data.m_trtcylinder, + dir,true,Trk::muon); if(test){ delete test; return event_data.m_trtcylinder; } - test=m_extrapolator->extrapolateDirectly(*m_propagator,par,*event_data.m_trtdiscA,dir,true,Trk::muon); + test=m_extrapolator->extrapolateDirectly(ctx, + *m_propagator, + par, + *event_data.m_trtdiscA,dir,true,Trk::muon); if(test){ delete test; return event_data.m_trtdiscA; } - test=m_extrapolator->extrapolateDirectly(*m_propagator,par,*event_data.m_trtdiscC,dir,true,Trk::muon); + test=m_extrapolator->extrapolateDirectly(ctx,* + m_propagator, + par, + *event_data.m_trtdiscC,dir,true,Trk::muon); if(test){ delete test; return event_data.m_trtdiscC; diff --git a/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx index 5b3dd6ce5dc..13624f4ec99 100644 --- a/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx +++ b/InnerDetector/InDetRecTools/TRT_TrackHoleSearch/src/TRTTrackHoleSearchTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // TRTTrackHoleSearchTool.cxx @@ -257,7 +257,10 @@ int TRTTrackHoleSearchTool::extrapolateBetweenHits(const Trk::TrackParameters* s // look for holes std::vector > steps = - m_extrapolator->extrapolateStepwise(*start_parameters, end_surf, Trk::alongMomentum, m_bcheck, partHyp); + m_extrapolator->extrapolateStepwise(Gaudi::Hive::currentContext(), + *start_parameters, + end_surf, + Trk::alongMomentum, m_bcheck, partHyp); if(steps.empty()) { ATH_MSG_DEBUG("extrapolateBetweenHits: extrapolateStepwise returned null"); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx index 9316b550902..4a071cfe101 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx @@ -165,7 +165,10 @@ AthTruthSelectionTool::initialize() { const Amg::Vector3D position(xPos, yPos, z_truth); const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); - const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_cylinder, Trk::anyDirection, false, Trk::pion); + const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + cParameters, + *m_cylinder, + Trk::anyDirection, false, Trk::pion); if (!exParameters) { ATH_MSG_VERBOSE("Failed extrapolation. Rejecting track."); return false; @@ -204,7 +207,9 @@ AthTruthSelectionTool::initialize() { const Amg::Vector3D position(xPos, yPos, z_truth); const Amg::Vector3D momentum(p.px(), p.py(), p.pz()); const Trk::CurvilinearParameters cParameters(position, momentum, p.charge()); - const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(cParameters, *m_disc1, Trk::anyDirection, true, Trk::pion); + const Trk::TrackParameters *exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + cParameters, + *m_disc1, Trk::anyDirection, true, Trk::pion); if (exParameters) { //since boundary check is true, should be enough to say we've hit the disk.. ATH_MSG_VERBOSE("Successfully extrapolated track to disk at +" << m_zDisc << ": " << *exParameters); @@ -217,7 +222,7 @@ AthTruthSelectionTool::initialize() { //else... ATH_MSG_VERBOSE("Strange, extrapolation succeeded but extrapolated position not within disc radius! Test next disc"); } - exParameters = m_extrapolator->extrapolate(cParameters, *m_disc2, Trk::anyDirection, true, Trk::pion); + exParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),cParameters, *m_disc2, Trk::anyDirection, true, Trk::pion); if (exParameters) { //since boundary check is true, should be enough to say we've hit the disk.. ATH_MSG_VERBOSE("Successfully extrapolated track to disk at -" << m_zDisc << ": " << *exParameters); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx index 710dad941a2..7741238769d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** @@ -154,6 +154,7 @@ InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle if (particle.isNeutral()) { return false; } + const EventContext& ctx = Gaudi::Hive::currentContext(); const Amg::Vector3D momentum(particle.px(), particle.py(), particle.pz()); const int pid(particle.pdgId()); double charge = particle.charge(); @@ -197,7 +198,9 @@ InDetPhysValTruthDecoratorAlg::decorateTruth(const xAOD::TruthParticle& particle Trk::PerigeeSurface persf(beamPos); - std::unique_ptr tP ( m_extrapolator->extrapolate(cParameters, persf, Trk::anyDirection, false) ); + std::unique_ptr tP ( m_extrapolator->extrapolate(ctx, + cParameters, + persf, Trk::anyDirection, false) ); if (tP) { float d0_truth = tP->parameters()[Trk::d0]; float theta_truth = tP->parameters()[Trk::theta]; diff --git a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx index f15e31001c5..a905d9dd1d9 100644 --- a/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx +++ b/MuonSpectrometer/MSVertexReconstruction/MSVertexTools/src/MSVertexRecoTool.cxx @@ -542,7 +542,8 @@ namespace Muon { Trk::CylinderSurface cyl(surfaceTransformMatrix, rpos, 10000.); // create the surface // extrapolate to the surface std::unique_ptr extrap_par( - m_extrapolator->extrapolate(*TracksForVertexing[k].at(i), cyl, Trk::anyDirection, boundaryCheck, Trk::muon)); + m_extrapolator->extrapolate(ctx, + *TracksForVertexing[k].at(i), cyl, Trk::anyDirection, boundaryCheck, Trk::muon)); const Trk::AtaCylinder* extrap = dynamic_cast(extrap_par.get()); @@ -574,7 +575,8 @@ namespace Muon { srfTransMat2.setIdentity(); Trk::CylinderSurface cyl2(srfTransMat2, rpos, 10000.); std::unique_ptr extrap_par2( - m_extrapolator->extrapolate(*TracksForErrors[k].at(i), cyl, Trk::anyDirection, boundaryCheck, Trk::muon)); + m_extrapolator->extrapolate(ctx, + *TracksForErrors[k].at(i), cyl, Trk::anyDirection, boundaryCheck, Trk::muon)); const Trk::AtaCylinder* extrap2 = dynamic_cast(extrap_par2.get()); if (extrap2) { diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx index 0d0fc211cee..b2cc9997399 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonTrackSummaryHelperTool.h" @@ -425,6 +425,7 @@ void Muon::MuonTrackSummaryHelperTool::updateHoleContent(Trk::MuonTrackSummary:: void Muon::MuonTrackSummaryHelperTool::calculateRoadHits(Trk::MuonTrackSummary::ChamberHitSummary& chamberHitSummary, const Trk::TrackParameters& pars) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); bool isStraightLine = false; if (pars.parameters().rows() < 5) { // no momentum parameter given isStraightLine = true; @@ -485,7 +486,10 @@ void Muon::MuonTrackSummaryHelperTool::calculateRoadHits(Trk::MuonTrackSummary:: if (pars.associatedSurface() == surf) { exPars = &pars; } else { - exPars = extrapolator->extrapolateDirectly(pars, surf, Trk::anyDirection, false, Trk::muon); + exPars = extrapolator->extrapolateDirectly(ctx, + pars, + surf, + Trk::anyDirection, false, Trk::muon); if (!exPars) { if (isStraightLine) { ATH_MSG_DEBUG(" Straight line propagation to prd " << m_idHelperSvc->toString(id) << " failed"); diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx index 07bc3c733cb..af503b9a1fe 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonTrackExtrapolationTool.h" @@ -62,23 +62,23 @@ namespace Muon { if (m_cosmics) { // for cosmics try both directions const Trk::TrackParameters *entryPars = - m_muonExtrapolator->extrapolateToVolume(pars, *msEntrance, Trk::oppositeMomentum, particleHypo); + m_muonExtrapolator->extrapolateToVolume(ctx, pars, *msEntrance, Trk::oppositeMomentum, particleHypo); if (!entryPars) { ATH_MSG_VERBOSE(" failed to extrapolate opposite momentum"); // retry in other direction - entryPars = m_muonExtrapolator->extrapolateToVolume(pars, *msEntrance, Trk::alongMomentum, particleHypo); + entryPars = m_muonExtrapolator->extrapolateToVolume(ctx, pars, *msEntrance, Trk::alongMomentum, particleHypo); if (!entryPars) ATH_MSG_VERBOSE(" failed to extrapolate along momentum for the second trial"); } return entryPars; } - return m_muonExtrapolator->extrapolateToVolume(pars, *msEntrance, dir, particleHypo); + return m_muonExtrapolator->extrapolateToVolume(ctx, pars, *msEntrance, dir, particleHypo); } const Trk::TrackParameters *MuonTrackExtrapolationTool::extrapolateToIP(const Trk::TrackParameters &pars, Trk::ParticleHypothesis particleHypo) const { if (m_atlasExtrapolator.empty()) return nullptr; - + const EventContext& ctx = Gaudi::Hive::currentContext(); // temporary hack to avoid crashes in Muid. Amg::Vector3D refPos(0.1, 0.1, 0.1); Trk::PerigeeSurface persurf(refPos); @@ -93,13 +93,13 @@ namespace Muon { : "")); // for cosmics try both directions - const Trk::TrackParameters *entryPars = m_atlasExtrapolator->extrapolate(pars, persurf, propDir, false, particleHypo); + const Trk::TrackParameters *entryPars = m_atlasExtrapolator->extrapolate(ctx, pars, persurf, propDir, false, particleHypo); if (!entryPars) ATH_MSG_VERBOSE(" failed to extrapolate to IP"); if (m_cosmics && !entryPars) { // flip propagation direction and retry in other direction propDir = propDir == Trk::alongMomentum ? Trk::oppositeMomentum : Trk::alongMomentum; - entryPars = m_atlasExtrapolator->extrapolate(pars, persurf, propDir, false, particleHypo); + entryPars = m_atlasExtrapolator->extrapolate(ctx, pars, persurf, propDir, false, particleHypo); if (!entryPars) ATH_MSG_VERBOSE(" failed to extrapolate to IP in opposite direction"); } @@ -435,7 +435,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector *matvec = m_muonExtrapolator->extrapolateM( - *perigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); + ctx, *perigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -466,7 +466,7 @@ namespace Muon { if (meas) { ATH_MSG_VERBOSE(" trying to add material layers extrapolating to next measurement "); const std::vector *matvec = m_muonExtrapolator->extrapolateM( - *perigee, meas->associatedSurface(), Trk::alongMomentum, false, particleHypo); + ctx, *perigee, meas->associatedSurface(), Trk::alongMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -509,7 +509,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector *matvec = m_muonExtrapolator->extrapolateM( - *secondPerigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); + ctx, *secondPerigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -537,7 +537,7 @@ namespace Muon { if (meas) { ATH_MSG_VERBOSE(" trying to add material layers extrapolating to next measurement "); const std::vector *matvec = m_muonExtrapolator->extrapolateM( - *secondPerigee, meas->associatedSurface(), Trk::alongMomentum, false, particleHypo); + ctx, *secondPerigee, meas->associatedSurface(), Trk::alongMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -574,7 +574,8 @@ namespace Muon { // collect the material going in opposite direction const std::vector *matvec = - m_muonExtrapolator->extrapolateM(*perigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); + m_muonExtrapolator->extrapolateM( + ctx, *perigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -597,7 +598,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector *matvec = m_muonExtrapolator->extrapolateM( - *secondPerigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); + ctx, *secondPerigee, meas->associatedSurface(), Trk::oppositeMomentum, false, particleHypo); if (matvec && !matvec->empty()) { ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -636,7 +637,7 @@ namespace Muon { const Trk::Perigee *MuonTrackExtrapolationTool::createPerigee(const Trk::TrackParameters &pars) const { if (m_muonExtrapolator2.empty()) { return nullptr; } Trk::PerigeeSurface persurf(pars.position()); - const Trk::TrackParameters *exPars = m_muonExtrapolator2->extrapolateDirectly(pars, persurf); + const Trk::TrackParameters *exPars = m_muonExtrapolator2->extrapolateDirectly(Gaudi::Hive::currentContext(),pars, persurf); const Trk::Perigee *pp = dynamic_cast(exPars); if (!pp) { ATH_MSG_WARNING(" Extrapolation to Perigee surface did not return a perigee!! "); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcTrackAnaAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcTrackAnaAlg.cxx index 39aace313dd..13873a68974 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcTrackAnaAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcTrackAnaAlg.cxx @@ -536,6 +536,7 @@ StatusCode RpcTrackAnaAlg::computeTrackIntersectionWithGasGap(ExResult & const xAOD::TrackParticle* track_particle, const std::shared_ptr &gap) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); /* This function: - constructs Identifier for specific gasgap @@ -553,18 +554,20 @@ StatusCode RpcTrackAnaAlg::computeTrackIntersectionWithGasGap(ExResult & const Trk::TrackParameters *detParameters = nullptr; if(m_useAODParticle) { - detParameters = m_extrapolator->extrapolate(*track_particle, - gapSurface, - result.direction, - false, - Trk::muon); + detParameters = m_extrapolator->extrapolate(ctx, + *track_particle, + gapSurface, + result.direction, + false, + Trk::muon); } else if (track_particle->track()) { - detParameters = m_extrapolator->extrapolate(*(track_particle->track()), - gapSurface, - result.direction, - true, - Trk::muon); + detParameters = m_extrapolator->extrapolate(ctx, + *(track_particle->track()), + gapSurface, + result.direction, + true, + Trk::muon); } else { return StatusCode::FAILURE; diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx index 387bff72150..00d14334d9c 100644 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/TgcRawDataMonitoring/src/TgcRawDataMonitorAlgorithm.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TgcRawDataMonitorAlgorithm.h" @@ -1715,7 +1715,9 @@ std::unique_ptr TgcRawDataMonitorAlgorithm::extrapol distance[0] = trackZ; distance[1] = std::abs(trackZ - targetZ); const bool boundaryCheck = true; - auto param = std::unique_ptr(m_extrapolator->extrapolate(*track, *disc, Trk::anyDirection, boundaryCheck, Trk::muon)); + auto param = std::unique_ptr(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *track, *disc, Trk::anyDirection, boundaryCheck, Trk::muon)); if (!param) { return nullptr; } @@ -1743,7 +1745,9 @@ std::unique_ptr TgcRawDataMonitorAlgorithm::extrapol distance[0] = trackRadius; distance[1] = trackRadius - radius; const bool boundaryCheck = true; - auto param = std::unique_ptr(m_extrapolator->extrapolate(*track, *cylinder, Trk::anyDirection, boundaryCheck, Trk::muon)); + auto param = std::unique_ptr(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *track, *cylinder, Trk::anyDirection, boundaryCheck, Trk::muon)); if (!param) { return nullptr; diff --git a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx index 5508c68410e..10a7afe8c34 100644 --- a/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx +++ b/MuonSpectrometer/MuonValidation/MuonPRDTest/src/MDTPRDValAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MDTPRDValAlg.h" @@ -716,7 +716,7 @@ void MDTPRDValAlg::analyseHits( MuonMdtHitMap& muonMdtHitMap, TruthMap& truthMap // fill event data /** get EventInfo, used to obtain run and event number */ const xAOD::EventInfo* pevt; - + const EventContext& ctx = Gaudi::Hive::currentContext(); if (evtStore()->retrieve(pevt).isFailure()) { ATH_MSG_WARNING("Could not find event"); @@ -878,7 +878,7 @@ void MDTPRDValAlg::analyseHits( MuonMdtHitMap& muonMdtHitMap, TruthMap& truthMap const Trk::SaggedLineSurface& sagSurf = detEl->surface(id); - const Trk::TrackParameters* expar = m_extrapolator->extrapolateDirectly(muonPerigee,sagSurf, + const Trk::TrackParameters* expar = m_extrapolator->extrapolateDirectly(ctx,muonPerigee,sagSurf, Trk::alongMomentum,false); if( !expar ){ ATH_MSG_DEBUG(" extrapolation failed "); @@ -901,7 +901,7 @@ void MDTPRDValAlg::analyseHits( MuonMdtHitMap& muonMdtHitMap, TruthMap& truthMap // // Perform a full extrapolation including material and Eloss // - const Trk::TrackParameters* exparEloss = m_extrapolator->extrapolate(muonPerigee,sagSurf,Trk::alongMomentum,false); + const Trk::TrackParameters* exparEloss = m_extrapolator->extrapolate(ctx,muonPerigee,sagSurf,Trk::alongMomentum,false); if( !exparEloss ){ ATH_MSG_DEBUG(" extrapolation failed "); delete expar; @@ -922,7 +922,7 @@ void MDTPRDValAlg::analyseHits( MuonMdtHitMap& muonMdtHitMap, TruthMap& truthMap delete exparEloss; continue; } - const Trk::TrackParameters* exparSag = m_extrapolator->extrapolateDirectly(muonPerigee,*saggedSurface, + const Trk::TrackParameters* exparSag = m_extrapolator->extrapolateDirectly(ctx, muonPerigee,*saggedSurface, Trk::alongMomentum,false); if( !exparSag ){ ATH_MSG_DEBUG(" extrapolation failed "); @@ -957,7 +957,7 @@ void MDTPRDValAlg::analyseHits( MuonMdtHitMap& muonMdtHitMap, TruthMap& truthMap continue; } - const Trk::TrackParameters* exparSagRot = m_extrapolator->extrapolateDirectly(muonPerigee,rot->associatedSurface(), + const Trk::TrackParameters* exparSagRot = m_extrapolator->extrapolateDirectly(ctx,muonPerigee,rot->associatedSurface(), Trk::alongMomentum,false); if( !exparSagRot ){ ATH_MSG_DEBUG(" extrapolation failed "); diff --git a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTraversedMaterialFillerTool.cxx b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTraversedMaterialFillerTool.cxx index a500c9c3ce1..611e87e8380 100644 --- a/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTraversedMaterialFillerTool.cxx +++ b/PhysicsAnalysis/D3PDMaker/egammaD3PDMaker/src/egammaTraversedMaterialFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // $Id$ @@ -173,11 +173,13 @@ namespace D3PD { // Extrapolate to surface typedef std::vector tsos_vec_t; std::unique_ptr v - (m_extrapolator->extrapolateM (parameters, - *surface, - Trk::alongMomentum, - true, - Trk::muon)); + (m_extrapolator->extrapolateM ( + Gaudi::Hive::currentContext(), + parameters, + *surface, + Trk::alongMomentum, + true, + Trk::muon)); if (!v) { ATH_MSG_DEBUG("Extrapolation failed"); diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx index 02d78734c20..ebd4438e30a 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkInDet/src/TrackStateOnSurfaceDecorator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -349,21 +349,52 @@ namespace DerivationFramework { if ( trkTrack->perigeeParameters() ){ // Track extrapolation - std::unique_ptr perigee( m_extrapolator->extrapolate(*trkTrack, - (trkTrack->perigeeParameters())->associatedSurface(), - Trk::oppositeMomentum, - true, - Trk::pion, - Trk::addNoise)); - - Trk::CylinderSurface cylSurfIBL(29.5,3000.0); - Trk::CylinderSurface cylSurfBL(50.5,3000.0); - Trk::CylinderSurface cylSurfL1(88.5,3000.0); - Trk::CylinderSurface cylSurfL2(122.5,3000.0); - std::unique_ptr outputParamsIBL(m_extrapolator->extrapolate(*perigee,cylSurfIBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise)); - std::unique_ptr outputParamsBL(m_extrapolator->extrapolate(*perigee,cylSurfBL,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise)); - std::unique_ptr outputParamsL1(m_extrapolator->extrapolate(*perigee,cylSurfL1,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise)); - std::unique_ptr outputParamsL2(m_extrapolator->extrapolate(*perigee,cylSurfL2,Trk::alongMomentum,true,Trk::pion,Trk::removeNoise)); + std::unique_ptr perigee( + m_extrapolator->extrapolate( + ctx, + *trkTrack, + (trkTrack->perigeeParameters())->associatedSurface(), + Trk::oppositeMomentum, + true, + Trk::pion, + Trk::addNoise)); + + Trk::CylinderSurface cylSurfIBL(29.5, 3000.0); + Trk::CylinderSurface cylSurfBL(50.5, 3000.0); + Trk::CylinderSurface cylSurfL1(88.5, 3000.0); + Trk::CylinderSurface cylSurfL2(122.5, 3000.0); + std::unique_ptr outputParamsIBL( + m_extrapolator->extrapolate(ctx, + *perigee, + cylSurfIBL, + Trk::alongMomentum, + true, + Trk::pion, + Trk::removeNoise)); + std::unique_ptr outputParamsBL( + m_extrapolator->extrapolate(ctx, + *perigee, + cylSurfBL, + Trk::alongMomentum, + true, + Trk::pion, + Trk::removeNoise)); + std::unique_ptr outputParamsL1( + m_extrapolator->extrapolate(ctx, + *perigee, + cylSurfL1, + Trk::alongMomentum, + true, + Trk::pion, + Trk::removeNoise)); + std::unique_ptr outputParamsL2( + m_extrapolator->extrapolate(ctx, + *perigee, + cylSurfL2, + Trk::alongMomentum, + true, + Trk::pion, + Trk::removeNoise)); if (outputParamsIBL.get()) { trackPixFloatDecorators[kTrkIBLXDecor](*track) = outputParamsIBL->position().x(); @@ -594,15 +625,7 @@ namespace DerivationFramework { // Track extrapolation - std::unique_ptr extrap( m_extrapolator->extrapolate(*trkTrack,trackState->surface()) ); -// const Trk::TrackParameters* extrap = m_extrapolator->extrapolate(*trkTrack,trackState->surface(),Trk::PropDirection::anyDirection,false); -// const Trk::TrackParameters* extrap = m_extrapolator->extrapolate(*trkTrack,trackState->surface(),Trk::PropDirection::anyDirection,true,Trk::ParticleHypothesis::pion,Trk::MaterialUpdateMode::removeNoise); -// const Trk::TrackParameters* extrap = m_extrapolator->extrapolate(*trkTrack,trackState->surface(),Trk::PropDirection::anyDirection,true,Trk::ParticleHypothesis::nonInteractingMuon,Trk::MaterialUpdateMode::addNoise); - -// Amg::Transform3D *newDetElem = new Amg::Transform3D(); -// *newDetElem = trackState->surface().transform(); -// Trk::PerigeeSurface newSurface(newDetElem); -// const Trk::TrackParameters* extrap = m_extrapolator->extrapolateDirectly(track->perigeeParameters(),newSurface); + std::unique_ptr extrap( m_extrapolator->extrapolate(ctx,*trkTrack,trackState->surface()) ); // Set local positions on the surface if (tp) { diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/BTagTrackAugmenterAlg.cxx b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/BTagTrackAugmenterAlg.cxx index 2c7251e69dc..6ea84113586 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/BTagTrackAugmenterAlg.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/src/BTagTrackAugmenterAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ @@ -138,7 +138,7 @@ namespace Analysis { // some other parameters we have go get directly from the // extrapolator. This is more or less copied from: // https://goo.gl/iWLv5T - std::unique_ptr< const Trk::TrackParameters > extrap_pars( m_extrapolator->extrapolate( *track, primary_surface ) ); + std::unique_ptr< const Trk::TrackParameters > extrap_pars( m_extrapolator->extrapolate(ctx, *track, primary_surface ) ); if ( extrap_pars ) { const Amg::Vector3D& track_pos = extrap_pars->position(); const Amg::Vector3D& vertex_pos = primary->position(); diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/ExtrapolateMuonToIPTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/ExtrapolateMuonToIPTool.cxx index 83e233268a5..f0c2f311f6a 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/ExtrapolateMuonToIPTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/ExtrapolateMuonToIPTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "ExtrapolateMuonToIPTool.h" @@ -61,8 +61,12 @@ std::unique_ptr ExtrapolateMuonToIPTool::extrapolate(const Trac return extrapolateTracks; } -std::unique_ptr ExtrapolateMuonToIPTool::extrapolate(const Trk::Track& track, const EventContext& ctx) const { - const Trk::TrackInfo& trackInfo = track.info(); +std::unique_ptr +ExtrapolateMuonToIPTool::extrapolate(const Trk::Track& track, + const EventContext& ctx) const +{ + + const Trk::TrackInfo& trackInfo = track.info(); auto particleType = trackInfo.trackProperties(Trk::TrackInfo::StraightTrack) ? Trk::nonInteracting : Trk::muon; const Trk::TrackParameters* closestPars = findMeasuredParametersClosestToIP(track); ATH_MSG_DEBUG("Extrapolating track " << m_printer->print(track) << " type " << particleType << std::endl @@ -103,7 +107,7 @@ std::unique_ptr ExtrapolateMuonToIPTool::extrapolate(const Trk::Trac if (!ipPars) { // if extrapolation failed go in other direction propDir = (propDir == Trk::alongMomentum) ? Trk::oppositeMomentum : Trk::alongMomentum; - ipPars.reset(m_extrapolator->extrapolate(*closestPars, perigeeSurface, propDir, false, particleType)); + ipPars.reset(m_extrapolator->extrapolate(ctx,*closestPars, perigeeSurface, propDir, false, particleType)); if (propDir == Trk::alongMomentum) { ATH_MSG_DEBUG(" retrying opposite momentum extrapolating " diff --git a/Reconstruction/MuonIdentification/MuonSegmentTaggers/MuonSegmentTaggerTools/src/MuTagMatchingTool.cxx b/Reconstruction/MuonIdentification/MuonSegmentTaggers/MuonSegmentTaggerTools/src/MuTagMatchingTool.cxx index 3843c356269..489282378e2 100644 --- a/Reconstruction/MuonIdentification/MuonSegmentTaggers/MuonSegmentTaggerTools/src/MuTagMatchingTool.cxx +++ b/Reconstruction/MuonIdentification/MuonSegmentTaggers/MuonSegmentTaggerTools/src/MuTagMatchingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuTagMatchingTool.h" @@ -478,6 +478,7 @@ void MuTagMatchingTool::testExtrapolation(const Trk::Surface* pSurface, const Tr ATH_MSG_DEBUG("Couldn't get the measured Perigee from TP"); return; } + const EventContext& ctx = Gaudi::Hive::currentContext(); // CLHEP::HepVector oripars = oriPerigee->parameters(); const AmgVector(5)& oripars = oriPerigee->parameters(); @@ -495,7 +496,7 @@ void MuTagMatchingTool::testExtrapolation(const Trk::Surface* pSurface, const Tr ATH_MSG_DEBUG("=== global directn " << startMom.phi() << " " << startMom.theta()); std::unique_ptr alongPars{ - m_IExtrapolator->extrapolate(*pPerigee, *pSurface, Trk::alongMomentum, false, Trk::muon)}; + m_IExtrapolator->extrapolate(ctx, *pPerigee, *pSurface, Trk::alongMomentum, false, Trk::muon)}; ATH_MSG_DEBUG("======= EXTRAPOLATED ALONG MOMENTUM ORIGINAL PERIGEE"); if (alongPars) { @@ -510,7 +511,7 @@ void MuTagMatchingTool::testExtrapolation(const Trk::Surface* pSurface, const Tr ATH_MSG_DEBUG("======= EXTRAPOLATED OPPOSITE MOMENTUM ORIGINAL PERIGEE"); std::unique_ptr oppositePars{ - m_IExtrapolator->extrapolate(*pPerigee, *pSurface, Trk::oppositeMomentum, false, Trk::muon)}; + m_IExtrapolator->extrapolate(ctx, *pPerigee, *pSurface, Trk::oppositeMomentum, false, Trk::muon)}; if (oppositePars) { const Amg::Vector3D oppositePos = oppositePars->position(); const Amg::Vector3D oppositeMom = oppositePars->momentum(); @@ -534,7 +535,7 @@ void MuTagMatchingTool::testExtrapolation(const Trk::Surface* pSurface, const Tr ATH_MSG_DEBUG("=== global directn " << flipMom.phi() << " " << flipMom.theta()); std::unique_ptr alongFlipPars{ - m_IExtrapolator->extrapolate(*flippedPerigee, *pSurface, Trk::alongMomentum, false, Trk::muon)}; + m_IExtrapolator->extrapolate(ctx,*flippedPerigee, *pSurface, Trk::alongMomentum, false, Trk::muon)}; ATH_MSG_DEBUG("======= EXTRAPOLATED ALONGFLIP MOMENTUM ORIGINAL PERIGEE"); if (alongFlipPars) { @@ -548,7 +549,7 @@ void MuTagMatchingTool::testExtrapolation(const Trk::Surface* pSurface, const Tr ATH_MSG_DEBUG("======= EXTRAPOLATED OPPOSITEFLIP MOMENTUM ORIGINAL PERIGEE"); std::unique_ptr oppositeFlipPars{ - m_IExtrapolator->extrapolate(*flippedPerigee, *pSurface, Trk::oppositeMomentum, false, Trk::muon)}; + m_IExtrapolator->extrapolate(ctx, *flippedPerigee, *pSurface, Trk::oppositeMomentum, false, Trk::muon)}; if (oppositeFlipPars) { const Amg::Vector3D oppositeFlipPos = oppositeFlipPars->position(); const Amg::Vector3D oppositeFlipMom = oppositeFlipPars->momentum(); diff --git a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx index 880a6a1160e..b9465ad7b59 100755 --- a/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx +++ b/Reconstruction/RecoTools/TrackToVertex/src/TrackToVertex.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -102,7 +102,7 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const xAOD::TrackPartic return (trackparPerigee.clone()); } else { const Trk::TrackParameters* extrapResult = - m_extrapolator->extrapolateDirectly(trackparPerigee, persf); + m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(),trackparPerigee, persf); if (extrapResult && extrapResult->surfaceType() == Trk::SurfaceType::Perigee) { vertexPerigee = static_cast(extrapResult); } @@ -127,7 +127,7 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Rec::TrackParticl return(trackparPerigee->clone()); } else { const Trk::TrackParameters* extrapResult = - m_extrapolator->extrapolateDirectly(*trackparPerigee, persf); + m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(),*trackparPerigee, persf); if (extrapResult && extrapResult->surfaceType() == Trk::SurfaceType::Perigee) { vertexPerigee = static_cast(extrapResult); @@ -151,7 +151,7 @@ const Trk::Perigee* Reco::TrackToVertex::perigeeAtVertex(const Trk::Track& track Trk::PerigeeSurface persf(gp); const Trk::Perigee* vertexPerigee = nullptr; const Trk::TrackParameters* extrapResult = - m_extrapolator->extrapolate(track, persf); + m_extrapolator->extrapolate(Gaudi::Hive::currentContext(),track, persf); if (extrapResult && extrapResult->surfaceType() == Trk::SurfaceType::Perigee) { vertexPerigee = static_cast(extrapResult); } @@ -283,7 +283,7 @@ const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const xAOD::Tra ATH_MSG_DEBUG("Perigee of TrackParticle is already expressed to given vertex, a copy is returned."); return(trackparPerigee.clone()); } else - vertexPerigee = m_extrapolator->extrapolateDirectly(trackparPerigee, persf); + vertexPerigee = m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(),trackparPerigee, persf); if (!vertexPerigee){ ATH_MSG_DEBUG("Extrapolation to Beam Line failed, a NULL pointer is returned."); } @@ -294,13 +294,13 @@ const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const xAOD::Tra const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const Trk::Track& trk, const Trk::StraightLineSurface* beamline) const { - return m_extrapolator->extrapolate(trk, *beamline); + return m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), trk, *beamline); } const Trk::TrackParameters* Reco::TrackToVertex::trackAtBeamline(const Trk::TrackParameters& tpars, const Trk::StraightLineSurface* beamline) const { - return m_extrapolator->extrapolate(tpars, *beamline); + return m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), tpars, *beamline); } diff --git a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx index e61df2b7999..fc90c2b2e91 100755 --- a/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx +++ b/Reconstruction/VKalVrt/NewVrtSecInclusiveTool/src/Utilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /// /// @author Vadim Kostyukhin @@ -303,7 +303,8 @@ namespace Rec{ } double NewVrtSecInclusiveTool::distToMatLayerSignificance(Vrt2Tr & Vrt) const - { + { + const EventContext& ctx = Gaudi::Hive::currentContext(); if(Vrt.fitVertex.perp()<20.) return 1.e9; double normP=1./Vrt.momentum.P(); Amg::Vector3D momentumP(Vrt.momentum.Px()*normP,Vrt.momentum.Py()*normP,Vrt.momentum.Pz()*normP); @@ -329,9 +330,9 @@ namespace Rec{ const Trk::TrackParameters * extrapParP=0; //along momentum const Trk::TrackParameters * extrapParN=0; //backward - if(nextLayerP){ extrapParP = m_extrapolator->extrapolate(pseudoVrtPart, + if(nextLayerP){ extrapParP = m_extrapolator->extrapolate(ctx, pseudoVrtPart, nextLayerP->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon) ;} - if(nextLayerN){ extrapParN = m_extrapolator->extrapolate(pseudoVrtPart, + if(nextLayerN){ extrapParN = m_extrapolator->extrapolate(ctx, pseudoVrtPart, nextLayerN->surfaceRepresentation(), Trk::anyDirection, false, Trk::nonInteractingMuon) ;} float distanceP=1.e9, distanceN=1.e9; diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h index 1baaa64c124..0b706b0c0a6 100644 --- a/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h +++ b/Reconstruction/VKalVrt/VrtSecInclusive/VrtSecInclusive/details/Utilities.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef _VrtSecInclusive_VrtSecInclusive_Utilities_H @@ -35,9 +35,14 @@ namespace VKalVrtAthena { //____________________________________________________________________________________________________ - template void VrtSecInclusive::setIntersection( TrackT* trk, IntersectionPos *layer, const Trk::Perigee* per) { - const Trk::TrackParameters* Output (nullptr); - + template + void + VrtSecInclusive::setIntersection(TrackT* trk, + IntersectionPos* layer, + const Trk::Perigee* per) + { + const EventContext& ctx = Gaudi::Hive::currentContext(); + const Trk::TrackParameters* Output(nullptr); if( layer->bec() == IntersectionPos::barrel ) { @@ -48,7 +53,7 @@ namespace VKalVrtAthena { Amg::Transform3D trnsf; trnsf.setIdentity(); Trk::CylinderSurface surfBorder(trnsf, barrel->radius(), 300000.); // - Output = m_extrapolator->extrapolateDirectly(*per,surfBorder,Trk::anyDirection,true,Trk::pion); + Output = m_extrapolator->extrapolateDirectly(ctx, *per,surfBorder,Trk::anyDirection,true,Trk::pion); barrel->x()->push_back( Output? Output->position().x() : -10000 ); barrel->y()->push_back( Output? Output->position().y() : -10000 ); @@ -68,7 +73,7 @@ namespace VKalVrtAthena { trnsf.setIdentity(); trnsf.translate( Amg::Vector3D(0.,0.,endcap->zpos()) ); Trk::DiscSurface surfBorder(trnsf, endcap->rmin(), endcap->rmax() ); - Output = m_extrapolator->extrapolateDirectly(*per, surfBorder, Trk::anyDirection, true, Trk::pion); + Output = m_extrapolator->extrapolateDirectly(ctx, *per, surfBorder, Trk::anyDirection, true, Trk::pion); endcap->x()->push_back( Output? Output->position().x() : -10000 ); endcap->y()->push_back( Output? Output->position().y() : -10000 ); @@ -85,7 +90,6 @@ namespace VKalVrtAthena { delete Output; } - //____________________________________________________________________________________________________ template diff --git a/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx b/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx index 35fd45d955b..78ce7638210 100644 --- a/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx +++ b/Reconstruction/VKalVrt/VrtSecInclusive/src/Utilities.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // Header include @@ -1098,9 +1098,10 @@ namespace VKalVrtAthena { VrtSecInclusive::ExtrapolatedPattern* VrtSecInclusive::extrapolatedPattern( const xAOD::TrackParticle* trk, enum Trk::PropDirection direction ) { auto* pattern = new ExtrapolatedPattern; - - std::vector> paramsVector = m_extrapolator->extrapolateBlindly( trk->perigeeParameters(), direction ); - + const EventContext& ctx = Gaudi::Hive::currentContext(); + std::vector> paramsVector = + m_extrapolator->extrapolateBlindly(ctx, trk->perigeeParameters(), direction); + TVector3 prevPos( AlgConsts::invalidFloat, AlgConsts::invalidFloat, AlgConsts::invalidFloat ); auto nDisabled = 0; diff --git a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx index aa0062efea5..c4c6143c182 100644 --- a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx +++ b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "egammaTrkRefitterTool.h" @@ -296,7 +296,7 @@ egammaTrkRefitterTool::provideVotFromBeamspot(const EventContext& ctx, // calculate perigee parameters wrt. beam-spot const Trk::Perigee* perigee = nullptr; const Trk::TrackParameters* tmp = - m_extrapolator->extrapolate(*track, surface); + m_extrapolator->extrapolate(ctx, *track, surface); if (tmp->associatedSurface().type() == Trk::SurfaceType::Perigee) { perigee = static_cast(tmp); } diff --git a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/src/ISPtoPerigeeTool.cxx b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/src/ISPtoPerigeeTool.cxx index af70814c2f3..d37825d8f22 100644 --- a/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/src/ISPtoPerigeeTool.cxx +++ b/Simulation/ISF/ISF_ParametricSim/ISF_ParSimTools/src/ISPtoPerigeeTool.cxx @@ -45,7 +45,7 @@ const Amg::Vector3D iParSim::ISPtoPerigeeTool::getPerigee() const{ const Trk::TrackParameters* iParSim::ISPtoPerigeeTool::extractTrkParameters(const ISF::ISFParticle& isp) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); if( isp.charge() == 0 ) { ATH_MSG_WARNING(" ISPtoPerigeeTool is not for neutral particles!"); } @@ -55,9 +55,12 @@ const Trk::TrackParameters* iParSim::ISPtoPerigeeTool::extractTrkParameters(cons const Amg::Vector3D &position = isp.position(); //do the rest const Trk::CurvilinearParameters cParameters(position, momentum, isp.charge()); - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx }; Trk::PerigeeSurface persf( beamSpotHandle->beamPos() ); - const Trk::TrackParameters* tP = m_extrapolator->extrapolate(cParameters, persf, Trk::anyDirection, false); + const Trk::TrackParameters* tP = m_extrapolator->extrapolate(ctx, + cParameters, + persf, + Trk::anyDirection, false); return tP; } diff --git a/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/src/TrkExtrapolator.cxx b/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/src/TrkExtrapolator.cxx index ac9c6a21704..2831be8ea69 100644 --- a/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/src/TrkExtrapolator.cxx +++ b/Simulation/ISF/ISF_Tracking/ISF_TrackingTools/src/TrkExtrapolator.cxx @@ -69,6 +69,7 @@ StatusCode ISF::TrkExtrapolator::finalize() /** Extrapolate the given ISFParticle to the given TrackingVolume name */ ISF::ISFParticle* ISF::TrkExtrapolator::extrapolate( const ISF::ISFParticle &particle ) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); if( m_extrapolator.empty() ) { ATH_MSG_ERROR( "Problem with extrapolator!" ); return 0; @@ -103,7 +104,11 @@ ISF::ISFParticle* ISF::TrkExtrapolator::extrapolate( const ISF::ISFParticle &par if ( absPdg == 999 ) particleHypo = Trk::geantino; // extrapolate to calorimeter entry - const Trk::TrackParameters* extrapolatedPars = m_extrapolator->extrapolateToVolume(par,*m_trackingVolume,Trk::alongMomentum,particleHypo); + const Trk::TrackParameters* extrapolatedPars = m_extrapolator->extrapolateToVolume(ctx, + par, + *m_trackingVolume, + Trk::alongMomentum, + particleHypo); // create a new ISF particle representing the given particle at the extrapolated position ISFParticle *extrapolatedParticle = new ISFParticle( extrapolatedPars->position(), diff --git a/TestBeam/TBRec/src/TBExtrapolTrackToCaloTool.cxx b/TestBeam/TBRec/src/TBExtrapolTrackToCaloTool.cxx index e61e2f9d850..8532092aa38 100644 --- a/TestBeam/TBRec/src/TBExtrapolTrackToCaloTool.cxx +++ b/TestBeam/TBRec/src/TBExtrapolTrackToCaloTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // *************************************************************************** @@ -442,9 +442,11 @@ TBExtrapolTrackToCaloTool::extrapolate(const Trk::TrackParameters* parm, << (*surf)); // for the moment use nonInteracting to avoid the navigation - param = m_extrapolator->extrapolate( *parm, *surf, - Trk::alongMomentum, - true, Trk::nonInteracting); + param = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *parm, *surf, + Trk::alongMomentum, + true, Trk::nonInteracting); if (param) ATH_MSG_DEBUG ("Propagation successful "); @@ -475,9 +477,11 @@ TBExtrapolTrackToCaloTool::extrapolate(const Trk::Track* trk, ATH_MSG_DEBUG ("Trying to propagate to Surface ... " << (*surf) ); - param = m_extrapolator->extrapolate( *trk, *surf, - Trk::alongMomentum, - true, Trk::nonInteracting); + param = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *trk, *surf, + Trk::alongMomentum, + true, Trk::nonInteracting); // the other way to do it: // @@ -498,6 +502,7 @@ TBExtrapolTrackToCaloTool::extrapolate(const Trk::Track* trk, Amg::Vector3D TBExtrapolTrackToCaloTool::getMomentumAtVertex(const xAOD::Vertex& vertex, bool /*reuse*/) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); Amg::Vector3D momentum(0., 0., 0.); if (vertex.vxTrackAtVertexAvailable()) { @@ -538,7 +543,7 @@ Amg::Vector3D TBExtrapolTrackToCaloTool::getMomentumAtVertex(const xAOD::Vertex& ATH_MSG_WARNING("NULL pointer to TrackParticle in vertex"); continue; } - const Trk::TrackParameters* params = m_extrapolator->extrapolate(*tp, *surface, Trk::alongMomentum); + const Trk::TrackParameters* params = m_extrapolator->extrapolate(ctx, *tp, *surface, Trk::alongMomentum); if (!params) ATH_MSG_DEBUG("Extrapolation to vertex (perigee) failed"); else diff --git a/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx b/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx index c8a09290def..c7435b6e230 100644 --- a/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx +++ b/Tracking/TrkAlignment/TrkAlignGenTools/src/BeamspotVertexPreProcessor.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkAlignGenTools/BeamspotVertexPreProcessor.h" @@ -403,6 +403,7 @@ const xAOD::Vertex* BeamspotVertexPreProcessor::findVertexCandidate(const Track* const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Track* track, const xAOD::Vertex* &vtx) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); const VertexOnTrack * vot = nullptr; const xAOD::Vertex* tmpVtx = nullptr; const xAOD::Vertex* updatedVtx = nullptr; @@ -438,7 +439,7 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac const PerigeeSurface* surface = new PerigeeSurface(globPos); - const Perigee * perigee = dynamic_cast(m_extrapolator->extrapolate(*track, *surface)); + const Perigee * perigee = dynamic_cast(m_extrapolator->extrapolate(ctx,*track, *surface)); if (!perigee) { const Perigee * trackPerigee = track->perigeeParameters(); if ( trackPerigee && trackPerigee->associatedSurface() == *surface ) @@ -514,8 +515,9 @@ const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromVertex(const Trac const VertexOnTrack* BeamspotVertexPreProcessor::provideVotFromBeamspot(const Track* track) const{ + const EventContext& ctx = Gaudi::Hive::currentContext(); const VertexOnTrack * vot = nullptr; - SG::ReadCondHandle beamSpotHandle { m_beamSpotKey }; + SG::ReadCondHandle beamSpotHandle { m_beamSpotKey, ctx }; Amg::Vector3D bpos = beamSpotHandle->beamPos(); ATH_MSG_DEBUG("beam spot: "<(m_extrapolator->extrapolate(*track, *surface)); + const Perigee * perigee = dynamic_cast(m_extrapolator->extrapolate(ctx, *track, *surface)); if (!perigee) { const Perigee * trackPerigee = track->perigeeParameters(); if ( trackPerigee && trackPerigee->associatedSurface() == *surface ) @@ -626,9 +628,14 @@ void BeamspotVertexPreProcessor::provideVtxBeamspot(const AlignVertex* b, AmgSym ATH_MSG_DEBUG("VTX constraint size (x,y,z) = ( "<< beamSigmaX <<" , "<< beamSigmaY <<" , "<< beamSigmaZ <<" )"); } - -const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandle& fitter, const Track* track, const VertexOnTrack* vot, const ParticleHypothesis& particleHypothesis) const{ - +const Track* +BeamspotVertexPreProcessor::doConstraintRefit( + ToolHandle& fitter, + const Track* track, + const VertexOnTrack* vot, + const ParticleHypothesis& particleHypothesis) const +{ + const EventContext& ctx = Gaudi::Hive::currentContext(); const Track* newTrack = nullptr; if(vot){ @@ -644,14 +651,14 @@ const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandleassociatedSurface(); ATH_MSG_DEBUG(" Track reference surface will be: " << surface); - const TrackParameters* parsATvertex=m_extrapolator->extrapolate(*track, surface); + const TrackParameters* parsATvertex=m_extrapolator->extrapolate(ctx, *track, surface); ATH_MSG_DEBUG(" Track will be refitted at this surface "); - newTrack = (fitter->fit(Gaudi::Hive::currentContext(),measurementCollection, + newTrack = (fitter->fit(ctx, measurementCollection, *parsATvertex, m_runOutlierRemoval, particleHypothesis)).release(); delete parsATvertex; } else { - newTrack = (fitter->fit(Gaudi::Hive::currentContext(), + newTrack = (fitter->fit(ctx, measurementCollection, *(track->trackParameters()->front()), m_runOutlierRemoval, particleHypothesis)).release(); } @@ -661,7 +668,6 @@ const Track* BeamspotVertexPreProcessor::doConstraintRefit(ToolHandletrackingGeometry(); @@ -201,7 +201,8 @@ StatusCode Trk::CETmaterial::execute() m_msentry = m_trackingGeometry->trackingVolume("Calo::Containers::Calorimeter"); } if (m_msentry) { - const Trk::TrackParameters* msEntry = m_extrapolator->extrapolateToVolume(*currPar,*m_msentry,Trk::alongMomentum, + const Trk::TrackParameters* msEntry = m_extrapolator->extrapolateToVolume(ctx, + *currPar,*m_msentry,Trk::alongMomentum, (Trk::ParticleHypothesis)m_particleType); if (msEntry) { printMat(theta,phi, @@ -209,11 +210,12 @@ StatusCode Trk::CETmaterial::execute() Amg::error(msEntry->covariance()->inverse().eval(),Trk::theta), Amg::error(msEntry->covariance()->inverse().eval(),Trk::phi)); - const std::vector* mmsentry = m_extrapolator->extrapolateM(*currPar, - msEntry->associatedSurface(), - Trk::alongMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); + const std::vector* mmsentry = m_extrapolator->extrapolateM(ctx, + *currPar, + msEntry->associatedSurface(), + Trk::alongMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); if (mmsentry ) { for (unsigned int i=0; i< mmsentry->size(); i++) if ((*mmsentry)[i]) @@ -221,7 +223,8 @@ StatusCode Trk::CETmaterial::execute() << (*mmsentry)[i]->trackParameters()->momentum().mag()-currPar->momentum().mag()); currPar = (mmsentry->back()) ? mmsentry->back()->trackParameters() : msEntry; - const std::vector* peri = m_extrapolator->extrapolateM(*currPar, + const std::vector* peri = m_extrapolator->extrapolateM(ctx, + *currPar, pSf, Trk::oppositeMomentum, false, @@ -263,7 +266,9 @@ StatusCode Trk::CETmaterial::execute() if (m_checkStepWise) { double matApp = 0.; while (currPar) { - std::pair next = m_extrapolator->extrapolateToNextActiveLayerM(*currPar, + std::pair next = m_extrapolator->extrapolateToNextActiveLayerM( + ctx, + *currPar, Trk::alongMomentum, true, material, @@ -276,7 +281,9 @@ StatusCode Trk::CETmaterial::execute() if (m_doprecision && precPar && currPar ) { // try to extrapolate to the same surface - const std::vector* nextPrec = m_extraprec->extrapolateM(*precPar,currPar->associatedSurface(), + const std::vector* nextPrec = m_extraprec->extrapolateM( + ctx, + *precPar,currPar->associatedSurface(), Trk::alongMomentum, false, (Trk::ParticleHypothesis)m_particleType); @@ -330,7 +337,9 @@ StatusCode Trk::CETmaterial::execute() printMat(theta,phi,mat); } } else { - const std::vector* destParameters = m_extrapolator->extrapolateM(*currPar, + const std::vector* destParameters = m_extrapolator->extrapolateM( + ctx, + *currPar, *m_outerBoundary, Trk::alongMomentum, false, @@ -370,7 +379,8 @@ StatusCode Trk::CETmaterial::execute() if (m_backward) { material.clear(); - const std::vector* peri = m_extrapolator->extrapolateM(*(destParameters->back()->trackParameters()), + const std::vector* peri = m_extrapolator->extrapolateM( + ctx, *(destParameters->back()->trackParameters()), pSf, Trk::oppositeMomentum, false, diff --git a/Tracking/TrkExtrapolation/TrkExAlgs/src/CombinedExtrapolatorTest.cxx b/Tracking/TrkExtrapolation/TrkExAlgs/src/CombinedExtrapolatorTest.cxx index eb8e6ced509..281fb846f95 100755 --- a/Tracking/TrkExtrapolation/TrkExAlgs/src/CombinedExtrapolatorTest.cxx +++ b/Tracking/TrkExtrapolation/TrkExAlgs/src/CombinedExtrapolatorTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -91,7 +91,7 @@ StatusCode Trk::CombinedExtrapolatorTest::finalize() StatusCode Trk::CombinedExtrapolatorTest::execute() { msg(MSG::INFO) << " execute()" << endmsg; - + const EventContext& ctx = Gaudi::Hive::currentContext(); // retrieve outer boundary if (!m_outerBoundary) { m_trackingGeometry = m_extrapolator->trackingGeometry(); @@ -122,10 +122,12 @@ StatusCode Trk::CombinedExtrapolatorTest::execute() const Trk::PerigeeSurface pSf = initialPerigee.associatedSurface(); - const Trk::TrackParameters* destParameters = m_extrapolator->extrapolateToVolume(*seed, - *m_outerBoundary, - Trk::alongMomentum, - (Trk::ParticleHypothesis)m_particleType); + const Trk::TrackParameters* destParameters = m_extrapolator->extrapolateToVolume( + ctx, + *seed, + *m_outerBoundary, + Trk::alongMomentum, + (Trk::ParticleHypothesis)m_particleType); if (!destParameters || !m_extrapolator->trackingGeometry()->atVolumeBoundary(destParameters->position(),m_outerBoundary,0.001) ) { msg(MSG::ERROR) << " extrapolation to outer boundary failed for input parameters: " << initialPerigee.parameters() << endmsg; @@ -135,11 +137,13 @@ StatusCode Trk::CombinedExtrapolatorTest::execute() msg(MSG::INFO) << " outer boundary reached at: " << destParameters->position().perp() <<","<position().z() << endmsg; msg(MSG::INFO) << "cov matrix:"<< destParameters->covariance() << endmsg; - const Trk::TrackParameters* peri = m_extrapolator->extrapolate(*destParameters, - pSf, - Trk::oppositeMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); + const Trk::TrackParameters* peri = m_extrapolator->extrapolate( + ctx, + *destParameters, + pSf, + Trk::oppositeMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); if ( peri) { msg(MSG::INFO) << " extrapolation to perigee:input: " << initialPerigee.parameters() << endmsg; msg(MSG::INFO) << " extrapolation to perigee:output: " << peri->parameters() << endmsg; diff --git a/Tracking/TrkExtrapolation/TrkExAlgs/src/EnergyLossExtrapolationValidation.cxx b/Tracking/TrkExtrapolation/TrkExAlgs/src/EnergyLossExtrapolationValidation.cxx index 5fdd4d3a187..2eb021e5e2a 100644 --- a/Tracking/TrkExtrapolation/TrkExAlgs/src/EnergyLossExtrapolationValidation.cxx +++ b/Tracking/TrkExtrapolation/TrkExAlgs/src/EnergyLossExtrapolationValidation.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -267,7 +267,7 @@ StatusCode Trk::EnergyLossExtrapolationValidation::finalize() StatusCode Trk::EnergyLossExtrapolationValidation::execute() { - + const EventContext& ctx = Gaudi::Hive::currentContext(); // get the overall dimensions if (!m_highestVolume){ // get TrackingGeometry and highest volume @@ -345,21 +345,24 @@ StatusCode Trk::EnergyLossExtrapolationValidation::execute() if (!m_materialCollectionValidation) { lastParameters = m_extrapolator->extrapolate( - startParameters, - *(m_theCylinders->at(0)), - Trk::alongMomentum, - true, - (Trk::ParticleHypothesis)m_particleType); + ctx, + startParameters, + *(m_theCylinders->at(0)), + Trk::alongMomentum, + true, + (Trk::ParticleHypothesis)m_particleType); } else { // material collection validation // get the vector of TrackStateOnSurfaces back const std::vector* collectedMaterial = - m_extrapolator->extrapolateM(startParameters, - *(m_theCylinders->at(0)), - Trk::alongMomentum, - true, - (Trk::ParticleHypothesis)m_particleType); + m_extrapolator->extrapolateM( + ctx, + startParameters, + *(m_theCylinders->at(0)), + Trk::alongMomentum, + true, + (Trk::ParticleHypothesis)m_particleType); // get the last one and clone it if (collectedMaterial && !collectedMaterial->empty()) { @@ -397,17 +400,19 @@ StatusCode Trk::EnergyLossExtrapolationValidation::execute() if (!m_materialCollectionValidation) { newParameters = m_extrapolator->extrapolate( - m_onion ? *lastParameters : startParameters, - *(m_theCylinders->at(lay)), - Trk::alongMomentum, - true, - (Trk::ParticleHypothesis)m_particleType); + ctx, + m_onion ? *lastParameters : startParameters, + *(m_theCylinders->at(lay)), + Trk::alongMomentum, + true, + (Trk::ParticleHypothesis)m_particleType); } else { // material collection validation // get the vector of TrackStateOnSurfaces back const std::vector* collectedMaterial = - m_extrapolator->extrapolateM(m_onion ? *lastParameters : startParameters, + m_extrapolator->extrapolateM(ctx, + m_onion ? *lastParameters : startParameters, *(m_theCylinders->at(lay)), Trk::alongMomentum, true, @@ -438,7 +443,8 @@ StatusCode Trk::EnergyLossExtrapolationValidation::execute() if (!m_materialCollectionValidation) { - newParameters = m_extrapolator->extrapolate(m_onion ? *lastParameters : startParameters, + newParameters = m_extrapolator->extrapolate(ctx, + m_onion ? *lastParameters : startParameters, (m_parameterEta[0] < 0) ? *(m_theDiscs1->at(lay)) : *(m_theDiscs2->at(lay)), Trk::alongMomentum, true, @@ -448,7 +454,8 @@ StatusCode Trk::EnergyLossExtrapolationValidation::execute() // get the vector of TrackStateOnSurfaces back const std::vector* collectedMaterial = - m_extrapolator->extrapolateM(m_onion ? *lastParameters : startParameters, + m_extrapolator->extrapolateM(ctx, + m_onion ? *lastParameters : startParameters, (m_parameterEta[0] < 0) ? *(m_theDiscs1->at(lay)) : *(m_theDiscs2->at(lay)), Trk::alongMomentum, true, diff --git a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolationValidation.cxx b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolationValidation.cxx index a154d148359..efd7e85d3c9 100755 --- a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolationValidation.cxx +++ b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolationValidation.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -203,7 +203,7 @@ StatusCode Trk::ExtrapolationValidation::finalize() StatusCode Trk::ExtrapolationValidation::execute() { - + const EventContext& ctx = Gaudi::Hive::currentContext(); // get the overall dimensions if (!m_highestVolume){ // get TrackingGeometry and highest volume @@ -325,7 +325,8 @@ StatusCode Trk::ExtrapolationValidation::execute() Amg::Transform3D CylTrf; CylTrf.setIdentity(); Trk::CylinderSurface estimationCylinder(CylTrf, m_estimationR, 10e10); - const Trk::TrackParameters* estimationParameters = m_extrapolator->extrapolateDirectly(startParameters, + const Trk::TrackParameters* estimationParameters = m_extrapolator->extrapolateDirectly(ctx, + startParameters, estimationCylinder, Trk::alongMomentum, false); @@ -392,7 +393,8 @@ StatusCode Trk::ExtrapolationValidation::execute() const Trk::TrackParameters* destParameters = nullptr; // the standard validation ... if (!m_materialCollectionValidation && !m_direct) - destParameters = m_extrapolator->extrapolate(startParameters, + destParameters = m_extrapolator->extrapolate(ctx, + startParameters, destinationSurface, Trk::alongMomentum, false, @@ -400,11 +402,12 @@ StatusCode Trk::ExtrapolationValidation::execute() else if(!m_direct){ // material collection validation // get the vector of TrackStateOnSurfaces back const std::vector* - collectedMaterial = m_extrapolator->extrapolateM(startParameters, - destinationSurface, - Trk::alongMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); + collectedMaterial = m_extrapolator->extrapolateM(ctx, + startParameters, + destinationSurface, + Trk::alongMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); // get the last one and clone it if (collectedMaterial && !collectedMaterial->empty()){ @@ -420,11 +423,12 @@ StatusCode Trk::ExtrapolationValidation::execute() } else{ - destParameters = m_extrapolator->extrapolateDirectly(startParameters, - destinationSurface, - Trk::alongMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); + destParameters = m_extrapolator->extrapolateDirectly(ctx, + startParameters, + destinationSurface, + Trk::alongMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); } // ----------------------- check if forward call was successful and continue then @@ -466,19 +470,21 @@ StatusCode Trk::ExtrapolationValidation::execute() const Trk::TrackParameters* backParameters = nullptr; // the standard validation ... if (!m_materialCollectionValidation && !m_direct) - backParameters = m_extrapolator->extrapolate(*destParameters, - startSurface, - Trk::oppositeMomentum, - false, - (Trk::ParticleHypothesis)m_particleType,Trk::removeNoise); + backParameters = m_extrapolator->extrapolate(ctx, + *destParameters, + startSurface, + Trk::oppositeMomentum, + false, + (Trk::ParticleHypothesis)m_particleType,Trk::removeNoise); else if(!m_direct){ // material collection validation // get the vector of TrackStateOnSurfaces back const std::vector* - collectedBackMaterial = m_extrapolator->extrapolateM(*destParameters, - startSurface, - Trk::oppositeMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); + collectedBackMaterial = m_extrapolator->extrapolateM(ctx, + *destParameters, + startSurface, + Trk::oppositeMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); // get the last one and clone it if (collectedBackMaterial && !collectedBackMaterial->empty()){ // get the last track state on surface & clone the destination parameters @@ -494,12 +500,13 @@ StatusCode Trk::ExtrapolationValidation::execute() } else{ - backParameters = m_extrapolator->extrapolateDirectly(*destParameters, - startSurface, - Trk::oppositeMomentum, - false, - (Trk::ParticleHypothesis)m_particleType); - + backParameters = m_extrapolator->extrapolateDirectly(ctx, + *destParameters, + startSurface, + Trk::oppositeMomentum, + false, + (Trk::ParticleHypothesis)m_particleType); + } // ----------------------- check if backward call was successful and continue then if (backParameters){ diff --git a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorComparisonTest.cxx b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorComparisonTest.cxx index 7133b752288..b663fba88fb 100644 --- a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorComparisonTest.cxx +++ b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorComparisonTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -223,11 +223,14 @@ StatusCode Trk::ExtrapolatorComparisonTest::execute(const EventContext& ctx) con ATH_MSG_VERBOSE("Starting extrapolation " << n_extraps << " from : " << *atlPerigee << " to : " << *destinationSurface); auto start_fwd = xclock::now(); - const Trk::TrackParameters* destParameters = m_atlasExtrapolator->extrapolate(*atlPerigee, - *destinationSurface, - Trk::alongMomentum, - true, - (Trk::ParticleHypothesis)m_particleType); + const Trk::TrackParameters* destParameters = + m_atlasExtrapolator->extrapolate( + ctx, + *atlPerigee, + *destinationSurface, + Trk::alongMomentum, + true, + (Trk::ParticleHypothesis)m_particleType); auto end_fwd = xclock::now(); float ms_fwd = std::chrono::duration_cast(end_fwd-start_fwd).count(); @@ -239,11 +242,14 @@ StatusCode Trk::ExtrapolatorComparisonTest::execute(const EventContext& ctx) con // now try backward extrapolation auto start_bkw = xclock::now(); - const Trk::TrackParameters* finalperigee = m_atlasExtrapolator->extrapolate(*destParameters, - atlPerigee->associatedSurface(), - Trk::oppositeMomentum, - true, - (Trk::ParticleHypothesis)m_particleType); + const Trk::TrackParameters* finalperigee = + m_atlasExtrapolator->extrapolate( + ctx, + *destParameters, + atlPerigee->associatedSurface(), + Trk::oppositeMomentum, + true, + (Trk::ParticleHypothesis)m_particleType); auto end_bkw = xclock::now(); float ms_bkw = std::chrono::duration_cast(end_bkw-start_bkw).count(); diff --git a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorTest.cxx b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorTest.cxx index 91ef39cc2ca..f74ffe54807 100755 --- a/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorTest.cxx +++ b/Tracking/TrkExtrapolation/TrkExAlgs/src/ExtrapolatorTest.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -194,29 +194,34 @@ void Trk::ExtrapolatorTest::runTest( const Trk::Perigee& initialPerigee ) { double theta = initialPerigee.parameters()[Trk::theta]; - + const EventContext& ctx = Gaudi::Hive::currentContext(); for (int refSurface = 0 ; surfaceTripleIter != surfaceTripleIterEnd; ++surfaceTripleIter, ++negRefIter, ++posRefIter ){ // decide which reference surface to take refSurface = theta < (*posRefIter) ? 2 : 1; refSurface = theta > (*negRefIter) ? 0 : 1; const Trk::Surface* destinationSurface = (*surfaceTripleIter)[refSurface]; - - const auto *destParameters = m_useExtrapolator ? - m_extrapolator->extrapolate(initialPerigee, - *destinationSurface, - propagationDirection, - false, - (Trk::ParticleHypothesis)m_particleType) : - - m_propagator->propagate( - Gaudi::Hive::currentContext(), - initialPerigee, - *destinationSurface, - propagationDirection, - false, - *m_magFieldProperties, - (Trk::ParticleHypothesis)m_particleType).release(); + + const auto* destParameters = + m_useExtrapolator + ? m_extrapolator->extrapolate( + ctx, + initialPerigee, + *destinationSurface, + propagationDirection, + false, + (Trk::ParticleHypothesis)m_particleType) + : + + m_propagator + ->propagate(ctx, + initialPerigee, + *destinationSurface, + propagationDirection, + false, + *m_magFieldProperties, + (Trk::ParticleHypothesis)m_particleType) + .release(); if (destParameters) { // global position parameter diff --git a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h b/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h index f25ad41e799..df9a25c2204 100755 --- a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h +++ b/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h @@ -10,422 +10,278 @@ #define TRKEXINTERFACES_IEXTRAPOLATOR_H // Gaudi -#include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/EventContext.h" +#include "GaudiKernel/IAlgTool.h" #include "GaudiKernel/ThreadLocalContext.h" // Trk -#include "TrkEventPrimitives/PropDirection.h" #include "TrkEventPrimitives/ParticleHypothesis.h" -#include "TrkMaterialOnTrack/MaterialEffectsOnTrack.h" -#include "TrkExUtils/MaterialUpdateMode.h" +#include "TrkEventPrimitives/PropDirection.h" #include "TrkExUtils/ExtrapolationCache.h" -#include "TrkSurfaces/BoundaryCheck.h" -#include "TrkParameters/TrackParameters.h" +#include "TrkExUtils/MaterialUpdateMode.h" +#include "TrkMaterialOnTrack/MaterialEffectsOnTrack.h" #include "TrkNeutralParameters/NeutralParameters.h" +#include "TrkParameters/TrackParameters.h" #include "TrkParametersBase/ParametersBase.h" +#include "TrkSurfaces/BoundaryCheck.h" // xAOD -#include "xAODTracking/TrackParticle.h" #include "xAODTracking/NeutralParticle.h" +#include "xAODTracking/TrackParticle.h" // STL #include - namespace Trk { - - static const InterfaceID IID_IExtrapolator("IExtrapolator", 1, 0); - - /** - @class IExtrapolator - Interface class for the extrapolation AlgTool, it inherits from IAlgTool - Detailed information about private members and member functions can be found in the actual implementation class - Extrapolator which inherits from this one. - - @author Andreas.Salzburger@cern.ch + +static const InterfaceID IID_IExtrapolator("IExtrapolator", 1, 0); + +/** + @class IExtrapolator + Interface class for the extrapolation AlgTool, it inherits from IAlgTool + Detailed information about private members and member functions can be found in + the actual implementation class Extrapolator which inherits from this one. + + @author Andreas.Salzburger@cern.ch + */ + +class IPropagator; +class INavigator; +class IMaterialUpdater; +class Track; +class Surface; +class TrackingVolume; +class TrackingGeometry; +class TransportJacobian; +class TrackStateOnSurface; +class Layer; +class Volume; + +class IExtrapolator : virtual public IAlgTool +{ +public: + /** Virtual destructor */ + virtual ~IExtrapolator() {} + + /** AlgTool interface methods */ + static const InterfaceID& interfaceID() { return IID_IExtrapolator; } + + /** [xAOD interface ] */ + + /** xAOD 0) neutral xAOD particle */ + virtual const NeutralParameters* extrapolate( + const xAOD::NeutralParticle& xnParticle, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true) const = 0; + + /** [NeutralParameters] + * ------------------------------------------------------------- */ + + /** N 0) Neutral parameters method + - returns a ParametersBase object as well, 0 if the extrapolation did not + succeed + */ + + virtual const NeutralParameters* extrapolate( + const NeutralParameters& parameters, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true) const = 0; + + /** [TrackParameters] interfaces WITH EventContext + * ------------------------------------------ */ + + /** xAOD 0) xAOD track particle */ + virtual const TrackParameters* extrapolate( + const EventContext& ctx, + const xAOD::TrackParticle& particleBase, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion, + MaterialUpdateMode matupmode = addNoise) const = 0; + + /** 1) Configured AlgTool extrapolation method): + - returns the TrackParameters at the Destination Surface (if extrapolation + succeeds), nullptr if extrapolation to destination surface does not succeed + */ + virtual const TrackParameters* extrapolate( + const EventContext& ctx, + const TrackParameters& parm, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion, + MaterialUpdateMode matupmode = addNoise, + Trk::ExtrapolationCache* cache = nullptr) const = 0; + + /** 2) Configured AlgTool extrapolation method): + - returns a vector of TrackParameters representing the tracking detector + elements hit in between and the TrackParameters at the destination Surface + (if final extrapolation suceeds), empty if the extrapolation to the + destination surface does not suceed*/ + virtual std::vector> + extrapolateStepwise(const EventContext& ctx, + const TrackParameters& parm, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion) const = 0; + + /** 3) Configured AlgTool extrapolation method): + - searches the closest TrackParameters of the Track to the destination + Surface + - returns the TrackParameters at the Destination Surface (if extrapolation + succeeds), 0 if extrapolation to destination surface does not suceed */ + virtual const TrackParameters* extrapolate( + const EventContext& ctx, + const Track& trk, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion, + MaterialUpdateMode matupmode = addNoise, + Trk::ExtrapolationCache* cache = nullptr) const = 0; + + /** 4) Configured AlgTool extrapolation method): + - direct extrapolation to the destination surface, no material effects + or intermediate steps are taken into account + */ + virtual TrackParameters* extrapolateDirectly( + const EventContext& ctx, + const TrackParameters& parm, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion) const = 0; + + /** 4.1) Configured AlgTool extrapolation method): + Same as 4 but with propagator arguement (needed by a single client + TRT_TrackExtensionToolCosmics + */ + virtual TrackParameters* extrapolateDirectly( + const EventContext& ctx, + const IPropagator& prop, + const TrackParameters& parm, + const Surface& sf, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion) const = 0; + + /** 5) Configured AlgTool extrapolation method): + - blind inside the given tracking Volume (boundaryVol), + if none is given the reference surface for destination is used */ - - class IPropagator; - class INavigator; - class IMaterialUpdater; - class Track; - class Surface; - class TrackingVolume; - class TrackingGeometry; - class TransportJacobian; - class TrackStateOnSurface; - class Layer; - class Volume; - - class IExtrapolator : virtual public IAlgTool { - public: - - /** Virtual destructor */ - virtual ~IExtrapolator(){} - - /** AlgTool interface methods */ - static const InterfaceID& interfaceID() { return IID_IExtrapolator; } - - /** [xAOD interface ] */ - - /** xAOD 0) neutral xAOD particle */ - virtual const NeutralParameters* extrapolate(const xAOD::NeutralParticle& xnParticle, - const Surface& sf, - PropDirection dir=anyDirection, - const BoundaryCheck& bcheck = true) const = 0; - - - - /** [NeutralParameters] ------------------------------------------------------------- */ - - /** N 0) Neutral parameters method - - returns a ParametersBase object as well, 0 if the extrapolation did not succeed - */ - - virtual const NeutralParameters* extrapolate(const NeutralParameters& parameters, - const Surface& sf, - PropDirection dir=anyDirection, - const BoundaryCheck& bcheck = true) const = 0; - - - /** [TrackParameters] interfaces WITH EventContext ------------------------------------------ */ - - - /** xAOD 0) xAOD track particle */ - virtual const TrackParameters* extrapolate(const EventContext& ctx, - const xAOD::TrackParticle& particleBase, - const Surface& sf, - PropDirection dir=anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle=pion, - MaterialUpdateMode matupmode=addNoise) const = 0; - - - - /** 1) Configured AlgTool extrapolation method): - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - nullptr if extrapolation to destination surface does not succeed */ - virtual const TrackParameters* extrapolate(const EventContext& ctx, - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise, - Trk::ExtrapolationCache* cache = nullptr) const = 0; - - /** 2) Configured AlgTool extrapolation method): - - returns a vector of TrackParameters representing the tracking detector elements - hit in between and the TrackParameters at the destination Surface (if final extrapolation suceeds), - empty if the extrapolation to the destination surface does not suceed*/ - virtual std::vector> extrapolateStepwise( - const EventContext& ctx, - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const = 0; - - /** 3) Configured AlgTool extrapolation method): - - searches the closest TrackParameters of the Track to the destination Surface - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - 0 if extrapolation to destination surface does not suceed */ - virtual const TrackParameters* extrapolate(const EventContext& ctx, - const Track& trk, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise, - Trk::ExtrapolationCache* cache = nullptr) const = 0; - - /** 4) Configured AlgTool extrapolation method): - - direct extrapolation to the destination surface, no material effects - or intermediate steps are taken into account - */ - virtual TrackParameters* extrapolateDirectly(const EventContext& ctx, - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const = 0; - - /** 4.1) Configured AlgTool extrapolation method): - Same as 4 but with propagator arguement (needed by a single client TRT_TrackExtensionToolCosmics - */ - virtual TrackParameters* extrapolateDirectly(const EventContext& ctx, - const IPropagator& prop, - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const = 0; - - /** 5) Configured AlgTool extrapolation method): - - blind inside the given tracking Volume (boundaryVol), - if none is given the reference surface for destination is used - */ - virtual std::vector> extrapolateBlindly( - const EventContext& ctx, - const TrackParameters& parm, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - const Volume* boundaryVol = nullptr) const = 0; - - /** 6) Configured AlgTool extrapolation method): - *- extrapolation to the next active layer, based on the extrapolation to the next layer - and layer identification*/ - virtual std::pair extrapolateToNextActiveLayer( - const EventContext& ctx, - const TrackParameters& parm, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise) const = 0; - - /** 7) Configured AlgTool extrapolation method):*/ - virtual std::pair extrapolateToNextActiveLayerM( - const EventContext& ctx, - const TrackParameters& parm, - PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise) const = 0; - - /** 8) Configured AlgTool extrapolation method ): - - extrapolation to the next active layer, based on the extrapolation to the next layer - and layer identification - * */ - virtual const TrackParameters* extrapolateToVolume(const EventContext& ctx, - const TrackParameters& parm, - const Trk::TrackingVolume& vol, - PropDirection dir = anyDirection, - ParticleHypothesis particle = pion) const = 0; - - /** 9) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers in between. - */ - virtual std::vector* extrapolateM(const EventContext& ctx, - const TrackParameters& parameters, - const Surface& sf, - PropDirection dir, - const BoundaryCheck& bcheck, - ParticleHypothesis particle = pion, - Trk::ExtrapolationCache* cache = nullptr) const = 0; - - /** 10) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers and transport jacobians in - between. - */ - virtual std::vector* extrapolateM(const EventContext& ctx, - const TrackParameters& parameters, - const Surface& sf, - PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - std::vector& jacs, - ParticleHypothesis particle = pion, - Trk::ExtrapolationCache* cache = nullptr) const = 0; - - virtual const Trk::TrackParameters* extrapolateWithPathLimit( - const EventContext& ctx, - const Trk::TrackParameters& parm, - double& pathLim, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& parmOnSf, - std::vector*& material, - const Trk::TrackingVolume* boundaryVol = nullptr, - MaterialUpdateMode matupmod = Trk::addNoise) const = 0; - - /** extrapolation method collecting intersections with subdetector boundaries and active volumes/layers. - A primitive identification is provided - to be replaced with appropriate identifier, and possibly merged - with TrackParameters. Material collection in option. Destination (subdetector boundary) : geoID (exit) - */ - virtual const std::vector>* extrapolate( - const EventContext& ctx, - const Trk::TrackParameters& parm, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& material, - int destination = 3) const = 0; - - /** Return the TrackingGeometry used by the Extrapolator (forwards information from Navigator) */ - virtual const TrackingGeometry* trackingGeometry() const = 0; - - /** Validation Action: - Can be implemented optionally, outside access to internal validation steps - */ - virtual void validationAction() const = 0; - - /** Access the subPropagator to the given volume*/ - virtual const IPropagator* subPropagator(const TrackingVolume& tvol) const = 0; - - - /** [TrackParameters] old interfaces WITHOUT EventContext - * Implemented here in terms of the new ones - * so need to be re-implemented - **/ - - /** xAOD 0) xAOD track particle */ - const TrackParameters* extrapolate( - const xAOD::TrackParticle& particleBase, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise) const; - - /** 1) Configured AlgTool extrapolation method): - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - nullptr if extrapolation to destination surface does not succeed */ - const TrackParameters* extrapolate( - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise, - Trk::ExtrapolationCache* cache = nullptr) const; - - /** 2) Configured AlgTool extrapolation method): - - returns a vector of TrackParameters representing the tracking detector elements - hit in between and the TrackParameters at the destination Surface (if final extrapolation suceeds), - empty if the extrapolation to the destination surface does not suceed*/ - std::vector> extrapolateStepwise( - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const; - - /** 3) Configured AlgTool extrapolation method): - - searches the closest TrackParameters of the Track to the destination Surface - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - 0 if extrapolation to destination surface does not suceed */ - const TrackParameters* extrapolate( - const Track& trk, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise, - Trk::ExtrapolationCache* cache = nullptr) const; - - /** 4) Configured AlgTool extrapolation method): - - direct extrapolation to the destination surface, no material effects - or intermediate steps are taken into account - */ - TrackParameters* extrapolateDirectly( - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const; - - /** 4.1) Configured AlgTool extrapolation method): - Same as 4 but with propagator arguement (needed by a single client TRT_TrackExtensionToolCosmics - */ - TrackParameters* extrapolateDirectly( - const IPropagator& prop, - const TrackParameters& parm, - const Surface& sf, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion) const; - - /** 5) Configured AlgTool extrapolation method): - - blind inside the given tracking Volume (boundaryVol), - if none is given the reference surface for destination is used - */ - std::vector> extrapolateBlindly( - const TrackParameters& parm, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - const Volume* boundaryVol = 0) const; - - /** 6) Configured AlgTool extrapolation method): - *- extrapolation to the next active layer, based on the extrapolation to the next layer - and layer identification*/ - std::pair - extrapolateToNextActiveLayer( - const TrackParameters& parm, - PropDirection dir = anyDirection, - const BoundaryCheck& bcheck = true, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise) const; - - /** 7) Configured AlgTool extrapolation method):*/ - std::pair - extrapolateToNextActiveLayerM( - const TrackParameters& parm, - PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - ParticleHypothesis particle = pion, - MaterialUpdateMode matupmode = addNoise) const; - - /** 8) Configured AlgTool extrapolation method ): - - extrapolation to the next active layer, based on the extrapolation to - the next layer and layer identification - * */ - const TrackParameters* extrapolateToVolume( - const TrackParameters& parm, - const Trk::TrackingVolume& vol, - PropDirection dir = anyDirection, - ParticleHypothesis particle = pion) const; - - /** 9) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers in between. - */ - std::vector* extrapolateM( - const TrackParameters& parameters, - const Surface& sf, - PropDirection dir, - const BoundaryCheck& bcheck, - ParticleHypothesis particle = pion, - Trk::ExtrapolationCache* cache = nullptr) const; - - /** 10) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers and transport jacobians in - between. - */ - std::vector* extrapolateM( - const TrackParameters& parameters, - const Surface& sf, - PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - std::vector& jacs, - ParticleHypothesis particle = pion, - Trk::ExtrapolationCache* cache = nullptr) const; - - const Trk::TrackParameters* extrapolateWithPathLimit( - const Trk::TrackParameters& parm, - double& pathLim, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& parmOnSf, - std::vector*& material, - const Trk::TrackingVolume* boundaryVol = 0, - MaterialUpdateMode matupmod = Trk::addNoise) const; - - /** extrapolation method collecting intersections with subdetector boundaries and active volumes/layers. - A primitive identification is provided - to be replaced with appropriate identifier, and possibly merged - with TrackParameters. Material collection in option. Destination (subdetector boundary) : geoID (exit) - */ - const std::vector>* - extrapolate(const Trk::TrackParameters& parm, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& material, - int destination = 3) const; - }; + virtual std::vector> + extrapolateBlindly(const EventContext& ctx, + const TrackParameters& parm, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion, + const Volume* boundaryVol = nullptr) const = 0; + + /** 6) Configured AlgTool extrapolation method): + *- extrapolation to the next active layer, based on the extrapolation to the + next layer and layer identification*/ + virtual std::pair + extrapolateToNextActiveLayer( + const EventContext& ctx, + const TrackParameters& parm, + PropDirection dir = anyDirection, + const BoundaryCheck& bcheck = true, + ParticleHypothesis particle = pion, + MaterialUpdateMode matupmode = addNoise) const = 0; + + /** 7) Configured AlgTool extrapolation method):*/ + virtual std::pair + extrapolateToNextActiveLayerM( + const EventContext& ctx, + const TrackParameters& parm, + PropDirection dir, + const BoundaryCheck& bcheck, + std::vector& material, + ParticleHypothesis particle = pion, + MaterialUpdateMode matupmode = addNoise) const = 0; + + /** 8) Configured AlgTool extrapolation method ): + - extrapolation to the next active layer, based on the extrapolation to the + next layer and layer identification + * */ + virtual const TrackParameters* extrapolateToVolume( + const EventContext& ctx, + const TrackParameters& parm, + const Trk::TrackingVolume& vol, + PropDirection dir = anyDirection, + ParticleHypothesis particle = pion) const = 0; + + /** 9) Configured AlgTool extrapolation method: + - Extrapolate to a destination surface, while collecting all the material + layers in between. + */ + virtual std::vector* extrapolateM( + const EventContext& ctx, + const TrackParameters& parameters, + const Surface& sf, + PropDirection dir, + const BoundaryCheck& bcheck, + ParticleHypothesis particle = pion, + Trk::ExtrapolationCache* cache = nullptr) const = 0; + + /** 10) Configured AlgTool extrapolation method: + - Extrapolate to a destination surface, while collecting all the material + layers and transport jacobians in between. + */ + virtual std::vector* extrapolateM( + const EventContext& ctx, + const TrackParameters& parameters, + const Surface& sf, + PropDirection dir, + const BoundaryCheck& bcheck, + std::vector& material, + std::vector& jacs, + ParticleHypothesis particle = pion, + Trk::ExtrapolationCache* cache = nullptr) const = 0; + + virtual const Trk::TrackParameters* extrapolateWithPathLimit( + const EventContext& ctx, + const Trk::TrackParameters& parm, + double& pathLim, + Trk::PropDirection dir, + Trk::ParticleHypothesis particle, + std::vector*& parmOnSf, + std::vector*& material, + const Trk::TrackingVolume* boundaryVol = nullptr, + MaterialUpdateMode matupmod = Trk::addNoise) const = 0; + + /** extrapolation method collecting intersections with subdetector boundaries + and active volumes/layers. A primitive identification is provided - to be + replaced with appropriate identifier, and possibly merged with + TrackParameters. Material collection in option. Destination (subdetector + boundary) : geoID (exit) + */ + virtual const std::vector>* + extrapolate(const EventContext& ctx, + const Trk::TrackParameters& parm, + Trk::PropDirection dir, + Trk::ParticleHypothesis particle, + std::vector*& material, + int destination = 3) const = 0; + + /** Return the TrackingGeometry used by the Extrapolator (forwards information + * from Navigator) */ + virtual const TrackingGeometry* trackingGeometry() const = 0; + + /** Validation Action: + Can be implemented optionally, outside access to internal validation steps + */ + virtual void validationAction() const = 0; + + /** Access the subPropagator to the given volume*/ + virtual const IPropagator* subPropagator( + const TrackingVolume& tvol) const = 0; + +}; } // end of namespace -#include "TrkExInterfaces/IExtrapolator.icc" #endif // TRKEXINTERFACES_ITRKEXTRAPOLATOR_H diff --git a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.icc b/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.icc deleted file mode 100644 index 476231316df..00000000000 --- a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.icc +++ /dev/null @@ -1,319 +0,0 @@ -/* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration -*/ - -/////////////////////////////////////////////////////////////////// -// IExtrapolator.icc, (c) ATLAS Detector software -/////////////////////////////////////////////////////////////////// - -/** Implement old interfaces WITHOUT EventContext ------------------------------------------ */ - - -/** xAOD 0) xAOD track particle */ -inline const Trk::TrackParameters* -Trk::IExtrapolator::extrapolate(const xAOD::TrackParticle& particleBase, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - Trk::MaterialUpdateMode matupmode) const -{ - return extrapolate( Gaudi::Hive::currentContext(), - particleBase, - sf, - dir, - bcheck, - particle, - matupmode); -} - - - - -/** 1) Configured AlgTool extrapolation method): - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - nullptr if extrapolation to destination surface does not succeed */ -inline const Trk::TrackParameters* -Trk::IExtrapolator::extrapolate(const TrackParameters& parm, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - Trk::MaterialUpdateMode matupmode, - Trk::ExtrapolationCache* cache) const -{ - return extrapolate( Gaudi::Hive::currentContext(), - parm, - sf, - dir, - bcheck, - particle, - matupmode, - cache); -} - - -/** 2) Configured AlgTool extrapolation method): - - returns a vector of TrackParameters representing the tracking detector elements - hit in between and the TrackParameters at the destination Surface (if final extrapolation suceeds), - empty if the extrapolation to the destination surface does not suceed*/ -inline std::vector> Trk::IExtrapolator::extrapolateStepwise( - const TrackParameters& parm, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle) const -{ - return extrapolateStepwise(Gaudi::Hive::currentContext(), - parm, - sf, - dir, - bcheck, - particle); -} - -/** 3) Configured AlgTool extrapolation method): - - searches the closest TrackParameters of the Track to the destination Surface - - returns the TrackParameters at the Destination Surface (if extrapolation succeeds), - 0 if extrapolation to destination surface does not suceed */ -inline const Trk::TrackParameters* Trk::IExtrapolator::extrapolate(const Track& trk, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - Trk::MaterialUpdateMode matupmode, - Trk::ExtrapolationCache* cache) const -{ - return extrapolate(Gaudi::Hive::currentContext(), - trk, - sf, - dir, - bcheck, - particle, - matupmode, - cache); -} - -/** 4) Configured AlgTool extrapolation method): - - direct extrapolation to the destination surface, no material effects - or intermediate steps are taken into account -*/ -inline Trk::TrackParameters* Trk::IExtrapolator::extrapolateDirectly(const TrackParameters& parm, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle) const -{ - return extrapolateDirectly(Gaudi::Hive::currentContext(), - parm, - sf, - dir, - bcheck, - particle); -} - -/** 4.1) Configured AlgTool extrapolation method): - Same as 4 but with propagator arguement (needed by a single client TRT_TrackExtensionToolCosmics -*/ -inline Trk::TrackParameters* Trk::IExtrapolator::extrapolateDirectly(const IPropagator& prop, - const TrackParameters& parm, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle) const -{ - return extrapolateDirectly(Gaudi::Hive::currentContext(), - prop, - parm, - sf, - dir, - bcheck, - particle); -} - -/** 5) Configured AlgTool extrapolation method): - - blind inside the given tracking Volume (boundaryVol), - if none is given the reference surface for destination is used -*/ -inline std::vector> Trk::IExtrapolator::extrapolateBlindly( - const TrackParameters& parm, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - const Volume* boundaryVol) const -{ - return extrapolateBlindly(Gaudi::Hive::currentContext(), - parm, - dir, - bcheck, - particle, - boundaryVol); -} - -/** 6) Configured AlgTool extrapolation method): - *- extrapolation to the next active layer, based on the extrapolation to the next layer - and layer identification*/ -inline std::pair Trk::IExtrapolator::extrapolateToNextActiveLayer( - const TrackParameters& parm, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - Trk::MaterialUpdateMode matupmode) const -{ - return extrapolateToNextActiveLayer(Gaudi::Hive::currentContext(), - parm, - dir, - bcheck, - particle, - matupmode); -} - -/** 7) Configured AlgTool extrapolation method):*/ -inline std::pair Trk::IExtrapolator::extrapolateToNextActiveLayerM( - const TrackParameters& parm, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - Trk::ParticleHypothesis particle, - Trk::MaterialUpdateMode matupmode) const -{ - return extrapolateToNextActiveLayerM(Gaudi::Hive::currentContext(), - parm, - dir, - bcheck, - material, - particle, - matupmode); -} - -/** 8) Configured AlgTool extrapolation method ): - - extrapolation to the next active layer, based on the extrapolation to the next layer - and layer identification - * */ -inline const Trk::TrackParameters* Trk::IExtrapolator::extrapolateToVolume(const TrackParameters& parm, - const Trk::TrackingVolume& vol, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle) const -{ - return extrapolateToVolume(Gaudi::Hive::currentContext(), - parm, - vol, - dir, - particle); -} - -/** 9) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers in between. -*/ -inline std::vector* Trk::IExtrapolator::extrapolateM(const TrackParameters& parameters, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - Trk::ParticleHypothesis particle, - Trk::ExtrapolationCache* cache) const -{ - return extrapolateM(Gaudi::Hive::currentContext(), - parameters, - sf, - dir, - bcheck, - particle, - cache); -} - -/** 10) Configured AlgTool extrapolation method: - - Extrapolate to a destination surface, while collecting all the material layers and transport jacobians in - between. -*/ -inline std::vector* Trk::IExtrapolator::extrapolateM(const TrackParameters& parameters, - const Trk::Surface& sf, - Trk::PropDirection dir, - const BoundaryCheck& bcheck, - std::vector& material, - std::vector& jacs, - Trk::ParticleHypothesis particle, - Trk::ExtrapolationCache* cache) const -{ - return extrapolateM(Gaudi::Hive::currentContext(), - parameters, - sf, - dir, - bcheck, - material, - jacs, - particle, - cache); -} - -inline const Trk::TrackParameters* Trk::IExtrapolator::extrapolateWithPathLimit( - const Trk::TrackParameters& parm, - double& pathLim, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& parmOnSf, - std::vector*& material, - const Trk::TrackingVolume* boundaryVol, - Trk::MaterialUpdateMode matupmod) const -{ - return extrapolateWithPathLimit(Gaudi::Hive::currentContext(), - parm, - pathLim, - dir, - particle, - parmOnSf, - material, - boundaryVol, - matupmod); -} - -/** extrapolation method collecting intersections with subdetector boundaries and active volumes/layers. - A primitive identification is provided - to be replaced with appropriate identifier, and possibly merged - with TrackParameters. Material collection in option. Destination (subdetector boundary) : geoID (exit) -*/ -inline const std::vector>* Trk::IExtrapolator::extrapolate( - const Trk::TrackParameters& parm, - Trk::PropDirection dir, - Trk::ParticleHypothesis particle, - std::vector*& material, - int destination) const -{ - return extrapolate(Gaudi::Hive::currentContext(), - parm, - dir, - particle, - material, - destination); -} - - - - - - - -inline const Trk::TrackParameters* -Trk::IExtrapolator::extrapolateWithPathLimit(const EventContext& /*ctx*/, - const Trk::TrackParameters& /*parm*/, - double& /*pathLim*/, - Trk::PropDirection /*dir*/, - Trk::ParticleHypothesis /*particle*/, - std::vector*& /*parmOnSf*/, - std::vector*& /*material*/, - const Trk::TrackingVolume* /*boundaryVol*/, - Trk::MaterialUpdateMode /*matupmod*/) const -{ - std::cout << "CONFIGURATION ERROR: dummy version of extrapolation-with-path-limit method called " << std::endl; - return 0; -} - -inline const std::vector>* -Trk::IExtrapolator::extrapolate(const EventContext& /*ctx*/, - const Trk::TrackParameters& /*parm*/, - Trk::PropDirection /*dir*/, - Trk::ParticleHypothesis /*particle*/, - std::vector*& /*material*/, - int /*destination*/) const -{ - std::cout << "CONFIGURATION ERROR: dummy version of extrapolation through active regions called " << std::endl; - return 0; -} diff --git a/Tracking/TrkFitter/TrkDynamicNoiseAdjustor/src/InDetDynamicNoiseAdjustment.cxx b/Tracking/TrkFitter/TrkDynamicNoiseAdjustor/src/InDetDynamicNoiseAdjustment.cxx index 98fe72d5726..df8211e1851 100755 --- a/Tracking/TrkFitter/TrkDynamicNoiseAdjustor/src/InDetDynamicNoiseAdjustment.cxx +++ b/Tracking/TrkFitter/TrkDynamicNoiseAdjustor/src/InDetDynamicNoiseAdjustment.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -584,7 +584,7 @@ Trk::InDetDynamicNoiseAdjustment::DNA_Adjust( auto testPredPars = std::unique_ptr(m_extrapolator->extrapolate( - *updatedPar, surf, direction, false, matEff.particleType())); + state.eventContext, *updatedPar, surf, direction, false, matEff.particleType())); if (testPredPars == nullptr) { ATH_MSG_WARNING( "extrapolation for adjusted cov fails - should never happen!"); diff --git a/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx b/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx index 1fbe039426a..66171cb7121 100755 --- a/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx +++ b/Tracking/TrkFitter/TrkFitterUtils/src/TrackFitInputPreparator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -507,12 +507,12 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject prevPar = CREATE_PARAMETERS(*prevPar,prevPar->parameters(),std::nullopt).release(); } const std::vector< const Trk::TrackStateOnSurface * >* collectedTSOS = m_extrapolator->extrapolateM( - *prevPar, - measurement->associatedSurface(), - Trk::alongMomentum, - false, - partHypo - + Gaudi::Hive::currentContext(), + *prevPar, + measurement->associatedSurface(), + Trk::alongMomentum, + false, + partHypo ); if (trajectory.back().referenceParameters()->covariance()) delete prevPar; // balance CREATE_PARS from a few lines earlier if (collectedTSOS) { @@ -549,13 +549,15 @@ void Trk::TrackFitInputPreparator::insertStateIntoTrajectory(Trajectory& traject } // end if trajectory.size()>0 if (!trkPar) { /// extrapolate to first state in trajectory - trkPar = m_extrapolator->extrapolate( *initialParameters, - measurement->associatedSurface(), - Trk::alongMomentum, - false, - partHypo - - ); + trkPar = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *initialParameters, + measurement->associatedSurface(), + Trk::alongMomentum, + false, + partHypo + + ); if (!trkPar) { std::cout << "TrackFitInputPreparator: WARNING, extrapolation problem." << std::endl; } diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx index ff578baa655..fbc71a02201 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkFitterUtils/TrackFitInputPreparator.h" #include "TrkGlobalChi2Fitter/GlobalChi2Fitter.h" @@ -838,6 +838,7 @@ namespace Trk { } lastidpar.reset(m_extrapolator->extrapolateToVolume( + ctx, *firstidpar, *cache.m_caloEntrance, alongMomentum, @@ -1092,6 +1093,7 @@ namespace Trk { idscatpar = firstscatpar.get(); startPar.reset(m_extrapolator->extrapolateToVolume( + ctx, *idscatpar, *cache.m_caloEntrance, oppositeMomentum, @@ -1115,6 +1117,7 @@ namespace Trk { PlaneSurface curvlinsurf(trans); const TrackParameters *curvlinpar = m_extrapolator->extrapolateDirectly( + ctx, *startPar, curvlinsurf, Trk::oppositeMomentum, @@ -1304,6 +1307,7 @@ namespace Trk { std::unique_ptr lastidpar = nullptr; if ((firstidpar != nullptr) && (cache.m_caloEntrance != nullptr)) lastidpar.reset(m_extrapolator->extrapolateToVolume( + ctx, *firstidpar, *cache.m_caloEntrance, alongMomentum, @@ -3771,6 +3775,7 @@ namespace Trk { if (cache.m_acceleration) { if (tp == nullptr) { tp = m_extrapolator->extrapolate( + ctx, *refpar2, *state->surface(), alongMomentum, @@ -3926,6 +3931,7 @@ namespace Trk { ATH_MSG_ERROR("calo entrance not available"); } else { tmppar.reset(m_extrapolator->extrapolateToVolume( + ctx, *startmatpar1, *cache.m_caloEntrance, oppositeMomentum, @@ -3939,7 +3945,11 @@ namespace Trk { } if (matvec_used) cache.m_matTempStore.push_back( std::move(matvec) ); - matvec.reset( m_extrapolator->extrapolateM(*startmatpar1, *destsurf, oppositeMomentum, false, matEffects) ); + matvec.reset( m_extrapolator->extrapolateM(ctx, + *startmatpar1, + *destsurf, + oppositeMomentum, + false, matEffects) ); matvec_used=false; if (matvec && !matvec->empty()) { @@ -3991,6 +4001,7 @@ namespace Trk { ATH_MSG_ERROR("calo entrance not available"); } else { tmppar.reset(m_extrapolator->extrapolateToVolume( + ctx, *startmatpar2, *cache.m_caloEntrance, Trk::alongMomentum, @@ -4041,8 +4052,9 @@ namespace Trk { } if (matvec_used) cache.m_matTempStore.push_back( std::move(matvec) ); - matvec.reset( m_extrapolator->extrapolateM(*startmatpar2, *destsurf, alongMomentum, false, matEffects) ); - matvec_used=false; + matvec.reset(m_extrapolator->extrapolateM( + ctx, *startmatpar2, *destsurf, alongMomentum, false, matEffects)); + matvec_used = false; if (matvec && !matvec->empty()) { for (const auto & i : *matvec) { @@ -4233,6 +4245,7 @@ namespace Trk { ATH_MSG_ERROR("MS entrance not available"); } else if (cache.m_msEntrance->inside(lastcalopar->position())) { muonpar1.reset(m_extrapolator->extrapolateToVolume( + ctx, *lastcalopar, *cache.m_msEntrance, Trk::alongMomentum, @@ -4254,6 +4267,7 @@ namespace Trk { PlaneSurface curvlinsurf(trans); std::unique_ptr curvlinpar(m_extrapolator->extrapolateDirectly( + ctx, *muonpar1, curvlinsurf, Trk::alongMomentum, @@ -4332,8 +4346,13 @@ namespace Trk { const TrackParameters *prevtp = muonpar1.get(); ATH_MSG_DEBUG("Obtaining downstream layers from Extrapolator"); if (matvec_used) cache.m_matTempStore.push_back( std::move(matvec) ); - matvec.reset( m_extrapolator->extrapolateM(*prevtp, *states.back()->surface(), alongMomentum, false, Trk::nonInteractingMuon)); - matvec_used=false; + matvec.reset(m_extrapolator->extrapolateM(ctx, + *prevtp, + *states.back()->surface(), + alongMomentum, + false, + Trk::nonInteractingMuon)); + matvec_used = false; if (matvec && matvec->size() > 1000 && m_rejectLargeNScat) { ATH_MSG_DEBUG("too many scatterers: " << matvec->size()); @@ -4391,6 +4410,7 @@ namespace Trk { ATH_MSG_ERROR("MS entrance not available"); } else if (cache.m_msEntrance->inside(firstcalopar->position())) { muonpar1.reset(m_extrapolator->extrapolateToVolume( + ctx, *firstcalopar, *cache.m_msEntrance, Trk::oppositeMomentum, @@ -4412,6 +4432,7 @@ namespace Trk { PlaneSurface curvlinsurf(trans); std::unique_ptr curvlinpar(m_extrapolator->extrapolateDirectly( + ctx, *muonpar1, curvlinsurf, Trk::oppositeMomentum, @@ -4444,7 +4465,8 @@ namespace Trk { const TrackParameters *prevtp = muonpar1.get(); ATH_MSG_DEBUG("Collecting upstream muon material from extrapolator"); if (matvec_used) cache.m_matTempStore.push_back( std::move(matvec) ); - matvec.reset(m_extrapolator->extrapolateM(*prevtp, + matvec.reset(m_extrapolator->extrapolateM(ctx, + *prevtp, *states[0]->surface(), oppositeMomentum, false, @@ -4607,10 +4629,9 @@ namespace Trk { } PerigeeSurface tmppersf; - std::unique_ptr per( - m_extrapolator->extrapolate(param, tmppersf, oppositeMomentum, false, matEffects) - ); - + std::unique_ptr per(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(),param, tmppersf, oppositeMomentum, false, matEffects)); + if (per == nullptr) { ATH_MSG_DEBUG("Cannot make Perigee with starting parameters"); return nullptr; @@ -6943,6 +6964,7 @@ namespace Trk { } else if (cache.m_acceleration && (firstmeasstate->trackParameters() != nullptr)) { per.reset( m_extrapolator->extrapolate( + ctx, *firstmeasstate->trackParameters(), PerigeeSurface(Amg::Vector3D(0, 0, 0)), oppositeMomentum, @@ -7272,6 +7294,7 @@ namespace Trk { * to ensure that the hole counts are updated. */ std::vector> bl = m_extrapolator->extrapolateBlindly( + ctx, *last.trackParameters(), Trk::alongMomentum, false, diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx index e609f6349e0..0e6a61b6b3e 100755 --- a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx +++ b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardKalmanFitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -373,6 +373,7 @@ const Trk::TrackParameters* Trk::ForwardKalmanFitter::predict const int filterCounter, const int tjPositionCounter) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); if (msgLvl(MSG::DEBUG) && filterCounter == 1) printGlobalParams( (tjPositionCounter-1), " init", updatedPar ); // m_log << MSG::DEBUG << "From " << *updatedPar << " to " << destinationSurface << endmsg; @@ -393,9 +394,12 @@ const Trk::TrackParameters* Trk::ForwardKalmanFitter::predict } else { ATH_MSG_VERBOSE ("-Fp get filter onto 1st surface by direct extrapolation."); if (!m_useExEngine) - predPar = m_extrapolator->extrapolateDirectly(*updatedPar, destinationSurface, - Trk::anyDirection, - false, Trk::nonInteracting); + predPar = m_extrapolator->extrapolateDirectly(ctx, + *updatedPar, + destinationSurface, + Trk::anyDirection, + false, + Trk::nonInteracting); else { ATH_MSG_INFO ("Forward Kalman Fitter --> starting extrapolation engine"); @@ -440,9 +444,13 @@ const Trk::TrackParameters* Trk::ForwardKalmanFitter::predict //////////////////////////////////////////////////////////////////////////// // --- 2nd case covers filter loop: extrapolate to next surface with full matEffects if (!m_useExEngine) - predPar = m_extrapolator->extrapolate(*updatedPar,destinationSurface, - Trk::alongMomentum,false, - controlledMatEffects.particleType()); + predPar = + m_extrapolator->extrapolate(ctx, + *updatedPar, + destinationSurface, + Trk::alongMomentum, + false, + controlledMatEffects.particleType()); else { ATH_MSG_DEBUG ("Forward Kalman Fitter --> starting extrapolation engine"); Trk::ExtrapolationCell ecc(*updatedPar, Trk::alongMomentum); @@ -783,10 +791,12 @@ Trk::FitterStatusCode Trk::ForwardKalmanFitter::enterSeedIntoTrajectory } else { ATH_MSG_VERBOSE ("-Fe get filter onto 1st surface by direct extrapolation."); if (!m_useExEngine) - inputParAtStartSurface = m_extrapolator->extrapolateDirectly(inputPar, - startSurface, - Trk::anyDirection, - false, Trk::nonInteracting); + inputParAtStartSurface = m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + inputPar, + startSurface, + Trk::anyDirection, + false, Trk::nonInteracting); else { ATH_MSG_DEBUG ("Forward Kalman Fitter --> starting extrapolation engine"); Trk::ExtrapolationCell ecc(inputPar, Trk::anyDirection); diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardRefTrackKalmanFitter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardRefTrackKalmanFitter.cxx index 5f117aba7af..eaedf7ef6c4 100755 --- a/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardRefTrackKalmanFitter.cxx +++ b/Tracking/TrkFitter/TrkKalmanFitter/src/ForwardRefTrackKalmanFitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -410,10 +410,12 @@ Trk::FitterStatusCode Trk::ForwardRefTrackKalmanFitter::enterSeedIntoTrajectory ATH_MSG_VERBOSE ("-Fe start params already expressed at 1st meas't - do no extrapolate."); } else { ATH_MSG_VERBOSE ("-Fe get filter onto 1st surface by direct extrapolation."); - inputParAtStartSurface = m_extrapolator->extrapolateDirectly(inputPar, - startSurface, - Trk::anyDirection, - false, Trk::nonInteracting); + inputParAtStartSurface = m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + inputPar, + startSurface, + Trk::anyDirection, + false, Trk::nonInteracting); if (inputParAtStartSurface == nullptr) { ATH_MSG_WARNING ("-Fe can not transport input param to first measurement => extrap problem or bad input"); ATH_MSG_INFO ("-Fe parameters R="<< inputPar.position().perp() << ", z="<< diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanOutlierRecovery_InDet.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanOutlierRecovery_InDet.cxx index 32660eac118..d281a6627c4 100755 --- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanOutlierRecovery_InDet.cxx +++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanOutlierRecovery_InDet.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -133,7 +133,7 @@ bool Trk::KalmanOutlierRecovery_InDet::flagNewOutliers(Trk::Trajectory& T, const int fitIteration) const { ATH_MSG_VERBOSE ("-O- entered KalmanOutlierRecovery_InDet::flagNewOutliers()"); - + const EventContext& ctx = Gaudi::Hive::currentContext(); // count number of hits and outliers int numberOfRejections = 0; bool failureRecoveryNeedsRefit = false; @@ -175,9 +175,10 @@ bool Trk::KalmanOutlierRecovery_InDet::flagNewOutliers(Trk::Trajectory& T, Trk::Trajectory::iterator restartState = Trk::ProtoTrajectoryUtility::nextFittableState(T,it); const Trk::TrackParameters* smoothedParAtOutlier = (restartState != T.end() ? - m_extrapolator->extrapolate(*restartState->smoothedTrackParameters(), - it->measurement()->associatedSurface(), Trk::oppositeMomentum, - false, Trk::nonInteracting) : + m_extrapolator->extrapolate(ctx, + *restartState->smoothedTrackParameters(), + it->measurement()->associatedSurface(), Trk::oppositeMomentum, + false, Trk::nonInteracting) : nullptr ); if (!smoothedParAtOutlier) continue; @@ -236,7 +237,8 @@ bool Trk::KalmanOutlierRecovery_InDet::flagNewOutliers(Trk::Trajectory& T, if (it->measurementType() == SCT) lastSctState = it; const Trk::TrackParameters* sctExitTemp = - m_extrapolator->extrapolate(*filterInputPar, + m_extrapolator->extrapolate(ctx, + *filterInputPar, lastSctState->measurement()->associatedSurface(), Trk::alongMomentum, false, Trk::nonInteracting); @@ -288,10 +290,11 @@ bool Trk::KalmanOutlierRecovery_InDet::flagNewOutliers(Trk::Trajectory& T, if ( rit->measurementType() == SCT) { const Trk::TrackParameters* predPar = (sctFitResult!=nullptr ? - m_extrapolator->extrapolate(*sctFitResult, - rit->measurement()->associatedSurface(), - Trk::oppositeMomentum, - false, Trk::muon) : + m_extrapolator->extrapolate(ctx, + *sctFitResult, + rit->measurement()->associatedSurface(), + Trk::oppositeMomentum, + false, Trk::muon) : nullptr); delete sctFitResult; if (!predPar) { @@ -319,11 +322,12 @@ bool Trk::KalmanOutlierRecovery_InDet::flagNewOutliers(Trk::Trajectory& T, for( ; rit!=T.rend(); ++rit) { const Trk::TrackParameters* filteredPar = ( updatedPar != nullptr ? - m_extrapolator->extrapolate(*updatedPar, - rit->measurement()->associatedSurface(), - Trk::oppositeMomentum, - false, Trk::muon) : - nullptr ); + m_extrapolator->extrapolate(ctx, + *updatedPar, + rit->measurement()->associatedSurface(), + Trk::oppositeMomentum, + false, Trk::muon) : + nullptr ); delete updatedPar; const Trk::FitQualityOnSurface* testQuality = (filteredPar==nullptr)? nullptr : m_updator->predictedStateFitQuality(*filteredPar, diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx index 83cb1d2c04e..a762c972620 100644 --- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx +++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanPiecewiseAnnealingFilter.cxx @@ -356,6 +356,7 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece const ParticleHypothesis& particleType) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); if (msgLvl(MSG::DEBUG)) { msg(MSG::DEBUG) << "entering filterTrajectoryPiece() with annealing scheme"; for (unsigned int annealer=0; annealer < m_option_annealingScheme.size(); ++annealer) @@ -399,7 +400,9 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece } else { if (!input_it->referenceParameters()) { // filter using extrapolator - predPar.reset((m_extrapolator->extrapolate(*updatedPar, + predPar.reset((m_extrapolator->extrapolate( + ctx, + *updatedPar, *input_it->surface(), Trk::alongMomentum, false, particleType))); @@ -542,11 +545,6 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece ATH_MSG_WARNING ("Programming error - lost seed"); m_utility->dumpTrajectory(m_trajPiece, name()); } - /* old code for lost seed: - const TrackParameters* newPredPar = - m_extrapolator->extrapolate(*start_predPar, - ffs->measurement()->associatedSurface(), - Trk::alongMomentum, false, particleType); */ ATH_MSG_DEBUG ("entering FKF at annealing factor " <fit(m_trajPiece, *start->forwardTrackParameters(), // no check needed: void in refKF @@ -775,7 +773,7 @@ Trk::KalmanPiecewiseAnnealingFilter::filterTrajectoryPiece if (m_forwardFitter->needsReferenceTrajectory()) ATH_MSG_ERROR("Code missing!"); if (start_predPar) delete start_predPar; start_predPar = - m_extrapolator->extrapolate(*lastStateOnPiece->smoothedTrackParameters(), + m_extrapolator->extrapolate(ctx,*lastStateOnPiece->smoothedTrackParameters(), resumeKfState->measurement()->associatedSurface(), Trk::alongMomentum, false, particleType); if (!start_predPar) { diff --git a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx index e7d293672ee..50dec8f5d2b 100755 --- a/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx +++ b/Tracking/TrkFitter/TrkKalmanFitter/src/KalmanSmoother.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -178,7 +178,7 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory& tra const Trk::KalmanMatEffectsController& kalMec) const { ATH_MSG_VERBOSE ("--> enter KalmanSmoother::fit"); - + const EventContext& ctx = Gaudi::Hive::currentContext(); // protection against being unconfigured if (!m_updator) { ATH_MSG_ERROR ("need to first configure with updator"); @@ -305,7 +305,8 @@ Trk::FitterStatusCode Trk::KalmanSmoother::fit(Trk::Trajectory& tra // now propagate updated TrkParameters to surface of ROT if (!m_useExEngine) - predPar.reset( m_extrapolator->extrapolate(*updatedPar, sf, + predPar.reset( m_extrapolator->extrapolate(ctx, + *updatedPar, sf, Trk::oppositeMomentum, // reverse filtering false, // no boundary check kalMec.particleType()) ); diff --git a/Tracking/TrkFitter/TrkRefitAlg/src/ReFitTrack.cxx b/Tracking/TrkFitter/TrkRefitAlg/src/ReFitTrack.cxx index c923874d47f..a066ab2c74d 100755 --- a/Tracking/TrkFitter/TrkRefitAlg/src/ReFitTrack.cxx +++ b/Tracking/TrkFitter/TrkRefitAlg/src/ReFitTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -138,8 +138,8 @@ StatusCode Trk::ReFitTrack::execute() { ATH_MSG_DEBUG ("ReFitTrack::execute()"); std::unique_ptr prd_to_track_map(m_assoTool->createPRDtoTrackMap()); - - SG::ReadHandle tracks (m_trackName); + const EventContext& ctx = Gaudi::Hive::currentContext(); + SG::ReadHandle tracks (m_trackName, ctx); if (!tracks.isValid()){ msg(MSG::ERROR) <<"Track collection named " << m_trackName.key() @@ -219,7 +219,10 @@ StatusCode Trk::ReFitTrack::execute() ATH_MSG_VERBOSE ("Creating measurement for beamspot."); // extrapolate the track to the vertex -- for consistent Measurement frame - std::unique_ptr tp( m_extrapolator->extrapolate(**itr,*constrainSf,Trk::anyDirection) ); + std::unique_ptr tp( m_extrapolator->extrapolate(ctx, + **itr, + *constrainSf, + Trk::anyDirection) ); const Trk::Perigee* tpConstrainedSf = dynamic_cast(tp.get()); // create the vertex/beamsptOnTrack std::unique_ptr bsvxOnTrack( tpConstrainedSf ? new Trk::VertexOnTrack(*constrainVx,*tpConstrainedSf) : nullptr ); diff --git a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx index c11cdc362df..ad0afdcf280 100755 --- a/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx +++ b/Tracking/TrkFitter/TrkiPatFitter/src/MaterialAllocator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -664,15 +664,18 @@ namespace Trk MaterialAllocator::leadingSpectrometerTSOS(const TrackParameters& spectrometerParameters, Garbage_t& garbage) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); const Trk::TrackingVolume* spectrometerEntrance = getSpectrometerEntrance(); if (!spectrometerEntrance) return nullptr; // check input parameters are really in the spectrometer if (m_calorimeterVolume->inside(spectrometerParameters.position())) return nullptr; - std::unique_ptr entranceParameters(m_extrapolator->extrapolateToVolume(spectrometerParameters, - *spectrometerEntrance, - anyDirection, - Trk::nonInteracting)); + std::unique_ptr entranceParameters(m_extrapolator->extrapolateToVolume( + ctx, + spectrometerParameters, + *spectrometerEntrance, + anyDirection, + Trk::nonInteracting)); if (!entranceParameters) { ATH_MSG_VERBOSE(std::setiosflags(std::ios::fixed) << "leadingSpectrometerTSOS: no material found from RZ" @@ -1049,9 +1052,10 @@ namespace Trk const BoundaryCheck& boundsCheck, ParticleHypothesis particleHypothesis, Garbage_t& garbage) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); // fix up material duplication appearing after recent TrackingGeometry speed-up const std::vector* TGMaterial = - extrapolator->extrapolateM(parameters, surface, dir, boundsCheck, particleHypothesis); + extrapolator->extrapolateM(ctx, parameters, surface, dir, boundsCheck, particleHypothesis); if (!TGMaterial || TGMaterial->empty()) return TGMaterial; @@ -1964,6 +1968,7 @@ namespace Trk FitParameters& fitParameters, const TrackParameters& startParameters, Garbage_t& garbage) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); // return if no MS measurement if (m_calorimeterVolume->inside(measurements.back()->position())) return; @@ -2077,10 +2082,11 @@ namespace Trk *innerMeasurement, false)); if (!innerParameters) innerParameters.reset(startParameters.clone()); - entranceParameters.reset( m_extrapolator->extrapolateToVolume(*innerParameters, - *spectrometerEntrance, - anyDirection, - Trk::nonInteracting)); + entranceParameters.reset( m_extrapolator->extrapolateToVolume(ctx, + *innerParameters, + *spectrometerEntrance, + anyDirection, + Trk::nonInteracting)); if (entranceParameters) { startDirection = entranceParameters->momentum().unit(); startPosition = entranceParameters->position(); @@ -2111,19 +2117,21 @@ namespace Trk if (!outerParameters) outerParameters.reset(startParameters.clone()); const Surface& endSurface = *measurements.back()->surface(); std::unique_ptr endParameters( - m_extrapolator->extrapolate(*outerParameters, - endSurface, - anyDirection, - false, - particleHypothesis)); + m_extrapolator->extrapolate(ctx, + *outerParameters, + endSurface, + anyDirection, + false, + particleHypothesis)); if (endParameters.get() == outerParameters.get()) throw std::logic_error("Extrapolator returned input parameters."); if (!endParameters) { - endParameters.reset(m_extrapolator->extrapolate(*outerParameters, - endSurface, - anyDirection, - false, - Trk::nonInteracting)); + endParameters.reset(m_extrapolator->extrapolate(ctx, + *outerParameters, + endSurface, + anyDirection, + false, + Trk::nonInteracting)); if (endParameters.get() == outerParameters.get()) throw std::logic_error("Extrapolator returned input parameters."); if (!endParameters) { diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerHelper.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerHelper.cxx index 5c16b68c570..8905bffde4f 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerHelper.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -167,9 +167,16 @@ void Trk::GeantFollowerHelper::trackParticle(const G4ThreeVector& pos, // destination surface const Trk::PlaneSurface& destinationSurface = g4Parameters->associatedSurface(); // extrapolate to the destination surface + const EventContext& ctx = Gaudi::Hive::currentContext(); const Trk::TrackParameters* trkParameters = m_extrapolateDirectly ? - m_extrapolator->extrapolateDirectly(*m_parameterCache,destinationSurface,Trk::alongMomentum,false) : - m_extrapolator->extrapolate(*m_parameterCache,destinationSurface,Trk::alongMomentum,false); + m_extrapolator->extrapolateDirectly(ctx, + *m_parameterCache, + destinationSurface, + Trk::alongMomentum,false) : + m_extrapolator->extrapolate(ctx, + *m_parameterCache, + destinationSurface, + Trk::alongMomentum,false); // fill the geant information and the trk information m_treeData->m_g4_p[m_treeData->m_g4_steps] = mom.mag(); m_treeData->m_g4_eta[m_treeData->m_g4_steps] = mom.eta(); diff --git a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSHelper.cxx b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSHelper.cxx index 5a48d297de3..c68a5ac52b2 100644 --- a/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSHelper.cxx +++ b/Tracking/TrkG4Components/TrkG4UserActions/src/GeantFollowerMSHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -229,7 +229,7 @@ void Trk::GeantFollowerMSHelper::beginEvent() const void Trk::GeantFollowerMSHelper::trackParticle(const G4ThreeVector& pos, const G4ThreeVector& mom, int pdg, double charge, float t, float X0) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); // as the MS starts at 6736 in R.07 the cut is just before double zMuonEntry = 6735.; @@ -347,17 +347,25 @@ void Trk::GeantFollowerMSHelper::trackParticle(const G4ThreeVector& pos, const G const Trk::PlaneSurface& destinationSurface = g4Parameters->associatedSurface(); // extrapolate to the destination surface const Trk::TrackParameters* trkParameters = m_extrapolateDirectly&&m_crossedMuonEntry ? - m_extrapolator->extrapolateDirectly(*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon) : - m_extrapolator->extrapolate(*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon); + m_extrapolator->extrapolateDirectly(ctx,*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon) : + m_extrapolator->extrapolate(ctx,*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon); if(m_treeData->m_g4_stepsMS==0) { ATH_MSG_DEBUG( " Extrapolate m_parameterCacheCov with covMatrix "); extrapolationCache->reset(); trkParameters = m_extrapolateDirectly&&m_crossedMuonEntry ? - m_extrapolator->extrapolateDirectly(*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon) : - m_extrapolator->extrapolate(*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,Trk::addNoise,extrapolationCache); - - ATH_MSG_DEBUG(" G4 extrapolate to Muon Entry system " << " X0 " << extrapolationCache->x0tot() << " Eloss deltaE " << extrapolationCache->eloss()->deltaE() << " Eloss sigma " << extrapolationCache->eloss()->sigmaDeltaE() << " meanIoni " << extrapolationCache->eloss()->meanIoni() << " sigmaIoni " << extrapolationCache->eloss()->sigmaIoni() << " meanRad " << extrapolationCache->eloss()->meanRad() << " sigmaRad " << extrapolationCache->eloss()->sigmaRad() << " depth " << extrapolationCache->eloss()->length()); - + m_extrapolator->extrapolateDirectly(ctx,*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon) : + m_extrapolator->extrapolate(ctx,*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,Trk::addNoise,extrapolationCache); + + ATH_MSG_DEBUG( + " G4 extrapolate to Muon Entry system " + << " X0 " << extrapolationCache->x0tot() << " Eloss deltaE " + << extrapolationCache->eloss()->deltaE() << " Eloss sigma " + << extrapolationCache->eloss()->sigmaDeltaE() << " meanIoni " + << extrapolationCache->eloss()->meanIoni() << " sigmaIoni " + << extrapolationCache->eloss()->sigmaIoni() << " meanRad " + << extrapolationCache->eloss()->meanRad() << " sigmaRad " + << extrapolationCache->eloss()->sigmaRad() << " depth " + << extrapolationCache->eloss()->length()); ATH_MSG_DEBUG( " Extrapolation OK "); } @@ -382,20 +390,20 @@ void Trk::GeantFollowerMSHelper::trackParticle(const G4ThreeVector& pos, const G // Get extrapolatio with errors extrapolationCache->reset(); trkParameters = m_extrapolateDirectly&&m_crossedMuonEntry ? - m_extrapolator->extrapolateDirectly(*m_parameterCacheMSCov,destinationSurface,Trk::alongMomentum,false,Trk::muon) : - m_extrapolator->extrapolate(*m_parameterCacheMSCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,Trk::addNoise,extrapolationCache); + m_extrapolator->extrapolateDirectly(ctx,*m_parameterCacheMSCov,destinationSurface,Trk::alongMomentum,false,Trk::muon) : + m_extrapolator->extrapolate(ctx,*m_parameterCacheMSCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,Trk::addNoise,extrapolationCache); // Forward from ME to Exit const Trk::TrackParameters* trkParameters_FW = m_extrapolateDirectly ? - m_extrapolator->extrapolateDirectly(*m_parameterCacheMS,destinationSurface,Trk::alongMomentum,false,Trk::muon) : - m_extrapolator->extrapolate(*m_parameterCacheMS,destinationSurface,Trk::alongMomentum,false,Trk::muon); + m_extrapolator->extrapolateDirectly(ctx,*m_parameterCacheMS,destinationSurface,Trk::alongMomentum,false,Trk::muon) : + m_extrapolator->extrapolate(ctx,*m_parameterCacheMS,destinationSurface,Trk::alongMomentum,false,Trk::muon); // Backwards from Exit to ME if(trkParameters_FW) { ATH_MSG_DEBUG (" forward extrapolation succeeded "); bool doBackWard = false; if(doBackWard) { const Trk::TrackParameters* trkParameters_BACK = m_extrapolateDirectly ? - m_extrapolator->extrapolateDirectly(*trkParameters_FW,*m_destinationSurface,Trk::oppositeMomentum,false,Trk::muon) : - m_extrapolator->extrapolate(*trkParameters_FW,*m_destinationSurface,Trk::oppositeMomentum,false,Trk::muon); + m_extrapolator->extrapolateDirectly(ctx,*trkParameters_FW,*m_destinationSurface,Trk::oppositeMomentum,false,Trk::muon) : + m_extrapolator->extrapolate(ctx,*trkParameters_FW,*m_destinationSurface,Trk::oppositeMomentum,false,Trk::muon); // if(m_usePropagator) { // std::cout << " Use Propagator " << std::endl; // trkParameters_BACK = m_propagator->propagate(*trkParameters,*m_destinationSurface,Trk::oppositeMomentum,false,*m_magFieldProperties); @@ -414,7 +422,11 @@ void Trk::GeantFollowerMSHelper::trackParticle(const G4ThreeVector& pos, const G if(fabs(m_treeData->m_m_p-m_treeData->m_b_p)>10.) ATH_MSG_DEBUG (" Back extrapolation to Muon Entry finds different momentum difference MeV " << m_treeData->m_m_p-m_treeData->m_b_p); delete trkParameters_BACK; extrapolationCache->reset(); - const std::vector *matvec_BACK = m_extrapolator->extrapolateM(*trkParameters_FW,*m_destinationSurface,Trk::oppositeMomentum,false,Trk::muon,extrapolationCache); + const std::vector *matvec_BACK = m_extrapolator->extrapolateM(ctx, + *trkParameters_FW, + *m_destinationSurface, + Trk::oppositeMomentum, + false,Trk::muon,extrapolationCache); double Eloss = 0.; double x0 = 0.; @@ -484,8 +496,8 @@ void Trk::GeantFollowerMSHelper::trackParticle(const G4ThreeVector& pos, const G } extrapolationCache->reset(); - const std::vector *matvec = m_extrapolator->extrapolateM(*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon,extrapolationCache); - if(m_treeData->m_g4_stepsMS==0) matvec = m_extrapolator->extrapolateM(*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,extrapolationCache); + const std::vector *matvec = m_extrapolator->extrapolateM(ctx,*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon,extrapolationCache); + if(m_treeData->m_g4_stepsMS==0) matvec = m_extrapolator->extrapolateM(ctx,*m_parameterCacheCov,destinationSurface,Trk::alongMomentum,false,Trk::muon,extrapolationCache); if(m_treeData->m_g4_stepsMS==0) ATH_MSG_DEBUG(" G4 extrapolateM to Muon Entry " << " X0 " << extrapolationCache->x0tot() << " Eloss deltaE " << extrapolationCache->eloss()->deltaE() << " Eloss sigma " << extrapolationCache->eloss()->sigmaDeltaE() << " meanIoni " << extrapolationCache->eloss()->meanIoni() << " sigmaIoni " << extrapolationCache->eloss()->sigmaIoni() << " meanRad " << extrapolationCache->eloss()->meanRad() << " sigmaRad " << extrapolationCache->eloss()->sigmaRad()); // if(m_treeData->m_trk_status[m_treeData->m_g4_steps] == 1000) matvec = m_extrapolator->extrapolateM(*m_parameterCache,destinationSurface,Trk::alongMomentum,false,Trk::muon); diff --git a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx index 72514d34740..47b25ac2f1c 100644 --- a/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx +++ b/Tracking/TrkTools/TrkMaterialProvider/src/TrkMaterialProviderTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkMaterialProvider/TrkMaterialProviderTool.h" @@ -153,7 +153,7 @@ Trk::TrkMaterialProviderTool::finalize() void Trk::TrkMaterialProviderTool::updateCaloTSOS(Trk::Track& track, const Trk::TrackParameters* startParameters) const { ATH_MSG_VERBOSE("updateCaloTSOS(Trk::Track& track, const Trk::TrackParameters* startParameters)"); - + // back extrapolate to perigee, get pAtCaloEntry from list of TSOSs // and update/add calo+ID material to mstrack to be refitted. const Trk::TrackStates* inputTSOS_orig = track.trackStateOnSurfaces(); @@ -686,19 +686,19 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, con // Get Calorimeter TSOS from TG (extrapolateM) Trk::TrackStates* -Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, - const Trk::Track& muonTrack, - const Trk::Surface& surf, - Trk::PropDirection dir, - Trk::ParticleHypothesis mateffects, - double& Eloss, - double& X0ScaleMS, - double& ElossScaleMS, - const Trk::TrackParameters* parms, - bool boundaryCheck, - bool removeOoC) const +Trk::TrkMaterialProviderTool::getCaloTSOS(const Trk::TrackParameters& parm, + const Trk::Track& muonTrack, + const Trk::Surface& surf, + Trk::PropDirection dir, + Trk::ParticleHypothesis mateffects, + double& Eloss, + double& X0ScaleMS, + double& ElossScaleMS, + const Trk::TrackParameters* parms, + bool boundaryCheck, + bool removeOoC) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); bool fremoveMS = false; if(!removeOoC) fremoveMS = true; @@ -715,8 +715,11 @@ Trk::TrkMaterialProviderTool::getCaloTSOS (const Trk::TrackParameters& parm, double pOri = parm.momentum().mag(); // Get TSOS from extrapolateM (from TG) - std::vector* caloTSOS = m_muonExtrapolator->extrapolateM(parm, surf, dir, - boundaryCheck, mateffects); + std::vector* caloTSOS = m_muonExtrapolator->extrapolateM(ctx, + parm, + surf, dir, + boundaryCheck, + mateffects); ATH_MSG_DEBUG("Retrieved " << caloTSOS->size() << " Calorimeter TSOS from extrapolateM, no-removal"); diff --git a/Tracking/TrkTools/TrkTruthToTrack/src/TruthToTrack.cxx b/Tracking/TrkTools/TrkTruthToTrack/src/TruthToTrack.cxx index aebf9066772..7449fc5ec52 100755 --- a/Tracking/TrkTools/TrkTruthToTrack/src/TruthToTrack.cxx +++ b/Tracking/TrkTools/TrkTruthToTrack/src/TruthToTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #define TRUTHTOTRACK_IMP @@ -132,11 +132,13 @@ const Trk::TrackParameters* Trk::TruthToTrack::makePerigeeParameters(HepMC::Cons // Extrapolate the TrackParameters object to the perigee. Direct extrapolation, // no material effects. - generatedTrackPerigee = m_extrapolator->extrapolateDirectly( *productionVertexTrackParams, - Trk::PerigeeSurface(), - Trk::anyDirection, - false, - Trk::nonInteracting ); + generatedTrackPerigee = m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + *productionVertexTrackParams, + Trk::PerigeeSurface(), + Trk::anyDirection, + false, + Trk::nonInteracting ); } } @@ -156,11 +158,13 @@ const Trk::TrackParameters* Trk::TruthToTrack::makePerigeeParameters(const xAOD: // Extrapolate the TrackParameters object to the perigee. Direct extrapolation, // no material effects. - generatedTrackPerigee = m_extrapolator->extrapolateDirectly( *productionVertexTrackParams, - Trk::PerigeeSurface(), - Trk::anyDirection, - false, - Trk::nonInteracting ); + generatedTrackPerigee = m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + *productionVertexTrackParams, + Trk::PerigeeSurface(), + Trk::anyDirection, + false, + Trk::nonInteracting ); } } diff --git a/Tracking/TrkTools/TrkTruthToTrack/src/TruthTrackRecordToTrack.cxx b/Tracking/TrkTools/TrkTruthToTrack/src/TruthTrackRecordToTrack.cxx index 8175881f74a..71b20cd4780 100755 --- a/Tracking/TrkTools/TrkTruthToTrack/src/TruthTrackRecordToTrack.cxx +++ b/Tracking/TrkTools/TrkTruthToTrack/src/TruthTrackRecordToTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TrkTruthToTrack/TruthTrackRecordToTrack.h" @@ -212,11 +212,13 @@ const Trk::TrackParameters* Trk::TruthTrackRecordToTrack::makePerigeeParameters( // Extrapolate the TrackParameters object to the perigee. Direct extrapolation, // no material effects. - generatedTrackPerigee = m_extrapolator->extrapolateDirectly( *productionVertexTrackParams, - Trk::PerigeeSurface(), - Trk::anyDirection, - false, - Trk::nonInteracting ); + generatedTrackPerigee = + m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(), + *productionVertexTrackParams, + Trk::PerigeeSurface(), + Trk::anyDirection, + false, + Trk::nonInteracting); } } @@ -236,11 +238,13 @@ const Trk::TrackParameters* Trk::TruthTrackRecordToTrack::makePerigeeParameters( // Extrapolate the TrackParameters object to the perigee. Direct extrapolation, // no material effects. - generatedTrackPerigee = m_extrapolator->extrapolateDirectly( *productionVertexTrackParams, - Trk::PerigeeSurface(), - Trk::anyDirection, - false, - Trk::nonInteracting ); + generatedTrackPerigee = + m_extrapolator->extrapolateDirectly(Gaudi::Hive::currentContext(), + *productionVertexTrackParams, + Trk::PerigeeSurface(), + Trk::anyDirection, + false, + Trk::nonInteracting); } } diff --git a/Tracking/TrkValidation/TrkValTools/src/PerigeeParametersNtupleTool.cxx b/Tracking/TrkValidation/TrkValTools/src/PerigeeParametersNtupleTool.cxx index 80d7329a256..93922a5756b 100644 --- a/Tracking/TrkValidation/TrkValTools/src/PerigeeParametersNtupleTool.cxx +++ b/Tracking/TrkValidation/TrkValTools/src/PerigeeParametersNtupleTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -169,7 +169,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::fillTrackData ( //const Trk::FitterStatusCode /*fitStatCode*/ ) const { ATH_MSG_VERBOSE ("in fillTrackData(trk, indx)"); - + const EventContext& ctx = Gaudi::Hive::currentContext(); //---------------------------------------------- // fill track parameters in ntuple const Trk::Perigee* perpars = track.perigeeParameters(); @@ -182,7 +182,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::fillTrackData ( ATH_MSG_VERBOSE ("try extrapolate SiSPSeeded track to perigee"); const Trk::PerigeeSurface perSurf; perpars = dynamic_cast - (m_extrapolator->extrapolate(track, perSurf, Trk::anyDirection, false, Trk::nonInteracting)); + (m_extrapolator->extrapolate(ctx, track, perSurf, Trk::anyDirection, false, Trk::nonInteracting)); if (perpars != nullptr && fillTrackPerigee(perpars).isFailure()) { msg(MSG::WARNING) << "Newly made perigee parameters could not be " << "written to ntuple" << endmsg; @@ -220,6 +220,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::fillProtoTrajectoryData const unsigned int ) const // const Trk::FitterStatusCode) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_VERBOSE ("in fillProtoTrajectoryData(protoTraj, indx)"); if (myPerigee != nullptr) { @@ -241,7 +242,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::fillProtoTrajectoryData if (nearestParam!=nullptr) { const Trk::PerigeeSurface perSurf; const Trk::Perigee* perpars = dynamic_cast - (m_extrapolator->extrapolate(*nearestParam, perSurf, Trk::anyDirection, false, Trk::pion)); + (m_extrapolator->extrapolate(ctx,*nearestParam, perSurf, Trk::anyDirection, false, Trk::pion)); if (perpars != nullptr && fillTrackPerigee(perpars).isFailure()) { ATH_MSG_WARNING ("Newly made perigee parameters could not be written to ntuple"); } diff --git a/Tracking/TrkVertexFitter/TrkV0Fitter/src/TrkV0VertexFitter.cxx b/Tracking/TrkVertexFitter/TrkV0Fitter/src/TrkV0VertexFitter.cxx index 46de52c00e6..9e1c0bfa616 100755 --- a/Tracking/TrkVertexFitter/TrkV0Fitter/src/TrkV0VertexFitter.cxx +++ b/Tracking/TrkVertexFitter/TrkV0Fitter/src/TrkV0VertexFitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -122,6 +122,7 @@ namespace Trk const xAOD::Vertex* pointingVertex, const Amg::Vector3D& firstStartingPoint) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); std::vector measuredPerigees; std::vector measuredPerigees_delete; for (const xAOD::TrackParticle* p : vectorTrk) @@ -140,14 +141,26 @@ namespace Trk const Trk::TrackParameters* chargeParameters = &p->perigeeParameters(); MaterialUpdateMode mode = Trk::removeNoise; const Trk::TrackParameters* extrapolatedPerigee(nullptr); - extrapolatedPerigee = m_extrapolator->extrapolate(*chargeParameters, estimationCylinder, Trk::alongMomentum, true, Trk::pion, mode); - if (extrapolatedPerigee!=nullptr) { + extrapolatedPerigee = m_extrapolator->extrapolate(ctx, + *chargeParameters, + estimationCylinder, + Trk::alongMomentum, + true, + Trk::pion, + mode); + if (extrapolatedPerigee != nullptr) { msg(MSG::DEBUG) << "extrapolated to first measurement" << endmsg; measuredPerigees.push_back (extrapolatedPerigee); measuredPerigees_delete.push_back (extrapolatedPerigee); } else { - extrapolatedPerigee = m_extrapolator->extrapolateDirectly(*chargeParameters, estimationCylinder, Trk::alongMomentum, true, Trk::pion); - if (extrapolatedPerigee!=nullptr) { + extrapolatedPerigee = + m_extrapolator->extrapolateDirectly(ctx, + *chargeParameters, + estimationCylinder, + Trk::alongMomentum, + true, + Trk::pion); + if (extrapolatedPerigee != nullptr) { msg(MSG::DEBUG) << "extrapolated (direct) to first measurement" << endmsg; measuredPerigees.push_back (extrapolatedPerigee); measuredPerigees_delete.push_back (extrapolatedPerigee); @@ -217,7 +230,7 @@ namespace Trk const xAOD::Vertex* pointingVertex, const Amg::Vector3D& firstStartingPoint) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); if ( originalPerigees.empty() ) { ATH_MSG_DEBUG("No tracks to fit in this event."); @@ -354,7 +367,8 @@ namespace Trk MaterialUpdateMode mode = Trk::removeNoise; if(extrapolationDirection > 0) mode = Trk::addNoise; const Trk::Perigee* extrapolatedPerigee(nullptr); - extrapolatedPerigee = dynamic_cast(m_extrapolator->extrapolate(*chargeParameters, perigeeSurface, Trk::anyDirection, true, Trk::pion, mode)); + extrapolatedPerigee = dynamic_cast(m_extrapolator->extrapolate( + ctx, *chargeParameters, perigeeSurface, Trk::anyDirection, true, Trk::pion, mode)); if (extrapolatedPerigee==nullptr) { ATH_MSG_DEBUG("Perigee was not extrapolated! Taking original one!"); @@ -789,7 +803,8 @@ namespace Trk MaterialUpdateMode mode = Trk::removeNoise; if(extrapolationDirection > 0) mode = Trk::addNoise; const Trk::Perigee* extrapolatedPerigee(nullptr); - extrapolatedPerigee = dynamic_cast(m_extrapolator->extrapolate(*chargeParameters, perigeeSurfaceItr, Trk::anyDirection, true, Trk::pion, mode)); + extrapolatedPerigee = dynamic_cast(m_extrapolator->extrapolate( + ctx, *chargeParameters, perigeeSurfaceItr, Trk::anyDirection, true, Trk::pion, mode)); if (extrapolatedPerigee==nullptr) { ATH_MSG_DEBUG("Perigee was not extrapolated! Taking original one!"); diff --git a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx index 543521d99dd..f0a1bb93488 100755 --- a/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx +++ b/Tracking/TrkVertexFitter/TrkVKalVrtFitter/src/VKalExtPropagator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // // The VKalExtPropagator object is created if ATHENA propagator exists @@ -357,6 +357,10 @@ namespace Trk { const IVKalState& istate) const { const TrkVKalVrtFitter::State& state = static_cast (istate); + const EventContext& ctx = (state.m_eventContext) + ? *(state.m_eventContext) + : Gaudi::Hive::currentContext(); + const Trk::TrackParameters* endPer=nullptr; ParticleHypothesis prtType = muon; @@ -391,8 +395,8 @@ namespace Trk { // if( Strategy == 0) { PropDirection dir=alongMomentum; if(pmom.dot(step)<0) dir=oppositeMomentum; - endPer = m_extrapolator->extrapolate(*pntOnTrk, lineTarget, dir, true, prtType, addNoise); - if(!endPer)endPer = m_extrapolator->extrapolateDirectly(*pntOnTrk, lineTarget, dir, true, prtType); + endPer = m_extrapolator->extrapolate(ctx, *pntOnTrk, lineTarget, dir, true, prtType, addNoise); + if(!endPer)endPer = m_extrapolator->extrapolateDirectly(ctx,*pntOnTrk, lineTarget, dir, true, prtType); return endPer; } // @@ -401,7 +405,7 @@ namespace Trk { if( Strategy == 1 || Strategy == 2) { PropDirection dir=alongMomentum; MaterialUpdateMode mmode=addNoise; if(pmom.dot(step)<0){ dir=oppositeMomentum; mmode=removeNoise;} - endPer = m_extrapolator->extrapolate(*pntOnTrk, lineTarget, dir, true, prtType, mmode); + endPer = m_extrapolator->extrapolate(ctx, *pntOnTrk, lineTarget, dir, true, prtType, mmode); return endPer; } return endPer; @@ -431,6 +435,7 @@ namespace Trk { { if(!xprt->isAvailable("radiusOfFirstHit")) return nullptr; // No radiusOfFirstHit on track + const EventContext& ctx = Gaudi::Hive::currentContext(); const Trk::Perigee* mPer = &(xprt->perigeeParameters()); Amg::Transform3D trnsf; trnsf.setIdentity(); @@ -438,14 +443,24 @@ namespace Trk { ParticleHypothesis prtType = pion; const TrackParameters *hitOnTrk = - m_extrapolator->extrapolate( *mPer, surfacePntOnTrk, alongMomentum, true, prtType, removeNoise); + m_extrapolator->extrapolate(ctx, + *mPer, + surfacePntOnTrk, + alongMomentum, + true, prtType, removeNoise); //std::cout<<" Radius="<radiusOfFirstHit()<<" extrap="<extrapolateDirectly( *mPer, surfacePntOnTrk, alongMomentum, true, prtType); + if(hitOnTrk==nullptr)hitOnTrk=m_extrapolator->extrapolateDirectly(ctx, + *mPer, + surfacePntOnTrk, + alongMomentum, + true, prtType); if(hitOnTrk==nullptr)return nullptr; //convert result to Perigee PerigeeSurface surfacePerigee( hitOnTrk->position() ); - const TrackParameters *hitOnTrkPerig = m_extrapolator->extrapolate( *hitOnTrk, surfacePerigee); + const TrackParameters *hitOnTrkPerig = m_extrapolator->extrapolate(ctx, + *hitOnTrk, + surfacePerigee); delete hitOnTrk; // Delete temporary results if(hitOnTrkPerig==nullptr)return nullptr; //std::cout<<" perig="<<(*hitOnTrkPerig)<<'\n'; diff --git a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx index c9d0a69d69a..fdca0164c83 100644 --- a/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexAnalysisUtils/src/V0Tools.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************* @@ -2260,7 +2260,10 @@ namespace Trk if (masses[it] >= 0.) { const xAOD::TrackParticle* TP = origTrack(vxCandidate,it); if (TP == nullptr) return -999999.; - const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate(*TP, perigeeSurface); + const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *TP, + perigeeSurface); if (extrPer == nullptr) return -999999.; px += extrPer->momentum().x(); py += extrPer->momentum().y(); @@ -2294,7 +2297,10 @@ namespace Trk if (masses[it] >= 0.) { const xAOD::TrackParticle* TP = origTrack(vxCandidate,it); if (TP == nullptr) return -999999.; - const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate(*TP, perigeeSurface); + const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *TP, + perigeeSurface); if (extrPer == nullptr) return -999999.; px += extrPer->momentum().x(); py += extrPer->momentum().y(); @@ -2422,7 +2428,10 @@ namespace Trk if (masses[it] >= 0.) { const xAOD::TrackParticle* TP = origTrack(vxCandidate,it); if (TP == nullptr) return -999999.; - const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate(*TP, perigeeSurface); + const Trk::TrackParameters* extrPer = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *TP, + perigeeSurface); if (extrPer == nullptr) return -999999.; const AmgSymMatrix(5)* cov_tmp = extrPer->covariance(); V0_cor(5*it+2,5*it+2) = (*cov_tmp)(2,2); diff --git a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx index b7a53276033..7b176418319 100755 --- a/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexBilloirTools/src/FastVertexFitter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /*************************************************************************** @@ -310,7 +310,10 @@ namespace Trk // you need to extrapolate the original perigee ((*BTIter).originalPerigee) really to the // found vertex. The first propagation above is only to the starting point. But here we // want to store it wrt. to the last fitted vertex - auto extrapolatedPerigee = std::unique_ptr ( m_extrapolator->extrapolate ( * ( *BTIter ).originalPerigee, perigeeSurface ) ); + auto extrapolatedPerigee = std::unique_ptr ( m_extrapolator->extrapolate ( + Gaudi::Hive::currentContext(), + * ( *BTIter ).originalPerigee, + perigeeSurface ) ); if ( extrapolatedPerigee==nullptr ) { extrapolatedPerigee = std::unique_ptr(((*BTIter).originalPerigee)->clone()); diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/FullLinearizedTrackFactory.cxx b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/FullLinearizedTrackFactory.cxx index afe995262c6..d378cdede87 100755 --- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/FullLinearizedTrackFactory.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/FullLinearizedTrackFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************* @@ -68,7 +68,10 @@ namespace Trk Trk::removeNoise ; // parameters downstream of vertex -> go back const TrackParameters* parsAtVertex = - m_extrapolator->extrapolate(*trackPars, perigeeSurface, Trk::anyDirection, true, Trk::pion, mode); + m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *trackPars, + perigeeSurface, Trk::anyDirection, true, Trk::pion, mode); if (dynamic_cast(parsAtVertex)==nullptr || parsAtVertex->covariance()==nullptr ) { @@ -242,7 +245,8 @@ namespace Trk Trk::removeNoise ; // parameters downstream of vertex -> go back */ const NeutralParameters* parsAtVertex = - m_extrapolator->extrapolate(*neutralPars, perigeeSurface, Trk::anyDirection, true); + m_extrapolator->extrapolate(*neutralPars, + perigeeSurface, Trk::anyDirection, true); if (dynamic_cast(parsAtVertex)==nullptr || parsAtVertex->covariance()==nullptr ) { diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/ImpactPoint3dEstimator.cxx b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/ImpactPoint3dEstimator.cxx index 8aea3b973fc..f6d77684b4c 100755 --- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/ImpactPoint3dEstimator.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/ImpactPoint3dEstimator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************* @@ -144,8 +144,10 @@ namespace Trk }*/ Trk::PerigeeSurface perigeeSurface(*theVertex); - thePerigee=dynamic_cast(m_extrapolator->extrapolateDirectly(*trackPerigee, - perigeeSurface)); + thePerigee=dynamic_cast(m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + *trackPerigee, + perigeeSurface)); if (thePerigee == nullptr) return nullptr; } @@ -332,7 +334,10 @@ namespace Trk ATH_MSG_VERBOSE( "Original perigee was: " << *(vtxTrack.initialPerigee()) ); ATH_MSG_VERBOSE( "The resulting surface is: " << *theSurfaceAtIP ); #endif - const auto *pTrackPar = m_extrapolator->extrapolate(*(vtxTrack.initialPerigee()),*theSurfaceAtIP); + const auto *pTrackPar = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *(vtxTrack.initialPerigee()), + *theSurfaceAtIP); if (const Trk::AtaPlane* res = dynamic_cast(pTrackPar); res){ return res; } diff --git a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/TrackToVertexIPEstimator.cxx b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/TrackToVertexIPEstimator.cxx index 3d310535a63..f4c99c75c54 100644 --- a/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/TrackToVertexIPEstimator.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitterUtils/src/TrackToVertexIPEstimator.cxx @@ -135,7 +135,10 @@ namespace Trk //estrapolating to the perigee of the reconstructed vertex const Amg::Vector3D & lp = vtx.position(); PerigeeSurface perigeeSurface(lp); - const Trk::Perigee * extrapolatedParameters =dynamic_cast(m_extrapolator->extrapolate(*track,perigeeSurface)); + const Trk::Perigee * extrapolatedParameters =dynamic_cast(m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + *track, + perigeeSurface)); if (extrapolatedParameters && extrapolatedParameters->covariance()) { //actual calculation of d0 and sigma. @@ -244,7 +247,10 @@ namespace Trk const Amg::Vector3D & lp = primaryVertex.position(); PerigeeSurface perigeeSurface(lp); - const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate(track,perigeeSurface); + const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + track, + perigeeSurface); if (!extrapolatedParameters) return 0.; @@ -275,7 +281,10 @@ namespace Trk const Amg::Vector3D & lp = primaryVertex.position(); PerigeeSurface perigeeSurface(lp); - const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate(track,perigeeSurface); + const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate( + Gaudi::Hive::currentContext(), + track, + perigeeSurface); if (!extrapolatedParameters) return 0.; @@ -306,7 +315,9 @@ namespace Trk const Amg::Vector3D & lp = primaryVertex.position(); PerigeeSurface perigeeSurface(lp); - const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate(track,perigeeSurface); + const Trk::TrackParameters * extrapolatedParameters = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + track, + perigeeSurface); if (!extrapolatedParameters) return 0.; diff --git a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx index 03a19f72007..14880ee9c6a 100755 --- a/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx +++ b/Tracking/TrkVertexFitter/TrkVertexFitters/src/DummyVertexSmoother.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /********************************************************************* @@ -77,14 +77,16 @@ namespace Trk { //Either we should return non-const parameters from the extrapolator //as the owner here has to delete them - //Or we need to clone - auto extrapolatedPerigee = std::unique_ptr(m_extrapolator->extrapolate(*initPar,perigeeSurface)); - if(extrapolatedPerigee != nullptr) - { + //Or we need to clone + auto extrapolatedPerigee = + std::unique_ptr(m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *initPar, + perigeeSurface)); + if (extrapolatedPerigee != nullptr) { (*t_it).setPerigeeAtVertex(extrapolatedPerigee->clone()); } else { msg(MSG::ERROR) << " Extrapolation failed; VxTrackAtertex will not be updated" << endmsg; - }//end of successfull extrapolation check + } // end of successfull extrapolation check } else { msg(MSG::WARNING) << " The VxTrackAtVertex passed has no initial Parameters? This track will not be refitted" << endmsg; }//end of initial parameters protection check diff --git a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx index db7fc31e5d9..f341d90ad0c 100644 --- a/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx +++ b/Trigger/TrigAlgorithms/TrigFastTrackFinder/src/TrigFastTrackFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////// @@ -2928,7 +2928,10 @@ const Trk::Perigee* TrigFastTrackFinder::extrapolateDisTrackToBS(Trk::Track* t, Trk::PerigeeSurface persf(gp); const Trk::Perigee* vertexPerigee = 0; const Trk::Perigee* trackparPerigee = t->perigeeParameters(); - vertexPerigee = dynamic_cast(m_extrapolator->extrapolateDirectly((*trackparPerigee),persf)); + vertexPerigee = dynamic_cast(m_extrapolator->extrapolateDirectly( + Gaudi::Hive::currentContext(), + (*trackparPerigee), + persf)); return vertexPerigee; } diff --git a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx index b7a26f5e738..a6c34241b07 100644 --- a/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx +++ b/Trigger/TrigAlgorithms/TrigL2MuonSA/src/FtfRoadDefiner.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "FtfRoadDefiner.h" @@ -38,7 +38,6 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i double aw_ftf[3]={0.,0.,0.}; // slope of FTF Road for Inner/Middle/Outer double bw_ftf[3]={0.,0.,0.}; // intercept of FTF Road for Inner/Middle/Outer - // Inner auto extFtfInner = extTrack( idtrack, 4700., 7500., muonRoad.ext_ftf_flag[0][0]); if( !extFtfInner ) { @@ -148,6 +147,7 @@ StatusCode TrigL2MuonSA::FtfRoadDefiner::defineRoad(const xAOD::TrackParticle* i std::unique_ptr TrigL2MuonSA::FtfRoadDefiner::extTrack( const xAOD::TrackParticle* trk, const double R, const double halflength, int& extFlag ) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); const bool boundaryCheck = true; bool bCylinder = false; bool bDisk = false; @@ -156,7 +156,7 @@ std::unique_ptr TrigL2MuonSA::FtfRoadDefiner::extTra // Cylinder std::unique_ptr barrel = std::make_unique( R, Z ); - std::unique_ptr param1( m_extrapolator->extrapolate(*trk, *barrel, Trk::anyDirection, boundaryCheck, Trk::muon) ); + std::unique_ptr param1( m_extrapolator->extrapolate(ctx, *trk, *barrel, Trk::anyDirection, boundaryCheck, Trk::muon) ); if(param1){ bCylinder = true; ATH_MSG_DEBUG("Cylinder -> eta: " << param1->eta() << ", phi: " << param1->position().phi() << ", Z: " << param1->position().z() << ", Rms: " << std::hypot(param1->position().x(), param1->position().y())); @@ -168,7 +168,7 @@ std::unique_ptr TrigL2MuonSA::FtfRoadDefiner::extTra Amg::Transform3D matrix = Amg::Transform3D( Amg::Vector3D( 0.,0.,Z ) ); std::unique_ptr disc = std::make_unique( matrix, 0, R ); - std::unique_ptr param2( m_extrapolator->extrapolate(*trk, *disc, Trk::anyDirection, boundaryCheck, Trk::muon) ); + std::unique_ptr param2( m_extrapolator->extrapolate(ctx, *trk, *disc, Trk::anyDirection, boundaryCheck, Trk::muon) ); if(param2){ bDisk = true; ATH_MSG_DEBUG("Disk -> eta: " << param2->eta() << ", phi: " << param2->position().phi() << ", Z: " << param2->position().z() << ", Rms: " << std::hypot(param2->position().x(), param2->position().y())); diff --git a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx index 475bbaa9b77..298530feff9 100644 --- a/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx +++ b/Trigger/TrigAlgorithms/TrigmuComb/src/muComb.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** @@ -133,6 +133,7 @@ int muComb::g4Match(const xAOD::L2StandAloneMuon* feature, double& combPtInv, double& combPtRes, double& deta, double& dphi, double& chi2, int& ndof) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); chi2 = 1.0e30; ndof = 0; @@ -214,7 +215,7 @@ int muComb::g4Match(const xAOD::L2StandAloneMuon* feature, double id_eptinv = id_eipt; //now taken from Track itself ... std::unique_ptr muonPerigee - (m_backExtrapolatorG4->extrapolate(perigeeMS, beamSurface, Trk::oppositeMomentum, true, Trk::muon)); + (m_backExtrapolatorG4->extrapolate(ctx,perigeeMS, beamSurface, Trk::oppositeMomentum, true, Trk::muon)); //Protection against failing extrapolation double extr_eta; diff --git a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx index 86be5cc4ab8..a4020eebf43 100644 --- a/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx +++ b/Trigger/TrigMonitoring/TrigMuonMonitoringMT/src/MuonMatchingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include @@ -389,7 +389,8 @@ const Trk::TrackParameters* MuonMatchingTool :: extTrackToTGC( const xAOD::Track std::unique_ptr disc(new Trk::DiscSurface( matrix, 0., 15000.)); const bool boundaryCheck = true; - const Trk::TrackParameters* param = m_extrapolator->extrapolate(*trk, + const Trk::TrackParameters* param = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *trk, *disc, Trk::anyDirection, boundaryCheck, @@ -409,7 +410,8 @@ const Trk::TrackParameters* MuonMatchingTool :: extTrackToRPC( const xAOD::Track std::unique_ptr barrel(new Trk::CylinderSurface( 7478., 15000. )); const bool boundaryCheck = true; - const Trk::TrackParameters* param = m_extrapolator->extrapolate(*trk, + const Trk::TrackParameters* param = m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *trk, *barrel, Trk::anyDirection, boundaryCheck, diff --git a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx index 4497712aa25..d37cac78d6d 100644 --- a/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx +++ b/graphics/VP1/VP1Systems/VP1TrackSystems/src/TrackPropagationHelper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ @@ -264,7 +264,7 @@ bool TrackPropagationHelper::makePointsCharged( std::vector& poi return m_d->makePointsCharged_SinglePar(points,track,extrapolator,hypo); points.reserve(npars);//At least we need this. - + const EventContext& ctx = Gaudi::Hive::currentContext(); //Add a point for each parameter, and add extra points between them where appropriate. DataVector::const_iterator tsos_iter = track->trackStateOnSurfaces()->begin(); DataVector::const_iterator tsos_end = track->trackStateOnSurfaces()->end(); @@ -312,7 +312,10 @@ bool TrackPropagationHelper::makePointsCharged( std::vector& poi messageVerbose("Extrap value:"+str((extrapolator))); messageVerbose("trackParam:"+str((trackParam))); - const Trk::TrackParameters* trackPar = extrapolator->extrapolate(*trackParam,**bSurfsIt,Trk::alongMomentum,true,hypo); // change this to extrapolate current param to surface. + const Trk::TrackParameters* trackPar = extrapolator->extrapolate(ctx, + *trackParam, + **bSurfsIt, + Trk::alongMomentum,true,hypo); // change this to extrapolate current param to surface. if (trackPar){ messageVerbose("Extrapolation succeeded"); @@ -353,7 +356,10 @@ const Trk::TrackParameters * TrackPropagationHelper::Imp::extrapolateToNewPar( T const Trk::TrackParameters *newpars(nullptr); try { - newpars = extrapolator->extrapolate(*prevpars,surf,Trk::alongMomentum,false,hypo); // change this to extrapolate current param to surface. + newpars = extrapolator->extrapolate(Gaudi::Hive::currentContext(), + *prevpars, + surf, + Trk::alongMomentum,false,hypo); // change this to extrapolate current param to surface. } catch (const std::runtime_error& e) { theclass->message("Failure trying to use extrapolator for track (Exception thrown: " + QString(e.what())+")"); return nullptr; -- GitLab From 657c1c255ce6e3ea4e3239adba27cd09f2b5c1cc Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 14 Jan 2022 16:47:56 +0100 Subject: [PATCH 2/2] Fix remaining clients --- .../src/MooCandidateMatchingTool.cxx | 11 +++---- .../src/MuonRecoValidationTool.cxx | 5 +-- .../src/MuonExtrapolationTool.cxx | 19 ++++------- .../src/MuonLayerSegmentMatchingTool.cxx | 5 +-- .../TrkExInterfaces/IExtrapolator.h | 12 ++++--- .../src/TruthTrackBuilder.cxx | 32 +++++++++++++------ 6 files changed, 49 insertions(+), 35 deletions(-) diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx index 97d5b85d64a..6bb8e9c3698 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackSteeringTools/src/MooCandidateMatchingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MooCandidateMatchingTool.h" @@ -693,7 +693,6 @@ namespace Muon { info.reason = TrackSegmentMatchResult::NoSegmentPointer; return; } - int sector2 = m_idHelperSvc->sector(info.segmentChamberId); bool hasStereoAngle = false; @@ -856,12 +855,12 @@ namespace Muon { // Check sector- if (straightLineMatch && !entry1.hasMomentum()) { - exPars.reset(m_atlasExtrapolator->extrapolateDirectly(*tmpPars, entry2.segment->associatedSurface(), + exPars.reset(m_atlasExtrapolator->extrapolateDirectly(ctx, *tmpPars, entry2.segment->associatedSurface(), Trk::anyDirection, false, Trk::muon)); } else { ATH_MSG_VERBOSE(" Extrapolating to other segment " << m_printer->print(*tmpPars) << std::endl << Amg::toString(*tmpPars->covariance(), 10)); - exPars.reset(m_atlasExtrapolator->extrapolate(*tmpPars, entry2.segment->associatedSurface(), Trk::anyDirection, + exPars.reset(m_atlasExtrapolator->extrapolate(ctx, *tmpPars, entry2.segment->associatedSurface(), Trk::anyDirection, false, Trk::muon)); } } @@ -889,10 +888,10 @@ namespace Muon { // no closest measured parameters, take closest parameters if (straightLineMatch && !entry1.hasMomentum()) { - exPars.reset(m_atlasExtrapolator->extrapolateDirectly(*closestPars, entry2.segment->associatedSurface(), + exPars.reset(m_atlasExtrapolator->extrapolateDirectly(ctx, *closestPars, entry2.segment->associatedSurface(), Trk::anyDirection, false, Trk::muon)); } else { - exPars.reset(m_atlasExtrapolator->extrapolate(*closestPars, entry2.segment->associatedSurface(), Trk::anyDirection, + exPars.reset(m_atlasExtrapolator->extrapolate(ctx, *closestPars, entry2.segment->associatedSurface(), Trk::anyDirection, false, Trk::muon)); } if (!exPars) { diff --git a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonRecoValidationTool.cxx b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonRecoValidationTool.cxx index ca5220d44a6..4bde5dca173 100644 --- a/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonRecoValidationTool.cxx +++ b/MuonSpectrometer/MuonValidation/MuonRecValidation/MuonTrackPerformance/src/MuonRecoValidationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonTrackPerformance/MuonRecoValidationTool.h" @@ -306,6 +306,7 @@ namespace Muon { } bool MuonRecoValidationTool::add(const MuonSystemExtension::Intersection& intersection, const MuonSegment& segment, int stage) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); m_ntuple.segmentBlock.stage->push_back(stage); Identifier id = m_edmHelperSvc->chamberId(segment); @@ -348,7 +349,7 @@ namespace Muon { // extrapolate and create an intersection @ the segment surface. std::shared_ptr exPars( - m_extrapolator->extrapolate(*intersection.trackParameters, segment.associatedSurface(), Trk::anyDirection, false, Trk::muon)); + m_extrapolator->extrapolate(ctx, *intersection.trackParameters, segment.associatedSurface(), Trk::anyDirection, false, Trk::muon)); if (!exPars) { ATH_MSG_VERBOSE(" extrapolation failed "); m_ntuple.segmentBlock.quality->push_back(-2); diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/MuonExtrapolationTool.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/MuonExtrapolationTool.cxx index b3ba49b2fcf..af9026ae10f 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/MuonExtrapolationTool.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/src/MuonExtrapolationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ // MuonExtrapolationTool.cxx #include "DerivationFrameworkBPhys/MuonExtrapolationTool.h" @@ -115,6 +115,7 @@ StatusCode MuonExtrapolationTool::addBranches() const const Trk::TrackParameters* MuonExtrapolationTool::extrapolateToTriggerPivotPlane(const xAOD::TrackParticle& track) const { // BARREL + const EventContext& ctx = Gaudi::Hive::currentContext(); const Trk::Perigee& perigee = track.perigeeParameters(); // create the barrel as a cylinder surface centered at 0,0,0 @@ -132,11 +133,8 @@ const Trk::TrackParameters* MuonExtrapolationTool::extrapolateToTriggerPivotPlan // and then attempt to extrapolate our track to this surface, checking for the boundaries of the barrel bool boundaryCheck = true; const Trk::Surface* surface = cylinder; - const Trk::TrackParameters* p = m_extrapolator->extrapolate(perigee, - *surface, - Trk::alongMomentum, - boundaryCheck, - Trk::muon); + const Trk::TrackParameters* p = m_extrapolator->extrapolate( + ctx, perigee, *surface, Trk::alongMomentum, boundaryCheck, Trk::muon); delete cylinder; // if the extrapolation worked out (so we are in the barrel) we are done and can return the // track parameters at this surface. @@ -167,12 +165,9 @@ const Trk::TrackParameters* MuonExtrapolationTool::extrapolateToTriggerPivotPlan // for the endcap, we turn off the boundary check, extending the EC infinitely to catch stuff heading for the transition region boundaryCheck = false; surface = disc; - p = m_extrapolator->extrapolate(perigee, - *surface, - Trk::alongMomentum, - boundaryCheck, - Trk::muon); - delete disc; + p = m_extrapolator->extrapolate( + ctx, perigee, *surface, Trk::alongMomentum, boundaryCheck, Trk::muon); + delete disc; return p; } } diff --git a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonLayerSegmentMatchingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonLayerSegmentMatchingTool.cxx index 5c234442a6c..6ec79d270d9 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonLayerSegmentMatchingTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedTrackFindingTools/src/MuonLayerSegmentMatchingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "MuonLayerSegmentMatchingTool.h" @@ -23,6 +23,7 @@ namespace Muon { } bool MuonLayerSegmentMatchingTool::match(const MuonSystemExtension::Intersection& intersection, const MuonSegment& segment) const { + const EventContext& ctx = Gaudi::Hive::currentContext(); if (msgLvl(MSG::VERBOSE)) { const Trk::TrackParameters* pars = intersection.trackParameters.get(); msg(MSG::VERBOSE) << " startPars: phi " << pars->position().phi() << " r " << pars->position().perp() << " z " @@ -34,7 +35,7 @@ namespace Muon { } std::unique_ptr exPars( - m_extrapolator->extrapolate(*intersection.trackParameters, segment.associatedSurface(), Trk::anyDirection, false, Trk::muon)); + m_extrapolator->extrapolate(ctx,*intersection.trackParameters, segment.associatedSurface(), Trk::anyDirection, false, Trk::muon)); if (!exPars) { ATH_MSG_VERBOSE(" extrapolation failed "); return false; diff --git a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h b/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h index df9a25c2204..900274af0b7 100755 --- a/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h +++ b/Tracking/TrkExtrapolation/TrkExInterfaces/TrkExInterfaces/IExtrapolator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -37,11 +37,15 @@ static const InterfaceID IID_IExtrapolator("IExtrapolator", 1, 0); /** @class IExtrapolator + Interface class for the extrapolation AlgTool, it inherits from IAlgTool Detailed information about private members and member functions can be found in the actual implementation class Extrapolator which inherits from this one. + The ownership of the returned parameters is passed to caller. + @author Andreas.Salzburger@cern.ch + @author Christos Anastopoulos (Athena MT) */ class IPropagator; @@ -78,8 +82,8 @@ public: * ------------------------------------------------------------- */ /** N 0) Neutral parameters method - - returns a ParametersBase object as well, 0 if the extrapolation did not - succeed + - returns a ParametersBase object as well, nullptr if the extrapolation did not + succeed. */ virtual const NeutralParameters* extrapolate( @@ -132,7 +136,7 @@ public: - searches the closest TrackParameters of the Track to the destination Surface - returns the TrackParameters at the Destination Surface (if extrapolation - succeeds), 0 if extrapolation to destination surface does not suceed */ + succeeds), nullptr if extrapolation to destination surface does not suceed */ virtual const TrackParameters* extrapolate( const EventContext& ctx, const Track& trk, diff --git a/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx b/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx index 387e1fa05e6..0637e2d9c18 100644 --- a/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx +++ b/Tracking/TrkTruthTracks/TrkTruthTrackTools/src/TruthTrackBuilder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////// @@ -119,7 +119,7 @@ StatusCode Trk::TruthTrackBuilder::finalize() Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTraj, SegmentCollection* segs ) const { - + const EventContext& ctx = Gaudi::Hive::currentContext(); if( segs != nullptr ){ ATH_MSG_WARNING("Requested to fill segment collection but mode not implemented"); } @@ -160,10 +160,17 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr Trk::PerigeeSurface persurf; Trk::CurvilinearParameters startParams(startPos,startMom,charge); //minimal conversion; ideally the extrapolator would return a unique_ptr - auto per = std::unique_ptr(m_extrapolator->extrapolate(startParams,persurf,Trk::anyDirection,false,Trk::nonInteracting)); + auto per = std::unique_ptr( + m_extrapolator->extrapolate(ctx, + startParams, + persurf, + Trk::anyDirection, + false, + Trk::nonInteracting)); if (!per) { - ATH_MSG_DEBUG("Perigee creation for genParticle start position failed. Skipping track creation."); - return nullptr; + ATH_MSG_DEBUG("Perigee creation for genParticle start position failed. " + "Skipping track creation."); + return nullptr; } // first TrackStateOnSurface is the Perigee std::bitset typePattern; @@ -184,9 +191,16 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr if (surf==prevpar->associatedSurface()) continue; bool ispixel=false; if (m_DetID->is_pixel(clusters[i]->identify())) ispixel=true; - - auto thispar = std::unique_ptr(m_extrapolator->extrapolate(*prevpar,surf,Trk::alongMomentum,false,Trk::nonInteracting)); - if (!thispar) break; + + auto thispar = std::unique_ptr( + m_extrapolator->extrapolate(ctx, + *prevpar, + surf, + Trk::alongMomentum, + false, + Trk::nonInteracting)); + if (!thispar) + break; if (!surf.insideBounds(thispar->localPosition(),20*Gaudi::Units::mm,50*Gaudi::Units::mm)) { continue; } @@ -235,7 +249,7 @@ Trk::Track* Trk::TruthTrackBuilder::createTrack(const PRD_TruthTrajectory& prdTr std::unique_ptr prevpar(refittedtrack->trackParameters()->back()->uniqueClone()); for (;i<(int)clusters.size();i++) { const Trk::Surface *surf=&clusters[i]->detectorElement()->surface(clusters[i]->identify()); - std::unique_ptr thispar(m_extrapolator->extrapolate(*prevpar,*surf,Trk::alongMomentum,false,Trk::nonInteracting)); + std::unique_ptr thispar(m_extrapolator->extrapolate(ctx,*prevpar,*surf,Trk::alongMomentum,false,Trk::nonInteracting)); if (!thispar) break; const Trk::RIO_OnTrack *rot=m_rotcreatorbroad->correct(*clusters[i],*thispar); if (rot) measset.push_back(rot); -- GitLab