Skip to content

Commit 507c544

Browse files
committed
ALICE3: use track extension + allow configuring passes via JSON
1 parent 5436649 commit 507c544

2 files changed

Lines changed: 60 additions & 4 deletions

File tree

Detectors/Upgrades/ALICE3/GlobalReconstruction/workflow/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ The tracking configuration is provided via a JSON file that specifies:
8080
"SaveTimeBenchmarks": false,
8181
"DoUPCIteration": false,
8282
"FataliseUponFailure": true,
83-
"UseTrackFollower": true,
84-
"UseTrackFollowerTop": false,
85-
"UseTrackFollowerBot": false,
86-
"UseTrackFollowerMix": true,
83+
"TrackFollower": "mix",
8784
"TrackFollowerNSigmaCutZ": 1.0,
8885
"TrackFollowerNSigmaCutPhi": 1.0,
86+
"TrackFollowerBeamWidth": 1,
8987
"createArtefactLabels": false,
9088
"PrintMemory": false,
9189
"DropTFUponFailure": false

Detectors/Upgrades/ALICE3/GlobalReconstruction/workflow/src/TrackerSpec.cxx

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ std::vector<o2::its::TrackingParameters> TrackerDPL::createTrackingParamsFromCon
9494
auto loadTrackingParamsFromJson = [](std::vector<o2::its::TrackingParameters>& trackingParams, const nlohmann::json& paramConfigJson) {
9595
for (const auto& paramConfig : paramConfigJson) {
9696
o2::its::TrackingParameters params;
97+
auto applyPassFlag = [&](const char* name, o2::its::IterationStep step) {
98+
if (paramConfig.contains(name)) {
99+
if (paramConfig[name].get<bool>()) {
100+
params.PassFlags.set(step);
101+
} else {
102+
params.PassFlags.reset(step);
103+
}
104+
}
105+
};
97106

98107
if (paramConfig.contains("NLayers")) {
99108
params.NLayers = paramConfig["NLayers"].get<int>();
@@ -163,6 +172,37 @@ std::vector<o2::its::TrackingParameters> TrackerDPL::createTrackingParamsFromCon
163172
if (paramConfig.contains("CreateArtefactLabels")) {
164173
params.CreateArtefactLabels = paramConfig["CreateArtefactLabels"].get<bool>();
165174
}
175+
if (paramConfig.contains("TrackFollower")) {
176+
const auto mode = paramConfig["TrackFollower"].get<std::string>();
177+
if (mode == "top" || mode == "outward") {
178+
params.PassFlags.set(o2::its::IterationStep::TrackFollowerTop);
179+
} else if (mode == "bot" || mode == "bottom" || mode == "inward") {
180+
params.PassFlags.set(o2::its::IterationStep::TrackFollowerBot);
181+
} else if (mode == "mix" || mode == "both") {
182+
params.PassFlags.set(o2::its::IterationStep::TrackFollowerTop);
183+
params.PassFlags.set(o2::its::IterationStep::TrackFollowerBot);
184+
} else if (mode != "off") {
185+
LOGP(fatal, "Invalid ALICE3 TRK tracking parameter TrackFollower: {}", mode);
186+
}
187+
}
188+
if (paramConfig.contains("TrackFollowerNSigmaCutZ")) {
189+
params.TrackFollowerNSigmaCutZ = paramConfig["TrackFollowerNSigmaCutZ"].get<float>();
190+
}
191+
if (paramConfig.contains("TrackFollowerNSigmaCutPhi")) {
192+
params.TrackFollowerNSigmaCutPhi = paramConfig["TrackFollowerNSigmaCutPhi"].get<float>();
193+
}
194+
if (paramConfig.contains("TrackFollowerBeamWidth")) {
195+
params.TrackFollowerBeamWidth = std::max(1, paramConfig["TrackFollowerBeamWidth"].get<int>());
196+
}
197+
applyPassFlag("FirstPass", o2::its::IterationStep::FirstPass);
198+
applyPassFlag("RebuildClusterLUT", o2::its::IterationStep::RebuildClusterLUT);
199+
applyPassFlag("UseUPCMask", o2::its::IterationStep::UseUPCMask);
200+
applyPassFlag("SelectUPCVertices", o2::its::IterationStep::SelectUPCVertices);
201+
applyPassFlag("ResetVertices", o2::its::IterationStep::ResetVertices);
202+
applyPassFlag("SkipROFsAboveThreshold", o2::its::IterationStep::SkipROFsAboveThreshold);
203+
applyPassFlag("MarkVerticesAsUPC", o2::its::IterationStep::MarkVerticesAsUPC);
204+
applyPassFlag("TrackFollowerTop", o2::its::IterationStep::TrackFollowerTop);
205+
applyPassFlag("TrackFollowerBot", o2::its::IterationStep::TrackFollowerBot);
166206
if (paramConfig.contains("PrintMemory")) {
167207
params.PrintMemory = paramConfig["PrintMemory"].get<bool>();
168208
}
@@ -280,6 +320,7 @@ void TrackerDPL::run(ProcessingContext& pc)
280320
trackerTraits.adoptTimeFrame(static_cast<o2::its::TimeFrame<11>*>(&timeFrame));
281321
itsTracker.adoptTimeFrame(timeFrame);
282322
trackerTraits.updateTrackingParameters(trackingParams);
323+
timeFrame.initTrackerTopologies(trackingParams, 11);
283324

284325
int nRofs{0};
285326
if (!mHitRecoConfig.empty()) {
@@ -354,6 +395,23 @@ void TrackerDPL::run(ProcessingContext& pc)
354395
LOGP(info, "Number of cell neighbours in iteration {}: {}", iter, timeFrame.getNumberOfNeighbours());
355396
trackerTraits.findRoads(iter);
356397
LOGP(info, "Number of roads in iteration {}: {}", iter, timeFrame.getNumberOfTracks());
398+
if (trackerTraits.supportsExtendTracks() && (trackingParams[iter].PassFlags[o2::its::IterationStep::TrackFollowerTop] || trackingParams[iter].PassFlags[o2::its::IterationStep::TrackFollowerBot])) {
399+
const auto nClustersBefore = timeFrame.getNumberOfUsedClusters();
400+
const auto nTracksBefore = std::count_if(timeFrame.getTracks().begin(), timeFrame.getTracks().end(), [](const auto& track) {
401+
return track.getPattern() & 0xff000000;
402+
});
403+
const auto extensionStart = std::chrono::steady_clock::now();
404+
trackerTraits.extendTracks(iter);
405+
const auto extensionElapsedMs = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - extensionStart).count();
406+
const auto nTracksAfter = std::count_if(timeFrame.getTracks().begin(), timeFrame.getTracks().end(), [](const auto& track) {
407+
return track.getPattern() & 0xff000000;
408+
});
409+
LOGP(info, "Extended {} tracks using {} clusters in iteration {} in {} ms",
410+
nTracksAfter - nTracksBefore,
411+
timeFrame.getNumberOfUsedClusters() - nClustersBefore,
412+
iter,
413+
extensionElapsedMs);
414+
}
357415
}
358416
const auto trackingLoopElapsedMs = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - trackingLoopStart).count();
359417
LOGP(info, "Tracking iterations block took {} ms", trackingLoopElapsedMs);

0 commit comments

Comments
 (0)