5 '''Function to configure LVL1 Efex simulation comparison algorithm in the monitoring system.'''
8 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
10 helper = L1CaloMonitorCfgHelper(flags,CompFactory.JfexSimMonitorAlgorithm,
'JfexSimMonAlg')
11 JfexSimMonAlg = helper.alg
15 JfexSimMonAlg.jFexSRJetRoIContainer =
"L1_jFexSRJetxRoI"
16 JfexSimMonAlg.jFexLRJetRoIContainer =
"L1_jFexLRJetxRoI"
17 JfexSimMonAlg.jFexTauRoIContainer =
"L1_jFexTauxRoI"
18 JfexSimMonAlg.jFexFwdElRoIContainer =
"L1_jFexFwdElxRoI"
19 JfexSimMonAlg.jFexMETRoIContainer =
"L1_jFexMETxRoI"
20 JfexSimMonAlg.jFexSumETRoIContainer =
"L1_jFexSumETxRoI"
22 JfexSimMonAlg.jFexSRJetRoISimContainer =
"L1_jFexSRJetxRoISim"
23 JfexSimMonAlg.jFexLRJetRoISimContainer =
"L1_jFexLRJetxRoISim"
24 JfexSimMonAlg.jFexTauRoISimContainer =
"L1_jFexTauxRoISim"
25 JfexSimMonAlg.jFexFwdElRoISimContainer =
"L1_jFexFwdElxRoISim"
26 JfexSimMonAlg.jFexMETRoISimContainer =
"L1_jFexMETxRoISim"
27 JfexSimMonAlg.jFexSumETRoISimContainer =
"L1_jFexSumETxRoISim"
29 helper.defineDQAlgorithm(
"L1CaloMismatchRate",
30 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_GreaterThan_Threshold",
"BinThreshold":
"0.9"},
31 thresholdConfig={
"NBins":[0,10]},
34 helper.defineHistogram(
'EventType,Signature,tobMismatched;h_simSummary',title=
'Sim-HW Mismatches (percentage);Event Type;Signature',
35 fillGroup=
"mismatches",
36 path=
'Expert/Sim/detail',
37 hanConfig={
"display":
"SetPalette(87),Draw=COLZTEXT"},
39 xlabels=[
"DataTowers",
"EmulatedTowers"],
40 ymin=0,ymax=len(L1CaloMonitorCfgHelper.SIGNATURES),ylabels=L1CaloMonitorCfgHelper.SIGNATURES,
41 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
"merge")
42 helper.defineHistogram(
'LBN,Signature;h_mismatched_SimReady',
43 fillGroup=
"mismatches_count",
44 paths=[
'Shifter/Sim'],
45 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",
"display":
"SetPalette(55)"},
46 type=
'TH2I', cutmask=
'SimulationReady',
47 title=
'Mismatched Simulation-Ready Events;LB;Signature;Events',
48 xbins=1,xmin=0,xmax=1,
49 ylabels=[
"gJ",
"gLJ",
"jJ",
"jTAU",
"jXE",
"jTE",
"eTAU",
"eEM"],
50 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
51 helper.defineHistogram(
'LBN,Signature,tobMismatched;h_mismatched_SimReadyRate',
52 fillGroup=
"mismatches",
54 hanConfig={
"algorithm":
"L1CaloMismatchRate",
"description":
"Mismatch rate, per LB (x-axis), per signature (y-axis) for signatures that are deemed simulation-ready - should not be high rate (see DQ algo)",
"display":
"SetPalette(55)"},
55 type=
'TProfile2D', cutmask=
'SimulationReady',
56 title=
'Mismatched Rate for Simulation-Ready Signatures;LB;Signature;Event Rate (%)',
57 xbins=1,xmin=0,xmax=1,
58 ylabels=[
"gJ",
"gLJ",
"jJ",
"jTAU",
"jXE",
"jTE",
"eTAU",
"eEM"],
59 opt=[
'kAddBinsDynamically',
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
60 helper.defineHistogram(
'LBNString,Signature;h_mismatched_DataTowerEvts',
61 fillGroup=
"mismatches",
62 type=
'TH2I', cutmask=
'IsDataTowers',
63 title=
'Mismatched DataTower Events;LB:FirstEvtNum;Signature;Events',
64 xbins=1,xmin=0,xmax=1,
65 ybins=1,ymin=0,ymax=1,
66 opt=[
'kCanRebin',
'kAlwaysCreate'],merge=
'merge')
67 helper.defineHistogram(
'LBN,Signature;h_mismatched_EmulatedTowerEvts',
68 fillGroup=
"mismatches",
69 type=
'TH2I', cutmask=
'IsEmulatedTowers',
70 title=
'Mismatched EmulatedTower Events;LB;Signature;Events',
71 xbins=1,xmin=0,xmax=1,
72 ybins=1,ymin=0,ymax=1,
73 opt=[
'kCanRebin',
'kAlwaysCreate',
'kAddBinsDynamically'],merge=
'merge')
74 helper.defineTree(
'LBN,Signature,LBNString,EventNumber,EventType,dataEtas,dataPhis,dataWord0s,simEtas,simPhis,simWord0s;mismatched',
75 "lbn/l:Signature/string:lbnString/string:eventNumber/l:EventType/string:dataEtas/vector<float>:dataPhis/vector<float>:dataWord0s/vector<unsigned int>:simEtas/vector<float>:simPhis/vector<float>:simWord0s/vector<unsigned int>",
76 title=
"mismatched;LBN;Signature",fillGroup=
"mismatches")
79 return helper.result()
82 if __name__==
'__main__':
84 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
88 parser = argparse.ArgumentParser(prog=
'python -m TrigT1CaloMonitoring.JfexSimMonitorAlgorithm',
89 description=
"""Used to run jFEX Monitoring\n\n
90 Example: python -m TrigT1CaloMonitoring.JfexSimMonitorAlgorithm --filesInput file.root.\n
91 Overwrite inputs using standard athena opts --filesInput, evtMax etc. see athena --help""")
92 parser.add_argument(
'--evtMax',type=int,default=-1,help=
"number of events")
93 parser.add_argument(
'--filesInput',nargs=
'+',help=
"input files",required=
True)
94 parser.add_argument(
'--skipEvents',type=int,default=0,help=
"number of events to skip")
95 args = parser.parse_args()
99 flags.Trigger.triggerConfig=
'DB'
100 flags.Input.Files = [file
for x
in args.filesInput
for file
in glob.glob(x)]
101 flags.Output.HISTFileName =
'jFexSimData_Monitoring.root'
103 flags.Exec.MaxEvents = args.evtMax
104 flags.Exec.SkipEvents = args.skipEvents
108 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
109 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
114 cfg.merge(JfexSimMonitorCfg)
116 from TrigT1CaloMonitoring.JfexInputMonitorAlgorithm
import JfexInputMonitoringConfig
118 cfg.merge(JfexInputMonitorCfg)