ATLAS Offline Software
Loading...
Searching...
No Matches
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
14#include "PATCore/AcceptData.h"
15
16//
17// method implementations
18//
19
20namespace CP
21{
22
23 StatusCode MuonIsolationAlg ::
24 initialize ()
25 {
26
27 ANA_CHECK (m_isolationTool.retrieve());
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}
#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 isolation 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".