ATLAS Offline Software
BSMonitoringAlgorithm.py
Go to the documentation of this file.
1 
2 #
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 #
5 def BSMonitoringConfig(inputFlags):
6  '''Function to configure LVL1 BSMonitoring algorithm in the monitoring system.'''
7 
8  import logging
9  local_logger = logging.getLogger('AthenaMonitoringCfg')
10  info = local_logger.info
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,'BSMonitoringCfg')
18 
19  # get any algorithms
20  BSMonAlg = helper.addAlgorithm(CompFactory.TrigT1CTMonitoring.BSMonitoringAlgorithm,'BSMonAlg')
21 
22  # default values:
23  ProcessRoIBResult = True
24  InclusiveTriggerThresholds = True
25  ProcessMuctpiData = True
26  ProcessMuctpiDataRIO = True
27  RunOnESD = False
28  CompareRerun = False
29  ProcessCTPData = True
30  isSimulation = inputFlags.Input.isMC
31 
32  info('In BSMonitoringConfig SIM or not?: %s', isSimulation)
33  #-----------ONLINE CODE---------------------
34  if inputFlags.Common.isOnline:
35  #info('In BSMonitoringConfig: isOnline')
36  ProcessRoIBResult = True
37  InclusiveTriggerThresholds = True
38  ProcessMuctpiData = True #True
39  ProcessMuctpiDataRIO = False #True
40  RunOnESD = False
41  CompareRerun = False
42  #-----------OFFLINE CODE---------------------
43  else:
44  #info('In BSMonitoringConfig: NOT isOnline')
45 
52 
53  #none of these 2 work - pretty unsatisfying! - to be fixed asap!!!!!
54  #if inputFlags.DQ.Environment not in ('online', 'tier0', 'tier0Raw'): #, 'tier0ESD'):
55 
58 
59 
63 
64  #from TrigT1MuctpiPhase1.TrigT1MuctpiPhase1Config import L1MuctpiPhase1_on_Data #MUCTPI_AthAlgCfg #L1MuctpiPhase1 #L1MuctpiPhase1_on_Data
65  #CTPMonSeq += L1MuctpiPhase1_on_Data("MUCTPI_AthTool") # MUCTPI_AthAlgCfg(inputFlags) #L1MuctpiPhase1() #L1MuctpiPhase1_on_Data()
66 
67  # check if global muons are on
68  if not inputFlags.Reco.EnableCombinedMuon:
69  if isSimulation:
70  info('In BSMonitoringConfig: rec.doMuon=True & SIM')
71  ProcessRoIBResult = False
72  InclusiveTriggerThresholds = False
73  ProcessMuctpiData = False
74  ProcessMuctpiDataRIO = False
75  CompareRerun = False #True
76  else:
77  info('In BSMonitoringConfig: rec.doMuon=True & DATA')
78  ProcessRoIBResult = False
79  InclusiveTriggerThresholds = False
80  ProcessMuctpiData = False
81  ProcessMuctpiDataRIO = False
82  RunOnESD = False
83  CompareRerun = False
84  else:
85  if isSimulation:
86  info('In BSMonitoringConfig: rec.doMuon=False & SIM')
87  ProcessRoIBResult = True
88  ProcessMuctpiData = False #True
89  ProcessMuctpiDataRIO = False #True
90  RunOnESD = True
91  CompareRerun = False #True
92  else:
93  info('In BSMonitoringConfig: rec.doMuon=False & DATA')
94  ProcessRoIBResult = True
95  ProcessMuctpiData = True
96  ProcessMuctpiDataRIO = False
97  RunOnESD = False
98  CompareRerun = False
99 
100  # ------ DET MASK ---------------------------------------------------
101  from AthenaConfiguration.AutoConfigFlags import GetFileMD
102  metadata = GetFileMD(inputFlags.Input.Files)
103  if len(inputFlags.Input.Files)!=1: print("INFO: more than one file. DetMask check may fail")
104 
105  #else, the det mask check is invalid => don't assume MUCTPI is OUT
106  if 'detectorMask' in metadata:
107  import eformat #eformat includes DetectorMask and is a tdaq package
108  detmask_unformatted=metadata['detectorMask'][0]
109  detmask=f'{detmask_unformatted:032x}' #detmask needs to be 32 hex chars
110  x = eformat.helper.DetectorMask(detmask)
111  if not x.is_set(eformat.helper.SubDetector.TDAQ_MUON_CTP_INTERFACE):
112  ProcessMuctpiData=False
113  print("INFO: MUCTPI is not in det mask; skipping muctpi algos")
114  # ------------------------------------------------------------------
115 
116  from AthenaConfiguration.Enums import LHCPeriod
117  isRun3 = inputFlags.GeoModel.Run is LHCPeriod.Run3
118  BSMonAlg.isRun3 = isRun3
119  if not isRun3:
120  BSMonAlg.ProcessMuctpiData = False
121  BSMonAlg.ProcessMuctpiDataRIO = False
122 
123  BSMonAlg.isSimulation = isSimulation
124  BSMonAlg.ProcessRoIBResult = ProcessRoIBResult
125  BSMonAlg.InclusiveTriggerThresholds = InclusiveTriggerThresholds
126  BSMonAlg.ProcessMuctpiData = ProcessMuctpiData
127  BSMonAlg.ProcessMuctpiDataRIO = ProcessMuctpiDataRIO
128  BSMonAlg.RunOnESD = RunOnESD
129  BSMonAlg.CompareRerun = CompareRerun
130  BSMonAlg.ProcessCTPData = ProcessCTPData
131  DefaultBcIntervalInNs = 24.9507401
132  BSMonAlg.DefaultBcIntervalInNs = DefaultBcIntervalInNs
133  BSMonAlg.BCsPerTurn = 3564
134  LumiBlockTimeCoolFolderName = '/TRIGGER/LUMI/LBLB"'
135  BSMonAlg.LumiBlockTimeCoolFolderName = LumiBlockTimeCoolFolderName
136  #should not use online
137  #FillStateCoolFolderName = '/LHC/DCS/FILLSTATE'
138  #BSMonAlg.FillStateCoolFolderName = FillStateCoolFolderName
139  DataTakingModeCoolFolderName = '/TDAQ/RunCtrl/DataTakingMode'
140  BSMonAlg.DataTakingModeCoolFolderName = DataTakingModeCoolFolderName
141  IgnorePatterns = ["L1_TRT", "L1_ZB", "_AFP", "L1_BPTX", "L1_BCM", "L1_LUCID"]
142  BSMonAlg.IgnorePatterns = IgnorePatterns
143 
144  # add monitoring algorithm to group, with group name and main directory
145  groupName = 'CTPMonitor' # the monitoring group name is also used for the package name
146  BSMonAlg.PackageName = groupName
147  mainDir = 'CT'
148  myGroup = helper.addGroup(BSMonAlg, groupName , mainDir)
149 
150  if isRun3 and ProcessMuctpiData:
151  #add the phase1 algorithm
152  from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import MuCTPIPhase1ByteStreamAlgoCfg
153  result.merge( MuCTPIPhase1ByteStreamAlgoCfg(inputFlags) )
154 
155 
156  if(not isRun3):
157 
158  errorSummaryBinLabels = [
159  "CTP/ROD BCID Offset",
160  "No BCs in Readout",
161  "CTP/MuCTPI BCID Offset",
162  "Wrong Cand Word Number",
163  "Wrong Pt in Mult Word",
164  "Wrong Num of RoI",
165  "No Cand for RoI",
166  "Cand BC Out of Range",
167  "Invalid Lumi Block",
168  "LB Out of Time",
169  "Nanosec > 1e9",
170  "TAP w/out TBP",
171  "TAV w/out TAP",
172  "CTP sim. mismatch",
173  "Incomplete fragment",
174  "Missing orbit pulse",
175  "MuCTPI/noRPC candidate mismatch",
176  "MuCTPI/noTGC candidate mismatch",
177  "RPC/noMuCTPI candidate mismatch",
178  "GC/noMuCTPI candidate mismatch"
179  ]
180  incompleteFragmentTypeBinLabels = [
181  "CTP RIO",
182  "CTP RDO",
183  #"MuCTPI RIO",
184  "MuCTPI RDO",
185  "RoIBResult",
186  "TGC SL RDO",
187  "RPC SL RDO"
188  ]
189 
190  # ERRORS
191  # TProfile or TEfficiency? I guess both work as we only casre about he value not correct errors
192  # CHECK( registerTProfile("errorSummary", "CTP and MuCTPI errors; ; Error rate", 20, 0.5, 20.5, -1, 2) );
193  myGroup.defineHistogram('errorSummaryX,errorSummaryY;errorSummary',title='CTP and MuCTPI errors; ; Error ratio',
194  type='TProfile', path="", xbins=20, xmin=0.5, xmax=20.5, ymin=-1., ymax=2., xlabels=errorSummaryBinLabels, opt='kAlwaysCreate')
195  # 2D
196  # CHECK( registerTH2("errorSummaryPerLumiBlock", "Errors per lumi block; LB number; Errors", 2000, 0.5, 2000.5, 20, 0.5, 20.5) );
197  myGroup.defineHistogram('errorSummaryPerLumiBlockX,errorSummaryPerLumiBlockY;errorSummaryPerLumiBlock',title='Errors per lumi block; LB number; Errors',
198  type='TH2F',path='',xbins=2000,xmin=0.5,xmax=2000.5,ybins=20,ymin=0.5,ymax=20.5,ylabels=errorSummaryBinLabels, opt='kAlwaysCreate')
199  # 1d
200  # CHECK( registerTH1("errorPerLumiBlock", "Number of errors per lumi block; LB number; Errors", 2001, -0.5, 2000.5) );
201  myGroup.defineHistogram('errorPerLumiBlockX;errorPerLumiBlock', title='Number of errors per lumi block; LB number; Errors',
202  path='',xbins=2001,xmin=-0.5,xmax=2000.5,opt='kAlwaysCreate')
203  # CHECK( registerTH1("incompleteFragmentType", "Number of missing fragments per type; Fragment type; Number of incomplete fragments", 8, -0.5, 7.5) );
204  myGroup.defineHistogram('incompleteFragmentTypeX;incompleteFragmentType', title='Number of missing fragments per type; Fragment type; Number of incomplete fragments ',
205  path='',xbins=7,xmin=-0.5,xmax=7.5, xlabels=incompleteFragmentTypeBinLabels, opt='kAlwaysCreate')
206 
207  monCTPPath="/CTP/"
208  # CHECK( registerTH1("deltaBcid", "CTP Data BCID - ROD Header BCID; #DeltaBCID; Entries", 401, -200.5, 200.5) );
209  myGroup.defineHistogram('deltaBcidX;deltaBcid', title='CTP Data BCID - ROD Header BCID; #DeltaBCID; Entries',
210  path=monCTPPath,xbins=401,xmin=-200.5,xmax=200.5,opt='kAlwaysCreate')
211  # CHECK( registerTH1("triggerType", "Trigger Type; Trigger Type; Entries", 256, -0.5, 255.5) );
212  myGroup.defineHistogram('triggerTypeX;triggerType', title='Trigger Type; Trigger Type; Entries',
213  path=monCTPPath,xbins=256,xmin=-0.5,xmax=255.5,opt='kAlwaysCreate')
214  # CHECK( registerTH1("timeSinceLBStart", "Time Since LB Start; Time After New LB (ms); Entries", 1000, -500, 1500) );
215  myGroup.defineHistogram('timeSinceLBStartX;timeSinceLBStart', title='Time Since LB Start; Time After New LB (ms); Entries',
216  path=monCTPPath,xbins=1000,xmin=-500,xmax=1500,opt='kAlwaysCreate')
217  # CHECK( registerTH1("timeUntilLBEnd", "Time Until LB End; Time Until Next LB (ms); Entries", 1000, -500, 1500) );
218  myGroup.defineHistogram('timeUntilLBEndX;timeUntilLBEnd', title='Time Until LB End; Time Until Next LB (ms); Entries',
219  path=monCTPPath,xbins=1000,xmin=-500,xmax=1500,opt='kAlwaysCreate')
220  # CHECK( registerTH1("timeSinceL1A", "Time since last L1A; Time since last L1A (ms); Entries", 2000, -1, 30) );
221  myGroup.defineHistogram('timeSinceL1AX;timeSinceL1A', title='Time since last L1A; Time since last L1A (ms); Entries',
222  path=monCTPPath,xbins=2000,xmin=-1,xmax=30,opt='kAlwaysCreate')
223  # CHECK( registerTH1("turnCounterTimeError", "Error of time based on turn counter and BCID; t_{TC+BCID}-t_{GPS} [#mus]; Entries", 2000, -1000., 1000.) );
224  myGroup.defineHistogram('turnCounterTimeErrorX;turnCounterTimeError', title='Error of time based on turn counter and BCID; t_{TC+BCID}-t_{GPS} [#mus]; Entries',
225  path=monCTPPath,xbins=2000,xmin=-1000.,xmax=1000.,opt='kAlwaysCreate')
226  #patrick check how this one now looks and used to look! - compare to error Profile!
227  # CHECK( registerTProfile("turnCounterTimeErrorVsLb", "Error of (TC+BCID)-based time vs. LB; LB; t_{TC+BCID}-t_{GPS} [#mus]", 2001, -0.5, 2000.5, -1000., 1000.) );
228  myGroup.defineHistogram('turnCounterTimeErrorVsLbX,turnCounterTimeErrorVsLbY,turnCounterTimeErrorVsLbZ;turnCounterTimeErrorVsLb',
229  title='Error of (TC+BCID)-based time vs. LB; LB; t_{TC+BCID}-t_{GPS} [#mus]',
230  type='TProfile2D', path=monCTPPath, xbins=2001, ybins=2001, xmin=-0.5, xmax=2000.5, ymin=-1000., ymax=1000, opt='kAlwaysCreate')
231  # CHECK( registerTH2("pitBC", "CTP BC vs. PIT; PIT; BC", 320, -0.5, 319.5, 127, -63.5, 63.5) );
232  myGroup.defineHistogram('pitBCX,pitBCY;pitBC',title='CTP BC vs. PIT; PIT; BC',
233  type='TH2F',path=monCTPPath, xbins=320,xmin=-0.5,xmax=319.5,ybins=127,ymin=-63.5,ymax=63.5,opt='kAlwaysCreate')
234  # CHECK( registerTH2("pitFirstBC", "First CTP BC vs. PIT; PIT; BC", 320, -0.5, 319.5, 127, -63.5, 63.5) );
235  myGroup.defineHistogram('pitFirstBCX,pitFirstBCY;pitFirstBC',title='First CTP BC vs. PIT; PIT; BC',
236  type='TH2F',path=monCTPPath, xbins=320,xmin=-0.5,xmax=319.5,ybins=127,ymin=-63.5,ymax=63.5,opt='kAlwaysCreate')
237  # CHECK( registerTH1("tav", "Trigger Items After Veto; CTP TAV; Entries", 512, -0.5, 511.5) );
238  myGroup.defineHistogram('tavX;tav', title='Trigger Items After Veto; CTP TAV; Entries',
239  path=monCTPPath,xbins=512,xmin=-0.5,xmax=511.5,opt='kAlwaysCreate')
240  # CHECK( registerTH1("ctpStatus1", "CTP Status Word 1; Bit; Number of times ON", 24, -0.5, 23.5) );
241  myGroup.defineHistogram('ctpStatus1X;ctpStatus1', title='CTP Status Word 1; Bit; Number of times ON',
242  path=monCTPPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
243  # CHECK( registerTH1("ctpStatus2", "CTP Status Word 2; Bit; Number of times ON", 24, -0.5, 23.5) );
244  myGroup.defineHistogram('ctpStatus2X;ctpStatus2', title='CTP Status Word 2; Bit; Number of times ON',
245  path=monCTPPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
246  # CHECK( registerTH1("l1ItemsBPSimMismatch","Sim mismatch L1 Items before prescale", 512, 0, 512) );
247  myGroup.defineHistogram('l1ItemsBPSimMismatchX;l1ItemsBPSimMismatch', title='Sim mismatch L1 Items before prescale',
248  path=monCTPPath,xbins=512,xmin=0,xmax=512,opt='kAlwaysCreate')
249  # CHECK( registerTH1("l1ItemsBPSimMismatchItems","Sim mismatch L1 Items before prescale, mismatched ones only", 512, 0, 512) );
250  myGroup.defineHistogram('l1ItemsBPSimMismatchItemsX;l1ItemsBPSimMismatchItems', title='Sim mismatch L1 Items before prescale, mismatched ones only',
251  path=monCTPPath,xbins=512,xmin=0,xmax=512,opt='kAlwaysCreate')
252 
253 
254 
255 
256  monMUCTPIPath="/MUCTPI/"
257  # CHECK( registerTH1("nCandidates", "Number of MuCTPI candidates from mult word; Multiplicity; Entries", 11, -0.5, 10.5) );
258  myGroup.defineHistogram('nCandidatesX;nCandidates', title='Number of MuCTPI candidates from mult word; Multiplicity; Entries',
259  path=monMUCTPIPath,xbins=11,xmin=-0.5,xmax=10.5,opt='kAlwaysCreate')
260  # CHECK( registerTH1("nCandidatesDataWord", "Number of MuCTPI candidates from data word; Multiplicity; Entries", 100, -0.5, 99.5) );
261  myGroup.defineHistogram('nCandidatesDataWordX;nCandidatesDataWord', title='Number of MuCTPI candidates from data word; Multiplicity; Entries',
262  path=monMUCTPIPath,xbins=100,xmin=-0.5,xmax=99.5,opt='kAlwaysCreate')
263  # CHECK( registerTH1("pt", "Candidate p_{T} distribution from mult word; p_{T} threshold; Entries", 6, 0.5, 6.5) );
264  myGroup.defineHistogram('ptX;pt', title='Candidate p_{T} distribution from mult word; p_{T} threshold; Entries',
265  path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,opt='kAlwaysCreate')
266  # CHECK( registerTH2("nCandidatesPt", "Number of MuCTPI candidates from mult word vs p_{T}; p_{T} threshold; MuCTPI candidates", 6, 0.5, 6.5, 8, -0.5, 7.5) );
267  myGroup.defineHistogram('nCandidatesPtX,nCandidatesPtY;nCandidatesPt', title='Number of MuCTPI candidates from mult word vs p_{T}; p_{T} threshold; MuCTPI candidates',
268  type='TH2F',path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,ybins=8,ymin=-0.5,ymax=7.5,opt='kAlwaysCreate')
269  # CHECK( registerTH2("nCandidatesDataWordPt", "Number of MuCTPI candidates from data word vs p_{T}; p_{T} threshold; MuCTPI candidates", 6, 0.5, 6.5, 25, -0.5, 99.5) );
270  myGroup.defineHistogram('nCandidatesDataWordPtX,nCandidatesDataWordPtY;nCandidatesDataWordPt', title='Number of MuCTPI candidates from data word vs p_{T}; p_{T} threshold; MuCTPI candidates',
271  type='TH2F',path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,ybins=8,ymin=-0.5,ymax=7.5,opt='kAlwaysCreate')
272  # CHECK( registerTH1("nCandidatesMictpMioct", "Diff between MICTP and MIOCT candidates (same BC); MICTP - MIOCT; Entries", 21, -10.5, 10.5) );
273  myGroup.defineHistogram('nCandidatesMictpMioctX;nCandidatesMictpMioct', title='Diff between MICTP and MIOCT candidates (same BC); MICTP - MIOCT; Entries',
274  path=monMUCTPIPath,xbins=21,xmin=-10.5,xmax=12.5,opt='kAlwaysCreate')
275  # CHECK( registerTH1("bcidMictpMioct", "BCID diff between MICTP and all MIOCT candidate words; MIOCT - MICTP; Entries", 8, -3.5, 4.5) );
276  myGroup.defineHistogram('bcidMictpMioctX;bcidMictpMioct', title='BCID diff between MICTP and all MIOCT candidate words; MIOCT - MICTP; Entries',
277  path=monMUCTPIPath,xbins=8,xmin=-3.5,xmax=4.5,opt='kAlwaysCreate')
278  # CHECK( registerTH1("bcidMictpHeader", "BCID Diff between MICTP and ROD header; MICTP - ROD header; Entries", 15, -7.5, 7.5) );
279  #myGroup.defineHistogram('bcidMictpHeaderX;bcidMictpHeader', title='BCID Diff between MICTP and ROD header; MICTP - ROD header; Entries',
280  # path=monMUCTPIPath,xbins=15,xmin=-7.5,xmax=7.5,opt='kAlwaysCreate')
281  # CHECK( registerTH1("muctpiStatus1", "MuCTPI Status Word 1; Bit; Number of times ON", 24, -0.5, 23.5) );
282  #myGroup.defineHistogram('muctpiStatus1X;muctpiStatus1', title='MuCTPI Status Word 1; Bit; Number of times ON',
283  # path=monMUCTPIPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
284  # CHECK( registerTH1("muctpiStatus2", "MuCTPI Status Word 2; Bit; Number of times ON", 24, -0.5, 23.5) );
285  #myGroup.defineHistogram('muctpiStatus2X;muctpiStatus2', title='MuCTPI Status Word 2; Bit; Number of times ON',
286  # path=monMUCTPIPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
287 
288  # //RoI numbers
289  # CHECK( registerTH2("barrelRoiSectorID", "MIOCT RoI Number vs Barrel Sector ID (Trigger BC); Sector ID; RoI Number", 64, -0.5, 63.5, 32, -0.5, 31.5) );
290  myGroup.defineHistogram('barrelRoiSectorIDX,barrelRoiSectorIDY;barrelRoiSectorID', title='MIOCT RoI Number vs Barrel Sector ID (Trigger BC); Sector ID; RoI Number',
291  type='TH2F',path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
292  # CHECK( registerTH2("endcapRoiSectorID", "MIOCT RoI Number vs Endcap Sector ID (Trigger BC); Sector ID; RoI Number", 96, -0.5, 95.5, 32, -0.5, 31.5) );
293  myGroup.defineHistogram('endcapRoiSectorIDX,endcapRoiSectorIDY;endcapRoiSectorID', title='MIOCT RoI Number vs Endcap Sector ID (Trigger BC); Sector ID; RoI Number',
294  type='TH2F',path=monMUCTPIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
295  # CHECK( registerTH2("forwardRoiSectorID", "MIOCT RoI Number vs Forward Sector ID (Trigger BC); Sector ID; RoI Number", 48, -0.5, 47.5, 32, -0.5, 31.5) );
296  myGroup.defineHistogram('forwardRoiSectorIDX,forwardRoiSectorIDY;forwardRoiSectorID', title='MIOCT RoI Number vs Forward Sector ID (Trigger BC); Sector ID; RoI Number',
297  type='TH2F',path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
298  # CHECK( registerTH2("barrelRoiSectorIDAll", "MIOCT RoI Number vs Barrel Sector ID (All BC); Sector ID; RoI Number", 64, -0.5, 63.5, 32, -0.5, 31.5) );
299  myGroup.defineHistogram('barrelRoiSectorIDAllX,barrelRoiSectorIDAllY;barrelRoiSectorIDAll', title='MIOCT RoI Number vs Barrel Sector ID (All BC); Sector ID; RoI Number',
300  type='TH2F',path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
301  # CHECK( registerTH2("endcapRoiSectorIDAll", "MIOCT RoI Number vs Endcap Sector ID (All BC); Sector ID; RoI Number", 96, -0.5, 95.5, 32, -0.5, 31.5) );
302  myGroup.defineHistogram('endcapRoiSectorIDAllX,endcapRoiSectorIDAllY;endcapRoiSectorIDAll', title='MIOCT RoI Number vs Endcap Sector ID (All BC); Sector ID; RoI Number',
303  type='TH2F',path=monMUCTPIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
304  # CHECK( registerTH2("forwardRoiSectorIDAll", "MIOCT RoI Number vs Forward Sector ID (All BC); Sector ID; RoI Number", 48, -0.5, 47.5, 32, -0.5, 31.5) );
305  myGroup.defineHistogram('forwardRoiSectorIDAllX,forwardRoiSectorIDAllY;forwardRoiSectorIDAll', title='MIOCT RoI Number vs Forward Sector ID (All BC); Sector ID; RoI Number',
306  type='TH2F',path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
307 
308  # //Candidate multiplicity within sectors
309  # CHECK( registerTH2("barrelNCandSectorID", "MIOCT Candidate mult vs Sector ID (barrel); Sector ID; Candidates", 64, -0.5, 63.5, 8, -0.5, 7.5) );
310  myGroup.defineHistogram('barrelNCandSectorIDX,barrelNCandSectorIDY;barrelNCandSectorID', title='MIOCT Candidate mult vs Sector ID (barrel); Sector ID; Candidates',
311  type='TH2F',path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=8,ymin=-0.5,ymax=7.5,opt='kAlwaysCreate')
312  # CHECK( registerTH2("endcapNCandSectorID", "MIOCT Candidate mult vs Sector ID (endcap); Sector ID; Candidates", 96, -0.5, 95.5, 8, -0.5, 7.5) );
313  myGroup.defineHistogram('endcapNCandSectorIDX,endcapNCandSectorIDY;endcapNCandSectorID', title='MIOCT Candidate mult vs Sector ID (endcap); Sector ID; Candidates',
314  type='TH2F',path=monMUCTPIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=8,ymin=-0.5,ymax=7.5,opt='kAlwaysCreate')
315  # CHECK( registerTH2("forwardNCandSectorID", "MIOCT Candidate mult vs Sector ID (forward); Sector ID; Candidates", 48, -0.5, 47.5, 8, -0.5, 7.5) );
316  myGroup.defineHistogram('forwardNCandSectorIDX,forwardNCandSectorIDY;forwardNCandSectorID', title='MIOCT Candidate mult vs Sector ID (forward); Sector ID; Candidates',
317  type='TH2F',path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=8,ymin=-0.5,ymax=7.5,opt='kAlwaysCreate')
318 
319  # //Overlap regions
320  # CHECK( registerTH2("barrelSectorIDOverlapBits", "Barrel Sector ID vs overlap bits; Sector ID; Overlap bits", 64, -0.5, 63.5, 3, 0.5, 3.5) );
321  myGroup.defineHistogram('barrelSectorIDOverlapBitsX,barrelSectorIDOverlapBitsY;barrelSectorIDOverlapBits', title='Barrel Sector ID vs overlap bits; Sector ID; Overlap bits',
322  type='TH2F',path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=3,ymin=0.5,ymax=3.5,opt='kAlwaysCreate')
323  # CHECK( registerTH1("endcapSectorIDOverlapBit", "Endcap Sector ID vs number of candidates with overlap; Sector ID; Candidates", 48, -0.5, 47.5) );
324  myGroup.defineHistogram('endcapSectorIDOverlapBitX;endcapSectorIDOverlapBit', title='Endcap Sector ID vs number of candidates with overlap; Sector ID; Candidates',
325  path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,opt='kAlwaysCreate')
326 
327  # //Sector occupancy
328  # CHECK( registerTH1("barrelSectorID", "Barrel Sector ID (Trigger BC); Sector ID; Candidates", 64, -0.5, 63.5) );
329  myGroup.defineHistogram('barrelSectorIDX;barrelSectorID', title='Barrel Sector ID (Trigger BC); Sector ID; Candidates',
330  path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,opt='kAlwaysCreate')
331  # CHECK( registerTH1("endcapSectorID", "Endcap Sector ID (Trigger BC); Sector ID; Candidates", 96, -0.5, 95.5) );
332  myGroup.defineHistogram('endcapSectorIDX;endcapSectorID', title='Endcap Sector ID (Trigger BC); Sector ID; Candidates',
333  path=monMUCTPIPath,xbins=96,xmin=-0.5,xmax=95.5,opt='kAlwaysCreate')
334  # CHECK( registerTH1("forwardSectorID", "Forward Sector ID (Trigger BC); Sector ID; Candidates", 48, -0.5, 47.5) );
335  myGroup.defineHistogram('forwardSectorIDX;forwardSectorID', title='Forward Sector ID (Trigger BC); Sector ID; Candidates',
336  path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,opt='kAlwaysCreate')
337  # CHECK( registerTH1("barrelSectorIDAll", "Barrel Sector ID (All BC); Sector ID; Candidates", 64, -0.5, 63.5) );
338  myGroup.defineHistogram('barrelSectorIDAllX;barrelSectorIDAll', title='Barrel Sector ID (All BC); Sector ID; Candidates',
339  path=monMUCTPIPath,xbins=64,xmin=-0.5,xmax=63.5,opt='kAlwaysCreate')
340  # CHECK( registerTH1("endcapSectorIDAll", "Endcap Sector ID (All BC); Sector ID; Candidates", 96, -0.5, 95.5) );
341  myGroup.defineHistogram('endcapSectorIDAllX;endcapSectorIDAll', title='Endcap Sector ID (All BC); Sector ID; Candidates',
342  path=monMUCTPIPath,xbins=96,xmin=-0.5,xmax=95.5,opt='kAlwaysCreate')
343  # CHECK( registerTH1("forwardSectorIDAll", "Forward Sector ID (All BC); Sector ID; Candidates", 48, -0.5, 47.5) );
344  myGroup.defineHistogram('forwardSectorIDAllX;forwardSectorIDAll', title='Forward Sector ID (All BC); Sector ID; Candidates',
345  path=monMUCTPIPath,xbins=48,xmin=-0.5,xmax=47.5,opt='kAlwaysCreate')
346 
347  # //Candidate word pT
348  # CHECK( registerTH1("barrelPt", "Barrel candidate p_{T} (all candidates); p_{T} threshold; Candidates", 6, 0.5, 6.5) );
349  myGroup.defineHistogram('barrelPtX;barrelPt', title='Barrel candidate p_{T} (all candidates); p_{T} threshold; Candidates',
350  path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,opt='kAlwaysCreate')
351  # CHECK( registerTH1("endcapPt", "Endcap candidate p_{T} (all candidates); p_{T} threshold; Candidates", 6, 0.5, 6.5) );
352  myGroup.defineHistogram('endcapPtX;endcapPt', title='Endcap candidate p_{T} (all candidates); p_{T} threshold; Candidates',
353  path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,opt='kAlwaysCreate')
354  # CHECK( registerTH1("forwardPt", "Forward candidate p_{T} (all candidates); p_{T} threshold; Candidates", 6, 0.5, 6.5) );
355  myGroup.defineHistogram('forwardPtX;forwardPt', title='Forward candidate p_{T} (all candidates); p_{T} threshold; Candidates',
356  path=monMUCTPIPath,xbins=6,xmin=0.5,xmax=6.5,opt='kAlwaysCreate')
357  nCandidates_secLocBinabels = [
358  "Barrel",
359  "Endcap",
360  "Forward"
361  ]
362  # //Number of candidates in each region
363  # CHECK( registerTH1("nCandidates_secLoc", "All candidates by sector location; Sector location; Candidates", 3, -0.5, 2.5) );
364  myGroup.defineHistogram('nCandidates_secLocX;nCandidates_secLoc', title='"All candidates by sector location; Sector location; Candidates',
365  path=monMUCTPIPath,xbins=3,xmin=-0.5,xmax=2.5,xlabels=nCandidates_secLocBinabels,opt='kAlwaysCreate')
366  #
367  # //Plots for comparing MuCTPI output to output of RPC and TGC SL
368  # CHECK( registerTH2("muctpiNoRPCCandfound", "MuCTPI BA candidate with no equivalent candidate in RPC SL r/o, Sector ID vs. RoI number", 30, -0.5, 29.5, 64, -0.5, 63.5) );
369  myGroup.defineHistogram('muctpiNoRPCCandfoundX,muctpiNoRPCCandfoundY;muctpiNoRPCCandfound', title='MuCTPI BA candidate with no equivalent candidate in RPC SL r/o, Sector ID vs. RoI number',
370  type='TH2F',path=monMUCTPIPath,xbins=30,xmin=-0.5,xmax=29.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
371  # CHECK( registerTH2("rpcNoMuCTPICandfound", "RPC SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number", 30, -0.5, 29.5, 64, -0.5, 63.5) );
372  myGroup.defineHistogram('rpcNoMuCTPICandfoundX,rpcNoMuCTPICandfoundY;rpcNoMuCTPICandfound', title='RPC SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number',
373  type='TH2F',path=monMUCTPIPath,xbins=30,xmin=-0.5,xmax=29.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
374  #
375  # CHECK( registerTH2("muctpiNoTGCecCandfound", "MuCTPI EC candidate with no equivalent candidate in TGC SL r/o, Sector ID vs. RoI number", 150, -0.5, 149.5, 100, -0.5, 99.5) );
376  myGroup.defineHistogram('muctpiNoTGCecCandfoundX,muctpiNoTGCecCandfoundY;muctpiNoTGCecCandfound', title='MuCTPI EC candidate with no equivalent candidate in TGC SL r/o, Sector ID vs. RoI number',
377  type='TH2F',path=monMUCTPIPath,xbins=150,xmin=-0.5,xmax=149.5,ybins=100,ymin=-0.5,ymax=99.5,opt='kAlwaysCreate')
378  # CHECK( registerTH2("tgcecNoMuCTPICandfound", "TGC EC SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number", 150, -0.5, 149.5, 100, -0.5, 99.5) );
379  myGroup.defineHistogram('tgcecNoMuCTPICandfoundX,tgcecNoMuCTPICandfoundY;tgcecNoMuCTPICandfound', title='TGC EC SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number',
380  type='TH2F',path=monMUCTPIPath,xbins=150,xmin=-0.5,xmax=149.5,ybins=100,ymin=-0.5,ymax=99.5,opt='kAlwaysCreate')
381  # CHECK( registerTH2("muctpiNoTGCfwCandfound", "MuCTPI FW candidate with no equivalent candidate in TGC SL r/o, Sector ID vs. RoI number", 64, -0.5, 63.5, 50, -0.5, 49.5) );
382  myGroup.defineHistogram('muctpiNoTGCfwCandfoundX,muctpiNoTGCfwCandfoundY;muctpiNoTGCfwCandfound', title='MuCTPI FW candidate with no equivalent candidate in TGC SL r/o, Sector ID vs. RoI number',
383  type='TH2F',path=monMUCTPIPath,xbins=150,xmin=-0.5,xmax=149.5,ybins=100,ymin=-0.5,ymax=99.5,opt='kAlwaysCreate')
384  # CHECK( registerTH2("tgcfwNoMuCTPICandfound", "TGC FW SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number", 64, -0.5, 63.5, 50, -0.5, 49.5) );
385  myGroup.defineHistogram('tgcfwNoMuCTPICandfoundX,tgcfwNoMuCTPICandfoundY;tgcfwNoMuCTPICandfound', title='TGC FW SL r/o candidate with no equivalent candidate in MuCTPI r/o, Sector ID vs. RoI number',
386  type='TH2F',path=monMUCTPIPath,xbins=150,xmin=-0.5,xmax=149.5,ybins=100,ymin=-0.5,ymax=99.5,opt='kAlwaysCreate')
387 
388  monCTPMUCTPIPath="/CTPMUCTPI/"
389  # CHECK( registerTH1("headerL1IdDifference", "ROD header LVL1 ID CTP - MuCTPI; #DeltaL1ID; Entries", 101, -50.5, 50.5) );
390  myGroup.defineHistogram('headerL1IdDifferenceX;headerL1IdDifference', title='ROD header LVL1 ID CTP - MuCTPI; #DeltaL1ID; Entries',
391  path=monCTPMUCTPIPath,xbins=101,xmin=-50.5,xmax=50.5,opt='kAlwaysCreate')
392  # CHECK( registerTH1("headerBCIDDifference", "ROD header BCID CTP - MuCTPI; #DeltaBCID; Entries", 401, -200.5, 200.5) );
393  myGroup.defineHistogram('headerBCIDDifferenceX;headerBCIDDifference', title='ROD header BCID CTP - MuCTPI; #DeltaBCID; Entries',
394  path=monCTPMUCTPIPath,xbins=401,xmin=-200.5,xmax=200.5,opt='kAlwaysCreate')
395  # CHECK( registerTH1("bcidDifference", "BCID CTP - MICTP; #DeltaBCID; Entries", 15, -7.5, 7.5) );
396  myGroup.defineHistogram('bcidDifferenceX;bcidDifference', title='BCID CTP - MICTP; #DeltaBCID; Entries',
397  path=monCTPMUCTPIPath,xbins=15,xmin=-7.5,xmax=7.5,opt='kAlwaysCreate')
398 
399  monROIPath="/ROI/"
400  #keeping histo definitions for now commented. May re-include in upcoming update
401  # //RoI eta / phi
402  # CHECK( registerTH2("roiEtaPhi","Coordinates of all RoIs; #eta; #phi",32,-2.5,2.5,32,-TMath::Pi(),TMath::Pi()) );
403  #myGroup.defineHistogram('roiEtaPhiX,roiEtaPhiY;roiEtaPhi', title='Coordinates of all RoIs; #eta; #phi',
404  # type='TH2F',path=monROIPath,xbins=32,xmin=-2.5,xmax=2.5,ybins=32,ymin=-math.pi,ymax=math.pi,opt='kAlwaysCreate')
405  # CHECK( registerTH1("roiEta","#eta of all RoI's; #eta; Entries",32,-2.5,2.5) );
406  #myGroup.defineHistogram('roiEtaX;roiEta', title="#eta of all RoI's; #eta; Entries",
407  # path=monROIPath,xbins=32,xmin=-2.5,xmax=2.5,opt='kAlwaysCreate')
408  # CHECK( registerTH1("roiPhi","#phi of all RoI's; #phi; Entries",32,-TMath::Pi(),TMath::Pi()) );
409  #myGroup.defineHistogram('roiPhiX;roiPhi', title="#phi of all RoI's; #phi; Entries",
410  # path=monROIPath,xbins=32,xmin=-math.pi,xmax=math.pi,opt='kAlwaysCreate')
411  #
412  # //Sector vs. RoI
413  # CHECK( registerTH2("barrelSectorIDRoi","Sector ID vs. RoI for barrel muons (matched cand only); Sector ID; RoI", 64,-0.5,63.5,32,-0.5,31.5) );
414  myGroup.defineHistogram('barrelSectorIDRoiX,barrelSectorIDRoiY;barrelSectorIDRoi', title='Sector ID vs. RoI for barrel muons (matched cand only); Sector ID; RoI',
415  type='TH2F',path=monROIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
416  # CHECK( registerTH2("endcapSectorIDRoi","Sector ID vs. RoI for endcap muons (matched cand only); Sector ID; RoI", 96,-0.5,95.5,32,-0.5,31.5) );
417  myGroup.defineHistogram('endcapSectorIDRoiX,endcapSectorIDRoiY;endcapSectorIDRoi', title='Sector ID vs. RoI for endcap muons (matched cand only); Sector ID; RoI',
418  type='TH2F',path=monROIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
419  # CHECK( registerTH2("forwardSectorIDRoi","Sector ID vs. RoI for forward muons (matched cand only); Sector ID; RoI", 48,-0.5,47.5,32,-0.5,31.5) );
420  myGroup.defineHistogram('forwardSectorIDRoiX,forwardSectorIDRoiY;forwardSectorIDRoi', title='Sector ID vs. RoI for forward muons (matched cand only); Sector ID; RoI',
421  type='TH2F',path=monROIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
422  #
423  # //Sector vs. RoI Eta
424  # CHECK( registerTH2("barrelSectorIDRoiEta","Sector ID vs. RoI #eta for barrel muons (matched cand only); Sector ID; #eta", 64,-0.5,63.5,32,-2.5,2.5) );
425  #myGroup.defineHistogram('barrelSectorIDRoiEtaX,barrelSectorIDRoiEtaY;barrelSectorIDRoiEta', title='Sector ID vs. RoI #eta for barrel muons (matched cand only); Sector ID; #eta',
426  # type='TH2F',path=monROIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
427  myGroup.defineHistogram('barrelSectorIDRoiEtaX;barrelSectorIDRoiEta', title='Sector ID for barrel muons (matched cand only); Sector ID',
428  path=monROIPath,xbins=64,xmin=-0.5,xmax=63.5,opt='kAlwaysCreate')
429  # CHECK( registerTH2("endcapSectorIDRoiEta","Sector ID vs. RoI #eta for endcap muons (matched cand only); Sector ID; #eta", 96,-0.5,95.5,32,-2.5,2.5) );
430  #myGroup.defineHistogram('endcapSectorIDRoiEtaX,endcapSectorIDRoiEtaY;endcapSectorIDRoiEta', title='Sector ID vs. RoI #eta for endcap muons (matched cand only); Sector ID; #eta',
431  # type='TH2F',path=monROIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
432  myGroup.defineHistogram('endcapSectorIDRoiEtaX;endcapSectorIDRoiEta', title='Sector ID for endcap muons (matched cand only); Sector ID',
433  path=monROIPath,xbins=96,xmin=-0.5,xmax=95.5,opt='kAlwaysCreate')
434  # CHECK( registerTH2("forwardSectorIDRoiEta","Sector ID vs. RoI #eta for forward muons (matched cand only); Sector ID; #eta", 48,-0.5,47.5,32,-2.5,2.5) );
435  #myGroup.defineHistogram('forwardSectorIDRoiEtaX,forwardSectorIDRoiEtaY;forwardSectorIDRoiEta', title='Sector ID vs. RoI #eta for forward muons (matched cand only); Sector ID; #eta',
436  # type='TH2F',path=monROIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
437  myGroup.defineHistogram('forwardSectorIDRoiEtaX;forwardSectorIDRoiEta', title='Sector IDfor forward muons (matched cand only); Sector ID',
438  path=monROIPath,xbins=48,xmin=-0.5,xmax=47.5,opt='kAlwaysCreate')
439  #
440  # //Sector vs. RoI Phi
441  # CHECK( registerTH2("barrelSectorIDRoiPhi","Sector ID vs. RoI #phi for barrel (matched cand only); Sector ID; #phi", 64,-0.5,63.5,32,-TMath::Pi(),TMath::Pi()) );
442  #myGroup.defineHistogram('barrelSectorIDRoiPhiX,barrelSectorIDRoiPhiY;barrelSectorIDRoiPhi', title='Sector ID vs. RoI #phi for barrel (matched cand only); Sector ID; #phi',
443  # type='TH2F',path=monROIPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-math.pi,ymax=math.pi,opt='kAlwaysCreate')
444  myGroup.defineHistogram('barrelSectorIDRoiPhiX;barrelSectorIDRoiPhi', title='Sector ID for barrel (matched cand only); Sector ID',
445  type='TH2F',path=monROIPath,xbins=64,xmin=-0.5,xmax=63.5,opt='kAlwaysCreate')
446  # CHECK( registerTH2("endcapSectorIDRoiPhi","Sector ID vs. RoI #phi for endcap (matched cand only); Sector ID; #phi", 96,-0.5,95.5,32,-TMath::Pi(),TMath::Pi()) );
447  #myGroup.defineHistogram('endcapSectorIDRoiPhiX,endcapSectorIDRoiPhiY;endcapSectorIDRoiPhi', title='Sector ID vs. RoI #phi for endcap (matched cand only); Sector ID; #phi',
448  # type='TH2F',path=monROIPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=32,ymin=-math.pi,ymax=math.pi,opt='kAlwaysCreate')
449  myGroup.defineHistogram('endcapSectorIDRoiPhiX;endcapSectorIDRoiPhi', title='Sector ID for endcap (matched cand only); Sector ID',
450  path=monROIPath,xbins=96,xmin=-0.5,xmax=95.5,opt='kAlwaysCreate')
451  # CHECK( registerTH2("forwardSectorIDRoiPhi","Sector ID vs. RoI #phi for forward (matched cand only); Sector ID; #phi", 48,-0.5,47.5,32,-TMath::Pi(),TMath::Pi()) );
452  #myGroup.defineHistogram('forwardSectorIDRoiPhiX,forwardSectorIDRoiPhiY;forwardSectorIDRoiPhi', title='Sector ID vs. RoI #phi for forward (matched cand only); Sector ID; #phi',
453  # type='TH2F',path=monROIPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=32,ymin=-math.pi,ymax=math.pi,opt='kAlwaysCreate')
454  myGroup.defineHistogram('forwardSectorIDRoiPhiX;forwardSectorIDRoiPhi', title='Sector ID for forward (matched cand only); Sector ID',
455  path=monROIPath,xbins=48,xmin=-0.5,xmax=47.5,opt='kAlwaysCreate')
456 
457  else: #=> is Run3 here below
458 
459  errorSummaryCTPBinLabels = [ # .cxx indices
460  "CTP/ROD BCID Offset", #1
461  "No BCs in Readout", #2
462  "Invalid Lumi Block", #3
463  "LB Out of Time", #4
464  "Nanosec > 1e9", #5
465  "TAP w/out TBP", #6
466  "TAV w/out TAP", #7
467  "CTP sim. mismatch", #8
468  "Incomplete fragment", #9
469  "Missing orbit pulse" #10
470  ]
471  incompleteFragmentTypeBinLabels = [
472  "CTP RIO",
473  "CTP RDO",
474  #"MuCTPI RIO",
475  "MuCTPI RDO",
476  "RoIBResult",
477  "TGC SL RDO",
478  "RPC SL RDO"
479  ]
480 
481  # ERRORS - COMMON
482 
483  # 1d
484  # CHECK( registerTH1("errorPerLumiBlock", "Number of errors per lumi block; LB number; Errors", 2001, -0.5, 2000.5) );
485  myGroup.defineHistogram('errorPerLumiBlockCTPX;errorPerLumiBlock', title='Number of errors per lumi block; LB number; Errors',
486  path='',xbins=2001,xmin=-0.5,xmax=2000.5,opt='kAlwaysCreate')
487 
488  # -------------------- CTP
489 
490  monPath="/CTP/"
491  myGroup.defineHistogram('errorSummaryCTPX,errorSummaryCTPY;errorSummaryCTP',title='CTP errors; ; Error ratio', type='TProfile', path=monPath, xbins=len(errorSummaryCTPBinLabels), xmin=0.5, xmax=len(errorSummaryCTPBinLabels)+0.5, ymin=-1., ymax=2., xlabels=errorSummaryCTPBinLabels, opt='kAlwaysCreate')
492  myGroup.defineHistogram('errorSummaryPerLumiBlockCTPX,errorSummaryPerLumiBlockCTPY;errorSummaryPerLumiBlockCTP',title='Errors per lumi block; LB number; Errors', type='TH2F', path=monPath, xbins=2000, xmin=0.5, xmax=2000.5, ybins=len(errorSummaryCTPBinLabels), ymin=0.5, ymax=len(errorSummaryCTPBinLabels)+0.5, ylabels=errorSummaryCTPBinLabels, opt='kAlwaysCreate')
493  myGroup.defineHistogram('incompleteFragmentTypeX;incompleteFragmentType', title='Number of missing fragments per type; Fragment type; Number of incomplete fragments ', path=monPath, xbins=7, xmin=-0.5, xmax=7.5, xlabels=incompleteFragmentTypeBinLabels, opt='kAlwaysCreate')
494  myGroup.defineHistogram('deltaBcidX;deltaBcid', title='CTP Data BCID - ROD Header BCID; #DeltaBCID; Entries',
495  path=monPath,xbins=401,xmin=-200.5,xmax=200.5,opt='kAlwaysCreate')
496  myGroup.defineHistogram('triggerTypeX;triggerType', title='Trigger Type; Trigger Type; Entries',
497  path=monPath,xbins=256,xmin=-0.5,xmax=255.5,opt='kAlwaysCreate')
498  myGroup.defineHistogram('timeSinceLBStartX;timeSinceLBStart', title='Time Since LB Start; Time After New LB (ms); Entries',
499  path=monPath,xbins=1000,xmin=-500,xmax=1500,opt='kAlwaysCreate')
500  myGroup.defineHistogram('timeUntilLBEndX;timeUntilLBEnd', title='Time Until LB End; Time Until Next LB (ms); Entries',
501  path=monPath,xbins=1000,xmin=-500,xmax=1500,opt='kAlwaysCreate')
502  myGroup.defineHistogram('timeSinceL1AX;timeSinceL1A', title='Time since last L1A; Time since last L1A (ms); Entries',
503  path=monPath,xbins=2000,xmin=-1,xmax=30,opt='kAlwaysCreate')
504  myGroup.defineHistogram('turnCounterTimeErrorX;turnCounterTimeError', title='Error of time based on turn counter and BCID; t_{TC+BCID}-t_{GPS} [#mus]; Entries',
505  path=monPath,xbins=2000,xmin=-1000.,xmax=1000.,opt='kAlwaysCreate')
506  #patrick check how this one now looks and used to look! - compare to error Profile!
507  myGroup.defineHistogram('turnCounterTimeErrorVsLbX,turnCounterTimeErrorVsLbY,turnCounterTimeErrorVsLbZ;turnCounterTimeErrorVsLb',
508  title='Error of (TC+BCID)-based time vs. LB; LB; t_{TC+BCID}-t_{GPS} [#mus]',
509  type='TProfile2D', path=monPath, xbins=2001, ybins=2001, xmin=-0.5, xmax=2000.5, ymin=-1000., ymax=1000, opt='kAlwaysCreate')
510  myGroup.defineHistogram('pitBCX,pitBCY;pitBC',title='CTP BC vs. PIT; PIT; BC',
511  type='TH2F',path=monPath, xbins=320,xmin=-0.5,xmax=319.5,ybins=127,ymin=-63.5,ymax=63.5,opt='kAlwaysCreate')
512  myGroup.defineHistogram('pitFirstBCX,pitFirstBCY;pitFirstBC',title='First CTP BC vs. PIT; PIT; BC',
513  type='TH2F',path=monPath, xbins=320,xmin=-0.5,xmax=319.5,ybins=127,ymin=-63.5,ymax=63.5,opt='kAlwaysCreate')
514  myGroup.defineHistogram('tavX;tav', title='Trigger Items After Veto; CTP TAV; Entries',
515  path=monPath,xbins=512,xmin=-0.5,xmax=511.5,opt='kAlwaysCreate')
516  myGroup.defineHistogram('ctpStatus1X;ctpStatus1', title='CTP Status Word 1; Bit; Number of times ON',
517  path=monPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
518  myGroup.defineHistogram('ctpStatus2X;ctpStatus2', title='CTP Status Word 2; Bit; Number of times ON',
519  path=monPath,xbins=24,xmin=-0.5,xmax=23.5,opt='kAlwaysCreate')
520  myGroup.defineHistogram('l1ItemsBPSimMismatchX;l1ItemsBPSimMismatch', title='Sim mismatch L1 Items before prescale',
521  path=monPath,xbins=512,xmin=0,xmax=512,opt='kAlwaysCreate')
522  myGroup.defineHistogram('l1ItemsBPSimMismatchItemsX;l1ItemsBPSimMismatchItems', title='Sim mismatch L1 Items before prescale, mismatched ones only', path=monPath,xbins=512,xmin=0,xmax=512,opt='kAlwaysCreate')
523 
524  errorSummaryMUCTPIBinLabels = [ #cxx indices
525  "Event - MuCTPI BCID Mismatch", #1
526  "Wrong Cand Word Number", #2
527  "Wrong TOB Word Number", #3
528  "Unequal Cand - TOB Number", #4
529  "Mismatch (Eta,Phi) Cand - TOB", #5
530  "Incomplete fragment", #6
531  "MuCTPI/noRPC candidate mismatch", #7
532  "MuCTPI/noTGC candidate mismatch", #8
533  "RPC/noMuCTPI candidate mismatch", #9
534  "TGC/noMuCTPI candidate mismatch" #10
535  ]
536 
537  statusDataWordMUCTPIBinLabels = [ #cxx indices - ROD format indices
538  "Event# mismatch (MSPA vs TRP) (central)", #1 #0
539  "Event# mismatch (MSPC vs TRP) (central)", #2 #1
540  "Event# mismatch (MSPA vs MSPC)" , #3 #2
541  "BCID mismatch (TRP vs MSPA) (central)" , #4 #3
542  "BCID mismatch (TRP vs MSPC) (central)" , #5 #4
543  "BCID mismatch (MSPA vs MSPC)" , #6 #5
544  "MSPA multiplicity LVDS link CRC error" , #7 #6
545  "MSPC multiplicity LVDS link CRC error" , #8 #7
546  "SL error flag on any MSPA sector" , #9 #8
547  "SL error flag on any MSPC sector" , #10 #9
548  "Error flag in muon cand after ZS" , #11 #10
549  "CRC error on MSPA DAQ link" , #12 #11
550  "CRC error on MSPC DAQ link" , #13 #12
551  "TriggerType reception timeout error" , #14 #13
552  "MSPA DAQ link input FIFO full flag" , #15 #14
553  "MSPC DAQ link input FIFO full flag" #16 #15
554  ]
555 
556  monPath="/MUCTPI/"
557  from TrigT1CTMonitoring.BSMonDefinitions import barrelEtaLowBinEdges
558  from TrigT1CTMonitoring.BSMonDefinitions import barrelPhiLowBinEdges
559  from TrigT1CTMonitoring.BSMonDefinitions import endcapEtaLowBinEdges
560  from TrigT1CTMonitoring.BSMonDefinitions import endcapPhiLowBinEdges
561  from TrigT1CTMonitoring.BSMonDefinitions import forwardEtaLowBinEdges
562  from TrigT1CTMonitoring.BSMonDefinitions import forwardPhiLowBinEdges
563  from TrigT1CTMonitoring.BSMonDefinitions import candidateWordsPerTimeslice
564  from TrigT1CTMonitoring.BSMonDefinitions import tobWordsPerTimeslice
565  #from TrigT1CTMonitoring.BSMonDefinitions import muctpiErrorBins
566  # TODO: import a vector for the 15 pt indexes
567 
568  #general errors, defined in this code
569  myGroup.defineHistogram('errorSummaryMUCTPI',title='MUCTPI errors;', type='TH1I', path=monPath, xbins=len(errorSummaryMUCTPIBinLabels), xmin=0.5, xmax=0.5+len(errorSummaryMUCTPIBinLabels), xlabels=errorSummaryMUCTPIBinLabels, opt='kAlwaysCreate')
570  myGroup.defineHistogram('errorSummaryPerLumiBlockMUCTPIX,errorSummaryPerLumiBlockMUCTPIY;errorSummaryPerLumiBlockMUCTPI',title='Errors per lumi block; LB number; Errors', type='TH2F', path=monPath, xbins=2000, xmin=0.5, xmax=2000.5, ybins=len(errorSummaryMUCTPIBinLabels), ymin=0.5, ymax=len(errorSummaryMUCTPIBinLabels)+0.5, ylabels=errorSummaryMUCTPIBinLabels, opt='kAlwaysCreate')
571  #error bits defined in the last word of the ROD fragment
572  myGroup.defineHistogram('statusDataWordMUCTPI',title='Status word bits;', type='TH1I', path=monPath, xbins=len(statusDataWordMUCTPIBinLabels), xmin=0.5, xmax=0.5+len(statusDataWordMUCTPIBinLabels), xlabels=statusDataWordMUCTPIBinLabels, opt='kAlwaysCreate')
573  myGroup.defineHistogram('statusDataWordPerLumiBlockMUCTPIX,statusDataWordPerLumiBlockMUCTPIY;statusDataWordPerLumiBlockMUCTPI',title='Status word bits per lumi block; LB number; Errors', type='TH2F', path=monPath, xbins=2000, xmin=0.5, xmax=2000.5, ybins=len(statusDataWordMUCTPIBinLabels), ymin=0.5, ymax=len(statusDataWordMUCTPIBinLabels)+0.5, ylabels=statusDataWordMUCTPIBinLabels, opt='kAlwaysCreate')
574 
575  #mult
576  monPath="/MUCTPI/Mult"
577  myGroup.defineHistogram('multThrX;multThr',title='MLT thresholds total count;',type='TH1I',path=monPath,xbins=32,xmin=-0.5,xmax=31.5,opt='kAlwaysCreate')
578  myGroup.defineHistogram('multThrVsLBX,multThrVsLBY;multThrVsLB', title='MLT thresholds total count - per LB', type='TH2F',path=monPath,xbins=2000,xmin=0,xmax=2000,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
579 
580  myGroup.defineHistogram('multBitsX;multBits', title='MLT bits total count', path=monPath,xbins=64,xmin=-0.5,xmax=63.5,opt='kAlwaysCreate')
581  myGroup.defineHistogram('multBitsVsLBX,multBitsVsLBY;multBitsVsLB', title='MLT bits total count - per LB', type='TH2F',path=monPath,xbins=2000,xmin=0,xmax=2000,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
582 
583  #cand
584  monPath="/MUCTPI/Cand"
585  myGroup.defineHistogram('candPtBAX;candPtBA', title='BA cand pT;pT index;candidates', path=monPath,xbins=6, xmin=0.5, xmax=6.5, opt='kAlwaysCreate')
586  myGroup.defineHistogram('candPtECX;candPtEC', title='EC cand pT;pT index;candidates', path=monPath,xbins=15,xmin=0.5,xmax=15.5,opt='kAlwaysCreate')
587  myGroup.defineHistogram('candPtFWX;candPtFW', title='FW cand pT;pT index;candidates', path=monPath,xbins=15,xmin=0.5,xmax=15.5,opt='kAlwaysCreate')
588  myGroup.defineHistogram('candCount',title='Candidates distrib. per event (central slice);candidates',type='TH1I',path=monPath,xbins=candidateWordsPerTimeslice,duration='' if inputFlags.Common.isOnline else 'lb',opt='kAlwaysCreate')
589  myGroup.defineHistogram('candCountVsLBX,candCountVsLBY;candCountVsLB',title='Candidates distrib. per event (central slice) vs LB;LB;candidates',type='TH2I',path=monPath,xmin=0.5,xmax=2000.5,xbins=2000,ybins=candidateWordsPerTimeslice,opt='kAlwaysCreate')
590 
591  monPath="/MUCTPI/Cand/Expert"
592  myGroup.defineHistogram('candSLVsLBBAX,candSLVsLBBAY;candSLVsLBBA', title='BA cand SL vs LB;LB;BA sect. number', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5, ybins=64,ymin=-0.5,ymax=63.5 ,opt='kAlwaysCreate')
593  myGroup.defineHistogram('candSLVsLBECX,candSLVsLBECY;candSLVsLBEC', title='EC cand SL vs LB;LB;EC sect. number', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5, ybins=96,ymin=-0.5,ymax=95.5 ,opt='kAlwaysCreate')
594  myGroup.defineHistogram('candSLVsLBFWX,candSLVsLBFWY;candSLVsLBFW', title='FW cand SL vs LB;LB;FW sect. number', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5, ybins=48,ymin=-0.5,ymax=47.5 ,opt='kAlwaysCreate')
595  myGroup.defineHistogram('candVetoFlag_RoiVsSLBAX,candVetoFlag_RoiVsSLBAY;candVetoFlag_RoiVsSLBA', title='BA cand VetoFlag | RoI vs SL;BA sect. number;RoI', type='TH2F', path=monPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
596  myGroup.defineHistogram('candVetoFlag_RoiVsSLECX,candVetoFlag_RoiVsSLECY;candVetoFlag_RoiVsSLEC', title='EC cand VetoFlag | RoI vs SL;EC sect. number;RoI', type='TH2F', path=monPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=148,ymin=-0.5,ymax=147.5,opt='kAlwaysCreate')
597  myGroup.defineHistogram('candVetoFlag_RoiVsSLFWX,candVetoFlag_RoiVsSLFWY;candVetoFlag_RoiVsSLFW', title='FW cand VetoFlag | RoI vs SL;FW sect. number;RoI', type='TH2F', path=monPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
598  myGroup.defineHistogram('candVetoFlag_EtaPhiBAX,candVetoFlag_EtaPhiBAY;candVetoFlag_EtaPhiBA', title='BA cand Overlap Veto Flag;Eta;Phi', type='TH2F', path=monPath, xbins=barrelEtaLowBinEdges, ybins=barrelPhiLowBinEdges, opt='kAlwaysCreate')
599  myGroup.defineHistogram('candVetoFlag_EtaPhiECX,candVetoFlag_EtaPhiECY;candVetoFlag_EtaPhiEC', title='EC cand Overlap Veto Flag;Eta;Phi', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
600  myGroup.defineHistogram('candVetoFlag_EtaPhiFWX,candVetoFlag_EtaPhiFWY;candVetoFlag_EtaPhiFW', title='FW cand Overlap Veto Flag;Eta;Phi', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
601  myGroup.defineHistogram('candRoiVsSLBACentralSliceX,candRoiVsSLBACentralSliceY;candRoiVsSLBACentralSlice', title='BA cand RoI vs SL (central slice);BA sect. number;RoI', type='TH2F', path=monPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=31.5,opt='kAlwaysCreate')
602  myGroup.defineHistogram('candRoiVsSLECCentralSliceX,candRoiVsSLECCentralSliceY;candRoiVsSLECCentralSlice', title='EC cand RoI vs SL (central slice);EC sect. number;RoI', type='TH2F', path=monPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=148,ymin=-0.5,ymax=147.5,opt='kAlwaysCreate')
603  myGroup.defineHistogram('candRoiVsSLFWCentralSliceX,candRoiVsSLFWCentralSliceY;candRoiVsSLFWCentralSlice', title='FW cand RoI vs SL (central slice);FW sect. number;RoI', type='TH2F', path=monPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
604  myGroup.defineHistogram('candRoiVsSLBAOtherSliceX,candRoiVsSLBAOtherSliceY;candRoiVsSLBAOtherSlice', title='BA cand RoI vs SL (other slice);BA sect. number;RoI', type='TH2F', path=monPath,xbins=64,xmin=-0.5,xmax=63.5,ybins=32,ymin=-0.5,ymax=29.5,opt='kAlwaysCreate')
605  myGroup.defineHistogram('candRoiVsSLECOtherSliceX,candRoiVsSLECOtherSliceY;candRoiVsSLECOtherSlice', title='EC cand RoI vs SL (other slice);EC sect. number;RoI', type='TH2F', path=monPath,xbins=96,xmin=-0.5,xmax=95.5,ybins=148,ymin=-0.5,ymax=147.5,opt='kAlwaysCreate')
606  myGroup.defineHistogram('candRoiVsSLFWOtherSliceX,candRoiVsSLFWOtherSliceY;candRoiVsSLFWOtherSlice', title='FW cand RoI vs SL (other slice);FW sect. number;RoI', type='TH2F', path=monPath,xbins=48,xmin=-0.5,xmax=47.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
607  myGroup.defineHistogram('candEtaPhi_PhiOverlapX_BA,candEtaPhi_PhiOverlapY_BA;candEtaPhi_PhiOverlap_BA',title='BA cand phi overlap;Eta;Phi', type='TH2F', path=monPath, xbins=barrelEtaLowBinEdges, ybins=barrelPhiLowBinEdges, opt='kAlwaysCreate')
608  myGroup.defineHistogram('candEtaPhi_Gt1CandRoiX_BA,candEtaPhi_Gt1CandRoiY_BA;candEtaPhi_Gt1CandRoi_BA',title='BA cand >1 in Roi;Eta;Phi', type='TH2F', path=monPath, xbins=barrelEtaLowBinEdges, ybins=barrelPhiLowBinEdges, opt='kAlwaysCreate')
609  myGroup.defineHistogram('candEtaPhi_SectorFlagGtNX_BA,candEtaPhi_SectorFlagGtNY_BA;candEtaPhi_SectorFlagGtN_BA',title=">2 cand in sector;Eta;Phi", type='TH2F',path=monPath, xbins=barrelEtaLowBinEdges, ybins=barrelPhiLowBinEdges, opt='kAlwaysCreate')
610  myGroup.defineHistogram('candEtaPhi_NSWMonFlagX_EC,candEtaPhi_NSWMonFlagY_EC;candEtaPhi_NSWMonFlag_EC',title='NSW monitoring flag EC;Eta;Phi',type='TH2F',path=monPath,xbins=endcapEtaLowBinEdges,ybins=endcapPhiLowBinEdges,opt='kAlwaysCreate')
611  myGroup.defineHistogram('candEtaPhi_NSWMonFlagX_FW,candEtaPhi_NSWMonFlagY_FW;candEtaPhi_NSWMonFlag_FW',title='NSW monitoring flag FW;Eta;Phi',type='TH2F',path=monPath,xbins=forwardEtaLowBinEdges,ybins=forwardPhiLowBinEdges,opt='kAlwaysCreate')
612  myGroup.defineHistogram('candEtaPhi_SectorFlagGtNX_EC,candEtaPhi_SectorFlagGtNY_EC;candEtaPhi_SectorFlagGtN_EC',title='>4 cand in EC sector;Eta;Phi',type='TH2F',path=monPath,xbins=endcapEtaLowBinEdges,ybins=endcapPhiLowBinEdges,opt='kAlwaysCreate')
613  myGroup.defineHistogram('candEtaPhi_SectorFlagGtNX_FW,candEtaPhi_SectorFlagGtNY_FW;candEtaPhi_SectorFlagGtN_FW',title='>4 cand in FW sector;Eta;Phi',type='TH2F',path=monPath,xbins=forwardEtaLowBinEdges,ybins=forwardPhiLowBinEdges,opt='kAlwaysCreate')
614 
615  candFlagsMUCTPIBinLabels_BA = [ #cxx indices
616  "> 1 cand. in the RoI" , #1
617  "phi overlap" , #2
618  ]
619  candFlagsMUCTPIBinLabels_ECFW = [ #cxx indices
620  "charge" , #1
621  "BW2/3" , #2
622  "InnerCoin" , #2
623  "GoodMF" , #2
624  ]
625  myGroup.defineHistogram('candCandFlagsVsSLBACentralSliceX,candCandFlagsVsSLBACentralSliceY;candCandFlagsVsSLBACentralSlice', title='BA cand CandFlags vs SL (central slice);BA sect. number', type='TH2F', path=monPath, xbins=64, xmin=-0.5,xmax=63.5, ybins=2, ymin=-0.5,ymax=1.5,ylabels=candFlagsMUCTPIBinLabels_BA,opt='kAlwaysCreate')
626  myGroup.defineHistogram('candCandFlagsVsSLECCentralSliceX,candCandFlagsVsSLECCentralSliceY;candCandFlagsVsSLECCentralSlice', title='EC cand CandFlags vs SL (central slice);EC sect. number', type='TH2F', path=monPath, xbins=96, xmin=-0.5,xmax=95.5, ybins=4, ymin=-0.5,ymax=3.5,ylabels=candFlagsMUCTPIBinLabels_ECFW,opt='kAlwaysCreate')
627  myGroup.defineHistogram('candCandFlagsVsSLFWCentralSliceX,candCandFlagsVsSLFWCentralSliceY;candCandFlagsVsSLFWCentralSlice', title='FW cand CandFlags vs SL (central slice);FW sect. number', type='TH2F', path=monPath, xbins=48,xmin=-0.5,xmax=47.5, ybins=4, ymin=-0.5,ymax=3.5,ylabels=candFlagsMUCTPIBinLabels_ECFW,opt='kAlwaysCreate')
628 
629  #sec err per LB (Central slice)
630  myGroup.defineHistogram('candErrorflagVsSLBACentralSlicePerLBX,candErrorflagVsSLBACentralSlicePerLBY;candErrorflagVsSLBACentralSlicePerLB', title='SL (BA) cand ErrorFlag vs LB (central slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
631  myGroup.defineHistogram('candErrorflagVsSLECCentralSlicePerLBX,candErrorflagVsSLECentralSlicePerLBY;candErrorflagVsSLECCentralSlicePerLB', title='SL (EC) cand ErrorFlag vs LB (central slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=96,ymin=-0.5,ymax=95.5,opt='kAlwaysCreate')
632  myGroup.defineHistogram('candErrorflagVsSLFWCentralSlicePerLBX,candErrorflagVsSLFWCentralSlicePerLBY;candErrorflagVsSLFWCentralSlicePerLB', title='SL (FW) cand ErrorFlag vs LB (central slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=48,ymin=-0.5,ymax=47.5,opt='kAlwaysCreate')
633  #sec err per LB (Other slice)
634  myGroup.defineHistogram('candErrorflagVsSLBAOtherSlicePerLBX,candErrorflagVsSLBAOtherSlicePerLBY;candErrorflagVsSLBAOtherSlicePerLB', title='SL (BA) cand ErrorFlag vs LB (other slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=64,ymin=-0.5,ymax=63.5,opt='kAlwaysCreate')
635  myGroup.defineHistogram('candErrorflagVsSLECOtherSlicePerLBX,candErrorflagVsSLECOtherSlicePerLBY;candErrorflagVsSLECOtherSlicePerLB', title='SL (EC) cand ErrorFlag vs LB (other slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=96,ymin=-0.5,ymax=95.5,opt='kAlwaysCreate')
636  myGroup.defineHistogram('candErrorflagVsSLFWOtherSlicePerLBX,candErrorflagVsSLFWOtherSlicePerLBY;candErrorflagVsSLFWOtherSlicePerLB', title='SL (FW) cand ErrorFlag vs LB (other slice)', type='TH2F', path=monPath,xbins=2000,xmin=0.5,xmax=2000.5,ybins=48,ymin=-0.5,ymax=47.5,opt='kAlwaysCreate')
637 
638  monPath="/MUCTPI/TOB/Expert"
639  etaBins=50
640  etaMin=0
641  etaMax=80
642  phiBins=50
643  phiMin=0
644  phiMax=80
645 
646  myGroup.defineHistogram('tobEtaPhiAX,tobEtaPhiAY;tobEtaPhiA',title='TOB hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
647  myGroup.defineHistogram('tobEtaPhiA_GoodMFX,tobEtaPhiA_GoodMFY;tobEtaPhiA_GoodMF',title='TOB GoodMF flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
648  myGroup.defineHistogram('tobEtaPhiA_InnerCoinX,tobEtaPhiA_InnerCoinY;tobEtaPhiA_InnerCoin',title='TOB InnerCoin flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
649  myGroup.defineHistogram('tobEtaPhiA_BW23X,tobEtaPhiA_BW23Y;tobEtaPhiA_BW23',title='TOB BW23 flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
650  myGroup.defineHistogram('tobEtaPhiA_ChargeX,tobEtaPhiA_ChargeY;tobEtaPhiA_Charge',title='TOB Charge flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
651  myGroup.defineHistogram('tobEtaPhiCX,tobEtaPhiCY;tobEtaPhiC',title='TOB hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
652  myGroup.defineHistogram('tobEtaPhiC_GoodMFX,tobEtaPhiC_GoodMFY;tobEtaPhiC_GoodMF',title='TOB GoodMF flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
653  myGroup.defineHistogram('tobEtaPhiC_InnerCoinX,tobEtaPhiC_InnerCoinY;tobEtaPhiC_InnerCoin',title='TOB InnerCoin flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
654  myGroup.defineHistogram('tobEtaPhiC_BW23X,tobEtaPhiC_BW23Y;tobEtaPhiC_BW23',title='TOB BW23 flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
655  myGroup.defineHistogram('tobEtaPhiC_ChargeX,tobEtaPhiC_ChargeY;tobEtaPhiC_Charge',title='TOB Charge flag hitmap (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=etaBins, ymin=etaMin, ymax=etaMax, opt='kAlwaysCreate')
656  #pt vs eta/phi
657  myGroup.defineHistogram('tobPtVsEtaAX,tobPtVsEtaAY;tobPtVsEtaA',title='TOB pT VS eta (A);Eta;pT index', type='TH2F', path=monPath, xbins=etaBins, xmin=etaMin, xmax=etaMax, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
658  myGroup.defineHistogram('tobPtVsPhiAX,tobPtVsPhiAY;tobPtVsPhiA',title='TOB pT VS phi (A);Phi;pT index', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
659  myGroup.defineHistogram('tobPtVsEtaCX,tobPtVsEtaCY;tobPtVsEtaC',title='TOB pT VS eta (C);Eta;pT index', type='TH2F', path=monPath, xbins=etaBins, xmin=etaMin, xmax=etaMax, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
660  myGroup.defineHistogram('tobPtVsPhiCX,tobPtVsPhiCY;tobPtVsPhiC',title='TOB pT VS phi (C);Phi;pT index', type='TH2F', path=monPath, xbins=phiBins, xmin=phiMin, xmax=phiMax, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
661 
662  # Retrieve histogram binning for eta/phi
663 
664  monPath="/MUCTPI/TOB"
665  myGroup.defineHistogram('tobEtaPhiXdecoded_BA,tobEtaPhiYdecoded_BA;tobEtaPhi_BA',title='TOB hitmap BA (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=barrelEtaLowBinEdges, ybins=barrelPhiLowBinEdges, opt='kAlwaysCreate')
666  myGroup.defineHistogram('tobEtaPhiXdecoded_EC,tobEtaPhiYdecoded_EC;tobEtaPhi_EC',title='TOB hitmap EC (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
667  myGroup.defineHistogram('tobEtaPhiXdecoded_FW,tobEtaPhiYdecoded_FW;tobEtaPhi_FW',title='TOB hitmap FW (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
668 
669  myGroup.defineHistogram('tobEtaPhi_GoodMFXdecoded_EC,tobEtaPhi_GoodMFYdecoded_EC;tobEtaPhi_GoodMF_EC',title='TOB GoodMF flag hitmap EC (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
670  myGroup.defineHistogram('tobEtaPhi_GoodMFXdecoded_FW,tobEtaPhi_GoodMFYdecoded_FW;tobEtaPhi_GoodMF_FW',title='TOB GoodMF flag hitmap FW (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
671 
672  myGroup.defineHistogram('tobEtaPhi_InnerCoinXdecoded_EC,tobEtaPhi_InnerCoinYdecoded_EC;tobEtaPhi_InnerCoin_EC',title='TOB InnerCoin flag hitmap EC (eta,phi);Eta;Phi', type='TH2F', path=monPath,xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
673  myGroup.defineHistogram('tobEtaPhi_InnerCoinXdecoded_FW,tobEtaPhi_InnerCoinYdecoded_FW;tobEtaPhi_InnerCoin_FW',title='TOB InnerCoin flag hitmap FW (eta,phi);Eta;Phi', type='TH2F', path=monPath,xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
674 
675  myGroup.defineHistogram('tobEtaPhi_BW23Xdecoded_EC,tobEtaPhi_BW23Ydecoded_EC;tobEtaPhi_BW23_EC',title='TOB BW23 flag hitmap EC (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
676  myGroup.defineHistogram('tobEtaPhi_BW23Xdecoded_FW,tobEtaPhi_BW23Ydecoded_FW;tobEtaPhi_BW23_FW',title='TOB BW23 flag hitmap FW (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
677 
678  myGroup.defineHistogram('tobEtaPhi_ChargeXdecoded_EC,tobEtaPhi_ChargeYdecoded_EC;tobEtaPhi_Charge_EC',title='TOB Charge flag hitmap EC (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=endcapPhiLowBinEdges, opt='kAlwaysCreate')
679  myGroup.defineHistogram('tobEtaPhi_ChargeXdecoded_FW,tobEtaPhi_ChargeYdecoded_FW;tobEtaPhi_Charge_FW',title='TOB Charge flag hitmap FW (eta,phi);Eta;Phi', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=forwardPhiLowBinEdges, opt='kAlwaysCreate')
680 
681  #pt vs eta/phi
682  myGroup.defineHistogram('tobPtVsEtaXdecoded_BA,tobPtVsEtaYdecoded_BA;tobPtVsEta_BA',title='TOB pT VS eta BA;Eta;pT index', type='TH2F', path=monPath, xbins=barrelEtaLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
683  myGroup.defineHistogram('tobPtVsEtaXdecoded_EC,tobPtVsEtaYdecoded_EC;tobPtVsEta_EC',title='TOB pT VS eta EC;Eta;pT index', type='TH2F', path=monPath, xbins=endcapEtaLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
684  myGroup.defineHistogram('tobPtVsEtaXdecoded_FW,tobPtVsEtaYdecoded_FW;tobPtVsEta_FW',title='TOB pT VS eta FW;Eta;pT index', type='TH2F', path=monPath, xbins=forwardEtaLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
685 
686  myGroup.defineHistogram('tobPtVsPhiXdecoded_BA,tobPtVsPhiYdecoded_BA;tobPtVsPhi_BA',title='TOB pT VS phi BA;Phi;pT index', type='TH2F', path=monPath, xbins=barrelPhiLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
687  myGroup.defineHistogram('tobPtVsPhiXdecoded_EC,tobPtVsPhiYdecoded_EC;tobPtVsPhi_EC',title='TOB pT VS phi EC;Phi;pT index', type='TH2F', path=monPath, xbins=endcapPhiLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
688  myGroup.defineHistogram('tobPtVsPhiXdecoded_FW,tobPtVsPhiYdecoded_FW;tobPtVsPhi_FW',title='TOB pT VS phi FW;Phi;pT index', type='TH2F', path=monPath, xbins=forwardPhiLowBinEdges, ybins=15, ymin=0.5, ymax=15.5, opt='kAlwaysCreate')
689  # tob count
690  myGroup.defineHistogram('tobCount',title='TOBs distrib. per event (central slice);TOBs',type='TH1I',xbins=tobWordsPerTimeslice,path=monPath,opt='kAlwaysCreate')
691 
692  monPath="/MUCTPI/Timing"
693  candSliceVsSLMUCTPIBinLabels = [ #cxx indices
694  "-3 Slice" , #1
695  "-2 Slice" , #2
696  "-1 Slice" , #3
697  "Central Slice" , #4
698  "+1 Slice" , #5
699  "+2 Slice" , #6
700  "+3 Slice" , #7
701  ]
702  myGroup.defineHistogram('candSliceVsSLBAX,candSliceVsSLBAY;candSliceVsSLBA',title='SL (BA) slice vs SL', type='TH2F', path=monPath, xbins=64, xmin=-0.5, xmax=63.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
703  myGroup.defineHistogram('candSliceVsSLECX,candSliceVsSLECY;candSliceVsSLEC',title='SL (EC) slice vs SL', type='TH2F', path=monPath, xbins=96, xmin=-0.5, xmax=95.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
704  myGroup.defineHistogram('candSliceVsSLFWX,candSliceVsSLFWY;candSliceVsSLFW',title='SL (FW) slice vs SL', type='TH2F', path=monPath, xbins=48, xmin=-0.5, xmax=47.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
705  #same histos, but aiming to fill only for specific BG (FirstInTrain) for better profiles
706  myGroup.defineHistogram('candSliceVsSLBAFirstInTrainX,candSliceVsSLBAFirstInTrainY;candSliceVsSLBAFirstInTrain',title='SL (BA) slice vs SL (BG=FirstInTrain)', type='TH2F', path=monPath, xbins=64, xmin=-0.5, xmax=63.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
707  myGroup.defineHistogram('candSliceVsSLECFirstInTrainX,candSliceVsSLECFirstInTrainY;candSliceVsSLECFirstInTrain',title='SL (EC) slice vs SL (BG=FirstInTrain)', type='TH2F', path=monPath, xbins=96, xmin=-0.5, xmax=95.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
708  myGroup.defineHistogram('candSliceVsSLFWFirstInTrainX,candSliceVsSLFWFirstInTrainY;candSliceVsSLFWFirstInTrain',title='SL (FW) slice vs SL (BG=FirstInTrain)', type='TH2F', path=monPath, xbins=48, xmin=-0.5, xmax=47.5, ybins=len(candSliceVsSLMUCTPIBinLabels), ymin=0., ymax=7., ylabels=candSliceVsSLMUCTPIBinLabels, opt='kAlwaysCreate')
709 
710 
711 
712 
713  acc = helper.result()
714  result.merge(acc)
715  return result
716 
717 
718 if __name__=='__main__':
719 
720  # set input file and config options
721  from AthenaConfiguration.AllConfigFlags import initConfigFlags
722  import glob
723  inputs = glob.glob('/eos/atlas/atlastier0/rucio/data18_13TeV/physics_Main/00354311/data18_13TeV.00354311.physics_Main.recon.ESD.f1129/data18_13TeV.00354311.physics_Main.recon.ESD.f1129._lb0013._SFO-8._0001.1')
724 
725  flags = initConfigFlags()
726  flags.Input.Files = inputs
727  flags.Output.HISTFileName = 'ExampleMonitorOutput_CTPMonitoring.root'
728  flags.lock()
729  #flags.dump() # print all the configs
730 
731  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
732  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
733  cfg = MainServicesCfg(flags)
734  cfg.merge(PoolReadCfg(flags))
735 
736  BSMonitorCfg = BSMonitoringConfig(flags)
737  cfg.merge(BSMonitorCfg)
738  # message level for algorithm
739  BSMonitorCfg.getEventAlgo('BSMonAlg').OutputLevel = 1 # 1/2 INFO/DEBUG
740  # options - print all details of algorithms, very short summary
741  cfg.printConfig(withDetails=False, summariseProps = True)
742 
743  nevents=-1
744  cfg.run(nevents)
grepfile.info
info
Definition: grepfile.py:38
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
BSMonitoringAlgorithm.BSMonitoringConfig
def BSMonitoringConfig(inputFlags)
Definition: BSMonitoringAlgorithm.py:5
python.AutoConfigFlags.GetFileMD
def GetFileMD(filenames, allowEmpty=True)
Definition: AutoConfigFlags.py:51
TrigT1ResultByteStreamConfig.MuCTPIPhase1ByteStreamAlgoCfg
def MuCTPIPhase1ByteStreamAlgoCfg(flags)
Definition: TrigT1ResultByteStreamConfig.py:318
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69