5 from TileConfiguration.TileConfigFlags
import TileRunType
8 @file TileTMDBMonitorAlgorithm.py
9 @brief Python configuration of TileTMDBMonitorAlgorithm algorithm for the Run III
13 ''' Function to configure TileTMDBMonitorAlgorithm algorithm in the monitoring system.'''
16 "Energy": [-100, 10000],
17 "Error": [-1010, 1010]
24 "Energy": [-1010, 1010],
25 "Error": [-1010, 1010]
31 TileRunType.MONOCIS: {
36 "Energy": [-700, 700],
44 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
47 from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
50 from TileConditions.TileTMDBConfig
import TileTMDBCondAlgCfg
53 kwargs.setdefault(
'fillDetailedHistograms',
False)
55 runType = flags.Tile.RunType
56 if runType
is TileRunType.PHY:
57 kwargs.setdefault(
'PulseEnergyRange', [1000., 5000.])
61 from AthenaMonitoring
import AthMonitorCfgHelper
62 helper = AthMonitorCfgHelper(flags,
'TileTMDBMonitoring')
65 from AthenaConfiguration.ComponentFactory
import CompFactory
66 tileTMDBMonAlg = helper.addAlgorithm(CompFactory.TileTMDBMonitorAlgorithm,
'TileTMDBMonAlg')
68 for k, v
in kwargs.items():
69 setattr(tileTMDBMonAlg, k, v)
71 run =
str(flags.Input.RunNumbers[0])
74 executeTimeGroup = helper.addGroup(tileTMDBMonAlg,
'TileTMDBMonExecuteTime',
'Tile/')
75 executeTimeGroup.defineHistogram(
'TIME_execute', path =
'TMDB', type=
'TH1F',
76 title =
'Time for execute TileTMDBMonAlg algorithm;time [#ms]',
77 xbins = 100, xmin = 0, xmax = 100000)
79 from TileMonitoring.TileMonitoringCfgHelper
import addTileTMDB_1DHistogramsArray
82 xvalue =
'sampleNumber', value =
'sample', path =
'Tile/TMDB/MeanPulse',
83 title =
'Mean pulse shape in TMDB;#sample;[ADC]', type =
'TProfile',
84 run = run, xbins = 7, xmin = -0.5, xmax = 6.5, perModule =
True)
87 xvalue =
'energy', path =
'Tile/TMDB/NoiseAnalysis',
88 title =
'Energy in TMDB;E_{TMDB} [MeV]', type =
'TH1D', run = run,
90 xmin = histogram_limits[runType][
"Energy"][0],
91 xmax = histogram_limits[runType][
"Energy"][1], perModule =
True)
94 xvalue =
'peak', path =
'Tile/TMDB/PeakPosition',
95 title =
'Peak Position in TMDB;E_{TMDB}', type =
'TH1D', run = run,
96 xbins = 7, xmin = 0, xmax = 7, perModule =
True)
98 from TileMonitoring.TileMonitoringCfgHelper
import addTileTMDB2DScatterHistogramsArray
101 xvalue =
'channX', yvalue =
'channY', path =
'Tile/TMDB/ChannelNoise',
102 title =
'Channel CrossProduct TMDB;', type =
'TH2D', run = run,
103 xbins = 101, xmin = 0, xmax = 255)
105 errorTitle =
'Energy difference between TMDB and correspoding Tile Cell (D) PMT;E_{D_PMT} - E_{TMDB} [MeV]'
107 xvalue =
'error', path =
'Tile/TMDB/CalibError',
108 title = errorTitle, type =
'TH1D', run = run,
110 xmin = histogram_limits[runType][
"Error"][0],
111 xmax = histogram_limits[runType][
"Error"][1],
114 from TileMonitoring.TileMonitoringCfgHelper
import addTileTMDB_2DHistogramsArray
117 value =
'energy', title =
'Energy [MeV] in TMDB',
118 path =
'Tile/TMDB', type=
'TProfile2D', run = run)
121 value =
'peakPosition', title =
'Position of peak sample in TMDB',
122 path =
'Tile/TMDB', type=
'TProfile2D', run = run)
124 accumalator = helper.result()
125 result.merge(accumalator)
128 if __name__==
'__main__':
131 from AthenaCommon.Logging
import log
136 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
137 from AthenaConfiguration.TestDefaults
import defaultGeometryTags, defaultTestFiles
139 flags.Input.Files = defaultTestFiles.RAW_RUN2
140 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
141 flags.Output.HISTFileName =
'TileTMDBMonitorOutput.root'
142 flags.DQ.useTrigger =
False
143 flags.DQ.enableLumiAccess =
False
144 flags.Exec.MaxEvents = 3
150 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
153 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
155 readMuRcvDigits=
True, readMuRcvRawCh=
True) )
159 cfg.printConfig(withDetails =
True, summariseProps =
True)
162 cfg.store(
open(
'TileTMDBMonitorAlgorithm.pkl',
'wb') )
168 sys.exit(
not sc.isSuccess())