ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigMuonEF
src
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
7
#include "
GetL2CBmuonInDetTracksAlg.h
"
8
#include "
xAODTracking/TrackParticleAuxContainer.h
"
9
10
GetL2CBmuonInDetTracksAlg::GetL2CBmuonInDetTracksAlg
(
const
std::string& name, ISvcLocator* pSvcLocator )
11
:
AthReentrantAlgorithm
(name, pSvcLocator)
12
{
13
}
14
15
StatusCode
GetL2CBmuonInDetTracksAlg::initialize
(){
16
17
ATH_CHECK
(
m_muonL2CBContainerKey
.initialize());
18
ATH_CHECK
(
m_idTrackOutputKey
.initialize());
19
return
StatusCode::SUCCESS;
20
}
21
22
StatusCode
GetL2CBmuonInDetTracksAlg::execute
(
const
EventContext& ctx)
const
23
{
24
25
SG::WriteHandle<xAOD::TrackParticleContainer>
wh_outidtracks(
m_idTrackOutputKey
, ctx);
26
ATH_CHECK
(wh_outidtracks.
record
(std::make_unique<xAOD::TrackParticleContainer>(), std::make_unique<xAOD::TrackParticleAuxContainer>()));
27
xAOD::TrackParticleContainer
*idtracksout = wh_outidtracks.
ptr
();
28
29
SG::ReadHandle<xAOD::L2CombinedMuonContainer>
cbMuons(
m_muonL2CBContainerKey
, ctx);
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
GetL2CBmuonInDetTracksAlg.h
TrackParticleAuxContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
GetL2CBmuonInDetTracksAlg::initialize
virtual StatusCode initialize() override
initialize
Definition
GetL2CBmuonInDetTracksAlg.cxx:15
GetL2CBmuonInDetTracksAlg::GetL2CBmuonInDetTracksAlg
GetL2CBmuonInDetTracksAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
GetL2CBmuonInDetTracksAlg.cxx:10
GetL2CBmuonInDetTracksAlg::m_muonL2CBContainerKey
SG::ReadHandleKey< xAOD::L2CombinedMuonContainer > m_muonL2CBContainerKey
Definition
GetL2CBmuonInDetTracksAlg.h:32
GetL2CBmuonInDetTracksAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
execute the filter alg
Definition
GetL2CBmuonInDetTracksAlg.cxx:22
GetL2CBmuonInDetTracksAlg::m_idTrackOutputKey
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_idTrackOutputKey
Definition
GetL2CBmuonInDetTracksAlg.h:33
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::VarHandleBase::isPresent
bool isPresent() const
Is the referenced object present in SG?
Definition
StoreGate/src/VarHandleBase.cxx:400
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::TrackParticleContainer
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticleContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0