diff --git a/TileCalorimeter/TileMonitoring/python/TileCellMonitorAlgorithm.py b/TileCalorimeter/TileMonitoring/python/TileCellMonitorAlgorithm.py index 85e6d1f09f4dfe4f294e12c5fcbaa1da5ba2e03f..2df7342756236637caddb4d698e4e948b7e2abe9 100644 --- a/TileCalorimeter/TileMonitoring/python/TileCellMonitorAlgorithm.py +++ b/TileCalorimeter/TileMonitoring/python/TileCellMonitorAlgorithm.py @@ -42,6 +42,7 @@ def TileCellMonitoringConfig(flags, **kwargs): kwargs.setdefault('NegativeEnergyThreshold', -2000.0 * MeV) kwargs.setdefault('EnergyBalanceThreshold', 3) kwargs.setdefault('TimeBalanceThreshold', 25 * ns) + kwargs.setdefault('fillChannelTimeHistograms', True) kwargs.setdefault('fillTimeAndEnergyDiffHistograms', False) if flags.Beam.Type in ('cosmics', 'singlebeam'): @@ -203,6 +204,15 @@ def TileCellMonitoringConfig(flags, **kwargs): subDirectory = False, perPartition = True, perSample = False, perGain = False, opt = 'kAddBinsDynamically') + if kwargs['fillChannelTimeHistograms']: + # Configure histograms with Tile channel time per partition and sample + titleChanTimeSamp = 'Channel Time, E_{ch} > %s MeV;time [ns]' % (kwargs['EnergyThresholdForTime'] / MeV) + addTile1DHistogramsArray(helper, tileCellMonAlg, name = 'TileChannelTime', + xvalue = 'time', title = titleChanTimeSamp, path = 'Tile/Cell', + xbins = 121, xmin = -60.5, xmax = 60.5, type='TH1D', + run = run, triggers = l1Triggers, subDirectory = True, + perPartition = True, perSample = True, perGain = False) + # 20) Configure histograms with energy difference between Tile cells' PMTs per partition and sample addTile1DHistogramsArray(helper, tileCellMonAlg, name = 'TileCellEneDiff', xvalue = 'energyDiff', title = 'Energy difference [MeV] between PMTs;Energy difference [MeV]', diff --git a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx index b56c110f6049acf0158b0ac10d84e320b26dbc99..8b08b2b976ca4755eafdcc68b25e0e29c0c5f640 100644 --- a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.cxx @@ -90,6 +90,11 @@ StatusCode TileCellMonitorAlgorithm::initialize() { m_overThrEtaPhiGroups = buildToolMap<std::vector<int>>(m_tools, "TileCellEtaPhiOvThr", MAX_SAMP, nL1Triggers); + if (m_fillChannelTimeHistograms) { + m_chanTimeSampGroups = buildToolMap<std::vector<std::vector<int>>>(m_tools, "TileChannelTime", + Tile::MAX_ROS - 1, MAX_SAMP, nL1Triggers); + } + m_eneDiffSampGroups = buildToolMap<std::vector<std::vector<int>>>(m_tools, "TileCellEneDiff", Tile::MAX_ROS - 1, MAX_SAMP, nL1Triggers); @@ -212,6 +217,7 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c std::vector<float> overThrOccupEta[MAX_SAMP]; std::vector<float> overThrOccupPhi[MAX_SAMP]; + std::vector<float> sampChanTime[Tile::MAX_ROS - 1][SAMP_ALL]; std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][MAX_SAMP]; std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][MAX_SAMP]; @@ -468,6 +474,9 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c chanTimeDrawer[partition1].push_back(drawer); chanTimeChannel[partition1].push_back(channel1); chanTimeDigitizer[partition1].push_back(getDigitizer(channel1)); + if (m_fillChannelTimeHistograms) { + sampChanTime[partition1][sample].push_back(time1); + } } if (isOkChannel2 && energy2 > m_energyThresholdForTime) { @@ -475,6 +484,9 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c chanTimeDrawer[partition2].push_back(drawer); chanTimeChannel[partition2].push_back(channel2); chanTimeDigitizer[partition2].push_back(getDigitizer(channel2)); + if (m_fillChannelTimeHistograms) { + sampChanTime[partition2][sample].push_back(time2); + } } } @@ -785,6 +797,18 @@ StatusCode TileCellMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c } } + if (m_fillChannelTimeHistograms) { + for (unsigned int sample = 0; sample < SAMP_ALL; ++sample) { + if (!sampChanTime[partition][sample].empty()) { + auto monChanTime = Monitored::Collection("time", sampChanTime[partition][sample]); + for (int l1TriggerIdx : l1TriggersIndices) { + fill(m_tools[m_chanTimeSampGroups[partition][sample][l1TriggerIdx]], monChanTime); + fill(m_tools[m_chanTimeSampGroups[partition][SAMP_ALL][l1TriggerIdx]], monChanTime); + } + } + } + } + if (m_fillTimeAndEnergyDiffHistograms) { for (unsigned int sample = 0; sample < SAMP_ALL; ++sample) { if (!sampEnergyDiff[partition][sample].empty()) { diff --git a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.h b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.h index c7e57a1a727ef43285c7eeccf6861fc449ce4985..a0b6a507c07e3bd192fee8137d04ba2133efbdcb 100644 --- a/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.h +++ b/TileCalorimeter/TileMonitoring/src/TileCellMonitorAlgorithm.h @@ -60,6 +60,9 @@ class TileCellMonitorAlgorithm : public TileMonitorAlgorithm { Gaudi::Property<bool> m_fillTimeHistograms{this, "fillTimeHistograms", false, "Force filling timing histograms"}; + Gaudi::Property<bool> m_fillChannelTimeHistograms{this, + "fillChannelTimeHistograms", true, "Fill histograms with channel time per sample"}; + Gaudi::Property<bool> m_fillTimeAndEnergyDiffHistograms{this, "fillTimeAndEnergyDiffHistograms", true, "Fill histograms with time and energy difference between two PMTs of the same Cell"}; @@ -116,6 +119,7 @@ class TileCellMonitorAlgorithm : public TileMonitorAlgorithm { std::vector<std::vector<int>> m_overThr300GeVOccupGroups; std::vector<std::vector<std::vector<int>>> m_overThrOccupGainGroups; + std::vector<std::vector<std::vector<int>>> m_chanTimeSampGroups; std::vector<std::vector<std::vector<int>>> m_eneDiffSampGroups; std::vector<std::vector<std::vector<int>>> m_timeDiffSampGroups;