Skip to content

Commit

Permalink
Halves the memory allocations in the TPCITS matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf committed Oct 10, 2023
1 parent facbf10 commit 0ed28b5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
42 changes: 36 additions & 6 deletions Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,42 @@ class MatchTPCITS
void printCandidatesTPC() const;
void printCandidatesITS() const;

const std::vector<o2::dataformats::TrackTPCITS>& getMatchedTracks() const { return mMatchedTracks; }
const MCLabContTr& getMatchLabels() const { return mOutLabels; }
const MCLabContTr& getABTrackletLabels() const { return mABTrackletLabels; }
const std::vector<int>& getABTrackletClusterIDs() const { return mABTrackletClusterIDs; }
const std::vector<o2::itsmft::TrkClusRef>& getABTrackletRefs() const { return mABTrackletRefs; }
const std::vector<VDTriplet>& getTglITSTPC() const { return mTglITSTPC; }
[[nodiscard]] const std::vector<o2::dataformats::TrackTPCITS>& getMatchedTracks() const { return mMatchedTracks; }
void resetMatchedTracks()
{
mMatchedTracks.clear();
mMatchedTracks.shrink_to_fit();
}
[[nodiscard]] const MCLabContTr& getMatchLabels() const { return mOutLabels; }
void resetMatchLabels()
{
mOutLabels.clear();
mOutLabels.shrink_to_fit();
}
[[nodiscard]] const MCLabContTr& getABTrackletLabels() const { return mABTrackletLabels; }
void resetABTrackletLabels()
{
mABTrackletLabels.clear();
mABTrackletLabels.shrink_to_fit();
}
[[nodiscard]] const std::vector<int>& getABTrackletClusterIDs() const { return mABTrackletClusterIDs; }
void resetABTrackletClusterIDs()
{
mABTrackletClusterIDs.clear();
mABTrackletClusterIDs.shrink_to_fit();
}
[[nodiscard]] const std::vector<o2::itsmft::TrkClusRef>& getABTrackletRefs() const { return mABTrackletRefs; }
void resetABTrackletRefs()
{
mABTrackletRefs.clear();
mABTrackletRefs.shrink_to_fit();
}
[[nodiscard]] const std::vector<VDTriplet>& getTglITSTPC() const { return mTglITSTPC; }
void resetTglITSTPC()
{
mTglITSTPC.clear();
mTglITSTPC.shrink_to_fit();
}

//>>> ====================== options =============================>>>
void setUseMatCorrFlag(MatCorrType f) { mUseMatCorrFlag = f; }
Expand Down
6 changes: 6 additions & 0 deletions Detectors/GlobalTrackingWorkflow/src/TPCITSMatchingSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,21 @@ void TPCITSMatchingDPL::run(ProcessingContext& pc)
mMatching.run(recoData);

pc.outputs().snapshot(Output{"GLO", "TPCITS", 0, Lifetime::Timeframe}, mMatching.getMatchedTracks());
mMatching.resetMatchedTracks();
pc.outputs().snapshot(Output{"GLO", "TPCITSAB_REFS", 0, Lifetime::Timeframe}, mMatching.getABTrackletRefs());
mMatching.resetABTrackletRefs();
pc.outputs().snapshot(Output{"GLO", "TPCITSAB_CLID", 0, Lifetime::Timeframe}, mMatching.getABTrackletClusterIDs());
mMatching.resetABTrackletClusterIDs();
if (mUseMC) {
pc.outputs().snapshot(Output{"GLO", "TPCITS_MC", 0, Lifetime::Timeframe}, mMatching.getMatchLabels());
mMatching.resetMatchLabels();
pc.outputs().snapshot(Output{"GLO", "TPCITSAB_MC", 0, Lifetime::Timeframe}, mMatching.getABTrackletLabels());
mMatching.resetABTrackletLabels();
}

if (mCalibMode) {
pc.outputs().snapshot(Output{"GLO", "TPCITS_VDTGL", 0, Lifetime::Timeframe}, mMatching.getTglITSTPC());
mMatching.resetTglITSTPC();
}
mTimer.Stop();
}
Expand Down

0 comments on commit 0ed28b5

Please sign in to comment.