From 30f6b2d10d615e220b961bf2de7d18a6c675a078 Mon Sep 17 00:00:00 2001 From: Maximiliano Puccio Date: Fri, 24 Apr 2026 08:27:11 +0200 Subject: [PATCH 1/2] ALICE3: adapt cluster finding to separated streams per layer Fix CheckCluster macro --- .../ALICE3/TRK/macros/test/CheckClusters.C | 264 +++++----- .../ALICE3/TRK/macros/test/CheckDigits.C | 467 ------------------ .../include/TRKReconstruction/Clusterer.h | 5 +- .../include/TRKReconstruction/ClustererACTS.h | 4 +- .../TRK/reconstruction/src/Clusterer.cxx | 10 +- .../TRK/reconstruction/src/ClustererACTS.cxx | 4 +- .../include/TRKWorkflow/ClustererSpec.h | 2 + .../TRK/workflow/src/ClusterWriterSpec.cxx | 86 +++- .../ALICE3/TRK/workflow/src/ClustererSpec.cxx | 126 ++--- 9 files changed, 274 insertions(+), 694 deletions(-) delete mode 100644 Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigits.C diff --git a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C index 327577102d86e..e822616649942 100644 --- a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C +++ b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C @@ -26,6 +26,7 @@ #include "DataFormatsTRK/Cluster.h" #include "DataFormatsTRK/ROFRecord.h" +#include "TRKBase/AlmiraParam.h" #include "TRKBase/GeometryTGeo.h" #include "TRKBase/SegmentationChip.h" #include "TRKSimulation/Hit.h" @@ -142,47 +143,63 @@ void CheckClusters(const std::string& clusfile = "o2clus_trk.root", return; } - std::vector* clusArr = nullptr; - std::vector* rofRecVecP = nullptr; - std::vector* patternsPtr = nullptr; - clusTree->SetBranchAddress("TRKClusterComp", &clusArr); - clusTree->SetBranchAddress("TRKClustersROF", &rofRecVecP); - if (clusTree->GetBranch("TRKClusterPatt") != nullptr) { - clusTree->SetBranchAddress("TRKClusterPatt", &patternsPtr); + // Read per-layer cluster branches and accumulate + static constexpr int nLayers = o2::trk::AlmiraParam::kNLayers; + std::vector*> clusArrPerLayer(nLayers, nullptr); + std::vector*> rofRecVecPerLayer(nLayers, nullptr); + std::vector*> patternsPerLayer(nLayers, nullptr); + std::vector*> clusLabArrPerLayer(nLayers, nullptr); + + bool hasMC = true; + for (int iLayer = 0; iLayer < nLayers; iLayer++) { + std::string brClus = std::string("TRKClusterComp_") + std::to_string(iLayer); + std::string brROF = std::string("TRKClustersROF_") + std::to_string(iLayer); + std::string brPatt = std::string("TRKClusterPatt_") + std::to_string(iLayer); + std::string brMCTruth = std::string("TRKClusterMCTruth_") + std::to_string(iLayer); + + if (clusTree->GetBranch(brClus.c_str()) == nullptr) { + LOGP(warning, "Branch {} not found, skipping layer {}", brClus, iLayer); + continue; + } + clusTree->SetBranchAddress(brClus.c_str(), &clusArrPerLayer[iLayer]); + clusTree->SetBranchAddress(brROF.c_str(), &rofRecVecPerLayer[iLayer]); + if (clusTree->GetBranch(brPatt.c_str()) != nullptr) { + clusTree->SetBranchAddress(brPatt.c_str(), &patternsPerLayer[iLayer]); + } + if (clusTree->GetBranch(brMCTruth.c_str()) != nullptr) { + clusTree->SetBranchAddress(brMCTruth.c_str(), &clusLabArrPerLayer[iLayer]); + } else { + hasMC = false; + } } - o2::dataformats::MCTruthContainer* clusLabArr = nullptr; - std::vector mc2rofVec, *mc2rofVecP = &mc2rofVec; - bool hasMC = (clusTree->GetBranch("TRKClusterMCTruth") != nullptr); - if (hasMC) { - clusTree->SetBranchAddress("TRKClusterMCTruth", &clusLabArr); - clusTree->SetBranchAddress("TRKClustersMC2ROF", &mc2rofVecP); + // Read entry and accumulate all layers + clusTree->GetEntry(0); + // Print total clusters per layer + for (int iLayer = 0; iLayer < nLayers; iLayer++) { + LOGP(info, "Layer {}: {} clusters", iLayer, clusArrPerLayer[iLayer]->size()); } - clusTree->GetEntry(0); - const unsigned int nROFRec = rofRecVecP ? (unsigned int)rofRecVecP->size() : 0u; + // Accumulate max ROF count across all layers + unsigned int nROFRec = 0; + for (int iLayer = 0; iLayer < nLayers; iLayer++) { + nROFRec = std::max(nROFRec, (unsigned int)rofRecVecPerLayer[iLayer]->size()); + } LOGP(info, "Number of ROF records: {}", nROFRec); - auto pattIt = patternsPtr ? patternsPtr->cbegin() : std::vector::const_iterator{}; - // ── Build per-ROF MC event range ─────────────────────────────────────────── - std::vector mcEvMin(nROFRec, (int)hitTree->GetEntries()); - std::vector mcEvMax(nROFRec, -1); + // ── Load all MC hit events upfront (TRK has no MC2ROF mapping) ────────────── if (hasMC) { - for (int imc = (int)mc2rofVec.size(); imc--;) { - const auto& mc2rof = mc2rofVec[imc]; - if (mc2rof.rofRecordID < 0) { - continue; - } - for (unsigned int irfd = mc2rof.maxROF - mc2rof.minROF + 1; irfd--;) { - unsigned int irof = mc2rof.rofRecordID + irfd; - if (irof >= nROFRec) { - continue; - } - if (mcEvMin[irof] > imc) { - mcEvMin[irof] = imc; - } - if (mcEvMax[irof] < imc) { - mcEvMax[irof] = imc; + LOGP(info, "Pre-loading {} MC events", hitTree->GetEntries()); + for (int im = 0; im < (int)hitTree->GetEntries(); im++) { + if (hitVecPool[im] == nullptr) { + hitTree->SetBranchAddress("TRKHit", &hitVecPool[im]); + hitTree->GetEntry(im); + auto& mc2hit = mc2hitVec[im]; + const auto* hv = hitVecPool[im]; + for (int ih = (int)hv->size(); ih--;) { + const auto& hit = (*hv)[ih]; + uint64_t key = (uint64_t(hit.GetTrackID()) << 32) + hit.GetDetectorID(); + mc2hit.emplace(key, ih); } } } @@ -203,103 +220,97 @@ void CheckClusters(const std::string& clusfile = "o2clus_trk.root", // ── Main loop ────────────────────────────────────────────────────────────── for (unsigned int irof = 0; irof < nROFRec; irof++) { - const auto& rofRec = (*rofRecVecP)[irof]; - - // Cache MC hit events for this ROF - if (hasMC) { - for (int im = mcEvMin[irof]; im <= mcEvMax[irof]; im++) { - if (hitVecPool[im] == nullptr) { - hitTree->SetBranchAddress("TRKHit", &hitVecPool[im]); - hitTree->GetEntry(im); - auto& mc2hit = mc2hitVec[im]; - const auto* hv = hitVecPool[im]; - for (int ih = (int)hv->size(); ih--;) { - const auto& hit = (*hv)[ih]; - uint64_t key = (uint64_t(hit.GetTrackID()) << 32) + hit.GetDetectorID(); - mc2hit.emplace(key, ih); - } - } + // Process each layer + for (int iLayer = 0; iLayer < nLayers; iLayer++) { + if (rofRecVecPerLayer[iLayer]->empty() || irof >= rofRecVecPerLayer[iLayer]->size()) { + continue; } - } - - for (int icl = 0; icl < rofRec.getNEntries(); icl++) { - const int clEntry = rofRec.getFirstEntry() + icl; - const auto& cluster = (*clusArr)[clEntry]; - nTot++; - - // ── Parse pattern → center-of-gravity within bounding box ────────── - // The cluster stores the bounding-box top-left pixel (row, col). - // The pattern stream encodes [rowSpan, colSpan, bitmap...] for each cluster. - // We accumulate pixel row/col offsets to obtain a sub-pixel CoG correction. - float cogDr{0.f}, cogDc{0.f}; // mean offsets from bbox origin (pixels) - if (patternsPtr) { - const uint8_t rowSpan = *pattIt++; - const uint8_t colSpan = *pattIt++; - const int nBytes = (rowSpan * colSpan + 7) / 8; - int nPix{0}, pixIdx{0}; - for (int ib = 0; ib < nBytes; ib++) { - const uint8_t byte = *pattIt++; - for (int bit = 7; bit >= 0 && pixIdx < rowSpan * colSpan; bit--, pixIdx++) { - if (byte & (1 << bit)) { - cogDr += pixIdx / colSpan; - cogDc += pixIdx % colSpan; - nPix++; + const auto& rofRec = (*rofRecVecPerLayer[iLayer])[irof]; + const auto& clusArr = *clusArrPerLayer[iLayer]; + const auto& patternsPtr = (patternsPerLayer[iLayer] == nullptr) ? nullptr : patternsPerLayer[iLayer]; + const auto& clusLabArr = clusLabArrPerLayer[iLayer]; + + // Create per-layer pattern iterator + auto pattIt = patternsPtr ? patternsPtr->cbegin() : std::vector::const_iterator{}; + + for (int icl = 0; icl < rofRec.getNEntries(); icl++) { + const int clEntry = rofRec.getFirstEntry() + icl; + const auto& cluster = clusArr[clEntry]; + nTot++; + + // ── Parse pattern → center-of-gravity within bounding box ────────── + // The cluster stores the bounding-box top-left pixel (row, col). + // The pattern stream encodes [rowSpan, colSpan, bitmap...] for each cluster. + // We accumulate pixel row/col offsets to obtain a sub-pixel CoG correction. + float cogDr{0.f}, cogDc{0.f}; // mean offsets from bbox origin (pixels) + if (patternsPtr) { + const uint8_t rowSpan = *pattIt++; + const uint8_t colSpan = *pattIt++; + const int nBytes = (rowSpan * colSpan + 7) / 8; + int nPix{0}, pixIdx{0}; + for (int ib = 0; ib < nBytes; ib++) { + const uint8_t byte = *pattIt++; + for (int bit = 7; bit >= 0 && pixIdx < rowSpan * colSpan; bit--, pixIdx++) { + if (byte & (1 << bit)) { + cogDr += pixIdx / colSpan; + cogDc += pixIdx % colSpan; + nPix++; + } } } + if (nPix > 1) { + cogDr /= nPix; + cogDc /= nPix; + } } - if (nPix > 1) { - cogDr /= nPix; - cogDc /= nPix; - } - } - // ── Cluster local → global (CoG position) ───────────────────────────── - // Get local coords of the bounding-box corner pixel, then apply the - // fractional CoG displacement using the pixel pitch. - // Formula from detectorToLocalUnchecked: - // VD : xRow = 0.5*(width[lay]-pitchRow) - row*pitchRow → row↑ xRow↓ - // zCol = col*pitchCol + 0.5*(pitchCol-length) → col↑ zCol↑ - // MLOT: same structure with MLOT pitches - float clLocX{0.f}, clLocZ{0.f}; - o2::trk::SegmentationChip::detectorToLocalUnchecked( - cluster.row, cluster.col, clLocX, clLocZ, - cluster.subDetID, cluster.layer, cluster.disk); - const float pitchRow = (cluster.subDetID == 0) - ? o2::trk::SegmentationChip::PitchRowVD - : o2::trk::SegmentationChip::PitchRowMLOT; - const float pitchCol = (cluster.subDetID == 0) - ? o2::trk::SegmentationChip::PitchColVD - : o2::trk::SegmentationChip::PitchColMLOT; - clLocX -= cogDr * pitchRow; // increasing row → decreasing xRow - clLocZ += cogDc * pitchCol; // increasing col → increasing zCol - const float yResponse = (cluster.subDetID == 0) ? yPlaneVD : yPlaneMLOT; - // For VD the L2G matrix is built in the *curved* local frame (quasi-Cartesian, - // origin at the beam axis). Convert flat (clLocX, 0) → curved (xC, yC) first. - // For MLOT (flat sensors) the local frame is already Cartesian: pass directly. - // clLocX is already in the flat frame from detectorToLocalUnchecked + CoG and - // does NOT need any further transformation for the residual comparison. - o2::math_utils::Point3D locC; - if (cluster.subDetID == 0) { - auto cv = o2::trk::SegmentationChip::flatToCurved(cluster.layer, clLocX, 0.f); - locC = {cv.X(), cv.Y(), clLocZ}; - } else { - locC = {clLocX, yResponse, clLocZ}; - } - auto gloC = gman->getMatrixL2G(cluster.chipID)(locC); - - if (!hasMC || clusLabArr == nullptr) { - // No MC info: just fill geometry columns, leave residuals as 0 - std::array data = { - -1.f, -1.f, - 0.f, 0.f, 0.f, 0.f, 0.f, - (float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(), - clLocX, clLocZ, - (float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID, - (float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID, - (float)cluster.row, (float)cluster.col, -1.f}; - nt.Fill(data.data()); - continue; - } + // ── Cluster local → global (CoG position) ───────────────────────────── + // Get local coords of the bounding-box corner pixel, then apply the + // fractional CoG displacement using the pixel pitch. + // Formula from detectorToLocalUnchecked: + // VD : xRow = 0.5*(width[lay]-pitchRow) - row*pitchRow → row↑ xRow↓ + // zCol = col*pitchCol + 0.5*(pitchCol-length) → col↑ zCol↑ + // MLOT: same structure with MLOT pitches + float clLocX{0.f}, clLocZ{0.f}; + o2::trk::SegmentationChip::detectorToLocalUnchecked( + cluster.row, cluster.col, clLocX, clLocZ, + cluster.subDetID, cluster.layer, cluster.disk); + const float pitchRow = (cluster.subDetID == 0) + ? o2::trk::SegmentationChip::PitchRowVD + : o2::trk::SegmentationChip::PitchRowMLOT; + const float pitchCol = (cluster.subDetID == 0) + ? o2::trk::SegmentationChip::PitchColVD + : o2::trk::SegmentationChip::PitchColMLOT; + clLocX -= cogDr * pitchRow; // increasing row → decreasing xRow + clLocZ += cogDc * pitchCol; // increasing col → increasing zCol + const float yResponse = (cluster.subDetID == 0) ? yPlaneVD : yPlaneMLOT; + // For VD the L2G matrix is built in the *curved* local frame (quasi-Cartesian, + // origin at the beam axis). Convert flat (clLocX, 0) → curved (xC, yC) first. + // For MLOT (flat sensors) the local frame is already Cartesian: pass directly. + // clLocX is already in the flat frame from detectorToLocalUnchecked + CoG and + // does NOT need any further transformation for the residual comparison. + o2::math_utils::Point3D locC; + if (cluster.subDetID == 0) { + auto cv = o2::trk::SegmentationChip::flatToCurved(cluster.layer, clLocX, 0.f); + locC = {cv.X(), cv.Y(), clLocZ}; + } else { + locC = {clLocX, yResponse, clLocZ}; + } + auto gloC = gman->getMatrixL2G(cluster.chipID)(locC); + + if (!hasMC || clusLabArr == nullptr) { + // No MC info: just fill geometry columns, leave residuals as 0 + std::array data = { + -1.f, -1.f, + 0.f, 0.f, 0.f, 0.f, 0.f, + (float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(), + clLocX, clLocZ, + (float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID, + (float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID, + (float)cluster.row, (float)cluster.col, -1.f}; + nt.Fill(data.data()); + continue; + } // ── MC label ─────────────────────────────────────────────────────── const auto& labels = clusLabArr->getLabels(clEntry); @@ -367,6 +378,7 @@ void CheckClusters(const std::string& clusfile = "o2clus_trk.root", (float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID, (float)cluster.row, (float)cluster.col, pt}; nt.Fill(data.data()); + } } } diff --git a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigits.C b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigits.C deleted file mode 100644 index ec1adf500f562..0000000000000 --- a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigits.C +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file CheckDigits.C -/// \brief Simple macro to check TRK digits - -#if !defined(__CLING__) || defined(__ROOTCLING__) -#include -#include -#include -#include -#include -#include -#include -#include - -#include "TRKBase/SegmentationChip.h" -#include "TRKBase/GeometryTGeo.h" -#include "DataFormatsITSMFT/Digit.h" -#include "TRKSimulation/Hit.h" -#include "MathUtils/Utils.h" -#include "SimulationDataFormat/ConstMCTruthContainer.h" -#include "SimulationDataFormat/IOMCTruthContainerView.h" -#include "SimulationDataFormat/MCCompLabel.h" -#include "DetectorsBase/GeometryManager.h" -#include "ITSMFTSimulation/AlpideSimResponse.h" -#include "CCDB/BasicCCDBManager.h" - -#include "DataFormatsITSMFT/ROFRecord.h" - -#endif - -#define ENABLE_UPGRADES - -void addTLines(float pitch) -{ - // Add grid lines at multiples of pitch on the current pad - if (!gPad) - return; - - gPad->Update(); - - Double_t xmin = gPad->GetUxmin(); - Double_t xmax = gPad->GetUxmax(); - Double_t ymin = gPad->GetUymin(); - Double_t ymax = gPad->GetUymax(); - - // Calculate the first vertical line position (multiple of pitch) - int nLinesX = 0; - for (float x = xmin; x <= xmax && nLinesX < 1000; x += pitch, nLinesX++) { - TLine* line = new TLine(x, ymin, x, ymax); - line->SetLineStyle(2); - line->SetLineColor(kGray); - line->Draw("same"); - } - - // Calculate the first horizontal line position (multiple of pitch) - int nLinesY = 0; - for (float y = ymin; y <= ymax && nLinesY < 1000; y += pitch, nLinesY++) { - TLine* line = new TLine(xmin, y, xmax, y); - line->SetLineStyle(2); - line->SetLineColor(kGray); - line->Draw("same"); - } - - gPad->Modified(); - gPad->Update(); -} - -void CheckDigits(std::string digifile = "trkdigits.root", std::string hitfile = "o2sim_HitsTRK.root", std::string inputGeom = "o2sim_geometry.root", std::string paramfile = "o2sim_par.root") -{ - gStyle->SetPalette(55); - - using namespace o2::base; - using namespace o2::trk; - - using o2::itsmft::Digit; - using o2::trk::Hit; - - using o2::trk::SegmentationChip; - - TFile* f = TFile::Open("CheckDigits.root", "recreate"); - - TNtuple* nt = new TNtuple("ntd", "digit ntuple", "id:x:y:z:rowD:colD:rowH:colH:xlH:zlH:xlcH:zlcH:dx:dz"); - TNtuple* nt2 = new TNtuple("ntd2", "digit ntuple", "id:z:dxH:dzH"); /// maximum number of elements in a tuple = 15: doing a new tuple to store more variables - - // Geometry - o2::base::GeometryManager::loadGeometry(inputGeom); - auto* gman = o2::trk::GeometryTGeo::Instance(); - gman->fillMatrixCache(o2::math_utils::bit2Mask(o2::math_utils::TransformType::L2G)); - - SegmentationChip seg; - // seg.Print(); - - // MLOT response plane: y = halfThickness - depthMax. - float depthMax = (float)o2::trk::constants::apts::thickness; // fallback (no CCDB) - auto& ccdbMgr = o2::ccdb::BasicCCDBManager::instance(); - ccdbMgr.setURL("http://alice-ccdb.cern.ch"); - if (auto* alpResp = ccdbMgr.get("IT3/Calib/APTSResponse")) { - depthMax = alpResp->getDepthMax(); - } - const float yPlaneMLOT = o2::trk::SegmentationChip::SiliconThicknessMLOT / 2.f - depthMax; - const float yPlaneVD = -o2::trk::SegmentationChip::SiliconThicknessVD; // VD reference plane in local flat y - // Hits - TFile* hitFile = TFile::Open(hitfile.data()); - TTree* hitTree = (TTree*)hitFile->Get("o2sim"); - int nevH = hitTree->GetEntries(); // hits are stored as one event per entry - std::vector*> hitArray(nevH, nullptr); - - std::vector> mc2hitVec(nevH); - - // Digits - TFile* digFile = TFile::Open(digifile.data()); - TTree* digTree = (TTree*)digFile->Get("o2sim"); - - std::vector* digArr = nullptr; - digTree->SetBranchAddress("TRKDigit", &digArr); - - o2::dataformats::IOMCTruthContainerView* plabels = nullptr; - digTree->SetBranchAddress("TRKDigitMCTruth", &plabels); - - // Get Read Out Frame arrays - std::vector* ROFRecordArrray = nullptr; - digTree->SetBranchAddress("TRKDigitROF", &ROFRecordArrray); - std::vector& ROFRecordArrrayRef = *ROFRecordArrray; - - std::vector* MC2ROFRecordArrray = nullptr; - digTree->SetBranchAddress("TRKDigitMC2ROF", &MC2ROFRecordArrray); - std::vector& MC2ROFRecordArrrayRef = *MC2ROFRecordArrray; - - digTree->GetEntry(0); - - int nROFRec = (int)ROFRecordArrrayRef.size(); - std::vector mcEvMin(nROFRec, hitTree->GetEntries()); - std::vector mcEvMax(nROFRec, -1); - o2::dataformats::ConstMCTruthContainer labels; - plabels->copyandflatten(labels); - delete plabels; - - // >> build min and max MC events used by each ROF - for (int imc = MC2ROFRecordArrrayRef.size(); imc--;) { - const auto& mc2rof = MC2ROFRecordArrrayRef[imc]; - // printf("MCRecord: "); - // mc2rof.print(); - - if (mc2rof.rofRecordID < 0) { - continue; // this MC event did not contribute to any ROF - } - - for (int irfd = mc2rof.maxROF - mc2rof.minROF + 1; irfd--;) { - - int irof = mc2rof.rofRecordID + irfd; - - if (irof >= nROFRec) { - LOG(error) << "ROF=" << irof << " from MC2ROF record is >= N ROFs=" << nROFRec; - } - if (mcEvMin[irof] > imc) { - mcEvMin[irof] = imc; - } - if (mcEvMax[irof] < imc) { - mcEvMax[irof] = imc; - } - } - } // << build min and max MC events used by each ROF - - unsigned int rofIndex = 0; - unsigned int rofNEntries = 0; - - // LOOP on : ROFRecord array - for (unsigned int iROF = 0; iROF < ROFRecordArrrayRef.size(); iROF++) { - - rofIndex = ROFRecordArrrayRef[iROF].getFirstEntry(); - rofNEntries = ROFRecordArrrayRef[iROF].getNEntries(); - - // >> read and map MC events contributing to this ROF - for (int im = mcEvMin[iROF]; im <= mcEvMax[iROF]; im++) { - - if (!hitArray[im]) { - - hitTree->SetBranchAddress("TRKHit", &hitArray[im]); - hitTree->GetEntry(im); - - auto& mc2hit = mc2hitVec[im]; - - for (int ih = hitArray[im]->size(); ih--;) { - - const auto& hit = (*hitArray[im])[ih]; - uint64_t key = (uint64_t(hit.GetTrackID()) << 32) + hit.GetDetectorID(); - mc2hit.emplace(key, ih); - } - } - } - - // LOOP on : digits array - for (unsigned int iDigit = rofIndex; iDigit < rofIndex + rofNEntries; iDigit++) { - // if (iDigit % 10000 != 0) /// looking only at a small sample - // continue; - - if (iDigit % 1000 == 0) - std::cout << "Reading digit " << iDigit << " / " << digArr->size() << std::endl; - - Int_t ix = (*digArr)[iDigit].getRow(), iz = (*digArr)[iDigit].getColumn(); - Int_t iDetID = (*digArr)[iDigit].getChipIndex(); - Int_t layer = gman->getLayer(iDetID); - Int_t disk = gman->getDisk(iDetID); - Int_t subDetID = gman->getSubDetID(iDetID); - Int_t petalCase = gman->getPetalCase(iDetID); - Int_t stave = gman->getStave(iDetID); - Int_t halfstave = gman->getHalfStave(iDetID); - - Float_t x = 0.f, y = 0.f, z = 0.f; - Float_t x_flat = 0.f, z_flat = 0.f; - - if (disk != -1) { - continue; // skip disks for the moment - } - - if (subDetID != 0) { - seg.detectorToLocal(ix, iz, x, z, subDetID, layer, disk); - } else if (subDetID == 0) { - seg.detectorToLocal(ix, iz, x_flat, z_flat, subDetID, layer, disk); - o2::math_utils::Vector2D xyCurved = seg.flatToCurved(layer, x_flat, 0.); - x = xyCurved.X(); - y = xyCurved.Y(); - z = z_flat; - } - - o2::math_utils::Point3D locD(x, y, z); // local Digit curved - o2::math_utils::Point3D locDF(-1, -1, -1); // local Digit flat - - Int_t chipID = (*digArr)[iDigit].getChipIndex(); - auto lab = (labels.getLabels(iDigit))[0]; - - int trID = lab.getTrackID(); - - if (!lab.isValid()) { // not a noise - continue; - } - - const auto gloD = gman->getMatrixL2G(chipID)(locD); // convert to global - - std::unordered_map* mc2hit = &mc2hitVec[lab.getEventID()]; - - // get MC info - uint64_t key = (uint64_t(trID) << 32) + chipID; - auto hitEntry = mc2hit->find(key); - - if (hitEntry == mc2hit->end()) { - - LOG(error) << "Failed to find MC hit entry for Tr" << trID << " chipID" << chipID; - continue; - } - - ////// HITS - Hit& hit = (*hitArray[lab.getEventID()])[hitEntry->second]; - - auto xyzLocE = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local - auto xyzLocS = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart()); - - // Hit local reference: Both VD and MLOT use response-plane interpolation (in flat local frame). - // For VD, transform curved → flat first, then interpolate. - o2::math_utils::Vector3D locH; /// Hit reference (at response plane) - o2::math_utils::Vector3D locHS; /// Hit, start pos - locHS.SetCoordinates(xyzLocS.X(), xyzLocS.Y(), xyzLocS.Z()); - o2::math_utils::Vector3D locHE; /// Hit, end pos - locHE.SetCoordinates(xyzLocE.X(), xyzLocE.Y(), xyzLocE.Z()); - o2::math_utils::Vector3D locHF; - - if (subDetID == 0) { - // VD: Interpolate to VD reference plane in flat frame; apply same r to X and Z - auto flatSta = seg.curvedToFlat(layer, locHS.X(), locHS.Y()); - auto flatEnd = seg.curvedToFlat(layer, locHE.X(), locHE.Y()); - float x0 = flatSta.X(), y0 = flatSta.Y(), z0 = locHS.Z(); - float dltx = flatEnd.X() - x0, dlty = flatEnd.Y() - y0, dltz = locHE.Z() - z0; - float r = (std::abs(dlty) > 1e-9f) ? (yPlaneVD - y0) / dlty : 0.5f; - locH.SetCoordinates(x0 + r * dltx, yPlaneVD, z0 + r * dltz); - } else { - // MLOT: Interpolate to response plane - float x0 = locHS.X(), y0 = locHS.Y(), z0 = locHS.Z(); - float dltx = locHE.X() - x0, dlty = locHE.Y() - y0, dltz = locHE.Z() - z0; - float r = (std::abs(dlty) > 1e-9f) ? (yPlaneMLOT - y0) / dlty : 0.5f; - locH.SetCoordinates(x0 + r * dltx, yPlaneMLOT, z0 + r * dltz); - } - - int row = 0, col = 0; - float xlc = 0., zlc = 0.; - - if (subDetID == 0) { - Float_t x_flat = 0.f, y_flat = 0.f; - // locH is already in flat frame from interpolation above; convert digit to flat for comparison - o2::math_utils::Vector2D xyFlatD = seg.curvedToFlat(layer, locD.X(), locD.Y()); - locDF.SetCoordinates(xyFlatD.X(), xyFlatD.Y(), locD.Z()); - locHF.SetCoordinates(locH.X(), locH.Y(), locH.Z()); // locH already in flat frame - seg.localToDetector(locHF.X(), locHF.Z(), row, col, subDetID, layer, disk); - } - - else { - seg.localToDetector(locH.X(), locH.Z(), row, col, subDetID, layer, disk); - } - - seg.detectorToLocal(row, col, xlc, zlc, subDetID, layer, disk); - - if (subDetID == 0) { - nt->Fill(chipID, /// detector ID - gloD.X(), gloD.Y(), gloD.Z(), /// global position retrieved from the digit: digit (row, col) ->local position -> global potision - ix, iz, /// row and column of the digit - row, col, /// row and col retrieved from the hit: hit global position -> hit local position -> detector position (row, col) - locH.X(), locH.Z(), /// x and z of the hit in the local reference frame: hit global position -> hit local position - xlc, zlc, /// x and z of the hit in the local frame: hit global position -> hit local position -> detector position (row, col) -> local position - locHF.X() - locDF.X(), locHF.Z() - locDF.Z()); /// difference in x and z between the hit and the digit in the local frame - - nt2->Fill(chipID, gloD.Z(), locHS.X() - locHE.X(), locHS.Z() - locHE.Z()); /// differences between local hit start and hit end positions - } else { - - nt->Fill(chipID, /// detector ID - gloD.X(), gloD.Y(), gloD.Z(), /// global position retrieved from the digit: digit (row, col) ->local position -> global potision - ix, iz, /// row and column of the digit - row, col, /// row and col retrieved from the hit: hit global position -> hit local position -> detector position (row, col) - locH.X(), locH.Z(), /// x and z of the hit in the local reference frame: hit global position -> hit local position - xlc, zlc, /// x and z of the hit in the local frame: hit global position -> hit local position -> detector position (row, col) -> local position - locH.X() - locD.X(), locH.Z() - locD.Z()); /// difference in x and z between the hit and the digit in the local frame - // locHS.X() - locHE.X(), locHS.Z() - locHE.Z()); /// difference in x and z between the hit and the digit in the local frame - nt2->Fill(chipID, gloD.Z(), locHS.X() - locHE.X(), locHS.Z() - locHE.Z()); /// differences between local hit start and hit end positions - } - - } // end loop on digits array - - } // end loop on ROFRecords array - - // digit maps in the xy and yz planes - auto canvXY = new TCanvas("canvXY", "", 1600, 2400); - canvXY->Divide(2, 3); - canvXY->cd(1); - nt->Draw("y:x >>h_y_vs_x_VD(1000, -3, 3, 1000, -3, 3)", "id < 12 ", "colz"); - canvXY->cd(2); - nt->Draw("y:z>>h_y_vs_z_VD(1000, -26, 26, 1000, -3, 3)", "id < 12 ", "colz"); - canvXY->cd(3); - nt->Draw("y:x>>h_y_vs_x_ML(1000, -25, 25, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); - canvXY->cd(4); - nt->Draw("y:z>>h_y_vs_z_ML(1000, -70, 70, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); - canvXY->cd(5); - nt->Draw("y:x>>h_y_vs_x_OT(1000, -85, 85, 1000, -85, 85)", "id >= 5132 ", "colz"); - canvXY->cd(6); - nt->Draw("y:z>>h_y_vs_z_OT(1000, -85, 85, 1000, -130, 130)", "id >= 5132 ", "colz"); - canvXY->SaveAs("trkdigits_y_vs_x_vs_z.pdf"); - - // z distributions - auto canvZ = new TCanvas("canvZ", "", 800, 2400); - canvZ->Divide(1, 3); - canvZ->cd(1); - nt->Draw("z>>h_z_VD(500, -26, 26)", "id < 12 "); - canvZ->cd(2); - nt->Draw("z>>h_z_ML(500, -70, 70)", "id >= 12 && id < 5132 "); - canvZ->cd(3); - nt->Draw("z>>h_z_OT(500, -85, 85)", "id >= 5132 "); - canvZ->SaveAs("trkdigits_z.pdf"); - - // dz distributions (difference between local position of digits and hits in x and z) - auto canvdZ = new TCanvas("canvdZ", "", 800, 2400); - canvdZ->Divide(1, 3); - canvdZ->cd(1); - nt->Draw("dz>>h_dz_VD(500, -0.05, 0.05)", "id < 12 "); - canvdZ->cd(2); - nt->Draw("dz>>h_dz_ML(500, -0.05, 0.05)", "id >= 12 && id < 5132 "); - canvdZ->cd(3); - nt->Draw("dz>>h_dz_OT(500, -0.05, 0.05)", "id >= 5132 "); - canvdZ->SaveAs("trkdigits_dz.pdf"); - canvdZ->SaveAs("trkdigits_dz.root"); - - // distributions of differences between local positions of digits and hits in x and z - auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 2400); - canvdXdZ->Divide(2, 3); - canvdXdZ->cd(1); - nt->Draw("dx:dz>>h_dx_vs_dz_VD(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - auto h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD"); - LOG(info) << "dx, dz"; - Info("VD", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(2); - nt->Draw("dx:dz>>h_dx_vs_dz_VD_z(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12 && abs(z)<0.5", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD_z"); - Info("VD |z|<1", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD |z|<1", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(3); - nt->Draw("dx:dz>>h_dx_vs_dz_ML(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML"); - Info("ML", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(4); - nt->Draw("dx:dz>>h_dx_vs_dz_ML_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML_z"); - Info("ML |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); - canvdXdZ->cd(5); - nt->Draw("dx:dz>>h_dx_vs_dz_OT(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT"); - Info("OT", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(6); - nt->Draw("dx:dz>>h_dx_vs_dz_OT_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT_z"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - Info("OT |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.root"); - - // distribution of differences between hit start and hit end in local coordinates - auto canvdXdZHit = new TCanvas("canvdXdZHit", "", 1600, 2400); - canvdXdZHit->Divide(2, 3); - canvdXdZHit->cd(1); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - LOG(info) << "dxH, dzH"; - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD"); - Info("VD", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(2); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD_z"); - Info("VD |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(3); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML"); - Info("ML", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(4); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML_z"); - Info("ML |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); - canvdXdZHit->cd(5); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT"); - Info("OT", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(6); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT_z"); - Info("OT |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); - - f->Write(); - f->Close(); -} diff --git a/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/Clusterer.h b/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/Clusterer.h index 70518b2ace593..bcd95155f533f 100644 --- a/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/Clusterer.h +++ b/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/Clusterer.h @@ -48,7 +48,6 @@ class Clusterer using Digit = o2::itsmft::Digit; using DigROFRecord = o2::itsmft::ROFRecord; - using DigMC2ROFRecord = o2::itsmft::MC2ROFRecord; using ClusterTruth = o2::dataformats::MCTruthContainer; using ConstDigitTruth = o2::dataformats::ConstMCTruthContainerView; using Label = o2::MCCompLabel; @@ -167,9 +166,7 @@ class Clusterer std::vector& patterns, std::vector& clusterROFs, const ConstDigitTruth* digitLabels = nullptr, - ClusterTruth* clusterLabels = nullptr, - gsl::span digMC2ROFs = {}, - std::vector* clusterMC2ROFs = nullptr); + ClusterTruth* clusterLabels = nullptr); protected: int mNHugeClus = 0; diff --git a/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/ClustererACTS.h b/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/ClustererACTS.h index 37a148aa78afb..5d68193e5e375 100644 --- a/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/ClustererACTS.h +++ b/Detectors/Upgrades/ALICE3/TRK/reconstruction/include/TRKReconstruction/ClustererACTS.h @@ -35,9 +35,7 @@ class ClustererACTS : public Clusterer std::vector& patterns, std::vector& clusterROFs, const ConstDigitTruth* digitLabels = nullptr, - ClusterTruth* clusterLabels = nullptr, - gsl::span digMC2ROFs = {}, - std::vector* clusterMC2ROFs = nullptr) override; + ClusterTruth* clusterLabels = nullptr) override; private: }; diff --git a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx index bdaa76319c1f2..b7d71f98bacb6 100644 --- a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx @@ -28,9 +28,7 @@ void Clusterer::process(gsl::span digits, std::vector& patterns, std::vector& clusterROFs, const ConstDigitTruth* digitLabels, - ClusterTruth* clusterLabels, - gsl::span digMC2ROFs, - std::vector* clusterMC2ROFs) + ClusterTruth* clusterLabels) { if (!mThread) { mThread = std::make_unique(this); @@ -82,12 +80,6 @@ void Clusterer::process(gsl::span digits, outFirst, static_cast(clusters.size()) - outFirst); } - if (clusterMC2ROFs && !digMC2ROFs.empty()) { - clusterMC2ROFs->reserve(clusterMC2ROFs->size() + digMC2ROFs.size()); - for (const auto& in : digMC2ROFs) { - clusterMC2ROFs->emplace_back(in.eventRecordID, in.rofRecordID, in.minROF, in.maxROF); - } - } } //__________________________________________________ diff --git a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/ClustererACTS.cxx b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/ClustererACTS.cxx index 2dbf56ae610e3..b764fcdd1cd79 100644 --- a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/ClustererACTS.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/ClustererACTS.cxx @@ -162,9 +162,7 @@ void ClustererACTS::process(gsl::span digits, std::vector& patterns, std::vector& clusterROFs, const ConstDigitTruth* digitLabels, - ClusterTruth* clusterLabels, - gsl::span digMC2ROFs, - std::vector* clusterMC2ROFs) + ClusterTruth* clusterLabels) { if (!mThread) { mThread = std::make_unique(this); diff --git a/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/ClustererSpec.h b/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/ClustererSpec.h index 18cc6d245025a..9d072e85d574a 100644 --- a/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/ClustererSpec.h +++ b/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/ClustererSpec.h @@ -14,6 +14,7 @@ #include "Framework/DataProcessorSpec.h" #include "Framework/Task.h" +#include "TRKBase/AlmiraParam.h" #include "TRKReconstruction/Clusterer.h" #ifdef O2_WITH_ACTS #include "TRKReconstruction/ClustererACTS.h" @@ -30,6 +31,7 @@ class ClustererDPL : public o2::framework::Task void run(o2::framework::ProcessingContext& pc) final; private: + static constexpr int mLayers = o2::trk::AlmiraParam::kNLayers; bool mUseMC = true; int mNThreads = 1; o2::trk::Clusterer mClusterer; diff --git a/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClusterWriterSpec.cxx b/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClusterWriterSpec.cxx index bc3a75c646198..863915bac0572 100644 --- a/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClusterWriterSpec.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClusterWriterSpec.cxx @@ -11,9 +11,16 @@ /// @file ClusterWriterSpec.cxx +#include +#include +#include #include +#include #include "TRKWorkflow/ClusterWriterSpec.h" +#include "Framework/ConcreteDataMatcher.h" +#include "Framework/DataRef.h" +#include "TRKBase/AlmiraParam.h" #include "DPLUtils/MakeRootTreeWriterSpec.h" #include "DataFormatsTRK/Cluster.h" #include "DataFormatsTRK/ROFRecord.h" @@ -35,31 +42,68 @@ using ROFRecLblType = std::vector; DataProcessorSpec getClusterWriterSpec(bool useMC) { - auto clustersSize = std::make_shared(0); - auto clustersSizeGetter = [clustersSize](ClustersType const& clusters) { - *clustersSize = clusters.size(); + static constexpr o2::header::DataOrigin Origin{o2::header::gDataOriginTRK}; + static constexpr int nLayers = o2::trk::AlmiraParam::kNLayers; + const auto detName = Origin.as(); + + auto compClusterSizes = std::make_shared>(nLayers, 0); + auto compClustersSizeGetter = [compClusterSizes](ClustersType const& compClusters, DataRef const& ref) { + auto const* dh = DataRefUtils::getHeader(ref); + (*compClusterSizes)[dh->subSpecification] = compClusters.size(); + }; + auto logger = [detName, compClusterSizes](ROFrameType const& rofs, DataRef const& ref) { + auto const* dh = DataRefUtils::getHeader(ref); + const auto i = dh->subSpecification; + LOG(info) << detName << "ClusterWriter on layer " << i + << " pulled " << (*compClusterSizes)[i] << " clusters, in " << rofs.size() << " RO frames"; }; - auto logger = [clustersSize](ROFrameType const& rofs) { - LOG(info) << "TRKClusterWriter pulled " << *clustersSize << " clusters, in " << rofs.size() << " RO frames"; + auto getIndex = [](DataRef const& ref) -> size_t { + auto const* dh = DataRefUtils::getHeader(ref); + return static_cast(dh->subSpecification); }; + auto getName = [](std::string base, size_t index) -> std::string { + return base + "_" + std::to_string(index); + }; + auto detNameLC = detName; + std::transform(detNameLC.begin(), detNameLC.end(), detNameLC.begin(), [](unsigned char c) { return std::tolower(c); }); + + std::vector vecInpSpecClus, vecInpSpecPatt, vecInpSpecROF, vecInpSpecLbl; + vecInpSpecClus.reserve(nLayers); + vecInpSpecPatt.reserve(nLayers); + vecInpSpecROF.reserve(nLayers); + vecInpSpecLbl.reserve(nLayers); + for (int iLayer = 0; iLayer < nLayers; iLayer++) { + vecInpSpecClus.emplace_back(getName("compclus", iLayer), Origin, "COMPCLUSTERS", iLayer); + vecInpSpecPatt.emplace_back(getName("patterns", iLayer), Origin, "PATTERNS", iLayer); + vecInpSpecROF.emplace_back(getName("ROframes", iLayer), Origin, "CLUSTERSROF", iLayer); + vecInpSpecLbl.emplace_back(getName("labels", iLayer), Origin, "CLUSTERSMCTR", iLayer); + } - return MakeRootTreeWriterSpec("trk-cluster-writer", + return MakeRootTreeWriterSpec(std::format("{}-cluster-writer", detNameLC).c_str(), "o2clus_trk.root", - MakeRootTreeWriterSpec::TreeAttributes{"o2sim", "Tree with TRK clusters"}, - BranchDefinition{InputSpec{"compclus", "TRK", "COMPCLUSTERS", 0}, - "TRKClusterComp", - clustersSizeGetter}, - BranchDefinition{InputSpec{"patterns", "TRK", "PATTERNS", 0}, - "TRKClusterPatt"}, - BranchDefinition{InputSpec{"ROframes", "TRK", "CLUSTERSROF", 0}, - "TRKClustersROF", - logger}, - BranchDefinition{InputSpec{"labels", "TRK", "CLUSTERSMCTR", 0}, - "TRKClusterMCTruth", - (useMC ? 1 : 0)}, - BranchDefinition{InputSpec{"MC2ROframes", "TRK", "CLUSTERSMC2ROF", 0}, - "TRKClustersMC2ROF", - (useMC ? 1 : 0)})(); + MakeRootTreeWriterSpec::TreeAttributes{.name = "o2sim", .title = "Tree with TRK clusters"}, + BranchDefinition{vecInpSpecClus, + "TRKClusterComp", "compact-cluster-branch", + nLayers, + compClustersSizeGetter, + getIndex, + getName}, + BranchDefinition{vecInpSpecPatt, + "TRKClusterPatt", "cluster-pattern-branch", + nLayers, + getIndex, + getName}, + BranchDefinition{vecInpSpecROF, + "TRKClustersROF", "cluster-rof-branch", + nLayers, + logger, + getIndex, + getName}, + BranchDefinition{vecInpSpecLbl, + "TRKClusterMCTruth", "cluster-label-branch", + (useMC ? nLayers : 0), + getIndex, + getName})(); } } // namespace o2::trk diff --git a/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClustererSpec.cxx b/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClustererSpec.cxx index 5d9ac463b3f54..f91262e021a55 100644 --- a/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClustererSpec.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/workflow/src/ClustererSpec.cxx @@ -17,6 +17,8 @@ #include "Framework/Logger.h" #include "SimulationDataFormat/ConstMCTruthContainer.h" +#include + namespace o2::trk { @@ -30,82 +32,84 @@ void ClustererDPL::init(o2::framework::InitContext& ic) void ClustererDPL::run(o2::framework::ProcessingContext& pc) { - auto digits = pc.inputs().get>("digits"); - auto rofs = pc.inputs().get>("ROframes"); + o2::base::GeometryManager::loadGeometry("sgn_geometry.root", false, true); - gsl::span mc2rofs; - gsl::span labelbuffer; - if (mUseMC) { - labelbuffer = pc.inputs().get>("labels"); - mc2rofs = pc.inputs().get>("MC2ROframes"); - } - o2::dataformats::ConstMCTruthContainerView labels(labelbuffer); + uint64_t totalClusters = 0; + for (int iLayer = 0; iLayer < mLayers; ++iLayer) { + auto digits = pc.inputs().get>(std::format("digits_{}", iLayer)); + auto rofs = pc.inputs().get>(std::format("ROframes_{}", iLayer)); - std::vector clusters; - std::vector patterns; - std::vector clusterROFs; - std::unique_ptr> clusterLabels; - std::vector clusterMC2ROFs; - if (mUseMC) { - clusterLabels = std::make_unique>(); - } - o2::base::GeometryManager::loadGeometry("o2sim_geometry.root", false, true); + gsl::span labelbuffer; + if (mUseMC) { + labelbuffer = pc.inputs().get>(std::format("labels_{}", iLayer)); + } + o2::dataformats::ConstMCTruthContainerView labels(labelbuffer); + + std::vector clusters; + std::vector patterns; + std::vector clusterROFs; + std::unique_ptr> clusterLabels; + if (mUseMC) { + clusterLabels = std::make_unique>(); + } #ifdef O2_WITH_ACTS - if (mUseACTS) { - LOG(info) << "Running TRKClusterer with ACTS"; - mClustererACTS.process(digits, - rofs, - clusters, - patterns, - clusterROFs, - mUseMC ? &labels : nullptr, - clusterLabels.get(), - mc2rofs, - mUseMC ? &clusterMC2ROFs : nullptr); - } else + if (mUseACTS) { + LOG(info) << "Running TRKClusterer with ACTS on layer " << iLayer; + mClustererACTS.process(digits, + rofs, + clusters, + patterns, + clusterROFs, + mUseMC ? &labels : nullptr, + clusterLabels.get()); + } else #endif - { - LOG(info) << "Running TRKClusterer"; - mClusterer.process(digits, - rofs, - clusters, - patterns, - clusterROFs, - mUseMC ? &labels : nullptr, - clusterLabels.get(), - mc2rofs, - mUseMC ? &clusterMC2ROFs : nullptr); - } - - pc.outputs().snapshot(o2::framework::Output{"TRK", "COMPCLUSTERS", 0}, clusters); - pc.outputs().snapshot(o2::framework::Output{"TRK", "PATTERNS", 0}, patterns); - pc.outputs().snapshot(o2::framework::Output{"TRK", "CLUSTERSROF", 0}, clusterROFs); + { + LOG(info) << "Running TRKClusterer on layer " << iLayer; + mClusterer.process(digits, + rofs, + clusters, + patterns, + clusterROFs, + mUseMC ? &labels : nullptr, + clusterLabels.get()); + } - if (mUseMC) { - pc.outputs().snapshot(o2::framework::Output{"TRK", "CLUSTERSMCTR", 0}, *clusterLabels); - pc.outputs().snapshot(o2::framework::Output{"TRK", "CLUSTERSMC2ROF", 0}, clusterMC2ROFs); + const auto subspec = static_cast(iLayer); + pc.outputs().snapshot(o2::framework::Output{"TRK", "COMPCLUSTERS", subspec}, clusters); + pc.outputs().snapshot(o2::framework::Output{"TRK", "PATTERNS", subspec}, patterns); + pc.outputs().snapshot(o2::framework::Output{"TRK", "CLUSTERSROF", subspec}, clusterROFs); + if (mUseMC) { + pc.outputs().snapshot(o2::framework::Output{"TRK", "CLUSTERSMCTR", subspec}, *clusterLabels); + } + totalClusters += clusters.size(); + LOGP(info, "TRKClusterer layer {} pushed {} clusters in {} ROFs", iLayer, clusters.size(), clusterROFs.size()); } - LOGP(info, "TRKClusterer pushed {} clusters in {} ROFs", clusters.size(), clusterROFs.size()); + LOGP(info, "TRKClusterer produced {} clusters", totalClusters); } o2::framework::DataProcessorSpec getClustererSpec(bool useMC) { + static constexpr int nLayers = o2::trk::AlmiraParam::kNLayers; std::vector inputs; - inputs.emplace_back("digits", "TRK", "DIGITS", 0, o2::framework::Lifetime::Timeframe); - inputs.emplace_back("ROframes", "TRK", "DIGITSROF", 0, o2::framework::Lifetime::Timeframe); + for (int iLayer = 0; iLayer < nLayers; ++iLayer) { + inputs.emplace_back(std::format("digits_{}", iLayer), "TRK", "DIGITS", iLayer, o2::framework::Lifetime::Timeframe); + inputs.emplace_back(std::format("ROframes_{}", iLayer), "TRK", "DIGITSROF", iLayer, o2::framework::Lifetime::Timeframe); + if (useMC) { + inputs.emplace_back(std::format("labels_{}", iLayer), "TRK", "DIGITSMCTR", iLayer, o2::framework::Lifetime::Timeframe); + } + } std::vector outputs; - outputs.emplace_back("TRK", "COMPCLUSTERS", 0, o2::framework::Lifetime::Timeframe); - outputs.emplace_back("TRK", "PATTERNS", 0, o2::framework::Lifetime::Timeframe); - outputs.emplace_back("TRK", "CLUSTERSROF", 0, o2::framework::Lifetime::Timeframe); - - if (useMC) { - inputs.emplace_back("labels", "TRK", "DIGITSMCTR", 0, o2::framework::Lifetime::Timeframe); - inputs.emplace_back("MC2ROframes", "TRK", "DIGITSMC2ROF", 0, o2::framework::Lifetime::Timeframe); - outputs.emplace_back("TRK", "CLUSTERSMCTR", 0, o2::framework::Lifetime::Timeframe); - outputs.emplace_back("TRK", "CLUSTERSMC2ROF", 0, o2::framework::Lifetime::Timeframe); + for (int iLayer = 0; iLayer < nLayers; ++iLayer) { + outputs.emplace_back("TRK", "COMPCLUSTERS", iLayer, o2::framework::Lifetime::Timeframe); + outputs.emplace_back("TRK", "PATTERNS", iLayer, o2::framework::Lifetime::Timeframe); + outputs.emplace_back("TRK", "CLUSTERSROF", iLayer, o2::framework::Lifetime::Timeframe); + if (useMC) { + outputs.emplace_back("TRK", "CLUSTERSMCTR", iLayer, o2::framework::Lifetime::Timeframe); + } } return o2::framework::DataProcessorSpec{ From dbe199c4765eaaf862553a7807f0df4085e27e9d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 27 Apr 2026 16:56:17 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- .../TRK/base/include/TRKBase/AlmiraParam.h | 8 +- .../TRK/base/include/TRKBase/GeometryTGeo.h | 4 +- .../ALICE3/TRK/base/include/TRKBase/Specs.h | 4 +- .../ALICE3/TRK/macros/test/CheckBandwidth.C | 2 - .../ALICE3/TRK/macros/test/CheckClusters.C | 130 ++++----- .../ALICE3/TRK/macros/test/CheckDigitsTRK.C | 250 +++++++++--------- .../TRK/reconstruction/src/Clusterer.cxx | 1 - .../include/TRKSimulation/DigiParams.h | 2 +- .../include/TRKWorkflow/DigitReaderSpec.h | 14 +- 9 files changed, 206 insertions(+), 209 deletions(-) diff --git a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h index 987b459c04764..9929a14c4e39c 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h +++ b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/AlmiraParam.h @@ -31,10 +31,11 @@ struct AlmiraParam : public o2::conf::ConfigurableParamHelper { int roFrameLengthInBCPerLayer[kNLayers] = {0}; ///< ROF length in BC per layer float strobeDelayPerLayer[kNLayers] = {0}; ///< strobe delay in ns per layer float strobeLengthContPerLayer[kNLayers] = {0}; ///< strobe length in ns per layer - int roFrameBiasInBCPerLayer[kNLayers] = {0}; ///< ROF start bias in BC per layer - int roFrameDelayInBCPerLayer[kNLayers] = {0}; ///< extra ROF delay in BC per layer + int roFrameBiasInBCPerLayer[kNLayers] = {0}; ///< ROF start bias in BC per layer + int roFrameDelayInBCPerLayer[kNLayers] = {0}; ///< extra ROF delay in BC per layer - int getROFLengthInBC(int layer) const { + int getROFLengthInBC(int layer) const + { if (roFrameLengthInBCPerLayer[layer] > 0) { return roFrameLengthInBCPerLayer[layer]; } else { @@ -46,7 +47,6 @@ struct AlmiraParam : public o2::conf::ConfigurableParamHelper { int getROFBiasInBC(int layer) const { return roFrameBiasInBCPerLayer[layer]; } int getROFDelayInBC(int layer) const { return roFrameDelayInBCPerLayer[layer]; } - O2ParamDef(AlmiraParam, "TRKAlmiraParam"); }; diff --git a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h index bfc0b779eb1ca..53ad7662cbfcd 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h +++ b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/GeometryTGeo.h @@ -89,8 +89,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache int getSubDetID(int index) const; int getPetalCase(int index) const; int getDisk(int index) const; - int getLayer(int index) const; ///< local layer index within the sub-detector (0-based per VD/MLOT) - int getLayerTRK(int index) const; ///< global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1) + int getLayer(int index) const; ///< local layer index within the sub-detector (0-based per VD/MLOT) + int getLayerTRK(int index) const; ///< global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1) int getStave(int index) const; int getHalfStave(int index) const; int getModule(int index) const; diff --git a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h index aad9d045ac6f4..6be2e0bd0f827 100644 --- a/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h +++ b/Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h @@ -100,7 +100,7 @@ constexpr int nCols{static_cast(length / chip::pitchZ)}; namespace ML { -constexpr int nLayers{3}; // number of layers in the ML +constexpr int nLayers{3}; // number of layers in the ML constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave // constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave constexpr double length{124 * cm}; // length of the stave, hardcoded to fit the implemented geometry @@ -118,7 +118,7 @@ constexpr double length{258 * cm}; // len constexpr int nRows{static_cast(width / moduleMLOT::chip::pitchX)}; // number of rows in the halfstave constexpr int nCols{static_cast(length / moduleMLOT::chip::pitchZ)}; // number of columns in the halfstave } // namespace halfstave -constexpr int nLayers{5}; // number of layers in the OT +constexpr int nLayers{5}; // number of layers in the OT constexpr double width{halfstave::width * 2}; // width of the stave constexpr double length{halfstave::length}; // length of the stave constexpr int nRows{static_cast(width / moduleMLOT::chip::pitchX)}; // number of rows in the stave diff --git a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckBandwidth.C b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckBandwidth.C index cda07447d58f5..c071a06516d30 100644 --- a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckBandwidth.C +++ b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckBandwidth.C @@ -193,7 +193,6 @@ void CheckBandwidth(std::string digifile = "trkdigits.root", std::string inputGe rofLengthBC[iLayer] = (*rofRecords[iLayer])[1].getBCData().bc - (*rofRecords[iLayer])[0].getBCData().bc; } - // --- Collision context --- TFile* ccFile = TFile::Open(collContextFile.data()); @@ -229,7 +228,6 @@ void CheckBandwidth(std::string digifile = "trkdigits.root", std::string inputGe // --- Accumulate per-chip digit counts across all ROFs --- - std::vector digitsPerChip(nChips, 0ull); std::vector maxDigitsPerROFPerChip(nChips, 0u); std::vector digitsInCurrentROFPerChip(nChips, 0u); diff --git a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C index e822616649942..28dc61aed9c8b 100644 --- a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C +++ b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckClusters.C @@ -312,72 +312,72 @@ void CheckClusters(const std::string& clusfile = "o2clus_trk.root", continue; } - // ── MC label ─────────────────────────────────────────────────────── - const auto& labels = clusLabArr->getLabels(clEntry); - if (labels.empty() || !labels[0].isValid()) { - nInvalidLabel++; - continue; - } - const auto& lab = labels[0]; - const int trID = lab.getTrackID(); - const int evID = lab.getEventID(); - - // ── Find matching MC hit ──────────────────────────────────────────── - const auto& mc2hit = mc2hitVec[evID]; - uint64_t key = (uint64_t(trID) << 32) + cluster.chipID; - auto hitEntry = mc2hit.find(key); - if (hitEntry == mc2hit.end()) { - nNoMCHit++; - continue; - } - const auto& hit = (*hitVecPool[evID])[hitEntry->second]; - const float pt = TMath::Hypot(hit.GetPx(), hit.GetPy()); - - // ── Hit global midpoint ──────────────────────────────────────────── - const auto& gloHend = hit.GetPos(); - const auto& gloHsta = hit.GetPosStart(); - o2::math_utils::Point3D gloHmid( - 0.5f * (gloHend.X() + gloHsta.X()), - 0.5f * (gloHend.Y() + gloHsta.Y()), - 0.5f * (gloHend.Z() + gloHsta.Z())); - - // ── Hit global → local ───────────────────────────── - o2::math_utils::Point3D locHsta = gman->getMatrixL2G(cluster.chipID) ^ (gloHsta); // inverse L2G - o2::math_utils::Point3D locHend = gman->getMatrixL2G(cluster.chipID) ^ (gloHend); // inverse L2G - - // ── Propagate hit segment to the sensor response surface ─────────────── - // Rather than the geometric midpoint, find where the track segment crosses - // the response plane (y = responseYShift in the flat local frame). - // For VD (curved): convert both endpoints to flat frame first. - // For ML/OT (flat): use local coordinates directly. - float hitLocX{0.f}, hitLocZ{0.f}; - if (cluster.subDetID == 0) { // VD – curved sensor - auto flatSta = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHsta.X(), locHsta.Y()); - auto flatEnd = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHend.X(), locHend.Y()); - float x0 = flatSta.X(), y0 = flatSta.Y(), z0 = locHsta.Z(); - float dltx = flatEnd.X() - x0, dlty = flatEnd.Y() - y0, dltz = locHend.Z() - z0; - float r = (std::abs(dlty) > 1e-9f) ? (yPlaneVD - y0) / dlty : 0.5f; - hitLocX = x0 + r * dltx; - hitLocZ = z0 + r * dltz; - } else { // ML/OT – flat sensor - float x0 = locHsta.X(), y0 = locHsta.Y(), z0 = locHsta.Z(); - float dltx = locHend.X() - x0, dlty = locHend.Y() - y0, dltz = locHend.Z() - z0; - float r = (std::abs(dlty) > 1e-9f) ? (yPlaneMLOT - y0) / dlty : 0.5f; - hitLocX = x0 + r * dltx; - hitLocZ = z0 + r * dltz; - } + // ── MC label ─────────────────────────────────────────────────────── + const auto& labels = clusLabArr->getLabels(clEntry); + if (labels.empty() || !labels[0].isValid()) { + nInvalidLabel++; + continue; + } + const auto& lab = labels[0]; + const int trID = lab.getTrackID(); + const int evID = lab.getEventID(); + + // ── Find matching MC hit ──────────────────────────────────────────── + const auto& mc2hit = mc2hitVec[evID]; + uint64_t key = (uint64_t(trID) << 32) + cluster.chipID; + auto hitEntry = mc2hit.find(key); + if (hitEntry == mc2hit.end()) { + nNoMCHit++; + continue; + } + const auto& hit = (*hitVecPool[evID])[hitEntry->second]; + const float pt = TMath::Hypot(hit.GetPx(), hit.GetPy()); + + // ── Hit global midpoint ──────────────────────────────────────────── + const auto& gloHend = hit.GetPos(); + const auto& gloHsta = hit.GetPosStart(); + o2::math_utils::Point3D gloHmid( + 0.5f * (gloHend.X() + gloHsta.X()), + 0.5f * (gloHend.Y() + gloHsta.Y()), + 0.5f * (gloHend.Z() + gloHsta.Z())); + + // ── Hit global → local ───────────────────────────── + o2::math_utils::Point3D locHsta = gman->getMatrixL2G(cluster.chipID) ^ (gloHsta); // inverse L2G + o2::math_utils::Point3D locHend = gman->getMatrixL2G(cluster.chipID) ^ (gloHend); // inverse L2G + + // ── Propagate hit segment to the sensor response surface ─────────────── + // Rather than the geometric midpoint, find where the track segment crosses + // the response plane (y = responseYShift in the flat local frame). + // For VD (curved): convert both endpoints to flat frame first. + // For ML/OT (flat): use local coordinates directly. + float hitLocX{0.f}, hitLocZ{0.f}; + if (cluster.subDetID == 0) { // VD – curved sensor + auto flatSta = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHsta.X(), locHsta.Y()); + auto flatEnd = o2::trk::SegmentationChip::curvedToFlat(cluster.layer, locHend.X(), locHend.Y()); + float x0 = flatSta.X(), y0 = flatSta.Y(), z0 = locHsta.Z(); + float dltx = flatEnd.X() - x0, dlty = flatEnd.Y() - y0, dltz = locHend.Z() - z0; + float r = (std::abs(dlty) > 1e-9f) ? (yPlaneVD - y0) / dlty : 0.5f; + hitLocX = x0 + r * dltx; + hitLocZ = z0 + r * dltz; + } else { // ML/OT – flat sensor + float x0 = locHsta.X(), y0 = locHsta.Y(), z0 = locHsta.Z(); + float dltx = locHend.X() - x0, dlty = locHend.Y() - y0, dltz = locHend.Z() - z0; + float r = (std::abs(dlty) > 1e-9f) ? (yPlaneMLOT - y0) / dlty : 0.5f; + hitLocX = x0 + r * dltx; + hitLocZ = z0 + r * dltz; + } - nValid++; - std::array data = { - (float)evID, (float)trID, - hitLocX, hitLocZ, - (float)gloHmid.X(), (float)gloHmid.Y(), (float)gloHmid.Z(), - (float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(), - clLocX, clLocZ, - (float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID, - (float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID, - (float)cluster.row, (float)cluster.col, pt}; - nt.Fill(data.data()); + nValid++; + std::array data = { + (float)evID, (float)trID, + hitLocX, hitLocZ, + (float)gloHmid.X(), (float)gloHmid.Y(), (float)gloHmid.Z(), + (float)gloC.X(), (float)gloC.Y(), (float)gloC.Z(), + clLocX, clLocZ, + (float)rofRec.getROFrame(), (float)cluster.size, (float)cluster.chipID, + (float)cluster.layer, (float)cluster.disk, (float)cluster.subDetID, + (float)cluster.row, (float)cluster.col, pt}; + nt.Fill(data.data()); } } } diff --git a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigitsTRK.C b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigitsTRK.C index f29a38f554200..400457fc98585 100644 --- a/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigitsTRK.C +++ b/Detectors/Upgrades/ALICE3/TRK/macros/test/CheckDigitsTRK.C @@ -298,131 +298,131 @@ void CheckDigits(std::string digifile = "trkdigits.root", std::string hitfile = } // end loop on layers // digit maps in the xy and yz planes - auto canvXY = new TCanvas("canvXY", "", 1600, 2400); - canvXY->Divide(2, 3); - canvXY->cd(1); - nt->Draw("y:x >>h_y_vs_x_VD(1000, -3, 3, 1000, -3, 3)", "id < 12 ", "colz"); - canvXY->cd(2); - nt->Draw("y:z>>h_y_vs_z_VD(1000, -26, 26, 1000, -3, 3)", "id < 12 ", "colz"); - canvXY->cd(3); - nt->Draw("y:x>>h_y_vs_x_ML(1000, -25, 25, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); - canvXY->cd(4); - nt->Draw("y:z>>h_y_vs_z_ML(1000, -70, 70, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); - canvXY->cd(5); - nt->Draw("y:x>>h_y_vs_x_OT(1000, -85, 85, 1000, -85, 85)", "id >= 5132 ", "colz"); - canvXY->cd(6); - nt->Draw("y:z>>h_y_vs_z_OT(1000, -85, 85, 1000, -130, 130)", "id >= 5132 ", "colz"); - canvXY->SaveAs("trkdigits_y_vs_x_vs_z.pdf"); - - // z distributions - auto canvZ = new TCanvas("canvZ", "", 800, 2400); - canvZ->Divide(1, 3); - canvZ->cd(1); - nt->Draw("z>>h_z_VD(500, -26, 26)", "id < 12 "); - canvZ->cd(2); - nt->Draw("z>>h_z_ML(500, -70, 70)", "id >= 12 && id < 5132 "); - canvZ->cd(3); - nt->Draw("z>>h_z_OT(500, -85, 85)", "id >= 5132 "); - canvZ->SaveAs("trkdigits_z.pdf"); - - // dz distributions (difference between local position of digits and hits in x and z) - auto canvdZ = new TCanvas("canvdZ", "", 800, 2400); - canvdZ->Divide(1, 3); - canvdZ->cd(1); - nt->Draw("dz>>h_dz_VD(500, -0.05, 0.05)", "id < 12 "); - canvdZ->cd(2); - nt->Draw("dz>>h_dz_ML(500, -0.05, 0.05)", "id >= 12 && id < 5132 "); - canvdZ->cd(3); - nt->Draw("dz>>h_dz_OT(500, -0.05, 0.05)", "id >= 5132 "); - canvdZ->SaveAs("trkdigits_dz.pdf"); - canvdZ->SaveAs("trkdigits_dz.root"); - - // distributions of differences between local positions of digits and hits in x and z - auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 2400); - canvdXdZ->Divide(2, 3); - canvdXdZ->cd(1); - nt->Draw("dx:dz>>h_dx_vs_dz_VD(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - auto h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD"); - LOG(info) << "dx, dz"; - Info("VD", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(2); - nt->Draw("dx:dz>>h_dx_vs_dz_VD_z(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12 && abs(z)<0.5", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD_z"); - Info("VD |z|<1", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD |z|<1", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(3); - nt->Draw("dx:dz>>h_dx_vs_dz_ML(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML"); - Info("ML", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(4); - nt->Draw("dx:dz>>h_dx_vs_dz_ML_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML_z"); - Info("ML |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); - canvdXdZ->cd(5); - nt->Draw("dx:dz>>h_dx_vs_dz_OT(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT"); - Info("OT", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->cd(6); - nt->Draw("dx:dz>>h_dx_vs_dz_OT_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); - h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT_z"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - Info("OT |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); - canvdXdZ->SaveAs("trkdigits_dx_vs_dz.root"); - - // distribution of differences between hit start and hit end in local coordinates - auto canvdXdZHit = new TCanvas("canvdXdZHit", "", 1600, 2400); - canvdXdZHit->Divide(2, 3); - canvdXdZHit->cd(1); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - LOG(info) << "dxH, dzH"; - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD"); - Info("VD", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(2); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowVD); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD_z"); - Info("VD |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("VD |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(3); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML"); - Info("ML", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(4); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML_z"); - Info("ML |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("ML |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); - canvdXdZHit->cd(5); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT"); - Info("OT", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->cd(6); - nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); - addTLines(o2::trk::SegmentationChip::PitchRowMLOT); - h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT_z"); - Info("OT |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); - Info("OT |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); - canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); + auto canvXY = new TCanvas("canvXY", "", 1600, 2400); + canvXY->Divide(2, 3); + canvXY->cd(1); + nt->Draw("y:x >>h_y_vs_x_VD(1000, -3, 3, 1000, -3, 3)", "id < 12 ", "colz"); + canvXY->cd(2); + nt->Draw("y:z>>h_y_vs_z_VD(1000, -26, 26, 1000, -3, 3)", "id < 12 ", "colz"); + canvXY->cd(3); + nt->Draw("y:x>>h_y_vs_x_ML(1000, -25, 25, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); + canvXY->cd(4); + nt->Draw("y:z>>h_y_vs_z_ML(1000, -70, 70, 1000, -25, 25)", "id >= 12 && id < 5132 ", "colz"); + canvXY->cd(5); + nt->Draw("y:x>>h_y_vs_x_OT(1000, -85, 85, 1000, -85, 85)", "id >= 5132 ", "colz"); + canvXY->cd(6); + nt->Draw("y:z>>h_y_vs_z_OT(1000, -85, 85, 1000, -130, 130)", "id >= 5132 ", "colz"); + canvXY->SaveAs("trkdigits_y_vs_x_vs_z.pdf"); + + // z distributions + auto canvZ = new TCanvas("canvZ", "", 800, 2400); + canvZ->Divide(1, 3); + canvZ->cd(1); + nt->Draw("z>>h_z_VD(500, -26, 26)", "id < 12 "); + canvZ->cd(2); + nt->Draw("z>>h_z_ML(500, -70, 70)", "id >= 12 && id < 5132 "); + canvZ->cd(3); + nt->Draw("z>>h_z_OT(500, -85, 85)", "id >= 5132 "); + canvZ->SaveAs("trkdigits_z.pdf"); + + // dz distributions (difference between local position of digits and hits in x and z) + auto canvdZ = new TCanvas("canvdZ", "", 800, 2400); + canvdZ->Divide(1, 3); + canvdZ->cd(1); + nt->Draw("dz>>h_dz_VD(500, -0.05, 0.05)", "id < 12 "); + canvdZ->cd(2); + nt->Draw("dz>>h_dz_ML(500, -0.05, 0.05)", "id >= 12 && id < 5132 "); + canvdZ->cd(3); + nt->Draw("dz>>h_dz_OT(500, -0.05, 0.05)", "id >= 5132 "); + canvdZ->SaveAs("trkdigits_dz.pdf"); + canvdZ->SaveAs("trkdigits_dz.root"); + + // distributions of differences between local positions of digits and hits in x and z + auto canvdXdZ = new TCanvas("canvdXdZ", "", 1600, 2400); + canvdXdZ->Divide(2, 3); + canvdXdZ->cd(1); + nt->Draw("dx:dz>>h_dx_vs_dz_VD(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowVD); + auto h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD"); + LOG(info) << "dx, dz"; + Info("VD", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("VD", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->cd(2); + nt->Draw("dx:dz>>h_dx_vs_dz_VD_z(500, -0.005, 0.005, 500, -0.005, 0.005)", "id < 12 && abs(z)<0.5", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowVD); + h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_VD_z"); + Info("VD |z|<1", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("VD |z|<1", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->cd(3); + nt->Draw("dx:dz>>h_dx_vs_dz_ML(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML"); + Info("ML", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("ML", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->cd(4); + nt->Draw("dx:dz>>h_dx_vs_dz_ML_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_ML_z"); + Info("ML |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("ML |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); + canvdXdZ->cd(5); + nt->Draw("dx:dz>>h_dx_vs_dz_OT(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT"); + Info("OT", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("OT", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->cd(6); + nt->Draw("dx:dz>>h_dx_vs_dz_OT_z(600, -0.03, 0.03, 600, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); + h = (TH2F*)gPad->GetPrimitive("h_dx_vs_dz_OT_z"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + Info("OT |z|<2", "RMS(dx)=%.1f mu", h->GetRMS(2) * 1e4); + Info("OT |z|<2", "RMS(dz)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZ->SaveAs("trkdigits_dx_vs_dz.pdf"); + canvdXdZ->SaveAs("trkdigits_dx_vs_dz.root"); + + // distribution of differences between hit start and hit end in local coordinates + auto canvdXdZHit = new TCanvas("canvdXdZHit", "", 1600, 2400); + canvdXdZHit->Divide(2, 3); + canvdXdZHit->cd(1); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowVD); + LOG(info) << "dxH, dzH"; + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD"); + Info("VD", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("VD", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->cd(2); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_VD_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id < 12 && abs(z)<2", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowVD); + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_VD_z"); + Info("VD |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("VD |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->cd(3); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML"); + Info("ML", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("ML", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->cd(4); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_ML_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 12 && id < 5132 && abs(z)<2", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_ML_z"); + Info("ML |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("ML |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); + canvdXdZHit->cd(5); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT"); + Info("OT", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("OT", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->cd(6); + nt2->Draw("dxH:dzH>>h_dxH_vs_dzH_OT_z(300, -0.03, 0.03, 300, -0.03, 0.03)", "id >= 5132 && abs(z)<2", "colz"); + addTLines(o2::trk::SegmentationChip::PitchRowMLOT); + h = (TH2F*)gPad->GetPrimitive("h_dxH_vs_dzH_OT_z"); + Info("OT |z|<2", "RMS(dxH)=%.1f mu", h->GetRMS(2) * 1e4); + Info("OT |z|<2", "RMS(dzH)=%.1f mu", h->GetRMS(1) * 1e4); + canvdXdZHit->SaveAs("trkdigits_dxH_vs_dzH.pdf"); f->Write(); f->Close(); diff --git a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx index b7d71f98bacb6..e0d689e4db5ed 100644 --- a/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx +++ b/Detectors/Upgrades/ALICE3/TRK/reconstruction/src/Clusterer.cxx @@ -79,7 +79,6 @@ void Clusterer::process(gsl::span digits, clusterROFs.emplace_back(inROF.getBCData(), inROF.getROFrame(), outFirst, static_cast(clusters.size()) - outFirst); } - } //__________________________________________________ diff --git a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h index 0253f8bf2bb5d..d7d1ea28bfcf7 100644 --- a/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h +++ b/Detectors/Upgrades/ALICE3/TRK/simulation/include/TRKSimulation/DigiParams.h @@ -126,7 +126,7 @@ class DigiParams std::unique_ptr mResponse; //!< pointer on external response // auxiliary precalculated parameters - std::array mROFrameLayerLengthInv; ///< inverse length of RO frame in ns per layer + std::array mROFrameLayerLengthInv; ///< inverse length of RO frame in ns per layer // ClassDef(DigiParams, 2); }; diff --git a/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/DigitReaderSpec.h b/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/DigitReaderSpec.h index 4acea7bd74914..92b64e0815cfb 100644 --- a/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/DigitReaderSpec.h +++ b/Detectors/Upgrades/ALICE3/TRK/workflow/include/TRKWorkflow/DigitReaderSpec.h @@ -45,16 +45,16 @@ class DigitReader : public Task protected: void connectTree(const std::string& filename); - template - void setBranchAddress(const std::string& base, Ptr& addr, int layer = -1); - std::string getBranchName(const std::string& base, int index) const; + template + void setBranchAddress(const std::string& base, Ptr& addr, int layer = -1); + std::string getBranchName(const std::string& base, int index) const; - static constexpr int mLayers = o2::trk::AlmiraParam::kNLayers; + static constexpr int mLayers = o2::trk::AlmiraParam::kNLayers; - std::vector*> mDigits{nullptr}; + std::vector*> mDigits{nullptr}; std::vector mCalib, *mCalibPtr = &mCalib; - std::vector*> mDigROFRec{nullptr}; - std::vector mPLabels{nullptr}; + std::vector*> mDigROFRec{nullptr}; + std::vector mPLabels{nullptr}; o2::header::DataOrigin mOrigin = o2::header::gDataOriginInvalid;