From 62ee6977c4fc214b220e4386f426c5c337f7dfa3 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Thu, 17 Jul 2025 10:24:53 +0200 Subject: [PATCH 1/3] ITS: add cont. lbls to output only if needed Signed-off-by: Felix Schlepper --- Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx index c8a785b6a3627..c825ec39d3499 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx @@ -15,6 +15,7 @@ #include "Framework/ConfigParamRegistry.h" #include "Framework/CCDBParamSpec.h" #include "ITSWorkflow/TrackerSpec.h" +#include "ITStracking/TrackingConfigParam.h" namespace o2 { @@ -120,10 +121,12 @@ DataProcessorSpec getTrackerSpec(bool useMC, bool useGeom, int trgType, Tracking inputs.emplace_back("itsmclabels", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe); inputs.emplace_back("ITSMC2ROframes", "ITS", "CLUSTERSMC2ROF", 0, Lifetime::Timeframe); outputs.emplace_back("ITS", "VERTICESMCTR", 0, Lifetime::Timeframe); - outputs.emplace_back("ITS", "VERTICESMCTRCONT", 0, Lifetime::Timeframe); outputs.emplace_back("ITS", "VERTICESMCPUR", 0, Lifetime::Timeframe); outputs.emplace_back("ITS", "TRACKSMCTR", 0, Lifetime::Timeframe); outputs.emplace_back("ITS", "ITSTrackMC2ROF", 0, Lifetime::Timeframe); + if (VertexerParamConfig::Instance().outputContLabels) { + outputs.emplace_back("ITS", "VERTICESMCTRCONT", 0, Lifetime::Timeframe); + } } return DataProcessorSpec{ From ec61534c0f49d621682814f1499d4114b094d69a Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Mon, 21 Jul 2025 15:45:25 +0200 Subject: [PATCH 2/3] ITS: fix truth seeding if firstOrbit is not 0 Signed-off-by: Felix Schlepper --- Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx b/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx index 409ce8895aa36..537896efbed94 100644 --- a/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx +++ b/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx @@ -25,6 +25,7 @@ #include "SimulationDataFormat/DigitizationContext.h" #include "Steer/MCKinematicsReader.h" #include "ITSMFTBase/DPLAlpideParam.h" +#include "DetectorsRaw/HBFUtils.h" #ifdef VTX_DEBUG #include "TTree.h" @@ -581,7 +582,7 @@ void VertexerTraits::addTruthSeedingVertices() const auto& ir = irs[eveId2colId[iEve]]; if (!ir.isDummy()) { // do we need this, is this for diffractive events? const auto& eve = mcReader.getMCEventHeader(iSrc, iEve); - int rofId = (ir.toLong() - roFrameBiasInBC) / roFrameLengthInBC; + int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC; if (!vertices.contains(rofId)) { vertices[rofId] = bounded_vector(mMemoryPool.get()); } From be6caa5060cd0e4c2f24e32396bd51fe46a1c629 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Fri, 18 Jul 2025 11:47:01 +0200 Subject: [PATCH 3/3] ITS: truth seeding fill labels Signed-off-by: Felix Schlepper --- .../ITS/tracking/src/VertexerTraits.cxx | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx b/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx index 537896efbed94..1069f1808fb2a 100644 --- a/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx +++ b/Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx @@ -575,7 +575,12 @@ void VertexerTraits::addTruthSeedingVertices() int64_t roFrameBiasInBC = o2::itsmft::DPLAlpideParam::Instance().roFrameBiasInBC; int64_t roFrameLengthInBC = o2::itsmft::DPLAlpideParam::Instance().roFrameLengthInBC; o2::steer::MCKinematicsReader mcReader(dc); - std::map> vertices; + struct VertInfo { + bounded_vector vertices; + bounded_vector srcs; + bounded_vector events; + }; + std::map vertices; for (int iSrc{0}; iSrc < mcReader.getNSources(); ++iSrc) { auto eveId2colId = dc->getCollisionIndicesForSource(iSrc); for (int iEve{0}; iEve < mcReader.getNEvents(iSrc); ++iEve) { @@ -584,7 +589,11 @@ void VertexerTraits::addTruthSeedingVertices() const auto& eve = mcReader.getMCEventHeader(iSrc, iEve); int rofId = ((ir - raw::HBFUtils::Instance().getFirstSampledTFIR()).toLong() - roFrameBiasInBC) / roFrameLengthInBC; if (!vertices.contains(rofId)) { - vertices[rofId] = bounded_vector(mMemoryPool.get()); + vertices[rofId] = { + .vertices = bounded_vector(mMemoryPool.get()), + .srcs = bounded_vector(mMemoryPool.get()), + .events = bounded_vector(mMemoryPool.get()), + }; } Vertex vert; vert.setTimeStamp(rofId); @@ -595,7 +604,9 @@ void VertexerTraits::addTruthSeedingVertices() vert.setChi2(1); constexpr float cov = 50e-9; vert.setCov(cov, cov, cov, cov, cov, cov); - vertices[rofId].push_back(vert); + vertices[rofId].vertices.push_back(vert); + vertices[rofId].srcs.push_back(iSrc); + vertices[rofId].events.push_back(iEve); } } } @@ -604,10 +615,11 @@ void VertexerTraits::addTruthSeedingVertices() bounded_vector verts(mMemoryPool.get()); bounded_vector> polls(mMemoryPool.get()); if (vertices.contains(iROF)) { - verts = vertices[iROF]; + const auto& vertInfo = vertices[iROF]; + verts = vertInfo.vertices; nVerts += verts.size(); for (size_t i{0}; i < verts.size(); ++i) { - o2::MCCompLabel lbl; // unset label for now + o2::MCCompLabel lbl(o2::MCCompLabel::maxTrackID(), vertInfo.events[i], vertInfo.srcs[i], false); polls.emplace_back(lbl, 1.f); } } else {