From de9d5aafabf65ab9151b3a08ae69d8f4e14a40a0 Mon Sep 17 00:00:00 2001 From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch> Date: Fri, 30 Oct 2020 17:01:15 +0100 Subject: [PATCH] TileMonitoring: Set up top path in Tile monitoring histograms for Run3 Tile monitoring configuartion helper functions have been modified to set up top path during adding arrays of tools (histograms). --- .../python/TileMonitoringCfgHelper.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py b/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py index 4ba90944b8e..ff8e8a79a01 100644 --- a/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py +++ b/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py @@ -191,10 +191,10 @@ def getLabels(labels, partition = ''): def getCellNameTMDB(partition, channel): - return _cellNameTMDB_LB[channel] if partition.startswith('L') else _cellNameTMDB_EB[channel] + return _cellNameTMDB_LB[channel] if partition.startswith('L') else _cellNameTMDB_EB[channel] def getCellChannelTMDB_Labels(partition): - return _cellNameTMDB_LB if partition.startswith('L') else _cellNameTMDB_EB + return _cellNameTMDB_LB if partition.startswith('L') else _cellNameTMDB_EB def addValueVsModuleAndChannelMaps(group, name, title, path, subDirectory = False, type = 'TH2D', value = '', trigger = '', run = ''): @@ -313,7 +313,7 @@ def addTile2DHistogramsArray(helper, algorithm, name = '', xvalue = '', yvalue = dimensions = _getDimensions(triggers = triggers, perPartition = perPartition, perSample = perSample, perGain = perGain, allPartitions = allPartitions) - array = helper.addArray(dimensions, algorithm, name) + array = helper.addArray(dimensions, algorithm, name, topPath = path) for postfix, tool in array.Tools.items(): kwargs = _parsePostfix(postfix, triggers = triggers, perPartition = perPartition, @@ -326,10 +326,10 @@ def addTile2DHistogramsArray(helper, algorithm, name = '', xvalue = '', yvalue = fullName = xvalue + ',' + yvalue + (',' + value if 'Profile' in type else '') + ';' fullName += getTileHistogramName(name = name,separator = separator, **kwargs) - fullPath = getTileHistogramPath(path = path, subDirectory = subDirectory, **kwargs) + subPath = getTileHistogramPath(path = '', subDirectory = subDirectory, **kwargs) fullTitle = getTileHistogramTitle(title = title, run = run, **kwargs) - tool.defineHistogram( fullName, path = fullPath, type = type, title = fullTitle, + tool.defineHistogram( fullName, path = subPath, type = type, title = fullTitle, xlabels = nxlabels, ylabels = nylabels, xbins = xbins, xmin = xmin, xmax = xmax, ybins = ybins, ymin = ymin, ymax = ymax, weight = weight) @@ -535,7 +535,7 @@ def addTile1DHistogramsArray(helper, algorithm, name = '', xvalue = '', value = dimensions = _getDimensions(triggers = triggers, perPartition = perPartition, perSample = perSample, perGain = perGain, allPartitions = allPartitions) - array = helper.addArray(dimensions, algorithm, name) + array = helper.addArray(dimensions, algorithm, name, topPath = path) for postfix, tool in array.Tools.items(): kwargs = _parsePostfix(postfix, triggers = triggers, perPartition = perPartition, @@ -547,10 +547,10 @@ def addTile1DHistogramsArray(helper, algorithm, name = '', xvalue = '', value = fullName = xvalue + (',' + value if 'Profile' in type else '') + ';' fullName += getTileHistogramName(name = name,separator = separator, **kwargs) - fullPath = getTileHistogramPath(path = path, subDirectory = subDirectory, **kwargs) + subPath = getTileHistogramPath(path = '', subDirectory = subDirectory, **kwargs) fullTitle = getTileHistogramTitle(title = title, run = run, **kwargs) - tool.defineHistogram( fullName, path = fullPath, type = type, title = fullTitle, + tool.defineHistogram( fullName, path = subPath, type = type, title = fullTitle, xlabels = nxlabels, xbins = xbins, xmin = xmin, xmax = xmax, opt = opt) return array @@ -590,7 +590,7 @@ def addTileModuleArray(helper, algorithm, name, title, path, def addTileTMDB_2DHistogramsArray(helper, algorithm, name = '', value = '', title = '', path = '', type = 'TH2D', run = ''): - array = helper.addArray([int(Tile.MAX_ROS - 1)], algorithm, name) + array = helper.addArray([int(Tile.MAX_ROS - 1)], algorithm, name, topPath = path) for postfix, tool in array.Tools.items(): ros = int(postfix.split('_').pop()) + 1 @@ -604,7 +604,7 @@ def addTileTMDB_2DHistogramsArray(helper, algorithm, name = '', value = '', fullTitle = getTileHistogramTitle(title, run = run, partition = partition) - tool.defineHistogram( fullName, path = path, type = type, title = fullTitle, + tool.defineHistogram( fullName, path = '', type = type, title = fullTitle, xlabels = nxlabels, ylabels = nylabels, xbins = Tile.MAX_DRAWER, xmin = -0.5, xmax = Tile.MAX_DRAWER - 0.5, ybins = ybins, ymin = -0.5, ymax = ybins - 0.5) @@ -619,7 +619,7 @@ def addTileTMDB_1DHistogramsArray(helper, algorithm, name = '', xvalue = '', val baseName = "{}_{}".format(name, partition) nChannels = len(_cellNameTMDB_LB) if partition.startswith('L') else len(_cellNameTMDB_EB) dimensions = [int(Tile.MAX_DRAWER), nChannels] if perModule else [nChannels] - array = helper.addArray(dimensions, algorithm, baseName, topPath = 'Tile') + array = helper.addArray(dimensions, algorithm, baseName, topPath = path) for postfix, tool in array.Tools.items(): elements = postfix.split('_') channel = int(elements.pop()) @@ -631,7 +631,6 @@ def addTileTMDB_1DHistogramsArray(helper, algorithm, name = '', xvalue = '', val moduleOrPartition = 'Module ' + partition + module if perModule else 'Partition ' + partition fullTitle = 'Run {} {} TMDB {}: {}'.format(run, moduleOrPartition, cell, title) - fullPath = path.replace('Tile/', '') if path.startswith('Tile/') else path - tool.defineHistogram(fullName, path = fullPath, type = type, title = fullTitle, + tool.defineHistogram(fullName, path = '', type = type, title = fullTitle, xbins = xbins, xmin = xmin, xmax = xmax) -- GitLab