Commit 61db7955 authored by Emma Torro Pastor's avatar Emma Torro Pastor Committed by Graeme Stewart
Browse files

Adding noalg_l1calo_L1J400 (ATR-13991) (TriggerMenu-00-17-90)

2016-05-04 Emma Torro
	* Adding noalg_l1calo_L1J400 (ATR-13991)
	* TriggerMenu-00-17-90

2016-05-04 Javier Montejo Berlingen
	* Fix for jet window size in JJ15.23ETA49: ATR-13984
	* Corresponds to TriggerMenuXML-04-01-91
	* TriggerMenu-00-17-89

2016-05-04 Nils Ruthmann
	* Improvements to mistimemon chains
	* Allow simple late J400 trigger
	* Add improved version of HLTtiming
	* Fix for long Muon L1 signals
	* Requires TrigGenericAlgs-00-00-54
	* TriggerMenu-00-17-88
2016-05-04 Ljiljana Morvaj
	* Add e28_lhtight_nod0 chains (ATR-13989)
	* Fix CPS warnings in HLT_mcV6 (ATR-13903)
	* TriggerMenu-00-17-87
...
(Long ChangeLog diff - truncated)
parent bc67df05
################################################################################
# Package: TriggerMenu
################################################################################
# Declare the package name:
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/minbias python/heavyion python/bphysics python/calibcosmicmon python/test python/combined )
atlas_install_joboptions( share/*.py )
atlas_install_scripts( scripts/generate*Menu.py scripts/menuTestTMC.sh )
atlas_install_xmls( data/*.dtd data/*.xml )
......@@ -7,35 +7,11 @@ use AtlasPolicy AtlasPolicy-*
apply_pattern declare_joboptions files="*.py"
pattern declare_python_submodule \
apply_pattern generic_declare_for_link kind=python_modules files='-s=../python/<submodule>/<subsubmodule> <files>' prefix=python/<package>/<submodule>/<subsubmodule> name=<submodule><subsubmodule> ; \
private ; \
macro_append <package>_python_init_dependencies " install_<submodule><subsubmodule>python_modules " ; \
end_private
apply_pattern declare_python_modules files="*.py"
apply_pattern declare_python_submodule files="*.py" submodule=menu
apply_pattern declare_python_submodule files="*.py" submodule=l1
apply_pattern declare_python_submodule files="*.py" submodule=l1menu
apply_pattern declare_python_submodule files="*.py" submodule=l1topo
apply_pattern declare_python_submodule files="*.py" submodule=l1topomenu
apply_pattern declare_python_submodule files="*.py" submodule=egamma
apply_pattern declare_python_submodule files="*.py" submodule=muon
apply_pattern declare_python_submodule files="*.py" submodule=jet
apply_pattern declare_python_submodule files="*.py" submodule=bjet
apply_pattern declare_python_submodule files="*.py" submodule=met
apply_pattern declare_python_submodule files="*.py" submodule=tau
apply_pattern declare_python_submodule files="*.py" submodule=minbias
apply_pattern declare_python_submodule files="*.py" submodule=heavyion
apply_pattern declare_python_submodule files="*.py" submodule=bphysics
apply_pattern declare_python_submodule files="*.py" submodule=calibcosmicmon
apply_pattern declare_python_submodule files="*.py" submodule=test
apply_pattern declare_python_submodule files="*.py" submodule=combined
#apply_pattern declare_python_modules files="*.py ../scripts/cnvXml_express.py"
apply_pattern declare_python_modules files="*.py menu l1 l1menu l1topo \
l1topomenu egamma muon jet \
bjet met tau minbias heavyion \
bphysics calibcosmicmon test \
combined"
apply_pattern declare_xmls
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from sys import settrace
import re
from collections import defaultdict
from .TriggerConfigL1Topo import TriggerConfigL1Topo
from l1.Lvl1Menu import Lvl1Menu
......@@ -17,17 +15,18 @@ class TriggerConfigLVL1:
current = None
def __init__(self, outputFile = None , inputFile = None , menuName = None , topoMenu = "MATCH" ):
"""
menuName: ignored now, will be taken from TF.triggerMenuSetup
menuName: if None taken from TF.triggerMenuSetup, otherwise assume externally defined menu
topoMenu: MATCH means that the L1Topo menu matches the L1 menu
"""
TriggerConfigLVL1.current = self
from TriggerJobOpts.TriggerFlags import TriggerFlags
self.menuName = TriggerFlags.triggerMenuSetup()
self.menuName = TriggerFlags.triggerMenuSetup() if menuName==None else menuName
self.inputFile = inputFile
self.outputFile = outputFile
self.topoMenu = topoMenu
self.l1menuFromXML = None # flag if l1menu is read from XML file
# all registered items
......@@ -38,8 +37,9 @@ class TriggerConfigLVL1:
# get L1Topo trigger line connections
if topoMenu=="MATCH": topoMenu = self.menuName # topo menu name should match CTP menu for correct connection
self.topotriggers = self.getL1TopoTriggerLines(topoMenu)
self.registerAllTopoTriggersAsThresholds()
if topoMenu!=None:
self.topotriggers = self.getL1TopoTriggerLines(topoMenu)
self.registerAllTopoTriggersAsThresholds()
# menu
......@@ -49,9 +49,8 @@ class TriggerConfigLVL1:
"""Read menu from XML"""
self.l1menuFromXML = True
self.menu.readMenuFromXML(self.inputFile)
else:
elif menuName==None:
"""Build menu from menu name"""
# defines the menu (item and threshold names)
TriggerConfigLVL1.defineMenu(self.menuName)
......@@ -70,7 +69,6 @@ class TriggerConfigLVL1:
else:
triggerLines = None
try:
from TriggerJobOpts.TriggerFlags import TriggerFlags
tpcl1 = TriggerConfigL1Topo()
tpcl1.generateMenu()
triggerLines = tpcl1.menu.getTriggerLines()
......@@ -116,8 +114,8 @@ class TriggerConfigLVL1:
if not self.topotriggers:
return
from l1.Lvl1Thresholds import LVL1Threshold, LVL1TopoInput
from l1.Lvl1Thresholds import LVL1TopoInput
from collections import defaultdict
multibitTopoTriggers = defaultdict(list)
multibitPattern = re.compile("(?P<line>.*)\[(?P<bit>\d+)\]")
......@@ -173,7 +171,6 @@ class TriggerConfigLVL1:
Writes L1 XML file
returns the file name
"""
log = logging.getLogger("TriggerConfigLVL1")
if self.outputFile is None:
log.warning("Can't write xml file since no name was provided")
return
......@@ -207,7 +204,6 @@ class TriggerConfigLVL1:
menuName=TriggerConfigL1Topo.getMenuBaseName(menuName)
menumodule = __import__('l1menu.Menu_%s' % menuName, globals(), locals(), ['defineMenu'], -1)
menumodule.defineMenu()
log = logging.getLogger('TriggerConfigLVL1.defineMenu')
log.info("menu %s contains %i items and %i thresholds" % ( menuName, len(Lvl1Flags.items()), len(Lvl1Flags.thresholds()) ) )
......@@ -220,13 +216,11 @@ class TriggerConfigLVL1:
Has to run AFTER defineMenu
"""
from l1.Lvl1Flags import Lvl1Flags
run1 = Lvl1Flags.CTPVersion()<=3
itemdefmodule = __import__('l1menu.ItemDef%s' % ('Run1' if run1 else ''), globals(), locals(), ['ItemDef'], -1)
log = logging.getLogger('TriggerConfigLVL1.registerMenu')
itemdefmodule.ItemDef.registerItems(self)
log.info("registered %i items and %i thresholds (%s)" % ( len(self.registeredItems), len(self.registeredThresholds), ('Run 1' if run1 else 'Run 2') ) )
......@@ -243,9 +237,6 @@ class TriggerConfigLVL1:
log.info("Menu was read from input file '%s', generateMenu() will not run" % self.inputFile)
return
from AthenaCommon.Logging import logging
log = logging.getLogger('TriggerConfigLVL1.generateMenu')
# build list of items for the menu from the list of requested names
itemsForMenu = []
......@@ -368,16 +359,16 @@ class TriggerConfigLVL1:
thr.cableinfo.range_begin = 30
thr.cableinfo.range_end = 30
c += Counter( ((thr.cableinfo.slot,thr.cableinfo.connector),) )
if sorted(c.values())[-1]>1:
if len(c)>0 and sorted(c.values())[-1]>1:
for k,v in c.items():
if v>1:
print "Slot %i, connector %i has more than one ZB threshold" % k
log.error("Slot %i, connector %i has more than one ZB threshold" % k)
raise RuntimeError("Multiple zero bias thresholds on single connector")
def updateItemPrescales(self):
from TriggerMenu.l1.Lvl1Flags import Lvl1Flags
for (it_name, ps) in Lvl1Flags.prescales().items():
item = self.menu.getItem(it_name)
if item:
......
......@@ -7,10 +7,42 @@ from AthenaCommon.Logging import logging
logging.getLogger().info("Importing %s",__name__)
log = logging.getLogger("TriggerMenu.bjet.generateBjetChainDefs.py")
from TriggerMenu.menu.MenuUtils import *
from TriggerMenu.menu.MenuUtils import mergeChainDefs, splitChainDict, setupTopoStartFrom
from TriggerMenu.jet.generateJetChainDefs import generateChainDefs as genJetChainDefs
from TriggerMenu.menu.DictFromChainName import DictFromChainName
theDictFromChainName = DictFromChainName()
from TrigBjetHypo.TrigBjetFexConfig import (getBjetFexFTKInstance,
getBjetFexFTKRefitInstance,
getBjetFexFTKVtxInstance,
getBjetFexInstance,
getBjetFexSplitInstance)
from TrigBjetHypo.TrigBtagFexConfig import (getBtagFexFTKInstance,
getBtagFexFTKRefitInstance,
getBtagFexFTKVtxInstance,
getBtagFexInstance,
getBtagFexSplitInstance)
from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
from TrigBjetHypo.TrigBjetHypoConfig import (getBjetHypoInstance,
getBjetHypoNoCutInstance,
getBjetHypoSplitInstance,
getBjetHypoSplitNoCutInstance)
from TrigBjetHypo.TrigEFBjetSequenceAllTEConfig import getEFBjetAllTEInstance
from TrigBjetHypo.TrigFarawayJetFinderAllTEConfig import getFarawayJetFinderAllTEInstance
from TrigBjetHypo.TrigJetSplitterAllTEConfig import getJetSplitterAllTEInstance, getJetSplitterFTKAllTEInstance
from TrigBjetHypo.TrigSuperRoiBuilderAllTEConfig import getSuperRoiBuilderAllTEInstance
from InDetTrigVxSecondary.InDetTrigVxSecondary_LoadTools import TrigVxSecondaryCombo_EF, TrigVxSecondary_EF
from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence
from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxAllTEConfig import EFHistoPrmVtxAllTE_Jet
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxComboConfig import EFHistoPrmVtxCombo_Jet
from collections import Counter
from copy import deepcopy
import pprint
pp = pprint.PrettyPrinter(indent=4, depth=8)
......@@ -18,9 +50,9 @@ pp = pprint.PrettyPrinter(indent=4, depth=8)
###########################################################################
def generateChainDefs(chainDict):
from copy import deepcopy
chainDict_orig = deepcopy(chainDict)
log.debug("Initial b-jet chainDict: \n %s" % (pp.pformat(chainDict)))
# PrettyPrinter is rather expensive so make sure we don't invoke it unless in DEBUG
if log.isEnabledFor(logging.DEBUG): log.debug("Initial b-jet chainDict: \n %s" , pp.pformat(chainDict))
#----------------------------------------------------------------------------
# --- preparing the dictionary for jet chain generation ---
......@@ -49,36 +81,35 @@ def generateChainDefs(chainDict):
if ('L1RD0_EMPTY' in chainDict['chainName']):
thejThrChainDef['L1item'] = 'L1_RD0_EMPTY'
from TriggerMenu.jet.generateJetChainDefs import generateChainDefs as genJetChainDefs
theBJChainDef = genJetChainDefs(thejThrChainDef)
log.debug("ChainDef for b-jet chain: \n %s" % (str(theBJChainDef)))
log.debug("ChainDef for b-jet chain: \n %s", theBJChainDef)
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# --- build the jet chain, then pass JetChainDef and bjetchainDictionaries to build bjet chains ---
theAllJetChainDef = genJetChainDefs(jetchainDict)
log.debug("Jet ChainDef for b-jet chain: \n %s" % (str(theAllJetChainDef)))
log.debug("Jet ChainDef for b-jet chain: \n %s", theAllJetChainDef)
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# --- now merge chain defs so that last TE is from jet serving as input to bjet seq ---
# DO NOT CHANGE THE MERGING ORDER PLEASE, OTHERWISE WRONG INPUTTE IS SELECTED
log.debug("Trying to merge chainDef for b-jet chain: \n %s " % (str(theBJChainDef) ))
log.debug("AllJetChainDef: \n %s" % str(theAllJetChainDef))
log.debug("Trying to merge chainDef for b-jet chain: \n %s ", theBJChainDef)
log.debug("AllJetChainDef: \n %s", theAllJetChainDef)
theJetChainDef = mergeChainDefs([theAllJetChainDef, theBJChainDef], 'serial', -1, False)
log.debug("Merged chainDef for b-jet chain: \n %s" % (str(theJetChainDef)))
log.debug("Merged chainDef for b-jet chain: \n %s", theJetChainDef)
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
# --- filtering b-tagged jets chainParts ---
listofChainDicts = splitChainDict(chainDict_orig)
log.debug("Split b-jet chainDict: \n %s" % (pp.pformat(listofChainDicts)))
if log.isEnabledFor(logging.DEBUG): log.debug("Split b-jet chainDict: \n %s" , pp.pformat(listofChainDicts))
bjetchainDicts = [cdict for cdict in listofChainDicts if cdict['chainParts']['bTag']]
log.debug("Final b-jet chainDict: \n %s" % (pp.pformat(bjetchainDicts)))
if log.isEnabledFor(logging.DEBUG): log.debug("Final b-jet chainDict: \n %s" , pp.pformat(bjetchainDicts))
theListOfChainDefs = []
for subChainDict in bjetchainDicts:
......@@ -87,25 +118,21 @@ def generateChainDefs(chainDict):
theListOfChainDefs += [theBjetChainDef]
log.debug("----------------- Beginning of final individual chainDefs for b-jet chains printout -----------------")
for chainDef in theListOfChainDefs:
log.debug(str(chainDef))
log.debug("----------------- End of final individual chainDefs for b-jet chains printout -----------------")
if log.isEnabledFor(logging.DEBUG):
log.debug("----------------- Beginning of final individual chainDefs for b-jet chains printout -----------------")
for chainDef in theListOfChainDefs:
log.debug('%s',chainDef)
log.debug("----------------- End of final individual chainDefs for b-jet chains printout -----------------")
if len(theListOfChainDefs)>1:
theFinalChainDef = mergeChainDefs(theListOfChainDefs,strategy="parallel",offset=-1,preserveL2EFOrder=True,removeDuplicateTEs=True)
else:
theFinalChainDef = theListOfChainDefs[0]
log.debug("----------------- Beginning of final merged chainDefs for b-jet chains printout -----------------")
log.debug(str(theFinalChainDef))
log.debug('%s',theFinalChainDef)
log.debug("----------------- End of final merged chainDefs for b-jet chains printout -----------------")
return theFinalChainDef
......@@ -114,11 +141,6 @@ def generateChainDefs(chainDict):
def buildBjetChains(jchaindef,bjetdict,doAtL2AndEF=True,numberOfSubChainDicts=1):
inputTEsEF = jchaindef.signatureList[-1]['listOfTriggerElements'][0]
L2ChainName = "L2_" + bjetdict['chainName']
EFChainName = "EF_bjet_" + bjetdict['chainName']
HLTChainName = "HLT_" + bjetdict['chainName']
topoAlgs = bjetdict["topo"]
bjetparts = bjetdict['chainParts']
if ('split' in bjetparts['bConfig']):
......@@ -136,18 +158,13 @@ def buildBjetChains(jchaindef,bjetdict,doAtL2AndEF=True,numberOfSubChainDicts=1)
def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=1):
L2ChainName = "L2_" + chainDict['chainName']
EFChainName = "EF_bjet_" + chainDict['chainName']
HLTChainName = "HLT_" + chainDict['chainName']
chainParts = chainDict['chainParts']
btagthresh = chainParts['threshold']
btagmult = chainParts['multiplicity']
btagcut = chainParts['bTag']
btagcut = btagcut[1:]
btracking = chainParts['bTracking']
bmatching = chainParts['bMatching']
ftk=""
if 'FTKVtx' in chainParts['bTracking'] or 'FTK' in chainParts['bTracking'] or 'FTKRefit' in chainParts['bTracking']:
......@@ -163,13 +180,11 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
#--------------------
# super ROI building
from TrigBjetHypo.TrigSuperRoiBuilderAllTEConfig import getSuperRoiBuilderAllTEInstance
theSuperRoi=getSuperRoiBuilderAllTEInstance()
#--------------------
# jet splitting
from TrigBjetHypo.TrigJetSplitterAllTEConfig import getJetSplitterAllTEInstance, getJetSplitterFTKAllTEInstance
theJetSplit=getJetSplitterAllTEInstance()
theJetSplitFTK=getJetSplitterFTKAllTEInstance()
......@@ -183,9 +198,8 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
for anti_match_part in chainParts['bMatching']:
if 'dr' in anti_match_part:
deltaR=anti_match_part.split('dr')[1][0:2]
if deltaR == -1: logCombined.error("No DeltaR cut could be extracted!")
if deltaR == -1: log.error("No DeltaR cut could be extracted!")
from TrigBjetHypo.TrigFarawayJetFinderAllTEConfig import getFarawayJetFinderAllTEInstance
theFarawayJet=getFarawayJetFinderAllTEInstance(str(deltaR))
algoInstance = "MuJetChain"
......@@ -193,7 +207,6 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
#--------------------
# Et hypo (for b-tagging)
from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
theBjetEtHypo = getBjetEtHypoInstance(algoInstance, "Btagging", btagthresh+"GeV" )
#--------------------
......@@ -203,21 +216,16 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
# [trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() # new
if 'FTKVtx' in chainParts['bTracking']:
from TrigInDetConf.TrigInDetSequence import TrigInDetSequence # new
[trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig").getSequence() # new
from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence # new
[ftkvtx, trkftk] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx"]).getSequence() # new
ftkvtx[0].getVertexContainer=True
elif 'FTKRefit' in chainParts['bTracking']:
from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence # new
[ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","refit","PT"]).getSequence() # new
ftkvtx[0].getVertexContainer=True
elif 'FTK' in chainParts['bTracking']:
from TrigInDetConf.TrigInDetFTKSequence import TrigInDetFTKSequence # new
[ftkvtx, trkftf, trkprec] = TrigInDetFTKSequence("Bjet", "bjet", sequenceFlavour=["FTKVtx","PT"]).getSequence() # new
ftkvtx[0].getVertexContainer=True
else:
from TrigInDetConf.TrigInDetSequence import TrigInDetSequence # new
[trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence() # new
# for b-tagging
......@@ -228,8 +236,6 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
#--------------------
# primary vertexing
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxAllTEConfig import EFHistoPrmVtxAllTE_Jet
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxComboConfig import EFHistoPrmVtxCombo_Jet
# JK FTK vertex
# from TrigFTK_RecAlgs.TrigFTK_RecAlgs_Config import TrigFTK_VxPrimary_EF
# from InDetTrigRecExample.InDetTrigConfigRecPostProcessing import *
......@@ -237,7 +243,6 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
#--------------------
# secondary vertexing
from InDetTrigVxSecondary.InDetTrigVxSecondary_LoadTools import TrigVxSecondaryCombo_EF
theVxSecondary = TrigVxSecondaryCombo_EF()
theVxSecondaryFTK = TrigVxSecondaryCombo_EF("TrigVxSecondaryComboFTK_EF")
theVxSecondaryFTK.PriVtxKey="HLT_PrimVertexFTK"
......@@ -256,30 +261,22 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
if ('boffperf' in chainParts['bTag'] or 'bmv2c20' in chainParts['bTag']):
# Offline taggers
if('FTKRefit' in chainParts['bTracking']):
from TrigBjetHypo.TrigBtagFexConfig import getBtagFexFTKRefitInstance
theBjetFex = getBtagFexFTKRefitInstance(algoInstance,"2012","EFID")
elif('FTKVtx' in chainParts['bTracking']):
from TrigBjetHypo.TrigBtagFexConfig import getBtagFexFTKVtxInstance
theBjetFex = getBtagFexFTKVtxInstance(algoInstance,"2012","EFID")
elif ('FTK' in chainParts['bTracking']):
from TrigBjetHypo.TrigBtagFexConfig import getBtagFexFTKInstance
theBjetFex = getBtagFexFTKInstance(algoInstance,"2012","EFID")
else:
from TrigBjetHypo.TrigBtagFexConfig import getBtagFexSplitInstance
theBjetFex = getBtagFexSplitInstance(algoInstance,"2012","EFID")
else:
# Run 1 style taggers
if('FTKRefit' in chainParts['bTracking']):
from TrigBjetHypo.TrigBjetFexConfig import getBjetFexFTKRefitInstance
theBjetFex = getBjetFexFTKRefitInstance(algoInstance,"2012","EFID")
elif ('FTKVtx' in chainParts['bTracking'] ):
from TrigBjetHypo.TrigBjetFexConfig import getBjetFexFTKVtxInstance
theBjetFex = getBjetFexFTKVtxInstance(algoInstance,"2012","EFID")
elif ('FTK' in chainParts['bTracking'] ):
from TrigBjetHypo.TrigBjetFexConfig import getBjetFexFTKInstance
theBjetFex = getBjetFexFTKInstance(algoInstance,"2012","EFID")
else:
from TrigBjetHypo.TrigBjetFexConfig import getBjetFexSplitInstance
theBjetFex = getBjetFexSplitInstance(algoInstance,"2012","EFID")
......@@ -289,15 +286,12 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
if ('bperf' in chainParts['bTag'] or 'boffperf' in chainParts['bTag']):
# Performance chains (run 1 and run 2 style)
# Runs in NoCut mode
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoSplitNoCutInstance
theBtagReq = getBjetHypoSplitNoCutInstance(algoInstance)
elif ('bmv2c20' in chainParts['bTag']):
# MV2c20 tagger series
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoSplitInstance
theBtagReq = getBjetHypoSplitInstance(algoInstance,"2015", btagcut)
else:
# Run 1 style chains
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoSplitInstance
theBtagReq = getBjetHypoSplitInstance(algoInstance,"2012", btagcut)
#-----------------------------------------------------------------------------------
......@@ -397,57 +391,42 @@ def myBjetConfig_split(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=
###################################################################################
def myBjetConfig1(theChainDef, chainDict, inputTEsEF,numberOfSubChainDicts=1):
L2ChainName = "L2_" + chainDict['chainName']
EFChainName = "EF_bjet_" + chainDict['chainName']
HLTChainName = "HLT_" + chainDict['chainName']
chainParts = chainDict['chainParts']
btagthresh = chainParts['threshold']
btagmult = chainParts['multiplicity']
btagcut = chainParts['bTag']
btagcut = btagcut[1:]
btracking = chainParts['bTracking']
#import fexes/hypos
from TrigBjetHypo.TrigEFBjetSequenceAllTEConfig import getEFBjetAllTEInstance
ef_bjetSequence=getEFBjetAllTEInstance()
from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
if ( int(btagthresh) == 0) : ef_ethypo_startseq = getBjetEtHypoInstance("EF","StartSequence","0GeV")
elif ( int(btagthresh) < 35) : ef_ethypo_startseq = getBjetEtHypoInstance("EF","StartSequence","15GeV")
else : ef_ethypo_startseq = getBjetEtHypoInstance("EF","StartSequence","35GeV")
# tracking
from TrigInDetConf.TrigInDetSequence import TrigInDetSequence # new
[trkvtx, trkftf, trkprec] = TrigInDetSequence("Bjet", "bjet", "IDTrig", "2step").getSequence()
ef_bjet_tracks = trkftf+trkprec
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxAllTEConfig import EFHistoPrmVtxAllTE_Jet
from TrigT2HistoPrmVtx.TrigT2HistoPrmVtxComboConfig import EFHistoPrmVtxCombo_Jet
from InDetTrigVxSecondary.InDetTrigVxSecondary_LoadTools import TrigVxSecondary_EF
ef_VxSecondary_EF = TrigVxSecondary_EF()
from TrigBjetHypo.TrigBjetEtHypoConfig import getBjetEtHypoInstance
ef_EtHypo_Btagging = getBjetEtHypoInstance("EF","Btagging", btagthresh+"GeV")
# B-tagging
if ('boffperf' in chainParts['bTag'] or 'bmv2c20' in chainParts['bTag']):
from TrigBjetHypo.TrigBtagFexConfig import getBtagFexInstance
ef_bjet = getBtagFexInstance("EF","2012","EFID")
else:
from TrigBjetHypo.TrigBjetFexConfig import getBjetFexInstance
ef_bjet = getBjetFexInstance("EF","2012","EFID")
# Hypo testing
if ('bperf' in chainParts['bTag'] or 'boffperf' in chainParts['bTag']):
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoNoCutInstance
ef_hypo = getBjetHypoNoCutInstance("EF")
elif ('bmv2c20' in chainParts['bTag']):
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoInstance
ef_hypo = getBjetHypoInstance("EF","2015", btagcut)
else:
from TrigBjetHypo.TrigBjetHypoConfig import getBjetHypoInstance
ef_hypo = getBjetHypoInstance("EF","2012", btagcut)
#------- 2012 EF Sequences based on j35 intput TE-------
......@@ -504,7 +483,6 @@ def _prepareJetChainDict(cdict):
# -- collecting thresholds in a list to check if there are duplicates --
thresholds = [part['threshold'] for part in cdict['chainParts']]
from collections import Counter
counts = Counter(thresholds)
duplicates = [val for val, count in counts.items() if count > 1]
......@@ -548,7 +526,7 @@ def _prepareJetChainDict(cdict):
jpart['chainPartName'] = jpart['multiplicity']+jpart['trigType']+jpart['threshold']
mergedbjetpart.append(bjindex)
else:
log.info("Jet and underlying jet chain from bjet are not the same despite the same thresholds. Ignore and keep separate dictionaries. The difference is %s " % str(diff))
log.info("Jet and underlying jet chain from bjet are not the same despite the same thresholds. Ignore and keep separate dictionaries. The difference is %s ", diff)
continue
......@@ -567,9 +545,9 @@ def _prepareJetChainDict(cdict):
else:
log.info('No duplicated thresholds in the jet/b-jet chain')
log.debug('No duplicated thresholds in the jet/b-jet chain')
log.debug("Prepared b-jet chainDict: \n %s" % (pp.pformat(cdict)))
if log.isEnabledFor(logging.DEBUG): log.debug("Prepared b-jet chainDict: \n %s" , pp.pformat(cdict))
return cdict
......
......@@ -2,8 +2,7 @@
""" Bphysics slice specific flags """
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties
from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList
from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer
__author__ = 'T. Bold'
__version__="$Revision: 1.30 $"
......
......@@ -8,25 +8,22 @@ __doc__="Definition of bphysics chains"
from AthenaCommon.Logging import logging
logging.getLogger().info("Importing %s",__name__)
logBphysDef = logging.getLogger("TriggerMenu.bphysics.BphysicsDef")
log = logging.getLogger(__name__)
from TriggerMenu.menu.MenuUtils import setupTopoStartFrom
from TrigInDetConf.TrigInDetSequence import TrigInDetSequence
from TriggerMenu.menu.MenuUtils import *
###########################################################################
###########################################################################
def generateChainDefs(chainDict):
chainParts = chainDict['chainParts']
listOfChainDicts = splitChainDict(chainDict)
listOfChainDefs = []
from TriggerMenu.muon.generateMuonChainDefs import generateChainDefs as genMuonChainDefs
theChainDef = genMuonChainDefs(chainDict)