Commit 6120e0b6 authored by Lidija Zivkovic's avatar Lidija Zivkovic
Browse files

ATR-15709: The first import of the HLT afp chains, creates the empty one now

Former-commit-id: 8c52c1842ff5a165b307e73a694abf7f1355f64e
parent ba6b18c9
......@@ -8,7 +8,7 @@ atlas_subdir( TriggerMenu )
# Install files from the package:
atlas_install_python_modules( python/*.py python/menu python/l1
python/l1menu python/l1topo python/l1topomenu python/egamma
python/muon python/jet python/bjet python/met python/tau
python/muon python/jet python/bjet python/met python/tau python/afp
python/minbias python/heavyion python/bphysics python/calibcosmicmon
python/test python/combined python/commonUtils )
atlas_install_joboptions( share/*.py )
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
""" AFP slice signatures """
__author__ = "L. Zivkovic, C.Bernius"
__version__ = ""
__doc__="Implementation of AFP slice in new TM framework "
##########################################################
#from AthenaCommon.SystemOfUnits import GeV
from TriggerMenu.menu.HltConfig import L2EFChainDef
#from TriggerMenu.menu.HltConfig import L2EFChainDef,mergeRemovingOverlap
from AthenaCommon.Logging import logging
logging.getLogger().info("Importing %s",__name__)
log = logging.getLogger("TriggerMenu.afp.AFPDef")
## Here probably HLT goes?
## Import from AFPHypo?
#from TriggerJobOpts.TriggerFlags import TriggerFlags
#from TrigAFPHypo.TrigAFPJetAllTEConfig import TrigAFPJetAllTE
## More may go here
#############################################################################
class L2EFChain_afp(L2EFChainDef):
def __init__(self, chainDict):
self.L2sequenceList = []
self.EFsequenceList = []
self.L2signatureList = []
self.EFsignatureList = []
self.TErenamingDict = []
self.chainPart = chainDict['chainParts']
self.chainL1Item = chainDict['L1item']
self.chainPartL1Item = self.chainPart['L1item']
self.chainCounter = chainDict['chainCounter']
self.L2Name = 'L2_'+self.chainPart['chainPartName']
self.EFName = 'EF_'+self.chainPart['chainPartName']
#self.mult = int(self.chainPart['multiplicity'])
self.chainName = chainDict['chainName']
self.chainPartName = self.chainPart['chainPartName']
#self.chainPartNameNoMult = self.chainPartName[1:] if self.mult > 1 else self.chainPartName
# These two lines should eventually be uncommented
self.L2InputL1Item = self.chainPartL1Item or self.chainL1Item
if self.L2InputL1Item:
## self.L2InputTE = getInputTEfromL1Item(self.L2InputL1Item)
## else:
self.L2InputTE = ''
L2EFChainDef.__init__(self, self.chainName, self.L2Name, self.chainCounter, self.chainL1Item, self.EFName, self.chainCounter, self.L2InputTE)
def defineSequences(self):
for sequence in self.L2sequenceList:
self.addL2Sequence(*sequence)
for sequence in self.EFsequenceList:
self.addEFSequence(*sequence)
def defineSignatures(self):
for signature in self.L2signatureList:
self.addL2Signature(*signature)
for signature in self.EFsignatureList:
self.addEFSignature(*signature)
def defineTErenaming(self):
self.TErenamingMap = self.TErenamingDict
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
""" AFP slice specific flags """
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper
#from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
# create container
__author__ = 'L. Zivkovic'
__version__="$Revision: 1.0 $"
__doc__="AFP slice specific flags "
_flags = []
class signatures(JobProperty):
""" signatures in AFP slice """
statusOn=True
allowedTypes=['list']
StoredValue = []
_flags.append(signatures)
class AFPSlice(JobPropertyContainer, CommonSliceHelper):
""" AFP Slice Flags """
from TriggerJobOpts.TriggerFlags import TriggerFlags
TriggerFlags.add_Container(AFPSlice)
# add add common slice flags
TriggerFlags.AFPSlice.import_JobProperties('TriggerMenu.menu.CommonSliceFlags')
for flag in _flags:
TriggerFlags.AFPSlice.add_JobProperty(flag)
del _flags
# make an alias
AFPSliceFlags = TriggerFlags.AFPSlice
# LocalWords: allowedTypes
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
##########################################################################################
##########################################################################################
__doc__=""
__version__="Implementation of AFP Slice signatures"
from AthenaCommon.Logging import logging
logging.getLogger().info("Importing %s",__name__)
from TriggerMenu.afp.AFPDef import L2EFChain_afp
#from TriggerJobOpts.TriggerFlags import TriggerFlags
from TriggerMenu.menu.MenuUtils import splitChainDict,mergeChainDefs
AFP = []
##########################################################################################
##########################################################################################
def generateChainDefs(chainDict):
listOfChainDicts = splitChainDict(chainDict)
listOfChainDefs = []
for subChainDict in listOfChainDicts:
AFP = L2EFChain_afp(subChainDict)
listOfChainDefs += [AFP.generateHLTChainDef()]
if len(listOfChainDefs)>1:
listOfChainDefs = [mergeChainDefs(listOfChainDefs)]
else:
listOfChainDefs = [listOfChainDefs[0]]
listOfChainDefs.reverse()
return listOfChainDefs
##########################################################
......@@ -226,6 +226,15 @@ class DictFromChainName(object):
mdicts.append(m_groupdict)
break # stop loop here so mb doesn't get picked up from min bias slice as it's streaming info
## Not sure if this is necessary, per suggestion from C. Bernius
elif cpart=='afp':
logDict.debug('Doing AFP')
multichainindex.append(chainName.index(cpart))
m_groupdict = {'signature': 'AFP', 'threshold': '', 'multiplicity': '',
'trigType': 'afp', 'extra': ''}
if 'AFP' not in signatureNames: signatureNames.append('AFP')
mdicts.append(m_groupdict)
elif cpart=='mb':
logDict.debug('Doing MB')
multichainindex.append(chainName.index(cpart))
......
......@@ -8,6 +8,7 @@ from TriggerMenu.jet.JetSliceFlags import JetSliceFlags
from TriggerMenu.bjet.BjetSliceFlags import BjetSliceFlags
from TriggerMenu.met.METSliceFlags import METSliceFlags
from TriggerMenu.tau.TauSliceFlags import TauSliceFlags
from TriggerMenu.afp.AFPSliceFlags import AFPSliceFlags
from TriggerMenu.minbias.MinBiasSliceFlags import MinBiasSliceFlags
from TriggerMenu.heavyion.HeavyIonSliceFlags import HeavyIonSliceFlags
from TriggerMenu.combined.CombinedSliceFlags import CombinedSliceFlags
......@@ -76,6 +77,7 @@ class GenerateMenu:
self.doBphysicsChains = True
self.doMETChains = True
self.doTauChains = True
self.doAFPChains = True
self.doMinBiasChains = True
self.doHeavyIonChains = True
self.doCosmicChains = True
......@@ -149,6 +151,12 @@ class GenerateMenu:
else:
self.doTauChains = False
if (CombinedSliceFlags.signatures() or AFPSliceFlags.signatures()) and self.doAFPChains:
chains += AFPSliceFlags.signatures()
log.debug('GenerateMenu : AFP : %s', chains)
else:
self.doAFPChains = False
if (CombinedSliceFlags.signatures() or MinBiasSliceFlags.signatures()) and self.doMinBiasChains:
chains += MinBiasSliceFlags.signatures()
log.debug('GenerateMenu : MinBias : %s', chains)
......@@ -321,6 +329,14 @@ class GenerateMenu:
log.info(traceback.print_exc())
self.doBjetChains = False
if self.doAFPChains:
try:
import TriggerMenu.afp.generateAFPChainDefs
except:
log.error('Problems when importing AFP.py, disabling AFP chains.')
log.info(traceback.print_exc())
self.doAFPChains = False
if self.doMinBiasChains:
try:
import TriggerMenu.minbias.generateMinBiasChainDefs
......@@ -405,7 +421,7 @@ class GenerateMenu:
#allowedSignatures = ["jet","egamma","muon", "electron", "photon","met","tau",
#allowedSignatures = ["jet","egamma","muon", "electron", "photon","met","tau", "afp",
# "minbias", "heavyion", "cosmic", "calibration", "streaming", "monitoring", "ht", 'bjet','eb']
listOfChainDefs = []
......@@ -489,6 +505,14 @@ class GenerateMenu:
log.error('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
log.info(traceback.print_exc())
continue
elif chainDict["signature"] == "AFP" and self.doAFPChains:
try:
chainDefs = TriggerMenu.afp.generateAFPChainDefs.generateChainDefs(chainDict)
except:
log.error('Problems creating ChainDef for chain %s ' % (chainDict['chainName']))
log.info(traceback.print_exc())
continue
elif chainDict["signature"] == "MinBias" and self.doMinBiasChains:
try:
......@@ -718,6 +742,7 @@ class GenerateMenu:
dumpIt(f, EgammaSliceFlags.signatures(), 'Egamma')
dumpIt(f, METSliceFlags.signatures(), 'MET')
dumpIt(f, TauSliceFlags.signatures(), 'Tau')
dumpIt(f, AFPSliceFlags.signatures(), 'AFP')
dumpIt(f, MinBiasSliceFlags.signatures(), 'MinBias')
dumpIt(f, HeavyIonSliceFlags.signatures(), 'HeavyIon')
dumpIt(f, CosmicSliceFlags.signatures(), 'Cosmic')
......
......@@ -11,6 +11,7 @@ AllowedGroups = ['Muon',
'Egamma',
'Bphys',
'BeamSpot',
'AFP',
'MinBias',
'Detector',
'Other',
......
......@@ -25,7 +25,10 @@ def setupMenu():
TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
]
TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
]
TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
]
......
......@@ -25,7 +25,10 @@ def setupMenu():
TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
]
TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
]
TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
]
......
......@@ -189,7 +189,10 @@ def setupMenu():
]
TriggerFlags.BeamspotSlice.signatures = [
]
]
TriggerFlags.AFPSlice.signatures = [
]
TriggerFlags.MinBiasSlice.signatures = [
]
......
......@@ -35,7 +35,12 @@ def setupMenu():
# ----------------------------------------------------------------------------------------
TriggerFlags.TestSlice.signatures = TriggerFlags.TestSlice.signatures() + [
]
]
TriggerFlags.AFPSlice.signatures = TriggerFlags.AFPSlice.signatures() + [
['afp_L1AFP_A_AND_C_SPECTOF_J50', 'L1_AFP_A_AND_C_SPECTOF_J50', [], ['MinBias'], [ 'RATE:MinBias','BW:MinBias'], -1],
# ['afp_L1AFP_A_AND_C_SPECTOF_J50', 'L1_AFP_A_AND_C_SPECTOF_J50', [], [PhysicsStream], [ 'RATE:MinBias','BW:MinBias'], -1],
]
TriggerFlags.MuonSlice.signatures = TriggerFlags.MuonSlice.signatures() + [
['mu20_r1extr', 'L1_MU20MU21', ['L1_MU20'], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1],
......
......@@ -218,6 +218,7 @@ def allSignatures():
TriggerFlags.METSlice,
TriggerFlags.TauSlice,
TriggerFlags.EgammaSlice,
TriggerFlags.AFPSlice,
TriggerFlags.MinBiasSlice,
TriggerFlags.CombinedSlice,
)
......
......@@ -31,6 +31,8 @@ def setupMenu():
TriggerFlags.Slices_all_setOff()
TriggerFlags.TestSlice.signatures = []
TriggerFlags.AFPSlice.signatures = []
TriggerFlags.MuonSlice.signatures = [
#ID tracking performance
......
......@@ -31,6 +31,8 @@ def setupMenu():
TriggerFlags.Slices_all_setOff()
TriggerFlags.TestSlice.signatures = []
TriggerFlags.AFPSlice.signatures = []
TriggerFlags.MuonSlice.signatures = [
#ID tracking performance
......
......@@ -40,6 +40,7 @@ def setupMenu():
TriggerFlags.TestSlice.signatures = []
TriggerFlags.AFPSlice.signatures = []
TriggerFlags.MuonSlice.signatures = [
# single muon
......
......@@ -18,6 +18,7 @@ SliceIDDict = {
'MET' : 'xe',
'XS' : 'xs',
'TE' : 'te',
'AFP' : 'afp',
'MinBias' : 'mb',
'HeavyIon' : 'hi',
'Cosmic' : 'cosmic',
......@@ -493,6 +494,33 @@ CombinedChainParts_Default['chainParts'] = ['g','mu'],
CombinedChainParts_Default['trigType'] =['g','mu']
CombinedChainParts_Default['topo'] = []
#==========================================================
# AFP
#==========================================================
# ---- AFP Dictinary of all allowed Values ----
AFPChainParts = {
'signature' : ['AFP'],
'L1item' : '',
'chainPartName' : '',
'multiplicity' : '',
'trigType' : ['afp'],
'threshold' : '',
'extra' : [],
'addInfo' : []
}
# ---- AFPDictinary of default Values ----
AFPChainParts_Default = {
'signature' : ['AFP'],
'L1item' : '',
'chainPartName' : '',
'multiplicity' : '',
'trigType' : ['afp'],
'threshold' : '',
'extra' : '',
'addInfo' : []
}
#==========================================================
# MinBias chains
#==========================================================
......@@ -877,6 +905,8 @@ def getSignatureInformation(signature):
return [XSChainParts_Default, XSChainParts]
if signature == "TE":
return [TEChainParts_Default, TEChainParts]
if signature == "AFP":
return [AFPChainParts_Default, AFPChainParts]
if signature == "MinBias":
return [MinBiasChainParts_Default, MinBiasChainParts]
if signature == "HeavyIon":
......
......@@ -7,6 +7,7 @@ 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.afp.AFPSliceFlags # noqa: F401
import TriggerMenu.minbias.MinBiasSliceFlags # noqa: F401
import TriggerMenu.heavyion.HeavyIonSliceFlags # noqa: F401
import TriggerMenu.combined.CombinedSliceFlags # noqa: F401
......
......@@ -18,7 +18,8 @@ physicsStreams = ['Main',
'Bphysics',
'Combined',
'Muon',
'Met', 'Jet', 'Tau',
'Met', 'Jet', 'Tau',
'AFP',
'MinBias',
'ZeroBias',
'TauOverlay',
......
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