ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
9namespace CP {
10
11 MissingETSelectorAlg::MissingETSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
12 : EL::AnaAlgorithm(name, pSvcLocator)
13 {}
14
27
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));
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));
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
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
SignEnum::ComparisonOperator m_signEnum
the operator version of the comparison (>, <, etc)
Gaudi::Property< std::string > m_metTerm
the MET term
virtual StatusCode initialize() override
MissingETSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
the standard constructor
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the event info handle
CP::SysReadSelectionHandle m_preselection
the preselection
CP::SysWriteSelectionHandle m_decoration
the output selection decoration
Gaudi::Property< float > m_metref
the MET threshold against which to compare
CP::SysListHandle m_systematicsList
the systematics
virtual StatusCode execute() override
CP::SysReadHandle< xAOD::MissingETContainer > m_metHandle
the MET input handle
Gaudi::Property< std::string > m_sign
the comparison (GT, LT, etc)
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Select isolated Photons, Electrons and Muons.
This module defines the arguments passed from the BATCH driver to the BATCH worker.
bool checkValue(T reference, ComparisonOperator sign, T test)
the comparison test given the specified sign and two test values
Definition SignEnums.h:37
static const std::map< std::string, ComparisonOperator > stringToOperator
the map between user inputs and comparison operators
Definition SignEnums.h:27
EventInfo_v1 EventInfo
Definition of the latest event info version.