7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaMonitoring
import AthMonitorCfgHelper
9 helper = AthMonitorCfgHelper(flags,
'LArCalibDelayMonCfg')
11 from AthenaConfiguration.ComponentFactory
import CompFactory
17 from LArCabling.LArCablingConfig
import LArFebRodMappingCfg, LArCalibIdMappingCfg
21 rv.merge(helper.result())
27 from LArMonitoring.GlobalVariables
import lArDQGlobals
29 larDelayMonAlgTest = helper.addAlgorithm(algoinstance,
'larCalibDelayMonAlgTest')
32 larDelayMonAlgTest.LArAccumulatedDigitContainerKey=gain
34 larDelayMonAlgTest.LArAccumulatedCalibDigitContainerKey=gain
36 larDelayMonAlgTest.LArCalibDigitContainerKey=gain
38 GroupName=
"DelayMonGroup"
40 larDelayMonAlgTest.LArDelayGroupName=GroupName
41 larDelayMonAlgTest.PartitionNames=lArDQGlobals.Partitions
42 larDelayMonAlgTest.SubDetNames=lArDQGlobals.SubDet
44 Group = helper.addGroup(larDelayMonAlgTest,GroupName,
'/LAr/'+GroupName+
'/')
48 summary_hist_path=
'Summary/'
50 FEBchan_n = lArDQGlobals.FEB_N_channels
51 FEBchan_low = lArDQGlobals.FEB_channels_Min
52 FEBchan_up = lArDQGlobals.FEB_channels_Max
54 Group.defineHistogram(
'febchid,sample_max;FEBvsMaxSamples',
55 title=
'Max samples per FEB;FEB_N_channels;MaxSample',
57 path=summary_hist_path,
58 xbins=FEBchan_n, xmin=FEBchan_low, xmax=FEBchan_up)
59 Group.defineHistogram(
'febchid,sample_min;FEBvsMinSamples',
60 title=
'Min samples per FEB;FEB_N_channels;MinSample',
62 path=summary_hist_path,
63 xbins=FEBchan_n, xmin=FEBchan_low, xmax=FEBchan_up)
64 Group.defineHistogram(
'sample_max;NbOfMaxSamples',
65 title=
'Max samples;ADC;Events',
67 path=summary_hist_path,
68 xbins=lArDQGlobals.Samples_Bins*lArDQGlobals.FEB_N_channels-2,
69 xmin=-0.5, xmax=lArDQGlobals.Samples_Bins*lArDQGlobals.FEB_N_channels-2.5)
70 Group.defineHistogram(
'sample_min;NbOfMinSamples',
71 title=
'Min samples;ADC;Events',
73 path=summary_hist_path,
74 xbins=lArDQGlobals.Samples_Bins*lArDQGlobals.FEB_N_channels-2,
75 xmin=-0.5, xmax=lArDQGlobals.Samples_Bins*lArDQGlobals.FEB_N_channels-2.5)
76 Group.defineHistogram(
'dac;ValueOfDAC',
77 title=
'Value of dac;DAC;Events',
79 path=summary_hist_path,
81 xmin=0.-0.5, xmax=6000.+0.5)
82 Group.defineHistogram(
'delay;ValueOfDelay',
83 title=
'Value of delay;Delay;Events',
85 path=summary_hist_path,
87 xmin=-0.5, xmax=200.+0.5)
88 Group.defineHistogram(
'febchid,dac;FEBvsDAC',
89 title=
'DAC per FEB;FEB_N_channels;DAC',
91 path=summary_hist_path,
92 xbins=FEBchan_n, xmin=FEBchan_low, xmax=FEBchan_up)
93 Group.defineHistogram(
'febchid,delay;FEBvsDelay',
94 title=
'Delay per FEB;FEB_N_channels;Delay',
96 path=summary_hist_path,
97 xbins=FEBchan_n, xmin=FEBchan_low, xmax=FEBchan_up)
100 for subdet
in range(0,lArDQGlobals.N_SubDet):
101 hist_path=
'/LAr/'+GroupName+
'/'+lArDQGlobals.SubDet[subdet]+
'/'
102 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
103 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
104 slot_n =
int(slot_up - slot_low)
105 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
106 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
107 ft_n =
int(ft_up - ft_low)
109 darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larDelayMonAlgTest,lArDQGlobals.SubDet[subdet])
111 darray.defineHistogram(
'slot,FT;NbOfEvents2D',
112 title=
'Number of Events;Slot;FT',
115 xbins=slot_n,xmin=slot_low,xmax=slot_up,
116 ybins=ft_n, ymin=ft_low, ymax=ft_up)
117 darray.defineHistogram(
'slot,FT,sample_max;SlotvsFTvsMaxSamples',
118 title=
'Average of MaxSamples;Slot;FT',
121 xbins=slot_n,xmin=slot_low,xmax=slot_up,
122 ybins=ft_n, ymin=ft_low, ymax=ft_up)
123 darray.defineHistogram(
'slot,FT,sample_min;SlotvsFTvsMinSamples',
124 title=
'Average of MinSamples;Slot;FT',
127 xbins=slot_n,xmin=slot_low,xmax=slot_up,
128 ybins=ft_n, ymin=ft_low, ymax=ft_up)
129 darray.defineHistogram(
'slot30,FT30,sample_max30;SlotvsFTvsMaxSamples30',
130 title=
'Average of MaxSamples>3000;Slot;FT',
133 xbins=slot_n,xmin=slot_low,xmax=slot_up,
134 ybins=ft_n, ymin=ft_low, ymax=ft_up)
136 if __name__==
'__main__':
138 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
141 from AthenaCommon.Logging
import log
145 from AthenaMonitoring.DQConfigFlags
import DQDataType
147 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
148 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
154 flags.Input.Files = [
155 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Delay-32s-High-HecFcal/00404654/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW._lb0000._SFO-1._0001.data",
157 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Delay-32s-High-HecFcal/00404654/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW._lb0000._SFO-2._0001.data",
159 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Delay-32s-High-HecFcal/00404654/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW._lb0000._SFO-3._0001.data",
161 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Delay-32s-High-HecFcal/00404654/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW/data21_calib.00404654.calibration_LArElec-Delay-32s-High-HecFcal.daq.RAW._lb0000._SFO-4._0001.data"]
162 flags.Output.HISTFileName =
'LArCalib'+type_run+
'MonOutput_'+run+
'-'+part+
'.root'
163 flags.DQ.enableLumiAccess =
False
164 flags.Input.isMC =
False
165 flags.DQ.useTrigger =
False
166 flags.LAr.doAlign=
False
167 from AthenaConfiguration.Enums
import BeamType
168 flags.Beam.Type = BeamType.Collisions
169 flags.DQ.DataType = DQDataType.Collisions
170 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
171 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
172 flags.Detector.GeometryCSC=
False
173 flags.Detector.GeometrysTGC=
False
174 flags.Detector.GeometryMM=
False
175 flags.Exec.OutputLevel=DEBUG
179 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
182 from LArByteStream.LArRawCalibDataReadingConfig
import LArRawCalibDataReadingCfg
187 cfg.printConfig(withDetails=
False)
190 f=
open(
"LArCalibDelayMon_"+run+
".pkl",
"wb")