13 ''' Function to configure TileRawChannelTimeMonitorAlgorithm algorithm in the monitoring system.'''
17 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
20 from TileRecUtils.TileDQstatusConfig
import TileDQstatusAlgCfg
23 from TileGeoModel.TileGMConfig
import TileGMCfg
26 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
29 from TileConditions.TileBadChannelsConfig
import TileBadChannelsCondAlgCfg
32 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
35 kwargs.setdefault(
'CheckDCS', flags.Tile.useDCS)
36 if kwargs[
'CheckDCS']:
37 from TileConditions.TileDCSConfig
import TileDCSCondAlgCfg
40 kwargs.setdefault(
'TriggerChain',
'')
41 kwargs.setdefault(
'TriggerTypes', [0x34])
44 partitionPairs = [[0, 1], [0, 2], [0, 3], [1, 2], [1, 3], [2, 3]]
45 kwargs.setdefault(
'PartitionTimeDiffferncePairs', partitionPairs)
47 runType = flags.Tile.RunType
48 partitionTimeCorrections = [0, 0, 0, 0]
49 if flags.Input.RunNumbers[0] > 400000:
50 if runType
is TileRunType.GAPLAS:
51 partitionTimeCorrections = [-28.65, -45.2, 25.24, 24.94]
52 elif runType
is TileRunType.GAPCIS:
53 partitionTimeCorrections = [0, 0, 0, 0]
55 partitionTimeCorrections = [-15.18, -15.37, 47.65, 47.42]
57 kwargs.setdefault(
'PartitionTimeCorrections', partitionTimeCorrections)
61 from AthenaMonitoring
import AthMonitorCfgHelper
62 helper = AthMonitorCfgHelper(flags,
'TileRawChannelTimeMonitoring')
65 from AthenaConfiguration.ComponentFactory
import CompFactory
66 TileRawChannelTimeMonitorAlgorithm = CompFactory.TileRawChannelTimeMonitorAlgorithm
67 tileRawChanTimeMonAlg = helper.addAlgorithm(TileRawChannelTimeMonitorAlgorithm,
'TileRawChanTimeMonAlg')
69 if amplitudeFragIDs
is not None:
70 tileRawChanTimeMonAlg.AmplitudeFragIDs = amplitudeFragIDs
71 for k, v
in kwargs.items():
72 setattr(tileRawChanTimeMonAlg, k, v)
74 run =
str(flags.Input.RunNumbers[0])
75 eventsType =
'CIS' if runType.getCommonType()
is TileRunType.CIS
else 'Laser'
78 executeTimeGroup = helper.addGroup(tileRawChanTimeMonAlg,
'TileRawChanTimeMonExecuteTime',
'Tile/')
79 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'RawChannelTime', type=
'TH1F',
80 title =
'Time for execute TileRawChanTimeMonAlg algorithm;time [#mus]',
81 xbins = 100, xmin = 0, xmax = 100000)
84 from TileMonitoring.TileMonitoringCfgHelper
import addTileModuleChannelMapsArray, getPartitionName
88 title = f
'Tile average time with {eventsType} (partition average time is subracted)',
89 path =
'Tile/RawChannelTime/Summary',
90 type =
'TProfile2D', value =
'time', run = run)
94 title = f
'Tile average uncorrected time with {eventsType}',
95 path =
'Tile/RawChannelTime/Summary',
96 type =
'TProfile2D', value =
'time', run = run)
100 title = f
'Tile average amplitude [pC] with {eventsType}',
101 path =
'Tile/RawChannelTime/Summary',
102 type =
'TProfile2D', value =
'amplitude', run = run)
104 from TileMonitoring.TileMonitoringCfgHelper
import addTile2DHistogramsArray
107 partitionAverageTimeTitle = {}
108 partitionAverageTimeTitleTemplate = f
'Tile average time with {eventsType} corrected by %+0.0f [ns] vs LumiBlock;LumiBlock;t [ns]'
109 for ros
in range(1,5):
110 partitionAverageTimeTitle[
getPartitionName(ros)] = partitionAverageTimeTitleTemplate % (-partitionTimeCorrections[ros - 1])
112 xvalue =
'lumiBlock', yvalue =
'time', type=
'TH2D',
113 title = partitionAverageTimeTitle, opt =
'kAddBinsDynamically', merge =
'merge',
114 path =
'Tile/RawChannelTime/Summary', run = run, perPartition =
True,
115 xbins = 3000, xmin = -0.5, xmax = 2999.5, ybins = 149, ymin = -74.5, ymax = 74.5)
119 partitionPairs = kwargs[
'PartitionTimeDiffferncePairs']
120 partTimeDiffVsLBArray = helper.addArray([len(partitionPairs)], tileRawChanTimeMonAlg,
121 'TileAverageTimeDifferenceLB', topPath =
'Tile/RawChannelTime')
122 for postfix, tool
in partTimeDiffVsLBArray.Tools.items():
123 pairIdx =
int(postfix.split(
'_').pop())
124 partitionName1, partitionName2 = [
getPartitionName(ros + 1)
for ros
in partitionPairs[pairIdx]]
125 ros1, ros2 = partitionPairs[pairIdx]
126 partitionTimeCorrection1 = partitionTimeCorrections[ros1]
127 partitionTimeCorrection2 = partitionTimeCorrections[ros2]
129 title = f
'Run {run}: Average time with {eventsType} between {partitionName1} and {partitionName2}'
130 title +=
' corrected by %+0.0f [ns]' % (partitionTimeCorrection1 - partitionTimeCorrection2)
131 title +=
' vs luminosity block;LumiBlock;t [ns]'
132 name =
'lumiBlock,time;TileAverageTimeDifferenceLB_%s-%s' % (partitionName1, partitionName2)
134 tool.defineHistogram(name, title = title, path =
'Summary', type =
'TProfile',
135 xbins = 1000, xmin = -0.5, xmax = 999.5, opt =
'kAddBinsDynamically', merge =
'merge')
138 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
142 digiTimeVsLBArray = helper.addArray([
int(Tile.MAX_ROS - 1),
int(Tile.MAX_DRAWER), maxDigitizer],
143 tileRawChanTimeMonAlg,
'TileDigitizerTimeLB', topPath =
'Tile/RawChannelTime')
144 for postfix, tool
in digiTimeVsLBArray.Tools.items():
145 ros, module, digitizer = [
int(x)
for x
in postfix.split(
'_')[1:]]
148 moduleName = Tile.getDrawerString(ros + 1, module)
149 title =
'Run ' + run +
' ' + moduleName +
' Digitizer ' +
str(digitizer)
150 title +=
': Time vs luminosity block (partition average time is subracted);LumiBlock;t [ns]'
151 name =
'lumiBlock,time;TileDigitizerTimeLB_' + moduleName +
'_DIGI_' +
str(digitizer)
154 tool.defineHistogram(name, title = title, path = path, type =
'TProfile',
155 xbins = 1000, xmin = -0.5, xmax = 999.5, opt =
'kAddBinsDynamically', merge =
'merge')
159 if amplitudeFragIDs
is not None:
161 for fragID
in amplitudeFragIDs:
163 drawer = fragID & 0x3F
164 modules += [Tile.getDrawerString(ros, drawer)]
166 ampVsLBArray = helper.addArray([modules], tileRawChanTimeMonAlg,
'TileAmplitudeVsLB', topPath=
'Tile/RawChannelTime')
167 for postfix, tool
in ampVsLBArray.Tools.items():
169 moduleName = postfix[1:]
170 partition = moduleName[:3]
171 for channel
in range(0, Tile.MAX_CHAN):
173 title = f
'Run {run} {moduleName} Channel {channel}: Amplitude vs luminosity block;LumiBlock;Amplitude [pC]'
174 name = f
'lumiBlock,amplitude_{channel};TileAmplitudeVsLB_{moduleName}_ch_{channel}'
175 path = f
'{partition}/{moduleName}'
177 tool.defineHistogram(name, title=title, path=path, type=
'TProfile',
178 xbins=1000, xmin=-0.5, xmax=999.5, opt=
'kAddBinsDynamically', merge=
'merge')
181 accumalator = helper.result()
182 result.merge(accumalator)