@@ -97,6 +97,9 @@ void Tracker::computeCells()
9797
9898void Tracker::findCellsNeighbours (int & iteration)
9999{
100+ #ifdef OPTIMISATION_OUTPUT
101+ std::ofstream off (fmt::format (" cellneighs{}.txt" , iteration));
102+ #endif
100103 for (int iLayer{0 }; iLayer < mTrkParams [iteration].CellsPerRoad () - 1 ; ++iLayer) {
101104
102105 if (mTimeFrame ->getCells ()[iLayer + 1 ].empty () ||
@@ -114,35 +117,26 @@ void Tracker::findCellsNeighbours(int& iteration)
114117 const int nextLayerTrackletIndex{currentCell.getSecondTrackletIndex ()};
115118 const int nextLayerFirstCellIndex{mTimeFrame ->getCellsLookupTable ()[iLayer][nextLayerTrackletIndex]};
116119 const int nextLayerLastCellIndex{mTimeFrame ->getCellsLookupTable ()[iLayer][nextLayerTrackletIndex + 1 ]};
117- for (int iNextLayerCell {nextLayerFirstCellIndex}; iNextLayerCell < nextLayerLastCellIndex; ++iNextLayerCell ) {
120+ for (int iNextCell {nextLayerFirstCellIndex}; iNextCell < nextLayerLastCellIndex; ++iNextCell ) {
118121
119- Cell& nextCell{mTimeFrame ->getCells ()[iLayer + 1 ][iNextLayerCell ]};
122+ Cell& nextCell{mTimeFrame ->getCells ()[iLayer + 1 ][iNextCell ]};
120123 if (nextCell.getFirstTrackletIndex () != nextLayerTrackletIndex) {
121124 break ;
122125 }
123126
124- const float3 currentCellNormalVector{currentCell.getNormalVectorCoordinates ()};
125- const float3 nextCellNormalVector{nextCell.getNormalVectorCoordinates ()};
126- const float3 normalVectorsDeltaVector{currentCellNormalVector.x - nextCellNormalVector.x ,
127- currentCellNormalVector.y - nextCellNormalVector.y ,
128- currentCellNormalVector.z - nextCellNormalVector.z };
129-
130- const float deltaNormalVectorsModulus{(normalVectorsDeltaVector.x * normalVectorsDeltaVector.x ) +
131- (normalVectorsDeltaVector.y * normalVectorsDeltaVector.y ) +
132- (normalVectorsDeltaVector.z * normalVectorsDeltaVector.z )};
133- const float deltaCurvature{std::abs (currentCell.getCurvature () - nextCell.getCurvature ())};
134-
135- if (deltaNormalVectorsModulus < mTrkParams [iteration].NeighbourMaxDeltaN [iLayer] &&
136- deltaCurvature < mTrkParams [iteration].NeighbourMaxDeltaCurvature [iLayer]) {
137-
138- mTimeFrame ->getCellsNeighbours ()[iLayer][iNextLayerCell].push_back (iCell);
127+ #ifdef OPTIMISATION_OUTPUT
128+ bool good{mTimeFrame ->getCellsLabel (iLayer)[iCell] == mTimeFrame ->getCellsLabel (iLayer + 1 )[iNextCell]};
129+ float signedDelta{currentCell.getTanLambda () - nextCell.getTanLambda ()};
130+ off << fmt::format (" {}\t {:d}\t {}\t {}" , iLayer, good, signedDelta, signedDelta / mTrkParams [iteration].CellDeltaTanLambdaSigma ) << std::endl;
131+ #endif
132+ mTimeFrame ->getCellsNeighbours ()[iLayer][iNextCell].push_back (iCell);
139133
140- const int currentCellLevel{currentCell.getLevel ()};
134+ const int currentCellLevel{currentCell.getLevel ()};
141135
142- if (currentCellLevel >= nextCell.getLevel ()) {
143- nextCell.setLevel (currentCellLevel + 1 );
144- }
136+ if (currentCellLevel >= nextCell.getLevel ()) {
137+ nextCell.setLevel (currentCellLevel + 1 );
145138 }
139+ // }
146140 }
147141 }
148142 }
@@ -283,7 +277,7 @@ void Tracker::findTracks()
283277 const auto & cluster3_tf = mTimeFrame ->getTrackingFrameInfoOnLayer (lastCellLevel).at (clusters[lastCellLevel]);
284278
285279 // / FIXME!
286- TrackITSExt temporaryTrack{buildTrackSeed (cluster1_glo, cluster2_glo, cluster3_glo, cluster3_tf)};
280+ TrackITSExt temporaryTrack{buildTrackSeed (cluster1_glo, cluster2_glo, cluster3_glo, cluster3_tf, mTimeFrame -> getPositionResolution (lastCellLevel) )};
287281 for (size_t iC = 0 ; iC < clusters.size (); ++iC) {
288282 temporaryTrack.setExternalClusterIndex (iC, clusters[iC], clusters[iC] != constants::its::UnusedIndex);
289283 }
@@ -376,12 +370,15 @@ bool Tracker::fitTrack(TrackITSExt& track, int start, int end, int step, const f
376370 return false ;
377371 }
378372
379- auto predChi2{track.getPredictedChi2 (trackingHit.positionTrackingFrame , trackingHit.covarianceTrackingFrame )};
373+ GPUArray<float , 3 > cov{trackingHit.covarianceTrackingFrame };
374+ cov[0 ] = std::hypot (cov[0 ], mTrkParams [0 ].LayerMisalignment [iLayer]);
375+ cov[2 ] = std::hypot (cov[2 ], mTrkParams [0 ].LayerMisalignment [iLayer]);
376+ auto predChi2{track.getPredictedChi2 (trackingHit.positionTrackingFrame , cov)};
380377 if (nCl >= 3 && predChi2 > chi2cut * (nCl * 2 - 5 )) {
381378 return false ;
382379 }
383380 track.setChi2 (track.getChi2 () + predChi2);
384- if (!track.o2 ::track::TrackParCov::update (trackingHit.positionTrackingFrame , trackingHit. covarianceTrackingFrame )) {
381+ if (!track.o2 ::track::TrackParCov::update (trackingHit.positionTrackingFrame , cov )) {
385382 return false ;
386383 }
387384 nCl++;
@@ -608,7 +605,7 @@ void Tracker::rectifyClusterIndices()
608605// / whereas the others are referred to the global frame. This function is almost a clone of CookSeed, adapted to return
609606// / a TrackParCov
610607track::TrackParCov Tracker::buildTrackSeed (const Cluster& cluster1, const Cluster& cluster2,
611- const Cluster& cluster3, const TrackingFrameInfo& tf3)
608+ const Cluster& cluster3, const TrackingFrameInfo& tf3, float resolution )
612609{
613610 const float ca = std::cos (tf3.alphaTrackingFrame ), sa = std::sin (tf3.alphaTrackingFrame );
614611 const float x1 = cluster1.xCoordinate * ca + cluster1.yCoordinate * sa;
@@ -628,10 +625,10 @@ track::TrackParCov Tracker::buildTrackSeed(const Cluster& cluster1, const Cluste
628625
629626 const float fy = 1 . / (cluster2.radius - cluster3.radius );
630627 const float & tz = fy;
631- const float cy = (math_utils::computeCurvature (x1, y1, x2, y2 + constants::its::Resolution , x3, y3) - crv) /
632- (constants::its::Resolution * getBz () * o2::constants::math::B2C) *
628+ const float cy = (math_utils::computeCurvature (x1, y1, x2, y2 + resolution , x3, y3) - crv) /
629+ (resolution * getBz () * o2::constants::math::B2C) *
633630 20 .f ; // FIXME: MS contribution to the cov[14] (*20 added)
634- constexpr float s2 = constants::its::Resolution * constants::its::Resolution ;
631+ const float s2 = resolution ;
635632
636633 return track::TrackParCov (tf3.xTrackingFrame , tf3.alphaTrackingFrame ,
637634 {y3, z3, crv * (x3 - x0), 0 .5f * (tgl12 + tgl23),
@@ -647,6 +644,19 @@ void Tracker::getGlobalConfiguration()
647644 if (tc.useMatCorrTGeo ) {
648645 setCorrType (o2::base::PropagatorImpl<float >::MatCorrType::USEMatCorrTGeo);
649646 }
647+ for (auto & params : mTrkParams ) {
648+ if (params.NLayers == 7 ) {
649+ for (int i{0 }; i < 7 ; ++i) {
650+ params.LayerMisalignment [i] = tc.misalignment [i] > 0 ? tc.misalignment [i] : params.LayerMisalignment [i];
651+ }
652+ }
653+ params.PhiBins = tc.LUTbinsPhi > 0 ? tc.LUTbinsPhi : params.PhiBins ;
654+ params.ZBins = tc.LUTbinsZ > 0 ? tc.LUTbinsZ : params.ZBins ;
655+ params.PVres = tc.pvRes > 0 ? tc.pvRes : params.PVres ;
656+ params.NSigmaCut *= tc.nSigmaCut > 0 ? tc.nSigmaCut : 1 .f ;
657+ params.CellDeltaTanLambdaSigma *= tc.deltaTanLres > 0 ? tc.deltaTanLres : 1 .f ;
658+ params.TrackletMaxDeltaPhi *= tc.phiCut > 0 ? tc.phiCut : 1 .f ;
659+ }
650660}
651661
652662void Tracker::adoptTimeFrame (TimeFrame& tf)
0 commit comments