Skip to content

Commit 736f443

Browse files
noferinishahor02
authored andcommitted
TOF matching multi-threaded
1 parent 0da03c5 commit 736f443

5 files changed

Lines changed: 302 additions & 148 deletions

File tree

Detectors/GlobalTracking/include/GlobalTracking/MatchTOF.h

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,14 @@ class MatchTOF
201201

202202
void storeMatchable(bool val = true) { mStoreMatchable = val; }
203203

204+
void setNlanes(int lanes) { mNlanes = lanes; }
205+
204206
private:
205207
bool prepareFITData();
206208
int prepareInteractionTimes();
207209
bool prepareTPCData();
210+
void propagateTPCTracks(int sec);
211+
void propagateConstrTracks(int sec);
208212
void addTPCSeed(const o2::tpc::TrackTPC& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
209213
void addITSTPCSeed(const o2::dataformats::TrackTPCITS& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
210214
void addTRDSeed(const o2::trd::TrackTRD& _tr, o2::dataformats::GlobalTrackID srcGID, float time0, float terr);
@@ -215,7 +219,7 @@ class MatchTOF
215219

216220
void doMatching(int sec);
217221
void doMatchingForTPC(int sec);
218-
void selectBestMatches();
222+
void selectBestMatches(int sec);
219223
void BestMatches(std::vector<o2::dataformats::MatchInfoTOFReco>& matchedTracksPairs, std::vector<o2::dataformats::MatchInfoTOF>* matchedTracks, std::vector<int>* matchedTracksIndex, int* matchedClustersIndex, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, const std::vector<Cluster>& TOFClusWork, const std::vector<matchTrack>* TracksWork, std::vector<o2::dataformats::CalibInfoTOF>& CalibInfoTOF, unsigned long Timestamp, bool MCTruthON, const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* TOFClusLabels, const std::vector<o2::MCCompLabel>* TracksLblWork, std::vector<o2::MCCompLabel>* OutTOFLabels, float calibMaxChi2);
220224
void BestMatchesHP(std::vector<o2::dataformats::MatchInfoTOFReco>& matchedTracksPairs, std::vector<o2::dataformats::MatchInfoTOF>* matchedTracks, std::vector<int>* matchedTracksIndex, int* matchedClustersIndex, const gsl::span<const o2::ft0::RecPoints>& FITRecPoints, const std::vector<Cluster>& TOFClusWork, std::vector<o2::dataformats::CalibInfoTOF>& CalibInfoTOF, unsigned long Timestamp, bool MCTruthON, const o2::dataformats::MCTruthContainer<o2::MCCompLabel>* TOFClusLabels, const std::vector<o2::MCCompLabel>* TracksLblWork, std::vector<o2::MCCompLabel>* OutTOFLabels);
221225
bool propagateToRefX(o2::track::TrackParCov& trc, float xRef /*in cm*/, float stepInCm /*in cm*/, o2::track::TrackLTIntegral& intLT);
@@ -232,6 +236,8 @@ class MatchTOF
232236
const o2::globaltracking::RecoContainer* mRecoCont = nullptr;
233237
o2::InteractionRecord mStartIR{0, 0}; ///< IR corresponding to the start of the TF
234238

239+
int mNlanes = 3; ///< for multi-threading in matching
240+
235241
// TOF matching params (work in progress)
236242
const MatchTOFParams* mMatchParams = nullptr;
237243

@@ -299,22 +305,22 @@ class MatchTOF
299305
/// <<<-----
300306

301307
///<working copy of the input tracks
302-
std::vector<matchTrack> mTracksWork[trkType::SIZE]; ///<track params prepared for matching + time value
303-
std::vector<o2::MCCompLabel> mTracksLblWork[trkType::SIZE]; ///<TPCITS track labels
304-
std::vector<o2::track::TrackLTIntegral> mLTinfos[trkType::SIZE]; ///<expected times and others
305-
std::vector<o2::dataformats::GlobalTrackID> mTrackGid[trkType::SIZE]; ///<expected times and others
308+
std::vector<matchTrack> mTracksWork[o2::constants::math::NSectors][trkType::SIZE]; ///< track params prepared for matching + time value
309+
std::vector<o2::MCCompLabel> mTracksLblWork[o2::constants::math::NSectors][trkType::SIZE]; ///< TPCITS track labels
310+
std::vector<o2::track::TrackLTIntegral> mLTinfos[o2::constants::math::NSectors][trkType::SIZE]; ///< expected times and others
311+
std::vector<o2::dataformats::GlobalTrackID> mTrackGid[o2::constants::math::NSectors][trkType::SIZE]; ///< expected times and others
306312
///< per sector indices of track entry in mTracksWork
307313
std::array<std::vector<int>, o2::constants::math::NSectors> mTracksSectIndexCache[trkType::SIZE];
314+
std::array<std::vector<int>, o2::constants::math::NSectors> mTracksSeed[trkType::SIZE];
308315

309-
std::vector<float> mExtraTPCFwdTime; ///<track extra params for TPC tracks: Fws Max time
310-
std::vector<Cluster> mTOFClusWork; ///<track params prepared for matching
311-
std::vector<int8_t> mSideTPC; ///<track side for TPC tracks
316+
std::vector<float> mExtraTPCFwdTime[o2::constants::math::NSectors]; ///< track extra params for TPC tracks: Fws Max time
317+
std::vector<Cluster> mTOFClusWork; ///< track params prepared for matching
318+
std::vector<int8_t> mSideTPC[o2::constants::math::NSectors]; ///< track side for TPC tracks
312319

313320
///< per sector indices of TOF cluster entry in mTOFClusWork
314321
std::array<std::vector<int>, o2::constants::math::NSectors> mTOFClusSectIndexCache;
315322

316-
///<array of track-TOFCluster pairs from the matching
317-
std::vector<o2::dataformats::MatchInfoTOFReco> mMatchedTracksPairs;
323+
///< array of track-TOFCluster pairs from the matching
318324
std::vector<o2::dataformats::MatchInfoTOFReco> mMatchedTracksPairsSec[o2::constants::math::NSectors];
319325

320326
///<array of TOFChannel calibration info
@@ -325,7 +331,7 @@ class MatchTOF
325331
std::vector<o2::dataformats::MatchInfoTOF> mMatchedTracks[trkType::SIZEALL]; // this is the output of the matching -> UNCONS, CONSTR
326332
std::vector<o2::MCCompLabel> mOutTOFLabels[trkType::SIZEALL]; ///< TOF label of matched tracks
327333

328-
std::vector<int> mMatchedTracksIndex[trkType::SIZE]; // vector of indexes of the tracks to be matched
334+
std::vector<int> mMatchedTracksIndex[o2::constants::math::NSectors][trkType::SIZE]; // vector of indexes of the tracks to be matched
329335

330336
int mNumOfClusters; // number of clusters to be matched
331337
int* mMatchedClustersIndex = nullptr; //[mNumOfClusters]

0 commit comments

Comments
 (0)