8def TileClusterMonitoringConfig(flags, **kwargs):
9
10 ''' Function to configure TileClusterMonitorAlgorithm algorithm in the monitoring system.'''
11
12
13
14 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
15 result = ComponentAccumulator()
16
17 from TileMonitoring.TileTopoClusterConfig import TileTopoClusterCfg
18 result.merge( TileTopoClusterCfg(flags) )
19
20
21
22 from AthenaMonitoring import AthMonitorCfgHelper
23 helper = AthMonitorCfgHelper(flags,'TileClusterMonitoring')
24
25
26 from AthenaConfiguration.ComponentFactory import CompFactory
27 tileClusterMonAlg = helper.addAlgorithm(CompFactory.TileClusterMonitorAlgorithm, 'TileClusterMonAlg')
28
29 tileClusterMonAlg.TriggerChain = ''
30
31
32
33
34
35
36
37 kwargs.setdefault('fillHistogramsForL1Triggers', ['AnyPhysTrig', 'bit7_Calib'])
38 l1Triggers = kwargs['fillHistogramsForL1Triggers']
39
40 kwargs.setdefault('fillTimingHistograms', flags.Common.isOnline)
41 fillTimingHistograms = kwargs['fillTimingHistograms']
42
43 for k, v in kwargs.items():
44 setattr(tileClusterMonAlg, k, v)
45
46 run = str(flags.Input.RunNumbers[0])
47
48
49 executeTimeGroup = helper.addGroup(tileClusterMonAlg, 'TileClusterMonExecuteTime', 'Tile/')
50 executeTimeGroup.defineHistogram('TIME_execute', path = 'Cluster', type='TH1F',
51 title = 'Time for execute TileClusterMonAlg algorithm;time [#mus]',
52 xbins = 100, xmin = 0, xmax = 1000)
53
54
55 from TileCalibBlobObjs.Classes import TileCalibUtils as Tile
56
57
58 from TileMonitoring.TileMonitoringCfgHelper import addTileEtaPhiMapsArray
59
60
61 addTileEtaPhiMapsArray(helper, tileClusterMonAlg, name = 'TileClusterEtaPhi', type='TH2D',
62 title = 'Most energetic Tile Cluster position', path = 'Tile/Cluster',
63 run = run, triggers = l1Triggers, perSample = False)
64
65
66 addTileEtaPhiMapsArray(helper, tileClusterMonAlg, name = 'TileAllClusterEtaPhi', type='TH2D',
67 title = 'All Tile Cluster position', path = 'Tile/Cluster',
68 run = run, triggers = l1Triggers, perSample = False)
69
70
71 addTileEtaPhiMapsArray(helper, tileClusterMonAlg, name = 'TileAllClusterEneEtaPhi', type='TProfile2D',
72 value = 'energy', title = 'All Tile Cluster everage energy [MeV]',
73 path = 'Tile/Cluster', run = run, triggers = l1Triggers, perSample = False)
74
75
76
77 addTileEtaPhiMapsArray(helper, tileClusterMonAlg, name = 'TileClusterEtaPhiDiff', type='TH2D',
78 title = 'Position correlation of Tile Cluster opposite to most energetic cluster',
79 path = 'Tile/Cluster', run = run, triggers = l1Triggers, perSample = False,
80 etaTitle = '#Delta #eta', etabins = 21, etamin = -2.025, etamax = 2.025,
81 phiTitle = '#Delta #phi', phibins = Tile.MAX_DRAWER, phimin = 0.0, phimax = 6.4)
82
83
84 from TileMonitoring.TileMonitoringCfgHelper import addTile1DHistogramsArray
85
86
87 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterEnergy', xvalue = 'energy',
88 title = 'Energy in most energetic Tile Cluster [MeV]', path = 'Tile/Cluster',
89 xbins = 80, xmin = 0., xmax = 20000., type = 'TH1D', run = run,
90 triggers = l1Triggers, perPartition = True, perSample = False,
91 perGain = False, subDirectory = True, allPartitions = True)
92
93
94 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterEt', xvalue = 'et',
95 title = 'E_{T} [MeV] in most energetic Tile Cluster', path = 'Tile/Cluster',
96 xbins = 80, xmin = 0., xmax = 20000., type = 'TH1D', run = run,
97 triggers = l1Triggers, perPartition = False, perSample = False,
98 perGain = False, subDirectory = False, allPartitions = False)
99
100
101 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterNCells', xvalue = 'nCells',
102 title = 'Number of cells in most energetic Tile Cluster', path = 'Tile/Cluster',
103 xbins = 100, xmin = 0., xmax = 100., type = 'TH1D', run = run,
104 triggers = l1Triggers, perPartition = False, perSample = False,
105 perGain = False, subDirectory = False, allPartitions = False)
106
107
108
109 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileAllClusterEnergy', xvalue = 'energy',
110 title = 'All Tile Cluster Energy [MeV]', path = 'Tile/Cluster',
111 xbins = 80, xmin = 0., xmax = 20000., type = 'TH1D', run = run,
112 triggers = l1Triggers, perPartition = False, perSample = False,
113 perGain = False, subDirectory = False, allPartitions = False)
114
115
116 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileNClusters', xvalue = 'nClusters',
117 title = 'Number of Tile Clusters', path = 'Tile/Cluster',
118 xbins = 200, xmin = 0., xmax = 200., type = 'TH1D', run = run,
119 triggers = l1Triggers, perPartition = False, perSample = False,
120 perGain = False, subDirectory = False, allPartitions = False)
121
122
123 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterSumPx', xvalue = 'sumPx',
124 title = 'Tile Clusters SumPx [MeV]', path = 'Tile/Cluster',
125 xbins = 101, xmin = -10000., xmax = 10000., type = 'TH1D', run = run,
126 triggers = l1Triggers, perPartition = False, perSample = False,
127 perGain = False, subDirectory = False, allPartitions = False)
128
129
130 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterSumPy', xvalue = 'sumPy',
131 title = 'Tile Clusters SumPy [MeV]', path = 'Tile/Cluster',
132 xbins = 101, xmin = -10000., xmax = 10000., type = 'TH1D', run = run,
133 triggers = l1Triggers, perPartition = False, perSample = False,
134 perGain = False, subDirectory = False, allPartitions = False)
135
136
137 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterSumEt', xvalue = 'sumEt',
138 title = 'Tile Clusters SumEt [MeV]', path = 'Tile/Cluster',
139 xbins = 100, xmin = 0., xmax = 20000., type = 'TH1D', run = run,
140 triggers = l1Triggers, perPartition = False, perSample = False,
141 perGain = False, subDirectory = False, allPartitions = False)
142
143
144 timeDiffTitle = 'Tile time correlation of cluster opposite to most energetic cluster; Time difference [ns]'
145 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterTimeDiff', xvalue = 'timeDiff',
146 title = timeDiffTitle, path = 'Tile/Cluster', xbins = 200, xmin = -100., xmax = 100.,
147 type = 'TH1D', run = run, triggers = l1Triggers, perPartition = False, perSample = False,
148 perGain = False, subDirectory = False, allPartitions = False)
149
150
151 eneDiffTitle = 'Tile energy correlation of cluster opposite to most energetic cluster; Time energy [MeV]'
152 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TileClusterEneDiff', xvalue = 'energyDiff',
153 title = eneDiffTitle, path = 'Tile/Cluster', xbins = 200, xmin = -10000., xmax = 10000.,
154 type = 'TH1D', run = run, triggers = l1Triggers, perPartition = False, perSample = False,
155 perGain = False, subDirectory = False, allPartitions = False)
156
157
158 if fillTimingHistograms:
159
160 titlePartitionTime = 'Tile partition time vs luminosity block;LumiBlock;t[ns]'
161 addTile1DHistogramsArray(helper, tileClusterMonAlg, name = 'TilePartitionTimeLB', opt = 'kAddBinsDynamically',
162 xvalue = 'lumiBlock', value = 'time', title = titlePartitionTime, path = 'Tile/Cluster',
163 xbins = 1000, xmin = -0.5, xmax = 999.5, type='TProfile', run = run, triggers = [],
164 subDirectory = False, perPartition = True, perSample = False, perGain = False,
165 allPartitions = True, merge='merge')
166
167
168 accumalator = helper.result()
169 result.merge(accumalator)
170 return result
171