@@ -53,14 +53,8 @@ using namespace o2::track;
5353
5454namespace o2 ::its
5555{
56- using namespace constants ::its2;
5756using Vertex = o2::dataformats::Vertex<o2::dataformats::TimeStamp<int >>;
5857
59- GPUdii () float Sq (float v)
60- {
61- return v * v;
62- }
63-
6458namespace gpu
6559{
6660
@@ -69,9 +63,9 @@ GPUd() const int4 getBinsRect(const Cluster& currentCluster, const int layerInde
6963 const float z1, const float z2, float maxdeltaz, float maxdeltaphi)
7064{
7165 const float zRangeMin = o2::gpu::CAMath::Min (z1, z2) - maxdeltaz;
72- const float phiRangeMin = (maxdeltaphi > constants::math::Pi ) ? 0 .f : currentCluster.phi - maxdeltaphi;
66+ const float phiRangeMin = (maxdeltaphi > o2:: constants::math::PI ) ? 0 .f : currentCluster.phi - maxdeltaphi;
7367 const float zRangeMax = o2::gpu::CAMath::Max (z1, z2) + maxdeltaz;
74- const float phiRangeMax = (maxdeltaphi > constants::math::Pi ) ? constants::math::TwoPi : currentCluster.phi + maxdeltaphi;
68+ const float phiRangeMax = (maxdeltaphi > o2:: constants::math::PI ) ? o2:: constants::math::TwoPI : currentCluster.phi + maxdeltaphi;
7569
7670 if (zRangeMax < -utils.getLayerZ (layerIndex) ||
7771 zRangeMin > utils.getLayerZ (layerIndex) || zRangeMin > zRangeMax) {
@@ -99,7 +93,7 @@ GPUd() bool fitTrack(TrackITSExt& track,
9993 o2::base::PropagatorF::MatCorrType matCorrType)
10094{
10195 for (int iLayer{start}; iLayer != end; iLayer += step) {
102- if (track.getClusterIndex (iLayer) == constants::its:: UnusedIndex) {
96+ if (track.getClusterIndex (iLayer) == constants::UnusedIndex) {
10397 continue ;
10498 }
10599 const TrackingFrameInfo& trackingHit = tfInfos[iLayer][track.getClusterIndex (iLayer)];
@@ -286,7 +280,7 @@ GPUg() void fitTrackSeedsKernel(
286280 temporaryTrack.setChi2 (0 );
287281 int * clusters = seed.getClusters ();
288282 for (int iL{0 }; iL < 7 ; ++iL) {
289- temporaryTrack.setExternalClusterIndex (iL, clusters[iL], clusters[iL] != constants::its:: UnusedIndex);
283+ temporaryTrack.setExternalClusterIndex (iL, clusters[iL], clusters[iL] != constants::UnusedIndex);
290284 }
291285 bool fitSuccess = fitTrack (temporaryTrack, // TrackITSExt& track,
292286 0 , // int lastLayer,
@@ -392,8 +386,6 @@ GPUg() void computeLayerCellsKernel(
392386 const float cellDeltaTanLambdaSigma,
393387 const float nSigmaCut)
394388{
395- constexpr float radl = 9 .36f ; // Radiation length of Si [cm].
396- constexpr float rho = 2 .33f ; // Density of Si [g/cm^3].
397389 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.
398390 for (int iCurrentTrackletIndex = blockIdx .x * blockDim .x + threadIdx .x ; iCurrentTrackletIndex < nTrackletsCurrent; iCurrentTrackletIndex += blockDim .x * gridDim .x ) {
399391 const Tracklet& currentTracklet = tracklets[layer][iCurrentTrackletIndex];
@@ -432,7 +424,7 @@ GPUg() void computeLayerCellsKernel(
432424 break ;
433425 }
434426
435- if (!track.correctForMaterial (layerxX0[layer + iC], layerxX0[layer] * radl * rho , true )) {
427+ if (!track.correctForMaterial (layerxX0[layer + iC], layerxX0[layer] * constants::Radl * constants::Rho , true )) {
436428 break ;
437429 }
438430
@@ -518,12 +510,12 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
518510 if (primaryVertex.isFlagSet (2 ) && iteration != 3 ) {
519511 continue ;
520512 }
521- const float resolution = o2::gpu::CAMath::Sqrt (Sq (resolutionPV) / primaryVertex.getNContributors () + Sq (positionResolution));
513+ const float resolution = o2::gpu::CAMath::Sqrt (math_utils:: Sq (resolutionPV) / primaryVertex.getNContributors () + math_utils:: Sq (positionResolution));
522514 const float tanLambda{(currentCluster.zCoordinate - primaryVertex.getZ ()) * inverseR0};
523515 const float zAtRmin{tanLambda * (minR - currentCluster.radius ) + currentCluster.zCoordinate };
524516 const float zAtRmax{tanLambda * (maxR - currentCluster.radius ) + currentCluster.zCoordinate };
525- const float sqInverseDeltaZ0{1 .f / (Sq (currentCluster.zCoordinate - primaryVertex.getZ ()) + 2 .e -8f )}; // / protecting from overflows adding the detector resolution
526- const float sigmaZ{o2::gpu::CAMath::Sqrt (Sq (resolution) * Sq (tanLambda) * ((Sq (inverseR0) + sqInverseDeltaZ0) * Sq (meanDeltaR) + 1 .f ) + Sq (meanDeltaR * MSAngle))};
517+ const float sqInverseDeltaZ0{1 .f / (math_utils:: Sq (currentCluster.zCoordinate - primaryVertex.getZ ()) + 2 .e -8f )}; // / protecting from overflows adding the detector resolution
518+ 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))};
527519 const int4 selectedBinsRect{getBinsRect (currentCluster, layerIndex + 1 , *utils, zAtRmin, zAtRmax, sigmaZ * NSigmaCut, phiCut)};
528520 if (selectedBinsRect.x == 0 && selectedBinsRect.y == 0 && selectedBinsRect.z == 0 && selectedBinsRect.w == 0 ) {
529521 continue ;
@@ -557,7 +549,7 @@ GPUg() void computeLayerTrackletsMultiROFKernel(
557549 const float deltaPhi{o2::gpu::CAMath::Abs (currentCluster.phi - nextCluster.phi )};
558550 const float deltaZ{o2::gpu::CAMath::Abs (tanLambda * (nextCluster.radius - currentCluster.radius ) + currentCluster.zCoordinate - nextCluster.zCoordinate )};
559551 const int nextSortedIndex{ROFClusters[layerIndex + 1 ][rof1] + nextClusterIndex};
560- if (deltaZ / sigmaZ < NSigmaCut && (deltaPhi < phiCut || o2::gpu::CAMath::Abs (deltaPhi - constants::math::TwoPi ) < phiCut)) {
552+ if (deltaZ / sigmaZ < NSigmaCut && (deltaPhi < phiCut || o2::gpu::CAMath::Abs (deltaPhi - o2:: constants::math::TwoPI ) < phiCut)) {
561553 if constexpr (initRun) {
562554 trackletsLUT[layerIndex][currentSortedIndex]++; // we need l0 as well for usual exclusive sums.
563555 } else {
@@ -604,8 +596,6 @@ GPUg() void processNeighboursKernel(const int layer,
604596 const o2::base::Propagator* propagator,
605597 const o2::base::PropagatorF::MatCorrType matCorrType)
606598{
607- constexpr float radl = 9 .36f ; // Radiation length of Si [cm].
608- constexpr float rho = 2 .33f ; // Density of Si [g/cm^3].
609599 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.
610600 for (unsigned int iCurrentCell = blockIdx .x * blockDim .x + threadIdx .x ; iCurrentCell < nCurrentCells; iCurrentCell += blockDim .x * gridDim .x ) {
611601 int foundSeeds{0 };
@@ -648,7 +638,7 @@ GPUg() void processNeighboursKernel(const int layer,
648638 }
649639
650640 if (matCorrType == o2::base::PropagatorF::MatCorrType::USEMatCorrNONE) {
651- if (!seed.correctForMaterial (layerxX0[layer - 1 ], layerxX0[layer - 1 ] * radl * rho , true )) {
641+ if (!seed.correctForMaterial (layerxX0[layer - 1 ], layerxX0[layer - 1 ] * constants::Radl * constants::Rho , true )) {
652642 continue ;
653643 }
654644 }
0 commit comments