diff --git a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h index c960ec7f6112a..044f74b0c0204 100644 --- a/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h +++ b/Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h @@ -58,6 +58,7 @@ class TrackerDPL : public framework::Task std::string mMode = "sync"; const o2::itsmft::TopologyDictionary* mDict = nullptr; std::unique_ptr mRecChain = nullptr; + std::unique_ptr mChainITS = nullptr; std::unique_ptr mGRP = nullptr; std::unique_ptr mTracker = nullptr; std::unique_ptr mVertexer = nullptr; diff --git a/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx b/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx index bf37577964864..2ebddc9ab9c2d 100644 --- a/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx +++ b/Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx @@ -59,8 +59,8 @@ void TrackerDPL::init(InitContext& ic) mTimer.Stop(); mTimer.Reset(); - auto* chainITS = mRecChain->AddChain(); - mVertexer = std::make_unique(chainITS->GetITSVertexerTraits()); + mChainITS.reset(mRecChain->AddChain()); + mVertexer = std::make_unique(mChainITS->GetITSVertexerTraits()); mTracker = std::make_unique(new TrackerTraitsCPU); auto filename = ic.options().get("grp-file"); @@ -208,14 +208,14 @@ void TrackerDPL::run(ProcessingContext& pc) const auto& multEstConf = FastMultEstConfig::Instance(); // parameters for mult estimation and cuts FastMultEst multEst; // mult estimator - TimeFrame mTimeFrame; - mTracker->adoptTimeFrame(mTimeFrame); + TimeFrame* timeFrame = mChainITS->GetITSTimeframe(); + mTracker->adoptTimeFrame(*timeFrame); mTracker->setBz(mBz); gsl::span::iterator pattIt = patterns.begin(); gsl::span rofspan(rofs); - mTimeFrame.loadROFrameData(rofspan, compClusters, pattIt, mDict, labels); + timeFrame->loadROFrameData(rofspan, compClusters, pattIt, mDict, labels); pattIt = patterns.begin(); std::vector savedROF; auto logger = [&](std::string s) { LOG(info) << s; }; @@ -268,7 +268,7 @@ void TrackerDPL::run(ProcessingContext& pc) } cutTotalMult += !multCut; processingMask.push_back(multCut); - mTimeFrame.addPrimaryVertices(vtxVecLoc); + timeFrame->addPrimaryVertices(vtxVecLoc); vtxROF.setNEntries(vtxVecLoc.size()); for (const auto& vtx : vtxVecLoc) { @@ -282,23 +282,23 @@ void TrackerDPL::run(ProcessingContext& pc) LOG(info) << fmt::format("\t - Cluster multiplicity selection rejected {}/{} ROFs", cutClusterMult, rofspan.size()); LOG(info) << fmt::format("\t - Vertex multiplicity selection rejected {}/{} ROFs", cutVertexMult, rofspan.size()); LOG(info) << fmt::format(" - Vertex seeding total elapsed time: {} ms for {} clusters in {} ROFs", vertexerElapsedTime, nclUsed, rofspan.size()); - LOG(info) << fmt::format(" - Beam position computed for the TF: {}, {}", mTimeFrame.getBeamX(), mTimeFrame.getBeamY()); + LOG(info) << fmt::format(" - Beam position computed for the TF: {}, {}", timeFrame->getBeamX(), timeFrame->getBeamY()); if (mCosmicsProcessing && nclUsed > 1500 * rofspan.size()) { LOG(fatal) << "Cosmics processing was requested with an average detector occupancy exceeding 1.e-7, aborting."; } - mTimeFrame.setMultiplicityCutMask(processingMask); + timeFrame->setMultiplicityCutMask(processingMask); mTracker->clustersToTracks(logger, fatalLogger); - if (mTimeFrame.hasBogusClusters()) { - LOG(warning) << fmt::format(" - The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", mTimeFrame.hasBogusClusters()); + if (timeFrame->hasBogusClusters()) { + LOG(warning) << fmt::format(" - The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", timeFrame->hasBogusClusters()); } for (unsigned int iROF{0}; iROF < rofs.size(); ++iROF) { auto& rof{rofs[iROF]}; - tracks = mTimeFrame.getTracks(iROF); - trackLabels = mTimeFrame.getTracksLabel(iROF); + tracks = timeFrame->getTracks(iROF); + trackLabels = timeFrame->getTracksLabel(iROF); auto number{tracks.size()}; auto first{allTracks.size()}; int offset = -rof.getFirstEntry(); // cluster entry!!! diff --git a/GPU/GPUTracking/Base/GPUReconstruction.cxx b/GPU/GPUTracking/Base/GPUReconstruction.cxx index 927ae511e0f9d..678b98d7a50fb 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.cxx +++ b/GPU/GPUTracking/Base/GPUReconstruction.cxx @@ -126,6 +126,11 @@ void GPUReconstruction::GetITSTraits(std::unique_ptr* tr } } +void GPUReconstruction::GetITSTimeframe(std::unique_ptr* timeFrame) +{ + timeFrame->reset(new o2::its::TimeFrame); +} + int GPUReconstruction::SetNOMPThreads(int n) { #ifdef WITH_OPENMP diff --git a/GPU/GPUTracking/Base/GPUReconstruction.h b/GPU/GPUTracking/Base/GPUReconstruction.h index 98e1449465a04..4d802abcb94af 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.h +++ b/GPU/GPUTracking/Base/GPUReconstruction.h @@ -39,6 +39,7 @@ namespace its { class TrackerTraits; class VertexerTraits; +class TimeFrame; } // namespace its } // namespace o2 @@ -221,6 +222,7 @@ class GPUReconstruction // Helpers to fetch processors from other shared libraries virtual void GetITSTraits(std::unique_ptr* trackerTraits, std::unique_ptr* vertexerTraits); + virtual void GetITSTimeframe(std::unique_ptr* timeFrame); bool slavesExist() { return mSlaves.size() || mMaster; } // Getters / setters for parameters diff --git a/GPU/GPUTracking/Global/GPUChainITS.cxx b/GPU/GPUTracking/Global/GPUChainITS.cxx index c1818df0335ce..06e31d390f1da 100644 --- a/GPU/GPUTracking/Global/GPUChainITS.cxx +++ b/GPU/GPUTracking/Global/GPUChainITS.cxx @@ -64,6 +64,11 @@ VertexerTraits* GPUChainITS::GetITSVertexerTraits() #endif return mITSVertexerTraits.get(); } +TimeFrame* GPUChainITS::GetITSTimeframe() +{ + mRec->GetITSTimeframe(&mITSTimeFrame); + return mITSTimeFrame.get(); +} int GPUChainITS::PrepareEvent() { return 0; } diff --git a/GPU/GPUTracking/Global/GPUChainITS.h b/GPU/GPUTracking/Global/GPUChainITS.h index 63478f8c80ddf..e6e728f70a9d0 100644 --- a/GPU/GPUTracking/Global/GPUChainITS.h +++ b/GPU/GPUTracking/Global/GPUChainITS.h @@ -46,12 +46,13 @@ class GPUChainITS : public GPUChain o2::its::TrackerTraits* GetITSTrackerTraits(); o2::its::VertexerTraits* GetITSVertexerTraits(); + o2::its::TimeFrame* GetITSTimeframe(); protected: GPUChainITS(GPUReconstruction* rec, unsigned int maxTracks = GPUCA_MAX_ITS_FIT_TRACKS); std::unique_ptr mITSTrackerTraits; std::unique_ptr mITSVertexerTraits; - + std::unique_ptr mITSTimeFrame; unsigned int mMaxTracks; }; } // namespace GPUCA_NAMESPACE::gpu