ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCellRec
src
EventInfoClearAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
EventInfoClearAlg.h
"
6
#include "
AthenaBaseComps/AthMsgStreamMacros.h
"
7
#include "
LArRecEvent/LArEventBitInfo.h
"
8
#include "
xAODEventInfo/EventInfo.h
"
9
#include "
xAODEventInfo/EventInfoLockHelper.h
"
10
11
//__________________________________________________________________________
12
StatusCode
EventInfoClearAlg::initialize
()
13
{
14
ATH_MSG_INFO
(
"EventInfoClearAlg initialize()"
);
15
ATH_CHECK
(
m_eventInfoKey
.initialize() );
16
//EventInfoLockHelper::unlockFunc_t fn=[](uint32_t runNbr, uint32_t lbNbr,uint64_t)->bool {return (runNbr==456729 && lbNbr>=732);};
17
EventInfoLockHelper::addUnlockFunc
(
m_runIf
);
18
return
StatusCode::SUCCESS;
19
20
}
21
22
//__________________________________________________________________________
23
StatusCode
EventInfoClearAlg::finalize
()
24
{
25
ATH_MSG_DEBUG
(
"EventInfoClearAlg finalize()"
);
26
ATH_MSG_INFO
(
"Number of events processed "
<<
m_nevt
<<
". Cleared EventInfo error state for "
<<
m_nevtCleard
<<
" events"
);
27
return
StatusCode::SUCCESS;
28
}
29
30
//__________________________________________________________________________
31
StatusCode
EventInfoClearAlg::execute
(
const
EventContext& ctx )
32
{
33
m_nevt
++;
34
SG::ReadHandle<xAOD::EventInfo>
eventInfo (
m_eventInfoKey
, ctx);
35
36
if
(
m_runIf
(eventInfo->runNumber(),eventInfo->lumiBlock(),eventInfo->eventNumber())) {
37
//m_runIf expands to unNbr==r456729 && lbNbr>=732
38
if
(eventInfo->errorState(
xAOD::EventInfo::LAr
)==
xAOD::EventInfo::Error
) {
39
if
(eventInfo->isEventFlagBitSet(
xAOD::EventInfo::LAr
,
LArEventBitInfo::DATACORRUPTEDVETO
)) {
40
//ERROR bit set and LAr Data Corruption Event Veto bit set. Clear DATACORRUPTEDVETO bit
41
xAOD::EventInfo
* eventInfoNC=
const_cast<
xAOD::EventInfo
*
>
(eventInfo.
cptr
());
42
eventInfoNC->
resetEventFlagBit
(
xAOD::EventInfo::LAr
,
LArEventBitInfo::DATACORRUPTEDVETO
);
43
if
(eventInfoNC->
eventFlags
(
xAOD::EventInfo::LAr
)==0) {
44
//No other LAr Flag set (like noise-burst), clear error state:
45
eventInfoNC->
setErrorState
(
xAOD::EventInfo::LAr
,
xAOD::EventInfo::NotSet
);
46
m_nevtCleard
++;
47
ATH_MSG_DEBUG
(
"Cleared EventInfo Error state for run/LB/event "
<< eventInfo->runNumber() <<
"/"
<< eventInfo->lumiBlock() <<
"/"
<< eventInfo->eventNumber());
48
}
49
else
{
50
ATH_MSG_INFO
(
"Not cleared EventInfo Error state for run/LB/event "
<< eventInfo->runNumber() <<
"/"
<< eventInfo->lumiBlock() <<
"/"
<< eventInfo->eventNumber()
51
<<
",LArFlags still at "
<< std::hex <<eventInfoNC->
eventFlags
(
xAOD::EventInfo::LAr
));
52
}
53
}
54
}
55
}
56
return
StatusCode::SUCCESS;
57
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventInfoClearAlg.h
EventInfoLockHelper.h
LArEventBitInfo.h
EventInfoClearAlg::finalize
virtual StatusCode finalize() override
Definition
EventInfoClearAlg.cxx:23
EventInfoClearAlg::m_nevtCleard
std::atomic< unsigned > m_nevtCleard
Definition
EventInfoClearAlg.h:37
EventInfoClearAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
EventInfoClearAlg.cxx:31
EventInfoClearAlg::m_runIf
EventInfoLockHelper::unlockFunc_t m_runIf
Definition
EventInfoClearAlg.h:41
EventInfoClearAlg::initialize
virtual StatusCode initialize() override
Definition
EventInfoClearAlg.cxx:12
EventInfoClearAlg::m_nevt
std::atomic< unsigned > m_nevt
Definition
EventInfoClearAlg.h:36
EventInfoClearAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
EventInfoClearAlg.h:39
EventInfoLockHelper::addUnlockFunc
static void addUnlockFunc(unlockFunc_t fn) ATLAS_NOT_THREAD_SAFE
Add a function defining if the flags are to be locked.
Definition
EventInfoLockHelper.cxx:7
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
xAOD::EventInfo_v1::resetEventFlagBit
bool resetEventFlagBit(EventFlagSubDet subDet, size_t bit)
Reset one particular bit of one particular sub-detector.
Definition
EventInfo_v1.cxx:772
xAOD::EventInfo_v1::LAr
@ LAr
The LAr calorimeter.
Definition
EventInfo_v1.h:335
xAOD::EventInfo_v1::setErrorState
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState state)
Set the error state for a particular sub-detector.
Definition
EventInfo_v1.cxx:825
xAOD::EventInfo_v1::NotSet
@ NotSet
The flag was not set to anything.
Definition
EventInfo_v1.h:347
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition
EventInfo_v1.h:349
xAOD::EventInfo_v1::eventFlags
uint32_t eventFlags(EventFlagSubDet subDet) const
Get the event flags for a particular sub-detector.
Definition
EventInfo_v1.cxx:697
LArEventBitInfo::DATACORRUPTEDVETO
@ DATACORRUPTEDVETO
Definition
LArEventBitInfo.h:15
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