5 @file TileRawChannelNoiseMonitorAlgorithm.py
6 @brief Python configuration of TileRawChannelNoiseMonitorAlgorithm algorithm for the Run III
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)
93 if __name__==
'__main__':
96 from AthenaCommon.Logging
import log
101 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
102 from AthenaConfiguration.TestDefaults
import defaultGeometryTags, defaultConditionsTags
104 flags.Input.Files = [
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TileRecEx/data24_13p6TeV.00485506.physics_CosmicCalo.merge.RAW._lb0202._SFO-ALL.TT130.10_events._0001.1']
105 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
106 flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
107 flags.Output.HISTFileName =
'TileRawChannelNoiseMonitorOutput.root'
108 flags.DQ.useTrigger =
False
109 flags.DQ.enableLumiAccess =
False
110 flags.Exec.MaxEvents = 3
115 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
118 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
121 from TileRecUtils.TileRawChannelMakerConfig
import TileRawChannelMakerCfg
126 cfg.printConfig(withDetails =
True, summariseProps =
True)
129 cfg.store(
open(
'TileRawChannelNoiseMonitorAlgorithm.pkl',
'wb') )
135 sys.exit(
not sc.isSuccess())