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  hasEtId = False
69  hasEt = False
70  hasAdc = False
71  hasAdcBas = False
72  RawSCContainerKey = ""
73  DigitContainerKey = ""
74  for i in range(0,len(streamTypes)):
75  mlog.info("runinfo.streamTypes()[i]: "+str(streamTypes[i]))
76  if streamTypes[i] == "SelectedEnergy":
77  hasEtId = True
78  RawSCContainerKey = "SC_ET_ID"
79  if streamTypes[i] == "Energy":
80  hasEt = True
81  RawSCContainerKey = "SC_ET"
82  if streamTypes[i] == "RawADC":
83  hasAdc = True
84  larLATOMEBuilderAlg.LArDigitKey = "SC"
85  larLATOMEBuilderAlg.isADCBas = False
86  DigitContainerKey = "SC"
87  if streamTypes[i] == "ADC":
88  hasAdcBas = True
89  DigitContainerKey = "SC_ADC_BAS"
90  larLATOMEBuilderAlg.isADCBas = True
91  larLATOMEBuilderAlg.LArDigitKey = "SC_ADC_BAS"
92 
93  # if no energies in the receipe, do not run this algo....
94  if len(RawSCContainerKey)==0:
95  print("No energies, not including LArDigitalTriggMonAlg")
96  return helper.result()
97 
98  larDigitalTriggMonAlg = helper.addAlgorithm(CompFactory.LArDigitalTriggMonAlg('larDigitalTriggMonAlg'))
99  larDigitalTriggMonAlg.ProblemsToMask=["maskedOSUM"] #highNoiseHG","highNoiseMG","highNoiseLG","deadReadout","deadPhys"]
100  if nsamples < 4:
101  larDigitalTriggMonAlg.LArRawSCEtRecoContainerKey="dummy" # this will not exists, so not used in monitoring
102 
103  larDigitalTriggMonAlg.isADCBas = hasAdcBas
104  larDigitalTriggMonAlg.LArRawSCContainerKey = RawSCContainerKey
105  larDigitalTriggMonAlg.LArDigitContainerKey = DigitContainerKey
106 
107  if (hasEtId and hasEt): #prefer EtId if both in recipe
108  hasEt = False
109  #larDigitalTriggMonAlg.EtName = "SC_ET_ID"
110 
111  if (hasAdc and hasAdcBas): #prefer Raw Adc if both in recipe
112  hasAdc = False
113  larDigitalTriggMonAlg.isADCBas=False
114 
115  mlog.info("Mux settings from COOL:")
116  mlog.info("has ET Id: "+str(hasEtId))
117  mlog.info("has ET: "+str(hasEt))
118  mlog.info("has ADC: "+str(hasAdc))
119  mlog.info("has ADC Bas: "+str(hasAdcBas))
120 
121  SCGroupName="SC"
122  larDigitalTriggMonAlg.SCMonGroup=SCGroupName
123  # uncomment if needed:
124  #larDigitalTriggMonAlg.FileKey="CombinedMonitoring"
125 
126  SCGroup = helper.addGroup(
127  larDigitalTriggMonAlg,
128  SCGroupName,
129  '/LArDigitalTrigger/',
130  'run'
131  )
132 
133  sc_hist_path='/'
134 
135  LatomeDetBinMapping = dict([
136  ("0x48",{"Subdet":"FCALC","Bin":1}),
137  ("0x4c",{"Subdet":"EMEC/HECC","Bin":3}),
138  ("0x44",{"Subdet":"EMECC","Bin":11}),
139  ("0x4a",{"Subdet":"EMB/EMECC","Bin":27}),
140  ("0x42",{"Subdet":"EMBC","Bin":43}),
141  ("0x41",{"Subdet":"EMBA","Bin":59}),
142  ("0x49",{"Subdet":"EMB/EMECA","Bin":75}),
143  ("0x43",{"Subdet":"EMECA","Bin":91}),
144  ("0x4b",{"Subdet":"EMEC/HECA","Bin":107}),
145  ("0x47",{"Subdet":"FCALA","Bin":115})
146  ])
147  NLatomeBins=117
148  NLatomeBins_side=59
149 
150  BinLabel_LATOME=[]
151  BinLabel_LATOME_A=[]
152  BinLabel_LATOME_C=[]
153  phi=0
154  for bb in range (0,NLatomeBins):
155  Label=""
156  for detID in LatomeDetBinMapping:
157  if bb==(LatomeDetBinMapping[detID]["Bin"]-1):
158  Label=LatomeDetBinMapping[detID]["Subdet"]
159  phi=1
160  break
161  if bb < NLatomeBins_side:
162  BinLabel_LATOME_C+=[Label+str(phi)]
163  else:
164  BinLabel_LATOME_A+=[Label+str(phi)]
165 
166  BinLabel_LATOME+=[Label+str(phi)]
167  phi+=1
168 
169 
170 
171 
172  iphi_bins_dict = {"ALL": 63, "EMB": 63, "EMEC": 63, "HEC": 63, "FCAL": 15}
173 
174 
175 
176 
177  SCGroup.defineHistogram('lumi_block,event_size;EventSize_vs_LB',
178  title='Digital trigger event size per LB; LumiBlock; Event size [MB]',
179  type='TProfile',
180  path=sc_hist_path,
181  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
182 
183 
184 
185 
186  partGroup_digi = helper.addArray([larDigitalTriggMonAlg.LayerNames], larDigitalTriggMonAlg, 'LArDigitalTriggerMon_digi', topPath='/LArDigitalTrigger/')
187  partGroup_sc = helper.addArray([larDigitalTriggMonAlg.LayerNames], larDigitalTriggMonAlg, 'LArDigitalTriggerMon_sc', topPath='/LArDigitalTrigger/')
188 
189  for part in larDigitalTriggMonAlg.LayerNames:
190  selStrPart = {}
191  for sel in selStr.keys():
192  selStrPart[sel] = "in "+part+" "+selStr[sel]
193  iphi_bins = 63
194  for key in iphi_bins_dict.keys():
195  if part.startswith(key):
196  iphi_bins = iphi_bins_dict[key]
197 
198  if part == "ALL":
199  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"]["All"]["All"]
200  partybins=lArDQGlobals.SuperCell_Variables["phiRange"]["All"]["All"]
201  topPath=""
202  else:
203  topPath="PerPartition/"
204  Side = part[-1]
205  if "HEC" in part:
206  Sampling = "0"
207  Part = part[:-1]
208  else:
209  Sampling = part[-2]
210  Part = part[:-2]
211  if Part == "FCAL":
212  Part = "FCal"
213  if Sampling == "P":
214  Sampling = "0"
215  partxbins=lArDQGlobals.SuperCell_Variables["etaRange"][Part][Side][Sampling]
216  partybins=lArDQGlobals.SuperCell_Variables["phiRange"][Part][Side][Sampling]
217 
218 
219 
220 
221  for thisSel in [ "passDigiNom", "badNotMasked"]:
222  thisTopPath=f"/{thisSel}/{topPath}"
223  # Histos that we only want for all partitions/layers combined lalala
224  if part == "ALL":
225  partGroup_digi.defineHistogram('Digi_part_maxpos,Digi_part_partition;Partition_vs_maxSamplePosition_'+thisSel,
226  title='Partition vs. position of max sample '+selStrPart[thisSel],
227  cutmask='Digi_part_'+thisSel,
228  type='TH2F',
229  path=thisTopPath,
230  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
231  ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
232  xlabels = [str(x) for x in range(1,nsamples+1)],
233  ylabels=lArDQGlobals.Partitions,
234  pattern=[(part)])
235 
236  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_adc;ADCFullRange_vs_LATOME_'+thisSel,
237  title='ADC vs LATOME name '+selStrPart[thisSel]+'; ; ADC',
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_pedestal;Pedestal_vs_LATOME_'+thisSel,
247  title='Pedestal vs LATOME name '+selStrPart[thisSel]+'; ; Pedestal',
248  cutmask='Digi_part_'+thisSel,
249  type='TH2F',
250  path=thisTopPath,
251  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
252  ybins=500, ymin=-2, ymax=2500, #raw ADC is 12 bit
253  xlabels=BinLabel_LATOME,
254  pattern=[(part)])
255 
256  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_maxpos;MaxSamplePosition_vs_LATOME_'+thisSel,
257  title='Position of max sample vs. LATOME '+selStrPart[thisSel],
258  type='TH2F',
259  cutmask='Digi_part_'+thisSel,
260  path=thisTopPath,
261  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
262  ybins=nsamples,ymin=0.5,ymax=nsamples+0.5,
263  xlabels=BinLabel_LATOME,
264  ylabels = [str(x) for x in range(1,nsamples+1)],
265  pattern=[(part)])
266 
267  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_diff_adc0_ped;Diff_ADC0_Ped_vs_LATOME_'+thisSel,
268  title='ADC[0] - Pedestal vs LATOME name '+selStrPart[thisSel]+'; ; ADC[0] - 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  partGroup_digi.defineHistogram('Digi_part_latomesourceidbin,Digi_part_diff_adc_ped_norm;Diff_ADC_Ped_Norm_vs_LATOME_'+thisSel,
278  title='(ADC-ped)/fabs(ADC_max-ped) '+selStrPart[thisSel]+'; LATOME Name; (ADC - pedestal) / fabs(ADC_max - pedestal)',
279  type='TH2F',
280  cutmask='Digi_part_'+thisSel,
281  path=thisTopPath,
282  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
283  ybins=64, ymin=-32, ymax=32,
284  xlabels=BinLabel_LATOME,
285  pattern=[(part)])
286 
287 
288 
289  partGroup_digi.defineHistogram('Digi_part_eta,Digi_part_phi;Coverage_Eta_Phi_'+thisSel,
290  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
291  type='TH2F',
292  path=thisTopPath+'/Coverage',
293  cutmask='Digi_part_'+thisSel,
294  xbins=partxbins,
295  ybins=partybins,
296  pattern=[(part)])
297 
298 
299  if not flags.Common.isOnline: continue # Skip the remaining histos if we are running offline
300 
301  if thisSel != "passDigiNom": continue
302  partGroup_digi.defineHistogram('Digi_part_eta,Digi_part_phi,Digi_part_diff_adc0_ped;Coverage_Diff_ADC0_Ped_'+thisSel,
303  title='ADC[0] - Pedestal'+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
304  type='TProfile2D',
305  cutmask='Digi_part_'+thisSel,
306  path=thisTopPath+'/Coverage',
307  xbins=partxbins,
308  ybins=partybins,
309  pattern=[(part)])
310 
311 
312 
313  partGroup_digi.defineHistogram('Digi_part_BCID,Digi_part_iphi,Digi_part_diff_adc_ped;Diff_ADC_Ped_Per_BCID_Per_iphi_'+thisSel,
314  title='ADC - Pedestal (all samples) '+selStrPart[thisSel]+': iphi vs BCID;BCID;iphi',
315  type='TProfile2D',
316  cutmask='Digi_part_'+thisSel,
317  path=thisTopPath,
318  xbins=3564,xmin=-0.5,xmax=3563.5,
319  ybins=iphi_bins+1,ymin=0,ymax=iphi_bins+1, # Make a lardqglobals for ieta iphi?
320  pattern=[(part)])
321 
322 
323 
324 
325 
326 
327  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_adc;ADCZoom_vs_SamplePosition_'+thisSel,
328  title='ADC (zoom) 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=750, ymin=0, ymax=1300, #start from 0 otherwise miss endcap pedestals
335  pattern=[(part)])
336 
337  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_adc;ADCFullRange_vs_SamplePosition_'+thisSel,
338  title='ADC 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_sampos,Digi_part_pedestal;Pedestal_vs_SamplePosition_'+thisSel,
348  title='Pedestal vs sample position '+selStrPart[thisSel],
349  cutmask='Digi_part_'+thisSel,
350  type='TH2F',
351  path=thisTopPath,
352  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
353  xlabels = [str(x) for x in range(1,nsamples+1)],
354  ybins=500, ymin=0, ymax=5000, #raw ADC is 12 bit
355  pattern=[(part)])
356 
357  partGroup_digi.defineHistogram('Digi_part_diff_adc0_ped;Diff_ADC0_Ped_'+thisSel,
358  title='LATOME (ADC[0]-ped) '+selStrPart[thisSel]+'; (ADC - pedestal)',
359  type='TH1F',
360  cutmask='Digi_part_'+thisSel,
361  path=thisTopPath,
362  xbins=50,xmin=-25,xmax=25,
363  pattern=[(part)])
364 
365  partGroup_digi.defineHistogram('Digi_part_sampos,Digi_part_diff_adc_ped_norm;Diff_ADC_Ped_Norm_vs_SamplePosition_'+thisSel,
366  title='(ADC-ped)/fabs(ADC_max-ped) '+selStrPart[thisSel]+'; Sample position; (ADC - pedestal) / fabs(ADC_max - pedestal)',
367  type='TH2F',
368  cutmask='Digi_part_'+thisSel,
369  path=thisTopPath,
370  ybins=40,ymin=-1,ymax=1,
371  xbins=nsamples,xmin=0.5,xmax=nsamples+0.5,
372  xlabels = [str(x) for x in range(1,nsamples+1)],
373  pattern=[(part)])
374 
375  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_adc;ADC_vs_BCID_'+thisSel,
376  title='ADC value vs BCID '+selStrPart[thisSel]+'; BCID; ADC Value',
377  type='TProfile',
378  cutmask='Digi_part_'+thisSel,
379  path=thisTopPath,
380  xbins=3564,xmin=-0.5,xmax=3563.5,
381  ybins=500, ymin=0, ymax=5000,
382  pattern=[(part)])
383 
384  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_diff_adc0_ped;Diff_ADC0_Ped_vs_BCID_'+thisSel,
385  title='ADC[0] - Ped value vs BCID '+selStrPart[thisSel]+'; BCID; ADC[0] Value',
386  type='TProfile',
387  cutmask='Digi_part_'+thisSel,
388  path=thisTopPath,
389  xbins=3564,xmin=-0.5,xmax=3563.5,
390  ybins=500, ymin=-5, ymax=5,
391  pattern=[(part)])
392 
393  partGroup_digi.defineHistogram('Digi_part_LB, Digi_part_adc;ADC_vs_LB_'+thisSel,
394  title='ADC value vs LB '+selStrPart[thisSel]+'; LB; ADC Value',
395  type='TProfile',
396  cutmask='Digi_part_'+thisSel,
397  path=thisTopPath,
398  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
399  ybins=500, ymin=0, ymax=5000,
400  pattern=[(part)])
401 
402  partGroup_digi.defineHistogram("Digi_part_LB, Digi_part_adc_rms;ADC_RMS_vs_LB_"+thisSel,
403  title="RMS of ADC values vs LB "+selStrPart[thisSel]+"; LB; RMS of ADC Values",
404  type="TProfile",
405  cutmask='Digi_part_'+thisSel,
406  path=thisTopPath,
407  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
408  ybins=100, ymin=0, ymax=10,
409  pattern=[(part)])
410 
411  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_adc_rms;ADC_RMS_vs_BCID_'+thisSel,
412  title='RMS of ADC values vs BCID '+selStrPart[thisSel]+'; BCID; RMS of ADC Values',
413  type='TProfile',
414  cutmask='Digi_part_'+thisSel,
415  path=thisTopPath,
416  xbins=3564,xmin=-0.5,xmax=3563.5,
417  ybins=100, ymin=0, ymax=10,
418  pattern=[(part)])
419 
420 
421  partGroup_digi.defineHistogram('Digi_part_BCID, Digi_part_diff_adc_ped;Diff_ADC_Ped_vs_BCID_'+thisSel,
422  title='ADC - Pedestal (all samples) vs BCID '+selStrPart[thisSel]+'; BCID; ADC Value',
423  type='TProfile',
424  cutmask='Digi_part_'+thisSel,
425  path=thisTopPath,
426  xbins=3564,xmin=-0.5,xmax=3563.5,
427  ybins=500, ymin=-5, ymax=5,
428  pattern=[(part)])
429 
430 
431 
432  #for thisSel in [ "passSCNom", "passSCNom1", "passSCNom10", "passSCNom10tauGt3", "saturNotMasked", "OFCbOFNotMasked", "onlofflEmismatch", "notMaskedEoflNe0", "notMaskedEoflGt1"]:
433  for thisSel in [ "zeroET", "passSCNom0_0p325", "passSCNom0p325_1", "passSCNom1", "passSCNom10", "passSCNom10tauGt3", "saturNotMasked", "OFCbOFNotMasked", "onlofflEmismatch", "notMaskedEoflNe0", "notMaskedEoflGt1"]:
434  thisTopPath=f"/{thisSel}/{topPath}"
435  # Histos that we only want for all partitions/layers combined lalala
436  if part == "ALL":
437  partGroup_sc.defineHistogram('SC_part_latomesourceidbin,SC_part_et_onl;SC_ET_Onl_vs_LATOME_'+thisSel,
438  title='SC ET [GeV] vs LATOME name '+selStrPart[thisSel]+'; ; ET SC [GeV]',
439  type='TH2F',
440  cutmask='SC_part_'+thisSel,
441  path=thisTopPath,
442  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
443  ybins=200, ymin=-10, ymax=200,
444  xlabels=BinLabel_LATOME,
445  pattern=[(part)])
446 
447 
448  partGroup_sc.defineHistogram('SC_part_LB,SC_part_latomesourceidbin;LB_vs_LATOME_'+thisSel,
449  title='LATOME name vs LB '+selStrPart[thisSel]+';LB;LATOME',
450  type='TH2F',
451  cutmask='SC_part_'+thisSel,
452  path=thisTopPath,
453  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
454  ybins=NLatomeBins,ymin=1,ymax=NLatomeBins+1,
455  ylabels=BinLabel_LATOME,
456  pattern=[(part)])
457 
458  partGroup_sc.defineHistogram('SC_part_time,SC_part_et_ofl;time_vs_et_ofl_'+thisSel,
459  title='SC coverage '+selStrPart[thisSel]+': #tau vs ET ofl;#tau;ET ofl',
460  type='TH2F',
461  cutmask='SC_part_'+thisSel,
462  path=thisTopPath,
463  xbins=500,xmin=-50,xmax=50,
464  ybins=500,ymin=-10,ymax=70,
465  pattern=[(part)])
466 
467 
468  partGroup_sc.defineHistogram('SC_part_latomesourceidbin,SC_part_time;MeanOfflineLATOMEtime_vs_LATOME_'+thisSel,
469  title='Average LATOME #tau from Offline computation per LATOME'+selStrPart[thisSel]+'; LATOME ; #tau [ns]',
470  type='TH2F',
471  cutmask='SC_part_'+thisSel,
472  path=thisTopPath,
473  xbins=NLatomeBins,xmin=1,xmax=NLatomeBins+1,
474  ybins=200, ymin=-50, ymax=50,
475  xlabels=BinLabel_LATOME,
476  pattern=[(part)])
477 
478  partGroup_sc.defineHistogram('SC_part_LB,SC_part_latomesourceidbin,SC_part_time;MeanOfflineLATOMEtime_perLB_perLATOME_'+thisSel,
479  title='SC #tau '+selStrPart[thisSel]+': LATOME vs LB;LB;LATOME',
480  type='TProfile2D',
481  cutmask='SC_part_'+thisSel,
482  path=thisTopPath,
483  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
484  ybins=NLatomeBins,ymin=1,ymax=NLatomeBins+1,
485  ylabels=BinLabel_LATOME,
486  pattern=[(part)])
487 
488  partGroup_sc.defineHistogram('SC_part_LB,SC_part_time;MeanOfflineLATOMEtime_vs_LB_'+thisSel,
489  title='Average LATOME #tau from Offline computation per LB '+selStrPart[thisSel]+'; LumiBloc; #tau [ns]',
490  type='TProfile',
491  cutmask='SC_part_'+thisSel,
492  path=thisTopPath,
493  xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max,
494  pattern=[(part)])
495 
496 
497 
498 
499  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi;Coverage_Eta_Phi_'+thisSel,
500  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
501  type='TH2F',
502  cutmask='SC_part_'+thisSel,
503  path=thisTopPath+'/Coverage',
504  xbins=partxbins,
505  ybins=partybins,
506  pattern=[(part)])
507 
508 
509  partGroup_sc.defineHistogram('SC_part_time;OfflineLATOMEtime_'+thisSel,
510  title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+';#tau [ns]; Evts;',
511  type='TH1F',
512  cutmask='SC_part_'+thisSel,
513  path=thisTopPath,
514  xbins=100,xmin=-25,xmax=25,
515  pattern=[(part)])
516 
517 
518  if not flags.Common.isOnline: continue # Skip the remaining histos if we are running offline
519 
520  if thisSel != "passSCNom1": continue
521 
522  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi,SC_part_et_onl;Coverage_Et_Onl_'+thisSel,
523  title='SC Energy '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
524  type='TProfile2D',
525  cutmask='SC_part_'+thisSel,
526  path=thisTopPath+'/Coverage',
527  xbins=partxbins,
528  ybins=partybins,
529  pattern=[(part)])
530 
531  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi,SC_part_time;Coverage_OfflineLATOMEtime_'+thisSel,
532  title='LATOME #tau from Offline Computation '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
533  type='TProfile2D',
534  cutmask='SC_part_'+thisSel,
535  path=thisTopPath+'/Coverage',
536  xbins=partxbins,
537  ybins=partybins,
538  pattern=[(part)])
539 
540  partGroup_sc.defineHistogram('SC_part_et_onl,SC_part_et_ofl;ET_Ofl_vs_ET_Onl_'+thisSel,
541  title='LATOME ET vs Offline Computation '+selStrPart[thisSel]+'; ET Onl;ET Offl [GeV]',
542  type='TH2F',
543  cutmask='SC_part_'+thisSel,
544  path=thisTopPath,
545  xbins=0,xmin=0,xmax=20,
546  ybins=0,ymin=0,ymax=20,
547  pattern=[(part)])
548 
549  partGroup_sc.defineHistogram('SC_part_et_diff;ET_Diff_OnlOfl_'+thisSel,
550  title='LATOME ET vs Offline Computation '+selStrPart[thisSel]+'; ET Onl - ET Offl [GeV]; Evts;',
551  type='TH1F',
552  cutmask='SC_part_'+thisSel,
553  path=thisTopPath,
554  xbins=200,xmin=-10,xmax=10,
555  pattern=[(part)])
556 
557 
558  partGroup_sc.defineHistogram('SC_part_et_onl;SC_ET_Onl_'+thisSel,
559  title='SC eT [GeV] '+selStrPart[thisSel],
560  type='TH1F',
561  cutmask='SC_part_'+thisSel,
562  path=thisTopPath,
563  xbins=500, xmin=-100, xmax=400,
564  pattern=[(part)])
565 
566 
567  partGroup_sc.defineHistogram('SC_part_BCID,SC_part_time;MeanOfflineLATOMEtime_vs_BCID_'+thisSel,
568  title='Average LATOME #tau from Offline computation per BCID '+selStrPart[thisSel]+'; BCID; #tau [ns]',
569  type='TProfile',
570  cutmask='SC_part_'+thisSel,
571  path=thisTopPath,
572  xbins=3564,xmin=-0.5,xmax=3563.5,
573  pattern=[(part)])
574 
575  partGroup_sc.defineHistogram('SC_part_BCID,SC_part_et_onl_muscaled;AvEnergyVsBCID_'+thisSel,
576  title='Average Energy vs BCID '+selStrPart[thisSel]+'; BCID; Energy per SC [MeV]',
577  type='TProfile',
578  cutmask='SC_part_'+thisSel,
579  path=thisTopPath,
580  xbins=3564,xmin=-0.5,xmax=3563.5,
581  ybins=10, ymin=-20, ymax=20,
582  pattern=[(part)])
583 
584  for thisSel in ["passSCNomInvalid"]:
585  thisTopPath=f"/{thisSel}/{topPath}"
586  partGroup_sc.defineHistogram('SC_part_eta,SC_part_phi;Coverage_Eta_Phi_'+thisSel,
587  title='SC coverage '+selStrPart[thisSel]+': #phi vs #eta;#eta;#phi',
588  type='TH2F',
589  path=thisTopPath+'/Coverage',
590  cutmask='SC_part_'+thisSel,
591  xbins=partxbins,
592  ybins=partybins,
593  pattern=[(part)])
594 
595 
596 
597  return helper.result()
598 
599 
600 if __name__=='__main__':
601 
602  from AthenaConfiguration.AllConfigFlags import initConfigFlags
603  from AthenaConfiguration.TestDefaults import defaultGeometryTags
604  flags = initConfigFlags()
605 
606  from AthenaConfiguration.Enums import LHCPeriod
607  flags.GeoModel.Run = LHCPeriod.Run3
608 
609  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"]
610 
611  flags.Output.HISTFileName = 'LArDigitalTriggMonOutput.root'
612 
613  flags.DQ.useTrigger = False
614  flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
615  flags.PerfMon.doFullMonMT=True
616  flags.Exec.MaxEvents=100
617  flags.fillFromArgs()
618  flags.lock()
619 
620  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
621  cfg = MainServicesCfg(flags)
622 
623  # in case of tier0 workflow:
624  from CaloRec.CaloRecoConfig import CaloRecoCfg
625  cfg.merge(CaloRecoCfg(flags))
626 
627  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg
628  cfg.merge(LArBadChannelCfg(flags, isSC=True))
629 
630  from LArByteStream.LArRawSCDataReadingConfig import LArRawSCDataReadingCfg
631  SCData_acc = LArRawSCDataReadingCfg(flags)
632 
633  cfg.merge(SCData_acc)
634 
635  larLATOMEBuilderAlg=CompFactory.LArLATOMEBuilderAlg("LArLATOMEBuilderAlg",LArDigitKey="SC", isADCBas=False)
636  cfg.addEventAlgo(larLATOMEBuilderAlg)
637 
638  streamTypes = ["SelectedEnergy", "ADC"]
639  aff_acc = LArDigitalTriggMonConfig(flags, larLATOMEBuilderAlg, streamTypes=streamTypes)
640  cfg.merge(aff_acc)
641 
642  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
643  cfg.merge(PerfMonMTSvcCfg(flags))
644 
645  cfg.run()
646 
647 
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
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
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