ATLAS Offline Software
Loading...
Searching...
No Matches
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"
10
11//__________________________________________________________________________
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);};
18 return StatusCode::SUCCESS;
19
20 }
21
22//__________________________________________________________________________
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//__________________________________________________________________________
31StatusCode EventInfoClearAlg::execute( const EventContext& ctx )
32{
33 m_nevt++;
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());
43 if (eventInfoNC->eventFlags(xAOD::EventInfo::LAr)==0) {
44 //No other LAr Flag set (like noise-burst), clear error state:
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode finalize() override
std::atomic< unsigned > m_nevtCleard
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
EventInfoLockHelper::unlockFunc_t m_runIf
virtual StatusCode initialize() override
std::atomic< unsigned > m_nevt
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
static void addUnlockFunc(unlockFunc_t fn) ATLAS_NOT_THREAD_SAFE
Add a function defining if the flags are to be locked.
const_pointer_type cptr()
Dereference the pointer.
bool resetEventFlagBit(EventFlagSubDet subDet, size_t bit)
Reset one particular bit of one particular sub-detector.
@ LAr
The LAr calorimeter.
bool setErrorState(EventFlagSubDet subDet, EventFlagErrorState state)
Set the error state for a particular sub-detector.
@ NotSet
The flag was not set to anything.
@ Error
The sub-detector issued an error.
uint32_t eventFlags(EventFlagSubDet subDet) const
Get the event flags for a particular sub-detector.
EventInfo_v1 EventInfo
Definition of the latest event info version.