@@ -52,14 +52,8 @@ using namespace o2::track;
5252
5353namespace o2 ::its
5454{
55- using namespace constants ::its2;
5655using Vertex = o2::dataformats::Vertex<o2::dataformats::TimeStamp<int >>;
5756
58- GPUdii () float Sq (float v)
59- {
60- return v * v;
61- }
62-
6357namespace gpu
6458{
6559
@@ -99,9 +93,9 @@ GPUd() const int4 getBinsRect(const Cluster& currentCluster, const int layerInde
9993 const float z1, const float z2, float maxdeltaz, float maxdeltaphi)
10094{
10195 const float zRangeMin = o2::gpu::CAMath::Min (z1, z2) - maxdeltaz;
102- const float phiRangeMin = (maxdeltaphi > constants::math::Pi ) ? 0 .f : currentCluster.phi - maxdeltaphi;
96+ const float phiRangeMin = (maxdeltaphi > o2:: constants::math::PI ) ? 0 .f : currentCluster.phi - maxdeltaphi;
10397 const float zRangeMax = o2::gpu::CAMath::Max (z1, z2) + maxdeltaz;
104- const float phiRangeMax = (maxdeltaphi > constants::math::Pi ) ? constants::math::TwoPi : currentCluster.phi + maxdeltaphi;
98+ const float phiRangeMax = (maxdeltaphi > o2:: constants::math::PI ) ? o2:: constants::math::TwoPI : currentCluster.phi + maxdeltaphi;
10599
106100 if (zRangeMax < -utils.getLayerZ (layerIndex) ||
107101 zRangeMin > utils.getLayerZ (layerIndex) || zRangeMin > zRangeMax) {
@@ -129,7 +123,7 @@ GPUd() bool fitTrack(TrackITSExt& track,
129123 o2::base::PropagatorF::MatCorrType matCorrType)
130124{
131125 for (int iLayer{start}; iLayer != end; iLayer += step) {
132- if (track.getClusterIndex (iLayer) == constants::its:: UnusedIndex) {
126+ if (track.getClusterIndex (iLayer) == constants::UnusedIndex) {
133127 continue ;
134128 }
135129 const TrackingFrameInfo& trackingHit = tfInfos[iLayer][track.getClusterIndex (iLayer)];
@@ -316,7 +310,7 @@ GPUg() void fitTrackSeedsKernel(
316310 temporaryTrack.setChi2 (0 );
317311 int * clusters = seed.getClusters ();
318312 for (int iL{0 }; iL < 7 ; ++iL) {
319- temporaryTrack.setExternalClusterIndex (iL, clusters[iL], clusters[iL] != constants::its:: UnusedIndex);
313+ temporaryTrack.setExternalClusterIndex (iL, clusters[iL], clusters[iL] != constants::UnusedIndex);
320314 }
321315 bool fitSuccess = fitTrack (temporaryTrack, // TrackITSExt& track,
322316 0 , // int lastLayer,
@@ -422,8 +416,6 @@ GPUg() void computeLayerCellsKernel(
422416 const float cellDeltaTanLambdaSigma,
423417 const float nSigmaCut)
424418{
425- constexpr float radl = 9 .36f ; // Radiation length of Si [cm].
426- constexpr float rho = 2 .33f ; // Density of Si [g/cm^3].
427419 constexpr float layerxX0[7 ] = {5 .e -3f , 5 .e -3f , 5 .e -3f , 1 .e -2f , 1 .e -2f , 1 .e -2f , 1 .e -2f }; // Hardcoded here for the moment.
428420 for (int iCurrentTrackletIndex = blockIdx .x * blockDim .x + threadIdx .x ; iCurrentTrackletIndex < nTrackletsCurrent; iCurrentTrackletIndex += blockDim .x * gridDim .x ) {
429421 const Tracklet& currentTracklet = tracklets[layer][iCurrentTrackletIndex];
@@ -462,7 +454,7 @@ GPUg() void computeLayerCellsKernel(
462454 break ;
463455 }
464456
465- if (!track.correctForMaterial (layerxX0[layer + iC], layerxX0[layer] * radl * rho , true )) {
457+ if (!track.correctForMaterial (layerxX0[layer + iC], layerxX0[layer] * constants::Radl * constants::Rho , true )) {
466458 break ;
467459 }
468460
@@ -548,12 +540,12 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
548540 if (primaryVertex.isFlagSet (2 ) && iteration != 3 ) {
549541 continue ;
550542 }
551- const float resolution = o2::gpu::CAMath::Sqrt (Sq (resolutionPV) / primaryVertex.getNContributors () + Sq (positionResolution));
543+ const float resolution = o2::gpu::CAMath::Sqrt (math_utils:: Sq (resolutionPV) / primaryVertex.getNContributors () + math_utils:: Sq (positionResolution));
552544 const float tanLambda{(currentCluster.zCoordinate - primaryVertex.getZ ()) * inverseR0};
553545 const float zAtRmin{tanLambda * (minR - currentCluster.radius ) + currentCluster.zCoordinate };
554546 const float zAtRmax{tanLambda * (maxR - currentCluster.radius ) + currentCluster.zCoordinate };
555- const float sqInverseDeltaZ0{1 .f / (Sq (currentCluster.zCoordinate - primaryVertex.getZ ()) + 2 .e -8f )}; // / protecting from overflows adding the detector resolution
556- const float sigmaZ{o2::gpu::CAMath::Sqrt (Sq (resolution) * Sq (tanLambda) * ((Sq (inverseR0) + sqInverseDeltaZ0) * Sq (meanDeltaR) + 1 .f ) + Sq (meanDeltaR * MSAngle))};
547+ const float sqInverseDeltaZ0{1 .f / (math_utils:: Sq (currentCluster.zCoordinate - primaryVertex.getZ ()) + 2 .e -8f )}; // / protecting from overflows adding the detector resolution
548+ const float sigmaZ{o2::gpu::CAMath::Sqrt (math_utils:: Sq (resolution) * math_utils:: Sq (tanLambda) * ((math_utils:: Sq (inverseR0) + sqInverseDeltaZ0) * math_utils:: Sq (meanDeltaR) + 1 .f ) + math_utils:: Sq (meanDeltaR * MSAngle))};
557549 const int4 selectedBinsRect{getBinsRect (currentCluster, layerIndex + 1 , *utils, zAtRmin, zAtRmax, sigmaZ * NSigmaCut, phiCut)};
558550 if (selectedBinsRect.x == 0 && selectedBinsRect.y == 0 && selectedBinsRect.z == 0 && selectedBinsRect.w == 0 ) {
559551 continue ;
@@ -587,7 +579,7 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
587579 const float deltaPhi{o2::gpu::CAMath::Abs (currentCluster.phi - nextCluster.phi )};
588580 const float deltaZ{o2::gpu::CAMath::Abs (tanLambda * (nextCluster.radius - currentCluster.radius ) + currentCluster.zCoordinate - nextCluster.zCoordinate )};
589581 const int nextSortedIndex{ROFClusters[layerIndex + 1 ][rof1] + nextClusterIndex};
590- if (deltaZ / sigmaZ < NSigmaCut && (deltaPhi < phiCut || o2::gpu::CAMath::Abs (deltaPhi - constants::math::TwoPi ) < phiCut)) {
582+ if (deltaZ / sigmaZ < NSigmaCut && (deltaPhi < phiCut || o2::gpu::CAMath::Abs (deltaPhi - o2:: constants::math::TwoPI ) < phiCut)) {
591583 if constexpr (initRun) {
592584 trackletsLUT[layerIndex][currentSortedIndex]++; // we need l0 as well for usual exclusive sums.
593585 } else {
@@ -634,8 +626,6 @@ GPUg() void processNeighboursKernel(const int layer,
634626 const o2::base::Propagator* propagator,
635627 const o2::base::PropagatorF::MatCorrType matCorrType)
636628{
637- constexpr float radl = 9 .36f ; // Radiation length of Si [cm].
638- constexpr float rho = 2 .33f ; // Density of Si [g/cm^3].
639629 constexpr float layerxX0[7 ] = {5 .e -3f , 5 .e -3f , 5 .e -3f , 1 .e -2f , 1 .e -2f , 1 .e -2f , 1 .e -2f }; // Hardcoded here for the moment.
640630 for (unsigned int iCurrentCell = blockIdx .x * blockDim .x + threadIdx .x ; iCurrentCell < nCurrentCells; iCurrentCell += blockDim .x * gridDim .x ) {
641631 int foundSeeds{0 };
@@ -678,7 +668,7 @@ GPUg() void processNeighboursKernel(const int layer,
678668 }
679669
680670 if (matCorrType == o2::base::PropagatorF::MatCorrType::USEMatCorrNONE) {
681- if (!seed.correctForMaterial (layerxX0[layer - 1 ], layerxX0[layer - 1 ] * radl * rho , true )) {
671+ if (!seed.correctForMaterial (layerxX0[layer - 1 ], layerxX0[layer - 1 ] * constants::Radl * constants::Rho , true )) {
682672 continue ;
683673 }
684674 }
0 commit comments