Skip to content

Commit 6c7865c

Browse files
committed
Use vector as TPC tracks MCLabels instead of MCTruthContainer
1 parent 3131e83 commit 6c7865c

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎Detectors/TPC/reconstruction/src/GPUCATracking.cxx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs*
7272

7373
std::vector<TrackTPC>* outputTracks = data->outputTracks;
7474
std::vector<uint32_t>* outClusRefs = data->outputClusRefs;
75-
MCLabelContainer* outputTracksMCTruth = data->outputTracksMCTruth;
75+
std::vector<o2::MCCompLabel>* outputTracksMCTruth = data->outputTracksMCTruth;
7676

7777
if (!outputTracks || !outClusRefs) {
7878
LOG(ERROR) << "Output tracks or clusRefs vectors are not initialized";
@@ -288,7 +288,7 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs*
288288
}
289289
if (outputTracksMCTruth) {
290290
if (labels.size() == 0) {
291-
outputTracksMCTruth->addElement(iTmp, MCCompLabel()); //default constructor creates NotSet label
291+
outputTracksMCTruth->emplace_back(); //default constructor creates NotSet label
292292
} else {
293293
int bestLabelNum = 0, bestLabelCount = 0;
294294
for (int j = 0; j < labels.size(); j++) {
@@ -301,7 +301,7 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs*
301301
if (bestLabelCount < (1.f - sTrackMCMaxFake) * nOutCl) {
302302
bestLabel.setFakeFlag();
303303
}
304-
outputTracksMCTruth->addElement(iTmp, bestLabel);
304+
outputTracksMCTruth->emplace_back(bestLabel);
305305
}
306306
}
307307
}

‎Detectors/TPC/workflow/include/TPCWorkflow/TrackReaderSpec.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class TrackReader : public Task
4545

4646
std::vector<o2::tpc::TrackTPC>*mTracksInp = nullptr, mTracksOut;
4747
std::vector<o2::tpc::TPCClRefElem>*mCluRefVecInp = nullptr, mCluRefVecOut;
48-
o2::dataformats::MCTruthContainer<o2::MCCompLabel>*mMCTruthInp = nullptr, mMCTruthOut;
48+
std::vector<o2::MCCompLabel>*mMCTruthInp = nullptr, mMCTruthOut;
4949

5050
std::unique_ptr<TFile> mFile;
5151
std::unique_ptr<TTree> mTree;

‎Detectors/TPC/workflow/src/CATrackerSpec.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ DataProcessorSpec getCATrackerSpec(ca::Config const& specconfig, std::vector<int
539539

540540
std::vector<TrackTPC> tracks;
541541
std::vector<uint32_t> clusRefs;
542-
MCLabelContainer tracksMCTruth;
542+
std::vector<o2::MCCompLabel> tracksMCTruth;
543543
GPUO2InterfaceIOPtrs ptrs;
544544
ClusterNativeAccess clusterIndex;
545545
std::unique_ptr<ClusterNative[]> clusterBuffer;
@@ -637,7 +637,7 @@ DataProcessorSpec getCATrackerSpec(ca::Config const& specconfig, std::vector<int
637637
pc.outputs().snapshot(OutputRef{"outTracks"}, tracks);
638638
pc.outputs().snapshot(OutputRef{"outClusRefs"}, clusRefs);
639639
if (specconfig.processMC) {
640-
LOG(INFO) << "sending " << tracksMCTruth.getIndexedSize() << " track label(s)";
640+
LOG(INFO) << "sending " << tracksMCTruth.size() << " track label(s)";
641641
pc.outputs().snapshot(OutputRef{"mclblout"}, tracksMCTruth);
642642
}
643643
}

‎Detectors/TPC/workflow/src/RecoWorkflow.cxx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ framework::WorkflowSpec getWorkflow(std::vector<int> const& tpcSectors, std::vec
444444

445445
using ClusRefsOutputType = std::vector<o2::tpc::TPCClRefElem>;
446446

447-
using MCLabelContainer = o2::dataformats::MCTruthContainer<o2::MCCompLabel>;
447+
using MCLabelContainer = std::vector<o2::MCCompLabel>;
448448
// a spectator callback which will be invoked by the tree writer with the extracted object
449449
// we are using it for printing a log message
450450
auto logger = BranchDefinition<TrackOutputType>::Spectator([](TrackOutputType const& tracks) {

‎Detectors/TPC/workflow/src/TrackReaderSpec.cxx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void TrackReader::accumulate(int from, int n)
6060
mTracksOut.swap(*mTracksInp);
6161
mCluRefVecOut.swap(*mCluRefVecInp);
6262
if (mUseMC) {
63-
mMCTruthOut.mergeAtBack(*mMCTruthInp);
63+
std::copy(mMCTruthInp->begin(), mMCTruthInp->end(), std::back_inserter(mMCTruthOut));
6464
}
6565
} else {
6666
for (int iev = 0; iev < n; iev++) {
@@ -83,7 +83,7 @@ void TrackReader::accumulate(int from, int n)
8383
std::copy(tr0, tr1, std::back_inserter(mTracksOut));
8484
// MC
8585
if (mUseMC) {
86-
mMCTruthOut.mergeAtBack(*mMCTruthInp);
86+
std::copy(mMCTruthInp->begin(), mMCTruthInp->end(), std::back_inserter(mMCTruthOut));
8787
}
8888
}
8989
}

‎GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ struct GPUO2InterfaceIOPtrs {
114114
// Input / Output for Merged TPC tracks, two ptrs, for the tracks themselves, and for the MC labels.
115115
std::vector<o2::tpc::TrackTPC>* outputTracks = nullptr;
116116
std::vector<uint32_t>* outputClusRefs = nullptr;
117-
o2::dataformats::MCTruthContainer<o2::MCCompLabel>* outputTracksMCTruth = nullptr;
117+
std::vector<o2::MCCompLabel>* outputTracksMCTruth = nullptr;
118118

119119
// Output for entropy-reduced clusters of TPC compression
120120
const o2::tpc::CompressedClustersFlat* compressedClusters = nullptr;

0 commit comments

Comments
 (0)