Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class TrackerDPL : public framework::Task
std::string mMode = "sync";
const o2::itsmft::TopologyDictionary* mDict = nullptr;
std::unique_ptr<o2::gpu::GPUReconstruction> mRecChain = nullptr;
std::unique_ptr<o2::gpu::GPUChainITS> mChainITS = nullptr;
std::unique_ptr<parameters::GRPObject> mGRP = nullptr;
std::unique_ptr<Tracker> mTracker = nullptr;
std::unique_ptr<Vertexer> mVertexer = nullptr;
Expand Down
24 changes: 12 additions & 12 deletions Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void TrackerDPL::init(InitContext& ic)
mTimer.Stop();
mTimer.Reset();

auto* chainITS = mRecChain->AddChain<o2::gpu::GPUChainITS>();
mVertexer = std::make_unique<Vertexer>(chainITS->GetITSVertexerTraits());
mChainITS.reset(mRecChain->AddChain<o2::gpu::GPUChainITS>());
mVertexer = std::make_unique<Vertexer>(mChainITS->GetITSVertexerTraits());
mTracker = std::make_unique<Tracker>(new TrackerTraitsCPU);

auto filename = ic.options().get<std::string>("grp-file");
Expand Down Expand Up @@ -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<const unsigned char>::iterator pattIt = patterns.begin();

gsl::span<itsmft::ROFRecord> rofspan(rofs);
mTimeFrame.loadROFrameData(rofspan, compClusters, pattIt, mDict, labels);
timeFrame->loadROFrameData(rofspan, compClusters, pattIt, mDict, labels);
pattIt = patterns.begin();
std::vector<int> savedROF;
auto logger = [&](std::string s) { LOG(info) << s; };
Expand Down Expand Up @@ -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) {
Expand All @@ -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!!!
Expand Down
5 changes: 5 additions & 0 deletions GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ void GPUReconstruction::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits>* tr
}
}

void GPUReconstruction::GetITSTimeframe(std::unique_ptr<o2::its::TimeFrame>* timeFrame)
{
timeFrame->reset(new o2::its::TimeFrame);
}

int GPUReconstruction::SetNOMPThreads(int n)
{
#ifdef WITH_OPENMP
Expand Down
2 changes: 2 additions & 0 deletions GPU/GPUTracking/Base/GPUReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace its
{
class TrackerTraits;
class VertexerTraits;
class TimeFrame;
} // namespace its
} // namespace o2

Expand Down Expand Up @@ -221,6 +222,7 @@ class GPUReconstruction

// Helpers to fetch processors from other shared libraries
virtual void GetITSTraits(std::unique_ptr<o2::its::TrackerTraits>* trackerTraits, std::unique_ptr<o2::its::VertexerTraits>* vertexerTraits);
virtual void GetITSTimeframe(std::unique_ptr<o2::its::TimeFrame>* timeFrame);
bool slavesExist() { return mSlaves.size() || mMaster; }

// Getters / setters for parameters
Expand Down
5 changes: 5 additions & 0 deletions GPU/GPUTracking/Global/GPUChainITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
3 changes: 2 additions & 1 deletion GPU/GPUTracking/Global/GPUChainITS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<o2::its::TrackerTraits> mITSTrackerTraits;
std::unique_ptr<o2::its::VertexerTraits> mITSVertexerTraits;

std::unique_ptr<o2::its::TimeFrame> mITSTimeFrame;
unsigned int mMaxTracks;
};
} // namespace GPUCA_NAMESPACE::gpu
Expand Down