diff --git a/TileCalorimeter/TileMonitoring/python/TileDigitsMonitorAlgorithm.py b/TileCalorimeter/TileMonitoring/python/TileDigitsMonitorAlgorithm.py index 7c6d5b84faf60ac85b6ae823f8748ab7cd9f1961..4bb2036af5526ad7fb998d1c5abaf6d101cab3bc 100644 --- a/TileCalorimeter/TileMonitoring/python/TileDigitsMonitorAlgorithm.py +++ b/TileCalorimeter/TileMonitoring/python/TileDigitsMonitorAlgorithm.py @@ -20,6 +20,9 @@ def TileDigitsMonitoringConfig(flags, **kwargs): from TileGeoModel.TileGMConfig import TileGMCfg result.merge(TileGMCfg(flags)) + from TileConditions.TileCablingSvcConfig import TileCablingSvcCfg + result.merge(TileCablingSvcCfg(flags)) + from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg result.merge(TileInfoLoaderCfg(flags)) @@ -66,49 +69,7 @@ def TileDigitsMonitoringConfig(flags, **kwargs): from TileCalibBlobObjs.Classes import TileCalibUtils as Tile - - - def addTileChannel1DHistogramsArray(helper, algorithm, name, title, path, - xvalue, xbins, xmin, xmax, type = 'TH1D', - run = '', value = '', aliasSuffix = ''): - ''' - This function configures 1D histograms with Tile monitored value per module, channel, gain. - - Arguments: - helper -- Helper - algorithm -- Monitoring algorithm - name -- Name of histogram, actual name is constructed dynamicaly like: - name + mudule + channel + gain - title -- Title of histogram, actual title is constructed dynamicaly like: - run + module + channel + gain + title - path -- Path in file for histogram (relative to the path of given group) - xvalue -- Name of monitored value for x axis - type -- Type of histogram (TH1D, TProfile) - value -- Name of monitored value (needed for TProfile) - run -- Run number (given it will be put into the title) - xlabels -- List of bin labels - ''' - - dimensions = [int(Tile.MAX_ROS) - 1, int(Tile.MAX_DRAWER)] - array = helper.addArray(dimensions, algorithm, name, topPath = path) - - for postfix, tool in array.Tools.items(): - ros, module = [int(x) for x in postfix.split('_')[1:]] - moduleName = Tile.getDrawerString(ros + 1, module) - fullPath = moduleName - - for channel in range(0, int(Tile.MAX_CHAN)): - channelName = f'0{channel}' if channel < 10 else str(channel) - for gain in range(0, Tile.MAX_GAIN): - gainName = {0 : 'low', 1 : 'high'}.get(gain) - nameSuffix = aliasSuffix if aliasSuffix else xvalue - fullName = f'{xvalue}_{channel}_{gain}' - fullName += f',{value}_{channel}_{gain};' if 'Profile' in type else ';' - fullName += f'{moduleName}_ch_{channelName}_{gainName[:2]}_{nameSuffix}' - fullTitle = f'Run {run} {moduleName} Channel {channelName} {gainName} gain: {title}' - - tool.defineHistogram(fullName, title = fullTitle, path = fullPath, type = type, - xbins = xbins, xmin = xmin, xmax = xmax) + from TileMonitoring.TileMonitoringCfgHelper import addTileChannelHistogramsArray if kwargs['fillErrorsHistograms']: @@ -250,32 +211,32 @@ def TileDigitsMonitoringConfig(flags, **kwargs): if kwargs['fillPedestalHistograms']: # Configure histograms with Tile channel pedestals per module, channel and gain - addTileChannel1DHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsSample0', + addTileChannelHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsSample0', title = 'Pedestal, sample[0]', path = 'Tile/Digits', type = 'TH1I', xvalue = 'sample0', xbins = 151, xmin = -0.5, xmax = 150.5, run = run) if kwargs['fillHighFrequencyNoiseHistograms']: # Configure histograms with Tile channel HFN per module, channel and gain - addTileChannel1DHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsMeanRMS', + addTileChannelHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsMeanRMS', title = 'Mean RMS in event', path = 'Tile/Digits', type = 'TH1F', xvalue = 'meanRMS', xbins = 101, xmin = -0.05, xmax = 10.5, run = run) if kwargs['fillSamplesHistograms']: # Configure histograms with all Tile channel samples per module, channel and gain - addTileChannel1DHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsSamples', + addTileChannelHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsSamples', title = 'All samples', path = 'Tile/Digits', type = 'TH1I', xvalue = 'samples', xbins = 1025, xmin = -0.5, xmax = 1024.5, run = run) if kwargs['fillProfileHistograms']: # Configure histograms with Tile channel average profile per module, channel and gain - addTileChannel1DHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsProfile', + addTileChannelHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsProfile', title = 'Average profile', path = 'Tile/Digits', type = 'TProfile', xvalue = 'sampleNumbers', xbins = 7, xmin = -0.5, xmax = 6.5, run = run, value = 'samples', aliasSuffix = 'prof') if kwargs['fillEventModule32Histograms']: # Configure histograms with all Tile channel samples per module, channel and gain - addTileChannel1DHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsEvtMod32', + addTileChannelHistogramsArray(helper, tileDigitsMonAlg, name = 'TileDigitsEvtMod32', title = 'Event number % 32', path = 'Tile/Digits', type = 'TH1I', xvalue = 'evtn_mod32', xbins = 32, xmin = -0.5, xmax = 31.5, run = run) diff --git a/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py b/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py index 02216695aec1aed938d2e0ab218e570343bb646c..86e013a14dfd4816a5ac219f8c229cb50315c0e8 100644 --- a/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py +++ b/TileCalorimeter/TileMonitoring/python/TileMonitoringCfgHelper.py @@ -683,3 +683,59 @@ def addTileTMDB_1DHistogramsArray(helper, algorithm, name = '', xvalue = '', val tool.defineHistogram(fullName, path = '', type = type, title = fullTitle, xbins = xbins, xmin = xmin, xmax = xmax) + + +def addTileChannelHistogramsArray(helper, algorithm, name, title, path, + xvalue, xbins, xmin, xmax, type='TH1D', + yvalue=None, ybins=None, ymin=None, ymax=None, + run='', value='', aliasSuffix=''): + ''' + This function configures 1D histograms with Tile monitored value per module, channel, gain. + + Arguments: + helper -- Helper + algorithm -- Monitoring algorithm + name -- Name of histogram, actual name is constructed dynamicaly like: + name + mudule + channel + gain + title -- Title of histogram, actual title is constructed dynamicaly like: + run + module + channel + gain + title + path -- Path in file for histogram (relative to the path of given group) + xvalue -- Name of monitored value for x axis + yvalue -- Name of monitored value for y axis + type -- Type of histogram (TH1D, TProfile, TH2D) + value -- Name of monitored value (needed for TProfile) + run -- Run number (given it will be put into the title) + xlabels -- List of bin labels + ''' + + import builtins + dimensions = [int(Tile.MAX_ROS) - 1, int(Tile.MAX_DRAWER)] + array = helper.addArray(dimensions, algorithm, name, topPath = path) + + for postfix, tool in array.Tools.items(): + ros, module = [int(x) for x in postfix.split('_')[1:]] + moduleName = Tile.getDrawerString(ros + 1, module) + fullPath = moduleName + + for channel in range(0, int(Tile.MAX_CHAN)): + channelName = f'0{channel}' if channel < 10 else str(channel) + for gain in range(0, Tile.MAX_GAIN): + gainName = {0 : 'low', 1 : 'high'}.get(gain) + nameSuffix = aliasSuffix if aliasSuffix else xvalue + fullName = f'{xvalue}_{channel}_{gain}' + fullName += f',{yvalue}_{channel}_{gain}' if yvalue else "" + fullName += f',{value}_{channel}_{gain};' if 'Profile' in type else ';' + fullName += f'{moduleName}_ch_{channelName}_{gainName[:2]}_{nameSuffix}' + fullTitle = f'Run {run} {moduleName} Channel {channelName} {gainName} gain: {title}' + + xbinsInGain = xbins[gain] if builtins.type(xbins) is list else xbins + xminInGain = xmin[gain] if builtins.type(xmin) is list else xmin + xmaxInGain = xmax[gain] if builtins.type(xmax) is list else xmax + + ybinsInGain = ybins[gain] if builtins.type(ybins) is list else ybins + yminInGain = ymin[gain] if builtins.type(ymin) is list else ymin + ymaxInGain = ymax[gain] if builtins.type(ymax) is list else ymax + + tool.defineHistogram(fullName, title = fullTitle, path = fullPath, type = type, + xbins = xbinsInGain, xmin = xminInGain, xmax = xmaxInGain, + ybins = ybinsInGain, ymin = yminInGain, ymax = ymaxInGain) diff --git a/TileCalorimeter/TileMonitoring/python/TileRawChannelMonitorAlgorithm.py b/TileCalorimeter/TileMonitoring/python/TileRawChannelMonitorAlgorithm.py index 523739574ce45400b52bba7cad36cf321b0df157..008d2dd15e69f38e25f52b4bcddc57945e5ca9d2 100644 --- a/TileCalorimeter/TileMonitoring/python/TileRawChannelMonitorAlgorithm.py +++ b/TileCalorimeter/TileMonitoring/python/TileRawChannelMonitorAlgorithm.py @@ -99,64 +99,7 @@ def TileRawChannelMonitoringConfig(flags, overlapHistograms=None, **kwargs): xbins = 200, xmin = 0, xmax = 200000) - from TileCalibBlobObjs.Classes import TileCalibUtils as Tile - - - def addTileChannelHistogramsArray(helper, algorithm, name, title, path, - xvalue, xbins, xmin, xmax, type='TH1D', - yvalue=None, ybins=None, ymin=None, ymax=None, - run='', value='', aliasSuffix=''): - ''' - This function configures 1D histograms with Tile monitored value per module, channel, gain. - - Arguments: - helper -- Helper - algorithm -- Monitoring algorithm - name -- Name of histogram, actual name is constructed dynamicaly like: - name + mudule + channel + gain - title -- Title of histogram, actual title is constructed dynamicaly like: - run + module + channel + gain + title - path -- Path in file for histogram (relative to the path of given group) - xvalue -- Name of monitored value for x axis - yvalue -- Name of monitored value for y axis - type -- Type of histogram (TH1D, TProfile, TH2D) - value -- Name of monitored value (needed for TProfile) - run -- Run number (given it will be put into the title) - xlabels -- List of bin labels - ''' - - import builtins - dimensions = [int(Tile.MAX_ROS) - 1, int(Tile.MAX_DRAWER)] - array = helper.addArray(dimensions, algorithm, name, topPath = path) - - for postfix, tool in array.Tools.items(): - ros, module = [int(x) for x in postfix.split('_')[1:]] - moduleName = Tile.getDrawerString(ros + 1, module) - fullPath = moduleName - - for channel in range(0, int(Tile.MAX_CHAN)): - channelName = f'0{channel}' if channel < 10 else str(channel) - for gain in range(0, Tile.MAX_GAIN): - gainName = {0 : 'low', 1 : 'high'}.get(gain) - nameSuffix = aliasSuffix if aliasSuffix else xvalue - fullName = f'{xvalue}_{channel}_{gain}' - fullName += f',{yvalue}_{channel}_{gain}' if yvalue else "" - fullName += f',{value}_{channel}_{gain};' if 'Profile' in type else ';' - fullName += f'{moduleName}_ch_{channelName}_{gainName[:2]}_{nameSuffix}' - fullTitle = f'Run {run} {moduleName} Channel {channelName} {gainName} gain: {title}' - - xbinsInGain = xbins[gain] if builtins.type(xbins) is list else xbins - xminInGain = xmin[gain] if builtins.type(xmin) is list else xmin - xmaxInGain = xmax[gain] if builtins.type(xmax) is list else xmax - - ybinsInGain = ybins[gain] if builtins.type(ybins) is list else ybins - yminInGain = ymin[gain] if builtins.type(ymin) is list else ymin - ymaxInGain = ymax[gain] if builtins.type(ymax) is list else ymax - - tool.defineHistogram(fullName, title = fullTitle, path = fullPath, type = type, - xbins = xbinsInGain, xmin = xminInGain, xmax = xmaxInGain, - ybins = ybinsInGain, ymin = yminInGain, ymax = ymaxInGain) - + from TileMonitoring.TileMonitoringCfgHelper import addTileChannelHistogramsArray if kwargs['fillHistogramsForDSP']: # Configure histograms with Tile DSP raw channel amplitude per module, channel and gain diff --git a/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.cxx new file mode 100644 index 0000000000000000000000000000000000000000..784c531915c4fe370a05c358e409291015cc7586 --- /dev/null +++ b/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.cxx @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TileCalibMonitorAlgorithm.h" +#include "TileIdentifier/TileHWID.h" +#include "TileConditions/TileInfo.h" + +StatusCode TileCalibMonitorAlgorithm::initialize() { + + ATH_CHECK( AthMonitorAlgorithm::initialize() ); + + ATH_CHECK( m_dqStatusKey.initialize() ); + ATH_CHECK( detStore()->retrieve(m_tileHWID) ); + ATH_CHECK( detStore()->retrieve(m_tileInfo, m_tileInfoName) ); + + ATH_CHECK( m_cablingSvc.retrieve() ); + m_cabling = m_cablingSvc->cablingService(); + int runPeriod = m_cabling->runPeriod(); + + if (runPeriod == 3) { + std::vector v = { 0x10d }; // LBA14 is demonstrator in RUN3 + + if ( m_fragIDsToIgnoreDMUerrors.size() == 0) { + m_fragIDsToIgnoreDMUerrors = v; + } + + if ( m_fragIDsDemonstrators.size() == 0) { + m_fragIDsDemonstrators = v; + } + } + + if ( m_fragIDsToIgnoreDMUerrors.size() != 0) { + + std::sort(m_fragIDsToIgnoreDMUerrors.begin(), m_fragIDsToIgnoreDMUerrors.end()); + + std::ostringstream os; + for (int fragID : m_fragIDsToIgnoreDMUerrors) { + os << " 0x" << std::hex << fragID << std::dec; + } + + ATH_MSG_INFO("Tile DMU errors will be ignored in drawers (frag IDs):" << os.str()); + } + + if ( m_fragIDsDemonstrators.size() != 0) { + + std::sort(m_fragIDsDemonstrators.begin(), m_fragIDsDemonstrators.end()); + + std::ostringstream os; + for (int fragID : m_fragIDsDemonstrators) { + os << " 0x" << std::hex << fragID << std::dec; + } + + ATH_MSG_INFO("Special settings in histograms for demonstrator modules (frag IDs):" << os.str()); + } + + return StatusCode::SUCCESS; +} diff --git a/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..d149ca456d67f6c7688646699b22783ef57b62e8 --- /dev/null +++ b/TileCalorimeter/TileMonitoring/src/TileCalibMonitorAlgorithm.h @@ -0,0 +1,102 @@ +/* + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TILEMONITORING_TILECALIBMONITORALGORITHM_H +#define TILEMONITORING_TILECALIBMONITORALGORITHM_H + +#include "TileEvent/TileDQstatus.h" +#include "TileConditions/TileCablingSvc.h" + +#include "AthenaMonitoring/AthMonitorAlgorithm.h" +#include "StoreGate/ReadHandleKey.h" + +class TileHWID; +class TileInfo; + +/** @class TileCalibMonitorAlgorithm + * @brief Base class for Tile calibration runs monitoring + */ + +class TileCalibMonitorAlgorithm : public AthMonitorAlgorithm { + + public: + + TileCalibMonitorAlgorithm(const std::string& name, ISvcLocator* svcLocator) + :AthMonitorAlgorithm(name, svcLocator) {} + + using AthMonitorAlgorithm::AthMonitorAlgorithm; + virtual ~TileCalibMonitorAlgorithm() = default; + virtual StatusCode initialize() override; + virtual StatusCode fillHistograms(const EventContext& ctx) const override = 0; + + + protected: + + /* + * Function to check that the DMU header format is correct + * bit_31 of the DMU header must be 1 and + * bit_17 of the DMU header must be 0 + * Return true in case of error + */ + bool isHeaderFormatError(uint32_t header) const { + return (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0)) ? false : true; + }; + + /* + * Function to check that the DMU header parity is correct + * Parity of the DMU header should be odd + * Return true in case of error + */ + bool isHeaderParityError(uint32_t header) const { + uint32_t parity(0); + for (int i = 0; i < 32; ++i) { + parity += ((header >> i) & 0x1); + } + return ((parity % 2) == 1) ? false : true; + }; + + + /** + * @enum RunType + * @brief Describes Tile Run Type + */ + enum RunType { + UNKNOWN_RUN = 0, // expect monogain + PHYS_RUN = 1, // expect monogain + LAS_RUN = 2, // expect monogain + LED_RUN = 3, // expect monogain + PED_RUN = 4, // expect bigain + CIS_RUN = 8, // expect bigain + MONO_RUN = 9, // expect monogain + CIS_RAMP_RUN = 10 // expect monogain + }; + + Gaudi::Property m_tileInfoName{this, + "TileInfo", "TileInfo", "Name of TileInfo object in Detector Store"}; + + Gaudi::Property> m_fragIDsToIgnoreDMUerrors{this, + "FragIDsToIgnoreDMUErrors", {}, "List of Tile frag IDs for which ignore DMU errors"}; + + Gaudi::Property> m_fragIDsDemonstrators{this, + "FragIDsDemonstrators", {}, "List of Tile frag IDs of Demonstrators"}; + + Gaudi::Property m_runType{this, + "RunType", 0, "Run type: 1 - phys, 2 - las, 4 - ped, 8 - cis, 9- mono"}; + + SG::ReadHandleKey m_dqStatusKey{this, + "TileDQstatus", "TileDQstatus", "Tile DQ status name"}; + + /** + * @brief Name of Tile cabling service + */ + ServiceHandle m_cablingSvc{ this, + "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"}; + + const TileCablingService* m_cabling{nullptr}; + const TileHWID* m_tileHWID{nullptr}; + const TileInfo* m_tileInfo{nullptr}; +}; + + +#endif // TILEMONITORING_TILECALIBMONITORALGORITHM_H diff --git a/TileCalorimeter/TileMonitoring/src/TileDigitsMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileDigitsMonitorAlgorithm.cxx index 33a21f744fc2759605563c1231044d16d16081e5..6a3d092e5f776c7a4ba4595669303fe2f379d041 100644 --- a/TileCalorimeter/TileMonitoring/src/TileDigitsMonitorAlgorithm.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileDigitsMonitorAlgorithm.cxx @@ -1,9 +1,8 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "TileDigitsMonitorAlgorithm.h" -#include "TileIdentifier/TileHWID.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileInfo.h" @@ -15,18 +14,12 @@ StatusCode TileDigitsMonitorAlgorithm::initialize() { ATH_MSG_DEBUG("in initialize()"); // initialize superclass - ATH_CHECK( AthMonitorAlgorithm::initialize() ); - - std::sort(m_fragIDsToIgnoreDMUerrors.begin(), m_fragIDsToIgnoreDMUerrors.end()); - - ATH_CHECK( detStore()->retrieve(m_tileHWID) ); + ATH_CHECK( TileCalibMonitorAlgorithm::initialize() ); ATH_CHECK( m_digitsContainerKey.initialize() ); ATH_CHECK( m_rawChannelContainerKey.initialize(SG::AllowEmpty) ); - ATH_CHECK( m_dqStatusKey.initialize() ); ATH_CHECK( m_tileCondToolNoiseSample.retrieve(EnableTool(m_fillPedestalDifference)) ); - ATH_CHECK( detStore()->retrieve(m_tileInfo, m_tileInfoName) ); m_ADCmaxMinusEpsilon = m_tileInfo->ADCmax() - 0.01; if (m_tileInfo->ADCmax() == 4095) { m_is12bit = true; @@ -492,11 +485,11 @@ bool TileDigitsMonitorAlgorithm::checkCorruptedData(const std::vector>>& headerWordsAll, @@ -56,32 +42,6 @@ class TileDigitsMonitorAlgorithm : public AthMonitorAlgorithm { void checkBCID(const std::vector>>& headerWordsAll, uint32_t rodBCID, int ros, int drawer) const; - /* - * Function to check that the DMU header format is correct - * bit_31 of the DMU header must be 1 and - * bit_17 of the DMU header must be 0 - * Return true in case of error - */ - bool checkHeaderFormatError(uint32_t header) const { - return (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0)) ? false : true; - }; - - /* - * Function to check that the DMU header parity is correct - * Parity of the DMU header should be odd - * Return true in case of error - */ - bool checkHeaderParityError(uint32_t header) const { - uint32_t parity(0); - for (int i = 0; i < 32; ++i) { - parity += ((header >> i) & 0x1); - } - return ((parity % 2) == 1) ? false : true; - }; - - Gaudi::Property m_tileInfoName{this, - "TileInfo", "TileInfo", "Name of TileInfo object in Detector Store"}; - Gaudi::Property m_fillPedestalDifference{this, "fillPedestalDifference", true, "Fill pedestal difference between monitored pedestal and one from DB"}; @@ -106,15 +66,6 @@ class TileDigitsMonitorAlgorithm : public AthMonitorAlgorithm { Gaudi::Property m_fillCorrelationsHistograms{this, "fillCorrelationsHistograms", true, "Fill histograms which are used to produce correlation and corvariance plots"}; - Gaudi::Property> m_fragIDsToIgnoreDMUerrors{this, - "FragIDsToIgnoreDMUErrors", {}, "List of Tile frag IDs for which ignore DMU errors"}; - - Gaudi::Property m_runType{this, - "RunType", 0, "Run type: 1 - phys, 2 - las, 4 - ped, 8 - cis, 9- mono"}; - - SG::ReadHandleKey m_dqStatusKey{this, - "TileDQstatus", "TileDQstatus", "Tile DQ status name"}; - SG::ReadHandleKey m_digitsContainerKey{this, "TileDigitsContainer", "TileDigitsCnt", "Input Tile digits container key"}; @@ -124,8 +75,6 @@ class TileDigitsMonitorAlgorithm : public AthMonitorAlgorithm { ToolHandle m_tileCondToolNoiseSample{this, "TileCondToolNoiseSample", "TileCondToolNoiseSample", "Tile sample noise tool"}; - const TileHWID* m_tileHWID{nullptr}; - std::vector m_meanSampleGroups; std::vector m_meanSampleProdGroups; std::vector> m_crcGlobalGroups; @@ -142,9 +91,6 @@ class TileDigitsMonitorAlgorithm : public AthMonitorAlgorithm { static const int MAX_DMU{16}; bool m_is12bit{false}; - - // TileInfo - const TileInfo* m_tileInfo{nullptr}; float m_ADCmaxMinusEpsilon; }; diff --git a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.cxx index ae0b12970743943a92a9bbdcad4edf15c0bcbfa9..1887326d43506a3533961c7e2f4aa015667e6ff3 100644 --- a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.cxx @@ -3,7 +3,6 @@ */ #include "TileRawChannelMonitorAlgorithm.h" -#include "TileIdentifier/TileHWID.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileInfo.h" @@ -15,22 +14,13 @@ StatusCode TileRawChannelMonitorAlgorithm::initialize() { ATH_MSG_DEBUG("in initialize()"); // initialize superclass - ATH_CHECK( AthMonitorAlgorithm::initialize() ); - - ATH_CHECK( m_cablingSvc.retrieve() ); - m_cabling = m_cablingSvc->cablingService(); - - std::sort(m_fragIDsToIgnoreDMUerrors.begin(), m_fragIDsToIgnoreDMUerrors.end()); - - ATH_CHECK( detStore()->retrieve(m_tileHWID) ); + ATH_CHECK( TileCalibMonitorAlgorithm::initialize() ); ATH_CHECK( m_digitsContainerKey.initialize() ); ATH_CHECK( m_rawChannelContainerKey.initialize(SG::AllowEmpty) ); ATH_CHECK( m_dspRawChannelContainerKey.initialize(m_fillHistogramsForDSP) ); ATH_CHECK( m_emScaleKey.initialize() ); - ATH_CHECK( m_dqStatusKey.initialize() ); - ATH_CHECK( detStore()->retrieve(m_tileInfo, m_tileInfoName) ); m_dac2Charge[0] = 100.* 2.0 * 4.096 / m_tileInfo->ADCmax(); // 100 pF * 2 for legacy or 200 pF for demonstrator m_dac2Charge[1] = 5.2 * 2.0 * 4.096 / m_tileInfo->ADCmax(); // use the same number 5.2 pF as in TileCisDefaultCalibTool diff --git a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.h index 1f9b688736b0b6e23f069ddf6ec8c303cb4232e3..f6a8143a20d591512ffcb74ea311421236095016 100644 --- a/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.h +++ b/TileCalorimeter/TileMonitoring/src/TileRawChannelMonitorAlgorithm.h @@ -5,84 +5,33 @@ #ifndef TILEMONITORING_TILERAWCHANNELMONITORALGORITHM_H #define TILEMONITORING_TILERAWCHANNELMONITORALGORITHM_H -#include "TileEvent/TileDQstatus.h" +#include "TileCalibMonitorAlgorithm.h" #include "TileEvent/TileDigitsContainer.h" #include "TileEvent/TileRawChannelContainer.h" -#include "TileConditions/TileCablingSvc.h" #include "TileConditions/TileEMScale.h" #include "TileIdentifier/TileRawChannelUnit.h" -#include "AthenaMonitoring/AthMonitorAlgorithm.h" #include "AthenaMonitoringKernel/Monitored.h" #include "StoreGate/ReadHandleKey.h" #include "StoreGate/ReadCondHandleKey.h" -class TileHWID; -class TileInfo; - /** @class TileRawChannelMonitorAlgorithm * @brief Class for Tile raw channel based monitoring */ -class TileRawChannelMonitorAlgorithm : public AthMonitorAlgorithm { +class TileRawChannelMonitorAlgorithm : public TileCalibMonitorAlgorithm { public: - using AthMonitorAlgorithm::AthMonitorAlgorithm; + using TileCalibMonitorAlgorithm::TileCalibMonitorAlgorithm; virtual ~TileRawChannelMonitorAlgorithm() = default; virtual StatusCode initialize() override; virtual StatusCode fillHistograms(const EventContext& ctx) const override; private: - enum RunType { - UNKNOWN_RUN = 0, // expect monogain - PHYS_RUN = 1, // expect monogain - LAS_RUN = 2, // expect monogain - LED_RUN = 3, // expect monogain - PED_RUN = 4, // expect bigain - CIS_RUN = 8, // expect bigain - MONO_RUN = 9, // expect monogain - CIS_RAMP_RUN = 10 // expect monogain - }; - bool isDmuHeaderError(uint32_t header) const; - /* - * Function to check that the DMU header format is correct - * bit_31 of the DMU header must be 1 and - * bit_17 of the DMU header must be 0 - * Return true in case of error - */ - bool isHeaderFormatError(uint32_t header) const { - return (((header >> 31 & 0x1) == 1) && ((header >> 17 & 0x1) == 0)) ? false : true; - }; - - /* - * Function to check that the DMU header parity is correct - * Parity of the DMU header should be odd - * Return true in case of error - */ - bool isHeaderParityError(uint32_t header) const { - uint32_t parity(0); - for (int i = 0; i < 32; ++i) { - parity += ((header >> i) & 0x1); - } - return ((parity % 2) == 1) ? false : true; - }; - - Gaudi::Property m_tileInfoName{this, - "TileInfo", "TileInfo", "Name of TileInfo object in Detector Store"}; - - Gaudi::Property> m_fragIDsToIgnoreDMUerrors{this, - "FragIDsToIgnoreDMUErrors", {}, "List of Tile frag IDs for which ignore DMU errors"}; - - Gaudi::Property> m_fragIDsDemonstrators{this, - "FragIDsDemonstrators", {}, "List of Tile frag IDs of Demonstrators"}; - - Gaudi::Property m_runType{this, - "RunType", 0, "Run type: 1 - phys, 2 - las, 4 - ped, 8 - cis, 9- mono"}; - Gaudi::Property m_minAmpForCorrectedTime{this, "MinAmpForCorrectedTime", 0.5, "Minimum amplitude to use channel for time correction calculation"}; @@ -98,9 +47,6 @@ class TileRawChannelMonitorAlgorithm : public AthMonitorAlgorithm { Gaudi::Property m_fill2DHistograms{this, "fill2DHistograms", true, "Create and fill 2D histograms"}; - SG::ReadHandleKey m_dqStatusKey{this, - "TileDQstatus", "TileDQstatus", "Tile DQ status name"}; - SG::ReadHandleKey m_digitsContainerKey{this, "TileDigitsContainer", "TileDigitsCnt", "Input Tile digits container key"}; @@ -116,15 +62,6 @@ class TileRawChannelMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadCondHandleKey m_emScaleKey{this, "TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"}; - /** - * @brief Name of Tile cabling service - */ - ServiceHandle m_cablingSvc{ this, - "TileCablingSvc", "TileCablingSvc", "The Tile cabling service"}; - - const TileHWID* m_tileHWID{nullptr}; - const TileCablingService* m_cabling{nullptr}; - std::vector> m_ampGroups; std::vector> m_timeGroups; std::vector> m_timeCorrGroups; @@ -152,8 +89,6 @@ class TileRawChannelMonitorAlgorithm : public AthMonitorAlgorithm { static const int MAX_DMU{16}; TileRawChannelUnit::UNIT m_finalRawChannelUnit{TileRawChannelUnit::Invalid}; - // TileInfo - const TileInfo* m_tileInfo{nullptr}; double m_dac2Charge[2] = {}; bool m_runTypeIsNotCIS{true}; };