Skip to content

Commit 2b9c4ed

Browse files
committed
ITS: fix time assignment
1 parent 7e30ee1 commit 2b9c4ed

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

DataFormats/Detectors/ITSMFT/ITS/include/DataFormatsITS/TrackITS.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace its
3737
class TrackITS : public o2::track::TrackParCov
3838
{
3939
enum UserBits {
40-
kSharedClusters = 1 << 29
40+
kSharedClusters = 1 << 28
4141
};
4242

4343
using Cluster = o2::itsmft::Cluster;
@@ -93,7 +93,7 @@ class TrackITS : public o2::track::TrackParCov
9393

9494
GPUhdi() void setChi2(float chi2) { mChi2 = chi2; }
9595

96-
bool isBetter(const TrackITS& best, float maxChi2) const;
96+
bool isBetter(const TrackITS& best, float maxChi2 = o2::constants::math::VeryBig) const;
9797

9898
auto& getTimeStamp() { return mTime; }
9999
const auto& getTimeStamp() const { return mTime; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using namespace o2::its;
2424

2525
std::string TrackingParameters::asString() const
2626
{
27-
std::string str = std::format("NZb:{} NPhB:{} PerVtx:{} DropFail:{} ClSh:{} TrklMinPt:{:.2f} MinCl:{}", ZBins, PhiBins, PerPrimaryVertexProcessing, DropTFUponFailure, ClusterSharing, TrackletMinPt, MinTrackLength);
27+
std::string str = std::format("NZb:{} NPhB:{} PerVtx:{} DropFail:{} ClSh:{} TrklMinPt:{:.2f} MinCl:{} NSigma:{}", ZBins, PhiBins, PerPrimaryVertexProcessing, DropTFUponFailure, ClusterSharing, TrackletMinPt, MinTrackLength, NSigmaCut);
2828
bool first = true;
2929
for (int il = NLayers; il >= MinTrackLength; il--) {
3030
int slot = NLayers - il;

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,9 @@ void TrackerTraits<NLayers>::findCellSeeds(const int iteration)
570570
int rof = mTimeFrame->getClusterROF(i, cls[i]);
571571
int rofStartBC = mTimeFrame->getROFOverlapTableView().getLayer(i).getROFStartInBC(rof);
572572
int rofEndBC = mTimeFrame->getROFOverlapTableView().getLayer(i).getROFEndInBC(rof);
573-
startBC = o2::gpu::CAMath::Min(startBC, rofStartBC);
574-
endBC = o2::gpu::CAMath::Max(endBC, rofEndBC);
573+
// if the start/end of the cluster is after/before the current bracket need to enlarge
574+
startBC = (rofStartBC <= startBC) ? rofStartBC : o2::gpu::CAMath::Max(startBC, rofStartBC);
575+
endBC = (rofEndBC >= endBC) ? rofEndBC : o2::gpu::CAMath::Min(endBC, rofEndBC);
575576
}
576577
if (endBC - startBC < 0) { // this should not happen
577578
ltracks[iCell].markDead();
@@ -1143,15 +1144,17 @@ void TrackerTraits<NLayers>::findRoads(const int iteration)
11431144
}
11441145

11451146
deepVectorClear(trackSeeds);
1147+
// sort tracks in quality (accounting for 1. length; 2. chi2)
1148+
// needed since then tracks with shared clusters can be marked/discarded
11461149
tbb::parallel_sort(tracks.begin(), tracks.end(), [](const auto& a, const auto& b) {
1147-
return a.getChi2() < b.getChi2();
1150+
return a.isBetter(b);
11481151
});
11491152
});
11501153

11511154
for (auto& track : tracks) {
11521155
int nShared = 0;
11531156
bool isFirstShared{false};
1154-
int firstLayer{-1}, firstCluster{-1};
1157+
int firstLayer{constants::UnusedIndex}, firstCluster{constants::UnusedIndex};
11551158
for (int iLayer{0}; iLayer < mRecoParams[iteration].params.NLayers; ++iLayer) {
11561159
if (track.getClusterIndex(iLayer) == constants::UnusedIndex) {
11571160
continue;
@@ -1172,17 +1175,20 @@ void TrackerTraits<NLayers>::findRoads(const int iteration)
11721175

11731176
// here we can do the calculation of the time bracket simply
11741177
// by checkig in which rofs the clusters are
1178+
// also mark used clusters for the next iteration
11751179
int bcStart{0}, bcEnd{std::numeric_limits<int>::max()};
11761180
for (int iLayer{0}; iLayer < mRecoParams[iteration].params.NLayers; ++iLayer) {
11771181
if (track.getClusterIndex(iLayer) == constants::UnusedIndex) {
11781182
continue;
11791183
}
11801184
mTimeFrame->markUsedCluster(iLayer, track.getClusterIndex(iLayer));
11811185
int currentROF = mTimeFrame->getClusterROF(iLayer, track.getClusterIndex(iLayer));
1182-
int bcClsSta = mTimeFrame->getROFOverlapTableView().getLayer(iLayer).getROFStartInBC(currentROF);
1183-
int bcClsEnd = mTimeFrame->getROFOverlapTableView().getLayer(iLayer).getROFEndInBC(currentROF);
1184-
bcStart = std::max(bcStart, bcClsSta);
1185-
bcEnd = std::min(bcEnd, bcClsEnd);
1186+
// need to account for the imposed delay
1187+
int bcClsSta = mTimeFrame->getROFOverlapTableView().getLayer(iLayer).getROFStartInBC(currentROF, true);
1188+
int bcClsEnd = mTimeFrame->getROFOverlapTableView().getLayer(iLayer).getROFEndInBC(currentROF, true);
1189+
// if the start/end of the cluster is after/before the current bracket need to enlarge
1190+
bcStart = (bcClsEnd <= bcStart) ? bcClsSta : o2::gpu::CAMath::Max(bcStart, bcClsSta);
1191+
bcEnd = (bcClsSta >= bcEnd) ? bcClsEnd : o2::gpu::CAMath::Min(bcEnd, bcClsEnd);
11861192
}
11871193
track.getTimeStamp().setTimeStamp(bcStart);
11881194
track.getTimeStamp().setTimeStampError(bcEnd - bcStart + 1);

0 commit comments

Comments
 (0)