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
15//
16// method implementations
17//
18
19namespace CP
20{
21
22 StatusCode MuonCalibrationAndSmearingAlg ::
23 initialize ()
24 {
29 ANA_CHECK (m_systematicsList.initialize());
30 ANA_CHECK (m_outOfValidity.initialize());
31 return StatusCode::SUCCESS;
32 }
33
34
35
36 StatusCode MuonCalibrationAndSmearingAlg ::
37 execute (const EventContext& ctx)
38 {
39 for (const auto& sys : m_systematicsList.systematicsVector())
40 {
41 // always need to call `getCopy` first to ensure that the shallow copies
42 // are all there if requested
43 xAOD::MuonContainer *muons = nullptr;
44 ANA_CHECK (m_muonHandle.getCopy (muons, sys, ctx));
45
46 if (sys.empty() && m_skipNominal.value())
47 continue;
48
49 ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys));
50 for (xAOD::Muon *muon : *muons)
51 {
52 if (m_preselection.getBool (*muon, sys))
53 {
55 }
56 }
57 }
58 return StatusCode::SUCCESS;
59 }
60}
#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".