From 5d5f00803c8755f10f14c31db617028dde845abf Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 22 Sep 2026 10:33:40 +0000 Subject: [PATCH] Please consider the following formatting changes --- .../ALICE3/IOTOF/macros/CheckClustersIOTOF.C | 10 +++---- .../ALICE3/IOTOF/macros/CheckDigitsIOTOF.C | 8 +++--- .../IOTOF/macros/CheckTopologiesIOTOF.C | 27 +++++++++++-------- .../include/IOTOFReconstruction/Clusterer.h | 2 +- .../IOTOFReconstruction/TopologyClassifier.h | 22 ++++++++------- .../IOTOF/reconstruction/src/Clusterer.cxx | 20 +++++++------- .../ALICE3/IOTOF/simulation/src/Digitizer.cxx | 1 - 7 files changed, 48 insertions(+), 42 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C index d60a5efe7fcc0..c593d98768b49 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C +++ b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C @@ -70,11 +70,11 @@ void addTLines(float pitchRow, float pitchCol) while (xRow > xmin) { TLine* lineNeg = new TLine(xRow, ymin, xRow, ymax); lineNeg->SetLineStyle(2); - lineNeg->SetLineColor(kGray+3); + lineNeg->SetLineColor(kGray + 3); lineNeg->Draw("same"); TLine* linePos = new TLine(std::abs(xRow), ymin, std::abs(xRow), ymax); linePos->SetLineStyle(2); - linePos->SetLineColor(kGray+3); + linePos->SetLineColor(kGray + 3); linePos->Draw("same"); xRow -= pitchRow / 2; } @@ -83,11 +83,11 @@ void addTLines(float pitchRow, float pitchCol) while (yCol > ymin) { TLine* lineNeg = new TLine(xmin, yCol, xmax, yCol); lineNeg->SetLineStyle(2); - lineNeg->SetLineColor(kGray+3); + lineNeg->SetLineColor(kGray + 3); lineNeg->Draw("same"); TLine* linePos = new TLine(xmin, std::abs(yCol), xmax, std::abs(yCol)); linePos->SetLineStyle(2); - linePos->SetLineColor(kGray+3); + linePos->SetLineColor(kGray + 3); linePos->Draw("same"); yCol -= pitchCol / 2; } @@ -260,7 +260,7 @@ void CheckClustersIOTOF(std::string clusfile = "tf3clusters.root", closestHitIdx = 0; } else { float maxDist = std::numeric_limits::max(); - for (int iHitIdx=0; iHitIdx < hitEntry->second.size(); iHitIdx++) { + for (int iHitIdx = 0; iHitIdx < hitEntry->second.size(); iHitIdx++) { const o2::itsmft::Hit* hit = &((*hitArray)[hitEntry->second[iHitIdx]]); if (!hit) { LOG(error) << "Failed to find matching hit for Track: " << trID << ", chipID: " << chipID << ", eventID: " << evID; diff --git a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C index f7931628a46f5..f2631fc826292 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C +++ b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckDigitsIOTOF.C @@ -59,11 +59,11 @@ void addTLines(float pitchRow, float pitchCol) while (xRow > xmin) { TLine* lineNeg = new TLine(xRow, ymin, xRow, ymax); lineNeg->SetLineStyle(2); - lineNeg->SetLineColor(kGray+3); + lineNeg->SetLineColor(kGray + 3); lineNeg->Draw("same"); TLine* linePos = new TLine(std::abs(xRow), ymin, std::abs(xRow), ymax); linePos->SetLineStyle(2); - linePos->SetLineColor(kGray+3); + linePos->SetLineColor(kGray + 3); linePos->Draw("same"); xRow -= pitchRow / 2; } @@ -72,11 +72,11 @@ void addTLines(float pitchRow, float pitchCol) while (yCol > ymin) { TLine* lineNeg = new TLine(xmin, yCol, xmax, yCol); lineNeg->SetLineStyle(2); - lineNeg->SetLineColor(kGray+3); + lineNeg->SetLineColor(kGray + 3); lineNeg->Draw("same"); TLine* linePos = new TLine(xmin, std::abs(yCol), xmax, std::abs(yCol)); linePos->SetLineStyle(2); - linePos->SetLineColor(kGray+3); + linePos->SetLineColor(kGray + 3); linePos->Draw("same"); yCol -= pitchCol / 2; } diff --git a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckTopologiesIOTOF.C b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckTopologiesIOTOF.C index 71d5a706ed722..7dfc0091c4ca4 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckTopologiesIOTOF.C +++ b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckTopologiesIOTOF.C @@ -54,11 +54,16 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root" int nPixelsB = b.second.mNPixels; int frequencyA = a.second.mFrequency; int frequencyB = b.second.mFrequency; - if (topoA != topoB) return topoA < topoB; - if (frequencyA != frequencyB) return frequencyA > frequencyB; - if (spanRowA != spanRowB) return spanRowA < spanRowB; - if (spanColA != spanColB) return spanColA < spanColB; - if (nPixelsA != nPixelsB) return nPixelsA < nPixelsB; + if (topoA != topoB) + return topoA < topoB; + if (frequencyA != frequencyB) + return frequencyA > frequencyB; + if (spanRowA != spanRowB) + return spanRowA < spanRowB; + if (spanColA != spanColB) + return spanColA < spanColB; + if (nPixelsA != nPixelsB) + return nPixelsA < nPixelsB; return a.first < b.first; // Finally sort by bitmask if spans are equal }); @@ -81,9 +86,9 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root" // Topology names const std::array topologyNames = { - "kSingleDigit", "kLineOnRow", "kLineOnCol", "kSquare", "kRectangle", "kDiagonal", - "kLowerTriangleLeft", "kLowerTriangleRight", "kUpperTriangleLeft", "kUpperTriangleRight", - "kSnake", "kSnakeRefl", "kSnakeRot90", "kSnakeRot90Refl", "kHuge", "kOther"}; + "kSingleDigit", "kLineOnRow", "kLineOnCol", "kSquare", "kRectangle", "kDiagonal", + "kLowerTriangleLeft", "kLowerTriangleRight", "kUpperTriangleLeft", "kUpperTriangleRight", + "kSnake", "kSnakeRefl", "kSnakeRot90", "kSnakeRot90Refl", "kHuge", "kOther"}; // Create output ROOT file auto* outFile = TFile::Open(outFileName, "RECREATE"); @@ -113,7 +118,7 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root" float maxRowCoord = chipInfo.PitchRow * (spanRow + 0.5); float minColCoord = -1.5 * chipInfo.PitchCol; float maxColCoord = chipInfo.PitchCol * (spanCol + 0.5); - TH2F* hTopoDisplay = new TH2F(Form("spanRow_%i_spanCol_%i_key_%i_all", spanRow, spanCol, topoKey), Form("Cluster Topology %s;Row;Column", topoName.c_str()), + TH2F* hTopoDisplay = new TH2F(Form("spanRow_%i_spanCol_%i_key_%i_all", spanRow, spanCol, topoKey), Form("Cluster Topology %s;Row;Column", topoName.c_str()), spanRow + 2, minRowCoord, maxRowCoord, spanCol + 2, minColCoord, maxColCoord); // One-point TGraph for COG @@ -125,12 +130,12 @@ void CheckTopologiesIOTOF(const char* topoFileName = "TF3ClusterTopologies.root" gTopoCOG->SetMarkerStyle(20); gTopoCOG->SetMarkerColor(kBlue); - // Loop over the bits of bitmask and fill the histogram + // Loop over the bits of bitmask and fill the histogram for (int row = 0; row < spanRow; ++row) { for (int col = 0; col < spanCol; ++col) { int bitIndex = row * spanCol + col; if (bitmask & (1 << bitIndex)) { - hTopoDisplay->SetBinContent(row+2, col+2, frequency); + hTopoDisplay->SetBinContent(row + 2, col + 2, frequency); } } } diff --git a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/Clusterer.h b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/Clusterer.h index 1ef6e8d832678..9409339a02623 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/Clusterer.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/Clusterer.h @@ -70,7 +70,7 @@ class Clusterer const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr); void findClustersMultipleHits(gsl::span digits, gsl::span digitIdxs, const ConstDigitTruth* labelsDigPtr, ClusterTruth* labelsClusPtr); - std::vector> buildPreclusters(gsl::span digits, + std::vector> buildPreclusters(gsl::span digits, gsl::span digitIdxs, int maxTimeDiffNSigma, float timeResolution); diff --git a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h index 772ab0b5d3346..2e629d9a98d50 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h +++ b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h @@ -95,10 +95,12 @@ class TopologyClassifier static constexpr uint8_t MaxColSpan = 255; static constexpr uint16_t MaxBitmask = 65535; - TopologyClassifier() { + TopologyClassifier() + { sSegmentation = o2::iotof::Segmentation::Instance(); } - TopologyClassifier(std::unordered_map map) : mTopologyCache(std::move(map)) { + TopologyClassifier(std::unordered_map map) : mTopologyCache(std::move(map)) + { sSegmentation = o2::iotof::Segmentation::Instance(); } @@ -113,16 +115,17 @@ class TopologyClassifier void saveCacheToFile(const char* filename); void print(); - float getErrX(uint32_t pattID) {return std::sqrt(getTopologyFeatures(pattID).mXSigma2);}; - float getErrZ(uint32_t pattID) {return std::sqrt(getTopologyFeatures(pattID).mZSigma2);}; - float getNPixels(uint32_t pattID) {return getTopologyFeatures(pattID).mNPixels;}; - float getMeanX(uint32_t pattID) {return getTopologyFeatures(pattID).mXMean;}; - float getMeanZ(uint32_t pattID) {return getTopologyFeatures(pattID).mZMean;}; + float getErrX(uint32_t pattID) { return std::sqrt(getTopologyFeatures(pattID).mXSigma2); }; + float getErrZ(uint32_t pattID) { return std::sqrt(getTopologyFeatures(pattID).mZSigma2); }; + float getNPixels(uint32_t pattID) { return getTopologyFeatures(pattID).mNPixels; }; + float getMeanX(uint32_t pattID) { return getTopologyFeatures(pattID).mXMean; }; + float getMeanZ(uint32_t pattID) { return getTopologyFeatures(pattID).mZMean; }; // Provide the common iotof::GeometryTGeo to access matrices and segmentation void setGeometry(const o2::iotof::GeometryTGeo* gm) { mGeometry = gm; } - static uint32_t makeKey(uint8_t spanRow, uint8_t spanCol, uint16_t bitmask) { + static uint32_t makeKey(uint8_t spanRow, uint8_t spanCol, uint16_t bitmask) + { return (static_cast(spanRow) << 24) | (static_cast(spanCol) << 16) | static_cast(bitmask); @@ -139,8 +142,7 @@ class TopologyClassifier std::unordered_map mTopologyCache; const o2::iotof::GeometryTGeo* mGeometry = nullptr; ///< IOTOF geometry - static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton) - + static o2::iotof::Segmentation* sSegmentation; ///< IOTOF segmentation instance (singleton) }; } // namespace iotof diff --git a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx index c1e6fd451eb43..06e240bbbec27 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx @@ -127,22 +127,22 @@ void Clusterer::ClustererThread::processChip(gsl::span digits, } findClustersMultipleHits( - digits, - gsl::span(digitIdxs), - labelsDigPtr, - labelsClusPtr); + digits, + gsl::span(digitIdxs), + labelsDigPtr, + labelsClusPtr); } // Flush per-thread output into the caller's containers - // Push-back cluster labels, dummy labels for clusters with + // Push-back cluster labels, dummy labels for clusters with // empty labels, to ensure that the clusterLabels container - // WWhas the same size as the clustersOut container. + // WWhas the same size as the clustersOut container. if (labelsClusPtr) { - const size_t base = clustersOut->size(); // before inserting this chip's clusters + const size_t base = clustersOut->size(); // before inserting this chip's clusters // and store labels as you go, or copy from mLabels: for (size_t i = 0; i < mClusters.size(); ++i) { - auto labels = mLabels.getLabels(i); // empty span if none + auto labels = mLabels.getLabels(i); // empty span if none if (labels.empty()) { labelsClusPtr->addNoLabelIndex(base + i); } else { @@ -210,8 +210,8 @@ std::vector> Clusterer::ClustererThread::buildPreclusters( auto areNeighbours = [&](const Digit& a, const Digit& b) { return std::abs(static_cast(a.getRow()) - static_cast(b.getRow())) <= 1 && - std::abs(static_cast(a.getColumn()) - static_cast(b.getColumn())) <= 1 && - std::abs(a.getTime() - b.getTime()) <= maxTimeDiffNSigma * timeResolution; + std::abs(static_cast(a.getColumn()) - static_cast(b.getColumn())) <= 1 && + std::abs(a.getTime() - b.getTime()) <= maxTimeDiffNSigma * timeResolution; }; for (size_t i = 0; i < digitIdxs.size(); ++i) { diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index 5fe025e02e7c9..559a36c3c3467 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx @@ -25,7 +25,6 @@ #include #include - #include #include #include