diff --git a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C index 01a069b59232e..fe0ac72674d92 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C +++ b/Detectors/Upgrades/ALICE3/IOTOF/macros/CheckClustersIOTOF.C @@ -184,7 +184,6 @@ void CheckClustersIOTOF(std::string clusfile = "tf3clusters.root", const auto& rofRec = rofRecVec[irof]; rofRec.print(); - // >> read and map MC events contributing to this ROF for (int im = 0; im <= nEvts; im++) { if (!hitVecPool[im]) { @@ -219,32 +218,32 @@ void CheckClustersIOTOF(std::string clusfile = "tf3clusters.root", continue; } // std::cout << "CIAO2" << std::endl; - + uint32_t topoKey = TopologyClassifier::makeKey(spanRow, spanCol, pattID); errX = topoClassifier.getErrX(topoKey); errZ = topoClassifier.getErrZ(topoKey); npix = topoClassifier.getNPixels(topoKey); auto chipID = cluster.getSensorID(); // std::cout << "CIAO3" << std::endl; - + // Transformation to the local --> global locC = topoClassifier.getClusterCoordinates(cluster); // std::cout << "CIAO31" << std::endl; auto gloC = gman->getMatrixL2G(chipID) * locC; // std::cout << "CIAO32" << std::endl; - + // Check how many labels are there if (clusLabArr->getLabels(clEntry).empty()) { continue; } const auto& lab = (clusLabArr->getLabels(clEntry))[0]; // std::cout << "CIAO33" << std::endl; - + // std::cout << "CIAO4" << std::endl; if (!lab.isValid() || lab.getSourceID() == QEDSourceID) continue; // std::cout << "CIAO5" << std::endl; - + // get MC info int trID = lab.getTrackID(); const auto& mc2hit = mc2hitVec[lab.getEventID()]; @@ -261,7 +260,7 @@ void CheckClustersIOTOF(std::string clusfile = "tf3clusters.root", float dx = 0, dz = 0; int ievH = lab.getEventID(); o2::math_utils::Point3D locH, locHsta; - + // mean local position of the hit locH = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local locHsta = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart()); 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/TopologyClassifier.h b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/include/IOTOFReconstruction/TopologyClassifier.h index fbe8d1c71d515..c8e09264e2832 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,14 +115,15 @@ 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 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; }; // 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); @@ -137,8 +140,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 a9c1ea579f14d..fc06b9fbff36b 100644 --- a/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx +++ b/Detectors/Upgrades/ALICE3/IOTOF/reconstruction/src/Clusterer.cxx @@ -127,10 +127,10 @@ 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 @@ -258,9 +258,9 @@ void Clusterer::ClustererThread::findClustersMultipleHits(gsl::span Cluster cluster(minRow, minCol, rowSpan, colSpan, firedDigitsMask, clsTopology, chipID, time); LOG(debug) << "Pushing back cluster with row: " << row << ", col: " << col << ", rowSpan: " << rowSpan - << ", colSpan: " << colSpan << ", pattern: " << firedDigitsMask - << ", topology: " << clsTopology << ", chipID: " << chipID - << ", time: " << time; + << ", colSpan: " << colSpan << ", pattern: " << firedDigitsMask + << ", topology: " << clsTopology << ", chipID: " << chipID + << ", time: " << time; mClusters.emplace_back(cluster); mPatterns.emplace_back(static_cast(firedDigitsMask)); @@ -304,7 +304,7 @@ void Clusterer::ClustererThread::findClustersMultipleHits(gsl::span const auto& digit = digits[idx]; const uint16_t rowOffset = digit.getRow() - minRow; const uint16_t colOffset = digit.getColumn() - minCol; - + // Single bit position calculation const uint16_t bitIndex = rowOffset * colSpan + colOffset; diff --git a/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx b/Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Digitizer.cxx index 90578c08a2f1e..42d75a04b6b8b 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