ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCellRec
src
LArTimeVetoAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArTimeVetoAlg.h
"
6
#include "
AthenaPoolUtilities/AthenaAttributeList.h
"
7
#include "
LArRecEvent/LArEventBitInfo.h
"
8
#include "Gaudi/Property.h"
9
#include "
xAODEventInfo/EventInfo.h
"
10
#include "
StoreGate/WriteDecorHandle.h
"
11
12
//__________________________________________________________________________
13
StatusCode
LArTimeVetoAlg::initialize
()
14
{
15
ATH_MSG_INFO
(
"LArTimeVetoAlg initialize()"
);
16
ATH_CHECK
(
m_eventInfoKey
.initialize() );
17
ATH_CHECK
(
m_eventInfoDecorKey
.initialize() );
18
ATH_CHECK
(
m_eventVetoKey
.initialize() );
19
return
StatusCode::SUCCESS;
20
21
}
22
23
//__________________________________________________________________________
24
StatusCode
LArTimeVetoAlg::finalize
()
25
{
26
ATH_MSG_DEBUG
(
"LArTimeVetoAlg finalize()"
);
27
ATH_MSG_INFO
(
"Number of events processed "
<<
m_nevt
<<
". Number of events in LAr bad time interval "
<<
m_nevtMasked
);
28
return
StatusCode::SUCCESS;
29
}
30
31
//__________________________________________________________________________
32
StatusCode
LArTimeVetoAlg::execute
(
const
EventContext& ctx )
const
33
{
34
ATH_MSG_DEBUG
(
"LArTimeVetoAlg execute()"
);
35
36
m_nevt
++;
37
SG::ReadCondHandle<AthenaAttributeList>
ev_handle{
m_eventVetoKey
, ctx};
38
const
AthenaAttributeList
* dd_atrList{*ev_handle};
39
if
(dd_atrList==
nullptr
) {
40
ATH_MSG_FATAL
(
"Null pointer to the read conditions object"
);
41
return
StatusCode::FAILURE;
42
}
43
44
const
uint32_t vetoWord = (*dd_atrList)[
"EventVeto"
].data<uint32_t>();
45
46
if
(vetoWord != 0) {
47
48
m_nevtMasked
++;
49
50
// retrieve EventInfo
51
SG::ReadHandle<xAOD::EventInfo>
eventInfo (
m_eventInfoKey
, ctx);
52
if
(!eventInfo->updateErrorState(
xAOD::EventInfo::LAr
,
xAOD::EventInfo::Error
)) {
53
ATH_MSG_WARNING
(
" cannot set error state for LAr "
);
54
}
55
if
(vetoWord & 0x1FFFF) {
56
ATH_MSG_DEBUG
(
"Event flagged as Noise Burst!"
);
57
if
(!eventInfo->updateEventFlagBit(
xAOD::EventInfo::LAr
,
LArEventBitInfo::NOISEBURSTVETO
)) {
58
ATH_MSG_WARNING
(
" cannot set flag bit for LAr "
);
59
}
60
61
if
(vetoWord & 0x10000) {
62
ATH_MSG_DEBUG
(
"Event flagged as Mini-Noise Burst!"
);
63
if
(!eventInfo->updateEventFlagBit(
xAOD::EventInfo::LAr
,
LArEventBitInfo::MININOISEBURSTTIGHT
)) {
64
ATH_MSG_WARNING
(
" cannot set flag bit for LAr "
);
65
}
66
}
67
68
//Record location (partition) of noise burst
69
for
(
int
i=0;i<8;i++) {
70
if
(vetoWord & (1<<i)) {
71
if
(!eventInfo->updateEventFlagBit(
xAOD::EventInfo::LAr
,20+i)) {
72
ATH_MSG_WARNING
(
" cannot set flag bit for LAr documenting noise burst location "
);
73
}
74
}
75
}
76
}
//end if one of the first 16 bits set
77
if
(vetoWord & 0xFFF80000) {
78
ATH_MSG_DEBUG
(
"Event flagged as DataCorruption!"
);
79
if
(!eventInfo->updateEventFlagBit(
xAOD::EventInfo::LAr
,
LArEventBitInfo::DATACORRUPTEDVETO
)) {
80
ATH_MSG_WARNING
(
" cannot set flag bit for LAr "
);
81
}
82
}
//end if one of the second 16 bits set
83
84
ATH_MSG_VERBOSE
(
"LAr bit in error word "
<< eventInfo->errorState(
xAOD::EventInfo::LAr
) );
85
ATH_MSG_VERBOSE
(
"LAr word "
<< std::hex << eventInfo->eventFlags(
xAOD::EventInfo::LAr
) << std::dec );
86
87
}
//if vetoWord
88
89
90
return
StatusCode::SUCCESS;
91
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthenaAttributeList.h
LArEventBitInfo.h
LArTimeVetoAlg.h
WriteDecorHandle.h
Handle class for adding a decoration to an object.
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table.
Definition
PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:46
LArTimeVetoAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
LArTimeVetoAlg.cxx:32
LArTimeVetoAlg::initialize
virtual StatusCode initialize() override
Definition
LArTimeVetoAlg.cxx:13
LArTimeVetoAlg::m_eventVetoKey
SG::ReadCondHandleKey< AthenaAttributeList > m_eventVetoKey
Definition
LArTimeVetoAlg.h:33
LArTimeVetoAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
LArTimeVetoAlg.h:34
LArTimeVetoAlg::m_nevtMasked
std::atomic< unsigned > m_nevtMasked
Definition
LArTimeVetoAlg.h:31
LArTimeVetoAlg::m_nevt
std::atomic< unsigned > m_nevt
Definition
LArTimeVetoAlg.h:30
LArTimeVetoAlg::m_eventInfoDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
Definition
LArTimeVetoAlg.h:35
LArTimeVetoAlg::finalize
virtual StatusCode finalize() override
Definition
LArTimeVetoAlg.cxx:24
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
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
LArEventBitInfo::MININOISEBURSTTIGHT
@ MININOISEBURSTTIGHT
Definition
LArEventBitInfo.h:18
LArEventBitInfo::DATACORRUPTEDVETO
@ DATACORRUPTEDVETO
Definition
LArEventBitInfo.h:15
LArEventBitInfo::NOISEBURSTVETO
@ NOISEBURSTVETO
Definition
LArEventBitInfo.h:13
EventInfo.h
Generated on
for ATLAS Offline Software by
1.17.0