Commit ccb2a509 authored by Heather Russell's avatar Heather Russell
Browse files

ATR-15910, fixes to python/menu, share, and scripts for flake8 unit testing


Former-commit-id: 2067272c
parent dd38f1de
......@@ -10,11 +10,8 @@ from exc2string import exc2string2
#from TriggerJobOpts.TriggerFlags import TriggerFlags
from TrigGenericAlgs.TrigGenericAlgsConf import \ # noqa: F401
PESA__DummyUnseededAllTEAlgo as DummyAlgo
from TrigGenericAlgs.TrigGenericAlgsConf import \ # noqa: F401
PESA__SeededSuperRoiAllTEAlgo as SeededAlgo
from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyAlgo # noqa: F401
from TrigGenericAlgs.TrigGenericAlgsConf import PESA__SeededSuperRoiAllTEAlgo as SeededAlgo # noqa: F401
# from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX
......
......@@ -57,7 +57,7 @@ class ChainDef:
#safety: if asked to insert with sig_counter -1, use addSignature
if signature_counter == -1:
addSignature(signature_counter,listOfTriggerElements)
self.addSignature(signature_counter,listOfTriggerElements)
else:
pos_newSeq = -1
......
......@@ -314,7 +314,7 @@ class DictFromChainName(object):
logDict.debug('chainparts %s', chainparts)
# ---- check if L1 item is specified in chain Name ----
L1itemFromChainName = ''; L1item = '';
L1itemfromChainName = ''; L1item = '';
chainpartsNoL1 = chainparts
#Checking for L1 item for chain part and overall in the name
......
......@@ -42,6 +42,7 @@ class HLTChain:
if type(te) != type(''): # check if this is a string
raise Exception("The trigger element: " + str(te) + " in the signature: " + self.sigcounter + "is not a plain string" )
#xTriggerElement = etree.SubElement(xSignature, 'TRIGGERELEMENT', te_name=str(te))
etree.SubElement(xSignature, 'TRIGGERELEMENT', te_name=str(te))
# construction
def __init__(self, chain_name, chain_counter,
......@@ -287,12 +288,13 @@ class HLTChain:
xTriggerTypeList = etree.SubElement(xChain, 'TRIGGERTYPE_LIST')
for bit in self.trigger_type_bits:
print "HEATHER: THIS CODE IS ALIVE!"
xTriggerType = etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
#xTriggerType = etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
etree.SubElement(xTriggerTypeList, 'TRIGGERTYPE', bit = str(bit))
xStreamTagList = etree.SubElement(xChain, 'STREAMTAG_LIST')
for stream in self.stream_tag:
xStreamTag = etree.SubElement(xStreamTagList, 'STREAMTAG',
#xStreamTag = etree.SubElement(xStreamTagList, 'STREAMTAG',
etree.SubElement(xStreamTagList, 'STREAMTAG',
stream = stream[0],
type = stream[1],
obeyLB = stream[2],
......@@ -306,7 +308,8 @@ class HLTChain:
xGroupList = etree.SubElement(xChain, 'GROUP_LIST')
for g in self.groups:
xGroup = etree.SubElement(xGroupList, 'GROUP', name = g)
#xGroup = etree.SubElement(xGroupList, 'GROUP', name = g)
etree.SubElement(xGroupList, 'GROUP', name = g)
xSignatureList = etree.SubElement(xChain, 'SIGNATURE_LIST')
for sig in self.siglist:
......
......@@ -4,8 +4,6 @@
# Hlt configuration base classes
#-----------------------------------------------------
#from AthenaCommon.Configurable import *
from TriggerJobOpts.TriggerFlags import *
from TriggerMenu.menu.ChainDef import ChainDef
from AthenaCommon.Logging import logging # loads logger
......
......@@ -314,7 +314,7 @@ def getL1LowLumi(l1seed):
#####################################
def getSpecificL1Seeds(l1seedname, l1itemobject):
l1items = [i.name for i in l1itemobject]
l1ctpid = [i.ctpid for i in l1itemobject]
#l1ctpid = [i.ctpid for i in l1itemobject]
L1Seed = ''
if l1seedname == 'L1_J':
L1Seed = getL1JetBS()
......
......@@ -4,7 +4,6 @@
#------------------------------------------------------------------------#
def setupMenu():
from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerMenu.menu.LS1_v1.py' )
......@@ -161,8 +160,6 @@ def setupMenu():
]
allL1TAUseeds = ",".join([ x for x in tcl1.current.menu.items.itemNames() if "TAU" in x ])
TriggerFlags.CalibSlice.signatures = [
['l1calocalib', 'L1_RD0_FILLED', [], ['L1CaloCalib'], ["RATE:Calibration", "RATE:L1CaloCalib", "BW:Detector"], -1],
['l1calocalib_L1BGRP7', 'L1_BGRP7', [], ['L1CaloCalib'], ["RATE:Calibration", "RATE:L1CaloCalib", "BW:Detector"], -1],
......
......@@ -16,7 +16,6 @@ log = logging.getLogger( 'MC_HI_v3.py' )
def setupMenu():
physics_menu.setupMenu()
PhysicsStream="Main"
# ---------------------------------------------------------------------------------------
......
......@@ -16,7 +16,6 @@ log = logging.getLogger( 'MC_HI_v4.py' )
def setupMenu():
physics_menu.setupMenu()
PhysicsStream="Main"
# ---------------------------------------------------------------------------------------
......
......@@ -5,7 +5,7 @@ import TriggerMenu.menu.Physics_pp_v6 as physics_menu
from TriggerJobOpts.TriggerFlags import TriggerFlags
from copy import deepcopy
import re
from AthenaCommon.Logging import logging
......
......@@ -6,7 +6,7 @@ import TriggerMenu.menu.Physics_pp_v7 as physics_menu
from TriggerJobOpts.TriggerFlags import TriggerFlags
from copy import deepcopy
import re
from AthenaCommon.Logging import logging
log = logging.getLogger( 'MC_pp_v7.py' )
......@@ -25,8 +25,8 @@ def setupMenu():
RATE_BphysTag = 'RATE:Bphysics'
RATE_BMultiMuonTag = 'RATE:MultiMuon' # can become RATE:BMultiMuon' with one letter change
BW_BphysTag = 'BW:Bphys'
RATE_DYTag = 'RATE:Muon'
BW_DYTag = 'BW:Muon'
#RATE_DYTag = 'RATE:Muon' #not being used at this time
#BW_DYTag = 'BW:Muon'
# ---------------------------------------------------------------------------------------
......
......@@ -116,7 +116,6 @@ def checkStreamConsistency(triggerPythonConfig):
"""
menu_name = TriggerFlags.triggerMenuSetup()
log.info( "Menu: " + menu_name)
CheckGroups=False
from TriggerMenu.menu.StreamInfo import getAllStreams
......
......@@ -4,7 +4,6 @@
#------------------------------------------------------------------------#
def setupMenu():
from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerMenu.menu.Physics_HI_v3.py' )
......
......@@ -4,7 +4,6 @@
#------------------------------------------------------------------------#
def setupMenu():
from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerMenu.menu.Physics_HI_v4.py' )
......
......@@ -4,7 +4,6 @@
#------------------------------------------------------------------------#
def setupMenu():
from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerMenu.menu.Physics_pp_v6.py' )
......
......@@ -4,7 +4,6 @@
#------------------------------------------------------------------------#
def setupMenu():
from TriggerMenu.menu.TriggerPythonConfig import TriggerPythonConfig
from TriggerJobOpts.TriggerFlags import TriggerFlags
from AthenaCommon.Logging import logging
log = logging.getLogger( 'TriggerMenu.menu.Physics_pp_v7.py' )
......
......@@ -901,7 +901,6 @@ def getSignatureInformation(signature):
def getBasePattern():
import re
import itertools
# possibleTT = '|'.join(allowedSignaturePropertiesAndValues['trigType'])
#print 'SignatureDicts.py: Allowed values for triType in base pattern', SliceIDDict.values()
allTrigTypes = SliceIDDict.values()
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
import TriggerMenu.egamma.EgammaSliceFlags
import TriggerMenu.jet.JetSliceFlags
import TriggerMenu.bjet.BjetSliceFlags
import TriggerMenu.muon.MuonSliceFlags
import TriggerMenu.met.METSliceFlags
import TriggerMenu.tau.TauSliceFlags
import TriggerMenu.bphysics.BphysicsSliceFlags
import TriggerMenu.minbias.MinBiasSliceFlags
import TriggerMenu.heavyion.HeavyIonSliceFlags
import TriggerMenu.combined.CombinedSliceFlags
import TriggerMenu.calibcosmicmon.CosmicSliceFlags
import TriggerMenu.calibcosmicmon.CalibSliceFlags
import TriggerMenu.calibcosmicmon.StreamingSliceFlags
import TriggerMenu.calibcosmicmon.MonitorSliceFlags
import TriggerMenu.calibcosmicmon.BeamspotSliceFlags
import TriggerMenu.calibcosmicmon.EnhancedBiasSliceFlags
import TriggerMenu.test.TestSliceFlags
import TriggerMenu.egamma.EgammaSliceFlags # noqa: F401
import TriggerMenu.jet.JetSliceFlags # noqa: F401
import TriggerMenu.bjet.BjetSliceFlags # noqa: F401
import TriggerMenu.muon.MuonSliceFlags # noqa: F401
import TriggerMenu.met.METSliceFlags # noqa: F401
import TriggerMenu.tau.TauSliceFlags # noqa: F401
import TriggerMenu.bphysics.BphysicsSliceFlags # noqa: F401
import TriggerMenu.minbias.MinBiasSliceFlags # noqa: F401
import TriggerMenu.heavyion.HeavyIonSliceFlags # noqa: F401
import TriggerMenu.combined.CombinedSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.CosmicSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.CalibSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.StreamingSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.MonitorSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.BeamspotSliceFlags # noqa: F401
import TriggerMenu.calibcosmicmon.EnhancedBiasSliceFlags # noqa: F401
import TriggerMenu.test.TestSliceFlags # noqa: F401
......@@ -4,7 +4,6 @@
import os, sys
import xml.etree.cElementTree as ET
import logging
import math
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(message)s')
......@@ -148,7 +147,7 @@ class PSRule:
if target_lumi > self.scd_min_lumi:
#make this completely independent
#get PS at snd_min_lumi
scd_ps = self.scd_min_lumi/current_lumi*self.factor
#scd_ps = self.scd_min_lumi/current_lumi*self.factor
if (self.scd_factor==0):
ret_prescale = self.scd_value
else:
......
......@@ -9,7 +9,7 @@
"""
import importlib
import sys, re
import sys
tag = "pp_v6"
if len(sys.argv) > 1:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment