ATLAS Offline Software
CpmSimMonitorAlgorithm.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
4 def CpmSimMonitoringConfig(inputFlags):
5  '''Function to configure LVL1 CpmSim algorithm in the monitoring system.'''
6 
7  #import math
8  # get the component factory - used for getting the algorithms
9  from AthenaConfiguration.AutoConfigFlags import GetFileMD
10  from AthenaConfiguration.Enums import Format
11  from AthenaConfiguration.ComponentFactory import CompFactory
12  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
13  result = ComponentAccumulator()
14 
15  # make the athena monitoring helper
16  from AthenaMonitoring import AthMonitorCfgHelper
17  helper = AthMonitorCfgHelper(inputFlags,'CpmSimMonitoringCfg')
18 
19  # Use metadata to check Run3 compatible trigger info is available
20  md = GetFileMD(inputFlags.Input.Files)
21  inputContainsRun3FormatConfigMetadata = ("metadata_items" in md and any(('TriggerMenuJson' in key) for key in md["metadata_items"].keys()))
22  if inputFlags.Input.Format is Format.POOL and not inputContainsRun3FormatConfigMetadata:
23  # No L1 menu available in the POOL file.
24  return helper.result()
25 
26  # get any algorithms
27  CpmSimMonAlg = helper.addAlgorithm(CompFactory.CpmSimMonitorAlgorithm,'CpmSimMonAlg')
28 
29  # configure the L1Menu depending on input type
30  if inputFlags.Trigger.Online.isPartition or inputFlags.Input.Format is Format.BS:
31  # For standalone monitoring use from RAW
32  CpmSimMonAlg.TrigConfigSvc = ""
33  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
34  helper.result().merge(L1ConfigSvcCfg(inputFlags))
35  else:
36  # For monitoring ESD (or MC)
37  from TrigConfxAOD.TrigConfxAODConfig import getxAODConfigSvc
38  ca = getxAODConfigSvc(inputFlags)
39  CpmSimMonAlg.TrigConfigSvc = ca.getPrimary()
40  helper.result().merge(ca)
41 
42  # Enable/Disable legacy hadronic CP inputs in the simulation. This should be True for heavy ion running
43  CpmSimMonAlg.s_legacyCpHadInputsDisabled = inputFlags.Reco.EnableHI
44 
45  # add any steering
46  groupName = 'CpmSimMonitor' # the monitoring group name is also used for the package name
47  CpmSimMonAlg.PackageName = groupName
48 
49  # mainDir is where the group starts from
50  mainDir = 'L1Calo'
51  # subdirectories
52  trigPath = 'CPM'
53  simPath = trigPath+'/Errors/Transmission_Simulation/'
54  monCPMinPath = simPath + 'PPM2CPMTowers/'
55  monRoiPath = simPath + 'Towers2RoIs/'
56  simPathCmx = trigPath+'_CMX/Errors/Transmission_Simulation/'
57  monCMXinPath = simPathCmx + 'RoIs2TOBs/'
58  monCMXsumsPath = simPathCmx + '/TOBs2HitSums/'
59  monCMXTopoPath = simPathCmx + '/TOBs2Topo'
60  monExpertPath = simPath
61  monShiftPath = simPath
62  monEvent1Path = simPath + '/MismatchEventNumbers/'
63  monEvent2Path = simPathCmx + '/MismatchEventNumbers/'
64 
65  # add monitoring algorithm to group, with group name and main directory
66  myGroup = helper.addGroup(CpmSimMonAlg, groupName , mainDir)
67 
68  # CPMTowers
69  # em
70  myGroup.defineHistogram('eta_em_PpmEqCor,phi_em_PpmEqCor;cpm_em_2d_etaPhi_tt_PpmEqCore',
71  title="EM Core CPM Tower/PPM Tower Non-zero Matches;;",type='TH2F',
72  cutmask='',path=monCPMinPath,
73  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
74 
75  myGroup.defineHistogram('eta_em_PpmNeCor,phi_em_PpmNeCor;cpm_em_2d_etaPhi_tt_PpmNeCore',
76  title="EM Core CPM Tower/PPM Tower Non-zero Mismatches;;",type='TH2F',
77  cutmask='',path=monCPMinPath,
78  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
79 
80  myGroup.defineHistogram('eta_em_PpmNoCor,phi_em_PpmNoCor;cpm_em_2d_etaPhi_tt_PpmNoCore',
81  title="EM PPM Towers but no Core CPM Towers;;",type='TH2F',
82  cutmask='',path=monCPMinPath,
83  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
84 
85  myGroup.defineHistogram('eta_em_CoreNoPpm,phi_em_CoreNoPpm;cpm_em_2d_etaPhi_tt_CoreNoPpm',
86  title="EM Core CPM Towers but no PPM Towers;;",type='TH2F',
87  cutmask='',path=monCPMinPath,
88  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
89 
90  myGroup.defineHistogram('eta_em_PpmEqOverlap,phi_em_PpmEqOverlap;cpm_em_2d_etaPhi_tt_PpmEqOverlap',
91  title="EM Overlap CPM Tower/PPM Tower Non-zero Matches;;",type='TH2F',
92  cutmask='',path=monCPMinPath,
93  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
94 
95  myGroup.defineHistogram('eta_em_PpmNeOverlap,phi_em_PpmNeOverlap;cpm_em_2d_etaPhi_tt_PpmNeOverlap',
96  title="EM Overlap CPM Tower/PPM Tower Non-zero Mismatches;;",type='TH2F',
97  cutmask='',path=monCPMinPath,
98  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
99 
100  myGroup.defineHistogram('eta_em_PpmNoOverlap,phi_em_PpmNoOverlap;cpm_em_2d_etaPhi_tt_PpmNoOverlap',
101  title="EM PPM Towers but no Overlap CPM Towers;;",type='TH2F',
102  cutmask='',path=monCPMinPath,
103  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
104 
105  myGroup.defineHistogram('eta_em_OverlapeNoPpm,phi_em_OverlapeNoPpm;cpm_em_2d_etaPhi_tt_OverlapNoPpm',
106  title="EM Overlap CPM Towers but no PPM Towers;;",type='TH2F',
107  cutmask='',path=monCPMinPath,
108  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
109 
110 
111  # hadronic
112  myGroup.defineHistogram('eta_had_PpmEqCor,phi_had_PpmEqCor;cpm_had_2d_etaPhi_tt_PpmEqCore',
113  title="HAD Core CPM Tower/PPM Tower Non-zero Matches;;",type='TH2F',
114  cutmask='',path=monCPMinPath,
115  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
116 
117  myGroup.defineHistogram('eta_had_PpmNeCor,phi_had_PpmNeCor;cpm_had_2d_etaPhi_tt_PpmNeCore',
118  title="HAD Core CPM Tower/PPM Tower Non-zero Mismatches;;",type='TH2F',
119  cutmask='',path=monCPMinPath,
120  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
121 
122  myGroup.defineHistogram('eta_had_PpmNoCor,phi_had_PpmNoCor;cpm_had_2d_etaPhi_tt_PpmNoCore',
123  title="HAD PPM Towers but no Core CPM Towers;;",type='TH2F',
124  cutmask='',path=monCPMinPath,
125  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
126 
127  myGroup.defineHistogram('eta_had_CoreNoPpm,phi_had_CoreNoPpm;cpm_had_2d_etaPhi_tt_CoreNoPpm',
128  title="HAD Core CPM Towers but no PPM Towers;;",type='TH2F',
129  cutmask='',path=monCPMinPath,
130  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
131 
132  myGroup.defineHistogram('eta_had_PpmEqOverlap,phi_had_PpmEqOverlap;cpm_had_2d_etaPhi_tt_PpmEqOverlap',
133  title="HAD Overlap CPM Tower/PPM Tower Non-zero Matches;;",type='TH2F',
134  cutmask='',path=monCPMinPath,
135  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
136 
137  myGroup.defineHistogram('eta_had_PpmNeOverlap,phi_had_PpmNeOverlap;cpm_had_2d_etaPhi_tt_PpmNeOverlap',
138  title="HAD Overlap CPM Tower/PPM Tower Non-zero Mismatches;;",type='TH2F',
139  cutmask='',path=monCPMinPath,
140  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
141 
142  myGroup.defineHistogram('eta_had_PpmNoOverlap,phi_had_PpmNoOverlap;cpm_had_2d_etaPhi_tt_PpmNoOverlap',
143  title="HAD PPM Towers but no Overlap CPM Towers;;",type='TH2F',
144  cutmask='',path=monCPMinPath,
145  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
146 
147  myGroup.defineHistogram('eta_had_OverlapeNoPpm,phi_had_OverlapeNoPpm;cpm_had_2d_etaPhi_tt_OverlapNoPpm',
148  title="HAD Overlap CPM Towers but no PPM Towers;;",type='TH2F',
149  cutmask='',path=monCPMinPath,
150  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
151 
152 
153  # FPGA
154  myGroup.defineHistogram('loc_PpmEqCpmFpga,loc_fpga_PpmEqCpmFpga;cpm_2d_tt_PpmEqCpmFpga',
155  title="CPM Tower/PPM Tower Non-zero Matches by FPGA;;",type='TH2F',
156  cutmask='',path=monCPMinPath,
157  xbins=56,xmin=0.0,xmax=56.0,ybins=20,ymin=0.,ymax=20.0)
158 
159  myGroup.defineHistogram('loc_PpmNeCpmFpga,loc_fpga_PpmNeCpmFpga;cpm_2d_tt_PpmNeCpmFpga',
160  title="CPM Tower/PPM Tower Non-zero Mismatches by FPGA;;",type='TH2F',
161  cutmask='',path=monCPMinPath,
162  xbins=56,xmin=0.0,xmax=56.0,ybins=20,ymin=0.,ymax=20.0)
163 
164  myGroup.defineHistogram('loc_PpmNoCpmFpga,loc_fpga_PpmNoCpmFpga;cpm_2d_tt_PpmNoCpmFpga',
165  title="PPM Towers but no CPM Towers by FPGA;;",type='TH2F',
166  cutmask='',path=monCPMinPath,
167  xbins=56,xmin=0.0,xmax=56.0,ybins=20,ymin=0.,ymax=20.0)
168 
169  myGroup.defineHistogram('loc_CpmNoPpmFpga,loc_fpga_CpmNoPpmFpga;cpm_2d_tt_CpmNoPpmFpga',
170  title="CPM Towers but no PPM Towers by FPGA;;",type='TH2F',
171  cutmask='',path=monCPMinPath,
172  xbins=56,xmin=0.0,xmax=56.0,ybins=20,ymin=0.,ymax=20.0)
173 
174 
175  # RoIs
176  myGroup.defineHistogram('emEnerSimEqDataLocX,emEnerSimEqDataLocY;cpm_2d_roi_EmEnergySimEqData',
177  title="CPM RoI EM Energy Data/Simulation Non-zero Matches;;",type='TH2F',
178  cutmask='',path=monRoiPath,
179  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
180 
181  myGroup.defineHistogram('emEnerSimNeDataLocX,emEnerSimNeDataLocY;cpm_2d_roi_EmEnergySimNeData',
182  title="CPM RoI EM Energy Data/Simulation Non-zero mismatches;;",type='TH2F',
183  cutmask='',path=monRoiPath,
184  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
185 
186  myGroup.defineHistogram('emEnerSimNoDataLocX,emEnerSimNoDataLocY;cpm_2d_roi_EmEnergySimNoData',
187  title="CPM RoI EM Energy Simulation but no Data;;",type='TH2F',
188  cutmask='',path=monRoiPath,
189  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
190 
191  myGroup.defineHistogram('emEnerDataNoSimLocX,emEnerDataNoSimLocY;cpm_2d_roi_EmEnergyDataNoSim',
192  title="CPM RoI EM Energy Data but no Simulation;;",type='TH2F',
193  cutmask='',path=monRoiPath,
194  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
195 
196  myGroup.defineHistogram('tauEnerSimEqDataLocX,tauEnerSimEqDataLocY;cpm_2d_roi_TauEnergySimEqData',
197  title="CPM RoI Tau Energy Data/Simulation Non-zero Matches;;",type='TH2F',
198  cutmask='',path=monRoiPath,
199  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
200 
201  myGroup.defineHistogram('tauEnerSimNeDataLocX,tauEnerSimNeDataLocY;cpm_2d_roi_TauEnergySimNeData',
202  title="CPM RoI Tau Energy Data/Simulation Non-zero mismatches;;",type='TH2F',
203  cutmask='',path=monRoiPath,
204  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
205 
206  myGroup.defineHistogram('tauEnerSimNoDataLocX,tauEnerSimNoDataLocY;cpm_2d_roi_TauEnergySimNoData',
207  title="CPM RoI Tau Energy Simulation but no Data;;",type='TH2F',
208  cutmask='',path=monRoiPath,
209  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
210 
211  myGroup.defineHistogram('tauEnerDataNoSimLocX,tauEnerDataNoSimLocY;cpm_2d_roi_TauEnergyDataNoSim',
212  title="CPM RoI Tau Energy Data but no Simulation;;",type='TH2F',
213  cutmask='',path=monRoiPath,
214  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
215 
216  myGroup.defineHistogram('roiEtaSimEqData,roiPhiSimEqData;cpm_2d_etaPhi_roi_SimEqData',
217  title="CPM RoI Data/Simulation Non-zero Matches;;",type='TH2F',
218  cutmask='',path=monRoiPath,
219  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
220 
221  myGroup.defineHistogram('roiEtaSimNeData,roiPhiSimNeData;cpm_2d_etaPhi_roi_SimNeData',
222  title="CPM RoI Data/Simulation Non-zero Mismatches;;",type='TH2F',
223  cutmask='',path=monRoiPath,
224  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
225 
226  myGroup.defineHistogram('roiEtaSimNoData,roiPhiSimNoData;cpm_2d_etaPhi_roi_SimNoData',
227  title="CPM RoI Simulation but no Data;;",type='TH2F',
228  cutmask='',path=monRoiPath,
229  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
230 
231  myGroup.defineHistogram('roiEtaDataNoSim,roiPhiDataNoSim;cpm_2d_etaPhi_roi_DataNoSim',
232  title="CPM RoI Data but no Simulation;;",type='TH2F',
233  cutmask='',path=monRoiPath,
234  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
235 
236  # CMX-CP TOBs
237  myGroup.defineHistogram('cmxLeftEnerSimEqDataLocX,cmxLeftEnerSimEqDataLocY;cmx_2d_tob_LeftEnergySimEqData',
238  title="CMX TOB Left Energy Data/Simulation Non-zero Matches;;",type='TH2F',
239  cutmask='',path=monCMXinPath,
240  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
241 
242  myGroup.defineHistogram('cmxRightEnerSimEqDataLocX,cmxRightEnerSimEqDataLocY;cmx_2d_tob_RightEnergySimEqData',
243  title="CMX TOB Right Energy Data/Simulation Non-zero Matches;;",type='TH2F',
244  cutmask='',path=monCMXinPath,
245  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
246 
247  myGroup.defineHistogram('cmxLeftEnerSimNeDataLocX,cmxLeftEnerSimNeDataLocY;cmx_2d_tob_LeftEnergySimNeData',
248  title="CMX TOB Left Energy Data/Simulation Non-zero Mismatches;;",type='TH2F',
249  cutmask='',path=monCMXinPath,
250  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
251 
252  myGroup.defineHistogram('cmxRightEnerSimNeDataLocX,cmxRightEnerSimNeDataLocY;cmx_2d_tob_RightEnergySimNeData',
253  title="CMX TOB Right Energy Data/Simulation Non-zero Mismatches;;",type='TH2F',
254  cutmask='',path=monCMXinPath,
255  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
256 
257  myGroup.defineHistogram('cmxLeftEnerSimNoDataLocX,cmxLeftEnerSimNoDataLocY;cmx_2d_tob_LeftEnergySimNoData',
258  title="CMX TOB Left Energy Simulation but no Data;;",type='TH2F',
259  cutmask='',path=monCMXinPath,
260  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
261 
262  myGroup.defineHistogram('cmxRightEnerSimNoDataLocX,cmxRightEnerSimNoDataLocY;cmx_2d_tob_RightEnergySimNoData',
263  title="CMX TOB Right Energy Simulation but no Data;;",type='TH2F',
264  cutmask='',path=monCMXinPath,
265  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
266 
267  myGroup.defineHistogram('cmxLeftEnerDataNoSimLocX,cmxLeftEnerDataNoSimLocY;cmx_2d_tob_LeftEnergyDataNoSim',
268  title="CMX TOB Left Energy Data but no Simulation;;",type='TH2F',
269  cutmask='',path=monCMXinPath,
270  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
271 
272  myGroup.defineHistogram('cmxRightEnerDataNoSimLocX,cmxRightEnerDataNoSimLocY;cmx_2d_tob_RightEnergyDataNoSim',
273  title="CMX TOB Right Energy Data but no Simulation;;",type='TH2F',
274  cutmask='',path=monCMXinPath,
275  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
276 
277  #
278  myGroup.defineHistogram('cmxLeftIsolSimEqDataLocX,cmxLeftIsolSimEqDataLocY;cmx_2d_tob_LeftIsolSimEqData',
279  title="CMX TOB Left Isolation Data/Simulation Non-zero Matches;;",type='TH2F',
280  cutmask='',path=monCMXinPath,
281  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
282 
283  myGroup.defineHistogram('cmxRightIsolSimEqDataLocX,cmxRightIsolSimEqDataLocY;cmx_2d_tob_RightIsolSimEqData',
284  title="CMX TOB Right Isolation Data/Simulation Non-zero Matches;;",type='TH2F',
285  cutmask='',path=monCMXinPath,
286  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
287 
288  myGroup.defineHistogram('cmxLeftIsolSimNeDataLocX,cmxLeftIsolSimNeDataLocY;cmx_2d_tob_LeftIsolSimNeData',
289  title="CMX TOB Left Isolation Data/Simulation Non-zero Mismatches;;",type='TH2F',
290  cutmask='',path=monCMXinPath,
291  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
292 
293  myGroup.defineHistogram('cmxRightIsolSimNeDataLocX,cmxRightIsolSimNeDataLocY;cmx_2d_tob_RightIsolSimNeData',
294  title="CMX TOB Right Isolation Data/Simulation Non-zero Mismatches;;",type='TH2F',
295  cutmask='',path=monCMXinPath,
296  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
297 
298  myGroup.defineHistogram('cmxLeftIsolSimNoDataLocX,cmxLeftIsolSimNoDataLocY;cmx_2d_tob_LeftIsolSimNoData',
299  title="CMX TOB Left Isolation Simulation but no Data;;",type='TH2F',
300  cutmask='',path=monCMXinPath,
301  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
302 
303  myGroup.defineHistogram('cmxRightIsolSimNoDataLocX,cmxRightIsolSimNoDataLocY;cmx_2d_tob_RightIsolSimNoData',
304  title="CMX TOB Right Isolation Simulation but no Data;;",type='TH2F',
305  cutmask='',path=monCMXinPath,
306  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
307 
308  myGroup.defineHistogram('cmxLeftIsolDataNoSimLocX,cmxLeftIsolDataNoSimLocY;cmx_2d_tob_LeftIsolDataNoSim',
309  title="CMX TOB Left Isolation Data but no Simulation;;",type='TH2F',
310  cutmask='',path=monCMXinPath,
311  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
312 
313  myGroup.defineHistogram('cmxRightIsolDataNoSimLocX,cmxRightIsolDataNoSimLocY;cmx_2d_tob_RightIsolDataNoSim',
314  title="CMX TOB Right Isolation Data but no Simulation;;",type='TH2F',
315  cutmask='',path=monCMXinPath,
316  xbins=56,xmin=0.,xmax=56.0,ybins=64,ymin=0.,ymax=64.0)
317 
318  #
319  myGroup.defineHistogram('cmxOverLocXSimEqData,cmxOverCmxSimEqData;cmx_2d_tob_OverflowSimEqData',
320  title="CMX TOB RoI Overflow Bit Data/Simulation Matches;;",type='TH2F',
321  cutmask='',path=monCMXinPath,
322  xbins=56,xmin=0.0,xmax=56.0,ybins=2,ymin=0.,ymax=2.0)
323 
324  myGroup.defineHistogram('cmxOverLocXSimNeData,cmxOverCmxSimNeData;cmx_2d_tob_OverflowSimNeData',
325  title="CMX TOB RoI Overflow Bit Data/Simulation Mismatches;;",type='TH2F',
326  cutmask='',path=monCMXinPath,
327  xbins=56,xmin=0.0,xmax=56.0,ybins=2,ymin=0.,ymax=2.0)
328 
329  #
330  myGroup.defineHistogram('cmxEtaSimEqData,cmxPhiSimEqData;cmx_2d_etaPhi_tob_SimEqData',
331  title="CMX TOB Data/Simulation Non-zero Matches;;",type='TH2F',
332  cutmask='',path=monCMXinPath,
333  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
334 
335  myGroup.defineHistogram('cmxEtaSimNeData,cmxPhiSimNeData;cmx_2d_etaPhi_tob_SimNeData',
336  title="CMX TOB Data/Simulation Non-zero Mismatches;;",type='TH2F',
337  cutmask='',path=monCMXinPath,
338  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
339 
340  myGroup.defineHistogram('cmxEtaSimNoData,cmxPhiSimNoData;cmx_2d_etaPhi_tob_SimNoData',
341  title="CMX TOB Simulation but no Data;;",type='TH2F',
342  cutmask='',path=monCMXinPath,
343  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
344 
345  myGroup.defineHistogram('cmxEtaDataNoSim,cmxPhiDataNoSim;cmx_2d_etaPhi_tob_DataNoSim',
346  title="CMX TOB Data but no Simulation;;",type='TH2F',
347  cutmask='',path=monCMXinPath,
348  xbins=66,xmin=-3.3,xmax=3.3,ybins=64,ymin=0.,ymax=64.0)
349 
350 
351  # Local/Remote/Total sums
352 
353  myGroup.defineHistogram('cmx_sum_loc_SimEqData;cmx_1d_thresh_SumsSimEqData',
354  title='CMX Hit Sums Data/Simulation Non-zero Matches',
355  cutmask='',path=monCMXsumsPath,xbins=16,xmin=0.0,xmax=16.0)
356 
357  myGroup.defineHistogram('cmx_sum_loc_SimNeData;cmx_1d_thresh_SumsSimNeData',
358  title='CMX Hit Sums Data/Simulation Non-zero Mismatches',
359  cutmask='',path=monCMXsumsPath,xbins=16,xmin=0.0,xmax=16.0)
360 
361  myGroup.defineHistogram('cmx_sum_loc_SimNoData;cmx_1d_thresh_SumsSimNoData',
362  title='CMX Hit Sums Simulation but no Data',
363  cutmask='',path=monCMXsumsPath,xbins=16,xmin=0.0,xmax=16.0)
364 
365  myGroup.defineHistogram('cmx_sum_loc_DataNoSim;cmx_1d_thresh_SumsDataNoSim',
366  title='CMX Hit Sums Data but no Simulation',
367  cutmask='',path=monCMXsumsPath,xbins=16,xmin=0.0,xmax=16.0)
368 
369  #
370  myGroup.defineHistogram('cmx_x_leftsums_SimEqData,cmx_y_leftsums_SimEqData;cmx_2d_thresh_LeftSumsSimEqData',
371  title='CMX Hit Sums Left Data/Simulation Threshold Non-zero Matches',type='TH2F',
372  cutmask='',path=monCMXsumsPath,xbins=8,xmin=0.0,xmax=8.0,ybins=16,ymin=0.0,ymax=16.0,
373  weight='cmx_w_leftsums_SimEqData')
374 
375  myGroup.defineHistogram('cmx_x_leftsums_SimNeData,cmx_y_leftsums_SimNeData;cmx_2d_thresh_LeftSumsSimNeData',
376  title='CMX Hit Sums Left Data/Simulation Threshold Non-zero Mismatches',type='TH2F',
377  cutmask='',path=monCMXsumsPath,xbins=8,xmin=0.0,xmax=8.0,ybins=16,ymin=0.0,ymax=16.0,
378  weight='cmx_w_leftsums_SimNeData')
379 
380  myGroup.defineHistogram('cmx_x_rightsums_SimEqData,cmx_y_rightsums_SimEqData;cmx_2d_thresh_RightSumsSimEqData',
381  title='CMX Hit Sums Right Data/Simulation Threshold Non-zero Matches',type='TH2F',
382  cutmask='',path=monCMXsumsPath,xbins=8,xmin=0.0,xmax=8.0,ybins=16,ymin=0.0,ymax=16.0,
383  weight='cmx_w_rightsums_SimEqData')
384 
385  myGroup.defineHistogram('cmx_x_rightsums_SimNeData,cmx_y_rightsums_SimNeData;cmx_2d_thresh_RightSumsSimNeData',
386  title='CMX Hit Sums Right Data/Simulation Threshold Non-zero Mismatches',type='TH2F',
387  cutmask='',path=monCMXsumsPath,xbins=8,xmin=0.0,xmax=8.0,ybins=16,ymin=0.0,ymax=16.0,
388  weight='cmx_w_rightsums_SimNeData')
389 
390 
391  # Topo output information
392  """
393  m_histTool->setMonGroup(&monCMXTopo);
394 
395  m_h_cmx_2d_topo_SimNoData = m_histTool->book2F(
396  "cmx_2d_topo_SimNoData", "CMX Topo Output Simulation but no Data", 8, 0,
397  8, 3, 0, 3);
398  setLabelsTopo(m_h_cmx_2d_topo_SimNoData);
399  m_h_cmx_2d_topo_DataNoSim = m_histTool->book2F(
400  "cmx_2d_topo_DataNoSim", "CMX Topo Output Data but no Simulation", 8, 0,
401  8, 3, 0, 3);
402  setLabelsTopo(m_h_cmx_2d_topo_DataNoSim);
403  """
404  myGroup.defineHistogram('cmxTopoLocXSimNeData,cmxTopoLocYSimNeData;cmx_2d_topo_SimNeData',
405  title="CMX Topo Output Data/Simulation Non-zero Mismatches;;",type='TH2F',
406  cutmask='',path=monCMXTopoPath,
407  xbins=8,xmin=0.0,xmax=8.0,ybins=3,ymin=0.0,ymax=3.0)
408 
409  myGroup.defineHistogram('cmxTopoLocXSimEqData,cmxTopoLocYSimEqData;cmx_2d_topo_SimEqData',
410  title="CMX Topo Output Data/Simulation Non-zero Matches;;",type='TH2F',
411  cutmask='',path=monCMXTopoPath,
412  xbins=8,xmin=0.0,xmax=8.0,ybins=3,ymin=0.0,ymax=3.0)
413 
414  myGroup.defineHistogram('cmxTopoLocXSimNoData,cmxTopoLocYSimNoData;cmx_2d_topo_SimNoData',
415  title="CMX Topo Output Simulation but no Data;;",type='TH2F',
416  cutmask='',path=monCMXTopoPath,
417  xbins=8,xmin=0.0,xmax=8.0,ybins=3,ymin=0.0,ymax=3.0)
418 
419  myGroup.defineHistogram('cmxTopoLocXDataNoSim,cmxTopoLocYDataNoSim;cmx_2d_topo_DataNoSim',
420  title="CMX Topo Output Data but no Simulation;;",type='TH2F',
421  cutmask='',path=monCMXTopoPath,
422  xbins=8,xmin=0.0,xmax=8.0,ybins=3,ymin=0.0,ymax=3.0)
423 
424 
425  # Summary
426  NumberOfSummaryBins=10
427  summary_labels=["EM tt","Had tt","#color[2]{EM RoIs}","#color[2]{Tau RoIs}","#splitline{Left}{TOBs}",
428  "#splitline{Right}{TOBs}","#color[2]{#splitline{Local}{Sums}}","#splitline{Remote}{Sums}","#splitline{Total}{Sums}","#splitline{Topo}{Info}"]
429  #
430  myGroup.defineHistogram('cpmErrorLoc,cpmError;cpm_2d_SimEqDataOverview',
431  title="CP Transmission/Comparison with Simulation Overview - Events with Matches;;",
432  type='TH2F',
433  cutmask='',path=monExpertPath,
434  xbins=64,xmin=0.,xmax=64.0,
435  ybins=NumberOfSummaryBins,ymin=0.,ymax=NumberOfSummaryBins)
436 
437  myGroup.defineHistogram('cpmErrorLoc_SimNeData,cpmError_SimNeData;cpm_2d_SimNeDataOverview',
438  title="CP Transmission/Comparison with Simulation Overview - Events with Mismatches;;",
439  type='TH2F',
440  cutmask='',path=monExpertPath,
441  xbins=64,xmin=0.,xmax=64.0,
442  ybins=NumberOfSummaryBins,ymin=0.,ymax=NumberOfSummaryBins)
443 
444  # 1d summary to shiftpath
445  myGroup.defineHistogram('cpmErrorSummary;cpm_1d_SimNeDataSummary',
446  title='CP Transmission/Comparison with Simulation Mismatch Summary;;Events',
447  cutmask='',path=monShiftPath,
448  xbins=NumberOfSummaryBins,xmin=0,xmax=NumberOfSummaryBins,xlabels=summary_labels)
449 
450 
451 
452 
453  # Mismatch Event Number Samples
454  myGroup.defineHistogram('em_tt_evtstr,em_tt_y;cpm_em_2d_tt_MismatchEvents',
455  title='CPM Towers EM Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
456  path=monEvent1Path,merge='merge',
457  xbins=1,ybins=56,ymin=0,ymax=56.0)
458 
459  myGroup.defineHistogram('had_tt_evtstr,had_tt_y;cpm_had_2d_tt_MismatchEvents',
460  title='CPM Towers Had Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
461  path=monEvent1Path,merge='merge',
462  xbins=1,ybins=56,ymin=0,ymax=56.0)
463 
464  myGroup.defineHistogram('em_roi_evtstr,em_roi_y;cpm_2d_roi_EmMismatchEvents',
465  title='CPM RoIs EM Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
466  path=monEvent1Path,merge='merge',
467  xbins=1,ybins=56,ymin=0,ymax=56.0)
468 
469  myGroup.defineHistogram('tau_roi_evtstr,tau_roi_y;cpm_2d_roi_TauMismatchEvents',
470  title='CPM RoIs Tau Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
471  path=monEvent1Path,merge='merge',
472  xbins=1,ybins=56,ymin=0,ymax=56.0)
473 
474  # monEvent2Path
475  myGroup.defineHistogram('cmx_tob_left_evtstr,cmx_tob_left_y;cmx_2d_tob_LeftMismatchEvents',
476  title='CMX TOBs Left Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
477  path=monEvent2Path,merge='merge',
478  xbins=1,ybins=56,ymin=0,ymax=56.0)
479 
480  myGroup.defineHistogram('cmx_tob_right_evstr,cmx_tob_right_y;cmx_2d_tob_RightMismatchEvents',
481  title='CMX TOBs Right Mismatch Event Numbers;Events with Error/Mismatch;',type='TH2I',
482  path=monEvent2Path,merge='merge',
483  xbins=1,ybins=56,ymin=0,ymax=56.0)
484 
485  thresh_ylabels=["Local 0/0","","","","","","","",
486  "Remote 0/0","","","","","","Total 3/0","",
487  "Topo 0/0","","","","","","",""]
488  myGroup.defineHistogram('cmx_thresh_evtstr,cmx_thresh_y;cmx_2d_thresh_SumsMismatchEvents',
489  title='CMX Hit Sums Mismatch Event Numbers;Events with Error/Mismatch;', type='TH2I',
490  path=monEvent2Path,merge='merge',
491  xbins=1,ybins=24,ymin=0,ymax=24.0,ylabels=thresh_ylabels)
492 
493 
494  acc = helper.result()
495  result.merge(acc)
496  return result
497 
498 
499 if __name__=='__main__':
500  # set input file and config options
501  from AthenaConfiguration.AllConfigFlags import initConfigFlags
502  import glob
503 
504  inputs = glob.glob('/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2020-04-06T2139/TrigP1Test/test_trigP1_v1PhysP1_T0Mon_build/ESD.pool.root')
505 
506  flags = initConfigFlags()
507  flags.Input.Files = inputs
508  flags.Output.HISTFileName = 'ExampleMonitorOutput_LVL1.root'
509 
510  flags.lock()
511  flags.dump() # print all the configs
512 
513  from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
514  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
515  cfg = MainServicesSerialCfg()
516  cfg.merge(PoolReadCfg(flags))
517 
518  CpmSimMonitorCfg = CpmSimMonitoringConfig(flags)
519  cfg.merge(CpmSimMonitorCfg)
520 
521  # message level for algorithm
522  CpmSimMonitorCfg.getEventAlgo('CpmSimMonAlg').OutputLevel = 2 # 1/2 INFO/DEBUG
523  # options - print all details of algorithms, very short summary
524  cfg.printConfig(withDetails=False, summariseProps = True)
525 
526  nevents=-1
527  cfg.run(nevents)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True)
Definition: AutoConfigFlags.py:51
TrigConfxAODConfig.getxAODConfigSvc
def getxAODConfigSvc(flags)
Definition: TrigConfxAODConfig.py:5
CpmSimMonitorAlgorithm.CpmSimMonitoringConfig
def CpmSimMonitoringConfig(inputFlags)
Definition: CpmSimMonitorAlgorithm.py:4
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:198
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
merge
Definition: merge.py:1