ATLAS Offline Software
Functions | Variables
HLTMonitoringJSON Namespace Reference

Functions

def __getMenuBaseName (menuName)
 
def generateDefaultMonitoringJSON (flags, chainDicts)
 
def generateMonitoringJSON (menuName, chainDicts, fileName)
 

Variables

 __log
 

Function Documentation

◆ __getMenuBaseName()

def HLTMonitoringJSON.__getMenuBaseName (   menuName)
private

Definition at line 11 of file HLTMonitoringJSON.py.

11 def __getMenuBaseName(menuName):
12  pattern = re.compile(r'_v\d+|DC14')
13  patternPos = pattern.search(menuName)
14  if patternPos:
15  menuName=menuName[:patternPos.end()]
16  else:
17  __log.info('Can\'t find pattern to shorten menu name, either non-existent in name or not implemented.')
18  return menuName
19 
20 

◆ generateDefaultMonitoringJSON()

def HLTMonitoringJSON.generateDefaultMonitoringJSON (   flags,
  chainDicts 
)

Definition at line 21 of file HLTMonitoringJSON.py.

21 def generateDefaultMonitoringJSON(flags, chainDicts):
22  return generateMonitoringJSON(flags.Trigger.triggerMenuSetup,
23  chainDicts,
25 
26 

◆ generateMonitoringJSON()

def HLTMonitoringJSON.generateMonitoringJSON (   menuName,
  chainDicts,
  fileName 
)

Definition at line 27 of file HLTMonitoringJSON.py.

27 def generateMonitoringJSON(menuName, chainDicts, fileName):
28 
29  #create a summary file
30  summaryDict = {
31  "filetype": "hltmonitoringsummary",
32  "name": __getMenuBaseName(menuName),
33  "signatures": {}
34  }
35 
36  # then you can iterate, say over the HLT menu:
37  for chain in chainDicts:
38  chain_name = chain['chainName']
39  __log.debug("[HLTMonitoring::generateMonitoringJSON] Processing Chain %s ...", chain_name)
40 
41  #if the chain is in a express stream, check presence of teh monGroup
42  if 'express' in chain['stream']:
43  if len(chain['monGroups']) == 0:
44  __log.warning( "[HLTMonitoring::generateMonitoringJSON]Chain %s is in the express stream and doesn't have any monGroup", chain_name)
45 
46  #check if the chain needs to be monitored
47  if len(chain['monGroups']) == 0:
48  continue
49 
50  __log.debug("[HLTMonitoring::generateMonitoringJSON] Chain %s has monitoring groups!", chain_name)
51 
52  #add the signatures in the summary file
53  for entry in chain['monGroups']:
54  monSignature = entry.split(':')[0]
55  monGroup = entry.split(':')[1]
56 
57  if monSignature not in summaryDict['signatures']:
58  summaryDict['signatures'][monSignature] = {chain_name: [monGroup]}
59  else:
60  #the signature is already present,
61  # now check the chain
62  if chain_name not in summaryDict['signatures'][monSignature]:
63  summaryDict['signatures'][monSignature].update({chain_name: [monGroup]})
64  else:
65  summaryDict['signatures'][monSignature][chain_name].append(monGroup)
66 
67  # # then writing the summary to a file is as simple as:
68  __log.info( "Writing Summary of HLT Monitoring JSON to %s", fileName)
69  with open(fileName, 'w') as outfile:
70  json.dump(summaryDict, outfile, indent = 4, sort_keys=False )

Variable Documentation

◆ __log

HLTMonitoringJSON.__log
private

Definition at line 7 of file HLTMonitoringJSON.py.

dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
HLTMonitoringJSON.generateMonitoringJSON
def generateMonitoringJSON(menuName, chainDicts, fileName)
Definition: HLTMonitoringJSON.py:27
python.TrigConfigSvcCfg.getHLTMonitoringFileName
def getHLTMonitoringFileName(flags)
Definition: TrigConfigSvcCfg.py:144
HLTMonitoringJSON.__getMenuBaseName
def __getMenuBaseName(menuName)
Definition: HLTMonitoringJSON.py:11
Trk::open
@ open
Definition: BinningType.h:40
HLTMonitoringJSON.generateDefaultMonitoringJSON
def generateDefaultMonitoringJSON(flags, chainDicts)
Definition: HLTMonitoringJSON.py:21
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67