ATLAS Offline Software
Loading...
Searching...
No Matches
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"
8#include "Gaudi/Property.h"
11
12//__________________________________________________________________________
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//__________________________________________________________________________
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//__________________________________________________________________________
32StatusCode LArTimeVetoAlg::execute( const EventContext& ctx ) const
33{
34 ATH_MSG_DEBUG("LArTimeVetoAlg execute()");
35
36 m_nevt++;
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
49
50 // retrieve EventInfo
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Handle class for adding a decoration to an object.
An AttributeList represents a logical row of attributes in a metadata table.
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override
SG::ReadCondHandleKey< AthenaAttributeList > m_eventVetoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::atomic< unsigned > m_nevtMasked
std::atomic< unsigned > m_nevt
SG::WriteDecorHandleKey< xAOD::EventInfo > m_eventInfoDecorKey
virtual StatusCode finalize() override
@ LAr
The LAr calorimeter.
@ Error
The sub-detector issued an error.