ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCombinedMuonCandidateAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7MuonCombinedMuonCandidateAlg::MuonCombinedMuonCandidateAlg(const std::string& name, ISvcLocator* pSvcLocator) :
8 AthReentrantAlgorithm(name, pSvcLocator) {}
9
14 ATH_CHECK(m_msOnlyTracks.initialize());
15 return StatusCode::SUCCESS;
16}
17
18StatusCode MuonCombinedMuonCandidateAlg::execute(const EventContext& ctx) const {
19 // retrieve MuonSpectrometer tracks
21 if (!muonTrackParticles.isValid()) {
22 ATH_MSG_ERROR("Could not read " << m_muonTrackParticleLocation);
23 return StatusCode::FAILURE;
24 }
25 if (!muonTrackParticles.isPresent()) {
27 return StatusCode::SUCCESS;
28 }
30 ATH_CHECK(muonCandidates.record(std::make_unique<MuonCandidateCollection>()));
32 ATH_CHECK(msOnlyTracks.record(std::make_unique<TrackCollection>()));
33 m_muonCandidateTool->create(*muonTrackParticles, *muonCandidates, *msOnlyTracks, ctx);
34
35 return StatusCode::SUCCESS;
36}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< MuonCandidateCollection > m_candidateCollectionName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_muonTrackParticleLocation
MuonCombinedMuonCandidateAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< TrackCollection > m_msOnlyTracks
ToolHandle< MuonCombined::IMuonCandidateTool > m_muonCandidateTool
virtual bool isValid() override final
Can the handle be successfully dereferenced?
bool isPresent() const
Is the referenced object present in SG?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.