Skip to content

Commit 7ebbd9f

Browse files
musinskyknopers8
authored andcommitted
[CTP] use list of specific inputs instead of list of first inputs
1 parent 13d7f36 commit 7ebbd9f

2 files changed

Lines changed: 33 additions & 24 deletions

File tree

Modules/CTP/include/CTP/RawDataQcTask.h

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// \author Marek Bombara
1515
/// \author Lucia Anna Tarasovicova
1616
/// \author Jan Musinsky
17-
/// \date 2026-02-17
17+
/// \date 2026-03-31
1818
///
1919

2020
#ifndef QC_MODULE_CTP_CTPRAWDATAQCTASK_H
@@ -53,19 +53,18 @@ class CTPRawDataReaderTask final : public TaskInterface
5353
void readLHCFillingScheme();
5454

5555
private:
56-
o2::ctp::RawDataDecoder mDecoder; // ctp raw data decoder
57-
std::unique_ptr<TH1DRatio> mHistoInputs = nullptr; // histogram with ctp inputs
58-
std::unique_ptr<TH1DRatio> mHistoClasses = nullptr; // histogram with ctp classes
59-
std::unique_ptr<TH1DRatio> mHistoInputRatios = nullptr; // histogram with ctp input ratios to MB
60-
std::unique_ptr<TH1DRatio> mHistoClassRatios = nullptr; // histogram with ctp class ratios to MB
61-
std::unique_ptr<TH1D> mHistoBCMinBias1 = nullptr; // histogram of BC positions to check LHC filling scheme
62-
std::unique_ptr<TH1D> mHistoBCMinBias2 = nullptr; // histogram of BC positions to check LHC filling scheme
63-
std::unique_ptr<TH1D> mHistoDecodeError = nullptr; // histogram of erros from decoder
64-
static constexpr int mUsedInputsMax = 18;
65-
std::array<TH1D*, mUsedInputsMax> mHisInputs = {}; ///< Array of input histograms, all BCs
66-
std::array<TH1D*, mUsedInputsMax> mHisInputsYesLHC = {}; ///< Array of input histograms, LHC BCs
67-
std::array<TH1D*, mUsedInputsMax> mHisInputsNotLHC = {}; ///< Array of input histograms, not LHC BCs
68-
std::array<std::size_t, mUsedInputsMax> shiftBC = {}; ///< Array of shifts for the BCs for each input
56+
o2::ctp::RawDataDecoder mDecoder; // ctp raw data decoder
57+
std::unique_ptr<TH1DRatio> mHistoInputs = nullptr; // histogram with ctp inputs
58+
std::unique_ptr<TH1DRatio> mHistoClasses = nullptr; // histogram with ctp classes
59+
std::unique_ptr<TH1DRatio> mHistoInputRatios = nullptr; // histogram with ctp input ratios to MB
60+
std::unique_ptr<TH1DRatio> mHistoClassRatios = nullptr; // histogram with ctp class ratios to MB
61+
std::unique_ptr<TH1D> mHistoBCMinBias1 = nullptr; // histogram of BC positions to check LHC filling scheme
62+
std::unique_ptr<TH1D> mHistoBCMinBias2 = nullptr; // histogram of BC positions to check LHC filling scheme
63+
std::unique_ptr<TH1D> mHistoDecodeError = nullptr; // histogram of erros from decoder
64+
std::array<TH1D*, o2::ctp::CTP_NINPUTS> mHisInputs = {}; ///< Array of input histograms, all BCs
65+
std::array<TH1D*, o2::ctp::CTP_NINPUTS> mHisInputsYesLHC = {}; ///< Array of input histograms, LHC BCs
66+
std::array<TH1D*, o2::ctp::CTP_NINPUTS> mHisInputsNotLHC = {}; ///< Array of input histograms, not LHC BCs
67+
std::array<std::size_t, o2::ctp::CTP_NINPUTS> shiftBC = {}; ///< Array of shifts for the BCs for each input
6968
int mRunNumber;
7069
int indexMB1 = -1;
7170
int indexMB2 = -1;

Modules/CTP/src/RawDataQcTask.cxx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// \author Marek Bombara
1515
/// \author Lucia Anna Tarasovicova
1616
/// \author Jan Musinsky
17-
/// \date 2026-02-17
17+
/// \date 2026-03-31
1818
///
1919

2020
#include <TCanvas.h>
@@ -71,11 +71,19 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
7171
getObjectsManager()->startPublishing(mHistoInputRatios.get());
7272
getObjectsManager()->startPublishing(mHistoBCMinBias1.get());
7373
getObjectsManager()->startPublishing(mHistoBCMinBias2.get());
74-
std::string sTmp1, sTmp2;
74+
75+
std::string inputName, sTmp1, sTmp2;
76+
std::vector<std::string> publishingInputs = {
77+
"MT0A", "MT0C", "MTVX", "MTSC", "MTCE", // 5x FT0
78+
"MVBA", "MVOR", "MVIR", "MVNC", "MVCH", // 5x FV0
79+
"0UCE", "0USC", "0UVX", "0U0C", "0U0A", // 5x FDD
80+
"1ZED", "1ZNC" // 2x ZDC
81+
}; // or std::unordered_set (hash based container) instead of std::vector
7582
for (std::size_t i = 0; i < mHisInputs.size(); i++) {
83+
inputName = o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(i + 1);
84+
// index mismatch, getInputNameFromIndex in range [1-48]
7685
sTmp1 = std::format("input{:02}", i);
77-
sTmp2 = std::format("input[{:02}] {}", i, o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(i + 1));
78-
// getInputNameFromIndex in range [1-48]
86+
sTmp2 = std::format("input[{:02}] {}", i, inputName);
7987
mHisInputs[i] = new TH1D(sTmp1.c_str(), sTmp2.c_str(), norbits, 0, norbits);
8088

8189
sTmp1 = std::format("input{:02}_yesLHC", i);
@@ -88,9 +96,11 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
8896
mHisInputsNotLHC[i]->SetLineColor(kRed + 1);
8997
mHisInputsNotLHC[i]->SetFillColor(kRed + 1);
9098

91-
getObjectsManager()->startPublishing(mHisInputs[i]);
92-
getObjectsManager()->startPublishing(mHisInputsYesLHC[i]);
93-
// getObjectsManager()->startPublishing(mHisInputsNotLHC[i]);
99+
if (std::find(publishingInputs.begin(), publishingInputs.end(), inputName) != publishingInputs.end()) {
100+
getObjectsManager()->startPublishing(mHisInputs[i]);
101+
getObjectsManager()->startPublishing(mHisInputsYesLHC[i]);
102+
// getObjectsManager()->startPublishing(mHisInputsNotLHC[i]);
103+
}
94104
}
95105

96106
mDecoder.setDoLumi(1);
@@ -342,7 +352,7 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
342352
for (auto const digit : outputDigits) {
343353
uint16_t bcid = digit.intRecord.bc;
344354
if (digit.CTPInputMask.count()) {
345-
for (int i = 0; i < mUsedInputsMax; i++) {
355+
for (int i = 0; i < o2::ctp::CTP_NINPUTS; i++) {
346356
if (digit.CTPInputMask[i]) {
347357
mHistoInputs->getNum()->Fill(i);
348358
mHistoInputRatios->getNum()->Fill(i);
@@ -355,8 +365,8 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
355365
int bc = bcid - mShiftInput2 >= 0 ? bcid - mShiftInput2 : bcid - mShiftInput2 + 3564;
356366
mHistoBCMinBias2->Fill(bc, 1. / mScaleInput2);
357367
}
358-
// int bc = (bcid - shiftBC[i]) >= 0 ? bcid - shiftBC[i] : bcid - shiftBC[i] + o2::constants::lhc::LHCMaxBunches;
359-
int bc = bcid - shiftBC[i];
368+
int bc = (bcid - shiftBC[i]) >= 0 ? bcid - shiftBC[i] : bcid - shiftBC[i] + o2::constants::lhc::LHCMaxBunches;
369+
// int bc = bcid - shiftBC[i];
360370
mHisInputs[i]->Fill(bc);
361371
}
362372
}

0 commit comments

Comments
 (0)