5 '''Function to configure LVL1 Efex simulation comparison algorithm in the monitoring system.'''
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
17 from LArBadChannelTool.LArBadChannelConfig
import LArMaskedSCCfg
21 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
22 helper = L1CaloMonitorCfgHelper(flags,CompFactory.EfexSimMonitorAlgorithm,
'EfexSimMonAlg')
25 if not flags.Trigger.L1.doCaloInputs: helper.alg.eFexTowerContainer=
""
27 helper.defineHistogram(
'EventType,Signature,tobMismatched;h_simSummary',title=
'Sim-HW Mismatches (percentage);Event Type;Signature',
28 fillGroup=
"mismatches",
29 path=
'Expert/Sim/detail',
30 hanConfig={
"display":
"SetPalette(87),Draw=COLZTEXT"},
32 xlabels=[
"DataTowers",
"EmulatedTowers"],
33 ymin=0,ymax=len(L1CaloMonitorCfgHelper.SIGNATURES),ylabels=L1CaloMonitorCfgHelper.SIGNATURES,
34 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
"merge")
35 helper.defineHistogram(
'LBN,Signature;h_mismatched_SimReady',
36 fillGroup=
"mismatches",
37 paths=[
'Shifter/Sim',
'Expert/Sim'],
38 hanConfig={
"algorithm":
"Histogram_Empty",
"description":
"Number of events with a mismatch, per LB (x-axis), per signature (y-axis) for signatures that are deemed simulation-ready"},
39 type=
'TH2I', cutmask=
'SimulationReady',
40 title=
'Mismatched Simulation-Ready Events;LB;Signature;Events',
41 xbins=1,xmin=0,xmax=1,
42 ylabels=[
"gJ",
"gLJ",
"jJ",
"jTAU",
"jXE",
"jTE",
"eTAU",
"eEM"],
43 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
47 for phiOct
in range(0,8):
48 for etaIdx
in range(-25,25):
49 locIdxs += [
str(phiOct) +
":" +
str(etaIdx)]
50 for sig
in [
"eEM",
"eTAU"]:
51 helper.defineHistogram(
"LBN,locIdx;h_"+sig+
"_mismatches_posLbnMap", title =
"Mismatched " + sig +
" [DataTower evts];LB;Position (Octant:Eta);TOBs",
52 fillGroup = sig +
"_mismatches", cutmask=
'SimulationReady',
53 path =
"Expert/Sim/detail",
54 hanConfig={
"description":
"Location of mismatched " + sig +
" TOBs in simulation-ready events. Use this plot to identify any localized eFEX issues."},
56 xbins=1,xmin=0,xmax=1, ylabels=locIdxs, opt=[
'kAddBinsDynamically'])
57 helper.defineHistogram(
'LBNString,Signature;h_mismatched_DataTowerEvts',
58 fillGroup=
"mismatches",
59 type=
'TH2I', cutmask=
'IsDataTowers',
60 title=
'Mismatched DataTower Events;LB:FirstEvtNum;Signature;Events',
61 xbins=1,xmin=0,xmax=1,
62 ybins=1,ymin=0,ymax=1,
63 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
64 helper.defineHistogram(
'LBNString,Signature;h_mismatched_EmulatedTowerEvts',
65 fillGroup=
"mismatches",
66 type=
'TH2I', cutmask=
'IsEmulatedTowers',
67 title=
'Mismatched EmulatedTower Events;LB:FirstEvtNum;Signature;Events',
68 xbins=1,xmin=0,xmax=1,
69 ybins=1,ymin=0,ymax=1,
70 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
71 helper.defineTree(
'LBNString,Signature,LBN,EventNumber,EventType,timeSince,timeUntil,dataEtas,dataPhis,dataWord0s,simEtas,simPhis,simWord0s;mismatched',
72 "lbnString/string:Signature/string:lbn/l:eventNumber/l:EventType/string:timeSince/I:timeUntil/I:dataEtas/vector<float>:dataPhis/vector<float>:dataWord0s/vector<unsigned int>:simEtas/vector<float>:simPhis/vector<float>:simWord0s/vector<unsigned int>",
73 title=
"mismatched;LBN:EvtNum;Signature",fillGroup=
"mismatches")
76 result.merge(helper.result())