6 @file TileDigitsFlxMonitorAlgorithm.py
7 @brief Python configuration of TileDigitsFlxMonitorAlgorithm algorithm for the Run III
11 '''Function to configures TileRawChannelFlxMonAlg algorithms in the monitoring system.'''
13 kwargs.setdefault(
'TileRawChannelContainerLegacy',
'TileRawChannelFit')
14 kwargs.setdefault(
'TileRawChannelContainerFlx',
'TileRawChannelFlxFit')
15 kwargs.setdefault(
'FelixScale', 4)
17 felixScale = kwargs[
'FelixScale']
19 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
22 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
25 from AthenaMonitoring
import AthMonitorCfgHelper
26 helper = AthMonitorCfgHelper(flags,
'TileRawChannelFlxMonitoring')
28 from AthenaConfiguration.ComponentFactory
import CompFactory
29 TileRawChannelFlxMonitorAlgorithm = CompFactory.TileRawChannelFlxMonitorAlgorithm
30 tileRawChannelFlxMonAlg = helper.addAlgorithm(TileRawChannelFlxMonitorAlgorithm,
'TileRawChannelFlxMonAlg')
31 tileRawChannelFlxMonAlg.TriggerChain =
''
33 for k, v
in kwargs.items():
34 setattr(tileRawChannelFlxMonAlg, k, v)
37 executeTimeGroup = helper.addGroup(tileRawChannelFlxMonAlg,
'TileRawChannelFlxMonExecuteTime', f
'{topPath}/Felix')
38 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'RawChannel', type=
'TH1F',
39 title =
'Time for execute TileRawChannelFlxMonAlg algorithm;time [#mus]',
40 xbins = 300, xmin = 0, xmax = 300000)
42 runNumber = flags.Input.RunNumbers[0]
43 from TileCalibBlobObjs.Classes
import TileCalibUtils
as Tile
47 for fragID
in fragIDs:
49 drawer = fragID & 0x3F
50 modules += [Tile.getDrawerString(ros, drawer)]
52 for ros
in range(1, Tile.MAX_ROS):
53 for drawer
in range(0, Tile.MAX_DRAWER):
54 modules += [Tile.getDrawerString(ros, drawer)]
56 channelLegacyGroup = helper.addGroup(tileRawChannelFlxMonAlg,
'TileRawChannelAmpLegacy', f
'{topPath}/Legacy/RawChannel')
57 for moduleName
in modules:
58 for gainName
in [
'HG',
'LG']:
59 title = f
'Run {str(runNumber)} {moduleName} {gainName}: Amplitude (Legacy);Channel;Amplitude'
60 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_amplitude;{moduleName}_{gainName}_amplitude_legacy'
62 channelLegacyGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
63 xbins = 48, xmin = -0.5, xmax = 47.5)
65 channelFelixGroup = helper.addGroup(tileRawChannelFlxMonAlg,
'TileRawChannelAmpFlx', f
'{topPath}/Felix/RawChannel')
66 for moduleName
in modules:
67 for gainName
in [
'HG',
'LG']:
68 title = f
'Run {str(runNumber)} {moduleName} {gainName}: Amplitude (FELIX);Channel;Amplitude'
69 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_amplitude;{moduleName}_{gainName}_amplitude_felix'
71 channelFelixGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
72 xbins = 48, xmin = -0.5, xmax = 47.5)
74 channelCompareGroup = helper.addGroup(tileRawChannelFlxMonAlg,
'TileRawChannelAmpDiff', f
'{topPath}/Compare/RawChannel')
75 for moduleName
in modules:
76 for gainName
in [
'HG',
'LG']:
77 title = f
'Run {str(runNumber)} {moduleName} {gainName}: Amplitude difference (FELIX-Legacy*{felixScale});Channel;Amplitude difference [ADC]'
78 name = f
'{moduleName}_{gainName}_channel,{moduleName}_{gainName}_amplitude_diff;{moduleName}_{gainName}_amplitude_diff'
80 channelCompareGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
81 xbins = 48, xmin = -0.5, xmax = 47.5)
83 channelCompareVsLegacyGroup = helper.addGroup(tileRawChannelFlxMonAlg,
'TileRawChannelAmpDiffVsLegacy', f
'{topPath}/Compare/RawChannel')
84 for moduleName
in modules:
85 for gainName
in [
'HG',
'LG']:
86 title = f
'Run {str(runNumber)} {moduleName} {gainName}: Amplitude difference (FELIX-Legacy*{felixScale});Amplitude (Legacy) [ADC];Amplitude difference [ADC]'
87 name = f
'{moduleName}_{gainName}_amplitude,{moduleName}_{gainName}_amplitude_diff;{moduleName}_{gainName}_amplitude_diff_vs_legacy'
89 channelCompareVsLegacyGroup.defineHistogram(name, title = title, path = path, type =
'TProfile',
90 xbins = 1024, xmin = -0.5, xmax = 1023.5)
92 accumalator = helper.result()
93 result.merge(accumalator)
98 if __name__==
'__main__':
101 from AthenaCommon.Logging
import log
106 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
107 from AthenaConfiguration.TestDefaults
import defaultTestFiles
109 flags.Input.Files = defaultTestFiles.RAW_RUN2
110 flags.Output.HISTFileName =
'TileRawChannelFlxMonitorOutput.root'
111 flags.DQ.useTrigger =
False
112 flags.DQ.enableLumiAccess =
False
113 flags.Exec.MaxEvents = 3
118 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
121 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
125 TileRawChannelContainerLegacy=
'TileRawChannelFit',
126 TileRawChannelContainerFlx=
'TileRawChannelFlxFit',
127 fillHistogramsForDSP=
True))
131 cfg.store(
open(
'TileRawChannelMonitorAlgorithm.pkl',
'wb') )
137 sys.exit(
not sc.isSuccess())