ATLAS Offline Software
Loading...
Searching...
No Matches
JvtEfficiencyAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8//
9// includes
10//
11
13
15
16//
17// method implementations
18//
19
20namespace CP
21{
22
23
24 StatusCode JvtEfficiencyAlg ::
25 initialize ()
26 {
27
28 ANA_CHECK (m_efficiencyTool.retrieve());
34 ANA_CHECK (m_systematicsList.initialize());
35 ANA_CHECK (m_outOfValidity.initialize());
36
37 return StatusCode::SUCCESS;
38 }
39
40
41
42 StatusCode JvtEfficiencyAlg ::
43 execute ()
44 {
45 for (const auto& sys : m_systematicsList.systematicsVector())
46 {
47 ANA_CHECK (m_efficiencyTool->applySystematicVariation (sys));
48 const xAOD::JetContainer *jets = nullptr;
49 ANA_CHECK (m_jetHandle.retrieve (jets, sys));
50
51 for (const xAOD::Jet *jet : *jets)
52 {
53 if (m_preselection.getBool (*jet, sys))
54 {
55 bool goodJet = true;
57 {
58 goodJet = m_selectionHandle.getBool(*jet, sys);
59 }
60 float sf = 1;
61 if (goodJet) {
62 ANA_CHECK_CORRECTION (m_outOfValidity, *jet, m_efficiencyTool->getEfficiencyScaleFactor (*jet, sf));
63 } else if (!m_skipBadEfficiency) {
64 ANA_CHECK_CORRECTION (m_outOfValidity, *jet, m_efficiencyTool->getInefficiencyScaleFactor (*jet, sf));
65 }
66 m_scaleFactorDecoration.set (*jet, sf, sys);
67 } else {
69 }
70 }
71 }
72
73 return StatusCode::SUCCESS;
74 }
75}
#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
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
SysReadHandle< xAOD::JetContainer > m_jetHandle
the jet collection we run on
SysListHandle m_systematicsList
the systematics list we run
ToolHandle< CP::IJvtEfficiencyTool > m_efficiencyTool
the efficiency tool
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the JVT scale factor
SysReadSelectionHandle m_selectionHandle
the decoration for the JVT selection
Gaudi::Property< bool > m_skipBadEfficiency
whether to skip efficiency calculation if the selection failed
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
Jet_v1 Jet
Definition of the current "jet version".
JetContainer_v1 JetContainer
Definition of the current "jet container version".