ATLAS Offline Software
Loading...
Searching...
No Matches
GetL2CBmuonInDetTracksAlg.cxx
Go to the documentation of this file.
1/*
2 Get muon ID tracks from L2CB muons
3
4 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5*/
6
9
10GetL2CBmuonInDetTracksAlg::GetL2CBmuonInDetTracksAlg(const std::string& name, ISvcLocator* pSvcLocator )
11:AthReentrantAlgorithm(name, pSvcLocator)
12{
13}
14
16
18 ATH_CHECK(m_idTrackOutputKey.initialize());
19 return StatusCode::SUCCESS;
20}
21
22StatusCode GetL2CBmuonInDetTracksAlg::execute(const EventContext& ctx) const
23{
24
26 ATH_CHECK(wh_outidtracks.record(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
27 xAOD::TrackParticleContainer *idtracksout = wh_outidtracks.ptr();
28
30 ATH_CHECK(cbMuons.isPresent());
31 ATH_MSG_DEBUG("adding combined muon container with size: "<<cbMuons->size());
32
33 for(auto cbmuon : *cbMuons) {
34 if(cbmuon->idTrack()) idtracksout->push_back(new xAOD::TrackParticle(*cbmuon->idTrack()));
35 }
36 ATH_MSG_DEBUG("output ID muon tracks with size: " << idtracksout->size());
37 return StatusCode::SUCCESS;
38
39}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
An algorithm that can be simultaneously executed in multiple threads.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
virtual StatusCode initialize() override
initialize
GetL2CBmuonInDetTracksAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_muonL2CBContainerKey
virtual StatusCode execute(const EventContext &ctx) const override
execute the filter alg
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_idTrackOutputKey
bool isPresent() const
Is the referenced object present in SG?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".