7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaMonitoring
import AthMonitorCfgHelper
9 helper = AthMonitorCfgHelper(flags,
'LArCalibPedMonCfg')
11 from AthenaConfiguration.ComponentFactory
import CompFactory
17 from LArCabling.LArCablingConfig
import LArFebRodMappingCfg, LArCalibIdMappingCfg
22 from LArROD.LArFebErrorSummaryMakerConfig
import LArFebErrorSummaryMakerCfg
25 rv.merge(helper.result())
31 from LArMonitoring.GlobalVariables
import lArDQGlobals
33 larPedMonAlgTest = helper.addAlgorithm(algoinstance,
'larCalibPedMonAlgTest')
36 larPedMonAlgTest.LArAccumulatedDigitContainerKey=gain
38 larPedMonAlgTest.LArAccumulatedCalibDigitContainerKey=gain
40 larPedMonAlgTest.LArCalibDigitContainerKey=gain
43 GroupName=
"PedMonGroup"
45 larPedMonAlgTest.LArPedGroupName=GroupName
46 larPedMonAlgTest.PartitionNames=lArDQGlobals.Partitions
47 larPedMonAlgTest.SubDetNames=lArDQGlobals.SubDet
49 Group = helper.addGroup(larPedMonAlgTest,GroupName,
'/LAr/'+GroupName+
'/')
53 summary_hist_path=
'Summary/'
58 Group.defineHistogram(
'nbChan;NbOfReadoutChannelsGlobal',
59 title=
'# of readout channels;Total channels for all FEB;Events',
61 path=summary_hist_path,
62 xbins=lArDQGlobals.N_FEB*lArDQGlobals.FEB_N_channels+5,
63 xmin=-0.5, xmax=lArDQGlobals.N_FEB*lArDQGlobals.FEB_N_channels+4.5)
64 Group.defineHistogram(
'nbFEB;NbOfReadoutFEBGlobal',
65 title=
'# of readout FEB/DSP header;N_FEB;Events',
67 path=summary_hist_path,
68 xbins=lArDQGlobals.N_FEB+11, xmin=-0.5, xmax=lArDQGlobals.N_FEB+10+0.5)
69 Group.defineHistogram(
'nbFEBpart,part;NbOfEvts2d',
70 title=
'# of readout FEB/DSP header;N_FEB;Partition',
72 path=summary_hist_path,
73 xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5,
74 ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
75 ylabels=lArDQGlobals.Partitions)
76 Group.defineHistogram(
'febError,part;NbOfFEBMonErrors_dE',
77 title=
'# of data corruption errors',
79 path=summary_hist_path,
80 xbins=lArDQGlobals.N_FEBErrors, xmin=0.5, xmax=lArDQGlobals.N_FEBErrors+0.5,
81 ybins=lArDQGlobals.N_Partitions, ymin=-0.5, ymax=lArDQGlobals.N_Partitions-0.5,
82 xlabels=lArDQGlobals.FEBErrors, ylabels=lArDQGlobals.Partitions)
83 Group.defineHistogram(
'LB0,EvtRejYield;RAW_YieldOfRejectedEventsVsLB',
84 title=
'Yield of corrupted events (DATACORRUPTED);LBs;Yield(%)',
86 path=summary_hist_path,
87 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
88 Group.defineHistogram(
'LB0;NbOfEventsVsLB',
89 title=
'Nb of events per LB;LBs;Events',
91 path=summary_hist_path,
92 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
93 Group.defineHistogram(
'LB0,LArEvSize;LAreventSizeVsLB',
94 title=
'LAr event size (w/o ROS headers);LBs;Megabytes',
96 path=summary_hist_path,
97 xbins=lArDQGlobals.LB_Bins, xmin=lArDQGlobals.LB_Min, xmax=lArDQGlobals.LB_Max)
99 for subdet
in range(0,lArDQGlobals.N_SubDet):
100 hist_path=
'/LAr/'+GroupName+
'/'+lArDQGlobals.SubDet[subdet]+
'/'
101 slot_low = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
102 slot_up = lArDQGlobals.FEB_Slot[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
103 slot_n =
int(slot_up - slot_low)
104 ft_low = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][0] - 0.5
105 ft_up = lArDQGlobals.FEB_Feedthrough[lArDQGlobals.Partitions[subdet*2]][1] + 0.5
106 ft_n =
int(ft_up - ft_low)
108 darray = helper.addArray([lArDQGlobals.Partitions[2*subdet:2*subdet+2]],larPedMonAlgTest,lArDQGlobals.SubDet[subdet])
110 darray.defineHistogram(
'nbFEBpart;nbOfFebBlocks',
111 title=
'# of readout FEBs (DSP header check only);N_FEB;Events',
114 xbins=lArDQGlobals.N_FEB_Parttions_Max, xmin=-0.5, xmax=lArDQGlobals.N_FEB_Parttions_Max-0.5)
115 darray.defineHistogram(
'slotnb,FTnb;RAW_nbOfEvts',
116 title=
'Nb of events (DSP header check only);Slot;FT',
119 xbins=slot_n,xmin=slot_low,xmax=slot_up,
120 ybins=ft_n, ymin=ft_low, ymax=ft_up)
122 darray.defineHistogram(
'slotnb,FTnb;RAW_nbOfFT',
123 title=
'Average # of cells with (qfactor+time) readout;Slot;FT',
126 xbins=slot_n,xmin=slot_low,xmax=slot_up,
127 ybins=ft_n, ymin=ft_low, ymax=ft_up)
130 if __name__==
'__main__':
132 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
136 from AthenaCommon.Logging
import log
140 from AthenaMonitoring.DQConfigFlags
import DQDataType
141 from LArMonitoring.LArMonConfigFlags
import addLArMonFlags
143 flags.addFlagsCategory(
"LArMon", addLArMonFlags)
147 flags.Input.Files = [
148 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00404637/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-1._0001.data",
149 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00404637/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-2._0001.data",
150 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00404637/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-3._0001.data",
151 "/eos/atlas/atlastier0/rucio/data21_calib/calibration_LArElec-Pedestal-32s-High-All/00404637/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW/data21_calib.00404637.calibration_LArElec-Pedestal-32s-High-All.daq.RAW._lb0000._SFO-4._0001.data"]
152 flags.Output.HISTFileName =
'LArCalibPedMonOutput_'+run+
'.root'
154 flags.DQ.enableLumiAccess =
False
155 flags.Input.isMC =
False
156 flags.DQ.useTrigger =
False
157 flags.LAr.doAlign=
False
158 from AthenaConfiguration.Enums
import BeamType
159 flags.Beam.Type = BeamType.Collisions
160 flags.DQ.DataType = DQDataType.Collisions
161 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
162 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
163 flags.Detector.GeometryCSC=
False
164 flags.Detector.GeometrysTGC=
False
165 flags.Detector.GeometryMM=
False
166 flags.Exec.OutputLevel=DEBUG
170 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
173 from LArByteStream.LArRawCalibDataReadingConfig
import LArRawCalibDataReadingCfg
178 cfg.printConfig(withDetails=
False)
181 f=
open(
"LArCalibPedMon_"+run+
".pkl",
"wb")