Skip to content

Commit e2e2193

Browse files
committed
Optionally refit ITS outward seeding with inward refit result
1 parent b5dfe50 commit e2e2193

File tree

7 files changed

+53
-0
lines changed

7 files changed

+53
-0
lines changed

Detectors/ITSMFT/ITS/tracking/GPU/ITStrackingGPU/TrackingKernels.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ void trackSeedHandler(CellSeed<nLayers>* trackSeeds,
219219
const float maxChi2ClusterAttachment,
220220
const float maxChi2NDF,
221221
const int reseedIfShorter,
222+
const bool repeatRefitOut,
222223
const bool shiftRefToCluster,
223224
const o2::base::Propagator* propagator,
224225
const o2::base::PropagatorF::MatCorrType matCorrType,

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackerTraitsGPU.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ void TrackerTraitsGPU<nLayers>::findRoads(const int iteration)
336336
startLevel, // const int startLevel,
337337
this->mTrkParams[0].MaxChi2ClusterAttachment, // float maxChi2ClusterAttachment
338338
this->mTrkParams[0].MaxChi2NDF, // float maxChi2NDF
339+
this->mTrkParams[0].RepeatRefitOut,
339340
this->mTrkParams[0].ReseedIfShorter,
340341
this->mTrkParams[0].ShiftRefToCluster,
341342
mTimeFrameGPU->getDevicePropagator(), // const o2::base::Propagator* propagator

Detectors/ITSMFT/ITS/tracking/GPU/cuda/TrackingKernels.cu

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
291291
const float maxChi2ClusterAttachment,
292292
const float maxChi2NDF,
293293
const int reseedIfShorter,
294+
const bool repeatRefitOut,
294295
const bool shifRefToCluster,
295296
const o2::base::Propagator* propagator,
296297
const o2::base::PropagatorF::MatCorrType matCorrType)
@@ -337,6 +338,34 @@ GPUg() void __launch_bounds__(256, 1) fitTrackSeedsKernel(
337338
if (!fitSuccess || temporaryTrack.getPt() < minPts[nLayers - temporaryTrack.getNClusters()]) {
338339
continue;
339340
}
341+
if (repeatRefitOut) { // repeat outward refit seeding and linearizing with the stable inward fit result
342+
o2::track::TrackParCov saveInw{temporaryTrack};
343+
linRef = saveInw; // use refitted track as lin.reference
344+
float saveChi2 = temporaryTrack.getChi2();
345+
temporaryTrack.resetCovariance();
346+
temporaryTrack.setCov(temporaryTrack.getQ2Pt() * temporaryTrack.getQ2Pt() * temporaryTrack.getCov()[o2::track::CovLabels::kSigQ2Pt2], o2::track::CovLabels::kSigQ2Pt2);
347+
temporaryTrack.setChi2(0);
348+
fitSuccess = fitTrack(temporaryTrack, // TrackITSExt& track,
349+
0, // int lastLayer,
350+
nLayers, // int firstLayer,
351+
1, // int firstCluster,
352+
maxChi2ClusterAttachment, // float maxChi2ClusterAttachment,
353+
maxChi2NDF, // float maxChi2NDF,
354+
o2::constants::math::VeryBig, // float maxQoverPt,
355+
0, // nCl,
356+
bz, // float bz,
357+
foundTrackingFrameInfo, // TrackingFrameInfo** trackingFrameInfo,
358+
propagator, // const o2::base::Propagator* propagator,
359+
matCorrType, // o2::base::PropagatorF::MatCorrType matCorrType
360+
&linRef,
361+
shifRefToCluster);
362+
if (!fitSuccess) {
363+
continue;
364+
}
365+
temporaryTrack.getParamOut() = temporaryTrack.getParamIn();
366+
temporaryTrack.getParamIn() = saveInw;
367+
temporaryTrack.setChi2(saveChi2);
368+
}
340369
tracks[iCurrentTrackSeedIndex] = temporaryTrack;
341370
}
342371
}
@@ -1174,6 +1203,7 @@ void trackSeedHandler(CellSeed<nLayers>* trackSeeds,
11741203
const float maxChi2ClusterAttachment,
11751204
const float maxChi2NDF,
11761205
const int reseedIfShorter,
1206+
const bool repeatRefitOut,
11771207
const bool shiftRefToCluster,
11781208
const o2::base::Propagator* propagator,
11791209
const o2::base::PropagatorF::MatCorrType matCorrType,
@@ -1195,6 +1225,7 @@ void trackSeedHandler(CellSeed<nLayers>* trackSeeds,
11951225
maxChi2ClusterAttachment, // float
11961226
maxChi2NDF, // float
11971227
reseedIfShorter, // int
1228+
repeatRefitOut, // bool
11981229
shiftRefToCluster, // bool
11991230
propagator, // const o2::base::Propagator*
12001231
matCorrType); // o2::base::PropagatorF::MatCorrType
@@ -1375,6 +1406,7 @@ template void trackSeedHandler(CellSeed<7>* trackSeeds,
13751406
const float maxChi2ClusterAttachment,
13761407
const float maxChi2NDF,
13771408
const int reseedIfShorter,
1409+
const bool repeatRefitOut,
13781410
const bool shiftRefToCluster,
13791411
const o2::base::Propagator* propagator,
13801412
const o2::base::PropagatorF::MatCorrType matCorrType,

Detectors/ITSMFT/ITS/tracking/include/ITStracking/Configuration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ struct TrackingParameters {
6969
int ReseedIfShorter = 6; // reseed for the final fit track with the length shorter than this
7070
std::vector<float> MinPt = {0.f, 0.f, 0.f, 0.f};
7171
unsigned char StartLayerMask = 0x7F;
72+
bool RepeatRefitOut = true; // repeat outward refit using inward refit as a seed
7273
bool ShiftRefToCluster = true; // TrackFit: after update shift the linearization reference to cluster
7374
bool FindShortTracks = false;
7475
bool PerPrimaryVertexProcessing = false;

Detectors/ITSMFT/ITS/tracking/include/ITStracking/TrackingConfigParam.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ struct TrackerParamConfig : public o2::conf::ConfigurableParamHelper<TrackerPara
9898
int nIterations = MaxIter; // overwrite the number of iterations
9999
int reseedIfShorter = 6; // for the final refit reseed the track with circle if they are shorter than this value
100100
bool shiftRefToCluster{true}; // TrackFit: after update shift the linearization reference to cluster
101+
bool repeatRefitOut{true}; // repeat outward refit using inward refit as a seed
101102
bool createArtefactLabels{false}; // create on-the-fly labels for the artefacts
102103

103104
int nThreads = 1;

Detectors/ITSMFT/ITS/tracking/src/Configuration.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ std::vector<TrackingParameters> TrackingMode::getTrackingParameters(TrackingMode
187187
p.MinPt[lslot] *= bFactor;
188188
}
189189
p.ReseedIfShorter = tc.reseedIfShorter;
190+
p.RepeatRefitOut = tc.repeatRefitOut;
190191
p.ShiftRefToCluster = tc.shiftRefToCluster;
191192
p.createArtefactLabels = tc.createArtefactLabels;
192193

Detectors/ITSMFT/ITS/tracking/src/TrackerTraits.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,22 @@ void TrackerTraits<nLayers>::findRoads(const int iteration)
778778
if (!fitSuccess || temporaryTrack.getPt() < mTrkParams[iteration].MinPt[mTrkParams[iteration].NLayers - temporaryTrack.getNClusters()]) {
779779
return 0;
780780
}
781+
if (mTrkParams[0].RepeatRefitOut) { // repeat outward refit seeding and linearizing with the stable inward fit result
782+
o2::track::TrackParCov saveInw{temporaryTrack};
783+
linRef = saveInw; // use refitted track as lin.reference
784+
float saveChi2 = temporaryTrack.getChi2();
785+
temporaryTrack.resetCovariance();
786+
temporaryTrack.setCov(temporaryTrack.getQ2Pt() * temporaryTrack.getQ2Pt() * temporaryTrack.getCov()[o2::track::CovLabels::kSigQ2Pt2], o2::track::CovLabels::kSigQ2Pt2);
787+
temporaryTrack.setChi2(0);
788+
fitSuccess = fitTrack(temporaryTrack, 0, mTrkParams[0].NLayers, 1, mTrkParams[0].MaxChi2ClusterAttachment, mTrkParams[0].MaxChi2NDF, o2::constants::math::VeryBig, 0, &linRef);
789+
if (!fitSuccess) {
790+
return 0;
791+
}
792+
temporaryTrack.getParamOut() = temporaryTrack.getParamIn();
793+
temporaryTrack.getParamIn() = saveInw;
794+
temporaryTrack.setChi2(saveChi2);
795+
}
796+
781797
if constexpr (decltype(Tag)::value == PassMode::OnePass::value) {
782798
tracks.push_back(temporaryTrack);
783799
} else if constexpr (decltype(Tag)::value == PassMode::TwoPassCount::value) {

0 commit comments

Comments
 (0)