ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EventSelectionAlgorithms
Root
MissingETSelectorAlg.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
#include "
EventSelectionAlgorithms/MissingETSelectorAlg.h
"
8
9
namespace
CP
{
10
11
MissingETSelectorAlg::MissingETSelectorAlg
(
const
std::string &
name
, ISvcLocator *pSvcLocator)
12
:
EL
::
AnaAlgorithm
(
name
, pSvcLocator)
13
{}
14
15
StatusCode
MissingETSelectorAlg::initialize
() {
16
ANA_CHECK
(
m_metHandle
.initialize(
m_systematicsList
));
17
ANA_CHECK
(
m_eventInfoHandle
.initialize(
m_systematicsList
));
18
19
ANA_CHECK
(
m_preselection
.initialize(
m_systematicsList
,
m_eventInfoHandle
,
SG::AllowEmpty
));
20
ANA_CHECK
(
m_decoration
.initialize(
m_systematicsList
,
m_eventInfoHandle
));
21
ANA_CHECK
(
m_systematicsList
.initialize());
22
23
m_signEnum
=
SignEnum::stringToOperator
.at(
m_sign
);
24
25
return
StatusCode::SUCCESS;
26
}
27
28
StatusCode
MissingETSelectorAlg::execute
(
const
EventContext& ctx) {
29
for
(
const
auto
&sys :
m_systematicsList
.systematicsVector()) {
30
// retrieve the EventInfo
31
const
xAOD::EventInfo
*evtInfo =
nullptr
;
32
ANA_CHECK
(
m_eventInfoHandle
.retrieve(evtInfo, sys, ctx));
33
34
// default-decorate EventInfo
35
m_decoration
.setBool(*evtInfo, 0, sys);
36
37
// check the preselection
38
if
(
m_preselection
&& !
m_preselection
.getBool(*evtInfo, sys))
39
continue
;
40
41
// retrieve the MET container
42
const
xAOD::MissingETContainer
*
met
=
nullptr
;
43
ANA_CHECK
(
m_metHandle
.retrieve(
met
, sys, ctx));
44
45
// calculate decision
46
if
((*
met
)[
m_metTerm
.value()] ==
nullptr
) {
47
ANA_MSG_ERROR
(
"The MET term "
<<
m_metTerm
.value() <<
" doesn't exist! Aborting."
);
48
return
StatusCode::FAILURE;
49
}
50
float
etmiss = (*met)[
m_metTerm
.value()]->met();
51
bool
decision =
SignEnum::checkValue
(
m_metref
.value(),
m_signEnum
, etmiss);
52
m_decoration
.setBool(*evtInfo, decision, sys);
53
}
54
return
StatusCode::SUCCESS;
55
}
56
57
}
// namespace CP
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
MissingETSelectorAlg.h
CP::MissingETSelectorAlg::m_signEnum
SignEnum::ComparisonOperator m_signEnum
the operator version of the comparison (>, <, etc)
Definition
MissingETSelectorAlg.h:45
CP::MissingETSelectorAlg::m_metTerm
Gaudi::Property< std::string > m_metTerm
the MET term
Definition
MissingETSelectorAlg.h:56
CP::MissingETSelectorAlg::initialize
virtual StatusCode initialize() override
Definition
MissingETSelectorAlg.cxx:15
CP::MissingETSelectorAlg::MissingETSelectorAlg
MissingETSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
Definition
MissingETSelectorAlg.cxx:11
CP::MissingETSelectorAlg::m_eventInfoHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info handle
Definition
MissingETSelectorAlg.h:59
CP::MissingETSelectorAlg::m_preselection
CP::SysReadSelectionHandle m_preselection
the preselection
Definition
MissingETSelectorAlg.h:64
CP::MissingETSelectorAlg::m_decoration
CP::SysWriteSelectionHandle m_decoration
the output selection decoration
Definition
MissingETSelectorAlg.h:69
CP::MissingETSelectorAlg::m_metref
Gaudi::Property< float > m_metref
the MET threshold against which to compare
Definition
MissingETSelectorAlg.h:39
CP::MissingETSelectorAlg::m_systematicsList
CP::SysListHandle m_systematicsList
the systematics
Definition
MissingETSelectorAlg.h:48
CP::MissingETSelectorAlg::m_metHandle
CP::SysReadHandle< xAOD::MissingETContainer > m_metHandle
the MET input handle
Definition
MissingETSelectorAlg.h:51
CP::MissingETSelectorAlg::m_sign
Gaudi::Property< std::string > m_sign
the comparison (GT, LT, etc)
Definition
MissingETSelectorAlg.h:42
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
EL::AnaAlgorithm::execute
virtual::StatusCode execute()
execute this algorithm
Definition
AnaAlgorithm.cxx:315
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
SignEnum::checkValue
bool checkValue(T reference, ComparisonOperator sign, T test)
the comparison test given the specified sign and two test values
Definition
SignEnums.h:37
SignEnum::stringToOperator
static const std::map< std::string, ComparisonOperator > stringToOperator
the map between user inputs and comparison operators
Definition
SignEnums.h:27
met
Definition
IMETSignificance.h:24
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::MissingETContainer
MissingETContainer_v1 MissingETContainer
Definition
Event/xAOD/xAODMissingET/xAODMissingET/MissingETContainer.h:16
Generated on
for ATLAS Offline Software by
1.17.0