Skip to content
Snippets Groups Projects
Commit 6ceb9feb authored by Savanna Shaw's avatar Savanna Shaw
Browse files

Make MuPatTrackBuilder reentrant

migrate MuPatTrackBuilder from AthAlgorithm to AthreentrantAlgorithm (ATR-22181)
parent e3d73893
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!38352Make MuPatTrackBuilder reentrant
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MuPatTrackBuilder.h" #include "MuPatTrackBuilder.h"
...@@ -39,11 +39,11 @@ StatusCode MuPatTrackBuilder::initialize() ...@@ -39,11 +39,11 @@ StatusCode MuPatTrackBuilder::initialize()
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
StatusCode MuPatTrackBuilder::execute() StatusCode MuPatTrackBuilder::execute(const EventContext& ctx) const
{ {
typedef std::vector<const Muon::MuonSegment*> MuonSegmentCollection; typedef std::vector<const Muon::MuonSegment*> MuonSegmentCollection;
SG::ReadHandle<Trk::SegmentCollection> segmentColl (m_segmentKey); SG::ReadHandle<Trk::SegmentCollection> segmentColl (m_segmentKey, ctx);
if (!segmentColl.isValid() ) { if (!segmentColl.isValid() ) {
msg(MSG::WARNING) << "Could not find MuonSegmentCollection at " << segmentColl.name() <<endmsg; msg(MSG::WARNING) << "Could not find MuonSegmentCollection at " << segmentColl.name() <<endmsg;
return StatusCode::RECOVERABLE; return StatusCode::RECOVERABLE;
...@@ -72,7 +72,7 @@ StatusCode MuPatTrackBuilder::execute() ...@@ -72,7 +72,7 @@ StatusCode MuPatTrackBuilder::execute()
TrackCollection * newtracks = m_trackMaker->find(msc); TrackCollection * newtracks = m_trackMaker->find(msc);
if (!newtracks) newtracks = new TrackCollection(); if (!newtracks) newtracks = new TrackCollection();
SG::WriteHandle<TrackCollection> spectroTracks(m_spectroTrackKey); SG::WriteHandle<TrackCollection> spectroTracks(m_spectroTrackKey, ctx);
if (spectroTracks.record(std::unique_ptr<TrackCollection>(newtracks)).isFailure()){ if (spectroTracks.record(std::unique_ptr<TrackCollection>(newtracks)).isFailure()){
ATH_MSG_WARNING( "New Track Container " << spectroTracks.name() << " could not be recorded in StoreGate !"); ATH_MSG_WARNING( "New Track Container " << spectroTracks.name() << " could not be recorded in StoreGate !");
return StatusCode::RECOVERABLE; return StatusCode::RECOVERABLE;
......
/* /*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef MUPATTRACKBUILDER_H #ifndef MUPATTRACKBUILDER_H
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <string> #include <string>
#include "AthenaBaseComps/AthAlgorithm.h" #include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
#include "TrkSegment/SegmentCollection.h" #include "TrkSegment/SegmentCollection.h"
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
#include "AthenaMonitoringKernel/GenericMonitoringTool.h" #include "AthenaMonitoringKernel/GenericMonitoringTool.h"
#include "AthenaMonitoringKernel/Monitored.h" #include "AthenaMonitoringKernel/Monitored.h"
class MuPatTrackBuilder : public AthAlgorithm class MuPatTrackBuilder : public AthReentrantAlgorithm
{ {
public: public:
using AthAlgorithm::AthAlgorithm; using AthReentrantAlgorithm::AthReentrantAlgorithm;
public: public:
virtual StatusCode initialize() override; virtual StatusCode initialize() override;
virtual StatusCode execute() override; virtual StatusCode execute(const EventContext& ctx) const override;
private: private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment