From f38e9cf7913878e1e1904d4219698835321b7316 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 19 May 2022 20:09:44 +0200 Subject: [PATCH] egammaTrkRefitter rm practically un-needed methods --- .../share/ElectronEoverPTracking.py | 4 -- .../src/IDPerfMonEoverP.cxx | 15 +++--- .../egammaInterfaces/IegammaTrkRefitterTool.h | 10 ---- .../src/egammaTrkRefitterTool.cxx | 53 ------------------- .../src/egammaTrkRefitterTool.h | 17 ------ 5 files changed, 9 insertions(+), 90 deletions(-) diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py index 4b5ddef00c0..e6fcc0ec694 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/share/ElectronEoverPTracking.py @@ -181,7 +181,6 @@ ElectronRefitterTool = egammaTrkRefitterTool(name='ElectronRefitterTool', # FitterTool = GSFTrackFitter, FitterTool=GX2TrackFitter, matEffects=3, - minNoSiHits=-1, useBeamSpot=False, OutputLevel =4) ToolSvc += ElectronRefitterTool @@ -190,7 +189,6 @@ ToolSvc += ElectronRefitterTool ElectronRefitterTool2 = egammaTrkRefitterTool(name = 'ElectronRefitterTool2', FitterTool = GX2TrackFitter, matEffects = 3, - minNoSiHits = -1, RemoveTRTHits = True, useBeamSpot = False, OutputLevel =4) @@ -199,7 +197,6 @@ ToolSvc += ElectronRefitterTool2 MuonRefitterTool = egammaTrkRefitterTool(name = 'MuonRefitterTool', FitterTool = GX2TrackFitter, matEffects = 2, - minNoSiHits = -1, useBeamSpot = False, OutputLevel =4) ToolSvc += MuonRefitterTool @@ -208,7 +205,6 @@ ToolSvc += MuonRefitterTool MuonRefitterToolIDSiOnly = egammaTrkRefitterTool(name = 'MuonRefitterToolIDSiOnly', FitterTool = GX2TrackFitter, matEffects = 2, - minNoSiHits = -1, RemoveTRTHits = True, useBeamSpot = False, OutputLevel =4) diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx index 5d6d9e59ab7..06ac6ad95da 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx @@ -572,8 +572,9 @@ StatusCode IDPerfMonEoverP::execute() ATH_MSG_DEBUG( "Refitting the track" ); IegammaTrkRefitterTool::Cache cache1{}; - StatusCode sc = m_TrackRefitter->refitElectronTrack(Gaudi::Hive::currentContext(), - pThisElectron,cache1); + StatusCode sc = m_TrackRefitter->refitTrack(Gaudi::Hive::currentContext(), + pThisElectron->trackParticle()->track(), + cache1); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache1.refittedTrack.release(); m_refittedTracks_no1->push_back(trkTrack); @@ -588,8 +589,9 @@ StatusCode IDPerfMonEoverP::execute() ATH_MSG_DEBUG( "Refitting the track again" ); IegammaTrkRefitterTool::Cache cache2{}; - sc = m_TrackRefitter_no2->refitElectronTrack(Gaudi::Hive::currentContext(), - pThisElectron,cache2 ); + sc = m_TrackRefitter_no2->refitTrack(Gaudi::Hive::currentContext(), + pThisElectron->trackParticle()->track(), + cache2 ); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache2.refittedTrack.release(); //Add the refitted track to the TrackCollection @@ -615,8 +617,9 @@ StatusCode IDPerfMonEoverP::execute() for( const auto & thisGoodElectron: goodElectrons){ IegammaTrkRefitterTool::Cache cache{}; - StatusCode sc = m_TrackRefitter->refitElectronTrack(Gaudi::Hive::currentContext(), - (*ElectronInput_container)[thisGoodElectron],cache ); + StatusCode sc = m_TrackRefitter->refitTrack(Gaudi::Hive::currentContext(), + (*ElectronInput_container)[thisGoodElectron]->trackParticle()->track(), + cache ); if (sc == StatusCode::SUCCESS){ Trk::Track* trkTrack= cache.refittedTrack.release(); selectedElectrons->push_back(trkTrack); diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaTrkRefitterTool.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaTrkRefitterTool.h index f8490eb9378..a69a1d93a84 100755 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaTrkRefitterTool.h +++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/IegammaTrkRefitterTool.h @@ -55,16 +55,6 @@ class IegammaTrkRefitterTool : virtual public IAlgTool } }; - /** Refit the track associated with an xAODEgamma object*/ - virtual StatusCode refitElectronTrack(const EventContext& ctx, - const xAOD::Electron* eg , - Cache& result) const = 0; - - /** Refit the track associated with a track particle object*/ - virtual StatusCode refitTrackParticle(const EventContext& ctx, - const xAOD::TrackParticle*, - Cache& result) const = 0; - /** Refit the track*/ virtual StatusCode refitTrack(const EventContext& ctx, const Trk::Track*, diff --git a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx index 3942d3d6bc3..c8004822739 100644 --- a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx +++ b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.cxx @@ -78,59 +78,6 @@ egammaTrkRefitterTool::finalize() return StatusCode::SUCCESS; } -StatusCode -egammaTrkRefitterTool::refitElectronTrack(const EventContext& ctx, - const xAOD::Electron* eg, - Cache& cache) const -{ - ATH_MSG_DEBUG("Refitting a track associated with an electron"); - // protection against bad pointers - if (eg == nullptr) - return StatusCode::SUCCESS; - // Set the pointer to the egamma object. - cache.electron = eg; - const xAOD::TrackParticle* trackParticle = eg->trackParticle(); - return refitTrackParticle(ctx, trackParticle, cache); -} - -StatusCode -egammaTrkRefitterTool::refitTrackParticle( - const EventContext& ctx, - const xAOD::TrackParticle* trackParticle, - Cache& cache) const -{ - ATH_MSG_DEBUG("Refitting a track associated with a TrackParticle"); - // protection against bad pointers - if (!trackParticle) { - ATH_MSG_DEBUG("No TrackParticle"); - return StatusCode::FAILURE; - } - int nSiliconHits_trk(0); - uint8_t dummy(0); - if (trackParticle->summaryValue(dummy, xAOD::numberOfSCTHits)) { - nSiliconHits_trk += dummy; - } - if (trackParticle->summaryValue(dummy, xAOD::numberOfPixelHits)) { - nSiliconHits_trk += dummy; - } - - if (nSiliconHits_trk <= m_MinNoSiHits) { - ATH_MSG_DEBUG( - "Not enough Si hits on track particle. The current min is set at " - << m_MinNoSiHits); - return StatusCode::FAILURE; - } - - if (trackParticle->trackLink().isValid()) { - // retrieve and refit original track - return refitTrack(ctx, trackParticle->track(), cache); - } - ATH_MSG_WARNING("Could not get TrackElementLink of the TrackParticle"); - return StatusCode::FAILURE; - - return StatusCode::SUCCESS; -} - StatusCode egammaTrkRefitterTool::refitTrack(const EventContext& ctx, const Trk::Track* track, diff --git a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.h b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.h index a1749822461..6bf13b5e89a 100644 --- a/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.h +++ b/Reconstruction/egamma/egammaTrackTools/src/egammaTrkRefitterTool.h @@ -59,15 +59,6 @@ public: virtual StatusCode finalize() override; typedef IegammaTrkRefitterTool::Cache Cache; - /** @brief Refit the track associated with an egamma object*/ - virtual StatusCode refitElectronTrack(const EventContext& ctx, - const xAOD::Electron*, - Cache& cache) const override final; - - /** @brief Refit a track assoicated to a TrackParticle*/ - virtual StatusCode refitTrackParticle(const EventContext& ctx, - const xAOD::TrackParticle*, - Cache& cache) const override final; /** @brief Refit a track*/ virtual StatusCode refitTrack(const EventContext& ctx, @@ -143,14 +134,6 @@ private: "Type of material interaction in extrapolation (Default Electron)" }; - /** @brief Minimum number of silicon hits on track before it is allowed to be - * refitted*/ - Gaudi::Property m_MinNoSiHits{ this, - "minNoSiHits", - 3, - "Minimum number of silicon hits on track " - "before it is allowed to be refitted" }; - /** @brief Particle Hypothesis*/ Trk::ParticleHypothesis m_ParticleHypothesis; -- GitLab