Skip to content
Snippets Groups Projects
Commit 4deb3083 authored by Sara Alderweireldt's avatar Sara Alderweireldt
Browse files

Merge branch '21.1_api' into '21.1'

Updates to TriggerAPI

See merge request atlas/athena!14587

Former-commit-id: f387e538905cd4a0a0502c8b2ae81361b5828365
parents 69cce240 06278f0c
No related branches found
No related tags found
60 merge requests!46457Draft: Adding the tools to run over data,!46454Draft: Adding the tools to be able to run over data,!45045WIP: Include another condition for hit merging in FCS_StepInfoSD.cxx,!45043Merge branch 'Update-DAOD_IDNCB' into '21.2',!44869Draft: Update to candidate store,!4217921.9-first_steps-InDetTrackingGeometryXML,!42171Add LAr cell DQ plots to UPC stream,!40342WIP: ATR-22546 - add missing trigger to MC16a,!39162Draft: Insert BCM' support,!38765Bis78 cabling,!37483Fix in monitoring of Pixel FE errors,!36893Fix size of RPC active region in BIS78 and strip material,!3645821.9: Improving material map description (ATLITKSW-127),!36293WIP pixel updates,!34993KF-input adding jXERHO to the AOD outputs,!34864LH rings in front ot HR rigs,!34763Fix L1_4jJ15.0ETA25 item definition (ATR-21261),!3473421.0 fix dq servers,!33996WIP: Correct MM zpositions,!3291021.3 salva s0,!3288421.0 salva s8,!3217421.9 - Bug fix for test stream creation in RD53BEncodingTool,!3135321.3,!3134821.9 README Update,!31345Add HEC sampling fractions macros,!31136added also PUsub for LargeR jets,!31123WIP: Master ttmdev,!3036121.9 fixing bug with layer indices in PixelRDOAnalysis,!29617IDPerfmonZmumu updates,!29454Idpvm 21.0 fix typo in trackselection config,!29085TRT modification for fractional charged particles,!28623Overlay as part of FastChain transform in 21.3,!28497ART tests - fixing the bugs,!27668Massimos 21.3 bis78,!27254WIP: Exclusive jets request -- Fix ExclusiveJets algo / ATR-17320,!26790Fixes for Simulation ART jobs (ATLASSIM-4309),!26747Update frozen shower generation scripts and code to be compatible with recent developments,!26592Master upload 2018 global monitoring scripts p2,!2618221.0 z counting,!25405Add new ART test: test_physics_pp_v8_chainorder_build.sh,!2420321.3 l1 muon 00 - new MuCTPI_RDO.h,!24037Make DCS Calculator dependent on sqlalchemy; fix python code quality issues,!23377WIP pixel ID scheme for ITk,!23330Inner Detector create misalignments: radial distortions,!2325521.0 z counting,!22695Master salva id perf mon,!2230421.0-ART_test-InDetPhysValMonitoring,!22214add an utility function to TrigT1TGCRecRoiSvc for storing ROI position and the eta/phi size,!22172changes related to 1-3 points in ATR-19579,!22124Changes related to ticket 19579,!22118Remove cabling information for new thresholds,!21684WIP: test push into tdaq-htt,!2153821.0-ART_test-InDetPhysValMonitoring,!21325Tilecal new laser unpack 2019 02 19,!21304WIP: Fix ATR-19377 L1Topo vbs alg,!2117721.3 po bugfixes,!21039Merging in features for HTT Bank Generation,!20518Mydev,!20442Merge tag 21.0.91-21.0.92 into 21.9,!20388Merge tag 21.0.91-21.0.92 into 21.9
......@@ -54,11 +54,6 @@ function( atlas_run_lowestunprescaled )
${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled
COMMAND ${CMAKE_BINARY_DIR}/atlas_build_run.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/generateUnprescaledLists.py ${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_PYTHON_OUTPUT_DIRECTORY}/TriggerMenu
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_BINARY_DIR}/LowestUnprescaledLists/unprescaled/
${CMAKE_PYTHON_OUTPUT_DIRECTORY}/TriggerMenu/api/
COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_CURRENT_BINARY_DIR}/unprescaled.stamp
DEPENDS "Package_$<JOIN:$<TARGET_PROPERTY:ATLAS_PACKAGES_TARGET,ATLAS_PACKAGES>,;Package_>" )
......
......@@ -17,6 +17,7 @@ class TriggerAPI:
dbQueries = {}
privatedbQueries = {}
customGRL = None
release = None
log = logging.getLogger( 'TriggerMenu.api.TriggerAPI.py' )
@classmethod
......@@ -41,6 +42,14 @@ class TriggerAPI:
except IOError:
pass
@classmethod
def setRelease(cls, release):
import re
if release and re.match('21\.1(\.[0-9]+)+$',release):
cls.release = release
else:
cls.log.warning("Release doesn't seem to be a well-formed 21.1 release, ignoring: "+release)
@classmethod
def setCustomGRL(cls, grl):
if TriggerInfo.testCustomGRL(grl):
......@@ -145,7 +154,7 @@ class TriggerAPI:
if not period & TriggerPeriod.future: cls.init()
if (period,cls.customGRL) not in cls.dbQueries:
if TriggerPeriod.isRunNumber(period) or (isinstance(period,TriggerPeriod) and period.isBasePeriod()):
cls.dbQueries[(period,cls.customGRL)] = TriggerInfo(period,cls.customGRL)
cls.dbQueries[(period,cls.customGRL)] = TriggerInfo(period,cls.customGRL,cls.release)
cls.privatedbQueries[(period,cls.customGRL)] = cls.dbQueries[(period,cls.customGRL)]
if not period & TriggerPeriod.future or TriggerPeriod.isRunNumber(period):
#Don't pickle TM information since it can change, very cheap to retrieve anyway
......
......@@ -289,12 +289,20 @@ def getHLTmap_fromDB(period, customGRL):
return hltMap, lbCount
def getHLTmap_fromTM(period):
def getHLTmap_fromTM(period, release):
''' Return a map of HLT chain: (L1 seed, active LBs, is-rerun) for a given period
Only "Future" periods make sense here
The format is the same as for TriggerDBAccess for compatibility but rerun is always false
'''
from TriggerMenu.menu import Physics_pp_v7
from os import getenv
asetupversion = getenv('AtlasVersion','')
forceRel21 = not (asetupversion.startswith("21.1") or asetupversion.startswith("22."))
if forceRel21 or release:
sys.path.insert(0, getMenuPathFromRelease(release))
import Physics_pp_v7
else:
from TriggerMenu.menu import Physics_pp_v7
from TriggerJobOpts.TriggerFlags import TriggerFlags
Physics_pp_v7.setupMenu()
......@@ -322,7 +330,14 @@ def getHLTmap_fromTM(period):
return hltMap, dummyfutureLBs
def getHLTlist(period, customGRL):
def getMenuPathFromRelease(release):
if release: #already format-proofed in TriggerAPI
return "/cvmfs/atlas.cern.ch/repo/sw/software/21.1/AthenaP1/%s/InstallArea/x86_64-slc6-gcc62-opt/python/TriggerMenu/menu"%release
#21.1.43 contains the final menu, no need to find the last release
return "/cvmfs/atlas.cern.ch/repo/sw/software/21.1/AthenaP1/21.1.43/InstallArea/x86_64-slc6-gcc62-opt/python/TriggerMenu/menu"
def getHLTlist(period, customGRL, release):
''' For a given period it returns: [HLT chain, L1 seed, average livefraction, active LB, is-rerun], total LB
The average livefraction is an approximation weighting the PS by number of lumiblocks.
*** Don't use this number in analysis!!! ***
......@@ -331,7 +346,7 @@ def getHLTlist(period, customGRL):
if not period & TriggerPeriod.future or TriggerPeriod.isRunNumber(period):
hltmap, totalLB = getHLTmap_fromDB(period, customGRL)
else:
hltmap, totalLB = getHLTmap_fromTM(period)
hltmap, totalLB = getHLTmap_fromTM(period, release)
hltlist = cleanHLTmap(hltmap, totalLB)
return (hltlist, totalLB)
......
......@@ -10,14 +10,14 @@ class TriggerInfo:
''' Object containing all the HLT information related to a given period.
Stores a list of TriggerChain objects and the functions to skim them
'''
def __init__(self,period=0, customGRL=None):
def __init__(self,period=0, customGRL=None, release=None):
self.triggerChains = []
self.period = period
self.totalLB = 0
if not period: return
from TriggerDataAccess import getHLTlist
HLTlist, totalLB = getHLTlist(period, customGRL)
HLTlist, totalLB = getHLTlist(period, customGRL, release)
self.totalLB = totalLB
for hlt, l1, livefraction, activeLB, hasRerun in HLTlist:
self.triggerChains.append( TriggerChain(hlt, l1, livefraction, activeLB, hasRerun))
......@@ -95,8 +95,8 @@ class TriggerInfo:
class TriggerLeg:
types = ('e','j','mu','tau','xe','g','ht')
legpattern = re.compile('([0-9]*)(%s)([0-9]+)' % '|'.join(types))
detailpattern = re.compile('(?:-?\d+)|(?:[^0-9|-]+)')
bjetpattern = re.compile('bmv|btight|bmedium|bloose')
detailpattern = re.compile('(?:-?\d+)|(?:[^0-9 -]+)') #split into text-only vs number-only
bjetpattern = re.compile('bmv|bhmv|btight|bmedium|bloose')
bphyspattern = re.compile('b[A-Z]')
exoticspattern = re.compile('llp|LLP|muvtx|hiptrt|LATE|NOMATCH')
afppattern = re.compile('afp|AFP')
......@@ -224,7 +224,7 @@ class TriggerLeg:
return 1
return -9
compl1seed = self.compareTags(self.l1seed, other.l1seed, stringSubset=True, debug=debug)
compdetails = self.compareTags("".join(self.details), "".join(other.details), debug=debug )
compdetails = self.compareTags(" ".join(self.details), " ".join(other.details), debug=debug )
if self.l1seed == other.l1seed:
if self.details == other.details: return -1
if debug: print "compareTags 1:",compdetails
......
......@@ -3117,11 +3117,11 @@ def setupMenu():
['e25_mergedtight_g35_medium_icalovloose_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e25_mergedtight_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e25_mergedtight_ivarloose_g35_medium_icalovloose_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e25_mergedtight_ivarloose_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e25_mergedtight_ivarloose_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e30_mergedtight_g35_medium_icalovloose_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e30_mergedtight_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e30_mergedtight_ivarloose_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
['e30_mergedtight_ivarloose_g35_medium_icalotight_Heg', 'L1_2EM20VH', [], [PhysicsStream], ['Primary:20000','RATE:ElectronPhoton', 'BW:Egamma'], -1,['parallel',-1,[] ]],
# new chain for 2e34 backup (ATR-15225)
['e24_lhmedium_nod0_ivarloose_tau35_medium1_tracktwo', 'L1_EM20VHI_TAU20IM_2TAU20_J25_3J20',['L1_EM20VHI','L1_TAU20IM'], [PhysicsStream], ['Primary:20000','RATE:ElectronTau', 'BW:Tau', 'BW:Egamma'], -1,['serial',-1,["e24_lhmedium_nod0_ivarloose","tau35_medium1_tracktwo"]]],
......
......@@ -19,7 +19,7 @@ def main(outfolder):
outfile.write( to_nice_list( TriggerAPI.getUnprescaled(TriggerPeriod.future2e34, triggerType), triggerType.name ) )
def to_nice_list( alist, name ):
thestr = "list_%s = [\n"%name
thestr = "%s = [\n"%name
for i in alist:
thestr += "\t'%s',\n"%i
thestr += "]\n\n"
......
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