ATLAS Offline Software
Loading...
Searching...
No Matches
MuonCalibrationAndSmearingAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 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 MuonCalibrationAndSmearingAlg ::
25 initialize ()
26 {
31 ANA_CHECK (m_systematicsList.initialize());
32 ANA_CHECK (m_outOfValidity.initialize());
33 return StatusCode::SUCCESS;
34 }
35
36
37
38 StatusCode MuonCalibrationAndSmearingAlg ::
39 execute ()
40 {
41 for (const auto& sys : m_systematicsList.systematicsVector())
42 {
43 // always need to call `getCopy` first to ensure that the shallow copies
44 // are all there if requested
45 xAOD::MuonContainer *muons = nullptr;
46 ANA_CHECK (m_muonHandle.getCopy (muons, sys));
47
48 if (sys.empty() && m_skipNominal.value())
49 continue;
50
51 ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys));
52 for (xAOD::Muon *muon : *muons)
53 {
54 if (m_preselection.getBool (*muon, sys))
55 {
57 }
58 }
59 }
60 return StatusCode::SUCCESS;
61 }
62}
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
SysListHandle m_systematicsList
the systematics list we run
SysCopyHandle< xAOD::MuonContainer > m_muonHandle
the muon collection we run on
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Gaudi::Property< bool > m_skipNominal
whether to skip the nominal correction (for PHYSLITE)
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
ToolHandle< IMuonCalibrationAndSmearingTool > m_calibrationAndSmearingTool
the smearing tool
Select isolated Photons, Electrons and Muons.
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".