ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
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
7
#include <
AsgAnalysisAlgorithms/EventStatusSelectionAlg.h
>
8
#include <
EventBookkeeperTools/FilterReporter.h
>
9
#include <
xAODEventInfo/EventInfo.h
>
10
11
CP::EventStatusSelectionAlg::EventStatusSelectionAlg
(
const
std::string &
name
,
12
ISvcLocator *svcLoc)
13
:
EL
::
AnaAlgorithm
(
name
, svcLoc)
14
{
15
}
16
17
StatusCode
CP::EventStatusSelectionAlg::initialize
()
18
{
19
ANA_CHECK
(
m_filterParams
.initialize());
20
return
StatusCode::SUCCESS;
21
}
22
23
StatusCode
CP::EventStatusSelectionAlg::execute
(
const
EventContext&
/*ctx*/
)
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
31
if
(eventInfo->
errorState
(
xAOD::EventInfo::Tile
) ==
xAOD::EventInfo::Error
)
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
39
if
(eventInfo->
errorState
(
xAOD::EventInfo::LAr
) ==
xAOD::EventInfo::Error
)
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
47
if
(eventInfo->
errorState
(
xAOD::EventInfo::SCT
) ==
xAOD::EventInfo::Error
)
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
68
StatusCode
CP::EventStatusSelectionAlg::finalize
()
69
{
70
ANA_MSG_INFO
(
m_filterParams
.summary());
71
72
return
StatusCode::SUCCESS;
73
}
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ANA_MSG_INFO
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:290
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
EventStatusSelectionAlg.h
FilterReporter.h
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
CP::EventStatusSelectionAlg::m_filterParams
FilterReporterParams m_filterParams
the filter reporter parameters
Definition
EventStatusSelectionAlg.h:28
CP::EventStatusSelectionAlg::EventStatusSelectionAlg
EventStatusSelectionAlg(const std::string &name, ISvcLocator *svcLoc=nullptr)
Definition
EventStatusSelectionAlg.cxx:11
CP::EventStatusSelectionAlg::finalize
virtual StatusCode finalize() final
Definition
EventStatusSelectionAlg.cxx:68
CP::EventStatusSelectionAlg::initialize
virtual StatusCode initialize() final
Definition
EventStatusSelectionAlg.cxx:17
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
FilterReporter
a guard class for use with ref FilterReporterParams
Definition
FilterReporter.h:35
xAOD::EventInfo_v1::SCT
@ SCT
The SCT.
Definition
EventInfo_v1.h:333
xAOD::EventInfo_v1::Tile
@ Tile
The Tile calorimeter.
Definition
EventInfo_v1.h:336
xAOD::EventInfo_v1::Core
@ Core
Core flags describing the event.
Definition
EventInfo_v1.h:339
xAOD::EventInfo_v1::LAr
@ LAr
The LAr calorimeter.
Definition
EventInfo_v1.h:335
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
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition
EventInfo_v1.h:349
xAOD::EventInfo_v1::errorState
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
Definition
EventInfo_v1.cxx:817
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0