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
15//
16// method implementations
17//
18
19namespace CP
20{
21
22 StatusCode MuonIsolationAlg ::
23 initialize ()
24 {
25
26 ANA_CHECK (m_isolationTool.retrieve());
30 ANA_CHECK (m_systematicsList.initialize());
31
32 if (!m_nameSvc.empty())
33 {
34 ANA_CHECK (m_nameSvc.retrieve());
35 ANA_CHECK (m_nameSvc->addAcceptInfo (m_muonHandle.getNamePattern(), m_isolationHandle.getLabel(),
36 m_isolationTool->getMuonAcceptInfo()));
37 }
38
39 asg::AcceptData blankAccept {&m_isolationTool->getMuonAcceptInfo()};
40 m_setOnFail = selectionFromAccept(blankAccept);
41
42 return StatusCode::SUCCESS;
43 }
44
45
46
47 StatusCode MuonIsolationAlg ::
48 execute ()
49 {
50 for (const auto& sys : m_systematicsList.systematicsVector())
51 {
52 const xAOD::MuonContainer *muons = nullptr;
53 ANA_CHECK (m_muonHandle.retrieve (muons, sys));
54 for (const xAOD::Muon *muon : *muons)
55 {
56 if (m_preselection.getBool (*muon, sys))
57 {
58 m_isolationHandle.setBits
59 (*muon, selectionFromAccept (m_isolationTool->accept (*muon)), sys);
60 } else {
61 m_isolationHandle.setBits (*muon, m_setOnFail, sys);
62 }
63 }
64 }
65 return StatusCode::SUCCESS;
66 }
67}
#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".