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