Skip to content
Snippets Groups Projects
Commit 32c926b0 authored by Tamara Vazquez Schroeder's avatar Tamara Vazquez Schroeder Committed by Atlas Nightlybuild
Browse files

Merge branch 'revert-4bce3de3' into '21.0'

Revert "Merge branch '21.0-dq-event-filter' into '21.0'"

See merge request !4538
parent 991470a7
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef DQEVENTFLAGFILTERTOOL_H
#define DQEVENTFLAGFILTERTOOL_H
#include "AthenaMonitoring/IDQFilterTool.h"
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/StatusCode.h"
#include "GaudiKernel/ToolHandle.h"
// This filter tool only accepts events which do not fail DP event cleaning cuts
// @author Peter Onyisi <ponyisi@cern.ch>
class DQEventFlagFilterTool : public AthAlgTool, virtual public IDQFilterTool {
public:
DQEventFlagFilterTool(const std::string&,const std::string&,const IInterface*);
virtual ~DQEventFlagFilterTool () override;
virtual StatusCode initialize() override;
virtual bool accept() const override;
private:
bool m_alwaysReturnTrue;
bool m_invert;
bool m_doLAr;
bool m_doTile;
bool m_doSCT;
bool m_doCore;
};
#endif //DQEVENTFLAGFILTERTOOL_H
...@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PUBLIC ...@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PUBLIC
Control/SGMon/SGAudCore Control/SGMon/SGAudCore
Database/AthenaPOOL/AthenaPoolUtilities Database/AthenaPOOL/AthenaPoolUtilities
Event/EventInfo Event/EventInfo
xAOD/xAODEventInfo
Tools/LWHists Tools/LWHists
Trigger/TrigEvent/TrigDecisionInterface Trigger/TrigEvent/TrigDecisionInterface
AtlasTest/TestTools) AtlasTest/TestTools)
......
...@@ -398,20 +398,6 @@ class enableLumiAccess(JobProperty): ...@@ -398,20 +398,6 @@ class enableLumiAccess(JobProperty):
StoredValue=True StoredValue=True
list+=[enableLumiAccess] list+=[enableLumiAccess]
class excludeFromCleaning(JobProperty):
""" Tools matching regexes in this list will not have event cleaning tool set up """
statusOn=True
allowedTypes=['list']
StoredValue=['.*LAr.*', '.*Tile.*', '.*SCT.*', 'DQTDataFlowMon']
list+=[excludeFromCleaning]
class specialCleaningConfiguration(JobProperty):
""" Special event cleaning configurations (no regexes) """
statusOn=True
allowedTypes=['dict']
StoredValue={}
list+=[specialCleaningConfiguration]
##----------------------------------------------------------------------------- ##-----------------------------------------------------------------------------
## 2nd step ## 2nd step
## Definition of the DQMon flag container ## Definition of the DQMon flag container
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from PyUtils.Decorators import memoize
# Set up the event cleaning filter tool
# Cache instances that are already created
@memoize
def GetEventFlagFilterTool(name, doLAr=True, doTile=True, doSCT=True, doCore=True, alwaysReturnTrue=False):
"""
Configure an instance of the bad LB filter tool. If called twice with the same options, will return the same instance.
Arguments:
- name: name of instance to create
- doLAr: do LAr cleaning (optional; default=True)
- doTile: do Tile cleaning (optional; default=True)
- doSCT: do SCT cleaning (optional; default=True)
- doCore: do Core event building cleaning (optional; default=True)
- alwaysReturnTrue: short-circuit all checks and return True (optional; default=False)
"""
from AthenaCommon.AppMgr import ToolSvc
from AthenaCommon.Logging import logging
log = logging.getLogger('EventFlagFilterTool')
from AthenaMonitoring.AthenaMonitoringConf import DQEventFlagFilterTool
monFilterTool = DQEventFlagFilterTool(name, doLAr=doLAr, doTile=doTile,
doSCT=doSCT, doCore=doCore)
ToolSvc += monFilterTool
return monFilterTool
...@@ -256,8 +256,6 @@ if DQMonFlags.doMonitoring(): ...@@ -256,8 +256,6 @@ if DQMonFlags.doMonitoring():
include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py") include("AthenaMonitoring/AtlasReadyFilterTool_jobOptions.py")
monToolSet_after = set(ToolSvc.getChildren()) monToolSet_after = set(ToolSvc.getChildren())
local_logger.debug('DQ Post-Setup Configuration') local_logger.debug('DQ Post-Setup Configuration')
import re
from AthenaMonitoring.EventFlagFilterTool import GetEventFlagFilterTool
for tool in monToolSet_after-monToolSet_before: for tool in monToolSet_after-monToolSet_before:
# stop lumi access if we're in MC or enableLumiAccess == False # stop lumi access if we're in MC or enableLumiAccess == False
if 'EnableLumi' in dir(tool): if 'EnableLumi' in dir(tool):
...@@ -273,25 +271,6 @@ if DQMonFlags.doMonitoring(): ...@@ -273,25 +271,6 @@ if DQMonFlags.doMonitoring():
if rec.triggerStream()=='express': if rec.triggerStream()=='express':
local_logger.info('Stream is express and we will add ready tool for %s', tool) local_logger.info('Stream is express and we will add ready tool for %s', tool)
tool.FilterTools += [monAtlasReadyFilterTool] tool.FilterTools += [monAtlasReadyFilterTool]
# unless prevented: configure a generic event cleaning tool
if not any(re.match(_, tool.name()) for _ in DQMonFlags.excludeFromCleaning()):
if tool.name() in DQMonFlags.specialCleaningConfiguration():
config_ = DQMonFlags.specialCleaningConfiguration()[tool.name()].copy()
for _ in config_:
try:
config_[_] = bool(config_[_])
except:
local_logger.error('Unable to enact special event cleaning configuration for tool %s; cannot cast %s=%s to bool', tool.name(), _, config_[_])
config_['name'] = 'DQEventFlagFilterTool_%s' % tool.name()
tool.FilterTools += [GetEventFlagFilterTool(**config_)]
del config_
local_logger.info('Configurating special event cleaning for tool %s', tool)
else:
local_logger.info('Configuring generic event cleaning for tool %s', tool)
tool.FilterTools += [GetEventFlagFilterTool('DQEventFlagFilterTool')]
else:
local_logger.info('NOT configuring event cleaning for tool %s', tool)
# give all the tools the trigger translator # give all the tools the trigger translator
if DQMonFlags.useTrigger(): if DQMonFlags.useTrigger():
tool.TrigDecisionTool = monTrigDecTool tool.TrigDecisionTool = monTrigDecTool
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "AthenaMonitoring/DQEventFlagFilterTool.h"
#include "AthenaKernel/errorcheck.h"
#include "xAODEventInfo/EventInfo.h"
DQEventFlagFilterTool::DQEventFlagFilterTool(const std::string& type,const std::string& name,const IInterface* parent)
: AthAlgTool( type, name, parent )
, m_alwaysReturnTrue(false)
, m_invert(false)
, m_doLAr(true)
, m_doTile(true)
, m_doSCT(true)
, m_doCore(true)
{
declareInterface<IDQFilterTool>(this);
declareProperty("alwaysReturnTrue", m_alwaysReturnTrue);
declareProperty("invert", m_invert);
declareProperty("doLAr", m_doLAr);
declareProperty("doTile", m_doTile);
declareProperty("doSCT", m_doSCT);
declareProperty("doCore", m_doCore);
}
DQEventFlagFilterTool::~DQEventFlagFilterTool () {}
StatusCode DQEventFlagFilterTool::initialize()
{
ATH_MSG_VERBOSE("ATLAS Ready initialize");
// don't register callback if we always return true anyway
if (m_alwaysReturnTrue) return StatusCode::SUCCESS;
return StatusCode::SUCCESS;
}
bool DQEventFlagFilterTool::accept() const {
if (m_alwaysReturnTrue) {
return true;
} else {
const xAOD::EventInfo* eventInfo(0);
CHECK( evtStore()->retrieve( eventInfo ) );
bool passed(true); //event passes
auto errorcode(xAOD::EventInfo::Error);
if (m_doLAr && (eventInfo->errorState(xAOD::EventInfo::LAr) == errorcode)) {
ATH_MSG_DEBUG("Event fails LAr event veto");
passed = false;
} else if (m_doTile && (eventInfo->errorState(xAOD::EventInfo::Tile) == errorcode)) {
ATH_MSG_DEBUG("Event fails Tile event veto");
passed = false;
} else if (m_doSCT && (eventInfo->errorState(xAOD::EventInfo::SCT) == errorcode)) {
ATH_MSG_DEBUG("Event fails SCT event veto");
passed = false;
} else if (m_doCore && (eventInfo->eventFlags(xAOD::EventInfo::Core) & 0x40000)) {
ATH_MSG_DEBUG("Event fais data corruption veto");
passed = false;
}
passed ^= m_invert;
ATH_MSG_VERBOSE("Event flag DQ tool accept called, passed " << passed);
return passed;
}
}
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include "AthenaMonitoring/DQFilledBunchFilterTool.h" #include "AthenaMonitoring/DQFilledBunchFilterTool.h"
#include "AthenaKernel/errorcheck.h" #include "AthenaKernel/errorcheck.h"
#include "xAODEventInfo/EventInfo.h" #include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
DQFilledBunchFilterTool::DQFilledBunchFilterTool(const std::string& type,const std::string& name,const IInterface* parent) DQFilledBunchFilterTool::DQFilledBunchFilterTool(const std::string& type,const std::string& name,const IInterface* parent)
: AthAlgTool( type, name, parent ) : AthAlgTool( type, name, parent )
...@@ -34,10 +35,10 @@ bool DQFilledBunchFilterTool::accept() const { ...@@ -34,10 +35,10 @@ bool DQFilledBunchFilterTool::accept() const {
if (m_alwaysReturnTrue) { if (m_alwaysReturnTrue) {
return true; return true;
} else { } else {
const xAOD::EventInfo* eventInfo(0); const EventInfo* eventInfo(0);
CHECK( evtStore()->retrieve( eventInfo ) ); CHECK( evtStore()->retrieve( eventInfo ) );
auto bcid = eventInfo->bcid(); EventID::number_type bcid = eventInfo->event_ID()->bunch_crossing_id();
bool value = m_bunchtool->isFilled(bcid) ^ m_invert; bool value = m_bunchtool->isFilled(bcid) ^ m_invert;
ATH_MSG_VERBOSE("Filled bunch DQ tool accept called, value " << value); ATH_MSG_VERBOSE("Filled bunch DQ tool accept called, value " << value);
return value; return value;
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "AthenaMonitoring/ManagedMonitorToolTest.h" #include "AthenaMonitoring/ManagedMonitorToolTest.h"
#include "AthenaMonitoring/DQAtlasReadyFilterTool.h" #include "AthenaMonitoring/DQAtlasReadyFilterTool.h"
#include "AthenaMonitoring/DQFilledBunchFilterTool.h" #include "AthenaMonitoring/DQFilledBunchFilterTool.h"
#include "AthenaMonitoring/DQEventFlagFilterTool.h"
#include "AthenaMonitoring/DQDummyFilterTool.h" #include "AthenaMonitoring/DQDummyFilterTool.h"
#include "AthenaMonitoring/DQBadLBFilterTool.h" #include "AthenaMonitoring/DQBadLBFilterTool.h"
#include "AthenaMonitoring/TriggerTranslatorSimple.h" #include "AthenaMonitoring/TriggerTranslatorSimple.h"
...@@ -16,7 +15,6 @@ DECLARE_ALGORITHM_FACTORY(AthenaMonManager) ...@@ -16,7 +15,6 @@ DECLARE_ALGORITHM_FACTORY(AthenaMonManager)
DECLARE_TOOL_FACTORY(ManagedMonitorToolTest) DECLARE_TOOL_FACTORY(ManagedMonitorToolTest)
DECLARE_TOOL_FACTORY(DQAtlasReadyFilterTool) DECLARE_TOOL_FACTORY(DQAtlasReadyFilterTool)
DECLARE_TOOL_FACTORY(DQFilledBunchFilterTool) DECLARE_TOOL_FACTORY(DQFilledBunchFilterTool)
DECLARE_TOOL_FACTORY(DQEventFlagFilterTool)
DECLARE_TOOL_FACTORY(DQDummyFilterTool) DECLARE_TOOL_FACTORY(DQDummyFilterTool)
DECLARE_TOOL_FACTORY(DQBadLBFilterTool) DECLARE_TOOL_FACTORY(DQBadLBFilterTool)
DECLARE_TOOL_FACTORY(TriggerTranslatorToolSimple) DECLARE_TOOL_FACTORY(TriggerTranslatorToolSimple)
...@@ -28,7 +26,6 @@ DECLARE_FACTORY_ENTRIES(AthenaMonitoring) { ...@@ -28,7 +26,6 @@ DECLARE_FACTORY_ENTRIES(AthenaMonitoring) {
DECLARE_ALGTOOL(ManagedMonitorToolTest) DECLARE_ALGTOOL(ManagedMonitorToolTest)
DECLARE_ALGTOOL(DQAtlasReadyFilterTool) DECLARE_ALGTOOL(DQAtlasReadyFilterTool)
DECLARE_ALGTOOL(DQFilledBunchFilterTool) DECLARE_ALGTOOL(DQFilledBunchFilterTool)
DECLARE_ALGTOOL(DQEventFlagFilterTool)
DECLARE_ALGTOOL(DQDummyFilterTool) DECLARE_ALGTOOL(DQDummyFilterTool)
DECLARE_ALGTOOL(DQBadLBFilterTool) DECLARE_ALGTOOL(DQBadLBFilterTool)
DECLARE_ALGTOOL(TriggerTranslatorToolSimple) DECLARE_ALGTOOL(TriggerTranslatorToolSimple)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment