ATLAS Offline Software
LArDigitalTriggMonAlg.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #
3 
4 # Define some handy strings for plot labels
5 
6 
7 # TO DO - add defined cut names for selections, add them to plot names
8 
9 from AthenaConfiguration.ComponentFactory import CompFactory
10 
11 
12 # selections from the digi (ADC) loop
13 selStr = {}
14 selStr["passDigiNom"] ="for unmasked SCs with ADC_max-pedestal > 10*RMS(DB) & good quality bits"
15 selStr["badNotMasked"] = "for unmasked SCs which have bad quality bits"
16 # selections from the sc (ET) loop
17 #selStr["passSCNom"] = "for unmasked SCs which pass #tau selection with non-zero ET < 10 GeV"
18 selStr["zeroET"] = "for unmasked SCs with ET == 0 GeV"
19 
20 selStr["passSCNom"] = "for unmasked SCs with non-zero ET < 10 GeV"
21 #selStr["passSCNom0_0p325"] = "for unmasked SCs which pass #tau selection with non-zero ET < 0.2 GeV"
22 selStr["passSCNomInvalid"] = "for unmasked SCs with raw E = -99999" # notMasked && NotSaturated && notOFCbOF
23 selStr["passSCNom0_0p325"] = "for unmasked SCs with 0 GeV < ET < 0.325 GeV"
24 #selStr["passSCNom0p325_1"] = "for unmasked SCs which pass #tau selection with 0.2 GeV < ET < 1 GeV"
25 selStr["passSCNom0p325_1"] = "for unmasked SCs with 0.325 GeV < ET < 1 GeV"
26 #selStr["passSCNom1"] = "for unmasked SCs which pass #tau selection with ET > 1 GeV"
27 selStr["passSCNom1"] = "for unmasked SCs with ET > 1 GeV"
28 #selStr["passSCNom10"] = "for unmasked SCs which pass tau selection with ET > 10 GeV"
29 selStr["passSCNom10"] = "for unmasked SCs with ET > 10 GeV"
30 #selStr["passSCNom10tauGt3"] = "for unmasked SCs which pass tau selection with ET > 10 GeV and #tau > 3"
31 selStr["passSCNom10tauGt3"] = "for unmasked SCs with ET > 10 GeV and #tau > 3"
32 selStr["saturNotMasked"] = "for unmasked SCs which are saturated"
33 selStr["OFCbOFNotMasked"] = "for unmasked SCs with OFCb in overflow"
34 selStr["onlofflEmismatch"] = "for unmasked SCs which pass #tau selection where online & offline energies are different"
35 
36 selStr["notMaskedEoflNe0"] = "for unmasked SCs with non-zero ET ofl"
37 selStr["notMaskedEoflGt1"] = "for unmasked SCs with ET ofl > 1 GeV"
38 
39 
40 
41 def LArDigitalTriggMonConfig(flags,larLATOMEBuilderAlg, nsamples=32, streamTypes=[]):
42  '''Function to configures some algorithms in the monitoring system.'''
43  # The following class will make a sequence, configure algorithms, and link
44  # them to GenericMonitoringTools
45 
46  from AthenaMonitoring.AthMonitorCfgHelper import AthMonitorCfgHelper
47  helper = AthMonitorCfgHelper(flags,'LArDigitalTriggMonAlgCfg')
48 
49  from LArMonitoring.GlobalVariables import lArDQGlobals
50 
51  from AthenaCommon.Logging import logging
52  mlog = logging.getLogger( 'LArDigitalTriggMon' )
53 
54  if not flags.DQ.enableLumiAccess:
55  from LumiBlockComps.LuminosityCondAlgConfig import LuminosityCondAlgCfg
56  helper.resobj.merge(LuminosityCondAlgCfg(flags))
57 
58  #get SC onl-offl mapping from DB
59  from LArCabling.LArCablingConfig import LArOnOffIdMappingSCCfg
60  helper.resobj.merge(LArOnOffIdMappingSCCfg(flags))
61 
62  # and elec. calib. coeffs
63  from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDBSCCfg
64  helper.resobj.merge(LArElecCalibDBSCCfg(flags, condObjs=["Ramp","DAC2uA", "Pedestal", "uA2MeV", "MphysOverMcal", "OFC", "Shape", "HVScaleCorr"]))
65 
66 
67 
68  larDigitalTriggMonAlg = helper.addAlgorithm(CompFactory.LArDigitalTriggMonAlg('larDigitalTriggMonAlg'))
69  larDigitalTriggMonAlg.ProblemsToMask=["maskedOSUM"] #highNoiseHG","highNoiseMG","highNoiseLG","deadReadout","deadPhys"]
70  if nsamples < 4:
71  larDigitalTriggMonAlg.LArRawSCEtRecoContainerKey="dummy" # this will not exists, so not used in monitoring
72 
73  hasEtId = False
74  hasEt = False
75  hasAdc = False
76  hasAdcBas = False
77  for i in range(0,len(streamTypes)):
78  mlog.info("runinfo.streamTypes()[i]: "+str(streamTypes[i]))
79  if streamTypes[i] == "SelectedEnergy":
80  hasEtId = True
81  larDigitalTriggMonAlg.LArRawSCContainerKey = "SC_ET_ID"
82  if streamTypes[i] == "Energy":
83  hasEt = True
84  larDigitalTriggMonAlg.LArRawSCContainerKey = "SC_ET"
85  if streamTypes[i] == "RawADC":
86  hasAdc = True
87  larLATOMEBuilderAlg.LArDigitKey = "SC"
88  larLATOMEBuilderAlg.isADCBas = False
89  larDigitalTriggMonAlg.LArDigitContainerKey = "SC"
90  if streamTypes[i] == "ADC":
91  hasAdcBas = True
92  larDigitalTriggMonAlg.isADCBas = True
93  larDigitalTriggMonAlg.LArDigitContainerKey = "SC_ADC_BAS"
94  larLATOMEBuilderAlg.isADCBas = True
95  larLATOMEBuilderAlg.LArDigitKey = "SC_ADC_BAS"
96 
97  if (hasEtId and hasEt): #prefer EtId if both in recipe
98  hasEt = False
99  #larDigitalTriggMonAlg.EtName = "SC_ET_ID"
100 
101  if (hasAdc and hasAdcBas): #prefer Raw Adc if both in recipe
102  hasAdc = False
103  larDigitalTriggMonAlg.isADCBas=False
104 
105  mlog.info("Mux settings from COOL:")
106  mlog.info("has ET Id: "+str(hasEtId))
107  mlog.info("has ET: "+str(hasEt))
108  mlog.info("has ADC: "+str(hasAdc))
109  mlog.info("has ADC Bas: "+str(hasAdcBas))
110 
111  SCGroupName="SC"
112  larDigitalTriggMonAlg.SCMonGroup=SCGroupName
113  # uncomment if needed:
114  #larDigitalTriggMonAlg.FileKey="CombinedMonitoring"
115 
116  SCGroup = helper.addGroup(
117  larDigitalTriggMonAlg,
118  SCGroupName,
119  '/LArDigitalTrigger/',
120  'run'
121  )
122 
123  sc_hist_path='/'
124 
125  LatomeDetBinMapping = dict([
126  ("0x48",{"Subdet":"FCALC","Bin":1}),
127  ("0x4c",{"Subdet":"EMEC/HECC","Bin":3}),
128  ("0x44",{"Subdet":"EMECC","Bin":11}),
129  ("0x4a",{"Subdet":"EMB/EMECC","Bin":27}),
130  ("0x42",{"Subdet":"EMBC","Bin":43}),
131  ("0x41",{"Subdet":"EMBA","Bin":59}),
132  ("0x49",{"Subdet":"EMB/EMECA","Bin":75}),
133  ("0x43",{"Subdet":"EMECA","Bin":91}),
134  ("0x4b",{"Subdet":"EMEC/HECA","Bin":107}),
135  ("0x47",{"Subdet":"FCALA","Bin":115})
136  ])
137  NLatomeBins=117
138  NLatomeBins_side=59
139 
140  BinLabel_LATOME=[]
141  BinLabel_LATOME_A=[]
142  BinLabel_LATOME_C=[]
143  phi=0
144  for bb in range (0,NLatomeBins):
145  Label=""
146  for detID in LatomeDetBinMapping:
147  if bb==(LatomeDetBinMapping[detID]["Bin"]-1):
148  Label=LatomeDetBinMapping[detID]["Subdet"]
149  phi=1
150  break
151  if bb < NLatomeBins_side:
152  BinLabel_LATOME_C+=[Label+str(phi)]
153  else:
154  BinLabel_LATOME_A+=[Label+str(phi)]
155 
156  BinLabel_LATOME+=[Label+str(phi)]
157  phi+=1
158 
159 
160 
161 
162  iphi_bins_dict = {"ALL": 63, "EMB": 63, "EMEC": 63, "HEC": 63, "FCAL": 15}
163 
164 
165 
166 
167  SCGroup.defineHistogram('lumi_block,event_size;EventSize_vs_LB',
168  title='Digital trigger event size per LB; LumiBlock; Event size [MB]',
169  type='TProfile',
170  path=sc_hist_path,
171  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
172 
173 
174 
175 
176  partGroup_digi = helper.addArray([larDigitalTriggMonAlg.LayerNames], larDigitalTriggMonAlg, 'LArDigitalTriggerMon_digi', topPath='/LArDigitalTrigger/')
177  partGroup_sc = helper.addArray([larDigitalTriggMonAlg.LayerNames], larDigitalTriggMonAlg, 'LArDigitalTriggerMon_sc', topPath='/LArDigitalTrigger/')
178 
179  for part in larDigitalTriggMonAlg.LayerNames:
180  selStrPart = {}
181  for sel in selStr.keys():
182  selStrPart[sel] = "in "+part+" "+selStr[sel]
183  iphi_bins = 63
184  for key in iphi_bins_dict.keys():
185  if part.startswith(key):
186  iphi_bins = iphi_bins_dict[key]
187 
188  if part == "ALL":
189  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"]["All"]["All"]
190  partybins=lArDQGlobals.SuperCell_Variables["phiRange"]["All"]["All"]
191  topPath=""
192  else:
193  topPath="PerPartition/"
194  Side = part[-1]
195  if "HEC" in part:
196  Sampling = "0"
197  Part = part[:-1]
198  else:
199  Sampling = part[-2]
200  Part = part[:-2]
201  if Part == "FCAL":
202  Part = "FCal"
203  if Sampling == "P":
204  Sampling = "0"
205  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"][Part][Side][Sampling]
206  partybins=lArDQGlobals.SuperCell_Variables["phiRange"][Part][Side][Sampling]
207 
208 
209 
210 
211  for thisSel in [ "passDigiNom", "badNotMasked"]:
212  thisTopPath=f"/{thisSel}/{topPath}"
213  # Histos that we only want for all partitions/layers combined lalala
214  if part == "ALL":
215  partGroup_digi.defineHistogram('Digi_part_maxpos,Digi_part_partition;Partition_vs_maxSamplePosition_'+thisSel,
216  title='Partition vs. position of max sample '+selStrPart[thisSel],
217  cutmask='Digi_part_'+thisSel,
218  type='TH2F',
219  path=thisTopPath,
220  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
221  ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
222  xlabels = [str(x) for x in range(1,nsamples+1)],
223  ylabels=lArDQGlobals.Partitions,
224  pattern=[(part)])
225 
226  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_adc;ADCFullRange_vs_LATOME_'+thisSel,
227  title='ADC vs LATOME name '+selStrPart[thisSel]+'; ; ADC',
228  cutmask='Digi_part_'+thisSel,
229  type='TH2F',
230  path=thisTopPath,
231  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
232  ybins=500, ymin=-2, ymax=2500, #raw ADC is 12 bit
233  xlabels=BinLabel_LATOME,
234  pattern=[(part)])
235 
236  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_pedestal;Pedestal_vs_LATOME_'+thisSel,
237  title='Pedestal vs LATOME name '+selStrPart[thisSel]+'; ; Pedestal',
238  cutmask='Digi_part_'+thisSel,
239  type='TH2F',
240  path=thisTopPath,
241  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
242  ybins=500, ymin=-2, ymax=2500, #raw ADC is 12 bit
243  xlabels=BinLabel_LATOME,
244  pattern=[(part)])
245 
246  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_maxpos;MaxSamplePosition_vs_LATOME_'+thisSel,
247  title='Position of max sample vs. LATOME '+selStrPart[thisSel],
248  type='TH2F',
249  cutmask='Digi_part_'+thisSel,
250  path=thisTopPath,
251  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
252  ybins=nsamples,ymin=0.5,ymax=nsamples+0.5,
253  xlabels=BinLabel_LATOME,
254  ylabels = [str(x) for x in range(1,nsamples+1)],
255  pattern=[(part)])
256 
257  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_diff_adc0_ped;Diff_ADC0_Ped_vs_LATOME_'+thisSel,
258  title='ADC[0] - Pedestal vs LATOME name '+selStrPart[thisSel]+'; ; ADC[0] - Pedestal',
259  type='TH2F',
260  cutmask='Digi_part_'+thisSel,
261  path=thisTopPath,
262  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
263  ybins=64, ymin=-32, ymax=32,
264  xlabels=BinLabel_LATOME,
265  pattern=[(part)])
266 
267  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_diff_adc_ped_norm;Diff_ADC_Ped_Norm_vs_LATOME_'+thisSel,
268  title='(ADC-ped)/fabs(ADC_max-ped) '+selStrPart[thisSel]+'; LATOME Name; (ADC - pedestal) / fabs(ADC_max - pedestal)',
269  type='TH2F',
270  cutmask='Digi_part_'+thisSel,
271  path=thisTopPath,
272  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
273  ybins=64, ymin=-32, ymax=32,
274  xlabels=BinLabel_LATOME,
275  pattern=[(part)])
276 
277 
278 
279  partGroup_digi.defineHistogram('Digi_part_eta,Digi_part_phi;Coverage_Eta_Phi_'+thisSel,
280  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
281  type='TH2F',
282  path=thisTopPath+'/Coverage',
283  cutmask='Digi_part_'+thisSel,
284  xbins=partxbins,
285  ybins=partybins,
286  pattern=[(part)])
287 
288 
289  if not flags.Common.isOnline: continue # Skip the remaining histos if we are running offline
290 
291  if thisSel != "passDigiNom": continue
292  partGroup_digi.defineHistogram('Digi_part_eta,Digi_part_phi,Digi_part_diff_adc0_ped;Coverage_Diff_ADC0_Ped_'+thisSel,
293  title='ADC[0] - Pedestal'+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
294  type='TProfile2D',
295  cutmask='Digi_part_'+thisSel,
296  path=thisTopPath+'/Coverage',
297  xbins=partxbins,
298  ybins=partybins,
299  pattern=[(part)])
300 
301 
302 
303  partGroup_digi.defineHistogram('Digi_part_BCID,Digi_part_iphi,Digi_part_diff_adc_ped;Diff_ADC_Ped_Per_BCID_Per_iphi_'+thisSel,
304  title='ADC - Pedestal (all samples) '+selStrPart[thisSel]+': iphi vs BCID;BCID;iphi',
305  type='TProfile2D',
306  cutmask='Digi_part_'+thisSel,
307  path=thisTopPath,
308  xbins=3564,xmin=-0.5,xmax=3563.5,
309  ybins=iphi_bins+1,ymin=0,ymax=iphi_bins+1, # Make a lardqglobals for ieta iphi?
310  pattern=[(part)])
311 
312 
313 
314 
315 
316 
317  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_adc;ADCZoom_vs_SamplePosition_'+thisSel,
318  title='ADC (zoom) vs sample position '+selStrPart[thisSel],
319  cutmask='Digi_part_'+thisSel,
320  type='TH2F',
321  path=thisTopPath,
322  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
323  xlabels = [str(x) for x in range(1,nsamples+1)],
324  ybins=750, ymin=0, ymax=1300, #start from 0 otherwise miss endcap pedestals
325  pattern=[(part)])
326 
327  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_adc;ADCFullRange_vs_SamplePosition_'+thisSel,
328  title='ADC vs sample position '+selStrPart[thisSel],
329  cutmask='Digi_part_'+thisSel,
330  type='TH2F',
331  path=thisTopPath,
332  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
333  xlabels = [str(x) for x in range(1,nsamples+1)],
334  ybins=500, ymin=0, ymax=5000, #raw ADC is 12 bit
335  pattern=[(part)])
336 
337  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_pedestal;Pedestal_vs_SamplePosition_'+thisSel,
338  title='Pedestal vs sample position '+selStrPart[thisSel],
339  cutmask='Digi_part_'+thisSel,
340  type='TH2F',
341  path=thisTopPath,
342  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
343  xlabels = [str(x) for x in range(1,nsamples+1)],
344  ybins=500, ymin=0, ymax=5000, #raw ADC is 12 bit
345  pattern=[(part)])
346 
347  partGroup_digi.defineHistogram('Digi_part_diff_adc0_ped;Diff_ADC0_Ped_'+thisSel,
348  title='LATOME (ADC[0]-ped) '+selStrPart[thisSel]+'; (ADC - pedestal)',
349  type='TH1F',
350  cutmask='Digi_part_'+thisSel,
351  path=thisTopPath,
352  xbins=50,xmin=-25,xmax=25,
353  pattern=[(part)])
354 
355  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_diff_adc_ped_norm;Diff_ADC_Ped_Norm_vs_SamplePosition_'+thisSel,
356  title='(ADC-ped)/fabs(ADC_max-ped) '+selStrPart[thisSel]+'; Sample position; (ADC - pedestal) / fabs(ADC_max - pedestal)',
357  type='TH2F',
358  cutmask='Digi_part_'+thisSel,
359  path=thisTopPath,
360  ybins=40,ymin=-1,ymax=1,
361  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
362  xlabels = [str(x) for x in range(1,nsamples+1)],
363  pattern=[(part)])
364 
365  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_adc;ADC_vs_BCID_'+thisSel,
366  title='ADC value vs BCID '+selStrPart[thisSel]+'; BCID; ADC Value',
367  type='TProfile',
368  cutmask='Digi_part_'+thisSel,
369  path=thisTopPath,
370  xbins=3564,xmin=-0.5,xmax=3563.5,
371  ybins=500, ymin=0, ymax=5000,
372  pattern=[(part)])
373 
374  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_diff_adc0_ped;Diff_ADC0_Ped_vs_BCID_'+thisSel,
375  title='ADC[0] - Ped value vs BCID '+selStrPart[thisSel]+'; BCID; ADC[0] Value',
376  type='TProfile',
377  cutmask='Digi_part_'+thisSel,
378  path=thisTopPath,
379  xbins=3564,xmin=-0.5,xmax=3563.5,
380  ybins=500, ymin=-5, ymax=5,
381  pattern=[(part)])
382 
383  partGroup_digi.defineHistogram('Digi_part_LB, Digi_part_adc;ADC_vs_LB_'+thisSel,
384  title='ADC value vs LB '+selStrPart[thisSel]+'; LB; ADC Value',
385  type='TProfile',
386  cutmask='Digi_part_'+thisSel,
387  path=thisTopPath,
388  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
389  ybins=500, ymin=0, ymax=5000,
390  pattern=[(part)])
391 
392  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_diff_adc_ped;Diff_ADC_Ped_vs_BCID_'+thisSel,
393  title='ADC - Pedestal (all samples) vs BCID '+selStrPart[thisSel]+'; BCID; ADC Value',
394  type='TProfile',
395  cutmask='Digi_part_'+thisSel,
396  path=thisTopPath,
397  xbins=3564,xmin=-0.5,xmax=3563.5,
398  ybins=500, ymin=-5, ymax=5,
399  pattern=[(part)])
400 
401 
402 
403  #for thisSel in [ "passSCNom", "passSCNom1", "passSCNom10", "passSCNom10tauGt3", "saturNotMasked", "OFCbOFNotMasked", "onlofflEmismatch", "notMaskedEoflNe0", "notMaskedEoflGt1"]:
404  for thisSel in [ "zeroET", "passSCNom0_0p325", "passSCNom0p325_1", "passSCNom1", "passSCNom10", "passSCNom10tauGt3", "saturNotMasked", "OFCbOFNotMasked", "onlofflEmismatch", "notMaskedEoflNe0", "notMaskedEoflGt1"]:
405  thisTopPath=f"/{thisSel}/{topPath}"
406  # Histos that we only want for all partitions/layers combined lalala
407  if part == "ALL":
408  partGroup_sc.defineHistogram('SC_part_latomesourceidbin,SC_part_et_onl;SC_ET_Onl_vs_LATOME_'+thisSel,
409  title='SC ET [GeV] vs LATOME name '+selStrPart[thisSel]+'; ; ET SC [GeV]',
410  type='TH2F',
411  cutmask='SC_part_'+thisSel,
412  path=thisTopPath,
413  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
414  ybins=200, ymin=-10, ymax=200,
415  xlabels=BinLabel_LATOME,
416  pattern=[(part)])
417 
418 
419  partGroup_sc.defineHistogram('SC_part_LB,SC_part_latomesourceidbin;LB_vs_LATOME_'+thisSel,
420  title='LATOME name vs LB '+selStrPart[thisSel]+';LB;LATOME',
421  type='TH2F',
422  cutmask='SC_part_'+thisSel,
423  path=thisTopPath,
424  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
425  ybins=NLatomeBins,ymin=1,ymax=NLatomeBins+1,
426  ylabels=BinLabel_LATOME,
427  pattern=[(part)])
428 
429  partGroup_sc.defineHistogram('SC_part_time,SC_part_et_ofl;time_vs_et_ofl_'+thisSel,
430  title='SC coverage '+selStrPart[thisSel]+': #tau vs ET ofl;#tau;ET ofl',
431  type='TH2F',
432  cutmask='SC_part_'+thisSel,
433  path=thisTopPath,
434  xbins=500,xmin=-50,xmax=50,
435  ybins=500,ymin=-10,ymax=70,
436  pattern=[(part)])
437 
438 
439  partGroup_sc.defineHistogram('SC_part_latomesourceidbin,SC_part_time;MeanOfflineLATOMEtime_vs_LATOME_'+thisSel,
440  title='Average LATOME #tau from Offline computation per LATOME'+selStrPart[thisSel]+'; LATOME ; #tau [ns]',
441  type='TH2F',
442  cutmask='SC_part_'+thisSel,
443  path=thisTopPath,
444  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
445  ybins=200, ymin=-50, ymax=50,
446  xlabels=BinLabel_LATOME,
447  pattern=[(part)])
448 
449  partGroup_sc.defineHistogram('SC_part_LB,SC_part_latomesourceidbin,SC_part_time;MeanOfflineLATOMEtime_perLB_perLATOME_'+thisSel,
450  title='SC #tau '+selStrPart[thisSel]+': LATOME vs LB;LB;LATOME',
451  type='TProfile2D',
452  cutmask='SC_part_'+thisSel,
453  path=thisTopPath,
454  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
455  ybins=NLatomeBins,ymin=1,ymax=NLatomeBins+1,
456  ylabels=BinLabel_LATOME,
457  pattern=[(part)])
458 
459  partGroup_sc.defineHistogram('SC_part_LB,SC_part_time;MeanOfflineLATOMEtime_vs_LB_'+thisSel,
460  title='Average LATOME #tau from Offline computation per LB '+selStrPart[thisSel]+'; LumiBloc; #tau [ns]',
461  type='TProfile',
462  cutmask='SC_part_'+thisSel,
463  path=thisTopPath,
464  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
465  pattern=[(part)])
466 
467 
468 
469 
470  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi;Coverage_Eta_Phi_'+thisSel,
471  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
472  type='TH2F',
473  cutmask='SC_part_'+thisSel,
474  path=thisTopPath+'/Coverage',
475  xbins=partxbins,
476  ybins=partybins,
477  pattern=[(part)])
478 
479 
480  partGroup_sc.defineHistogram('SC_part_time;OfflineLATOMEtime_'+thisSel,
481  title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+';#tau [ns]; Evts;',
482  type='TH1F',
483  cutmask='SC_part_'+thisSel,
484  path=thisTopPath,
485  xbins=100,xmin=-25,xmax=25,
486  pattern=[(part)])
487 
488 
489  if not flags.Common.isOnline: continue # Skip the remaining histos if we are running offline
490 
491  if thisSel != "passSCNom1": continue
492 
493  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi,SC_part_et_onl;Coverage_Et_Onl_'+thisSel,
494  title='SC Energy '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
495  type='TProfile2D',
496  cutmask='SC_part_'+thisSel,
497  path=thisTopPath+'/Coverage',
498  xbins=partxbins,
499  ybins=partybins,
500  pattern=[(part)])
501 
502  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi,SC_part_time;Coverage_OfflineLATOMEtime_'+thisSel,
503  title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
504  type='TProfile2D',
505  cutmask='SC_part_'+thisSel,
506  path=thisTopPath+'/Coverage',
507  xbins=partxbins,
508  ybins=partybins,
509  pattern=[(part)])
510 
511  partGroup_sc.defineHistogram('SC_part_et_onl,SC_part_et_ofl;ET_Ofl_vs_ET_Onl_'+thisSel,
512  title='LATOME ET vs Offline Computation '+selStrPart[thisSel]+'; ET Onl;ET Offl [GeV]',
513  type='TH2F',
514  cutmask='SC_part_'+thisSel,
515  path=thisTopPath,
516  xbins=0,xmin=0,xmax=20,
517  ybins=0,ymin=0,ymax=20,
518  pattern=[(part)])
519 
520  partGroup_sc.defineHistogram('SC_part_et_diff;ET_Diff_OnlOfl_'+thisSel,
521  title='LATOME ET vs Offline Computation '+selStrPart[thisSel]+'; ET Onl - ET Offl [GeV]; Evts;',
522  type='TH1F',
523  cutmask='SC_part_'+thisSel,
524  path=thisTopPath,
525  xbins=200,xmin=-10,xmax=10,
526  pattern=[(part)])
527 
528 
529  partGroup_sc.defineHistogram('SC_part_et_onl;SC_ET_Onl_'+thisSel,
530  title='SC eT [GeV] '+selStrPart[thisSel],
531  type='TH1F',
532  cutmask='SC_part_'+thisSel,
533  path=thisTopPath,
534  xbins=500, xmin=-100, xmax=400,
535  pattern=[(part)])
536 
537 
538  partGroup_sc.defineHistogram('SC_part_BCID,SC_part_time;MeanOfflineLATOMEtime_vs_BCID_'+thisSel,
539  title='Average LATOME #tau from Offline computation per BCID '+selStrPart[thisSel]+'; BCID; #tau [ns]',
540  type='TProfile',
541  cutmask='SC_part_'+thisSel,
542  path=thisTopPath,
543  xbins=3564,xmin=-0.5,xmax=3563.5,
544  pattern=[(part)])
545 
546  partGroup_sc.defineHistogram('SC_part_BCID,SC_part_et_onl_muscaled;AvEnergyVsBCID_'+thisSel,
547  title='Average Energy vs BCID '+selStrPart[thisSel]+'; BCID; Energy per SC [MeV]',
548  type='TProfile',
549  cutmask='SC_part_'+thisSel,
550  path=thisTopPath,
551  xbins=3564,xmin=-0.5,xmax=3563.5,
552  ybins=10, ymin=-20, ymax=20,
553  pattern=[(part)])
554 
555  for thisSel in ["passSCNomInvalid"]:
556  thisTopPath=f"/{thisSel}/{topPath}"
557  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi;Coverage_Eta_Phi_'+thisSel,
558  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
559  type='TH2F',
560  path=thisTopPath+'/Coverage',
561  cutmask='SC_part_'+thisSel,
562  xbins=partxbins,
563  ybins=partybins,
564  pattern=[(part)])
565 
566 
567 
568  return helper.result()
569 
570 
571 if __name__=='__main__':
572 
573  from AthenaConfiguration.AllConfigFlags import initConfigFlags
574  from AthenaConfiguration.TestDefaults import defaultGeometryTags
575  flags = initConfigFlags()
576 
577  from AthenaConfiguration.Enums import LHCPeriod
578  flags.GeoModel.Run = LHCPeriod.Run3
579 
580  flags.Input.Files = ["/eos/atlas/atlascerngroupdisk/proj-spot/spot-job-inputs/data23_13p6TeV/data23_13p6TeV.00451569.physics_Main.daq.RAW._lb0260._SFO-14._0001.data"]
581 
582  flags.Output.HISTFileName = 'LArDigitalTriggMonOutput.root'
583 
584  flags.DQ.useTrigger = False
585  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
586  flags.PerfMon.doFullMonMT=True
587  flags.Exec.MaxEvents=100
588  flags.fillFromArgs()
589  flags.lock()
590 
591  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
592  cfg = MainServicesCfg(flags)
593 
594  # in case of tier0 workflow:
595  from CaloRec.CaloRecoConfig import CaloRecoCfg
596  cfg.merge(CaloRecoCfg(flags))
597 
598  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
599  cfg.merge(LArBadChannelCfg(flags, isSC=True))
600 
601  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
602  SCData_acc = LArRawSCDataReadingCfg(flags)
603 
604  cfg.merge(SCData_acc)
605 
606  larLATOMEBuilderAlg=CompFactory.LArLATOMEBuilderAlg("LArLATOMEBuilderAlg",LArDigitKey="SC", isADCBas=False)
607  cfg.addEventAlgo(larLATOMEBuilderAlg)
608 
609  streamTypes = ["SelectedEnergy", "ADC"]
610  aff_acc = LArDigitalTriggMonConfig(flags, larLATOMEBuilderAlg, streamTypes=streamTypes)
611  cfg.merge(aff_acc)
612 
613  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
614  cfg.merge(PerfMonMTSvcCfg(flags))
615 
616  cfg.run()
617 
618 
python.CaloRecoConfig.CaloRecoCfg
def CaloRecoCfg(flags, clustersname=None)
Definition: CaloRecoConfig.py:9
python.LuminosityCondAlgConfig.LuminosityCondAlgCfg
def LuminosityCondAlgCfg(flags, useOnlineLumi=None, suffix=None)
Definition: LuminosityCondAlgConfig.py:17
LArCablingConfig.LArOnOffIdMappingSCCfg
def LArOnOffIdMappingSCCfg(configFlags)
Definition: LArCablingConfig.py:65
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
LArDigitalTriggMonAlg.LArDigitalTriggMonConfig
def LArDigitalTriggMonConfig(flags, larLATOMEBuilderAlg, nsamples=32, streamTypes=[])
Definition: LArDigitalTriggMonAlg.py:41
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.LArElecCalibDBConfig.LArElecCalibDBSCCfg
def LArElecCalibDBSCCfg(flags, condObjs, sqlite=None)
Definition: LArElecCalibDBConfig.py:126
str
Definition: BTagTrackIpAccessor.cxx:11
python.LArRawSCDataReadingConfig.LArRawSCDataReadingCfg
def LArRawSCDataReadingCfg(configFlags, ROBList=None, name="LArRawSCDataReadingAlg", **kwargs)
Definition: LArRawSCDataReadingConfig.py:8