12def TileTMDBMonitoringConfig(flags, **kwargs):
13 ''' Function to configure TileTMDBMonitorAlgorithm algorithm in the monitoring system.'''
14 histogram_limits = {
15 TileRunType.PHY: {
16 "Energy": [-100, 10000],
17 "Error": [-1010, 1010]
18 },
19 TileRunType.LAS: {
20 "Energy": [-5, 30],
21 "Error": [-10, 10]
22 },
23 TileRunType.BILAS: {
24 "Energy": [-1010, 1010],
25 "Error": [-1010, 1010]
26 },
27 TileRunType.CIS: {
28 "Energy": [-1, 10],
29 "Error": [-10, 10]
30 },
31 TileRunType.MONOCIS: {
32 "Energy": [-1, 10],
33 "Error": [-10, 10]
34 },
35 TileRunType.PED: {
36 "Energy": [-700, 700],
37 "Error": [-500, 500]
38 }
39 }
40
41
42
43
44 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
45 result = ComponentAccumulator()
46
47 from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg
48 result.merge( TileCablingSvcCfg(flags) )
49
50 from TileConditions.TileTMDBConfig import TileTMDBCondAlgCfg
51 result.merge( TileTMDBCondAlgCfg(flags) )
52
53 kwargs.setdefault('fillDetailedHistograms', False)
54
55 runType = flags.Tile.RunType
56 if runType is TileRunType.PHY:
57 kwargs.setdefault('PulseEnergyRange', [1000., 5000.])
58
59
60
61 from AthenaMonitoring import AthMonitorCfgHelper
62 helper = AthMonitorCfgHelper(flags,'TileTMDBMonitoring')
63
64
65 from AthenaConfiguration.ComponentFactory import CompFactory
66 tileTMDBMonAlg = helper.addAlgorithm(CompFactory.TileTMDBMonitorAlgorithm, 'TileTMDBMonAlg')
67
68 for k, v in kwargs.items():
69 setattr(tileTMDBMonAlg, k, v)
70
71 run = str(flags.Input.RunNumbers[0])
72
73
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)
78
79 from TileMonitoring.TileMonitoringCfgHelper import addTileTMDB_1DHistogramsArray
80
81 addTileTMDB_1DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_MeanPulse',
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)
85
86 addTileTMDB_1DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_Energy',
87 xvalue = 'energy', path = 'Tile/TMDB/NoiseAnalysis',
88 title = 'Energy in TMDB;E_{TMDB} [MeV]', type = 'TH1D', run = run,
89 xbins = 101,
90 xmin = histogram_limits[runType]["Energy"][0],
91 xmax = histogram_limits[runType]["Energy"][1], perModule = True)
92
93 addTileTMDB_1DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_Peak',
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)
97
98 from TileMonitoring.TileMonitoringCfgHelper import addTileTMDB2DScatterHistogramsArray
99
100 addTileTMDB2DScatterHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_ChanNoise',
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)
104
105 errorTitle = 'Energy difference between TMDB and correspoding Tile Cell (D) PMT;E_{D_PMT} - E_{TMDB} [MeV]'
106 addTileTMDB_1DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_CalibrationError',
107 xvalue = 'error', path = 'Tile/TMDB/CalibError',
108 title = errorTitle, type = 'TH1D', run = run,
109 xbins = 101,
110 xmin = histogram_limits[runType]["Error"][0],
111 xmax = histogram_limits[runType]["Error"][1],
112 perModule = True)
113
114 from TileMonitoring.TileMonitoringCfgHelper import addTileTMDB_2DHistogramsArray
115
116 addTileTMDB_2DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_Energy',
117 value = 'energy', title = 'Energy [MeV] in TMDB',
118 path = 'Tile/TMDB', type='TProfile2D', run = run)
119
120 addTileTMDB_2DHistogramsArray(helper, tileTMDBMonAlg, name = 'TMDB_PeakPosition',
121 value = 'peakPosition', title = 'Position of peak sample in TMDB',
122 path = 'Tile/TMDB', type='TProfile2D', run = run)
123
124 accumalator = helper.result()
125 result.merge(accumalator)
126 return result
127