diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt index bbd1b672efecf4b73183649453ebc722897495e0..248bdb7638ff33a87901cfc123a501b5d81d3200 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/CMakeLists.txt @@ -12,7 +12,6 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/GeoPrimitives Event/EventPrimitives GaudiKernel - Tracking/TrkDetDescr/TrkDetDescrInterfaces Tracking/TrkDetDescr/TrkGeometry Tracking/TrkDetDescr/TrkSurfaces Tracking/TrkEvent/TrkEventPrimitives @@ -27,29 +26,29 @@ atlas_depends_on_subdirs( PUBLIC Tracking/TrkTools/TrkToolInterfaces PRIVATE Control/CxxUtils - Event/xAOD/xAODEventInfo Tools/PathResolver Tracking/TrkDetDescr/TrkDetElementBase - Tracking/TrkDetDescr/TrkVolumes Tracking/TrkEvent/TrkCaloCluster_OnTrack Tracking/TrkEvent/TrkMeasurementBase Tracking/TrkEvent/TrkPrepRawData Tracking/TrkEvent/TrkPseudoMeasurementOnTrack Tracking/TrkEvent/TrkRIO_OnTrack - Tracking/TrkEvent/TrkTrack ) + Tracking/TrkEvent/TrkTrack + Tracking/TrkEvent/TrkParametersBase + ) # External dependencies: find_package( Eigen ) -# Component(s) in the package: +#Component(s) in the package: atlas_add_component( TrkGaussianSumFilter src/*.cxx src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives EventPrimitives GaudiKernel TrkDetDescrInterfaces TrkGeometry - TrkSurfaces TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkMultiComponentStateOnSurface TrkParameters TrkExInterfaces TrkExUtils TrkFitterInterfaces - TrkFitterUtils TrkToolInterfaces CxxUtils xAODEventInfo PathResolver TrkDetElementBase TrkVolumes TrkCaloCluster_OnTrack TrkMeasurementBase - TrkPrepRawData TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkTrack ) + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives EventPrimitives GaudiKernel TrkGeometry TrkSurfaces + TrkEventPrimitives TrkEventUtils TrkMaterialOnTrack TrkMultiComponentStateOnSurface TrkParameters TrkExInterfaces TrkExUtils TrkFitterInterfaces + TrkFitterUtils TrkToolInterfaces CxxUtils PathResolver TrkDetElementBase TrkCaloCluster_OnTrack TrkMeasurementBase TrkPrepRawData + TrkPseudoMeasurementOnTrack TrkRIO_OnTrack TrkTrack TrkParametersBase) # Install files from the package: atlas_install_headers( TrkGaussianSumFilter ) diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h index 91b98ac3fc2f1876b5ac7c1a79e9704cfe6079f8..38c10489cb58010da2a3a679283feff3a239cce1 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/ForwardGsfFitter.h @@ -2,15 +2,12 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/* ******************************************************************************* - ForwardGsfFitter.h - description - ---------------------------------- -begin : Wednesday 9th March 2005 -author : atkinson -email : Tom.Atkinson@cern.ch -decription : Class definition for the forward GSF fitter -********************************************************************************** -*/ +/** + * @file ForwardGsfFitter.h + * @date Wednesday 9th March 2005 + * @author Tom Athkinson, Anthony Morley, Christos Anastopoulos + * @brief Class definition for the forward GSF fitter + */ #ifndef TrkForwardGsfFitter_H #define TrkForwardGsfFitter_H @@ -60,6 +57,7 @@ public: /** Forward GSF fit using PrepRawData */ virtual std::unique_ptr<ForwardTrajectory> fitPRD( + const EventContext& ctx, const PrepRawDataSet&, const TrackParameters&, const ParticleHypothesis particleHypothesis = @@ -67,6 +65,7 @@ public: /** Forward GSF fit using MeasurementSet */ virtual std::unique_ptr<ForwardTrajectory> fitMeasurements( + const EventContext& ctx, const MeasurementSet&, const TrackParameters&, const ParticleHypothesis particleHypothesis = @@ -78,6 +77,7 @@ public: private: /** Progress one step along the fit */ bool stepForwardFit( + const EventContext& ctx, ForwardTrajectory*, const PrepRawData*, const MeasurementBase*, diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h index 0193e7adb93726d41bbb82967453b7922e354c38..ebc4bbd4c79144dd3670c40c46a966ac6ab82965 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/TrkGaussianSumFilter/IForwardGsfFitter.h @@ -2,15 +2,13 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/* ******************************************************************************* - IForwardGsfFitter.h - description - ---------------------------------- -created : Thursday 8th January 2009 -authors : amorley,christos -email : Anthony.Morley@cern.ch -decription : Abstract interface for the forward GSF fitter -********************************************************************************** -*/ + +/** + * @file IForwardGsfFitter.h + * @date Thursday 8th January 2009 + * @author Anthony Morley, Christos Anastopoulos + * @brief Abstract interface for the forward GSF fitter + */ #ifndef TrkIForwardGsfFitter_H #define TrkIForwardGsfFitter_H @@ -21,6 +19,7 @@ decription : Abstract interface for the forward GSF fitter #include "TrkFitterUtils/FitterTypes.h" #include "TrkMultiComponentStateOnSurface/MultiComponentState.h" #include "TrkParameters/TrackParameters.h" +#include "GaudiKernel/EventContext.h" #include <memory> namespace Trk { @@ -56,12 +55,14 @@ public: /** Forward GSF fit using PrepRawData */ virtual std::unique_ptr<ForwardTrajectory> fitPRD( + const EventContext& ctx, const PrepRawDataSet&, const TrackParameters&, const ParticleHypothesis particleHypothesis = nonInteracting) const = 0; /** Forward GSF fit using MeasurementSet */ virtual std::unique_ptr<ForwardTrajectory> fitMeasurements( + const EventContext& ctx, const MeasurementSet&, const TrackParameters&, const ParticleHypothesis particleHypothesis = nonInteracting) const = 0; diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx index 8d3b574cca28536d15d0874d04d520eb92a3f264..12ab02457be411564eac4fe1300c78af4ee5336b 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/ForwardGsfFitter.cxx @@ -2,18 +2,14 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ -/* ******************************************************************************* - ForwardGsfFitter.cxx - description - ------------------------------------ -begin : Wednesday 9th March 2005 -author : amorley, atkinson -email : Anthony.Morley@cern.ch, Tom.Atkinson@cern.ch -decription : Implementation code for ForwardGsfFitter class -********************************************************************************** -*/ +/** + * @file ForwardGsfFitter.cxx + * @date Wednesday 9th March 2005 + * @author Tom Athkinson, Anthony Morley, Christos Anastopoulos + * @brief Implementation code for ForwardGsfFitter class + */ #include "TrkGaussianSumFilter/ForwardGsfFitter.h" - #include "TrkMultiComponentStateOnSurface/MultiComponentStateOnSurface.h" #include "TrkGaussianSumFilter/IMultiStateExtrapolator.h" @@ -94,33 +90,12 @@ Trk::ForwardGsfFitter::configureTools( std::unique_ptr<Trk::ForwardTrajectory> Trk::ForwardGsfFitter::fitPRD( + const EventContext& ctx, const Trk::PrepRawDataSet& inputPrepRawDataSet, const Trk::TrackParameters& estimatedTrackParametersNearOrigin, const Trk::ParticleHypothesis particleHypothesis) const { - // Check that the updator is instansiated - if (!m_updator) { - ATH_MSG_ERROR("The measurement updator is not configured... Exiting!"); - return nullptr; - } - - if (!m_extrapolator) { - ATH_MSG_ERROR("The extrapolator is not configured... Exiting!"); - return nullptr; - } - - if (!m_rioOnTrackCreator) { - ATH_MSG_ERROR("The RIO_OnTrackCreator is not configured for use with the " - "PrepRawData set... Exiting!"); - return nullptr; - } - - if (inputPrepRawDataSet.empty()) { - ATH_MSG_ERROR("Input PrepRawDataSet is empty... Exiting!"); - return nullptr; - } - // Configure for forwards filtering material effects overide Trk::ParticleHypothesis configuredParticleHypothesis; @@ -173,6 +148,7 @@ Trk::ForwardGsfFitter::fitPRD( // Every valid step the ForwardTrajectory object passed to the // stepForwardFit method is updated bool stepIsValid = stepForwardFit( + ctx, forwardTrajectory.get(), *prepRawData, nullptr, @@ -195,6 +171,7 @@ Trk::ForwardGsfFitter::fitPRD( std::unique_ptr<Trk::ForwardTrajectory> Trk::ForwardGsfFitter::fitMeasurements( + const EventContext& ctx, const Trk::MeasurementSet& inputMeasurementSet, const Trk::TrackParameters& estimatedTrackParametersNearOrigin, const Trk::ParticleHypothesis particleHypothesis) const @@ -252,7 +229,8 @@ Trk::ForwardGsfFitter::fitMeasurements( for (; measurement != inputMeasurementSet.end(); ++measurement) { - bool stepIsValid = stepForwardFit(forwardTrajectory.get(), + bool stepIsValid = stepForwardFit(ctx, + forwardTrajectory.get(), nullptr, *measurement, (*measurement)->associatedSurface(), @@ -273,6 +251,7 @@ Trk::ForwardGsfFitter::fitMeasurements( bool Trk::ForwardGsfFitter::stepForwardFit( + const EventContext& ctx, ForwardTrajectory* forwardTrajectory, const Trk::PrepRawData* originalPrepRawData, const Trk::MeasurementBase* originalMeasurement, @@ -296,7 +275,7 @@ Trk::ForwardGsfFitter::stepForwardFit( // Extrapolate multi-component state to the next measurement surface // ================================================================= Trk::MultiComponentState extrapolatedState = - m_extrapolator->extrapolate(Gaudi::Hive::currentContext(), + m_extrapolator->extrapolate(ctx, updatedState, surface, Trk::alongMomentum, diff --git a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx index 7f9f920f38cf6dd971b18ae48ba55f55f4a48e38..eff345b24e9fbc0c5e08a26d1d1f471974ad583b 100644 --- a/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx +++ b/Tracking/TrkFitter/TrkGaussianSumFilter/src/GaussianSumFitter.cxx @@ -320,11 +320,14 @@ Trk::GaussianSumFitter::fit( prdComparisonFunction); } + const EventContext& ctx= Gaudi::Hive::currentContext(); // Perform GSF forwards fit ForwardTrajectory* forwardTrajectory = m_forwardGsfFitter - ->fitPRD( - sortedPrepRawDataSet, estimatedParametersNearOrigin, particleHypothesis) + ->fitPRD(ctx, + sortedPrepRawDataSet, + estimatedParametersNearOrigin, + particleHypothesis) .release(); if (!forwardTrajectory) { @@ -340,7 +343,6 @@ Trk::GaussianSumFitter::fit( return nullptr; } - const EventContext& ctx= Gaudi::Hive::currentContext(); // Perform GSF smoother operation SmoothedTrajectory* smoothedTrajectory = m_gsfSmoother->fit(ctx,*forwardTrajectory, particleHypothesis); @@ -462,11 +464,15 @@ Trk::GaussianSumFitter::fit( sortedMeasurementSet.end(), measurementBaseComparisonFunction); } + + const EventContext& ctx = Gaudi::Hive::currentContext(); // Perform GSF forwards fit - new memory allocated in forwards fitter ForwardTrajectory* forwardTrajectory = m_forwardGsfFitter - ->fitMeasurements( - sortedMeasurementSet, estimatedParametersNearOrigin, particleHypothesis) + ->fitMeasurements(ctx, + sortedMeasurementSet, + estimatedParametersNearOrigin, + particleHypothesis) .release(); if (!forwardTrajectory) { @@ -484,7 +490,6 @@ Trk::GaussianSumFitter::fit( // Perform GSF smoother operation - const EventContext& ctx = Gaudi::Hive::currentContext(); SmoothedTrajectory* smoothedTrajectory = m_gsfSmoother->fit(ctx, *forwardTrajectory, particleHypothesis, ccot);