ATLAS Offline Software
Loading...
Searching...
No Matches
ZdcLEDMonitorAlgorithm Namespace Reference

Functions

 ZdcLEDMonitoringConfig (inputFlags, run_type)

Detailed Description

@file ZdcLEDMonitorAlgorithm.py
@author Y. Guo
@author S. Mohapatra
@date 2023-08-01
@brief python configuration for ZDC LED monitoring under the Run III DQ framework
       will be run in the ZDC LED calibration stream
       see ExampleMonitorAlgorithm.py in AthenaMonitoring package for detailed step explanations

Function Documentation

◆ ZdcLEDMonitoringConfig()

ZdcLEDMonitorAlgorithm.ZdcLEDMonitoringConfig ( inputFlags,
run_type )

Definition at line 14 of file ZdcLEDMonitorAlgorithm.py.

14def ZdcLEDMonitoringConfig(inputFlags, run_type):
15
16 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
17 result = ComponentAccumulator()
18
19#---------------------------------------------------------------------------------------
20 from AthenaMonitoring import AthMonitorCfgHelper
21 helper = AthMonitorCfgHelper(inputFlags,'ZdcAthMonitorCfg')
22
23 from AthenaConfiguration.ComponentFactory import CompFactory
24 zdcLEDMonAlg = helper.addAlgorithm(CompFactory.ZdcLEDMonitorAlgorithm,'ZdcLEDMonAlg')
25
26 zdcLEDMonAlg.EnableZDC = inputFlags.Detector.EnableZDC_ZDC
27 zdcLEDMonAlg.EnableRPD = inputFlags.Detector.EnableZDC_RPD
28# --------------------------------------------------------------------------------------------------
29
30 LEDs = ["Blue1", "Green", "Blue2"]
31 sides = ["C","A"]
32 modules = ["0","1","2","3"]
33 channels = ["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"]
34
35 n_energy_bins_default = 200
36 n_adc_sum_fine_bins = 800
37 n_time_bins_default = 150
38 n_sample_bins_default = 25
39 lumi_block_max = 2000
40 l1TriggerType_max = 256
41 adc_sum_max = 40000.0
42 max_adc_max = 4096.0
43 nsamples_max = 25.0
44 time_max = 75.0
45
46 nDecodingErrorBits = 3
47
48# --------------------------------------------------------------------------------------------------
49 zdcLEDAllEventsDiagMonTool = helper.addGroup(zdcLEDMonAlg, 'ZdcLEDAllEventsDiagnosis','ZDC/AllLEDEventsDiagnosis/')
50
51 zdcModLEDMonToolArr = helper.addArray([LEDs,sides,modules],zdcLEDMonAlg,'ZdcModLEDMonitor', topPath='ZDC/ZDCLED/')
52 rpdChanLEDMonToolArr = helper.addArray([LEDs,sides,channels],zdcLEDMonAlg,'RPDChanLEDMonitor', topPath='ZDC/RPDLED/')
53
54# ------------------------- All-event (including bad events) diagnostic histograms -------------------------
55
56
57 zdcLEDAllEventsDiagMonTool.defineHistogram('decodingErrorBits',title=';;Events',
58 xbins=nDecodingErrorBits,xmin=0.0,xmax=nDecodingErrorBits,opt='kVec',
59 xlabels=['No Decoding Error', 'ZDC Decoding Error', 'RPD Decoding Error'])
60
61 zdcLEDAllEventsDiagMonTool.defineHistogram('l1TriggerType', title=';L1TriggerType;Events',
62 xbins=l1TriggerType_max,xmin=0.0,xmax=l1TriggerType_max)
63
64 # zdcLEDAllEventsDiagMonTool.defineHistogram('lumiBlock, l1TriggerType', type='TH2F', title=';lumi block;L1TriggerType',
65 # path='L1TriggerType',
66 # xbins=int(lumi_block_max/10),xmin=0.0,xmax=lumi_block_max,
67 # ybins=l1TriggerType_max,ymin=0.0,ymax=l1TriggerType_max)
68
69
70# -------------------------------------------- Observables ------------------------------------------------------
71
72 zdcModLEDMonToolArr.defineHistogram('zdcLEDADCSum', title=';LED ADC Sum [ADC Counts];Events',
73 path='zdcLEDADCSum',
74 xbins=n_adc_sum_fine_bins,xmin=0.0,xmax=adc_sum_max)
75 zdcModLEDMonToolArr.defineHistogram('zdcLEDMaxADC', title=';LED Max ADC [ADC Counts];Events',
76 path='zdcLEDMaxADC',
77 xbins=n_energy_bins_default,xmin=0.0,xmax=max_adc_max)
78 zdcModLEDMonToolArr.defineHistogram('zdcLEDMaxSample', title=';LED Max Sample [ADC Counts];Events',
79 path='zdcLEDMaxSample',
80 xbins=n_sample_bins_default,xmin=0.0,xmax=nsamples_max)
81 zdcModLEDMonToolArr.defineHistogram('zdcLEDAvgTime', title=';LED Average Time [ns];Events',
82 path='zdcLEDAvgTime',
83 xbins=n_time_bins_default,xmin=0.0,xmax=time_max)
84 rpdChanLEDMonToolArr.defineHistogram('rpdLEDADCSum', title=';LED ADC Sum [ADC Counts];Events',
85 cutmask='rpdLEDPassFireCriteria',
86 path='rpdLEDADCSum',
87 xbins=n_adc_sum_fine_bins,xmin=0.0,xmax=adc_sum_max)
88 rpdChanLEDMonToolArr.defineHistogram('rpdLEDMaxADC', title=';LED Max ADC [ADC Counts];Events',
89 cutmask='rpdLEDPassFireCriteria',
90 path='rpdLEDMaxADC',
91 xbins=n_energy_bins_default,xmin=0.0,xmax=max_adc_max)
92 rpdChanLEDMonToolArr.defineHistogram('rpdLEDMaxSample', title=';LED Max Sample [ADC Counts];Events',
93 cutmask='rpdLEDPassFireCriteria',
94 path='rpdLEDMaxSample',
95 xbins=n_sample_bins_default,xmin=0.0,xmax=nsamples_max)
96 rpdChanLEDMonToolArr.defineHistogram('rpdLEDAvgTime', title=';LED Average Time [ns];Events',
97 cutmask='rpdLEDPassFireCriteria',
98 path='rpdLEDAvgTime',
99 xbins=n_time_bins_default,xmin=0.0,xmax=time_max)
100
101# -------------------------------------------- lumi block dependence ------------------------------------------------------
102
103 zdcModLEDMonToolArr.defineHistogram('lumiBlock, zdcLEDADCSum;zdcLEDADCSum_vs_lb', type='TH2F', title=';lumi block;LED ADC Sum [ADC Counts]',
104 path='zdcLEDADCSumLBdep',
105 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
106 ybins=n_adc_sum_fine_bins,ymin=0.0,ymax=adc_sum_max)
107 zdcModLEDMonToolArr.defineHistogram('lumiBlock, zdcLEDMaxADC;zdcLEDMaxADC_vs_lb', type='TH2F', title=';lumi block;LED Max ADC [ADC Counts]',
108 path='zdcLEDMaxADCLBdep',
109 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
110 ybins=n_energy_bins_default,ymin=0.0,ymax=max_adc_max)
111 zdcModLEDMonToolArr.defineHistogram('lumiBlock, zdcLEDMaxSample;zdcLEDMaxSample_vs_lb', type='TH2F', title=';lumi block;LED Max Sample [ADC Counts]',
112 path='zdcLEDMaxSampleLBdep',
113 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
114 ybins=n_sample_bins_default,ymin=0.0,ymax=nsamples_max)
115 zdcModLEDMonToolArr.defineHistogram('lumiBlock, zdcLEDAvgTime;zdcLEDAvgTime_vs_lb', type='TH2F', title=';lumi block;LED Average Time [ns]',
116 path='zdcLEDAvgTimeLBdep',
117 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
118 ybins=n_time_bins_default,ymin=0.0,ymax=time_max)
119 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDADCSum;rpdLEDADCSum_vs_lb', type='TH2F', title=';lumi block;LED ADC Sum [ADC Counts]',
120 cutmask='rpdLEDPassFireCriteria',
121 path='rpdLEDADCSumLBdep',
122 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
123 ybins=n_adc_sum_fine_bins,ymin=0.0,ymax=adc_sum_max)
124 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDMaxADC;rpdLEDMaxADC_vs_lb', type='TH2F', title=';lumi block;LED Max ADC [ADC Counts]',
125 cutmask='rpdLEDPassFireCriteria',
126 path='rpdLEDMaxADCLBdep',
127 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
128 ybins=n_energy_bins_default,ymin=0.0,ymax=max_adc_max)
129 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDADCSum;rpdLEDADCSum_vs_lb_profile', type='TProfile', title=';lumi block;LED ADC Sum [ADC Counts]',
130 cutmask='rpdLEDPassFireCriteria',
131 path='rpdLEDADCSumLBdep',
132 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
133 ybins=n_adc_sum_fine_bins,ymin=0.0,ymax=adc_sum_max)
134 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDMaxADC;rpdLEDMaxADC_vs_lb_profile', type='TProfile', title=';lumi block;LED Max ADC [ADC Counts]',
135 cutmask='rpdLEDPassFireCriteria',
136 path='rpdLEDMaxADCLBdep',
137 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
138 ybins=n_energy_bins_default,ymin=0.0,ymax=max_adc_max)
139 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDMaxSample;rpdLEDMaxSample_vs_lb', type='TH2F', title=';lumi block;LED Max Sample [ADC Counts]',
140 cutmask='rpdLEDPassFireCriteria',
141 path='rpdLEDMaxSampleLBdep',
142 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
143 ybins=n_sample_bins_default,ymin=0.0,ymax=nsamples_max)
144 rpdChanLEDMonToolArr.defineHistogram('lumiBlock, rpdLEDAvgTime;rpdLEDAvgTime_vs_lb', type='TH2F', title=';lumi block;LED Average Time [ns]',
145 cutmask='rpdLEDPassFireCriteria',
146 path='rpdLEDAvgTimeLBdep',
147 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
148 ybins=n_time_bins_default,ymin=0.0,ymax=time_max)
149
150
151 acc = helper.result()
152 result.merge(acc)
153 return result
154
155