ATLAS Offline Software
Functions
L1TopoOnlineMonitoringConfig Namespace Reference

Functions

def getL1TopoOnlineMonitorHypo (flags)
 
def L1TopoOnlineMonitorHypoToolGen (chainDict)
 
def getL1TopoLabels (flags, connectors={0:'LegacyTopo0', 1:'LegacyTopo1'}, bmax=128)
 
def getMultiplicityLabels (flags, topoModule)
 
def getL1TopoPhase1OnlineMonitor (flags, name='L1TopoOnlineMonitor', doSimMon=True, doHwMonCtp=False, doHwMon=False, doComp=False, doMultComp=False, forceCtp=False, logLevel=None, toolName="L1TopoMonitoringTool")
 
def configureHistograms (alg, flags, doHwMonCtp, doHwMon, doComp, doMultComp)
 

Function Documentation

◆ configureHistograms()

def L1TopoOnlineMonitoringConfig.configureHistograms (   alg,
  flags,
  doHwMonCtp,
  doHwMon,
  doComp,
  doMultComp 
)

Definition at line 78 of file L1TopoOnlineMonitoringConfig.py.

78 def configureHistograms(alg, flags, doHwMonCtp, doHwMon, doComp, doMultComp):
79 
80  label_topo_all = []
81  for cable in range(2):
82  name = 'CableElec_'+str(cable+2)
83  name += ';Topo'+str(cable+2)+'El'
84  title = f'Topo Electric Cable {cable+2}'
85  labels = getL1TopoLabels(flags,{0: f'Topo{cable+2}El'},64)
86  label_topo_all += labels
87  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH1I',
88  title=title, xbins=64, xlabels=labels,
89  xmin=0, xmax=64)
90 
91  for cable in range(4):
92  topoName = 'Topo1Opt'+str(cable)
93  name = 'CableOpti_'+str(cable)
94  weight = name+'_weight'
95  name += f';{topoName}'
96  title = f'Topo Optical Cable {cable}'
97  labels = getMultiplicityLabels(flags=flags,topoModule=topoName)
98  xlabels = [x for x in labels if x]
99  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH1I',
100  title=title, xbins=len(xlabels), xlabels=xlabels,
101  weight=weight,
102  xmin=0, xmax=len(xlabels))
103  for cable in range(4):
104  topoName = 'Topo1Opt'+str(cable)
105  name = 'HdwTopo1Opt'+str(cable)
106  weight = name+'_weight'
107  name += f';{topoName}_data'
108  title = f'Topo Optical Cable {cable} (Data)'
109  labels = getMultiplicityLabels(flags=flags,topoModule=topoName)
110  xlabels = [x for x in labels if x]
111  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH1I',
112  title=title, xbins=len(xlabels), xlabels=xlabels,
113  weight=weight,
114  xmin=0, xmax=len(xlabels))
115 
116  for cable in range(4):
117  ylabels = ['#splitline{Sim counts <}{Hdw counts}','#splitline{Sim counts >}{Hdw counts}','#splitline{Sim counts =}{Hdw counts}']
118  topoName = 'Topo1Opt'+str(cable)
119  name = 'MultiplicityTopo1Opt'+str(cable)+',MultiplicityMatchTopo1Opt'+str(cable)
120  name += f';{topoName}_mismatch'
121  title = f'Topo Optical Cable {cable} Miss/Matches Summary'
122  labels = getMultiplicityLabels(flags=flags,topoModule=topoName)
123  xlabels = [x for x in labels if x]
124  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH2F',
125  title=title, xbins=len(xlabels), ybins=3,
126  xlabels=xlabels,ylabels=ylabels,
127  xmin=0, xmax=len(xlabels),
128  ymin=0, ymax=len(ylabels))
129 
130  for cable in range(4):
131  topoName = 'Topo1Opt'+str(cable)
132  labels = getMultiplicityLabels(flags=flags,topoModule=topoName)
133  labels = [x for x in labels if x]
134  for i,label in enumerate(labels):
135  name = f'Topo1Opt{cable}_{i}_Sim,Topo1Opt{cable}_{i}_Hdw;Topo1Opt{cable}_{label}'
136  title = f'Topo1Opt{cable}_{label};Simulation Counts;Hardware Counts'
137  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH2F',
138  title=title,xbins=10,ybins=10,
139  xmin=0, xmax=10,
140  ymin=0, ymax=10)
141 
142  alg.MonTool.defineHistogram('TopoSim', path='EXPERT', type='TH1I',
143  title='Simulation Results for L1Topo', xbins=128, xlabels=label_topo_all,
144  xmin=0, xmax=128)
145  alg.MonTool.defineHistogram('TopoSim_overflows', path='EXPERT', type='TH1I',
146  title='Overflow Simulation Results for L1Topo', xbins=128, xlabels=label_topo_all,
147  xmin=0, xmax=128)
148  alg.MonTool.defineHistogram('TopoSim_ambiguity', path='EXPERT', type='TH1I',
149  title='Ambiguity Results for L1Topo', xbins=128, xlabels=label_topo_all,
150  xmin=0, xmax=128)
151 
152  if doHwMonCtp:
153  alg.MonTool.defineHistogram('TopoCTP', path='EXPERT', type='TH1I',
154  title='CTP Results for L1Topo', xbins=128, xlabels=label_topo_all,
155  xmin=0, xmax=128)
156 
157  if doComp:
158  alg.MonTool.defineHistogram('SimNotHdwL1TopoResult', path='EXPERT', type='TH1I',
159  title='L1Topo events with simulation accept and hardware fail',
160  xbins=128, xlabels=label_topo_all,
161  xmin=0, xmax=128)
162  alg.MonTool.defineHistogram('HdwNotSimL1TopoResult', path='EXPERT', type='TH1I',
163  title='L1Topo events with hardware accept and simulation fail',
164  xbins=128, xlabels=label_topo_all,
165  xmin=0, xmax=128)
166  alg.MonTool.defineHistogram('Ambiguity_SimANDHdwDecisions', path='EXPERT', type='TH1I',
167  title='L1Topo ambiguity events with simulation accept and hardware accept',
168  xbins=128, xlabels=label_topo_all,
169  xmin=0, xmax=128)
170  alg.MonTool.defineHistogram('Ambiguity_DecisionMismatches', path='EXPERT', type='TH1I',
171  title='L1Topo ambiguity events with mismatches between simulation and hardware',
172  xbins=128, xlabels=label_topo_all,
173  xmin=0, xmax=128)
174 
175  if doMultComp:
176  ylabels = ['#frac{HdwNotSim}{Hdw}','#frac{SimNotHdw}{Sim}','#frac{HdwAndSim}{HdwOrSim}','#frac{Hdw}{Sim}']
177  for topo in [(0,'2a'),(1,'2b'),(2,'3a'),(3,'3b')]:
178  name = f'Phase1TopoTrigger_{topo[0]},Phase1TopoMissMatch_{topo[0]};Ph1Topo{topo[1]}'
179  title = f'Phase1 Topo{topo[1]} Miss/Matches Summary'
180  alg.MonTool.defineHistogram(name, path='EXPERT', type='TH2F',
181  title=title,xbins=32,ybins=4,
182  weight=f'Phase1TopoWeight_{topo[0]}',
183  xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
184  ylabels=ylabels,
185  xmin=0, xmax=32,
186  ymin=0, ymax=len(ylabels))
187  ylabelsOF = ['#frac{HdwOFnotSimOF}{HdwOF}','#frac{SimOFnotHdwOF}{SimOF}','#frac{HdwOFandSimOF}{HdwOForSimOF}','#frac{HdwOF}{SimOF}']
188  for topo in [(0,'2a'),(1,'2b'),(2,'3a'),(3,'3b')]:
189  name_OF = f'Phase1TopoTrigger_{topo[0]},Phase1TopoMissMatch_{topo[0]};Ph1Topo{topo[1]}_overflows'
190  title_OF = f'Phase1 Topo{topo[1]} Overflow Miss/Matches Summary'
191  alg.MonTool.defineHistogram(name_OF, path='EXPERT', type='TH2F',
192  title=title_OF,xbins=32,ybins=4,
193  weight=f'Phase1TopoOFWeight_{topo[0]}',
194  xlabels=label_topo_all[topo[0]*32:(topo[0]+1)*32],
195  ylabels=ylabelsOF,
196  xmin=0, xmax=32,
197  ymin=0, ymax=len(ylabelsOF))
198 
199  if doHwMon:
200  alg.MonTool.defineHistogram('HdwResults', path='EXPERT', type='TH1I',
201  title='Hardware Results for L1Topo', xbins=128, xlabels=label_topo_all,
202  xmin=0, xmax=128)
203  alg.MonTool.defineHistogram('OverflowResults', path='EXPERT', type='TH1I',
204  title='Overflow Results for L1Topo', xbins=128, xlabels=label_topo_all,
205  xmin=0, xmax=128)
206  rod_errors_labels = ["CT", "pc", "hc", "pe", "lm", "hm", "pt"]
207  alg.MonTool.defineHistogram('ROD_Errors', path='EXPERT', type='TH1I',
208  title='Counts of ROD errors', xbins=len(rod_errors_labels), xlabels=rod_errors_labels,
209  xmin=0, xmax=len(rod_errors_labels))
210  fpga_errors_labels = ["CT", "sm", "pe", "lm", "hm", "pt"]
211  fpga_indexes = ["topo1fpga1", "topo1fpga0", "topo2fpga1", "topo2fpga0", "topo3fpga1", "topo3fpga0"]
212  alg.MonTool.defineHistogram('FPGA_Errors, FPGA_Labels; FPGA_Errors', path='EXPERT', type='TH2I',
213  title='Counts of FPGA errors',xbins=len(fpga_errors_labels),ybins=len(fpga_indexes),
214  xlabels=fpga_errors_labels,
215  ylabels=fpga_indexes,
216  xmin=0, xmax=len(fpga_errors_labels),
217  ymin=0, ymax=len(fpga_indexes))
218 
219 
220  mon_failure_labels = ['doHwMon', 'doSimMon', 'doHwMonCTP', 'doComp', 'doMultComp']
221  alg.MonTool.defineHistogram('MonitoringFailures', path='EXPERT', type='TH1F',
222  title='Counts of mon functions returning failure;;Entries',
223  xlabels=mon_failure_labels, xbins=len(mon_failure_labels),
224  xmin=0, xmax=len(mon_failure_labels))

◆ getL1TopoLabels()

def L1TopoOnlineMonitoringConfig.getL1TopoLabels (   flags,
  connectors = {0: 'LegacyTopo0', 1: 'LegacyTopo1'},
  bmax = 128 
)

Definition at line 21 of file L1TopoOnlineMonitoringConfig.py.

21 def getL1TopoLabels(flags,connectors = {0: 'LegacyTopo0', 1: 'LegacyTopo1'}, bmax = 128):
22  topo_trigline_labels = ["" for i in range(bmax)]
23  lvl1access = getL1MenuAccess(flags)
24  for connector_id, connectorKey in connectors.items():
25  topo_triglines_dict = lvl1access.connector(connectorKey)['triggerlines']
26  if not isinstance(topo_triglines_dict, list):
27  for fpga_id in [0,1]:
28  topo_fpga = topo_triglines_dict['fpga{:d}'.format(fpga_id)]
29  for clock_id in [0,1]:
30  topo_clock = topo_fpga['clock{:d}'.format(clock_id)]
31  for topo_trigline in topo_clock:
32  topo_trigline_name = topo_trigline['name']
33  bit_id = topo_trigline['startbit']
34  topo_trigline_index = 64*connector_id + 32*fpga_id + 2*bit_id + clock_id
35  topo_trigline_labels[topo_trigline_index] = topo_trigline_name
36  else:
37  for topo_trigline in topo_triglines_dict:
38  topo_trigline_name = topo_trigline['name']
39  bit_id = topo_trigline['startbit']
40  fpga_id = topo_trigline['fpga']
41  clock_id = topo_trigline['clock']
42  topo_trigline_index = 64*connector_id + 32*fpga_id + 2*bit_id + clock_id
43  topo_trigline_labels[topo_trigline_index] = topo_trigline_name
44 
45  return topo_trigline_labels
46 

◆ getL1TopoOnlineMonitorHypo()

def L1TopoOnlineMonitoringConfig.getL1TopoOnlineMonitorHypo (   flags)

Definition at line 8 of file L1TopoOnlineMonitoringConfig.py.

9  hypo = CompFactory.L1TopoOnlineMonitorHypo()
10  return hypo
11 

◆ getL1TopoPhase1OnlineMonitor()

def L1TopoOnlineMonitoringConfig.getL1TopoPhase1OnlineMonitor (   flags,
  name = 'L1TopoOnlineMonitor',
  doSimMon = True,
  doHwMonCtp = False,
  doHwMon = False,
  doComp = False,
  doMultComp = False,
  forceCtp = False,
  logLevel = None,
  toolName = "L1TopoMonitoringTool" 
)

Definition at line 60 of file L1TopoOnlineMonitoringConfig.py.

60 def getL1TopoPhase1OnlineMonitor(flags, name='L1TopoOnlineMonitor', doSimMon=True, doHwMonCtp=False, doHwMon=False, doComp=False, doMultComp=False, forceCtp=False, logLevel = None, toolName="L1TopoMonitoringTool"):
61  # Placeholder for phase-1 implementation
62  #raise RuntimeError('L1Topo phase-1 online monitoring not yet implemented')
63  alg = CompFactory.L1TopoOnlineMonitor(toolName,
64  doHwMon = doHwMon,
65  doHwErrorMon = False,
66  doSimMon = doSimMon,
67  doHwMonCTP = doHwMonCtp,
68  doComp = doComp,
69  doMultComp = doMultComp,
70  forceCTPasHdw=forceCtp)
71  if logLevel : alg.OutputLevel=logLevel
72  alg.MonTool = GenericMonitoringTool(flags, 'MonTool')
73  alg.MonTool.HistPath = name
74  configureHistograms(alg, flags, doHwMonCtp, doHwMon, doComp, doMultComp)
75 
76  return alg
77 

◆ getMultiplicityLabels()

def L1TopoOnlineMonitoringConfig.getMultiplicityLabels (   flags,
  topoModule 
)

Definition at line 47 of file L1TopoOnlineMonitoringConfig.py.

47 def getMultiplicityLabels(flags,topoModule):
48  topo_trigline_labels = ["" for i in range(128)]
49  lvl1access = getL1MenuAccess(flags)
50  topo_triglines_dict = lvl1access.connector(topoModule)['triggerlines']
51 
52  for topo_trigline in topo_triglines_dict:
53  topo_trigline_name = topo_trigline['name']
54  bit_id = topo_trigline['startbit']
55  topo_trigline_labels[bit_id] = topo_trigline_name
56 
57  return topo_trigline_labels
58 
59 

◆ L1TopoOnlineMonitorHypoToolGen()

def L1TopoOnlineMonitoringConfig.L1TopoOnlineMonitorHypoToolGen (   chainDict)

Definition at line 12 of file L1TopoOnlineMonitoringConfig.py.

12 def L1TopoOnlineMonitorHypoToolGen(chainDict):
13  tool = CompFactory.L1TopoOnlineMonitorHypoTool(
14  chainDict['chainName'],
15  # Select error flags to accept events
16  ErrorFlagsKey = 'L1TopoErrorFlags',
17  AcceptTrivialFlag = True)
18 
19  return tool
20 
L1TopoOnlineMonitoringConfig.L1TopoOnlineMonitorHypoToolGen
def L1TopoOnlineMonitorHypoToolGen(chainDict)
Definition: L1TopoOnlineMonitoringConfig.py:12
vtune_athena.format
format
Definition: vtune_athena.py:14
L1TopoOnlineMonitoringConfig.getL1TopoLabels
def getL1TopoLabels(flags, connectors={0:'LegacyTopo0', 1:'LegacyTopo1'}, bmax=128)
Definition: L1TopoOnlineMonitoringConfig.py:21
GenericMonitoringTool
Definition: GenericMonitoringTool.h:53
python.TriggerConfigAccess.getL1MenuAccess
L1MenuAccess getL1MenuAccess(flags=None)
Definition: TriggerConfigAccess.py:129
L1TopoOnlineMonitoringConfig.getL1TopoOnlineMonitorHypo
def getL1TopoOnlineMonitorHypo(flags)
Definition: L1TopoOnlineMonitoringConfig.py:8
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
L1TopoOnlineMonitoringConfig.getMultiplicityLabels
def getMultiplicityLabels(flags, topoModule)
Definition: L1TopoOnlineMonitoringConfig.py:47
L1TopoOnlineMonitoringConfig.getL1TopoPhase1OnlineMonitor
def getL1TopoPhase1OnlineMonitor(flags, name='L1TopoOnlineMonitor', doSimMon=True, doHwMonCtp=False, doHwMon=False, doComp=False, doMultComp=False, forceCtp=False, logLevel=None, toolName="L1TopoMonitoringTool")
Definition: L1TopoOnlineMonitoringConfig.py:60
L1TopoOnlineMonitoringConfig.configureHistograms
def configureHistograms(alg, flags, doHwMonCtp, doHwMon, doComp, doMultComp)
Definition: L1TopoOnlineMonitoringConfig.py:78
str
Definition: BTagTrackIpAccessor.cxx:11