ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
MuonAnalysisAlgorithms
Root
MuonIsolationAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
9
//
10
// includes
11
//
12
13
#include <
MuonAnalysisAlgorithms/MuonIsolationAlg.h
>
14
#include "
PATCore/AcceptData.h
"
15
16
//
17
// method implementations
18
//
19
20
namespace
CP
21
{
22
23
StatusCode MuonIsolationAlg ::
24
initialize ()
25
{
26
27
ANA_CHECK
(
m_isolationTool
.retrieve());
28
ANA_CHECK
(
m_muonHandle
.initialize (
m_systematicsList
));
29
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_muonHandle
,
SG::AllowEmpty
));
30
ANA_CHECK
(
m_isolationHandle
.initialize (
m_systematicsList
,
m_muonHandle
));
31
ANA_CHECK
(
m_systematicsList
.initialize());
32
33
if
(!
m_nameSvc
.empty())
34
{
35
ANA_CHECK
(
m_nameSvc
.retrieve());
36
ANA_CHECK
(
m_nameSvc
->addAcceptInfo (
m_muonHandle
.getNamePattern(),
m_isolationHandle
.getLabel(),
37
m_isolationTool
->getMuonAcceptInfo()));
38
}
39
40
asg::AcceptData
blankAccept {&
m_isolationTool
->getMuonAcceptInfo()};
41
m_setOnFail
=
selectionFromAccept
(blankAccept);
42
43
return
StatusCode::SUCCESS;
44
}
45
46
47
48
StatusCode MuonIsolationAlg ::
49
execute (
const
EventContext& ctx)
50
{
51
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
52
{
53
const
xAOD::MuonContainer
*muons =
nullptr
;
54
ANA_CHECK
(
m_muonHandle
.retrieve (muons, sys, ctx));
55
for
(
const
xAOD::Muon
*
muon
: *muons)
56
{
57
if
(
m_preselection
.getBool (*
muon
, sys))
58
{
59
m_isolationHandle
.setBits
60
(*
muon
,
selectionFromAccept
(
m_isolationTool
->accept (*
muon
)), sys);
61
}
else
{
62
m_isolationHandle
.setBits (*
muon
,
m_setOnFail
, sys);
63
}
64
}
65
}
66
return
StatusCode::SUCCESS;
67
}
68
}
AcceptData.h
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
MuonIsolationAlg.h
CP::MuonIsolationAlg::m_setOnFail
SelectionType m_setOnFail
the bits to set for an object failing the preselection
Definition
MuonIsolationAlg.h:64
CP::MuonIsolationAlg::m_muonHandle
SysReadHandle< xAOD::MuonContainer > m_muonHandle
the muon collection we run on
Definition
MuonIsolationAlg.h:45
CP::MuonIsolationAlg::m_nameSvc
ServiceHandle< ISelectionNameSvc > m_nameSvc
the ISelectionNameSvc
Definition
MuonIsolationAlg.h:60
CP::MuonIsolationAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
MuonIsolationAlg.h:41
CP::MuonIsolationAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
MuonIsolationAlg.h:50
CP::MuonIsolationAlg::m_isolationTool
ToolHandle< IIsolationSelectionTool > m_isolationTool
the isolation tool
Definition
MuonIsolationAlg.h:37
CP::MuonIsolationAlg::m_isolationHandle
SysWriteSelectionHandle m_isolationHandle
the decoration for the muon isolation
Definition
MuonIsolationAlg.h:55
asg::AcceptData
Definition
AcceptData.h:31
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::selectionFromAccept
SelectionType selectionFromAccept(const asg::AcceptData &accept)
the selection decoration made from the given AcceptData object
Definition
SelectionHelpers.cxx:32
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:29
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