Skip to content

Commit

Permalink
Move MatchTPCITS to deque
Browse files Browse the repository at this point in the history
Reduce memory overhead due to unreserved emplace_back.
  • Loading branch information
ktf committed Oct 10, 2023
1 parent 8634e15 commit 4e3f4e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 10 additions & 10 deletions Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ 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::deque<o2::dataformats::TrackTPCITS>& getMatchedTracks() const { return mMatchedTracks; }
[[nodiscard]] const MCLabContTr& getMatchLabels() const { return mOutLabels; }
[[nodiscard]] const MCLabContTr& getABTrackletLabels() const { return mABTrackletLabels; }
[[nodiscard]] const std::deque<int>& getABTrackletClusterIDs() const { return mABTrackletClusterIDs; }
[[nodiscard]] const std::deque<o2::itsmft::TrkClusRef>& getABTrackletRefs() const { return mABTrackletRefs; }
[[nodiscard]] const std::deque<VDTriplet>& getTglITSTPC() const { return mTglITSTPC; }

//>>> ====================== options =============================>>>
void setUseMatCorrFlag(MatCorrType f) { mUseMatCorrFlag = f; }
Expand Down Expand Up @@ -630,8 +630,8 @@ class MatchTPCITS
///< indices of selected track entries in mTPCWork (for tracks selected by AfterBurner)
std::vector<int> mTPCABIndexCache;
std::vector<int> mABWinnersIDs;
std::vector<int> mABTrackletClusterIDs; ///< IDs of ITS clusters for AfterBurner winners
std::vector<o2::itsmft::TrkClusRef> mABTrackletRefs; ///< references on AfterBurner winners clusters
std::deque<int> mABTrackletClusterIDs; ///< IDs of ITS clusters for AfterBurner winners
std::deque<o2::itsmft::TrkClusRef> mABTrackletRefs; ///< references on AfterBurner winners clusters
std::vector<int> mABClusterLinkIndex; ///< index of 1st ABClusterLink for every cluster used by AfterBurner, -1: unused, -10: used by external ITS tracks
MCLabContTr mABTrackletLabels;
// ------------------------------
Expand All @@ -650,11 +650,11 @@ class MatchTPCITS
std::vector<int> mITSTrackROFContMapping;

///< outputs tracks container
std::vector<o2::dataformats::TrackTPCITS> mMatchedTracks;
std::deque<o2::dataformats::TrackTPCITS> mMatchedTracks;
MCLabContTr mOutLabels; ///< Labels: = TPC labels with flag isFake set in case of fake matching

///< container for <tglITS, tglTPC, dT> for vdrift calibration
std::vector<VDTriplet> mTglITSTPC;
std::deque<VDTriplet> mTglITSTPC;

o2::its::RecoGeomHelper mRGHelper; ///< helper for cluster and geometry access

Expand Down
2 changes: 0 additions & 2 deletions Detectors/GlobalTracking/src/MatchTPCITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1792,8 +1792,6 @@ void MatchTPCITS::runAfterBurner()
//______________________________________________
void MatchTPCITS::refitABWinners()
{
mABTrackletClusterIDs.reserve(mABWinnersIDs.size() * (o2::its::RecoGeomHelper::getNLayers() - mParams->lowestLayerAB));
mABTrackletRefs.reserve(mABWinnersIDs.size());
if (mMCTruthON) {
mABTrackletLabels.reserve(mABWinnersIDs.size());
}
Expand Down

0 comments on commit 4e3f4e3

Please sign in to comment.