Skip to content

Commit 861c1de

Browse files
mconcasdavidrohr
authored andcommitted
Get ITS TimeFrame from GPUReco
1 parent 3012a28 commit 861c1de

6 files changed

Lines changed: 27 additions & 13 deletions

File tree

Detectors/ITSMFT/ITS/workflow/include/ITSWorkflow/TrackerSpec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class TrackerDPL : public framework::Task
5858
std::string mMode = "sync";
5959
const o2::itsmft::TopologyDictionary* mDict = nullptr;
6060
std::unique_ptr<o2::gpu::GPUReconstruction> mRecChain = nullptr;
61+
std::unique_ptr<o2::gpu::GPUChainITS> mChainITS = nullptr;
6162
std::unique_ptr<parameters::GRPObject> mGRP = nullptr;
6263
std::unique_ptr<Tracker> mTracker = nullptr;
6364
std::unique_ptr<Vertexer> mVertexer = nullptr;

Detectors/ITSMFT/ITS/workflow/src/TrackerSpec.cxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void TrackerDPL::init(InitContext& ic)
5959
mTimer.Stop();
6060
mTimer.Reset();
6161

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

6666
auto filename = ic.options().get<std::string>("grp-file");
@@ -208,14 +208,14 @@ void TrackerDPL::run(ProcessingContext& pc)
208208
const auto& multEstConf = FastMultEstConfig::Instance(); // parameters for mult estimation and cuts
209209
FastMultEst multEst; // mult estimator
210210

211-
TimeFrame mTimeFrame;
212-
mTracker->adoptTimeFrame(mTimeFrame);
211+
TimeFrame* timeFrame = mChainITS->GetITSTimeframe();
212+
mTracker->adoptTimeFrame(*timeFrame);
213213
mTracker->setBz(mBz);
214214

215215
gsl::span<const unsigned char>::iterator pattIt = patterns.begin();
216216

217217
gsl::span<itsmft::ROFRecord> rofspan(rofs);
218-
mTimeFrame.loadROFrameData(rofspan, compClusters, pattIt, mDict, labels);
218+
timeFrame->loadROFrameData(rofspan, compClusters, pattIt, mDict, labels);
219219
pattIt = patterns.begin();
220220
std::vector<int> savedROF;
221221
auto logger = [&](std::string s) { LOG(info) << s; };
@@ -268,7 +268,7 @@ void TrackerDPL::run(ProcessingContext& pc)
268268
}
269269
cutTotalMult += !multCut;
270270
processingMask.push_back(multCut);
271-
mTimeFrame.addPrimaryVertices(vtxVecLoc);
271+
timeFrame->addPrimaryVertices(vtxVecLoc);
272272

273273
vtxROF.setNEntries(vtxVecLoc.size());
274274
for (const auto& vtx : vtxVecLoc) {
@@ -282,23 +282,23 @@ void TrackerDPL::run(ProcessingContext& pc)
282282
LOG(info) << fmt::format("\t - Cluster multiplicity selection rejected {}/{} ROFs", cutClusterMult, rofspan.size());
283283
LOG(info) << fmt::format("\t - Vertex multiplicity selection rejected {}/{} ROFs", cutVertexMult, rofspan.size());
284284
LOG(info) << fmt::format(" - Vertex seeding total elapsed time: {} ms for {} clusters in {} ROFs", vertexerElapsedTime, nclUsed, rofspan.size());
285-
LOG(info) << fmt::format(" - Beam position computed for the TF: {}, {}", mTimeFrame.getBeamX(), mTimeFrame.getBeamY());
285+
LOG(info) << fmt::format(" - Beam position computed for the TF: {}, {}", timeFrame->getBeamX(), timeFrame->getBeamY());
286286

287287
if (mCosmicsProcessing && nclUsed > 1500 * rofspan.size()) {
288288
LOG(fatal) << "Cosmics processing was requested with an average detector occupancy exceeding 1.e-7, aborting.";
289289
}
290290

291-
mTimeFrame.setMultiplicityCutMask(processingMask);
291+
timeFrame->setMultiplicityCutMask(processingMask);
292292
mTracker->clustersToTracks(logger, fatalLogger);
293-
if (mTimeFrame.hasBogusClusters()) {
294-
LOG(warning) << fmt::format(" - The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", mTimeFrame.hasBogusClusters());
293+
if (timeFrame->hasBogusClusters()) {
294+
LOG(warning) << fmt::format(" - The processed timeframe had {} clusters with wild z coordinates, check the dictionaries", timeFrame->hasBogusClusters());
295295
}
296296

297297
for (unsigned int iROF{0}; iROF < rofs.size(); ++iROF) {
298298

299299
auto& rof{rofs[iROF]};
300-
tracks = mTimeFrame.getTracks(iROF);
301-
trackLabels = mTimeFrame.getTracksLabel(iROF);
300+
tracks = timeFrame->getTracks(iROF);
301+
trackLabels = timeFrame->getTracksLabel(iROF);
302302
auto number{tracks.size()};
303303
auto first{allTracks.size()};
304304
int offset = -rof.getFirstEntry(); // cluster entry!!!

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ void GPUReconstruction::GetITSTraits(std::unique_ptr<o2::its::TrackerTraits>* tr
126126
}
127127
}
128128

129+
void GPUReconstruction::GetITSTimeframe(std::unique_ptr<o2::its::TimeFrame>* timeFrame)
130+
{
131+
timeFrame->reset(new o2::its::TimeFrame);
132+
}
133+
129134
int GPUReconstruction::SetNOMPThreads(int n)
130135
{
131136
#ifdef WITH_OPENMP

GPU/GPUTracking/Base/GPUReconstruction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace its
3939
{
4040
class TrackerTraits;
4141
class VertexerTraits;
42+
class TimeFrame;
4243
} // namespace its
4344
} // namespace o2
4445

@@ -221,6 +222,7 @@ class GPUReconstruction
221222

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

226228
// Getters / setters for parameters

GPU/GPUTracking/Global/GPUChainITS.cxx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ VertexerTraits* GPUChainITS::GetITSVertexerTraits()
6464
#endif
6565
return mITSVertexerTraits.get();
6666
}
67+
TimeFrame* GPUChainITS::GetITSTimeframe()
68+
{
69+
mRec->GetITSTimeframe(&mITSTimeFrame);
70+
return mITSTimeFrame.get();
71+
}
6772

6873
int GPUChainITS::PrepareEvent() { return 0; }
6974

GPU/GPUTracking/Global/GPUChainITS.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ class GPUChainITS : public GPUChain
4646

4747
o2::its::TrackerTraits* GetITSTrackerTraits();
4848
o2::its::VertexerTraits* GetITSVertexerTraits();
49+
o2::its::TimeFrame* GetITSTimeframe();
4950

5051
protected:
5152
GPUChainITS(GPUReconstruction* rec, unsigned int maxTracks = GPUCA_MAX_ITS_FIT_TRACKS);
5253
std::unique_ptr<o2::its::TrackerTraits> mITSTrackerTraits;
5354
std::unique_ptr<o2::its::VertexerTraits> mITSVertexerTraits;
54-
55+
std::unique_ptr<o2::its::TimeFrame> mITSTimeFrame;
5556
unsigned int mMaxTracks;
5657
};
5758
} // namespace GPUCA_NAMESPACE::gpu

0 commit comments

Comments
 (0)