10 ''' Function to configure TileRawChannelNoiseMonitorAlgorithm algorithm in the monitoring system.'''
14 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
17 from TileRecUtils.TileDQstatusConfig
import TileDQstatusAlgCfg
20 from TileGeoModel.TileGMConfig
import TileGMCfg
23 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
26 from TileConditions.TileBadChannelsConfig
import TileBadChannelsCondAlgCfg
29 from TileConditions.TileEMScaleConfig
import TileEMScaleCondAlgCfg
32 kwargs.setdefault(
'CheckDCS', flags.Tile.useDCS)
33 if kwargs[
'CheckDCS']:
34 from TileConditions.TileDCSConfig
import TileDCSCondAlgCfg
38 kwargs.setdefault(
'TriggerTypes', [0x82])
39 kwargs.setdefault(
'Gain', 1)
40 kwargs.setdefault(
'TileRawChannelContainer', flags.Tile.RawChannelContainer)
41 kwargs.setdefault(
'ignoreDisconnectedChannels', flags.Common.isOnline)
45 from AthenaMonitoring
import AthMonitorCfgHelper
46 helper = AthMonitorCfgHelper(flags,
'TileRawChanNoiseMonitoring')
49 from AthenaConfiguration.ComponentFactory
import CompFactory
50 TileRawChannelNoiseMonitorAlgorithm = CompFactory.TileRawChannelNoiseMonitorAlgorithm
51 tileRawChanNoiseMonAlg = helper.addAlgorithm(TileRawChannelNoiseMonitorAlgorithm,
'TileRawChanNoiseMonAlg')
53 for k, v
in kwargs.items():
54 setattr(tileRawChanNoiseMonAlg, k, v)
56 run =
str(flags.Input.RunNumbers[0])
59 executeTimeGroup = helper.addGroup(tileRawChanNoiseMonAlg,
'TileRawChanNoiseMonExecuteTime',
'Tile/')
60 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'RawChannelNoise', type=
'TH1F',
61 title =
'Time for execute TileRawChanNoiseMonAlg algorithm;time [#mus]',
62 xbins = 100, xmin = 0, xmax = 100000)
65 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
67 from TileMonitoring.TileMonitoringCfgHelper
import getPartitionName, getCellName, getGainName
71 dimensions = [
int(Tile.MAX_ROS) - 1,
int(Tile.MAX_DRAWER),
int(Tile.MAX_CHAN)]
72 chanAmpArray = helper.addArray(dimensions, tileRawChanNoiseMonAlg,
73 'TileRawChannelNoise', topPath =
'Tile/RawChannelNoise')
74 for postfix, tool
in chanAmpArray.Tools.items():
75 ros, module, channel = [
int(x)
for x
in postfix.split(
'_')[1:]]
78 moduleName = Tile.getDrawerString(ros + 1, module)
81 title =
'Run %s %s: Tile cell %s / channel %s amplitude (%s);Amplitude [ADC]'
82 title = title % (run, moduleName, cellName,
str(channel), gainName)
83 name =
'amplitude;TileRawChannelNoise_%s_%s_ch_%s_%s' % (moduleName, cellName,
str(channel), gainName)
84 fullPath =
'{}/{}'.
format(partition, moduleName)
86 tool.defineHistogram(name, title = title, path = fullPath, type =
'TH1F',
87 xbins = 81, xmin = -20.25, xmax = 20.25)
89 accumalator = helper.result()
90 result.merge(accumalator)