ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
MuonID
MuonSelectorTools
src
MuonQualityUpdaterAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonQualityUpdaterAlg.h
"
6
7
#include "
xAODCore/ShallowCopy.h
"
8
#include "
xAODMuon/Muon.h
"
9
#include "
xAODMuon/MuonAuxContainer.h
"
10
#include "
xAODMuon/MuonContainer.h
"
11
#include "
AthContainers/CurrentContext.h
"
12
13
namespace
CP
{
14
15
MuonQualityUpdaterAlg::MuonQualityUpdaterAlg
(
const
std::string&
name
, ISvcLocator* svcloc) :
16
AthAlgorithm
(
name
, svcloc),
m_tool
(
"CP::MuonSelectionTool"
)
/*public tool*/
{
17
declareProperty
(
"Input"
,
m_input_muons
=
""
);
18
declareProperty
(
"Output"
,
m_output_muons
=
""
);
19
declareProperty
(
"Tool"
,
m_tool
);
20
}
21
22
StatusCode
MuonQualityUpdaterAlg::initialize
() {
23
if
(
m_input_muons
==
""
) {
24
ATH_MSG_ERROR
(
"You must specify an input muon collection"
);
25
return
StatusCode::FAILURE;
26
}
27
CHECK
(
m_tool
.retrieve());
28
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
MuonQualityUpdaterAlg::execute
(
const
EventContext&
/*ctx*/
) {
33
// fetch input collection
34
const
xAOD::MuonContainer
* muons = 0;
35
CHECK
(
evtStore
()->retrieve(muons,
m_input_muons
));
36
37
// create a shallow copy container for the outputs
38
auto
OutMuons =
xAOD::shallowCopy
(*muons);
39
40
for
(
xAOD::Muon
*
muon
: *OutMuons.first) {
41
m_tool
->setQuality(*
muon
);
42
m_tool
->setPassesIDCuts(*
muon
);
43
// m_tool->setPassesLowPtEfficiencyCuts(*muon);
44
}
45
46
CHECK
(
evtStore
()->record(std::move(OutMuons.first),
m_output_muons
));
47
CHECK
(
evtStore
()->record(std::move(OutMuons.second),
m_output_muons
+
"Aux."
));
48
49
return
StatusCode::SUCCESS;
50
}
51
52
}
// namespace CP
CurrentContext.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
MuonContainer.h
Muon.h
MuonAuxContainer.h
MuonQualityUpdaterAlg.h
ShallowCopy.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
CP::MuonQualityUpdaterAlg::initialize
virtual StatusCode initialize()
Definition
MuonQualityUpdaterAlg.cxx:22
CP::MuonQualityUpdaterAlg::m_tool
ToolHandle< CP::IMuonSelectionTool > m_tool
Definition
MuonQualityUpdaterAlg.h:24
CP::MuonQualityUpdaterAlg::execute
virtual StatusCode execute(const EventContext &ctx)
Execute method.
Definition
MuonQualityUpdaterAlg.cxx:32
CP::MuonQualityUpdaterAlg::m_output_muons
std::string m_output_muons
Definition
MuonQualityUpdaterAlg.h:23
CP::MuonQualityUpdaterAlg::m_input_muons
std::string m_input_muons
Definition
MuonQualityUpdaterAlg.h:22
CP::MuonQualityUpdaterAlg::MuonQualityUpdaterAlg
MuonQualityUpdaterAlg(const std::string &name, ISvcLocator *svcloc)
Definition
MuonQualityUpdaterAlg.cxx:15
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::shallowCopy
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
xAOD::Muon
Muon_v1 Muon
Reference the current persistent version:
Definition
Event/xAOD/xAODMuon/xAODMuon/Muon.h:13
xAOD::muon
@ muon
Definition
TrackingPrimitives.h:196
xAOD::MuonContainer
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
Definition
Event/xAOD/xAODMuon/xAODMuon/MuonContainer.h:14
Generated on
for ATLAS Offline Software by
1.17.0