ATLAS Offline Software
DQBadLBFilterTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "CoralBase/AttributeListException.h"
9 
10 DQBadLBFilterTool::DQBadLBFilterTool(const std::string& type,const std::string& name,const IInterface* parent)
12 , m_fallbackValue(true)
13 , m_alwaysReturnTrue(false)
14 , m_key("")
15 {
16  declareInterface<IDQFilterTool>(this);
17  declareProperty("fallbackValue", m_fallbackValue);
18  declareProperty("alwaysReturnTrue", m_alwaysReturnTrue);
19  declareProperty("ReadKey", m_key);
20 }
21 
23 
25 {
26  ATH_MSG_DEBUG("DQ Bad LB Filter tool: fallback and force: " << m_fallbackValue << "; " << m_alwaysReturnTrue );
27 
28  ATH_MSG_VERBOSE("ATLAS Ready initialize");
29  // don't register key if we always return true anyway
30  if (m_alwaysReturnTrue) return StatusCode::SUCCESS;
31 
33  return StatusCode::SUCCESS;
34 }
35 
37  if (m_alwaysReturnTrue) {
38  return true;
39  } else {
41  const AthenaAttributeList* attrList{*rch};
42  if (attrList == 0) {
43  ATH_MSG_WARNING("Unable to retrieve DataTakingMode information; falling back to" << m_fallbackValue);
44  return m_fallbackValue;
45  }
46  bool value = (*attrList)["Accept"].data<bool>();
47  ATH_MSG_VERBOSE("Bad LB accept called, value " << value);
48  return value;
49  }
50 }
DQBadLBFilterTool::~DQBadLBFilterTool
virtual ~DQBadLBFilterTool() override
Definition: DQBadLBFilterTool.cxx:22
DQBadLBFilterTool::m_key
SG::ReadCondHandleKey< AthenaAttributeList > m_key
Definition: DQBadLBFilterTool.h:33
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
athena.value
value
Definition: athena.py:122
DQBadLBFilterTool::m_alwaysReturnTrue
bool m_alwaysReturnTrue
Definition: DQBadLBFilterTool.h:32
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
DQBadLBFilterTool::initialize
virtual StatusCode initialize() override
Definition: DQBadLBFilterTool.cxx:24
AthenaAttributeList.h
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
DQBadLBFilterTool::DQBadLBFilterTool
DQBadLBFilterTool(const std::string &, const std::string &, const IInterface *)
Definition: DQBadLBFilterTool.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DQBadLBFilterTool::m_fallbackValue
bool m_fallbackValue
Definition: DQBadLBFilterTool.h:31
AthAlgTool
Definition: AthAlgTool.h:26
DQBadLBFilterTool.h
DQBadLBFilterTool::accept
virtual bool accept() const override
Pure virtual.
Definition: DQBadLBFilterTool.cxx:36