6 '''@file ZdcMonitorAlgorithm.py
9 @brief python configuration for ZDC monitoring under the Run III DQ framework
10 will be run in the ZDC calibration stream & physics MinBias stream
11 see https://acode-browser1.usatlas.bnl.gov/lxr/source/athenAControl/AthenaMonitoring/python/ExampleMonitorAlgorithm.py
12 for details of structure of monitoring-configuration files
13 @reference https://twiki.cern.ch/twiki/bin/view/Atlas/DQRun3FrameworkTutorial
20 log_min = np.log10(min_value)
21 log_max = np.log10(max_value)
22 log_bin_edges = np.linspace(log_min, log_max, num_bins + 1)
23 bin_edges = [10 ** edge
for edge
in log_bin_edges]
30 from AthenaMonitoring
import AthMonitorCfgHelper
31 helper = AthMonitorCfgHelper(inputFlags,
'ZdcAthMonitorCfg')
33 from AthenaConfiguration.ComponentFactory
import CompFactory
34 zdcMonAlg = helper.addAlgorithm(CompFactory.ZdcMonitorAlgorithm,
'ZdcMonAlg')
36 from ZdcRec.ZdcRecConfig
import SetConfigTag
38 print (
'ZdcMonitorAlgorithm.py: Running with config tag ', config)
41 zdcMonAlg.EnableTrigger = inputFlags.DQ.useTrigger
42 zdcMonAlg.CalInfoOn = inputFlags.Input.TriggerStream ==
'physics_MinBias' or inputFlags.Input.TriggerStream ==
'express_express'
43 zdcMonAlg.IsOnline = inputFlags.Common.isOnline
44 zdcMonAlg.IsInjectedPulse = inputFlags.Input.TriggerStream ==
'calibration_ZDCInjCalib' or inputFlags.Input.TriggerStream ==
'calibration_DcmDummyProcessor'
45 zdcMonAlg.IsStandalone = inputFlags.Input.TriggerStream ==
'calibration_DcmDummyProcessor'
46 zdcMonAlg.IsPPMode =
'pp' in config
48 zdcMonAlg.EnableZDC = inputFlags.Detector.EnableZDC_ZDC
49 zdcMonAlg.EnableZDCPhysics = zdcMonAlg.EnableZDC
and not zdcMonAlg.IsInjectedPulse
50 zdcMonAlg.EnableRPD = inputFlags.Detector.EnableZDC_RPD
and not zdcMonAlg.IsInjectedPulse
51 zdcMonAlg.EnableRPDAmp = zdcMonAlg.EnableRPD
52 zdcMonAlg.EnableCentroid = zdcMonAlg.EnableRPD
54 print (
"ZdcMonitorAlgorithm.py: IsInjectedPulse? ",zdcMonAlg.IsInjectedPulse)
55 print (
"ZdcMonitorAlgorithm.py: IsPPMode? ",zdcMonAlg.IsPPMode)
62 n_lumi_block_bins_coarse = 200
64 n_energy_bins_default = 200
66 n_time_centroid_bins_default = 100
67 n_module_amp_coarse_bins = 100
68 n_module_amp_fine_bins = 200
69 n_mod_fraction_bins_default = 100
71 n_HG_LG_amp_ratio_bins = 120
72 n_HG_LG_time_diff_bins = 50
74 module_chisq_min = 0.1
75 module_chisq_max = 800000
76 module_chisq_nbins = 80
77 module_chisq_over_amp_min = 0.01
78 module_chisq_over_amp_max = 5000
79 module_chisq_over_amp_nbins = 80
83 zdcMonAlg.ZDCModuleChisqHistMinValue = module_chisq_min
84 zdcMonAlg.ZDCModuleChisqHistMaxvalue = module_chisq_max
85 zdcMonAlg.ZDCModuleChisqHistNumBins = module_chisq_nbins
86 zdcMonAlg.ZDCModuleChisqOverAmpHistMinValue = module_chisq_over_amp_min
87 zdcMonAlg.ZDCModuleChisqOverAmpHistMaxvalue = module_chisq_over_amp_max
88 zdcMonAlg.ZDCModuleChisqOverAmpHistNumBins = module_chisq_over_amp_nbins
91 pulse_voltage_max = 2.5
92 module_FPGA_max_ADC = 4096.
93 amp_LG_refit_max_ADC = module_FPGA_max_ADC
if zdcMonAlg.IsPPMode
else module_FPGA_max_ADC / 10.
95 if config ==
"LHCf2022":
96 print (
"looking at 2022 lhcf data")
97 energy_sum_xmax = 3000
98 energy_sum_zoomin_xmax = 3000
99 uncalib_amp_sum_zoomin_xmax = 3000
100 time_in_data_buffer = 75.
101 x_centroid_min = -500
105 zdc_amp_sum_xmax = 3000
106 rpd_channel_amp_min = - 200.
107 rpd_amp_sum_xmax = 3000
108 rpd_max_adc_sum_xmax = 3000
109 module_amp_xmax = 2000
110 rpd_sum_adc_max = 5000
111 module_calib_amp_xmax = 5000
112 module_amp_1Nmonitor_xmax = 2000
113 module_calib_amp_1Nmonitor_xmax = 5000
115 elif config ==
"pp2023" or config ==
"pp2024" or config ==
"Injectorpp2024":
116 print (
"looking at pp reference run")
117 energy_sum_xmax = 5000
118 energy_sum_zoomin_xmax = 5000
119 uncalib_amp_sum_zoomin_xmax = 5000
120 time_in_data_buffer = 75.
121 x_centroid_min = -500
125 zdc_amp_sum_xmax = 5000
126 rpd_channel_amp_min = - 200.
127 rpd_amp_sum_xmax = 5000
128 rpd_max_adc_sum_xmax = 5000
129 module_amp_xmax = 4096
130 rpd_sum_adc_max = 5000.
131 module_calib_amp_xmax = 5000
132 module_amp_1Nmonitor_xmax = 2000
133 module_calib_amp_1Nmonitor_xmax = 5000
136 elif config ==
"PbPb2023" or config ==
"PbPb2024" or config ==
"InjectorPbPb2024":
137 print (
"looking at pbpb run")
138 energy_sum_xmax = 200000.0
139 energy_sum_zoomin_xmax = 13000.0
140 uncalib_amp_sum_zoomin_xmax = 6000.0
141 time_in_data_buffer = 75.
146 zdc_amp_sum_xmax = 163840.0
147 rpd_channel_amp_min = - 2000.
148 rpd_amp_sum_xmax = 245760.0
149 rpd_max_adc_sum_xmax = 40960.0
150 module_amp_xmax = 40960.0
151 rpd_sum_adc_max = 25000.
152 module_calib_amp_xmax = 100000.0
153 module_amp_1Nmonitor_xmax = 1250.0
154 module_calib_amp_1Nmonitor_xmax = 3400.0
157 hg_lg_amp_ratio_min_loose = 0.6
if zdcMonAlg.IsPPMode
else 0.06
158 hg_lg_amp_ratio_min_nominal = 0.7
if zdcMonAlg.IsPPMode
else 0.07
159 hg_lg_amp_ratio_min_tight = 0.9
if zdcMonAlg.IsPPMode
else 0.09
160 hg_lg_amp_ratio_max_loose = 1.4
if zdcMonAlg.IsPPMode
else 0.14
161 hg_lg_amp_ratio_max_nominal = 1.3
if zdcMonAlg.IsPPMode
else 0.13
162 hg_lg_amp_ratio_max_tight = 1.2
if zdcMonAlg.IsPPMode
else 0.12
165 rpd_sub_amp_min = - module_amp_xmax / 4.
166 rpd_sub_amp_max = module_amp_xmax / 2.
167 n_rpd_amp_bins_full_range =
int((abs(rpd_channel_amp_min) + rpd_sum_adc_max) / rpd_sum_adc_max * n_energy_bins_default)
168 n_rpd_sub_amp_bins =
int((abs(rpd_sub_amp_min) + rpd_sub_amp_max) / rpd_sub_amp_max * n_energy_bins_default)
175 genZdcMonTool = helper.addGroup(zdcMonAlg,
'genZdcMonTool', topPath =
'ZDC')
177 nDecodingErrorBits = 3
179 genZdcMonTool.defineHistogram(
'decodingErrorBits',title=
';;Events',
180 path=
'/EXPERT/Global/DecodingErrors',
181 xbins=nDecodingErrorBits,xmin=0.0,xmax=nDecodingErrorBits,opt=
'kVec',
182 xlabels=[
'No Decoding Error',
'ZDC Decoding Error',
'RPD Decoding Error'])
184 if (zdcMonAlg.EnableZDCPhysics):
185 genZdcMonTool.defineHistogram(
'zdcEnergySumA, zdcEnergySumC', type=
'TH2F', title=
';E_{ZDC,A} [GeV];E_{ZDC,C} [GeV]',
186 path=
'/EXPERT/Global/SideACCorr',
187 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
188 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_xmax)
190 if (zdcMonAlg.EnableCentroid):
191 genZdcMonTool.defineHistogram(
'rpdCosDeltaReactionPlaneAngle', title=
';Cos (#Delta #phi_{AorC});Events',
192 path=
'/EXPERT/Global/ReactionPlane',
193 cutmask=
'bothHasCentroid',
194 xbins=n_time_centroid_bins_default,xmin=-1,xmax=1)
195 if (
not zdcMonAlg.IsOnline):
196 genZdcMonTool.defineHistogram(
'rpdCosDeltaReactionPlaneAngle;rpdCosDeltaReactionPlaneAngle_requireValid', title=
';Cos (#Delta #phi_{AorC});Events',
197 path=
'/EXPERT/Global/ReactionPlane',
198 cutmask=
'bothReactionPlaneAngleValid',
199 xbins=n_time_centroid_bins_default,xmin=-1,xmax=1)
203 if (zdcMonAlg.CalInfoOn):
204 genZdcMonTool.defineHistogram(
'fcalEtA, fcalEtC', type=
'TH2F', title=
';E_{FCal, A} [GeV];E_{FCal, C} [GeV]',
205 path=
'/EXPERT/Global/SideACCorr',
206 xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
207 ybins=n_energy_bins_default,ymin=0.0,ymax=5000)
211 modules = [
"0",
"1",
"2",
"3"]
212 channels = [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15"]
216 nRpdCentroidStatusBits = 21
222 if (zdcMonAlg.EnableZDCPhysics
or zdcMonAlg.EnableRPDAmp
or zdcMonAlg.EnableCentroid):
224 zdcSideMonToolArr = helper.addArray([sides],zdcMonAlg,
'ZdcSideMonitor', topPath =
'ZDC')
229 if (zdcMonAlg.EnableZDCPhysics):
230 zdcSideMonToolArr.defineHistogram(
'zdcEnergySum',title=
'ZDC Side {0} Energy Sum;Side {0} Energy [GeV];Events',
231 path=
'/EXPERT/ZDC/PerArm/Energy',
232 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax)
233 zdcSideMonToolArr.defineHistogram(
'zdcEnergySum;zdcEnergySum_zoomin_wTrigSelec',title=
'ZDC Side {0} Energy Sum (few neutrons, require opposite-side trigger);Side {0} Energy[GeV];Events',
234 path=
'/SHIFT/ZDC/PerArm/Energy',
235 cutmask =
'passTrigOppSide',
236 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax)
237 zdcSideMonToolArr.defineHistogram(
'zdcEnergySum;zdcEnergySum_zoomin_noTrigSelec',title=
'ZDC Side {0} Energy Sum (few neutrons, no trigger selection);Side {0} Energy[GeV];Events',
238 path=
'/SHIFT/ZDC/PerArm/Energy',
239 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_zoomin_xmax)
241 zdcSideMonToolArr.defineHistogram(
'zdcUncalibSum',title=
'ZDC Side {0} Uncalibrated Sum;[ADC];Events',
242 path=
'/EXPERT/ZDC/PerArm/UncalibAmp',
243 xbins=n_energy_bins_default,xmin=0.0,xmax=zdc_amp_sum_xmax)
246 if (
not zdcMonAlg.IsOnline):
247 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcEnergySum;zdcEnergySum_vs_lb_noTrig', type=
'TH2F', title=
';lumi block;Side {0} Energy [GeV]',
248 path=
'/EXPERT/ZDC/PerArm/Energy',
249 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
250 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
251 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcEnergySum;zdcEnergySum_vs_lb_wTrig', type=
'TH2F', title=
';lumi block;Side {0} Energy [GeV]',
252 path=
'/EXPERT/ZDC/PerArm/Energy',
253 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
254 cutmask =
'passTrigOppSide',
255 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
257 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcEnergySum;zdcEnergySum_vs_lb_noTrig', type=
'TH2F', title=
';lumi block;Side {0} Energy [GeV]',
258 path=
'/EXPERT/ZDC/PerArm/Energy',
259 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
260 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
261 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcEnergySum;zdcEnergySum_vs_lb_wTrig', type=
'TH2F', title=
';lumi block;Side {0} Energy [GeV]',
262 path=
'/EXPERT/ZDC/PerArm/Energy',
263 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
264 cutmask =
'passTrigOppSide',
265 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
267 if (
not zdcMonAlg.IsOnline):
268 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcUncalibSum;zdcUncalibSum_vs_lb_noTrig', type=
'TH2F', title=
';lumi block;ZDC Side {0} Uncalibrated Sum [ADC]',
269 path=
'/EXPERT/ZDC/PerArm/UncalibAmp',
270 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
271 ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax)
272 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcUncalibSum;zdcUncalibSum_vs_lb_wTrig', type=
'TH2F', title=
';lumi block;ZDC Side {0} Uncalibrated Sum [ADC]',
273 path=
'/EXPERT/ZDC/PerArm/UncalibAmp',
274 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
275 cutmask =
'passTrigOppSide',
276 ybins=n_energy_bins_default,ymin=0.0,ymax=uncalib_amp_sum_zoomin_xmax)
279 if (
not zdcMonAlg.IsOnline):
280 zdcSideMonToolArr.defineHistogram(
'bcid, zdcEnergySum;zdcEnergySum_vs_bcid_noTrig', type=
'TH2F', title=
';BCID;Side {0} Energy [GeV]',
281 path=
'/EXPERT/ZDC/PerArm/Energy',
282 xbins=bcid_max,xmin=0.0,xmax=bcid_max,
283 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
284 zdcSideMonToolArr.defineHistogram(
'bcid, zdcEnergySum;zdcEnergySum_vs_bcid_wTrig', type=
'TH2F', title=
';BCID;Side {0} Energy [GeV]',
285 path=
'/EXPERT/ZDC/PerArm/Energy',
286 xbins=bcid_max,xmin=0.0,xmax=bcid_max,
287 cutmask =
'passTrigOppSide',
288 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_zoomin_xmax)
290 if (zdcMonAlg.CalInfoOn):
291 zdcSideMonToolArr.defineHistogram(
'fcalEt, zdcEnergySum', type=
'TH2F', title=
';Side {0} FCal Energy [GeV];Side {0} ZDC Energy [GeV]',
292 path=
'/EXPERT/ZDC/PerArm/ZDCFcalCorr',
293 xbins=n_energy_bins_default,xmin=0.0,xmax=5000,
294 ybins=n_energy_bins_default,ymin=0.0,ymax=energy_sum_xmax)
298 zdcSideMonToolArr.defineHistogram(
'zdcAvgTime',title=
'ZDC Side Average Time;t[ns];Events', cutmask =
'zdcModuleMask',
299 path=
'/EXPERT/ZDC/PerArm/AvgTime',
300 xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
302 if (
not zdcMonAlg.IsOnline):
303 zdcSideMonToolArr.defineHistogram(
'lumiBlock, zdcAvgTime;zdcAvgTime_vs_lb', type=
'TH2F', title=
';ZDC Side Average Time versus Lumi block;lumi block;t[ns]',
304 path=
'/EXPERT/ZDC/PerArm/AvgTime',
305 cutmask =
'zdcModuleMask',
306 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
307 ybins=n_time_centroid_bins_default,ymin=-10.0,ymax=10.0)
311 zdcSideMonToolArr.defineHistogram(
'centroidStatusBits',title=
';;Events',
312 path=
'/EXPERT/RPD/PerArm/Centroid',
313 xbins=nRpdCentroidStatusBits,xmin=0.0,xmax=nRpdCentroidStatusBits,opt=
'kVec',
314 xlabels=[
'ValidBit',
'HasCentroidBit',
'ZDCInvalidBit',
'InsufficientZDCEnergyBit',
'ExcessiveZDCEnergyBit',
'EMInvalidBit',
'InsufficientEMEnergyBit',
'ExcessiveEMEnergyBit',
'RPDInvalidBit',
'PileupBit',
'ExcessivePileupBit',
'ZeroSumBit',
'ExcessiveSubtrUnderflowBit',
'Row0ValidBit',
'Row1ValidBit',
'Row2ValidBit',
'Row3ValidBit',
'Col0ValidBit',
'Col1ValidBit',
'Col2ValidBit',
'Col3ValidBit'])
316 zdcSideMonToolArr.defineHistogram(
'centroidValidBitFloat;centroidValidBit_RequireMinZDCEnergy',title=
'Centroid valid bit;;Events',
317 path=
'/SHIFT/RPD/PerArm/Centroid',
318 cutmask=
'passMinZDCEnergyCutForCentroidValidEvaluation',
319 xbins=2,xmin=0,xmax=2,
320 xlabels=[
'Valid',
'Invalid'])
323 zdcSideMonToolArr.defineHistogram(
'xCentroid',title=
';Centroid x position [mm];Events',
324 path=
'/SHIFT/RPD/PerArm/Centroid',
325 cutmask=
'centroidValid',
326 xbins=n_time_centroid_bins_default,xmin=x_centroid_min,xmax=x_centroid_max)
328 zdcSideMonToolArr.defineHistogram(
'yCentroid',title=
';Centroid y position [mm];Events',
329 path=
'/SHIFT/RPD/PerArm/Centroid',
330 cutmask=
'centroidValid',
331 xbins=n_time_centroid_bins_default,xmin=y_centroid_min,xmax=y_centroid_max)
333 zdcSideMonToolArr.defineHistogram(
'xCentroid, yCentroid',type=
'TH2F',title=
';Centroid x position [mm];Centroid y position [mm]',
334 path=
'/EXPERT/RPD/PerArm/Centroid',
335 cutmask=
'centroidValid',
336 xbins=n_time_centroid_bins_default,xmin=x_centroid_min,xmax=x_centroid_max,
337 ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
339 zdcSideMonToolArr.defineHistogram(
'ReactionPlaneAngle',title=
';Reaction Plane Angle;Events',
340 path=
'/EXPERT/RPD/PerArm/ReactionPlane',
341 cutmask=
'centroidValid',
342 xbins=64,xmin=-3.141593,xmax=3.141593)
346 if (
not zdcMonAlg.IsOnline):
347 zdcSideMonToolArr.defineHistogram(
'xCentroid, yCentroid;yCentroid_vs_xCentroid_requireOnlyHasCentroidBit',type=
'TH2F',title=
';Centroid x position [mm];Centroid y position [mm]',
348 path=
'/EXPERT/RPD/PerArm/Centroid',
349 xbins=n_time_centroid_bins_default,xmin=x_centroid_min,xmax=x_centroid_max,
350 ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
351 zdcSideMonToolArr.defineHistogram(
'ReactionPlaneAngle;ReactionPlaneAngle_requireOnlyHasCentroidBit',title=
';Reaction Plane Angle;Events',
352 path=
'/EXPERT/RPD/PerArm/ReactionPlane',
353 xbins=64,xmin=-3.141593,xmax=3.141593)
357 if (
not zdcMonAlg.IsOnline):
358 zdcSideMonToolArr.defineHistogram(
'lumiBlock, xCentroid;xCentroid_vs_lb_requireOnlyHasCentroidBit', type=
'TH2F', title=
';lumi block;Centroid x position [mm]',
359 path=
'/EXPERT/RPD/PerArm/CentroidLBdep',
360 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
361 ybins=n_time_centroid_bins_default,ymin=x_centroid_min,ymax=x_centroid_max)
362 zdcSideMonToolArr.defineHistogram(
'lumiBlock, yCentroid;yCentroid_vs_lb_requireOnlyHasCentroidBit', type=
'TH2F', title=
';lumi block;Centroid y position [mm]',
363 path=
'/EXPERT/RPD/PerArm/CentroidLBdep',
364 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
365 ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
367 zdcSideMonToolArr.defineHistogram(
'lumiBlock, xCentroid;xCentroid_vs_lb', type=
'TH2F', title=
';lumi block;Centroid x position [mm]',
368 path=
'/EXPERT/RPD/PerArm/CentroidLBdep',
369 cutmask=
'centroidValid',
370 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
371 ybins=n_time_centroid_bins_default,ymin=x_centroid_min,ymax=x_centroid_max)
372 zdcSideMonToolArr.defineHistogram(
'lumiBlock, yCentroid;yCentroid_vs_lb', type=
'TH2F', title=
';lumi block;Centroid y position [mm]',
373 path=
'/EXPERT/RPD/PerArm/CentroidLBdep',
374 cutmask=
'centroidValid',
375 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
376 ybins=n_time_centroid_bins_default,ymin=y_centroid_min,ymax=y_centroid_max)
379 zdcSideMonToolArr.defineHistogram(
'zdcEnergySum, rpdMaxADCSum', type=
'TH2F', title=
';E ZDC side [TeV];RPD Max ADC Sum (AorC) [ADC counts]',
380 path=
'/EXPERT/ZdcRpdPerSideCorr',
381 cutmask=
'RPDSideValid',
382 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
383 ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_max_adc_sum_xmax)
384 zdcSideMonToolArr.defineHistogram(
'zdcEnergySum, rpdAmplitudeCalibSum', type=
'TH2F', title=
';E ZDC side [GeV];RPD Calib Amp Sum (AorC) [ADC counts]',
385 path=
'/EXPERT/ZdcRpdPerSideCorr',
386 cutmask=
'RPDSideValid',
387 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
388 ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_amp_sum_xmax)
389 zdcSideMonToolArr.defineHistogram(
'zdcEMModuleEnergySameSide, rpdAmplitudeCalibSum', type=
'TH2F', title=
';E EM module AorC [GeV];RPD Calib Amp Sum (AorC) [ADC counts]',
390 path=
'/EXPERT/ZdcRpdPerSideCorr',
391 cutmask=
'RPDSideValid',
392 xbins=n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2.,
393 ybins=n_energy_bins_default,ymin=0.0,ymax=rpd_amp_sum_xmax)
400 zdcModuleMonToolArr = helper.addArray([sides,modules],zdcMonAlg,
'ZdcModuleMonitor', topPath =
'ZDC')
404 zdcModuleMonToolArr.defineHistogram(
'zdcStatusBits',title=
';;Events',
405 path=
'/SHIFT/ZDC/ZdcModule/ModuleStatusBits',
406 xbins=nZdcStatusBits,xmin=0.0,xmax=nZdcStatusBits,opt=
'kVec',
407 xlabels=[
'PulseBit',
'LowGainBit',
'FailBit',
'HGOverflowBit',
'HGUnderflowBit',
'PSHGOverUnderflowBit',
'LGOverflowBit',
'LGUnderflowBit',
'PrePulseBit',
'PostPulseBit',
'FitFailedBit',
'BadChisqBit',
'BadT0Bit',
'ExcludeEarlyLGBit',
'ExcludeLateLGBit',
'preExpTailBit',
'FitMinAmpBit',
'RepassPulseBit'])
411 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp',title=
';Module Amplitude [ADC Counts];Events',
412 path=
'/SHIFT/ZDC/ZdcModule/ModuleAmp',
413 xbins=n_fpga_bins * 2,xmin=0.0,xmax=module_amp_xmax)
415 zdcModuleMonToolArr.defineHistogram(
'zdcModuleMaxADC',title=
';Module Max ADC;Events',
416 path=
'/EXPERT/ZDC/ZdcModule/ModuleMaxADC',
417 xbins=n_fpga_bins,xmin=0.0,xmax=module_amp_xmax)
420 if (
not zdcMonAlg.IsPPMode):
421 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp;zdcModuleAmp_LG',title=
';Module Amplitude LG [ADC Counts];Events',
422 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmp',
423 cutmask=
'zdcModuleLG',
424 xbins=n_fpga_bins,xmin=0.0,xmax=module_amp_xmax)
426 if (zdcMonAlg.IsInjectedPulse):
427 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmpLGRefit',title=
';LG-Refit Amplitude [ADC Counts];Events',
428 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmp',
429 cutmask=
'zdcModuleHGValid',
430 xbins=n_fpga_bins,xmin=0.0,xmax=amp_LG_refit_max_ADC)
432 if (
not zdcMonAlg.IsOnline
and not zdcMonAlg.IsInjectedPulse):
433 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp;zdcModuleAmp_halfrange',title=
';Module Amplitude [ADC Counts];Events',
434 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmp',
435 xbins=n_fpga_bins,xmin=0.0,xmax=module_amp_xmax / 2.)
437 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp;zdcModuleAmp_HG',title=
';Module Amplitude HG [ADC Counts];Events',
438 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmp',
439 cutmask=
'zdcModuleHGValid',
440 xbins=n_fpga_bins,xmin=0.0,xmax=module_FPGA_max_ADC)
442 if (zdcMonAlg.IsInjectedPulse):
443 zdcModuleMonToolArr.defineHistogram(
'zdcModuleMaxADC;zdcModuleMaxADC_HG',title=
';Module Max ADC HG;Events',
444 path=
'/EXPERT/ZDC/ZdcModule/ModuleMaxADC',
445 cutmask=
'zdcModuleHGValid',
446 xbins=n_fpga_bins,xmin=0.0,xmax=module_FPGA_max_ADC)
447 zdcModuleMonToolArr.defineHistogram(
'zdcModuleMaxADC,zdcModuleAmpToMaxADCRatio;zdcModuleAmpToMaxADCRatio_vs_zdcModuleMaxADC_profile',type=
'TProfile',title=
';Module Max ADC HG;Avg Amp/Max ADC',
448 path=
'/EXPERT/ZDC/ZdcModule/ModuleMaxADC',
449 cutmask=
'zdcModuleHGValid',
450 xbins=n_fpga_bins,xmin=0.0,xmax=module_FPGA_max_ADC)
454 if (zdcMonAlg.IsInjectedPulse):
455 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFract',title=
';Module Amplitude Fraction;Events',
456 path=
'/SHIFT/ZDC/ZdcModule/ModuleFraction',
457 xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
459 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFract;zdcModuleFract_above_cut',title=
';Module Amplitude Fraction;Events',
460 path=
'/SHIFT/ZDC/ZdcModule/ModuleFraction',
461 cutmask=
'zdcEnergyAboveModuleFractCut',
462 xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
463 zdcModuleMonToolArr.defineHistogram(
'zdcEnergySumCurrentSide, zdcModuleFract;zdcModuleFract_vs_zdcEnergySum_fullrange', type=
'TH2F', title=
';ZDC Energy Sum Current Side [GeV];Module Amplitude Fraction',
464 path=
'/EXPERT/ZDC/ZdcModule/ModuleFractionVsEnergy',
465 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax,
466 ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
467 zdcModuleMonToolArr.defineHistogram(
'zdcEnergySumCurrentSide, zdcModuleFract;zdcModuleFract_vs_zdcEnergySum_profile', type=
'TProfile', title=
';ZDC Energy Sum Current Side [GeV];Module Amplitude Fraction',
468 path=
'/EXPERT/ZDC/ZdcModule/ModuleFractioVsEnergyn',
469 xbins=n_energy_bins_default,xmin=0.0,xmax=energy_sum_xmax)
470 zdcModuleMonToolArr.defineHistogram(
'zdcEnergySumCurrentSide, zdcModuleFract;zdcModuleFract_vs_zdcEnergySum_zoomedin', type=
'TH2F', title=
';Amplitude Sum Current Side [ADC Counts];Module Amplitude Fraction',
471 path=
'/EXPERT/ZDC/ZdcModule/ModuleFractionVsEnergy',
472 xbins=n_energy_bins_default,xmin=0.0,xmax=10000,
473 ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
474 if (
not zdcMonAlg.IsOnline):
475 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFract',title=
';Module Amplitude Fraction;Events',
476 path=
'/EXPERT/ZDC/ZdcModule/ModuleFraction',
477 xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
478 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFract;zdcModuleFract_above20N',title=
';Module Amplitude Fraction;Events',
479 path=
'/EXPERT/ZDC/ZdcModule/ModuleFraction',
480 cutmask=
'zdcAbove20NCurrentSide',
481 xbins=n_mod_fraction_bins_default,xmin=0.0,xmax=1.)
483 if (
not zdcMonAlg.IsInjectedPulse):
484 zdcModuleMonToolArr.defineHistogram(
'zdcModuleCalibAmp',title=
';Module Calibrated Amplitude [GeV];Events',
485 path=
'/EXPERT/ZDC/ZdcModule/ModuleCalibAmp',
486 xbins=2*n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax)
488 if (
not zdcMonAlg.IsOnline
and not zdcMonAlg.IsInjectedPulse):
489 zdcModuleMonToolArr.defineHistogram(
'zdcModuleCalibAmp;zdcModuleCalibAmp_halfrange',title=
';Module Calibrated Amplitude [GeV];Events',
490 path=
'/EXPERT/ZDC/ZdcModule/ModuleCalibAmp',
491 xbins=2*n_energy_bins_default,xmin=0.0,xmax=module_calib_amp_xmax / 2.)
494 if (zdcMonAlg.IsInjectedPulse):
495 zdcModuleMonToolArr.defineHistogram(
'injectedPulseInputVoltage,zdcModuleAmp', type=
'TH2F', title=
';Pulse amp [V];Signal Amp [ADC Counts]',
496 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmpVsInputVoltage',
497 xbins=n_energy_bins_default,xmin=0.0,xmax=pulse_voltage_max,
498 ybins=n_fpga_bins,ymin=0.0,ymax=module_FPGA_max_ADC)
500 zdcModuleMonToolArr.defineHistogram(
'injectedPulseInputVoltage,zdcModuleAmp;zdcModuleAmp_vs_injectedPulseInputVoltage_profile', type=
'TProfile', title=
';Pulse amp [V];Signal Amp [ADC Counts]',
501 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmpVsInputVoltage',
502 xbins=n_energy_bins_default,xmin=0.0,xmax=pulse_voltage_max)
506 zdcModuleMonToolArr.defineHistogram(
'zdcModuleTime',title=
';Module Time [ns];Events',
507 path=
'/SHIFT/ZDC/ZdcModule/ModuleTime',
508 xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
510 if (
not zdcMonAlg.IsPPMode):
511 zdcModuleMonToolArr.defineHistogram(
'zdcModuleTime;zdcModuleTime_LG',title=
';Module Time [ns];Events',
512 path=
'/SHIFT/ZDC/ZdcModule/ModuleTime',
513 cutmask=
'zdcModuleLG',
514 xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
516 zdcModuleMonToolArr.defineHistogram(
'zdcModuleTime;zdcModuleTime_HG',title=
';Module Time [ns];Events',
517 path=
'/SHIFT/ZDC/ZdcModule/ModuleTime',
518 cutmask=
'zdcModuleHG',
519 xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
521 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFitT0',title=
';Module FitT0 [ns];Events',
522 path=
'/EXPERT/ZDC/ZdcModule/ModuleFitT0',
523 xbins=n_time_centroid_bins_default,xmin=0.0,xmax=time_in_data_buffer)
525 if (
not zdcMonAlg.IsPPMode):
526 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFitT0;zdcModuleFitT0_LG',title=
';Module FitT0 LG [ns];Events',
527 path=
'/EXPERT/ZDC/ZdcModule/ModuleFitT0',
528 cutmask=
'zdcModuleLG',
529 xbins=n_time_centroid_bins_default,xmin=0.0,xmax=time_in_data_buffer)
531 zdcModuleMonToolArr.defineHistogram(
'zdcModuleFitT0;zdcModuleFitT0_HG',title=
';Module FitT0 HG [ns];Events',
532 path=
'/EXPERT/ZDC/ZdcModule/ModuleFitT0',
533 cutmask=
'zdcModuleHG',
534 xbins=n_time_centroid_bins_default,xmin=0.0,xmax=time_in_data_buffer)
537 if (
not zdcMonAlg.IsOnline
and not zdcMonAlg.IsInjectedPulse):
538 zdcModuleMonToolArr.defineHistogram(
'zdcModuleCalibTime',title=
';Module Calibrated Time [ns];Events',
539 path=
'/EXPERT/ZDC/ZdcModule/ModuleCalibTime',
540 xbins=n_time_centroid_bins_default,xmin=-10.0,xmax=10.0)
544 zdcModuleMonToolArr.defineHistogram(
'zdcModuleChisq',title=
';Module Chi-square;Events',
545 path=
'/EXPERT/ZDC/ZdcModule/ModuleChisq',
546 weight=
'zdcModuleChisqEventWeight',
547 xbins=
create_log_bins(module_chisq_min, module_chisq_max, module_chisq_nbins))
548 zdcModuleMonToolArr.defineHistogram(
'zdcModuleChisqOverAmp',title=
';Module Chi-square / Amplitude;Events',
549 path=
'/SHIFT/ZDC/ZdcModule/ModuleChisq',
550 weight=
'zdcModuleChisqOverAmpEventWeight',
551 xbins=
create_log_bins(module_chisq_over_amp_min, module_chisq_over_amp_max, module_chisq_over_amp_nbins))
552 if (
not zdcMonAlg.IsOnline):
553 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp, zdcModuleChisqOverAmp',type=
'TH2F',title=
';Module Amplitude [ADC Counts];Module Chi-square / Amplitude',
554 path=
'/EXPERT/ZDC/ZdcModule/ModuleChisq',
555 weight=
'zdcModuleChisqOverAmpEventWeight',
556 xbins=n_energy_bins_default,xmin=0.0,xmax=module_amp_xmax / 2.,
557 ybins=
create_log_bins(module_chisq_over_amp_min, module_chisq_over_amp_max, module_chisq_over_amp_nbins))
561 zdcModuleMonToolArr.defineHistogram(
'zdcModuleHGtoLGAmpRatio',title=
';Module Amplitude [ADC Counts];Events',
562 path=
'/SHIFT/ZDC/ZdcModule/ModuleHGLGCompr',
563 cutmask=
'zdcModuleHGValid',
564 xbins=n_HG_LG_amp_ratio_bins,xmin=hg_lg_amp_ratio_min_loose,xmax=hg_lg_amp_ratio_max_loose)
566 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp, zdcModuleHGtoLGAmpRatio', type=
'TH2F', title=
';ZDC HG Amplitude [ADC Counts];HG-to-LG Amplitude Raio;Events',
567 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
568 cutmask=
'zdcModuleHGValid',
569 xbins=n_module_amp_fine_bins, xmin=0.0, xmax=module_FPGA_max_ADC,
570 ybins=n_HG_LG_amp_ratio_bins,ymin=hg_lg_amp_ratio_min_nominal,ymax=hg_lg_amp_ratio_max_nominal)
572 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmp, zdcModuleHGtoLGAmpRatio;zdcModuleHGtoLGAmpRatio_vs_zdcModuleAmp_profile', type=
'TProfile', title=
';ZDC HG Amplitude [ADC Counts];Average HG-to-LG Amplitude Raio;Events',
573 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
574 cutmask=
'zdcModuleHGValid',
575 xbins=n_module_amp_fine_bins, xmin=0.0, xmax=module_FPGA_max_ADC)
577 if (
not zdcMonAlg.IsOnline):
578 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmpLGRefit, zdcModuleHGtoLGAmpRatio', type=
'TH2F', title=
';ZDC LG-Refit Amplitude [ADC Counts];HG-to-LG Amplitude Raio;Events',
579 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
580 cutmask=
'zdcModuleHGValid',
581 xbins=n_module_amp_fine_bins, xmin=0.0, xmax=amp_LG_refit_max_ADC,
582 ybins=n_HG_LG_amp_ratio_bins,ymin=hg_lg_amp_ratio_min_nominal,ymax=hg_lg_amp_ratio_max_nominal)
583 zdcModuleMonToolArr.defineHistogram(
'zdcModuleAmpLGRefit, zdcModuleHGtoLGAmpRatio;zdcModuleHGtoLGAmpRatio_vs_zdcModuleAmpLGRefit_profile', type=
'TProfile', title=
';ZDC LG-Refit Amplitude [ADC Counts];Average HG-to-LG Amplitude Raio;Events',
584 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
585 cutmask=
'zdcModuleHGValid',
586 xbins=n_module_amp_fine_bins, xmin=0.0, xmax=amp_LG_refit_max_ADC)
588 zdcModuleMonToolArr.defineHistogram(
'zdcModuleHGtoLGT0Diff',title=
';HG-LG T0 Difference [ns];Events',
589 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
590 cutmask=
'zdcModuleHGValid',
591 xbins=n_HG_LG_time_diff_bins,xmin=-10.0,xmax=10.0)
593 zdcModuleMonToolArr.defineHistogram(
'zdcModuleHGtoLGT0Diff, zdcModuleHGtoLGAmpRatio', type=
'TH2F', title=
';HG-LG T0 Difference [ns];HG-to-LG Amplitude Raio;Events',
594 path=
'/EXPERT/ZDC/ZdcModule/ModuleHGLGCompr',
595 cutmask=
'zdcModuleHGValid',
596 xbins=n_HG_LG_time_diff_bins,xmin=2.0,xmax=4.0,
597 ybins=n_HG_LG_amp_ratio_bins,ymin=hg_lg_amp_ratio_min_tight,ymax=hg_lg_amp_ratio_max_tight)
603 if (
not zdcMonAlg.IsInjectedPulse):
604 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleCalibAmp;zdcModuleCalibAmp_vs_lb', type=
'TH2F', title=
';lumi block;Module Calib Amplitude',
605 path=
'/EXPERT/ZDC/ZdcModule/ModuleCalibAmpLBdep',
606 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
607 ybins=n_module_amp_coarse_bins, ymin=0.0, ymax=module_calib_amp_1Nmonitor_xmax)
608 if (
not zdcMonAlg.IsOnline):
609 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleAmp;zdcModuleAmp_vs_lb', type=
'TH2F', title=
';lumi block;Module Amplitude [ADC counts]',
610 path=
'/EXPERT/ZDC/ZdcModule/ModuleAmpLBdep',
611 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
612 ybins=n_module_amp_coarse_bins, ymin=0.0, ymax=module_amp_1Nmonitor_xmax)
613 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleFract;zdcModuleFract_above20N_vs_lb', type=
'TH2F',title=
';lumi block;Module Amplitude Fraction',
614 path=
'/EXPERT/ZDC/ZdcModule/ModuleFractionLBdep',
615 cutmask=
'zdcAbove20NCurrentSide',
616 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
617 ybins=n_mod_fraction_bins_default,ymin=0.0,ymax=1.)
619 if (
not zdcMonAlg.IsOnline
and not zdcMonAlg.IsInjectedPulse):
620 zdcModuleMonToolArr.defineHistogram(
'bcid, zdcModuleCalibAmp', type=
'TH2F', title=
';BCID;Module Calib Amplitude',
621 path=
'/EXPERT/ZDC/ZdcModule/ModuleCalibAmpBCIDdep',
622 xbins=bcid_max,xmin=0.0,xmax=bcid_max,
623 ybins=n_module_amp_coarse_bins, ymin=0.0, ymax=module_calib_amp_1Nmonitor_xmax)
627 if (
not zdcMonAlg.IsOnline):
628 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_vs_lb', type=
'TH2F', title=
';lumi block;Module Time [ns]',
629 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
630 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
631 ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
632 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_LG_vs_lb', type=
'TH2F', title=
';lumi block;Module Time [ns]',
633 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
634 cutmask=
'zdcModuleLG',
635 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
636 ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
637 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_HG_vs_lb', type=
'TH2F', title=
';lumi block;Module Time [ns]',
638 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
639 cutmask=
'zdcModuleHG',
640 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
641 ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
643 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_LG_vs_lb', type=
'TH2F', title=
';lumi block;Module Time [ns]',
644 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
645 cutmask=
'zdcModuleLG',
646 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
647 ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
648 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_HG_vs_lb', type=
'TH2F', title=
';lumi block;Module Time [ns]',
649 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
650 cutmask=
'zdcModuleHG',
651 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
652 ybins=n_time_centroid_bins_default, ymin=-10.0, ymax=10.0)
654 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_LG_vs_lb_profile', type=
'TProfile', title=
';lumi block;Module Time [ns]',
655 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
656 cutmask=
'zdcModuleLG',
657 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max)
658 zdcModuleMonToolArr.defineHistogram(
'lumiBlock, zdcModuleTime;zdcModuleTime_HG_vs_lb_profile', type=
'TProfile', title=
';lumi block;Module Time [ns]',
659 path=
'/EXPERT/ZDC/ZdcModule/ModuleTimeLBdep',
660 cutmask=
'zdcModuleHG',
661 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max)
667 if (zdcMonAlg.EnableRPDAmp):
669 rpdChannelMonToolArr = helper.addArray([sides,channels],zdcMonAlg,
'RpdChannelMonitor', topPath =
'ZDC')
672 rpdChannelMonToolArr.defineHistogram(
'RPDChannelAmplitudeCalib', title=
';RPD Channel Calibrated Amplitude;Events',
673 path=
'/SHIFT/RPD/RPDChannel/CalibAmp',
674 cutmask=
'RPDChannelValid',
675 xbins=n_rpd_amp_bins_full_range,xmin=rpd_channel_amp_min,xmax=rpd_sum_adc_max)
676 rpdChannelMonToolArr.defineHistogram(
'RPDChannelMaxADC', title=
';Max ADC [ADC Counts];Events',
677 path=
'/EXPERT/RPD/RPDChannel/MaxADC',
678 cutmask=
'RPDChannelValid',
679 xbins=n_energy_bins_default,xmin=0.0,xmax=4096.0)
681 if (
not zdcMonAlg.IsOnline):
682 rpdChannelMonToolArr.defineHistogram(
'RPDChannelSubAmp', title=
';RPD Channel Subtracted Amplitude;Events',
683 path=
'/EXPERT/RPD/RPDChannel/SubAmp',
684 cutmask=
'RPDChannelCentroidValid',
685 xbins=n_rpd_sub_amp_bins,xmin=rpd_sub_amp_min,xmax=rpd_sub_amp_max)
688 if (
not zdcMonAlg.IsOnline):
689 rpdChannelMonToolArr.defineHistogram(
'RPDChannelAmplitudeCalib,RPDChannelMaxADC', type=
'TH2F', title=
';Sum ADC [ADC Counts];Max ADC [ADC Counts]',
690 path=
'/EXPERT/RPD/RPDChannel/MaxADCVsSumADC',
691 cutmask=
'RPDChannelValid',
692 xbins=n_rpd_amp_bins_full_range,xmin=rpd_channel_amp_min,xmax=rpd_sum_adc_max,
693 ybins=n_energy_bins_default,ymin=0.0,ymax=4096.0)
695 rpdChannelMonToolArr.defineHistogram(
'RPDChannelMaxSample', title=
';Max Sample;Events',
696 path=
'/EXPERT/RPD/RPDChannel/MaxSample',
697 cutmask=
'RPDChannelValid',
698 xbins=24,xmin=0.0,xmax=24.)
702 rpdChannelMonToolArr.defineHistogram(
'RPDStatusBits',title=
';;Events',
703 path=
'/EXPERT/RPD/RPDChannel/StatusBits',
704 xbins=nRpdStatusBits,xmin=0,xmax=nRpdStatusBits,opt=
'kVec',
705 xlabels=[
'ValidBit',
'OutOfTimePileupBit',
'OverflowBit',
'PrePulseBit',
'PostPulseBit',
'NoPulseBit',
'BadAvgBaselineSubtrBit',
'InsufficientPileupFitPointsBit',
'PileupStretchedExpFitFailBit',
'PileupStretchedExpGrowthBit',
'PileupBadStretchedExpSubtrBit',
'PileupExpFitFailBit',
'PileupExpGrowthBit',
'PileupBadExpSubtrBit',
'PileupStretchedExpPulseLike'])
707 rpdChannelMonToolArr.defineHistogram(
'RPDChannelValidBitFloat;RPDChannelValidBit',title=
'RPD Channel valid bit;;Events',
708 path=
'/SHIFT/RPD/RPDChannel/StatusBits',
709 xbins=2,xmin=0,xmax=2,
710 xlabels=[
'Valid',
'Invalid'])
713 if (
not zdcMonAlg.IsOnline):
714 rpdChannelMonToolArr.defineHistogram(
'lumiBlock, RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_vs_lb', type=
'TH2F', title=
';lumi block;RPD Channel Calibrated Amplitude',
715 path=
'/EXPERT/RPD/RPDChannel/CalibAmpLBdep',
716 cutmask=
'RPDChannelValid',
717 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
718 ybins=n_rpd_amp_bins_full_range,ymin=rpd_channel_amp_min,ymax=rpd_sum_adc_max)
719 rpdChannelMonToolArr.defineHistogram(
'lumiBlock, RPDChannelMaxADC;RPDChannelMaxADC_vs_lb', type=
'TH2F', title=
';lumi block;Max ADC [ADC Counts]',
720 path=
'/EXPERT/RPD/RPDChannel/MaxADCLBdep',
721 cutmask=
'RPDChannelValid',
722 xbins=lumi_block_max,xmin=0.0,xmax=lumi_block_max,
723 ybins=n_energy_bins_default,ymin=0.0,ymax=4096.0)
725 rpdChannelMonToolArr.defineHistogram(
'lumiBlock, RPDChannelAmplitudeCalib;RPDChannelAmplitudeCalib_vs_lb', type=
'TH2F', title=
';lumi block;RPD Channel Calibrated Amplitude',
726 path=
'/EXPERT/RPD/RPDChannel/CalibAmpLBdep',
727 cutmask=
'RPDChannelValid',
728 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
729 ybins=n_rpd_amp_bins_full_range,ymin=rpd_channel_amp_min,ymax=rpd_sum_adc_max)
730 rpdChannelMonToolArr.defineHistogram(
'lumiBlock, RPDChannelMaxADC;RPDChannelMaxADC_vs_lb', type=
'TH2F', title=
';lumi block;Max ADC [ADC Counts]',
731 path=
'/EXPERT/RPD/RPDChannel/MaxADCLBdep',
732 cutmask=
'RPDChannelValid',
733 xbins=n_lumi_block_bins_coarse,xmin=0.0,xmax=lumi_block_max,
734 ybins=n_energy_bins_default,ymin=0.0,ymax=4096.0)
742 return helper.result()
749 if __name__==
'__main__':
751 from AthenaCommon.Logging
import log
753 log.setLevel(WARNING)
756 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
759 inputfile =
'AOD.pool.root'
760 flags.Input.Files = [directory+inputfile]
762 parser = flags.getArgumentParser()
763 parser.add_argument(
'--datasetTag',default=
"HI2023",help=
"dataset tag")
764 parser.add_argument(
'--runNumber',default=
None,help=
"specify to select a run number")
765 parser.add_argument(
'--streamTag',default=
"ZDCCalib",help=
"ZDCCalib or MinBias")
766 parser.add_argument(
'--outputHISTFile',default=
None,help=
"specify output HIST file name")
767 args = flags.fillFromArgs(parser=parser)
769 flags.DQ.useTrigger =
False if flags.Input.isMC
else True
770 if args.runNumber
is not None:
771 flags.Output.HISTFileName = f
'ZdcMonitorOutput_{args.datasetTag}_{args.streamTag}_{args.runNumber}.root'
773 flags.Output.HISTFileName = f
'ZdcMonitorOutput_{args.datasetTag}_{args.streamTag}.root'
775 if args.outputHISTFile
is not None:
776 flags.Output.HISTFileName = f
'{args.outputHISTFile}'
779 print(
'Output', flags.Output.HISTFileName)
781 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
782 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
787 cfg.merge(zdcMonitorAcc)
793 cfg.printConfig(withDetails=
False)