ATLAS Offline Software
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 
9 namespace CP {
10 
11  MissingETSelectorAlg::MissingETSelectorAlg(const std::string &name, ISvcLocator *pSvcLocator)
12  : EL::AnaAlgorithm(name, pSvcLocator)
13  {}
14 
18 
22 
23  m_signEnum = SignEnum::stringToOperator.at( m_sign );
24 
25  return StatusCode::SUCCESS;
26  }
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  float etmiss = (*met)[m_metTerm.value()]->met();
47  bool decision = SignEnum::checkValue(m_metref.value(), m_signEnum, etmiss);
48  m_decoration.setBool(*evtInfo, decision, sys);
49  }
50  return StatusCode::SUCCESS;
51  }
52 
53 } // namespace CP
CP::MissingETSelectorAlg::m_systematicsList
CP::SysListHandle m_systematicsList
the systematics
Definition: MissingETSelectorAlg.h:50
CP::MissingETSelectorAlg::m_preselection
CP::SysReadSelectionHandle m_preselection
the preselection
Definition: MissingETSelectorAlg.h:66
CP::MissingETSelectorAlg::m_metref
Gaudi::Property< float > m_metref
the MET threshold against which to compare
Definition: MissingETSelectorAlg.h:41
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
MissingETSelectorAlg.h
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::SysWriteSelectionHandle::setBool
void setBool(const SG::AuxElement &element, bool selection, const CP::SystematicSet &sys) const
set the selection decoration
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:61
CP::MissingETSelectorAlg::initialize
virtual StatusCode initialize() override
Definition: MissingETSelectorAlg.cxx:15
CP::MissingETSelectorAlg::m_sign
Gaudi::Property< std::string > m_sign
the comparison (GT, LT, etc)
Definition: MissingETSelectorAlg.h:44
CP::MissingETSelectorAlg::execute
virtual StatusCode execute() override
Definition: MissingETSelectorAlg.cxx:28
CP::MissingETSelectorAlg::m_signEnum
SignEnum::ComparisonOperator m_signEnum
the operator version of the comparison (>, <, etc)
Definition: MissingETSelectorAlg.h:47
met
Definition: IMETSignificance.h:24
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
SignEnum::checkValue
bool checkValue(T reference, ComparisonOperator sign, T test)
the comparison test given the specified sign and two test values
Definition: SignEnums.h:35
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
CP::MissingETSelectorAlg::m_decoration
CP::SysWriteSelectionHandle m_decoration
the output selection decoration
Definition: MissingETSelectorAlg.h:71
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
CP::MissingETSelectorAlg::m_metHandle
CP::SysReadHandle< xAOD::MissingETContainer > m_metHandle
the MET input handle
Definition: MissingETSelectorAlg.h:53
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CP::MissingETSelectorAlg::m_metTerm
Gaudi::Property< std::string > m_metTerm
the MET term
Definition: MissingETSelectorAlg.h:58
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::SysWriteSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysWriteSelectionHandle.cxx:34