ATLAS Offline Software
DQEventFlagFilterTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 DQEventFlagFilterTool::DQEventFlagFilterTool(const std::string& type,const std::string& name,const IInterface* parent)
10 {
11  declareInterface<IDQFilterTool>(this);
12 }
13 
15 
17 {
18  ATH_MSG_VERBOSE("ATLAS Ready initialize");
19  // don't register callback if we always return true anyway
22  ATH_CHECK( m_larFlag.initialize(!m_alwaysReturnTrue) );
23  return StatusCode::SUCCESS;
24 }
25 
27  if (m_alwaysReturnTrue) {
28  return true;
29  } else {
31  if (! eventInfo.isValid()) {
32  ATH_MSG_ERROR("Cannot retrieve EventInfo object, returning false (or true if invert is set)");
33  return m_invert;
34  }
35  bool passed(true); //event passes
36  auto errorcode(xAOD::EventInfo::Error);
37  if (m_doLAr && (eventInfo->errorState(xAOD::EventInfo::LAr) == errorcode)) {
38  ATH_MSG_DEBUG("Event fails LAr event veto");
39  passed = false;
40  } else if (m_doTile && (eventInfo->errorState(xAOD::EventInfo::Tile) == errorcode)) {
41  ATH_MSG_DEBUG("Event fails Tile event veto");
42  passed = false;
43  } else if (m_doSCT && (eventInfo->errorState(xAOD::EventInfo::SCT) == errorcode)) {
44  ATH_MSG_DEBUG("Event fails SCT event veto");
45  passed = false;
46  } else if (m_doCore && (eventInfo->eventFlags(xAOD::EventInfo::Core) & 0x40000)) {
47  ATH_MSG_DEBUG("Event fais data corruption veto");
48  passed = false;
49  }
50  passed ^= m_invert;
51  ATH_MSG_VERBOSE("Event flag DQ tool accept called, passed " << passed);
52  return passed;
53  }
54 }
DQEventFlagFilterTool.h
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
DQEventFlagFilterTool::m_doLAr
Gaudi::Property< bool > m_doLAr
Definition: DQEventFlagFilterTool.h:30
DQEventFlagFilterTool::m_doSCT
Gaudi::Property< bool > m_doSCT
Definition: DQEventFlagFilterTool.h:32
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
DQEventFlagFilterTool::m_doCore
Gaudi::Property< bool > m_doCore
Definition: DQEventFlagFilterTool.h:33
DQEventFlagFilterTool::m_invert
Gaudi::Property< bool > m_invert
Definition: DQEventFlagFilterTool.h:29
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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
DQEventFlagFilterTool::~DQEventFlagFilterTool
virtual ~DQEventFlagFilterTool() override
Definition: DQEventFlagFilterTool.cxx:14
DQEventFlagFilterTool::m_alwaysReturnTrue
Gaudi::Property< bool > m_alwaysReturnTrue
Definition: DQEventFlagFilterTool.h:28
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DQEventFlagFilterTool::m_TileStatusKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_TileStatusKey
Definition: DQEventFlagFilterTool.h:35
DQEventFlagFilterTool::DQEventFlagFilterTool
DQEventFlagFilterTool(const std::string &, const std::string &, const IInterface *)
Definition: DQEventFlagFilterTool.cxx:8
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
errorcheck.h
Helpers for checking error return status codes and reporting errors.
DQEventFlagFilterTool::initialize
virtual StatusCode initialize() override
Definition: DQEventFlagFilterTool.cxx:16
DQEventFlagFilterTool::m_doTile
Gaudi::Property< bool > m_doTile
Definition: DQEventFlagFilterTool.h:31
DQEventFlagFilterTool::accept
virtual bool accept() const override
Pure virtual.
Definition: DQEventFlagFilterTool.cxx:26
xAOD::EventInfo_v1::eventFlags
uint32_t eventFlags(EventFlagSubDet subDet) const
Get the event flags for a particular sub-detector.
Definition: EventInfo_v1.cxx:697
DQEventFlagFilterTool::m_larFlag
SG::ReadDecorHandleKey< xAOD::EventInfo > m_larFlag
Definition: DQEventFlagFilterTool.h:36
xAOD::EventInfo_v1::Tile
@ Tile
The Tile calorimeter.
Definition: EventInfo_v1.h:336
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DQEventFlagFilterTool::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: DQEventFlagFilterTool.h:34
xAOD::EventInfo_v1::errorState
EventFlagErrorState errorState(EventFlagSubDet subDet) const
Get the error state for a particular sub-detector.
Definition: EventInfo_v1.cxx:817
AthAlgTool
Definition: AthAlgTool.h:26
xAOD::EventInfo_v1::Core
@ Core
Core flags describing the event.
Definition: EventInfo_v1.h:339
xAOD::EventInfo_v1::SCT
@ SCT
The SCT.
Definition: EventInfo_v1.h:333