ATLAS Offline Software
EventStatusSelectionAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
10 
12  ISvcLocator *svcLoc)
13  : EL::AnaAlgorithm(name, svcLoc)
14 {
15 }
16 
18 {
19  ANA_CHECK(m_filterParams.initialize());
20  return StatusCode::SUCCESS;
21 }
22 
24 {
25  FilterReporter filter (m_filterParams, false);
26 
27  const xAOD::EventInfo *eventInfo = 0;
28  ANA_CHECK(evtStore()->retrieve(eventInfo, "EventInfo"));
29 
30  // Reject bad events due to problems in Tile calorimeter
32  {
33  ATH_MSG_VERBOSE("Rejecting event due to problems in Tile calorimeter");
34  filter.setPassed(false);
35  return StatusCode::SUCCESS;
36  }
37 
38  // Reject bad events due to problems in LAr calorimeter
40  {
41  ATH_MSG_VERBOSE("Rejecting event due to problems in LAr calorimeter");
42  filter.setPassed(false);
43  return StatusCode::SUCCESS;
44  }
45 
46  // Reject bad events due to problems in SCT
48  {
49  ATH_MSG_VERBOSE("Rejecting event due to problems in SCT");
50  filter.setPassed(false);
51  return StatusCode::SUCCESS;
52  }
53 
54  // Reject incomplete events
55  if (eventInfo->isEventFlagBitSet(xAOD::EventInfo::Core, 18))
56  {
57  ATH_MSG_VERBOSE("Rejecting incomplete events");
58  filter.setPassed(false);
59  return StatusCode::SUCCESS;
60  }
61 
62  ATH_MSG_VERBOSE("Event passed all status checks.");
63  filter.setPassed(true);
64 
65  return StatusCode::SUCCESS;
66 }
67 
69 {
70  ANA_MSG_INFO (m_filterParams.summary());
71 
72  return StatusCode::SUCCESS;
73 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
FilterReporter
a guard class for use with ref FilterReporterParams
Definition: FilterReporter.h:35
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CP::EventStatusSelectionAlg::EventStatusSelectionAlg
EventStatusSelectionAlg(const std::string &name, ISvcLocator *svcLoc=nullptr)
Definition: EventStatusSelectionAlg.cxx:11
xAOD::EventInfo_v1::LAr
@ LAr
The LAr calorimeter.
Definition: EventInfo_v1.h:335
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition: EventInfo_v1.h:349
covarianceTool.filter
filter
Definition: covarianceTool.py:514
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition: AlgorithmWorkerData.h:24
FilterReporter.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EventInfo.h
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
xAOD::EventInfo_v1::Tile
@ Tile
The Tile calorimeter.
Definition: EventInfo_v1.h:336
CP::EventStatusSelectionAlg::finalize
virtual StatusCode finalize() final
Definition: EventStatusSelectionAlg.cxx:68
xAOD::EventInfo_v1::errorState
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
Definition: EventInfo_v1.cxx:817
xAOD::EventInfo_v1::isEventFlagBitSet
bool isEventFlagBitSet(EventFlagSubDet subDet, size_t bit) const
Check one particular bit of one particular sub-detector.
Definition: EventInfo_v1.cxx:703
EventStatusSelectionAlg.h
xAOD::EventInfo_v1::Core
@ Core
Core flags describing the event.
Definition: EventInfo_v1.h:339
CP::EventStatusSelectionAlg::execute
virtual StatusCode execute() final
Definition: EventStatusSelectionAlg.cxx:23
xAOD::EventInfo_v1::SCT
@ SCT
The SCT.
Definition: EventInfo_v1.h:333
CP::EventStatusSelectionAlg::initialize
virtual StatusCode initialize() final
Definition: EventStatusSelectionAlg.cxx:17