Skip to content

Commit 1b29528

Browse files
committed
Use digits span instead of a vector in the TPC tracking
1 parent 889bfc5 commit 1b29528

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Detectors/TPC/reconstruction/src/GPUCATracking.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data)
9393
ptrs.clustersNative = nullptr;
9494
const float zsThreshold = mTrackingCAO2Interface->getConfig().configReconstruction.tpcZSthreshold;
9595
for (int i = 0; i < Sector::MAXSECTOR; i++) {
96-
const std::vector<o2::tpc::Digit>& d = (*(data->o2Digits))[i];
96+
const auto& d = (*(data->o2Digits))[i];
9797
gpuDigits[i].reserve(d.size());
9898
gpuDigitsMap.tpcDigits[i] = gpuDigits[i].data();
9999
for (int j = 0; j < d.size(); j++) {

Detectors/TPC/workflow/src/CATrackerSpec.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ DataProcessorSpec getCATrackerSpec(bool processMC, bool caClusterer, std::vector
266266
// FIXME cleanup almost duplicated code
267267
auto& validMcInputs = processAttributes->validMcInputs;
268268
auto& mcInputs = processAttributes->mcInputs;
269-
std::array<std::vector<o2::tpc::Digit>, NSectors> inputDigits;
269+
std::array<gsl::span<const o2::tpc::Digit>, NSectors> inputDigits;
270270
std::array<std::unique_ptr<const MCLabelContainer>, NSectors> inputDigitsMC;
271271
if (processMC) {
272272
// we can later extend this to multiple inputs
@@ -343,7 +343,8 @@ DataProcessorSpec getCATrackerSpec(bool processMC, bool caClusterer, std::vector
343343
validInputs.set(sector);
344344
datarefs[sector] = ref;
345345
if (caClusterer) {
346-
inputDigits[sector] = std::move(pc.inputs().get<const std::vector<o2::tpc::Digit>>(inputLabel));
346+
inputDigits[sector] = pc.inputs().get<gsl::span<o2::tpc::Digit>>(inputLabel);
347+
LOG(INFO) << "GOT SPAN FOR SECTOR " << sector << " -> " << inputDigits[sector].size();
347348
}
348349
}
349350

GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <memory>
2828
#include <array>
2929
#include <vector>
30+
#include <gsl/gsl>
3031
#include "GPUSettings.h"
3132
#include "GPUDisplayConfig.h"
3233
#include "GPUQAConfig.h"
@@ -82,7 +83,7 @@ struct GPUO2InterfaceConfiguration {
8283
struct GPUO2InterfaceIOPtrs {
8384
// Input: TPC clusters in cluster native format, or digits, or list of ZS pages - const as it can only be input
8485
const o2::tpc::ClusterNativeAccess* clusters = nullptr;
85-
const std::array<std::vector<o2::tpc::Digit>, o2::tpc::Constants::MAXSECTOR>* o2Digits = nullptr;
86+
const std::array<gsl::span<const o2::tpc::Digit>, o2::tpc::Constants::MAXSECTOR>* o2Digits = nullptr;
8687
std::array<std::unique_ptr<const o2::dataformats::MCTruthContainer<o2::MCCompLabel>>, o2::tpc::Constants::MAXSECTOR>* o2DigitsMC = nullptr;
8788
const o2::gpu::GPUTrackingInOutZS* tpcZS = nullptr;
8889

0 commit comments

Comments
 (0)