11 '''Function to configures TileDigitsFlxMonAlg algorithms in the monitoring system.'''
13 kwargs.setdefault(
'TileDigitsContainerLegacy',
'TileDigitsCnt')
14 kwargs.setdefault(
'TileDigitsContainerFlx',
'TileDigitsFlxCnt')
15 kwargs.setdefault(
'FirstSample', 0)
16 kwargs.setdefault(
'LastSample', 15)
17 kwargs.setdefault(
'FelixOffset', 0)
18 kwargs.setdefault(
'FelixScale', 4)
20 felixScale = kwargs[
'FelixScale']
22 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
25 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
28 from AthenaMonitoring
import AthMonitorCfgHelper
29 helper = AthMonitorCfgHelper(flags,
'TileDigitsFlxMonitoring')
31 from AthenaConfiguration.ComponentFactory
import CompFactory
32 TileDigitsFlxMonitorAlgorithm = CompFactory.TileDigitsFlxMonitorAlgorithm
33 tileDigitsFlxMonAlg = helper.addAlgorithm(TileDigitsFlxMonitorAlgorithm,
'TileDigitsFlxMonAlg')
34 tileDigitsFlxMonAlg.TriggerChain =
''
36 for k, v
in kwargs.items():
37 setattr(tileDigitsFlxMonAlg, k, v)
40 executeTimeGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileDigitsFlxMonExecuteTime', f
'{topPath}/Felix')
41 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'Digits', type=
'TH1F',
42 title =
'Time for execute TileDigitsFlxMonAlg algorithm;time [#mus]',
43 xbins = 300, xmin = 0, xmax = 300000)
45 runNumber = flags.Input.RunNumbers[0]
46 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
50 for fragID
in fragIDs:
52 drawer = fragID & 0x3F
53 modules += [Tile.getDrawerString(ros, drawer)]
55 for ros
in range(1, Tile.MAX_ROS):
56 for drawer
in range(0, Tile.MAX_DRAWER):
57 modules += [Tile.getDrawerString(ros, drawer)]
59 channelHFNGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileFlxMonHFN', f
'{topPath}/Felix/Digits')
60 for moduleName
in modules:
61 for gainName
in [
'HG',
'LG']:
62 title = f
'Run {runNumber} {moduleName} {gainName}: Mean RMS in event (HFN)-FELIX;Channel;HFN'
63 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_HFN;{moduleName}_HFN_{gainName}'
65 channelHFNGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
66 xbins = 48, xmin = -0.5, xmax = 47.5)
68 channelPedGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileFlxMonPed', f
'{topPath}/Felix/Digits')
69 for moduleName
in modules:
70 for gainName
in [
'HG',
'LG']:
71 title = f
'Run {runNumber} {moduleName} {gainName}: Pedestal, sample[0]-FELIX;Channel;ADC'
72 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_Pedestal;{moduleName}_Pedestal_{gainName}'
74 channelPedGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
75 xbins = 48, xmin = -0.5, xmax = 47.5)
77 channelHFNGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileLegacyMonHFN', f
'{topPath}/Legacy/Digits')
78 for moduleName
in modules:
79 for gainName
in [
'HG',
'LG']:
80 title = f
'Run {runNumber} {moduleName} {gainName}: Mean RMS in event (HFN);Channel;HFN'
81 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_HFN;{moduleName}_HFN_{gainName}'
83 channelHFNGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
84 xbins = 48, xmin = -0.5, xmax = 47.5)
86 channelPedGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileLegacyMonPed', f
'{topPath}/Legacy/Digits')
87 for moduleName
in modules:
88 for gainName
in [
'HG',
'LG']:
89 title = f
'Run {runNumber} {moduleName} {gainName}: Pedestal, sample[0];Channel;ADC'
90 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_Pedestal;{moduleName}_Pedestal_{gainName}'
92 channelPedGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
93 xbins = 48, xmin = -0.5, xmax = 47.5)
95 channelSamplesFlxGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileFlxMonSamples', f
'{topPath}/Felix/Digits')
96 for moduleName
in modules:
97 for channel
in range(0, Tile.MAX_CHAN):
98 for gainName
in [
'HG',
'LG']:
99 title = (f
'Run {runNumber} {moduleName} channel {channel} {gainName}: Samples-FELIX;Sample [ADC];N')
100 name = f
'{moduleName}_ch_{str(channel)}_{gainName}_samples'
102 channelSamplesFlxGroup.defineHistogram(name, title = title, path = path, type =
'TH1F',
103 xbins = 4096, xmin = -0.5, xmax = 4095.5)
106 channelSamplesLegacyGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileLegacyMonSamples', f
'{topPath}/Legacy/Digits')
107 for moduleName
in modules:
108 for channel
in range(0, Tile.MAX_CHAN):
109 for gainName
in [
'HG',
'LG']:
110 title = (f
'Run {runNumber} {moduleName} channel {channel} {gainName}: Samples;Sample [ADC];N')
111 name = f
'{moduleName}_ch_{str(channel)}_{gainName}_samples'
113 channelSamplesLegacyGroup.defineHistogram(name, title = title, path = path, type =
'TH1F',
114 xbins = 1024, xmin = -0.5, xmax = 1023.5)
116 channelAllSamplesDiffGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileChannelAllSamplesDiff', f
'{topPath}/Compare/Digits')
117 for moduleName
in modules:
118 for channel
in range(0, Tile.MAX_CHAN):
119 for gainName
in [
'HG',
'LG']:
120 title = (f
'Run {runNumber} {moduleName} channel {channel} {gainName}: Samples difference (FELIX-Legacy*{felixScale});Sample [ADC];N')
121 name = f
'{moduleName}_ch_{str(channel)}_{gainName}_samples_diff'
123 channelAllSamplesDiffGroup.defineHistogram(name, title = title, path = path, type =
'TH1F',
124 xbins = 200, xmin = -100, xmax = 100)
126 moduleAllSamplesGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileModuleAllSamplesDiff', f
'{topPath}/Compare/Digits')
127 for moduleName
in modules:
128 for gainName
in [
'HG',
'LG']:
129 title = (f
'Run {runNumber} {moduleName} {gainName}: All channels samples difference (FELIX-Legacy*{felixScale});Sample [ADC];N')
130 name = f
'{moduleName}_{gainName}_samples_diff;{moduleName}_{gainName}_all_channels_samples_diff'
132 moduleAllSamplesGroup.defineHistogram(name, title = title, path = path, type =
'TH1F',
133 xbins = 200, xmin = -100, xmax = 100)
135 moduleSamplesDiffGroup = helper.addGroup(tileDigitsFlxMonAlg,
'TileModuleSamplesDiff', f
'{topPath}/Compare/Digits')
136 for moduleName
in modules:
137 for gainName
in [
'HG',
'LG']:
138 title = f
'Run {runNumber} {moduleName} {gainName}: Samples difference (FELIX-Legacy*{felixScale});Channel;ADC'
139 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_samples_diff;{moduleName}_{gainName}_samples_diff'
141 moduleSamplesDiffGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
142 xbins = 48, xmin = -0.5, xmax = 47.5)
145 accumalator = helper.result()
146 result.merge(accumalator)