From 12ac3134e078abcdb6d379e3ff1293db0a44427d Mon Sep 17 00:00:00 2001 From: David Rohr Date: Sun, 19 Jan 2025 22:39:54 +0100 Subject: [PATCH] GPU: Remove all AliRoot code --- .../TPC/include/DataFormatsTPC/PIDResponse.h | 2 - .../TRD/include/DataFormatsTRD/Tracklet64.h | 2 +- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 2 +- .../include/GlobalTracking/TrackMethods.h | 2 +- Detectors/GlobalTracking/src/MatchTPCITS.cxx | 2 +- .../study/src/TrackingStudy.cxx | 2 +- .../studies/include/ITSStudies/TrackCuts.h | 2 +- .../studies/include/ITSStudies/TrackMethods.h | 2 +- .../TPCCalibration/CorrectionMapsLoader.h | 2 +- .../TPC/calibration/src/CalculatedEdx.cxx | 2 +- Detectors/TPC/calibration/src/DigitAdd.cxx | 6 +- Detectors/TPC/calibration/src/TrackDump.cxx | 10 +- .../TPC/monitor/src/SimpleEventDisplayGUI.cxx | 2 +- Detectors/TPC/workflow/src/TPCRefitter.cxx | 2 +- GPU/CMakeLists.txt | 7 +- GPU/Common/CMakeLists.txt | 23 - GPU/Common/GPUCommonAlgorithm.h | 16 +- GPU/Common/GPUCommonAlgorithmThrust.h | 4 +- GPU/Common/GPUCommonConstants.h | 2 +- GPU/Common/GPUCommonDef.h | 10 +- GPU/Common/GPUCommonDefAPI.h | 4 +- GPU/Common/GPUCommonLogger.h | 2 +- GPU/Common/GPUCommonMath.h | 4 +- GPU/Common/GPUCommonTransform3D.h | 4 +- GPU/GPUTracking/Base/GPUConstantMem.h | 27 +- GPU/GPUTracking/Base/GPUGeneralKernels.cxx | 2 +- GPU/GPUTracking/Base/GPUGeneralKernels.h | 4 +- GPU/GPUTracking/Base/GPUKernelDebugOutput.cxx | 2 +- GPU/GPUTracking/Base/GPUKernelDebugOutput.h | 4 +- GPU/GPUTracking/Base/GPUMemoryResource.cxx | 2 +- GPU/GPUTracking/Base/GPUMemoryResource.h | 4 +- GPU/GPUTracking/Base/GPUParam.cxx | 86 +-- GPU/GPUTracking/Base/GPUParam.h | 5 +- GPU/GPUTracking/Base/GPUParam.inc | 4 +- GPU/GPUTracking/Base/GPUParamRTC.h | 4 +- GPU/GPUTracking/Base/GPUProcessor.cxx | 2 +- GPU/GPUTracking/Base/GPUProcessor.h | 4 +- GPU/GPUTracking/Base/GPUReconstruction.cxx | 6 +- GPU/GPUTracking/Base/GPUReconstruction.h | 4 +- GPU/GPUTracking/Base/GPUReconstructionCPU.cxx | 4 +- GPU/GPUTracking/Base/GPUReconstructionCPU.h | 4 +- .../Base/GPUReconstructionConvert.cxx | 2 +- .../Base/GPUReconstructionConvert.h | 4 +- .../Base/GPUReconstructionDeviceBase.cxx | 4 +- .../Base/GPUReconstructionDeviceBase.h | 4 +- .../Base/GPUReconstructionHelpers.h | 4 +- .../Base/GPUReconstructionIncludes.h | 5 - ...ReconstructionIncludesDeviceAll.template.h | 6 +- .../GPUReconstructionKernelList.template.h | 8 - .../Base/GPUReconstructionKernels.h | 4 +- .../Base/GPUReconstructionLibrary.cxx | 2 +- .../Base/GPUReconstructionTimeframe.cxx | 4 +- .../Base/GPUReconstructionTimeframe.h | 4 +- GPU/GPUTracking/Base/cuda/CMakeLists.txt | 183 ++--- GPU/GPUTracking/Base/cuda/CUDAThrustHelpers.h | 6 +- .../Base/cuda/GPUReconstructionCUDA.cu | 6 +- .../Base/cuda/GPUReconstructionCUDA.h | 8 +- .../GPUReconstructionCUDAExternalProvider.cu | 2 +- .../Base/cuda/GPUReconstructionCUDAGenRTC.cxx | 6 +- .../cuda/GPUReconstructionCUDAInternals.h | 4 +- .../Base/cuda/GPUReconstructionCUDAKernels.cu | 2 +- GPU/GPUTracking/Base/hip/CMakeLists.txt | 172 ++--- GPU/GPUTracking/Base/opencl/CMakeLists.txt | 19 - .../Base/opencl/GPUReconstructionOCL.cxx | 2 +- .../Base/opencl/GPUReconstructionOCL.h | 8 +- .../opencl/GPUReconstructionOCLInternals.h | 4 +- GPU/GPUTracking/CMakeLists.txt | 134 +--- .../AliHLTTPCClusterStatComponent.cxx | 718 ------------------ .../AliHLTTPCClusterStatComponent.h | 98 --- .../DataCompression/GPUTPCClusterRejection.h | 4 +- .../GPUTPCClusterStatistics.cxx | 2 +- .../DataCompression/GPUTPCClusterStatistics.h | 4 +- .../DataCompression/GPUTPCCompression.cxx | 2 +- .../DataCompression/GPUTPCCompression.h | 4 +- .../GPUTPCCompressionKernels.cxx | 2 +- .../GPUTPCCompressionKernels.h | 4 +- .../GPUTPCCompressionTrackModel.cxx | 3 +- .../GPUTPCCompressionTrackModel.h | 4 +- .../DataCompression/GPUTPCDecompression.cxx | 2 +- .../DataCompression/GPUTPCDecompression.h | 4 +- .../GPUTPCDecompressionKernels.cxx | 2 +- .../GPUTPCDecompressionKernels.h | 4 +- .../TPCClusterDecompressionCore.inc | 4 +- .../TPCClusterDecompressor.cxx | 2 +- .../DataCompression/TPCClusterDecompressor.h | 4 +- .../DataTypes/CalibdEdxContainer.cxx | 2 +- .../DataTypes/CalibdEdxContainer.h | 2 - .../CalibdEdxTrackTopologySpline.cxx | 2 +- GPU/GPUTracking/DataTypes/GPUConfigDump.cxx | 2 +- GPU/GPUTracking/DataTypes/GPUConfigDump.h | 4 +- GPU/GPUTracking/DataTypes/GPUDataTypes.cxx | 2 +- GPU/GPUTracking/DataTypes/GPUDataTypes.h | 8 +- GPU/GPUTracking/DataTypes/GPUHostDataTypes.h | 4 +- .../DataTypes/GPUMemorySizeScalers.cxx | 2 +- .../DataTypes/GPUMemorySizeScalers.h | 4 +- .../DataTypes/GPUNewCalibValues.cxx | 2 +- GPU/GPUTracking/DataTypes/GPUNewCalibValues.h | 4 +- GPU/GPUTracking/DataTypes/GPUO2FakeClasses.h | 4 +- GPU/GPUTracking/DataTypes/GPUOutputControl.h | 4 +- GPU/GPUTracking/DataTypes/GPUSettings.h | 4 +- .../DataTypes/GPUTPCClusterOccupancyMap.cxx | 2 +- .../DataTypes/GPUTPCClusterOccupancyMap.h | 4 +- .../DataTypes/GPUTPCGMMergedTrackHit.h | 8 +- .../DataTypes/GPUTPCGMPolynomialField.cxx | 4 +- .../DataTypes/GPUTPCGMPolynomialField.h | 4 +- GPU/GPUTracking/DataTypes/GPUTPCGeometry.h | 4 +- GPU/GPUTracking/DataTypes/GPUTRDDef.h | 33 +- .../DataTypes/GPUTRDInterfaceO2Track.h | 8 +- GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx | 9 +- GPU/GPUTracking/DataTypes/GPUTRDTrack.h | 16 +- GPU/GPUTracking/DataTypes/GPUTRDTrack.inc | 54 +- GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx | 2 +- GPU/GPUTracking/DataTypes/GPUTriggerOutputs.h | 4 +- GPU/GPUTracking/DataTypes/GPUdEdxInfo.h | 4 +- GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx | 2 +- GPU/GPUTracking/DataTypes/TPCPadBitMap.h | 4 +- GPU/GPUTracking/DataTypes/TPCPadGainCalib.cxx | 2 +- GPU/GPUTracking/DataTypes/TPCPadGainCalib.h | 4 +- .../DataTypes/TPCZSLinkMapping.cxx | 2 +- GPU/GPUTracking/DataTypes/TPCZSLinkMapping.h | 4 +- GPU/GPUTracking/Debug/GPUROOTDump.h | 4 +- GPU/GPUTracking/Debug/GPUROOTDumpCore.cxx | 2 +- GPU/GPUTracking/Debug/GPUROOTDumpCore.h | 4 +- .../Definitions/GPUDefConstantsAndSettings.h | 8 +- GPU/GPUTracking/Definitions/GPULogging.h | 35 +- GPU/GPUTracking/Definitions/GPUSettingsList.h | 14 +- .../Definitions/clusterFinderDefs.h | 4 +- GPU/GPUTracking/GPUTrackingLinkDef_AliRoot.h | 49 -- .../Global/AliHLTGPUDumpComponent.cxx | 492 ------------ .../Global/AliHLTGPUDumpComponent.h | 75 -- GPU/GPUTracking/Global/GPUChain.cxx | 2 +- GPU/GPUTracking/Global/GPUChain.h | 4 +- GPU/GPUTracking/Global/GPUChainITS.cxx | 2 +- GPU/GPUTracking/Global/GPUChainITS.h | 4 +- GPU/GPUTracking/Global/GPUChainTracking.cxx | 8 +- GPU/GPUTracking/Global/GPUChainTracking.h | 5 +- .../Global/GPUChainTrackingClusterizer.cxx | 4 +- .../Global/GPUChainTrackingCompression.cxx | 2 +- .../GPUChainTrackingDebugAndProfiling.cxx | 2 +- GPU/GPUTracking/Global/GPUChainTrackingDefs.h | 4 +- GPU/GPUTracking/Global/GPUChainTrackingIO.cxx | 2 +- .../Global/GPUChainTrackingMerger.cxx | 2 +- .../Global/GPUChainTrackingRefit.cxx | 2 +- .../Global/GPUChainTrackingSliceTracker.cxx | 2 +- .../Global/GPUChainTrackingTRD.cxx | 4 +- .../Global/GPUChainTrackingTransformation.cxx | 2 +- GPU/GPUTracking/Global/GPUErrors.cxx | 2 +- GPU/GPUTracking/Global/GPUErrors.h | 4 +- .../Global/GPUTrackingInputProvider.cxx | 2 +- .../Global/GPUTrackingInputProvider.h | 4 +- GPU/GPUTracking/ITS/GPUITSFitter.cxx | 2 +- GPU/GPUTracking/ITS/GPUITSFitter.h | 4 +- GPU/GPUTracking/ITS/GPUITSFitterKernels.cxx | 2 +- GPU/GPUTracking/ITS/GPUITSFitterKernels.h | 4 +- GPU/GPUTracking/ITS/GPUITSTrack.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMBorderTrack.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMMergedTrack.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx | 18 +- GPU/GPUTracking/Merger/GPUTPCGMMerger.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx | 2 +- GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.cxx | 4 +- GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h | 46 +- GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h | 4 +- .../Merger/GPUTPCGMPhysicalTrackModel.cxx | 2 +- .../Merger/GPUTPCGMPhysicalTrackModel.h | 4 +- .../Merger/GPUTPCGMPolynomialFieldManager.cxx | 604 +-------------- .../Merger/GPUTPCGMPolynomialFieldManager.h | 28 +- GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx | 2 +- GPU/GPUTracking/Merger/GPUTPCGMPropagator.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx | 2 +- GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h | 4 +- GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx | 59 +- GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h | 9 +- .../Merger/GPUTPCGMTracksToTPCSeeds.cxx | 2 +- .../Merger/GPUTPCGlobalDebugSortKernels.cxx | 2 +- .../Merger/GPUTPCGlobalDebugSortKernels.h | 4 +- .../Merger/GPUTPCGlobalMergerComponent.cxx | 575 -------------- .../Merger/GPUTPCGlobalMergerComponent.h | 147 ---- GPU/GPUTracking/Refit/GPUTrackingRefit.cxx | 2 +- .../Refit/GPUTrackingRefitKernel.cxx | 2 +- .../SliceTracker/GPUTPCBaseTrackParam.h | 4 +- .../SliceTracker/GPUTPCClusterData.h | 4 +- .../SliceTracker/GPUTPCCreateOccupancyMap.cxx | 2 +- .../SliceTracker/GPUTPCCreateOccupancyMap.h | 4 +- .../SliceTracker/GPUTPCCreateSliceData.cxx | 2 +- .../SliceTracker/GPUTPCCreateSliceData.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCDef.h | 4 +- .../SliceTracker/GPUTPCGlobalTracking.cxx | 2 +- .../SliceTracker/GPUTPCGlobalTracking.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCGrid.cxx | 2 +- GPU/GPUTracking/SliceTracker/GPUTPCGrid.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCHit.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCHitId.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCMCInfo.h | 4 +- .../SliceTracker/GPUTPCNeighboursCleaner.cxx | 2 +- .../SliceTracker/GPUTPCNeighboursCleaner.h | 4 +- .../SliceTracker/GPUTPCNeighboursFinder.cxx | 2 +- .../SliceTracker/GPUTPCNeighboursFinder.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCRow.cxx | 2 +- GPU/GPUTracking/SliceTracker/GPUTPCRow.h | 4 +- .../GPUTPCSectorDebugSortKernels.cxx | 2 +- .../GPUTPCSectorDebugSortKernels.h | 4 +- .../SliceTracker/GPUTPCSliceData.cxx | 2 +- .../SliceTracker/GPUTPCSliceData.h | 4 +- .../SliceTracker/GPUTPCSliceOutCluster.h | 4 +- .../SliceTracker/GPUTPCSliceOutput.cxx | 2 +- .../SliceTracker/GPUTPCSliceOutput.h | 4 +- .../SliceTracker/GPUTPCStartHitsFinder.cxx | 2 +- .../SliceTracker/GPUTPCStartHitsFinder.h | 4 +- .../SliceTracker/GPUTPCStartHitsSorter.cxx | 2 +- .../SliceTracker/GPUTPCStartHitsSorter.h | 4 +- GPU/GPUTracking/SliceTracker/GPUTPCTrack.cxx | 2 +- GPU/GPUTracking/SliceTracker/GPUTPCTrack.h | 4 +- .../SliceTracker/GPUTPCTrackLinearisation.h | 4 +- .../SliceTracker/GPUTPCTrackParam.cxx | 2 +- .../SliceTracker/GPUTPCTrackParam.h | 4 +- .../SliceTracker/GPUTPCTracker.cxx | 2 +- GPU/GPUTracking/SliceTracker/GPUTPCTracker.h | 4 +- .../SliceTracker/GPUTPCTrackerComponent.cxx | 709 ----------------- .../SliceTracker/GPUTPCTrackerComponent.h | 139 ---- .../SliceTracker/GPUTPCTrackerDump.cxx | 2 +- GPU/GPUTracking/SliceTracker/GPUTPCTracklet.h | 4 +- .../GPUTPCTrackletConstructor.cxx | 2 +- .../SliceTracker/GPUTPCTrackletConstructor.h | 4 +- .../SliceTracker/GPUTPCTrackletSelector.cxx | 2 +- .../SliceTracker/GPUTPCTrackletSelector.h | 4 +- .../Standalone/Benchmark/standalone.cxx | 4 +- GPU/GPUTracking/Standalone/tools/createGeo.C | 3 +- GPU/GPUTracking/Standalone/tools/createLUT.C | 2 +- GPU/GPUTracking/TPCClusterFinder/Array2D.h | 4 +- GPU/GPUTracking/TPCClusterFinder/CfConsts.h | 4 +- GPU/GPUTracking/TPCClusterFinder/CfFragment.h | 4 +- GPU/GPUTracking/TPCClusterFinder/CfUtils.h | 4 +- GPU/GPUTracking/TPCClusterFinder/ChargePos.h | 4 +- .../TPCClusterFinder/ClusterAccumulator.cxx | 4 +- .../TPCClusterFinder/ClusterAccumulator.h | 4 +- .../TPCClusterFinder/GPUTPCCFChainContext.h | 4 +- .../GPUTPCCFChargeMapFiller.cxx | 4 +- .../GPUTPCCFChargeMapFiller.h | 4 +- .../GPUTPCCFCheckPadBaseline.cxx | 4 +- .../GPUTPCCFCheckPadBaseline.h | 4 +- .../TPCClusterFinder/GPUTPCCFClusterizer.cxx | 4 +- .../TPCClusterFinder/GPUTPCCFClusterizer.h | 4 +- .../TPCClusterFinder/GPUTPCCFDecodeZS.cxx | 4 +- .../TPCClusterFinder/GPUTPCCFDecodeZS.h | 4 +- .../GPUTPCCFDeconvolution.cxx | 4 +- .../TPCClusterFinder/GPUTPCCFDeconvolution.h | 4 +- .../TPCClusterFinder/GPUTPCCFGather.cxx | 4 +- .../TPCClusterFinder/GPUTPCCFGather.h | 4 +- .../GPUTPCCFMCLabelFlattener.cxx | 4 +- .../GPUTPCCFMCLabelFlattener.h | 4 +- .../GPUTPCCFNoiseSuppression.cxx | 4 +- .../GPUTPCCFNoiseSuppression.h | 4 +- .../TPCClusterFinder/GPUTPCCFPeakFinder.cxx | 4 +- .../TPCClusterFinder/GPUTPCCFPeakFinder.h | 4 +- .../GPUTPCCFStreamCompaction.cxx | 4 +- .../GPUTPCCFStreamCompaction.h | 4 +- .../TPCClusterFinder/GPUTPCClusterFinder.cxx | 2 +- .../TPCClusterFinder/GPUTPCClusterFinder.h | 4 +- .../GPUTPCClusterFinderDump.cxx | 4 +- .../TPCClusterFinder/MCLabelAccumulator.cxx | 4 +- .../TPCClusterFinder/MCLabelAccumulator.h | 4 +- .../TPCClusterFinder/PackedCharge.h | 4 +- GPU/GPUTracking/TPCConvert/GPUTPCConvert.cxx | 2 +- GPU/GPUTracking/TPCConvert/GPUTPCConvert.h | 4 +- .../TPCConvert/GPUTPCConvertImpl.h | 4 +- .../TPCConvert/GPUTPCConvertKernel.cxx | 2 +- .../TPCConvert/GPUTPCConvertKernel.h | 4 +- GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h | 42 +- .../TRDTracking/GPUTRDInterfaces.h | 132 +--- .../TRDTracking/GPUTRDSpacePoint.h | 8 +- GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx | 81 +- GPU/GPUTracking/TRDTracking/GPUTRDTracker.h | 16 +- .../TRDTracking/GPUTRDTrackerComponent.cxx | 509 ------------- .../TRDTracking/GPUTRDTrackerComponent.h | 148 ---- .../TRDTracking/GPUTRDTrackerDebug.h | 300 +------- .../TRDTracking/GPUTRDTrackerKernels.cxx | 2 +- .../TRDTracking/GPUTRDTrackerKernels.h | 4 +- .../TRDTracking/GPUTRDTrackletLabels.h | 4 +- .../GPUTRDTrackletReaderComponent.cxx | 396 ---------- .../GPUTRDTrackletReaderComponent.h | 126 --- .../TRDTracking/GPUTRDTrackletWord.cxx | 20 +- .../TRDTracking/GPUTRDTrackletWord.h | 8 +- .../TRDTracking/macros/run_trd_tracker.C | 3 +- GPU/GPUTracking/cmake/kernel_helpers.cmake | 4 - GPU/GPUTracking/dEdx/GPUdEdx.cxx | 2 +- GPU/GPUTracking/dEdx/GPUdEdx.h | 4 +- GPU/GPUTracking/display/GPUDisplay.cxx | 2 +- GPU/GPUTracking/display/GPUDisplay.h | 4 +- .../display/GPUDisplayInterface.cxx | 2 +- GPU/GPUTracking/display/GPUDisplayInterface.h | 4 +- .../display/backend/GPUDisplayBackend.cxx | 2 +- .../display/backend/GPUDisplayBackend.h | 4 +- .../backend/GPUDisplayBackendOpenGL.cxx | 2 +- .../display/backend/GPUDisplayBackendOpenGL.h | 4 +- .../backend/GPUDisplayBackendVulkan.cxx | 2 +- .../display/backend/GPUDisplayBackendVulkan.h | 4 +- .../display/frontend/GPUDisplayFrontend.cxx | 6 +- .../display/frontend/GPUDisplayFrontend.h | 4 +- .../frontend/GPUDisplayFrontendGlfw.cxx | 2 +- .../display/frontend/GPUDisplayFrontendGlfw.h | 4 +- .../frontend/GPUDisplayFrontendGlut.cxx | 2 +- .../display/frontend/GPUDisplayFrontendGlut.h | 4 +- .../frontend/GPUDisplayFrontendNone.cxx | 2 +- .../display/frontend/GPUDisplayFrontendNone.h | 4 +- .../frontend/GPUDisplayFrontendWayland.cxx | 2 +- .../frontend/GPUDisplayFrontendWayland.h | 4 +- .../frontend/GPUDisplayFrontendWindows.cxx | 2 +- .../frontend/GPUDisplayFrontendWindows.h | 4 +- .../frontend/GPUDisplayFrontendX11.cxx | 2 +- .../display/frontend/GPUDisplayFrontendX11.h | 4 +- .../display/frontend/GPUDisplayGUIWrapper.cxx | 6 +- .../display/frontend/GPUDisplayGUIWrapper.h | 4 +- .../display/frontend/GPUDisplayKeys.cxx | 2 +- .../display/helpers/GPUDisplayAnimation.cxx | 2 +- .../GPUDisplayBackendOpenGLMagneticField.cxx | 2 +- .../display/helpers/GPUDisplayColors.inc | 2 +- .../display/helpers/GPUDisplayHelpers.cxx | 2 +- .../helpers/GPUDisplayInterpolation.cxx | 2 +- .../display/helpers/GPUDisplayLoader.cxx | 2 +- .../helpers/GPUDisplayMagneticField.cxx | 2 +- .../display/helpers/GPUDisplayMagneticField.h | 4 +- .../display/helpers/GPUDisplayQuaternion.cxx | 2 +- .../display/helpers/GPUDisplayROOT.cxx | 2 +- .../helpers/field-uniform-exporter.cxx | 2 +- .../display/render/GPUDisplayDraw.cxx | 2 +- .../display/render/GPUDisplayImportEvent.cxx | 2 +- .../display/shaders/GPUDisplayShaders.h | 4 +- GPU/GPUTracking/kernels.cmake | 20 +- .../oldFiles/AliHLT3DTrackParam.cxx | 425 ----------- GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.h | 137 ---- .../oldFiles/GPUTPCGMOfflineFitter.cxx | 309 -------- .../oldFiles/GPUTPCGMOfflineFitter.h | 48 -- GPU/GPUTracking/oldFiles/GPUTPCMCPoint.cxx | 20 - GPU/GPUTracking/oldFiles/GPUTPCMCPoint.h | 76 -- GPU/GPUTracking/oldFiles/GPUTPCMCTrack.cxx | 90 --- GPU/GPUTracking/oldFiles/GPUTPCMCTrack.h | 72 -- GPU/GPUTracking/qa/GPUQA.cxx | 8 +- GPU/GPUTracking/qa/GPUQA.h | 8 +- GPU/GPUTracking/qa/genEvents.cxx | 4 +- GPU/GPUTracking/qa/genEvents.h | 4 +- GPU/GPUTracking/utils/qlibload.h | 4 +- .../BandMatrixSolver.cxx | 6 +- GPU/TPCFastTransformation/BandMatrixSolver.h | 6 +- GPU/TPCFastTransformation/CMakeLists.txt | 54 -- GPU/TPCFastTransformation/ChebyshevFit1D.cxx | 2 +- GPU/TPCFastTransformation/ChebyshevFit1D.h | 4 +- .../CorrectionMapsHelper.cxx | 2 +- .../CorrectionMapsHelper.h | 30 +- .../MultivariatePolynomial.h | 14 +- .../MultivariatePolynomialHelper.cxx | 4 +- .../MultivariatePolynomialHelper.h | 4 +- .../NDPiecewisePolynomials.h | 12 +- .../NDPiecewisePolynomials.inc | 18 +- GPU/TPCFastTransformation/Spline.cxx | 6 +- GPU/TPCFastTransformation/Spline.h | 8 +- GPU/TPCFastTransformation/Spline1D.cxx | 6 +- GPU/TPCFastTransformation/Spline1D.h | 8 +- GPU/TPCFastTransformation/Spline1DHelper.cxx | 10 +- GPU/TPCFastTransformation/Spline1DHelper.h | 8 +- .../Spline1DHelperOld.cxx | 10 +- GPU/TPCFastTransformation/Spline1DHelperOld.h | 8 +- GPU/TPCFastTransformation/Spline1DSpec.cxx | 18 +- GPU/TPCFastTransformation/Spline1DSpec.h | 12 +- GPU/TPCFastTransformation/Spline2D.cxx | 6 +- GPU/TPCFastTransformation/Spline2D.h | 8 +- GPU/TPCFastTransformation/Spline2DHelper.cxx | 8 +- GPU/TPCFastTransformation/Spline2DHelper.h | 8 +- GPU/TPCFastTransformation/Spline2DSpec.cxx | 12 +- GPU/TPCFastTransformation/Spline2DSpec.h | 8 +- GPU/TPCFastTransformation/SplineHelper.cxx | 6 +- GPU/TPCFastTransformation/SplineHelper.h | 4 +- GPU/TPCFastTransformation/SplineSpec.cxx | 12 +- GPU/TPCFastTransformation/SplineSpec.h | 8 +- GPU/TPCFastTransformation/SplineUtil.h | 5 +- GPU/TPCFastTransformation/SymMatrixSolver.cxx | 6 +- GPU/TPCFastTransformation/SymMatrixSolver.h | 8 +- .../TPCFastSpaceChargeCorrection.cxx | 4 +- .../TPCFastSpaceChargeCorrection.h | 14 +- .../TPCFastSpaceChargeCorrectionMap.cxx | 4 +- .../TPCFastSpaceChargeCorrectionMap.h | 6 +- .../TPCFastTransform.cxx | 8 +- GPU/TPCFastTransformation/TPCFastTransform.h | 12 +- .../TPCFastTransformGeo.cxx | 2 +- .../TPCFastTransformGeo.h | 10 +- .../TPCFastTransformManager.cxx | 2 +- .../TPCFastTransformManager.h | 4 +- .../TPCFastTransformQA.cxx | 2 +- .../TPCFastTransformQA.h | 4 +- .../TPCFastTransformationLinkDef_AliRoot.h | 21 - .../alirootMacro/createTPCFastTransform.C | 69 -- .../generateTPCDistortionNTupleAliRoot.C | 150 ---- .../alirootMacro/initTPCcalibration.C | 198 ----- .../alirootMacro/moveTPCFastTransform.C | 69 -- .../devtools/IrregularSpline1D.cxx | 2 +- .../devtools/IrregularSpline1D.h | 6 +- .../devtools/IrregularSpline1DTest.C | 2 +- .../devtools/IrregularSpline2D3D.cxx | 2 +- .../devtools/IrregularSpline2D3D.h | 6 +- .../IrregularSpline2D3DCalibrator.cxx | 4 +- .../devtools/IrregularSpline2D3DCalibrator.h | 4 +- .../devtools/RegularSpline1D.h | 4 +- .../devtools/SemiregularSpline2D3D.cxx | 4 +- .../devtools/SemiregularSpline2D3D.h | 6 +- GPU/Utils/CMakeLists.txt | 25 +- GPU/Utils/FlatObject.h | 6 +- 406 files changed, 891 insertions(+), 8695 deletions(-) delete mode 100644 GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.cxx delete mode 100644 GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.h delete mode 100644 GPU/GPUTracking/GPUTrackingLinkDef_AliRoot.h delete mode 100644 GPU/GPUTracking/Global/AliHLTGPUDumpComponent.cxx delete mode 100644 GPU/GPUTracking/Global/AliHLTGPUDumpComponent.h delete mode 100644 GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.cxx delete mode 100644 GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.h delete mode 100644 GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.cxx delete mode 100644 GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.h delete mode 100644 GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.cxx delete mode 100644 GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.h delete mode 100644 GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.cxx delete mode 100644 GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.h delete mode 100644 GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.cxx delete mode 100644 GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.h delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.cxx delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.h delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCMCPoint.cxx delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCMCPoint.h delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCMCTrack.cxx delete mode 100644 GPU/GPUTracking/oldFiles/GPUTPCMCTrack.h delete mode 100644 GPU/TPCFastTransformation/TPCFastTransformationLinkDef_AliRoot.h delete mode 100644 GPU/TPCFastTransformation/alirootMacro/createTPCFastTransform.C delete mode 100644 GPU/TPCFastTransformation/alirootMacro/generateTPCDistortionNTupleAliRoot.C delete mode 100644 GPU/TPCFastTransformation/alirootMacro/initTPCcalibration.C delete mode 100644 GPU/TPCFastTransformation/alirootMacro/moveTPCFastTransform.C diff --git a/DataFormats/Detectors/TPC/include/DataFormatsTPC/PIDResponse.h b/DataFormats/Detectors/TPC/include/DataFormatsTPC/PIDResponse.h index 77b26f47d0c2f..277011a260631 100644 --- a/DataFormats/Detectors/TPC/include/DataFormatsTPC/PIDResponse.h +++ b/DataFormats/Detectors/TPC/include/DataFormatsTPC/PIDResponse.h @@ -65,9 +65,7 @@ class PIDResponse float mMIP = 50.f; float mChargeFactor = 2.299999952316284f; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(PIDResponse, 1); -#endif }; GPUd() void PIDResponse::setBetheBlochParams(const float betheBlochParams[5]) diff --git a/DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h b/DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h index f0af50a3c5a64..e63d8fbb5f277 100644 --- a/DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h +++ b/DataFormats/Detectors/TRD/include/DataFormatsTRD/Tracklet64.h @@ -144,7 +144,7 @@ class Tracklet64 GPUd() float getPadColFloat(bool applyShift) const { return getPositionFloat() + getMCMCol() * constants::NCOLMCM + 8.f + (applyShift ? 1.f : 0.f); } // pad column number inside pad row as int can be off by +-1 pad (same function name as for TRD digit) - GPUd() int getPadCol(bool applyShift = false) const { return GPUCA_NAMESPACE::gpu::CAMath::Float2IntRn(getPadColFloat(applyShift)); } + GPUd() int getPadCol(bool applyShift = false) const { return o2::gpu::CAMath::Float2IntRn(getPadColFloat(applyShift)); } // translate local position into global y (in cm) not taking into account calibrations (ExB, vDrift, t0) GPUd() float getUncalibratedY(bool applyShift = false) const { return (getPadColFloat(applyShift) - (constants::NCOLUMN / 2.f)) * getPadWidth(); } diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 6083052eb1168..41aac45f9e002 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1470,7 +1470,7 @@ void AODProducerWorkflowDPL::countTPCClusters(const o2::globaltracking::RecoCont o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef()); unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex; clMap[rowIndex] = true; - if (tpcClusShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { if (!shMap[rowIndex]) { counters.shared++; } diff --git a/Detectors/GlobalTracking/include/GlobalTracking/TrackMethods.h b/Detectors/GlobalTracking/include/GlobalTracking/TrackMethods.h index d87d68dd122b2..f65d9ffd260e6 100644 --- a/Detectors/GlobalTracking/include/GlobalTracking/TrackMethods.h +++ b/Detectors/GlobalTracking/include/GlobalTracking/TrackMethods.h @@ -47,7 +47,7 @@ class TrackMethods o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef()); unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex; clMap[rowIndex] = true; - if (tpcClusShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { if (!shMap[rowIndex]) { shared++; } diff --git a/Detectors/GlobalTracking/src/MatchTPCITS.cxx b/Detectors/GlobalTracking/src/MatchTPCITS.cxx index eb2a2212edb30..0d2f004ee3867 100644 --- a/Detectors/GlobalTracking/src/MatchTPCITS.cxx +++ b/Detectors/GlobalTracking/src/MatchTPCITS.cxx @@ -2880,7 +2880,7 @@ void MatchTPCITS::dumpTPCOrig(bool acc, int tpcIndex) for (int i = 0; i < tpcOrig.getNClusterReferences(); i++) { tpcOrig.getClusterReference(mTPCTrackClusIdx, i, clSect, clRow, clIdx); unsigned int absoluteIndex = mTPCClusterIdxStruct->clusterOffset[clSect][clRow] + clIdx; - if (mTPCRefitterShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (mTPCRefitterShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { if (!(prevRow == clRow && prevRawShared)) { nshared++; } diff --git a/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx b/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx index c6345b128f562..3c8bb07be92a3 100644 --- a/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx +++ b/Detectors/GlobalTrackingWorkflow/study/src/TrackingStudy.cxx @@ -266,7 +266,7 @@ void TrackingStudySpec::process(o2::globaltracking::RecoContainer& recoData) clRowP = clRow; } unsigned int absoluteIndex = tpcClusAcc.clusterOffset[clSect][clRow] + clIdx; - if (shMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (shMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { trExt.nClTPCShared++; } } diff --git a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackCuts.h b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackCuts.h index ef1d9faf86b83..03f52aae380c5 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackCuts.h +++ b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackCuts.h @@ -76,7 +76,7 @@ class TrackCuts o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef()); unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex; clMap[rowIndex] = true; - if (tpcClusShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { if (!shMap[rowIndex]) { counters.shared++; } diff --git a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackMethods.h b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackMethods.h index c3e6eadc979f4..55f92843cd14d 100644 --- a/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackMethods.h +++ b/Detectors/ITSMFT/ITS/postprocessing/studies/include/ITSStudies/TrackMethods.h @@ -53,7 +53,7 @@ class TrackMethods o2::tpc::TrackTPC::getClusterReference(tpcClusRefs, i, sectorIndex, rowIndex, clusterIndex, track.getClusterRef()); unsigned int absoluteIndex = tpcClusAcc.clusterOffset[sectorIndex][rowIndex] + clusterIndex; clMap[rowIndex] = true; - if (tpcClusShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (tpcClusShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { if (!shMap[rowIndex]) { shared++; } diff --git a/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h b/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h index 48af1be6b5b19..90dc84e618cec 100644 --- a/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h +++ b/Detectors/TPC/calibration/include/TPCCalibration/CorrectionMapsLoader.h @@ -75,7 +75,7 @@ class CorrectionMapsLoader : public o2::gpu::CorrectionMapsHelper float mInstLumiCTPFactor = 1.0; // multiplicative factor for inst. lumi int mLumiCTPSource = 0; // 0: main, 1: alternative CTP lumi source - std::unique_ptr mCorrMapMShape{nullptr}; + std::unique_ptr mCorrMapMShape{nullptr}; #endif }; diff --git a/Detectors/TPC/calibration/src/CalculatedEdx.cxx b/Detectors/TPC/calibration/src/CalculatedEdx.cxx index 2ac3b44938bce..60e9ada7794d3 100644 --- a/Detectors/TPC/calibration/src/CalculatedEdx.cxx +++ b/Detectors/TPC/calibration/src/CalculatedEdx.cxx @@ -159,7 +159,7 @@ void CalculatedEdx::calculatedEdx(o2::tpc::TrackTPC& track, dEdxInfo& output, fl // check if the cluster is shared const unsigned int absoluteIndex = mClusterIndex->clusterOffset[sectorIndex][rowIndex] + clusterIndexNumb; - const bool isShared = mRefit ? (mTPCRefitterShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) : 0; + const bool isShared = mRefit ? (mTPCRefitterShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) : 0; // get region, pad, stack and stack ID const int region = Mapper::REGION[rowIndex]; diff --git a/Detectors/TPC/calibration/src/DigitAdd.cxx b/Detectors/TPC/calibration/src/DigitAdd.cxx index bb5e4c5f31c51..4c8eb8ae9df6f 100644 --- a/Detectors/TPC/calibration/src/DigitAdd.cxx +++ b/Detectors/TPC/calibration/src/DigitAdd.cxx @@ -23,13 +23,13 @@ int DigitAdd::sector() const float DigitAdd::lx() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return gpuGeom.Row2X(mRow); } float DigitAdd::ly() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return gpuGeom.LinearPad2Y(sector(), mRow, getPad()); } @@ -49,6 +49,6 @@ float DigitAdd::gy() const float DigitAdd::cpad() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return getPad() - gpuGeom.NPads(mRow) / 2.f; } diff --git a/Detectors/TPC/calibration/src/TrackDump.cxx b/Detectors/TPC/calibration/src/TrackDump.cxx index 200abf766ac54..421750a5cb22b 100644 --- a/Detectors/TPC/calibration/src/TrackDump.cxx +++ b/Detectors/TPC/calibration/src/TrackDump.cxx @@ -47,7 +47,7 @@ void TrackDump::filter(const gsl::span tracks, ClusterNativeAcce ClExcludes excludes; - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; for (const auto& track : tracks) { const int nCl = track.getNClusterReferences(); @@ -141,7 +141,7 @@ void TrackDump::finalize() void TrackDump::fillClNativeAdd(ClusterNativeAccess const& clusterIndex, std::vector& clInfos, ClExcludes* excludes) { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; for (int sector = 0; sector < MAXSECTOR; ++sector) { for (int padrow = 0; padrow < MAXGLOBALPADROW; ++padrow) { @@ -164,19 +164,19 @@ void TrackDump::fillClNativeAdd(ClusterNativeAccess const& clusterIndex, std::ve float TrackDump::ClusterNativeAdd::cpad() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return getPad() - gpuGeom.NPads(padrow) / 2.f; } float TrackDump::ClusterNativeAdd::lx() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return gpuGeom.Row2X(padrow); } float TrackDump::ClusterNativeAdd::ly() const { - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; return gpuGeom.LinearPad2Y(sector, padrow, getPad()); } diff --git a/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx b/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx index 20da28eefe364..78f6b4d3e5397 100644 --- a/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx +++ b/Detectors/TPC/monitor/src/SimpleEventDisplayGUI.cxx @@ -1195,7 +1195,7 @@ void SimpleEventDisplayGUI::showClusters(int roc, int row) selFlags += mCheckClFlags[iFlag]->IsDown() << (iFlag - 1); } const bool fillSingleTB = mCheckSingleTB->IsDown(); - const GPUCA_NAMESPACE::gpu::GPUTPCGeometry gpuGeom; + const o2::gpu::GPUTPCGeometry gpuGeom; const int rowMin = fillSingleTB ? 0 : row; const int rowMax = fillSingleTB ? constants::MAXGLOBALPADROW : row + 1; diff --git a/Detectors/TPC/workflow/src/TPCRefitter.cxx b/Detectors/TPC/workflow/src/TPCRefitter.cxx index 7c14c8cd7d973..211f14cfae184 100644 --- a/Detectors/TPC/workflow/src/TPCRefitter.cxx +++ b/Detectors/TPC/workflow/src/TPCRefitter.cxx @@ -509,7 +509,7 @@ bool TPCRefitterSpec::processTPCTrack(o2::tpc::TrackTPC tr, o2::MCCompLabel lbl, unsigned int absoluteIndex = mTPCClusterIdxStruct->clusterOffset[sector][row] + clusterIndex; cl = &mTPCClusterIdxStruct->clusters[sector][row][clusterIndex]; uint8_t clflags = cl->getFlags(); - if (mTPCRefitterShMap[absoluteIndex] & GPUCA_NAMESPACE::gpu::GPUTPCGMMergedTrackHit::flagShared) { + if (mTPCRefitterShMap[absoluteIndex] & o2::gpu::GPUTPCGMMergedTrackHit::flagShared) { clflags |= 0x10; } clData.clSector.emplace_back(sector); diff --git a/GPU/CMakeLists.txt b/GPU/CMakeLists.txt index 95167d0a8b59a..3c83c583eebfc 100644 --- a/GPU/CMakeLists.txt +++ b/GPU/CMakeLists.txt @@ -9,14 +9,9 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -# Subdirectories will be compiled with O2 / AliRoot / Standalone To simplify the +# Subdirectories will be compiled with O2 / Standalone To simplify the # CMake, variables are defined for Sources / Headers first. Then, the actual # CMake build scripts use these variables. -# -# SRCS: Common Sources for all builds HDRS_CINT: Headers for ROOT dictionary -# (always) HDRS_CINT_ALIROOT: Headers for ROOT dictionary (only in AliRoot) -# HDRS_CINT_O2: Headers for ROOT dictionary (only for O2) HDRS_INSTALL: Headers -# for installation only if(NOT DEFINED GPUCA_NO_FAST_MATH) set(GPUCA_NO_FAST_MATH 0) diff --git a/GPU/Common/CMakeLists.txt b/GPU/Common/CMakeLists.txt index 2a31747b3673e..21253f7f9b815 100644 --- a/GPU/Common/CMakeLists.txt +++ b/GPU/Common/CMakeLists.txt @@ -66,26 +66,3 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") endif() install(FILES ${HDRS_INSTALL} DESTINATION include/GPU) endif() - -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - add_definitions(-DGPUCA_ALIROOT_LIB) - - set(SRCS ${SRCS} ../GPUTracking/utils/EmptyFile.cxx) - - # Add a library to the project using the specified source files - add_library_tested(Ali${MODULE} SHARED ${SRCS}) - - # Additional compilation flags - set_target_properties(Ali${MODULE} PROPERTIES COMPILE_FLAGS "") - - # System dependent: Modify the way the library is build - if(${CMAKE_SYSTEM} MATCHES Darwin) - set_target_properties(Ali${MODULE} - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - endif(${CMAKE_SYSTEM} MATCHES Darwin) - - # Installation - install(TARGETS Ali${MODULE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS_INSTALL} DESTINATION include) -endif() \ No newline at end of file diff --git a/GPU/Common/GPUCommonAlgorithm.h b/GPU/Common/GPUCommonAlgorithm.h index dd3cc1925b04a..a733f0ff99f26 100644 --- a/GPU/Common/GPUCommonAlgorithm.h +++ b/GPU/Common/GPUCommonAlgorithm.h @@ -24,7 +24,7 @@ // ----------------------------- SORTING ----------------------------- -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -72,9 +72,9 @@ class GPUCommonAlgorithm GPUd() static void IterSwap(I a, I b) noexcept; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -218,7 +218,7 @@ GPUdi() void GPUCommonAlgorithm::QuickSort(I f, I l) noexcept typedef GPUCommonAlgorithm CAAlgo; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #if (((defined(__CUDACC__) && !defined(__clang__)) || defined(__HIPCC__))) && !defined(GPUCA_GPUCODE_GENRTC) && !defined(GPUCA_GPUCODE_HOSTONLY) @@ -226,7 +226,7 @@ typedef GPUCommonAlgorithm CAAlgo; #else -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -248,12 +248,12 @@ GPUdi() void GPUCommonAlgorithm::sortDeviceDynamic(T* begin, T* end, const S& co } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // THRUST // sort and sortInBlock below are not taken from Thrust, since our implementations are faster -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -329,7 +329,7 @@ GPUdi() void GPUCommonAlgorithm::swap(T& a, T& b) #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 // ----------------------------- WORK GROUP FUNCTIONS ----------------------------- diff --git a/GPU/Common/GPUCommonAlgorithmThrust.h b/GPU/Common/GPUCommonAlgorithmThrust.h index 8c99200e00183..0208c12f1cd08 100644 --- a/GPU/Common/GPUCommonAlgorithmThrust.h +++ b/GPU/Common/GPUCommonAlgorithmThrust.h @@ -30,7 +30,7 @@ #define GPUCA_THRUST_NAMESPACE thrust::hip #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -88,6 +88,6 @@ GPUdi() void GPUCommonAlgorithm::sortDeviceDynamic(T* begin, T* end, const S& co } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/Common/GPUCommonConstants.h b/GPU/Common/GPUCommonConstants.h index d209b6a42a794..01d67eab1f9d3 100644 --- a/GPU/Common/GPUCommonConstants.h +++ b/GPU/Common/GPUCommonConstants.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE::gpu::gpu_common_constants +namespace o2::gpu::gpu_common_constants { static constexpr const float kCLight = 0.000299792458f; // TODO: Duplicate of MathConstants, fix this now that we use only OpenCL CPP } diff --git a/GPU/Common/GPUCommonDef.h b/GPU/Common/GPUCommonDef.h index 059e011a715d8..62d665d36c285 100644 --- a/GPU/Common/GPUCommonDef.h +++ b/GPU/Common/GPUCommonDef.h @@ -40,22 +40,16 @@ #endif #endif -// Set AliRoot / O2 namespace -#if defined(GPUCA_STANDALONE) || (defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE)) || defined(GPUCA_ALIROOT_LIB) || defined (GPUCA_GPUCODE) +#if defined(GPUCA_STANDALONE) || (defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE)) || defined (GPUCA_GPUCODE) #define GPUCA_ALIGPUCODE #endif -#ifdef GPUCA_ALIROOT_LIB - #define GPUCA_NAMESPACE AliGPU -#else - #define GPUCA_NAMESPACE o2 -#endif #if (defined(__CUDACC__) && defined(GPUCA_CUDA_NO_CONSTANT_MEMORY)) || (defined(__HIPCC__) && defined(GPUCA_HIP_NO_CONSTANT_MEMORY)) || (defined(__OPENCL__) && defined(GPUCA_OPENCL_NO_CONSTANT_MEMORY)) #define GPUCA_NO_CONSTANT_MEMORY #elif defined(__CUDACC__) || defined(__HIPCC__) #define GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM #endif -#if !defined(GPUCA_HAVE_O2HEADERS) && (defined(GPUCA_O2_LIB) || (!defined(GPUCA_ALIROOT_LIB) && !defined(GPUCA_STANDALONE))) +#if !defined(GPUCA_HAVE_O2HEADERS) && (defined(GPUCA_O2_LIB) || !defined(GPUCA_STANDALONE)) #define GPUCA_HAVE_O2HEADERS #endif diff --git a/GPU/Common/GPUCommonDefAPI.h b/GPU/Common/GPUCommonDefAPI.h index 23e16c75f098f..0cd3c4ebddb7f 100644 --- a/GPU/Common/GPUCommonDefAPI.h +++ b/GPU/Common/GPUCommonDefAPI.h @@ -104,12 +104,12 @@ #define GPUbarrier() barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE) #define GPUbarrierWarp() #if defined(__OPENCL__) && defined(GPUCA_OPENCL_CLANG_C11_ATOMICS) - namespace GPUCA_NAMESPACE { namespace gpu { + namespace o2 { namespace gpu { template struct oclAtomic; template <> struct oclAtomic {typedef atomic_uint t;}; static_assert(sizeof(oclAtomic::t) == sizeof(uint32_t), "Invalid size of atomic type"); }} - #define GPUAtomic(type) GPUCA_NAMESPACE::gpu::oclAtomic::t + #define GPUAtomic(type) o2::gpu::oclAtomic::t #else #define GPUAtomic(type) volatile type #endif diff --git a/GPU/Common/GPUCommonLogger.h b/GPU/Common/GPUCommonLogger.h index ca5a8ff3c3410..0b6b5ae401244 100644 --- a/GPU/Common/GPUCommonLogger.h +++ b/GPU/Common/GPUCommonLogger.h @@ -45,7 +45,7 @@ struct DummyLogger { #define LOGP(...) // #define LOGP(...) static_assert(false, "LOGP(...) unsupported in GPU code"); -#elif defined(GPUCA_STANDALONE) || defined(GPUCA_ALIROOT_LIB) +#elif defined(GPUCA_STANDALONE) #include #include #define LOG(type) std::cout diff --git a/GPU/Common/GPUCommonMath.h b/GPU/Common/GPUCommonMath.h index 27b3be8869b94..9aa260f59842f 100644 --- a/GPU/Common/GPUCommonMath.h +++ b/GPU/Common/GPUCommonMath.h @@ -31,7 +31,7 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -552,6 +552,6 @@ GPUdii() void GPUCommonMath::AtomicMinInternal(GPUglobalref() GPUgeneric() GPUAt #undef CHOICE } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUCOMMONMATH_H diff --git a/GPU/Common/GPUCommonTransform3D.h b/GPU/Common/GPUCommonTransform3D.h index 5cd09254d30d2..4c5cca1f00ddc 100644 --- a/GPU/Common/GPUCommonTransform3D.h +++ b/GPU/Common/GPUCommonTransform3D.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -80,6 +80,6 @@ class Transform3D kDZ = 11 }; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUConstantMem.h b/GPU/GPUTracking/Base/GPUConstantMem.h index 26c7726d13ca6..2a9a15e10f491 100644 --- a/GPU/GPUTracking/Base/GPUConstantMem.h +++ b/GPU/GPUTracking/Base/GPUConstantMem.h @@ -21,25 +21,10 @@ #include "GPUErrors.h" #include "GPUTPCGMMerger.h" -#if (!defined(GPUCA_GPUCODE) || !defined(GPUCA_ALIROOT_LIB)) #include "GPUTRDTracker.h" -#else -#include "GPUTRDDef.h" -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -template -class GPUTRDTracker_t -{ - void SetMaxData(const GPUTrackingInOutPointers& io) {} -}; -} // namespace gpu -} // namespace GPUCA_NAMESPACE -#endif // Dummies for stuff not suppored in legacy code, or for what requires O2 headers while not available -#if (!defined(GPUCA_GPUCODE) || !defined(GPUCA_ALIROOT_LIB)) && defined(GPUCA_HAVE_O2HEADERS) +#if defined(GPUCA_HAVE_O2HEADERS) #include "GPUTPCConvert.h" #include "GPUTPCCompression.h" #include "GPUTPCDecompression.h" @@ -54,7 +39,7 @@ class GPUTRDTracker_t #include "GPUKernelDebugOutput.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -123,11 +108,11 @@ union GPUConstantMemCopyable { static constexpr size_t gGPUConstantMemBufferSize = (sizeof(GPUConstantMem) + sizeof(uint4) - 1); #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #if defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM) && !defined(GPUCA_GPUCODE_HOSTONLY) -GPUconstant() GPUCA_NAMESPACE::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer; +GPUconstant() o2::gpu::GPUConstantMemCopyable gGPUConstantMemBuffer; #endif // GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -153,6 +138,6 @@ GPUdi() void GPUProcessor::raiseError(uint32_t code, uint32_t param1, uint32_t p } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUGeneralKernels.cxx b/GPU/GPUTracking/Base/GPUGeneralKernels.cxx index 44faf09112e5e..e1a3ce69dd8df 100644 --- a/GPU/GPUTracking/Base/GPUGeneralKernels.cxx +++ b/GPU/GPUTracking/Base/GPUGeneralKernels.cxx @@ -14,7 +14,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUMemClean16::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUglobalref() void* ptr, uint64_t size) diff --git a/GPU/GPUTracking/Base/GPUGeneralKernels.h b/GPU/GPUTracking/Base/GPUGeneralKernels.h index 333a53576663b..e11f818297770 100644 --- a/GPU/GPUTracking/Base/GPUGeneralKernels.h +++ b/GPU/GPUTracking/Base/GPUGeneralKernels.h @@ -32,7 +32,7 @@ #define GPUCA_CUB cub #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -111,7 +111,7 @@ class GPUitoa : public GPUKernelTemplate }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #undef GPUCA_CUB diff --git a/GPU/GPUTracking/Base/GPUKernelDebugOutput.cxx b/GPU/GPUTracking/Base/GPUKernelDebugOutput.cxx index be4207abc75d3..a417c41f2db60 100644 --- a/GPU/GPUTracking/Base/GPUKernelDebugOutput.cxx +++ b/GPU/GPUTracking/Base/GPUKernelDebugOutput.cxx @@ -17,7 +17,7 @@ #ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUKernelDebugOutput::InitializeProcessor() {} diff --git a/GPU/GPUTracking/Base/GPUKernelDebugOutput.h b/GPU/GPUTracking/Base/GPUKernelDebugOutput.h index 2a032125ced79..dc60014718677 100644 --- a/GPU/GPUTracking/Base/GPUKernelDebugOutput.h +++ b/GPU/GPUTracking/Base/GPUKernelDebugOutput.h @@ -19,7 +19,7 @@ #include "GPUProcessor.h" #ifdef GPUCA_KERNEL_DEBUGGER_OUTPUT -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -76,7 +76,7 @@ class GPUKernelDebugOutput : public GPUProcessor }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif #endif diff --git a/GPU/GPUTracking/Base/GPUMemoryResource.cxx b/GPU/GPUTracking/Base/GPUMemoryResource.cxx index ccc912fe6c036..b22267859345a 100644 --- a/GPU/GPUTracking/Base/GPUMemoryResource.cxx +++ b/GPU/GPUTracking/Base/GPUMemoryResource.cxx @@ -13,4 +13,4 @@ /// \author David Rohr #include "GPUMemoryResource.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; diff --git a/GPU/GPUTracking/Base/GPUMemoryResource.h b/GPU/GPUTracking/Base/GPUMemoryResource.h index 143a0ead26235..5037e7800d4d9 100644 --- a/GPU/GPUTracking/Base/GPUMemoryResource.h +++ b/GPU/GPUTracking/Base/GPUMemoryResource.h @@ -18,7 +18,7 @@ #include "GPUCommonDef.h" #include "GPUProcessor.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -104,6 +104,6 @@ class GPUMemoryResource MemoryType mType; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUParam.cxx b/GPU/GPUTracking/Base/GPUParam.cxx index 39b5a18c51eff..6726c022e5ddb 100644 --- a/GPU/GPUTracking/Base/GPUParam.cxx +++ b/GPU/GPUTracking/Base/GPUParam.cxx @@ -21,13 +21,8 @@ #include "GPUDataTypes.h" #include "GPUConstantMem.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#ifdef GPUCA_ALIROOT_LIB -#include "AliTPCClusterParam.h" -#include "AliTPCcalibDB.h" -#include -#endif #include #include #ifdef GPUCA_HAVE_O2HEADERS @@ -155,7 +150,7 @@ void GPUParam::UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessi void GPUParam::UpdateBzOnly(float newSolenoidBz) { bzkG = newSolenoidBz; - bzCLight = bzkG * GPUCA_NAMESPACE::gpu::gpu_common_constants::kCLight; + bzCLight = bzkG * o2::gpu::gpu_common_constants::kCLight; polynomialField.Reset(); if (par.assumeConstantBz) { GPUTPCGMPolynomialFieldManager::GetPolynomialField(GPUTPCGMPolynomialFieldManager::kUniform, bzkG, polynomialField); @@ -193,81 +188,6 @@ void GPUParam::UpdateRun3ClusterErrors(const float* yErrorParam, const float* zE #endif } -#ifndef GPUCA_ALIROOT_LIB -void GPUParam::LoadClusterErrors(bool Print) -{ -} -#else - -#include -#include -void GPUParam::LoadClusterErrors(bool Print) -{ - // update of calculated values - const AliTPCClusterParam* clparam = AliTPCcalibDB::Instance()->GetClusterParam(); - if (!clparam) { - std::cout << "Error: GPUParam::LoadClusterErrors():: No AliTPCClusterParam instance found !!!! " << std::endl; - return; - } - - for (int32_t i = 0; i < 2; i++) { - for (int32_t j = 0; j < 3; j++) { - for (int32_t k = 0; k < 6; k++) { - ParamS0Par[i][j][k] = clparam->GetParamS0Par(i, j, k); - } - } - } - - for (int32_t i = 0; i < 2; i++) { - for (int32_t j = 0; j < 3; j++) { - for (int32_t k = 0; k < 4; k++) { - ParamErrorsSeeding0[i][j][k] = clparam->GetParamRMS0(i, j, k); - } - } - } - - if (Print) { - typedef std::numeric_limits flt; - std::cout << std::scientific; - std::cout << std::setprecision(flt::max_digits10 + 2); - std::cout << "ParamS0Par[2][3][7]=" << std::endl; - std::cout << " { " << std::endl; - for (int32_t i = 0; i < 2; i++) { - std::cout << " { " << std::endl; - for (int32_t j = 0; j < 3; j++) { - std::cout << " { "; - for (int32_t k = 0; k < 6; k++) { - std::cout << ParamS0Par[i][j][k] << ", "; - } - std::cout << " }, " << std::endl; - } - std::cout << " }, " << std::endl; - } - std::cout << " }; " << std::endl; - - std::cout << "ParamErrorsSeeding0[2][3][4]=" << std::endl; - std::cout << " { " << std::endl; - for (int32_t i = 0; i < 2; i++) { - std::cout << " { " << std::endl; - for (int32_t j = 0; j < 3; j++) { - std::cout << " { "; - for (int32_t k = 0; k < 4; k++) { - std::cout << ParamErrorsSeeding0[i][j][k] << ", "; - } - std::cout << " }, " << std::endl; - } - std::cout << " }, " << std::endl; - } - std::cout << " }; " << std::endl; - - const THnBase* waveMap = clparam->GetWaveCorrectionMap(); - const THnBase* resYMap = clparam->GetResolutionYMap(); - std::cout << "waveMap = " << (void*)waveMap << std::endl; - std::cout << "resYMap = " << (void*)resYMap << std::endl; - } -} -#endif - void GPUParamRTC::setFrom(const GPUParam& param) { memcpy((void*)this, (void*)¶m, sizeof(param)); @@ -285,4 +205,4 @@ std::string GPUParamRTC::generateRTCCode(const GPUParam& param, bool useConstexp qConfigPrintRtc(std::make_tuple(¶m.rec.tpc, ¶m.rec.trd, ¶m.rec, ¶m.par), useConstexpr); } -static_assert(sizeof(GPUCA_NAMESPACE::gpu::GPUParam) == sizeof(GPUCA_NAMESPACE::gpu::GPUParamRTC), "RTC param size mismatch"); +static_assert(sizeof(o2::gpu::GPUParam) == sizeof(o2::gpu::GPUParamRTC), "RTC param size mismatch"); diff --git a/GPU/GPUTracking/Base/GPUParam.h b/GPU/GPUTracking/Base/GPUParam.h index 1a3ff9065dc94..78c13d19be81d 100644 --- a/GPU/GPUTracking/Base/GPUParam.h +++ b/GPU/GPUTracking/Base/GPUParam.h @@ -31,7 +31,7 @@ using Propagator = PropagatorImpl; } // namespace o2::base #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -85,7 +85,6 @@ struct GPUParam : public internal::GPUParam_t void SetDefaults(const GPUSettingsGRP* g, const GPUSettingsRec* r = nullptr, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr); void UpdateSettings(const GPUSettingsGRP* g, const GPUSettingsProcessing* p = nullptr, const GPURecoStepConfiguration* w = nullptr, const GPUSettingsRecDynamic* d = nullptr); void UpdateBzOnly(float newSolenoidBz); - void LoadClusterErrors(bool Print = 0); void UpdateRun3ClusterErrors(const float* yErrorParam, const float* zErrorParam); #endif @@ -116,6 +115,6 @@ struct GPUParam : public internal::GPUParam_t }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUParam.inc b/GPU/GPUTracking/Base/GPUParam.inc index 357af42276575..87d7b2dc4c7cd 100644 --- a/GPU/GPUTracking/Base/GPUParam.inc +++ b/GPU/GPUTracking/Base/GPUParam.inc @@ -19,7 +19,7 @@ #include "GPUTPCGMMergedTrackHit.h" #include "GPUTPCClusterOccupancyMap.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -224,6 +224,6 @@ GPUdi() bool GPUParam::rejectEdgeClusterByY(float uncorrectedY, int32_t iRow, fl } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUParamRTC.h b/GPU/GPUTracking/Base/GPUParamRTC.h index d7959a294854c..dd9cf73e38a1e 100644 --- a/GPU/GPUTracking/Base/GPUParamRTC.h +++ b/GPU/GPUTracking/Base/GPUParamRTC.h @@ -18,7 +18,7 @@ #include "GPUParam.h" #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -39,6 +39,6 @@ struct GPUParamRTC : public internal::GPUParam_t #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -158,6 +158,6 @@ class GPUProcessor friend class GPUTPCNeighboursFinder; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstruction.cxx b/GPU/GPUTracking/Base/GPUReconstruction.cxx index 9abe225c7848e..1fa8af0adffe8 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.cxx +++ b/GPU/GPUTracking/Base/GPUReconstruction.cxx @@ -46,7 +46,7 @@ #include "GPUReconstructionIncludesITS.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -66,9 +66,9 @@ struct GPUReconstructionPipelineContext { bool terminate = false; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; constexpr const char* const GPUReconstruction::GEOMETRY_TYPE_NAMES[]; constexpr const char* const GPUReconstruction::IOTYPENAMES[]; diff --git a/GPU/GPUTracking/Base/GPUReconstruction.h b/GPU/GPUTracking/Base/GPUReconstruction.h index 6951646dff840..6fd00e1fda207 100644 --- a/GPU/GPUTracking/Base/GPUReconstruction.h +++ b/GPU/GPUTracking/Base/GPUReconstruction.h @@ -44,7 +44,7 @@ class TimeFrame; } // namespace its } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -645,6 +645,6 @@ inline int32_t GPUReconstruction::ReadStructFromFile(const char* file, T* obj) return 0; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx b/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx index 271bee59db31b..944fcb32e4eda 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionCPU.cxx @@ -47,8 +47,8 @@ static inline int32_t omp_get_thread_num() { return 0; } static inline int32_t omp_get_max_threads() { return 1; } #endif -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::gpu_reconstruction_kernels; +using namespace o2::gpu; +using namespace o2::gpu::gpu_reconstruction_kernels; constexpr GPUReconstructionCPU::krnlRunRange GPUReconstructionCPU::krnlRunRangeNone; constexpr GPUReconstructionCPU::krnlEvent GPUReconstructionCPU::krnlEventNone; diff --git a/GPU/GPUTracking/Base/GPUReconstructionCPU.h b/GPU/GPUTracking/Base/GPUReconstructionCPU.h index 7eaf3e4a5e40d..8cc753731d074 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionCPU.h +++ b/GPU/GPUTracking/Base/GPUReconstructionCPU.h @@ -26,7 +26,7 @@ #include "GPUReconstructionKernelIncludes.h" #include "GPUReconstructionKernels.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -307,6 +307,6 @@ HighResTimer& GPUReconstructionCPU::getTimer(const char* name, int32_t num) } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionConvert.cxx b/GPU/GPUTracking/Base/GPUReconstructionConvert.cxx index 03898d16d5105..a21bdcf28dd35 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionConvert.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionConvert.cxx @@ -42,7 +42,7 @@ #include "DetectorsRaw/RDHUtils.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; using namespace o2::tpc::constants; using namespace std::string_literals; diff --git a/GPU/GPUTracking/Base/GPUReconstructionConvert.h b/GPU/GPUTracking/Base/GPUReconstructionConvert.h index 6e0f80d6678b9..b8aedbcde582b 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionConvert.h +++ b/GPU/GPUTracking/Base/GPUReconstructionConvert.h @@ -37,7 +37,7 @@ class RawFileWriter; struct AliHLTTPCRawCluster; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -64,6 +64,6 @@ class GPUReconstructionConvert }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.cxx b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.cxx index c9155c1cb8f60..1ded2899a116b 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.cxx @@ -18,7 +18,7 @@ #include "GPUTPCTracker.h" #include "GPUTPCSliceOutput.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #if defined(_WIN32) #include "../utils/pthread_mutex_win32_wrapper.h" @@ -42,8 +42,6 @@ GPUReconstructionDeviceBase::GPUReconstructionDeviceBase(const GPUSettingsDevice GPUReconstructionDeviceBase::~GPUReconstructionDeviceBase() { // make d'tor such that vtable is created for this class - // needed for build with AliRoot, otherwise dynamic loading of GPU libraries will fail - (void)0; // Avoid compiler warnings } void* GPUReconstructionDeviceBase::helperWrapper_static(void* arg) diff --git a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h index 5a3f02efe7e3b..215615f558442 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h +++ b/GPU/GPUTracking/Base/GPUReconstructionDeviceBase.h @@ -21,7 +21,7 @@ #include "GPUChain.h" #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -103,6 +103,6 @@ inline size_t GPUReconstructionDeviceBase::GPUMemCpyAlways(bool onGpu, void* dst } } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionHelpers.h b/GPU/GPUTracking/Base/GPUReconstructionHelpers.h index 75bce35e02fa1..c55e81905f32f 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionHelpers.h +++ b/GPU/GPUTracking/Base/GPUReconstructionHelpers.h @@ -17,7 +17,7 @@ #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -45,6 +45,6 @@ class GPUReconstructionHelpers }; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionIncludes.h b/GPU/GPUTracking/Base/GPUReconstructionIncludes.h index 4575c77b6ff54..d4502b978ef5b 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionIncludes.h +++ b/GPU/GPUTracking/Base/GPUReconstructionIncludes.h @@ -29,11 +29,6 @@ #include #include -#if defined(GPUCA_ALIROOT_LIB) && !defined(GPUCA_GPUCODE) -#include "AliHLTDefinitions.h" -#include "AliHLTSystem.h" -#endif - #define GPUCA_GPUReconstructionUpdateDefaults() \ if (mProcessingSettings.trackletConstructorInPipeline < 0) { \ mProcessingSettings.trackletConstructorInPipeline = GPUCA_CONSTRUCTOR_IN_PIPELINE; \ diff --git a/GPU/GPUTracking/Base/GPUReconstructionIncludesDeviceAll.template.h b/GPU/GPUTracking/Base/GPUReconstructionIncludesDeviceAll.template.h index 4822332a1839c..02008ed0ff78f 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionIncludesDeviceAll.template.h +++ b/GPU/GPUTracking/Base/GPUReconstructionIncludesDeviceAll.template.h @@ -17,13 +17,13 @@ #include "GPUDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { } -} // namespace GPUCA_NAMESPACE -using namespace GPUCA_NAMESPACE::gpu; +} // namespace o2 +using namespace o2::gpu; // clang-format off $>,APPEND,">,PREPEND,#include ">, diff --git a/GPU/GPUTracking/Base/GPUReconstructionKernelList.template.h b/GPU/GPUTracking/Base/GPUReconstructionKernelList.template.h index 1def09c61e606..92fa2546d3ca0 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionKernelList.template.h +++ b/GPU/GPUTracking/Base/GPUReconstructionKernelList.template.h @@ -15,14 +15,6 @@ // No header protection, this may be used multiple times #include "GPUReconstructionKernelMacros.h" -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) -#define GPUCA_KRNL_NOALIROOT -#endif - // clang-format off $,> // clang-format on - -#ifdef GPUCA_KRNL_NOALIROOT -#undef GPUCA_KRNL_NOALIROOT -#endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionKernels.h b/GPU/GPUTracking/Base/GPUReconstructionKernels.h index e5c22dd7f3cd5..d5d329d55ad4a 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionKernels.h +++ b/GPU/GPUTracking/Base/GPUReconstructionKernels.h @@ -17,7 +17,7 @@ #include "GPUReconstruction.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -127,6 +127,6 @@ class GPUReconstructionKernels : public T }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx b/GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx index f3749c160c3ff..94b16ae5a6936 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionLibrary.cxx @@ -33,7 +33,7 @@ #include "GPULogging.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUReconstruction* GPUReconstruction::CreateInstance(DeviceType type, bool forceType, GPUReconstruction* master) { diff --git a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx index 840a24a695706..fbca43e03781a 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx +++ b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx @@ -31,9 +31,9 @@ #include "utils/qconfig.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { extern GPUSettingsStandalone configStandalone; } diff --git a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.h b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.h index 1ffb730b54d55..a4f2e055da2c3 100644 --- a/GPU/GPUTracking/Base/GPUReconstructionTimeframe.h +++ b/GPU/GPUTracking/Base/GPUReconstructionTimeframe.h @@ -27,7 +27,7 @@ namespace o2::tpc struct ClusterNative; } // namespace o2::tpc -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -74,6 +74,6 @@ class GPUReconstructionTimeframe std::vector> mShiftedEvents; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/cuda/CMakeLists.txt b/GPU/GPUTracking/Base/cuda/CMakeLists.txt index 995b9224a4ad0..7c382e9b9374d 100644 --- a/GPU/GPUTracking/Base/cuda/CMakeLists.txt +++ b/GPU/GPUTracking/Base/cuda/CMakeLists.txt @@ -20,89 +20,87 @@ message(STATUS "Building GPUTracking with CUDA support ${TMP_TARGET}") set(SRCS GPUReconstructionCUDA.cu GPUReconstructionCUDAGenRTC.cxx GPUReconstructionCUDAKernels.cu) set(HDRS GPUReconstructionCUDA.h GPUReconstructionCUDAInternals.h GPUReconstructionCUDADef.h GPUReconstructionCUDAIncludes.h CUDAThrustHelpers.h) # -------------------------------- Prepare RTC ------------------------------------------------------- -if(NOT ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - enable_language(ASM) - if(ALIGPU_BUILD_TYPE STREQUAL "O2") - set(defineIncludeSrc "O2::${MODULE}") - else() - set(defineIncludeSrc "${MODULE}") - endif() - set(GPU_RTC_DEFINES "-D$,$-D>") - set(GPU_RTC_INCLUDES "-I$,EXCLUDE,^/usr/include/?>,$-I>" - -I${CMAKE_SOURCE_DIR}/Detectors/Base/src - -I${CMAKE_SOURCE_DIR}/Detectors/TRD/base/src - ) - if(ALIGPU_BUILD_TYPE STREQUAL "O2") - set(GPU_RTC_INCLUDES ${GPU_RTC_INCLUDES} "-I$,EXCLUDE,^/usr/include/?>,$-I>") - endif() - #set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -keep") - - # build flags to use for RTC - set(GPU_RTC_FLAGS "${CMAKE_CUDA_FLAGS} ${CMAKE_CUDA_FLAGS_${CMAKE_BUILD_TYPE_UPPER}} -std=c++${CMAKE_CUDA_STANDARD}") - set(GPU_RTC_FLAGS_ARCH "") - if(CUDA_COMPUTETARGET) - foreach(CUDA_ARCH ${CUDA_COMPUTETARGET}) - set(GPU_RTC_FLAGS_ARCH "${GPU_RTC_FLAGS_ARCH} -gencode arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}") - endforeach() - list (GET CUDA_COMPUTETARGET 0 RTC_CUDA_ARCH) - set(RTC_CUDA_ARCH "${RTC_CUDA_ARCH}0") - else() - set(RTC_CUDA_ARCH "750") - endif() - if(GPUCA_CUDA_GCCBIN) - set(GPU_RTC_FLAGS "${GPU_RTC_FLAGS} --compiler-bindir ${GPUCA_CUDA_GCCBIN}") - endif() - set(GPU_RTC_FLAGS_SEPARATED "${GPU_RTC_FLAGS}") - separate_arguments(GPU_RTC_FLAGS_SEPARATED) - - # convenience variables - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") - get_filename_component(GPUDIR ${CMAKE_SOURCE_DIR}/../ ABSOLUTE) - else() - set(GPUDIR ${CMAKE_SOURCE_DIR}/GPU/GPUTracking) - endif() - - set(GPU_RTC_SRC ${GPUDIR}/Base/cuda/GPUReconstructionCUDArtc.cu) - set(GPU_RTC_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionCUDArtc) - - # cmake-format: off - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.src - COMMAND cat ${GPUDIR}/Base/cuda/GPUReconstructionCUDAIncludes.h > ${GPU_RTC_BIN}.src - COMMAND ${CMAKE_CXX_COMPILER} ${GPU_RTC_DEFINES} ${GPU_RTC_INCLUDES} -std=c++${CMAKE_CUDA_STANDARD} -D__CUDA_ARCH__=${RTC_CUDA_ARCH} -D__CUDACC__ -x c++ -nostdinc -E ${GPU_RTC_SRC} >> ${GPU_RTC_BIN}.src - MAIN_DEPENDENCY ${GPU_RTC_SRC} - IMPLICIT_DEPENDS CXX ${GPU_RTC_SRC} - COMMAND_EXPAND_LISTS - COMMENT "Preparing CUDA RTC source file ${GPU_RTC_BIN}.src" - ) - create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o) +enable_language(ASM) +if(ALIGPU_BUILD_TYPE STREQUAL "O2") + set(defineIncludeSrc "O2::${MODULE}") +else() + set(defineIncludeSrc "${MODULE}") +endif() +set(GPU_RTC_DEFINES "-D$,$-D>") +set(GPU_RTC_INCLUDES "-I$,EXCLUDE,^/usr/include/?>,$-I>" + -I${CMAKE_SOURCE_DIR}/Detectors/Base/src + -I${CMAKE_SOURCE_DIR}/Detectors/TRD/base/src +) +if(ALIGPU_BUILD_TYPE STREQUAL "O2") + set(GPU_RTC_INCLUDES ${GPU_RTC_INCLUDES} "-I$,EXCLUDE,^/usr/include/?>,$-I>") +endif() +#set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -keep") + +# build flags to use for RTC +set(GPU_RTC_FLAGS "${CMAKE_CUDA_FLAGS} ${CMAKE_CUDA_FLAGS_${CMAKE_BUILD_TYPE_UPPER}} -std=c++${CMAKE_CUDA_STANDARD}") +set(GPU_RTC_FLAGS_ARCH "") +if(CUDA_COMPUTETARGET) + foreach(CUDA_ARCH ${CUDA_COMPUTETARGET}) + set(GPU_RTC_FLAGS_ARCH "${GPU_RTC_FLAGS_ARCH} -gencode arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}") + endforeach() + list (GET CUDA_COMPUTETARGET 0 RTC_CUDA_ARCH) + set(RTC_CUDA_ARCH "${RTC_CUDA_ARCH}0") +else() + set(RTC_CUDA_ARCH "750") +endif() +if(GPUCA_CUDA_GCCBIN) + set(GPU_RTC_FLAGS "${GPU_RTC_FLAGS} --compiler-bindir ${GPUCA_CUDA_GCCBIN}") +endif() +set(GPU_RTC_FLAGS_SEPARATED "${GPU_RTC_FLAGS}") +separate_arguments(GPU_RTC_FLAGS_SEPARATED) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done - COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done || bash -c "echo ERROR: CUDA RTC sources contain standard headers 1>&2 && exit 1" - COMMENT Checking CUDA RTC File ${GPU_RTC_BIN}.src - DEPENDS ${GPU_RTC_BIN}.src VERBATIM) - add_custom_target(${MODULE}_CUDA_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done) +# convenience variables +if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") + get_filename_component(GPUDIR ${CMAKE_SOURCE_DIR}/../ ABSOLUTE) +else() + set(GPUDIR ${CMAKE_SOURCE_DIR}/GPU/GPUTracking) +endif() - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.command - COMMAND echo -n "${CMAKE_CUDA_COMPILER} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} -fatbin" > ${GPU_RTC_BIN}.command - COMMAND_EXPAND_LISTS - VERBATIM - COMMENT "Preparing CUDA RTC command file ${GPU_RTC_BIN}.command" - ) - create_binary_resource(${GPU_RTC_BIN}.command ${GPU_RTC_BIN}.command.o) +set(GPU_RTC_SRC ${GPUDIR}/Base/cuda/GPUReconstructionCUDArtc.cu) +set(GPU_RTC_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionCUDArtc) - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.command.arch - COMMAND echo -n "${GPU_RTC_FLAGS_ARCH}" > ${GPU_RTC_BIN}.command.arch - COMMAND_EXPAND_LISTS - VERBATIM - COMMENT "Preparing CUDA RTC ARCH file ${GPU_RTC_BIN}.command.arch" - ) - create_binary_resource(${GPU_RTC_BIN}.command.arch ${GPU_RTC_BIN}.command.arch.o) +# cmake-format: off +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.src + COMMAND cat ${GPUDIR}/Base/cuda/GPUReconstructionCUDAIncludes.h > ${GPU_RTC_BIN}.src + COMMAND ${CMAKE_CXX_COMPILER} ${GPU_RTC_DEFINES} ${GPU_RTC_INCLUDES} -std=c++${CMAKE_CUDA_STANDARD} -D__CUDA_ARCH__=${RTC_CUDA_ARCH} -D__CUDACC__ -x c++ -nostdinc -E ${GPU_RTC_SRC} >> ${GPU_RTC_BIN}.src + MAIN_DEPENDENCY ${GPU_RTC_SRC} + IMPLICIT_DEPENDS CXX ${GPU_RTC_SRC} + COMMAND_EXPAND_LISTS + COMMENT "Preparing CUDA RTC source file ${GPU_RTC_BIN}.src" +) +create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o) + +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done + COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done || bash -c "echo ERROR: CUDA RTC sources contain standard headers 1>&2 && exit 1" + COMMENT Checking CUDA RTC File ${GPU_RTC_BIN}.src + DEPENDS ${GPU_RTC_BIN}.src VERBATIM) +add_custom_target(${MODULE}_CUDA_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done) + +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.command + COMMAND echo -n "${CMAKE_CUDA_COMPILER} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} -fatbin" > ${GPU_RTC_BIN}.command + COMMAND_EXPAND_LISTS + VERBATIM + COMMENT "Preparing CUDA RTC command file ${GPU_RTC_BIN}.command" +) +create_binary_resource(${GPU_RTC_BIN}.command ${GPU_RTC_BIN}.command.o) - set(SRCS ${SRCS} ${GPU_RTC_BIN}.src.o ${GPU_RTC_BIN}.command.o ${GPU_RTC_BIN}.command.arch.o) -endif() +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.command.arch + COMMAND echo -n "${GPU_RTC_FLAGS_ARCH}" > ${GPU_RTC_BIN}.command.arch + COMMAND_EXPAND_LISTS + VERBATIM + COMMENT "Preparing CUDA RTC ARCH file ${GPU_RTC_BIN}.command.arch" +) +create_binary_resource(${GPU_RTC_BIN}.command.arch ${GPU_RTC_BIN}.command.arch.o) + +set(SRCS ${SRCS} ${GPU_RTC_BIN}.src.o ${GPU_RTC_BIN}.command.o ${GPU_RTC_BIN}.command.arch.o) # -------------------------------- End RTC ------------------------------------------------------- if(ALIGPU_BUILD_TYPE STREQUAL "O2") @@ -123,27 +121,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") install(FILES ${HDRS} DESTINATION include/GPU) endif() -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(targetName "Ali${MODULE}") - set(TMP_BASELIB AliGPUTracking) - # Generate the dictionary - get_directory_property(incdirs INCLUDE_DIRECTORIES) - generate_dictionary("${targetName}" "" "GPUReconstructionCUDA.h" "${incdirs} .") - - # Generate the ROOT map Dependecies - generate_rootmap("${targetName}" "" "") - - # Add a library to the project using the specified source files - add_library_tested(${targetName} SHARED ${SRCS} G__${targetName}.cxx) - target_link_libraries(${targetName} PUBLIC ${TMP_BASELIB}) - - # Installation - install(TARGETS ${targetName} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS} DESTINATION include) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -endif() - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") set(targetName "${MODULE}") set(TMP_BASELIB GPUTracking) @@ -168,11 +145,7 @@ endif() # Special handling of GPU kernels in case of per-kernel compilation / RDC if(NOT DEFINED GPUCA_CUDA_COMPILE_MODE) - if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(GPUCA_CUDA_COMPILE_MODE "onefile") - else() - set(GPUCA_CUDA_COMPILE_MODE "perkernel") - endif() + set(GPUCA_CUDA_COMPILE_MODE "perkernel") endif() if(GPUCA_CUDA_COMPILE_MODE STREQUAL "onefile") target_compile_definitions(${targetName} PRIVATE GPUCA_KERNEL_COMPILE_MODE=0) diff --git a/GPU/GPUTracking/Base/cuda/CUDAThrustHelpers.h b/GPU/GPUTracking/Base/cuda/CUDAThrustHelpers.h index 7f5f596d96abf..99399f505d552 100644 --- a/GPU/GPUTracking/Base/cuda/CUDAThrustHelpers.h +++ b/GPU/GPUTracking/Base/cuda/CUDAThrustHelpers.h @@ -19,7 +19,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -39,7 +39,7 @@ class ThrustVolatileAsyncAllocator }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #ifndef __HIPCC__ // Override synchronize call at end of thrust algorithm running on stream, just don't run cudaStreamSynchronize @@ -48,7 +48,7 @@ namespace thrust namespace cuda_cub { -typedef thrust::cuda_cub::execution_policy thrustStreamPolicy; +typedef thrust::cuda_cub::execution_policy thrustStreamPolicy; template <> __host__ __device__ inline cudaError_t synchronize(thrustStreamPolicy& policy) { diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu index dd35a23d67c21..26cbc282b6fc2 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.cu @@ -42,7 +42,7 @@ static constexpr size_t REQUIRE_FREE_MEMORY_RESERVED_PER_SM = 40L * 1024 * 1024; static constexpr size_t RESERVE_EXTRA_MEM_THRESHOLD = 10L * 1024 * 1024 * 1024; static constexpr size_t RESERVE_EXTRA_MEM_OFFSET = 1L * 512 * 1024 * 1024; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; __global__ void dummyInitKernel(void*) {} @@ -371,7 +371,6 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime() hipLaunchKernelGGL(HIP_KERNEL_NAME(dummyInitKernel), dim3(mBlockCount), dim3(256), 0, 0, mDeviceMemoryBase); #endif -#ifndef GPUCA_ALIROOT_LIB if (mProcessingSettings.rtc.enable) { genAndLoadRTC(); } @@ -384,7 +383,6 @@ int32_t GPUReconstructionCUDA::InitDevice_Runtime() #undef GPUCA_KRNL loadKernelModules(true, false); } -#endif #endif void* devPtrConstantMem = nullptr; #ifndef GPUCA_NO_CONSTANT_MEMORY @@ -698,7 +696,7 @@ void* GPUReconstructionHIP::getGPUPointer(void* ptr) } #endif // __HIPCC__ -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { template class GPUReconstructionKernels; } diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h index 070177fb344f1..49142d409c5ae 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDA.h @@ -20,12 +20,12 @@ #include #ifdef _WIN32 -extern "C" __declspec(dllexport) GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_CUDA(const GPUCA_NAMESPACE::gpu::GPUSettingsDeviceBackend& cfg); +extern "C" __declspec(dllexport) o2::gpu::GPUReconstruction* GPUReconstruction_Create_CUDA(const o2::gpu::GPUSettingsDeviceBackend& cfg); #else -extern "C" GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_CUDA(const GPUCA_NAMESPACE::gpu::GPUSettingsDeviceBackend& cfg); +extern "C" o2::gpu::GPUReconstruction* GPUReconstruction_Create_CUDA(const o2::gpu::GPUSettingsDeviceBackend& cfg); #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -105,6 +105,6 @@ class GPUReconstructionCUDA : public GPUReconstructionKernels -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "GPUConstantMem.h" diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx index 93340c82a39ba..7114d37380afc 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx @@ -27,18 +27,15 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#ifndef GPUCA_ALIROOT_LIB #include "utils/qGetLdBinarySymbols.h" QGET_LD_BINARY_SYMBOLS(GPUReconstructionCUDArtc_src); QGET_LD_BINARY_SYMBOLS(GPUReconstructionCUDArtc_command); QGET_LD_BINARY_SYMBOLS(GPUReconstructionCUDArtc_command_arch); -#endif int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile) { -#ifndef GPUCA_ALIROOT_LIB std::string rtcparam = std::string(mProcessingSettings.rtc.optSpecialCode ? "#define GPUCA_RTC_SPECIAL_CODE(...) __VA_ARGS__\n" : "#define GPUCA_RTC_SPECIAL_CODE(...)\n") + GPUParamRTC::generateRTCCode(param(), mProcessingSettings.rtc.optConstexpr); if (filename == "") { filename = "/tmp/o2cagpu_rtc_"; @@ -253,6 +250,5 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile) close(fd); } -#endif return 0; } diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAInternals.h b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAInternals.h index 246677b4b9647..d6c2742ef0581 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAInternals.h +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAInternals.h @@ -23,7 +23,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -86,6 +86,6 @@ class GPUDebugTiming static_assert(std::is_convertible::value, "CUDA event type incompatible to deviceEvent"); } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu index 72e5d16006a2f..2e695b49ebb6c 100644 --- a/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu +++ b/GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAKernels.cu @@ -19,7 +19,7 @@ #include "GPUReconstructionCUDAInternals.h" #include "CUDAThrustHelpers.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifdef GPUCA_USE_TEXTURES texture gAliTexRefu2; diff --git a/GPU/GPUTracking/Base/hip/CMakeLists.txt b/GPU/GPUTracking/Base/hip/CMakeLists.txt index acd87c528e8e4..729ac3cf483e9 100644 --- a/GPU/GPUTracking/Base/hip/CMakeLists.txt +++ b/GPU/GPUTracking/Base/hip/CMakeLists.txt @@ -66,81 +66,79 @@ set(SRCS_CXX ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPGenRTC.cxx) set(HDRS ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIP.h ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPInternals.h ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPDef.h ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPIncludes.h ${GPUCA_HIP_SOURCE_DIR}/HIPThrustHelpers.h) # -------------------------------- Prepare RTC ------------------------------------------------------- -if(NOT ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - enable_language(ASM) - if(ALIGPU_BUILD_TYPE STREQUAL "O2") - set(defineIncludeSrc "O2::${MODULE}") - else() - set(defineIncludeSrc "${MODULE}") - endif() - set(GPU_RTC_DEFINES "-D$,$-D>") - set(GPU_RTC_INCLUDES "-I$,EXCLUDE,^/usr/include/?>,$-I>" - -I${CMAKE_SOURCE_DIR}/Detectors/Base/src - -I${CMAKE_SOURCE_DIR}/Detectors/TRD/base/src - ) - if(ALIGPU_BUILD_TYPE STREQUAL "O2") - set(GPU_RTC_INCLUDES ${GPU_RTC_INCLUDES} "-I$,EXCLUDE,^/usr/include/?>,$-I>") - endif() - - # build flags to use for RTC - set(GPU_RTC_FLAGS "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${CMAKE_BUILD_TYPE_UPPER}} -std=c++${CMAKE_HIP_STANDARD}") - set(GPU_RTC_FLAGS_ARCH "") - foreach(HIP_ARCH ${CMAKE_HIP_ARCHITECTURES}) - set(GPU_RTC_FLAGS_ARCH "${GPU_RTC_FLAGS_ARCH} --offload-arch=${HIP_ARCH}") - endforeach() - - set(GPU_RTC_FLAGS_SEPARATED "${GPU_RTC_FLAGS}") - separate_arguments(GPU_RTC_FLAGS_SEPARATED) - - # convenience variables - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") - get_filename_component(GPUDIR ${CMAKE_SOURCE_DIR}/../ ABSOLUTE) - else() - set(GPUDIR ${CMAKE_SOURCE_DIR}/GPU/GPUTracking) - endif() +enable_language(ASM) +if(ALIGPU_BUILD_TYPE STREQUAL "O2") + set(defineIncludeSrc "O2::${MODULE}") +else() + set(defineIncludeSrc "${MODULE}") +endif() +set(GPU_RTC_DEFINES "-D$,$-D>") +set(GPU_RTC_INCLUDES "-I$,EXCLUDE,^/usr/include/?>,$-I>" + -I${CMAKE_SOURCE_DIR}/Detectors/Base/src + -I${CMAKE_SOURCE_DIR}/Detectors/TRD/base/src +) +if(ALIGPU_BUILD_TYPE STREQUAL "O2") + set(GPU_RTC_INCLUDES ${GPU_RTC_INCLUDES} "-I$,EXCLUDE,^/usr/include/?>,$-I>") +endif() - set(GPU_RTC_SRC ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPrtc.hip) - set(GPU_RTC_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionHIPrtc) +# build flags to use for RTC +set(GPU_RTC_FLAGS "${CMAKE_HIP_FLAGS} ${CMAKE_HIP_FLAGS_${CMAKE_BUILD_TYPE_UPPER}} -std=c++${CMAKE_HIP_STANDARD}") +set(GPU_RTC_FLAGS_ARCH "") +foreach(HIP_ARCH ${CMAKE_HIP_ARCHITECTURES}) + set(GPU_RTC_FLAGS_ARCH "${GPU_RTC_FLAGS_ARCH} --offload-arch=${HIP_ARCH}") +endforeach() - # cmake-format: off - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.src - COMMAND cat ${GPUDIR}/Base/hip/GPUReconstructionHIPIncludes.h > ${GPU_RTC_BIN}.src - COMMAND ${CMAKE_CXX_COMPILER} ${GPU_RTC_DEFINES} ${GPU_RTC_INCLUDES} -std=c++${CMAKE_HIP_STANDARD} -D__HIPCC__ -D__HIP_DEVICE_COMPILE__ -x c++ -nostdinc -E ${GPU_RTC_SRC} >> ${GPU_RTC_BIN}.src - MAIN_DEPENDENCY ${GPU_RTC_SRC} - IMPLICIT_DEPENDS CXX ${GPU_RTC_SRC} - DEPENDS ${MODULE}_HIPIFIED - COMMAND_EXPAND_LISTS - COMMENT "Preparing HIP RTC source file ${GPU_RTC_BIN}.src" - ) - create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o) +set(GPU_RTC_FLAGS_SEPARATED "${GPU_RTC_FLAGS}") +separate_arguments(GPU_RTC_FLAGS_SEPARATED) - add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done - COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done || bash -c "echo ERROR: HIP RTC sources contain standard headers 1>&2 && exit 1" - COMMENT Checking HIP RTC File ${GPU_RTC_BIN}.src - DEPENDS ${GPU_RTC_BIN}.src VERBATIM) - add_custom_target(${MODULE}_HIP_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done) +# convenience variables +if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") + get_filename_component(GPUDIR ${CMAKE_SOURCE_DIR}/../ ABSOLUTE) +else() + set(GPUDIR ${CMAKE_SOURCE_DIR}/GPU/GPUTracking) +endif() - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.command - COMMAND echo -n "${hip_HIPCC_EXECUTABLE} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} --genco" > ${GPU_RTC_BIN}.command - COMMAND_EXPAND_LISTS - VERBATIM - COMMENT "Preparing HIP RTC command file ${GPU_RTC_BIN}.command" - ) - create_binary_resource(${GPU_RTC_BIN}.command ${GPU_RTC_BIN}.command.o) +set(GPU_RTC_SRC ${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIPrtc.hip) +set(GPU_RTC_BIN ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionHIPrtc) + +# cmake-format: off +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.src + COMMAND cat ${GPUDIR}/Base/hip/GPUReconstructionHIPIncludes.h > ${GPU_RTC_BIN}.src + COMMAND ${CMAKE_CXX_COMPILER} ${GPU_RTC_DEFINES} ${GPU_RTC_INCLUDES} -std=c++${CMAKE_HIP_STANDARD} -D__HIPCC__ -D__HIP_DEVICE_COMPILE__ -x c++ -nostdinc -E ${GPU_RTC_SRC} >> ${GPU_RTC_BIN}.src + MAIN_DEPENDENCY ${GPU_RTC_SRC} + IMPLICIT_DEPENDS CXX ${GPU_RTC_SRC} + DEPENDS ${MODULE}_HIPIFIED + COMMAND_EXPAND_LISTS + COMMENT "Preparing HIP RTC source file ${GPU_RTC_BIN}.src" +) +create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o) + +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done + COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done || bash -c "echo ERROR: HIP RTC sources contain standard headers 1>&2 && exit 1" + COMMENT Checking HIP RTC File ${GPU_RTC_BIN}.src + DEPENDS ${GPU_RTC_BIN}.src VERBATIM) +add_custom_target(${MODULE}_HIP_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done) + +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.command + COMMAND echo -n "${hip_HIPCC_EXECUTABLE} ${GPU_RTC_FLAGS_SEPARATED} ${GPU_RTC_DEFINES} --genco" > ${GPU_RTC_BIN}.command + COMMAND_EXPAND_LISTS + VERBATIM + COMMENT "Preparing HIP RTC command file ${GPU_RTC_BIN}.command" +) +create_binary_resource(${GPU_RTC_BIN}.command ${GPU_RTC_BIN}.command.o) - add_custom_command( - OUTPUT ${GPU_RTC_BIN}.command.arch - COMMAND echo -n "${GPU_RTC_FLAGS_ARCH}" > ${GPU_RTC_BIN}.command.arch - COMMAND_EXPAND_LISTS - VERBATIM - COMMENT "Preparing HIP RTC ARCH file ${GPU_RTC_BIN}.command.arch" - ) - create_binary_resource(${GPU_RTC_BIN}.command.arch ${GPU_RTC_BIN}.command.arch.o) +add_custom_command( + OUTPUT ${GPU_RTC_BIN}.command.arch + COMMAND echo -n "${GPU_RTC_FLAGS_ARCH}" > ${GPU_RTC_BIN}.command.arch + COMMAND_EXPAND_LISTS + VERBATIM + COMMENT "Preparing HIP RTC ARCH file ${GPU_RTC_BIN}.command.arch" +) +create_binary_resource(${GPU_RTC_BIN}.command.arch ${GPU_RTC_BIN}.command.arch.o) - set(SRCS ${SRCS} ${GPU_RTC_BIN}.src.o ${GPU_RTC_BIN}.command.o ${GPU_RTC_BIN}.command.arch.o) -endif() +set(SRCS ${SRCS} ${GPU_RTC_BIN}.src.o ${GPU_RTC_BIN}.command.o ${GPU_RTC_BIN}.command.arch.o) # -------------------------------- End RTC ------------------------------------------------------- if(ALIGPU_BUILD_TYPE STREQUAL "O2") @@ -167,36 +165,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") # LABELS gpu) endif() -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(targetName "Ali${MODULE}") - set(TMP_BASELIB AliGPUTracking) - if(NOT CMAKE_CXX_STANDARD OR CMAKE_CXX_STANDARD LESS 14) - message(FATAL_ERROR "HIP support needs at least C++14") - endif() - - # Generate the dictionary - get_directory_property(incdirs INCLUDE_DIRECTORIES) - generate_dictionary("${targetName}" "" "${GPUCA_HIP_SOURCE_DIR}/GPUReconstructionHIP.h" "${incdirs} .") - - # Generate the ROOT map Dependecies - generate_rootmap("${targetName}" "" "") - - # Add a library to the project using the specified source files - add_library_tested(${targetName} SHARED ${SRCS}) - set(SRCS_CXX ${SRCS_CXX} G__${targetName}.cxx) # CMake HIP language feature will parse hip flags to everything that is linked to hip libraries, so add the ROOT dictionary file here - target_link_libraries(${targetName} PUBLIC ${TMP_BASELIB}) - - # ROOT Cannot load this library, so we have to remove it from the list - list(REMOVE_ITEM ALILIBSTESTED ${targetName}) - set(ALILIBSTESTED ${ALILIBSTESTED} CACHE INTERNAL "ALILIBSTESTED") - - # Installation - install(TARGETS ${targetName} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS} DESTINATION include) - include_directories(${GPUCA_HIP_SOURCE_DIR}) -endif() - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") set(targetName "${MODULE}") set(TMP_BASELIB GPUTracking) @@ -229,11 +197,7 @@ endif() # Special handling of GPU kernels in case of per-kernel compilation / RDC if(NOT DEFINED GPUCA_HIP_COMPILE_MODE) - if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(GPUCA_HIP_COMPILE_MODE "onefile") - else() - set(GPUCA_HIP_COMPILE_MODE "perkernel") - endif() + set(GPUCA_HIP_COMPILE_MODE "perkernel") endif() if(GPUCA_HIP_COMPILE_MODE STREQUAL "onefile") target_compile_definitions(${targetName} PRIVATE GPUCA_KERNEL_COMPILE_MODE=0) diff --git a/GPU/GPUTracking/Base/opencl/CMakeLists.txt b/GPU/GPUTracking/Base/opencl/CMakeLists.txt index 58d0e5f40b593..1aa3739b0b44a 100644 --- a/GPU/GPUTracking/Base/opencl/CMakeLists.txt +++ b/GPU/GPUTracking/Base/opencl/CMakeLists.txt @@ -96,25 +96,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") install(FILES ${HDRS} DESTINATION include/GPU) endif() -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - # Generate the dictionary - get_directory_property(incdirs INCLUDE_DIRECTORIES) - generate_dictionary("Ali${MODULE}" "" "GPUReconstructionOCL.h" "${incdirs} .") - - # Generate the ROOT map - generate_rootmap("Ali${MODULE}" "" "") - - # Add a library to the project using the specified source files - add_library_tested(Ali${MODULE} SHARED ${SRCS} G__Ali${MODULE}.cxx) - target_link_libraries(Ali${MODULE} PUBLIC OpenCL AliGPUTracking) - - # Installation - install(TARGETS Ali${MODULE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS} DESTINATION include) - set(targetName Ali${MODULE}) -endif() - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") add_library(${MODULE} SHARED ${SRCS}) target_link_libraries(${MODULE} GPUTracking OpenCL) diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx index f05780e86fe62..ed985e31ab1b0 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx @@ -19,7 +19,7 @@ #include "GPUReconstructionOCLInternals.h" #include "GPUReconstructionIncludes.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include #include diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h index 4d0c51e65a517..245e9674801f6 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.h @@ -18,12 +18,12 @@ #include "GPUReconstructionDeviceBase.h" #ifdef _WIN32 -extern "C" __declspec(dllexport) GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_OCL(const GPUCA_NAMESPACE::gpu::GPUSettingsDeviceBackend& cfg); +extern "C" __declspec(dllexport) o2::gpu::GPUReconstruction* GPUReconstruction_Create_OCL(const o2::gpu::GPUSettingsDeviceBackend& cfg); #else -extern "C" GPUCA_NAMESPACE::gpu::GPUReconstruction* GPUReconstruction_Create_OCL(const GPUCA_NAMESPACE::gpu::GPUSettingsDeviceBackend& cfg); +extern "C" o2::gpu::GPUReconstruction* GPUReconstruction_Create_OCL(const o2::gpu::GPUSettingsDeviceBackend& cfg); #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUReconstructionOCLInternals; @@ -78,6 +78,6 @@ class GPUReconstructionOCLBackend : public GPUReconstructionDeviceBase }; using GPUReconstructionOCL = GPUReconstructionKernels; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCLInternals.h b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCLInternals.h index fdcd7ff7f12c9..1020ce85563c2 100644 --- a/GPU/GPUTracking/Base/opencl/GPUReconstructionOCLInternals.h +++ b/GPU/GPUTracking/Base/opencl/GPUReconstructionOCLInternals.h @@ -25,7 +25,7 @@ #include #include "GPULogging.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { static const char* opencl_error_string(int32_t errorcode) @@ -244,6 +244,6 @@ inline uint32_t GPUReconstructionOCLBackend::FindKernel(int32_t num) } static_assert(std::is_convertible::value, "OpenCL event type incompatible to deviceEvent"); -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/CMakeLists.txt b/GPU/GPUTracking/CMakeLists.txt index b04a8c12dd598..aac689a2e01c8 100644 --- a/GPU/GPUTracking/CMakeLists.txt +++ b/GPU/GPUTracking/CMakeLists.txt @@ -21,20 +21,11 @@ endif() include(cmake/helpers.cmake) -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - if(ENABLE_CUDA OR ENABLE_OPENCL OR ENABLE_HIP) - include(FeatureSummary) - find_package(O2GPU) - else() - include("cmake/kernel_helpers.cmake") - endif() -else() - if((ALIGPU_BUILD_TYPE STREQUAL "Standalone" AND GPUCA_BUILD_EVENT_DISPLAY) OR (ALIGPU_BUILD_TYPE STREQUAL "O2" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET AliceO2::DebugGUI AND OPENGL_FOUND AND GLFW_FOUND)) - set(GPUCA_EVENT_DISPLAY ON) - endif() - if(ROOT_FOUND) - set(GPUCA_QA ON) - endif() +if((ALIGPU_BUILD_TYPE STREQUAL "Standalone" AND GPUCA_BUILD_EVENT_DISPLAY) OR (ALIGPU_BUILD_TYPE STREQUAL "O2" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET AliceO2::DebugGUI AND OPENGL_FOUND AND GLFW_FOUND)) + set(GPUCA_EVENT_DISPLAY ON) +endif() +if(ROOT_FOUND) + set(GPUCA_QA ON) endif() # General sources @@ -236,27 +227,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") Interface/GPUO2InterfaceConfigurableParam.cxx) endif() -# Sources only for AliRoot -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(SRCS - ${SRCS} - Merger/GPUTPCGlobalMergerComponent.cxx - SliceTracker/GPUTPCTrackerComponent.cxx - Merger/GPUTPCGMTracksToTPCSeeds.cxx - DataCompression/AliHLTTPCClusterStatComponent.cxx - TRDTracking/GPUTRDTrackerComponent.cxx - TRDTracking/GPUTRDTrackletReaderComponent.cxx - Global/AliHLTGPUDumpComponent.cxx) - - set(SRCS_NO_CINT ${SRCS_NO_CINT} - ${CMAKE_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCGeometry.cxx - ${CMAKE_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCLog.cxx - ${CMAKE_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCDefinitions.cxx - ${CMAKE_SOURCE_DIR}/HLT/TRD/AliHLTTRDDefinitions.cxx) - - set(HDRS_INSTALL ${HDRS_INSTALL} SliceTracker/GPUTPCDefinitions.h) -endif() - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly) file(GENERATE OUTPUT include_gpu_onthefly/GPUReconstructionKernelList.h @@ -376,100 +346,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") add_subdirectory(Interface) endif() -# Main CMake part for AliRoot -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - set(HDRS_SRCS ${HDRS_SRCS} - DataTypes/GPUO2DataTypes.h) - add_definitions(-DGPUCA_ALIROOT_LIB) - include_directories(qa) - include_directories(SYSTEM ${ROOT_INCLUDE_DIR}) - include_directories(${CMAKE_SOURCE_DIR}/HLT/BASE - ${CMAKE_SOURCE_DIR}/HLT/BASE/util - ${CMAKE_SOURCE_DIR}/HLT/TPCLib - ${CMAKE_SOURCE_DIR}/HLT/TPCLib/transform - ${CMAKE_SOURCE_DIR}/HLT/TPCLib/comp - ${CMAKE_SOURCE_DIR}/HLT/TRD - ${CMAKE_SOURCE_DIR}/TRD/TRDbase - ${CMAKE_SOURCE_DIR}/STEER/STEERBase - ${CMAKE_SOURCE_DIR}/STEER/STEER - ${CMAKE_SOURCE_DIR}/STEER/ESD - ${CMAKE_SOURCE_DIR}/STEER/CDB - ${CMAKE_SOURCE_DIR}/TPC/TPCbase - ${CMAKE_SOURCE_DIR}/TPC/TPCcalib - ${CMAKE_SOURCE_DIR}/TPC/TPCrec - ${CMAKE_SOURCE_DIR}/GPU/Common - ${CMAKE_SOURCE_DIR}/GPU/Utils - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Debug - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Definitions - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/DataTypes - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Base - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/SliceTracker - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Merger - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Global - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/TPCConvert - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/dEdx - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/TRDTracking - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/utils - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Base/cuda - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Base/hip - ${CMAKE_SOURCE_DIR}/GPU/GPUTracking/Base/opencl - ${CMAKE_SOURCE_DIR}/GPU/TPCFastTransformation) - alice_usevc() - - # Generate the dictionary - get_directory_property(incdirs INCLUDE_DIRECTORIES) - generate_dictionary_flat("Ali${MODULE}" "GPUTrackingLinkDef_AliRoot.h" - "${HDRS_SRCS}" "${incdirs}") - - # Generate the ROOT map Dependecies - set(LIBDEPS - STEERBase - STEER - ESD - CDB - HLTbase - TPCbase - TPCrec - TPCcalib - TRDbase - AliTPCFastTransformation) - generate_rootmap("Ali${MODULE}" "${LIBDEPS}" - "${CMAKE_CURRENT_SOURCE_DIR}/GPUTrackingLinkDef_AliRoot.h") - # Don't pass Vc to root - set(LIBDEPS ${LIBDEPS} Vc) - - # Add a library to the project using the specified source files - add_library_tested(Ali${MODULE} - SHARED - ${SRCS} - ${SRCS_NO_CINT} - ${SRCS_NO_H} - ${SRCS_DATATYPES} - G__Ali${MODULE}.cxx) - target_link_libraries(Ali${MODULE} ${LIBDEPS}) - - # Additional compilation flags - set_target_properties(Ali${MODULE} PROPERTIES COMPILE_FLAGS "") - - # System dependent: Modify the way the library is build - if(${CMAKE_SYSTEM} MATCHES Darwin) - set_target_properties(Ali${MODULE} - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - endif(${CMAKE_SYSTEM} MATCHES Darwin) - - # Installation - install(TARGETS Ali${MODULE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS_SRCS} ${HDRS_INSTALL} DESTINATION include) - install(DIRECTORY utils - DESTINATION include - FILES_MATCHING PATTERN *.h) - - set(targetName Ali${MODULE}) - add_library(O2::${MODULE} ALIAS Ali${MODULE}) -endif() - # Main CMake part for Standalone if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") add_library(${MODULE} SHARED ${SRCS} ${SRCS_NO_CINT} ${SRCS_NO_H} ${SRCS_DATATYPES}) diff --git a/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.cxx b/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.cxx deleted file mode 100644 index d6f9ff692c15f..0000000000000 --- a/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.cxx +++ /dev/null @@ -1,718 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLTTPCClusterStatComponent.cxx -/// \author David Rohr - -#include "AliCDBEntry.h" -#include "AliCDBManager.h" -#include "AliEventInfo.h" -#include "AliGRPObject.h" -#include "AliGeomManager.h" -#include "AliHLTExternalTrackParam.h" -#include "AliHLTGlobalBarrelTrack.h" -#include "GPUParam.h" -#include "AliHLTTPCClusterStatComponent.h" -#include "AliHLTTPCClusterTransformation.h" -#include "AliHLTTPCClusterXYZ.h" -#include "AliHLTTPCDataCompressionComponent.h" -#include "AliHLTTPCDefinitions.h" -#include "GPUTPCGMPropagator.h" -#include "GPUTPCGMPolynomialField.h" -#include "GPUTPCGMPolynomialFieldManager.h" -#include "GPUTPCGMTrackParam.h" -#include "AliHLTTPCGeometry.h" -#include "AliHLTTPCRawCluster.h" -#include "AliRawEventHeaderBase.h" -#include "AliRecoParam.h" -#include "AliRunInfo.h" -#include "AliTPCParam.h" -#include "AliTPCRecoParam.h" -#include "AliTPCTransform.h" -#include "AliTPCcalibDB.h" -#include - -using namespace GPUCA_NAMESPACE::gpu; - -ClassImp(AliHLTTPCClusterStatComponent); - -AliHLTTPCClusterStatComponent::AliHLTTPCClusterStatComponent() - : AliHLTProcessor(), mSliceParam(nullptr), fTotal(0), fEdge(0), fSplitPad(0), fSplitTime(0), fSplitPadTime(0), fSplitPadOrTime(0), fAssigned(0), fCompressionStudy(0), fPrintClusters(0), fPrintClustersScaled(0), fDumpClusters(0), fAggregate(0), fSort(0), fEvent(0) -{ -} - -AliHLTTPCClusterStatComponent::~AliHLTTPCClusterStatComponent() {} - -void AliHLTTPCClusterStatComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) -{ - list.push_back(AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC); - list.push_back(AliHLTTPCDefinitions::fgkTPCReverseTransformInfoDataType); - list.push_back(AliHLTTPCDefinitions::ClustersXYZDataType()); - list.push_back((kAliHLTDataTypeTrack | kAliHLTDataOriginTPC)); -} - -AliHLTComponentDataType AliHLTTPCClusterStatComponent::GetOutputDataType() { return kAliHLTDataTypeHistogram | kAliHLTDataOriginOut; } - -void AliHLTTPCClusterStatComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - constBase = 2000000; - inputMultiplier = 0.0; -} - -int32_t AliHLTTPCClusterStatComponent::ProcessOption(TString option, TString value) -{ - int32_t iResult = 0; - - if (option.EqualTo("print-clusters")) { - fPrintClusters = 1; - } else if (option.EqualTo("aggregate")) { - fAggregate = 1; - } else if (option.EqualTo("sort")) { - fSort = 1; - } else if (option.EqualTo("print-clusters-scaled")) { - fPrintClustersScaled = 1; - } else if (option.EqualTo("dump-clusters")) { - fDumpClusters = 1; - } else if (option.EqualTo("compression-study")) { - fCompressionStudy = 1; - } else { - HLTError("invalid option: %s", value.Data()); - return -EINVAL; - } - return iResult; -} - -int32_t AliHLTTPCClusterStatComponent::DoInit(int argc, const char** argv) -{ - int32_t iResult = 0; - - if (ProcessOptionString(GetComponentArgs()) < 0) { - HLTFatal("wrong config string! %s", GetComponentArgs().c_str()); - return -EINVAL; - } - - if (fDumpClusters) { - if ((fp = fopen("clusters.dump", "w+b")) == nullptr) { - return -1; - } - } - - AliTPCcalibDB* pCalib = AliTPCcalibDB::Instance(); - const AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - pCalib->SetExBField(field); - AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data"); - AliGRPObject tmpGRP, *pGRP = 0; - pGRP = dynamic_cast(entry->GetObject()); - AliRunInfo runInfo(pGRP->GetLHCState(), pGRP->GetBeamType(), pGRP->GetBeamEnergy(), pGRP->GetRunType(), pGRP->GetDetectorMask()); - AliEventInfo evInfo; - evInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent); - entry = AliCDBManager::Instance()->Get("TPC/Calib/RecoParam"); - TObject* recoParamObj = entry->GetObject(); - - static AliRecoParam fOfflineRecoParam; - if (dynamic_cast(recoParamObj)) { - TObjArray* copy = (TObjArray*)(static_cast(recoParamObj)->Clone()); - fOfflineRecoParam.AddDetRecoParamArray(1, copy); - } else if (dynamic_cast(recoParamObj)) { - AliDetectorRecoParam* copy = (AliDetectorRecoParam*)static_cast(recoParamObj)->Clone(); - fOfflineRecoParam.AddDetRecoParam(1, copy); - } - fOfflineRecoParam.SetEventSpecie(&runInfo, evInfo, 0); - AliTPCRecoParam* recParam = (AliTPCRecoParam*)fOfflineRecoParam.GetDetRecoParam(1); - pCalib->GetTransform()->SetCurrentRecoParam(recParam); - - mSliceParam = new GPUParam(); - mSliceParam->SetDefaults(GetBz()); - - return iResult; -} - -int32_t AliHLTTPCClusterStatComponent::DoDeinit() -{ - if (fDumpClusters) { - fclose(fp); - } - delete mSliceParam; - mSliceParam = nullptr; - return 0; -} - -void AliHLTTPCClusterStatComponent::TransformReverse(int32_t slice, int32_t row, float y, float z, float padtime[]) -{ - AliTPCcalibDB* calib = AliTPCcalibDB::Instance(); - AliTPCParam* param = calib->GetParameters(); - - float padWidth = 0; - // float padLength = 0; - float maxPad = 0; - float sign = slice < NSLICES / 2 ? 1 : -1; - float zwidth; - - int32_t sector; - int32_t sectorrow; - if (row < AliHLTTPCGeometry::GetNRowLow()) { - sector = slice; - sectorrow = row; - maxPad = param->GetNPadsLow(sectorrow); - // padLength = param->GetPadPitchLength(sector, sectorrow); - padWidth = param->GetPadPitchWidth(sector); - } else { - sector = slice + NSLICES; - sectorrow = row - AliHLTTPCGeometry::GetNRowLow(); - maxPad = param->GetNPadsUp(sectorrow); - // padLength = param->GetPadPitchLength(sector, sectorrow); - padWidth = param->GetPadPitchWidth(sector); - } - - padtime[0] = y * sign / padWidth + 0.5f * maxPad; - - float xyzGlobal[2] = {param->GetPadRowRadii(sector, sectorrow), y}; - AliHLTTPCGeometry::Local2Global(xyzGlobal, slice); - - float time = z * sign * 1024.f / GPUTPCGeometry::TPCLength(); - padtime[1] = (1024.f - time); -} - -void AliHLTTPCClusterStatComponent::TransformForward(int32_t slice, int32_t row, float pad, float time, float xyz[]) -{ - AliTPCcalibDB* calib = AliTPCcalibDB::Instance(); - AliTPCParam* param = calib->GetParameters(); - - float padWidth = 0; - // float padLength = 0; - float maxPad = 0; - float sign = slice < NSLICES / 2 ? 1 : -1; - float zwidth; - - int32_t sector; - int32_t sectorrow; - if (row < AliHLTTPCGeometry::GetNRowLow()) { - sector = slice; - sectorrow = row; - maxPad = param->GetNPadsLow(sectorrow); - // padLength = param->GetPadPitchLength(sector, sectorrow); - padWidth = param->GetPadPitchWidth(sector); - } else { - sector = slice + NSLICES; - sectorrow = row - AliHLTTPCGeometry::GetNRowLow(); - maxPad = param->GetNPadsUp(sectorrow); - // padLength = param->GetPadPitchLength(sector, sectorrow); - padWidth = param->GetPadPitchWidth(sector); - } - - xyz[0] = param->GetPadRowRadii(sector, sectorrow); - xyz[1] = (pad - 0.5f * maxPad) * padWidth * sign; - - float xyzGlobal[2] = {xyz[0], xyz[1]}; - AliHLTTPCGeometry::Local2Global(xyzGlobal, slice); - - xyz[2] = sign * (1024 - time) * GPUTPCGeometry::TPCLength() / 1024.f; -} - -static bool AliHLTTPCClusterStat_sorthelper(const AliHLTTPCRawCluster& a, const AliHLTTPCRawCluster& b) -{ - if (a.GetPadRow() < b.GetPadRow()) { - return (true); - } - if (a.GetPadRow() > b.GetPadRow()) { - return (false); - } - if (a.GetPad() < b.GetPad()) { - return (true); - } - if (a.GetPad() > b.GetPad()) { - return (false); - } - if (a.GetTime() < b.GetTime()) { - return (true); - } - if (a.GetTime() > b.GetTime()) { - return (false); - } - return (false); -} - -int32_t AliHLTTPCClusterStatComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* /*outputPtr*/, AliHLTUInt32_t& /*size*/, AliHLTComponentBlockDataList& /*outputBlocks*/) -{ - int32_t iResult = 0; - - if (!IsDataEvent()) { - return iResult; - } - - if (!fAggregate) { - fTotal = fEdge = fSplitPad = fSplitTime = fSplitPadTime = fSplitPadOrTime = 0; - } - int32_t nBlocks = evtData.fBlockCnt; - - AliHLTTPCRawClusterData* clustersArray[NSLICES][NPATCHES]; - AliHLTTPCClusterXYZData* clustersTransformedArray[NSLICES][NPATCHES]; - AliHLTTPCTrackHelperStruct* clustersTrackIDArray[NSLICES][NPATCHES]; - memset(clustersArray, 0, NSLICES * NPATCHES * sizeof(void*)); - memset(clustersTransformedArray, 0, NSLICES * NPATCHES * sizeof(void*)); - memset(clustersTrackIDArray, 0, NSLICES * NPATCHES * sizeof(void*)); - - AliHLTTracksData* tracks = nullptr; - - float bz = GetBz(); - - AliTPCcalibDB* pCalib = AliTPCcalibDB::Instance(); - AliTPCParam* tpcParam = pCalib->GetParameters(); - tpcParam->Update(); - tpcParam->ReadGeoMatrices(); - AliTPCTransform* transform = pCalib->GetTransform(); - const AliTPCRecoParam* rec = transform->GetCurrentRecoParam(); - transform->SetCurrentTimeStamp(GetTimeStamp()); - - for (int32_t ndx = 0; ndx < nBlocks; ndx++) { - const AliHLTComponentBlockData* iter = blocks + ndx; - - if (iter->fDataType == (AliHLTTPCDefinitions::fgkRawClustersDataType | kAliHLTDataOriginTPC)) { - int32_t slice = AliHLTTPCDefinitions::GetMinSliceNr(iter->fSpecification); - int32_t patch = AliHLTTPCDefinitions::GetMinPatchNr(iter->fSpecification); - - clustersArray[slice][patch] = (AliHLTTPCRawClusterData*)(iter->fPtr); - } - - if (iter->fDataType == AliHLTTPCDefinitions::ClustersXYZDataType()) { - int32_t slice = AliHLTTPCDefinitions::GetMinSliceNr(iter->fSpecification); - int32_t patch = AliHLTTPCDefinitions::GetMinPatchNr(iter->fSpecification); - - clustersTransformedArray[slice][patch] = (AliHLTTPCClusterXYZData*)(iter->fPtr); - if (clustersTransformedArray[slice][patch]->fCount) { - clustersTrackIDArray[slice][patch] = new AliHLTTPCTrackHelperStruct[clustersTransformedArray[slice][patch]->fCount]; - memset(clustersTrackIDArray[slice][patch], 0, clustersTransformedArray[slice][patch]->fCount * sizeof(AliHLTTPCTrackHelperStruct)); - for (int32_t i = 0; i < clustersTransformedArray[slice][patch]->fCount; i++) { - clustersTrackIDArray[slice][patch][i].fID = -1; - } - } - } - - if (iter->fDataType == (kAliHLTDataTypeTrack | kAliHLTDataOriginTPC)) { - tracks = (AliHLTTracksData*)iter->fPtr; - } - } - - if (fCompressionStudy) { - if (tracks == nullptr) { - HLTError("Tracks missing"); - return (0); - } - } - - double residualBarrelTrackY = 0, residualBarrelTrackZ = 0, residualExternalTrackY = 0, residualExternalTrackZ = 0, residualBacktransformPad = 0, residualBacktransformTime = 0; - double residualBarrelTrackYabs = 0, residualBarrelTrackZabs = 0, residualExternalTrackYabs = 0, residualExternalTrackZabs = 0, residualBacktransformPadabs = 0, residualBacktransformTimeabs = 0; - double residualFitTrackY = 0, residualFitTrackZ = 0, residualFitTrackYabs = 0, residualFitTrackZabs = 0, residualTrackRawPad = 0, residualTrackRawTime = 0, residualTrackRawPadabs = 0, residualTrackRawTimeabs = 0; - int32_t nClusterTracks = 0, nClusters = 0, nClusterTracksRaw = 0; - - const AliHLTUInt8_t* pCurrent = reinterpret_cast(tracks->fTracklets); - if (fCompressionStudy) { - GPUTPCGMPropagator prop; - prop.SetMaxSinPhi(.999); - prop.SetMaterialTPC(); - GPUTPCGMPolynomialField field; - int32_t err = GPUTPCGMPolynomialFieldManager::GetPolynomialField(field); - if (err != 0) { - HLTError("Can not initialize polynomial magnetic field"); - return -1; - } - prop.SetPolynomialField(&field); - for (unsigned i = 0; i < tracks->fCount; i++) { - const AliHLTExternalTrackParam* track = reinterpret_cast(pCurrent); - if (track->fNPoints == 0) { - continue; - } - - AliHLTGlobalBarrelTrack btrack(*track); - btrack.CalculateHelixParams(bz); - - AliExternalTrackParam etrack(btrack); - - GPUTPCGMTrackParam ftrack; - float falpha; - - int32_t hitsUsed = 0; - float averageCharge = 0; - float averageQMax = 0; - AliHLTTPCTrackHelperStruct* hitIndexCache[1024]; - for (int32_t ip = 0; ip < track->fNPoints; ip++) { - int32_t clusterID = track->fPointIDs[ip]; - int32_t slice = AliHLTTPCGeometry::CluID2Slice(clusterID); - int32_t patch = AliHLTTPCGeometry::CluID2Partition(clusterID); - int32_t index = AliHLTTPCGeometry::CluID2Index(clusterID); - - if (clustersTrackIDArray[slice][patch][index].fID != -1) { - HLTDebug("Already assigned hit %d of track %d, skipping", ip, i); - continue; - } - - if (index > clustersArray[slice][patch]->fCount) { - HLTError("Cluster index out of range"); - continue; - } - - AliHLTTPCRawCluster& cluster = clustersArray[slice][patch]->fClusters[index]; - AliHLTTPCClusterXYZ& clusterTransformed = clustersTransformedArray[slice][patch]->fClusters[index]; - - int32_t padrow = AliHLTTPCGeometry::GetFirstRow(patch) + cluster.GetPadRow(); - float x = AliHLTTPCGeometry::Row2X(padrow); - float y = 0.0f; - float z = 0.0f; - - float xyz[3]; - if (1) // Use forward (exact reverse-reverse) transformation of raw cluster (track fit in distorted coordinates) - { - TransformForward(slice, padrow, cluster.GetPad(), cluster.GetTime(), xyz); - } else { // Correct cluster coordinates using correct transformation - xyz[0] = x; - xyz[1] = clusterTransformed.fY; - xyz[2] = clusterTransformed.fZ; - } - - float alpha = slice; - if (alpha > NSLICES / 2) { - alpha -= NSLICES / 2; - } - if (alpha > NSLICES / 4) { - alpha -= NSLICES / 2; - } - alpha = (alpha + 0.5f) * M_PI / 9.f; - btrack.CalculateCrossingPoint(x, alpha /* Better use btrack.GetAlpha() ?? */, y, z); - - etrack.Propagate(alpha, x, bz); - - if (ip == 0) { - ftrack.Par()[0] = xyz[1]; - ftrack.Par()[1] = xyz[2]; - for (int32_t k = 2; k < 5; k++) { - ftrack.Par()[k] = etrack.GetParameter()[k]; - } - ftrack.SetX(xyz[0]); - falpha = alpha; - - prop.SetTrack(&ftrack, falpha); - ftrack.ResetCovariance(); - bool inFlyDirection = 1; - prop.PropagateToXAlpha(xyz[0], falpha, inFlyDirection); - } else { - bool inFlyDirection = 0; - prop.PropagateToXAlpha(xyz[0], alpha, inFlyDirection); - } - - nClusterTracks++; - residualBarrelTrackYabs += fabsf(clusterTransformed.fY - y); - residualBarrelTrackZabs += fabsf(clusterTransformed.fZ - z); - residualExternalTrackYabs += fabsf(clusterTransformed.fY - (float)etrack.GetY()); - residualExternalTrackZabs += fabsf(clusterTransformed.fZ - (float)etrack.GetZ()); - residualBarrelTrackY += clusterTransformed.fY - y; - residualBarrelTrackZ += clusterTransformed.fZ - z; - residualExternalTrackY += clusterTransformed.fY - etrack.GetY(); - residualExternalTrackZ += clusterTransformed.fZ - etrack.GetZ(); - residualFitTrackY += clusterTransformed.fY - ftrack.GetY(); - residualFitTrackZ += clusterTransformed.fZ - ftrack.GetZ(); - residualFitTrackYabs += fabsf(clusterTransformed.fY - ftrack.GetY()); - residualFitTrackZabs += fabsf(clusterTransformed.fZ - ftrack.GetZ()); - - // Show residuals wrt track position - // HLTImportant("Residual %d btrack %f %f etrack %f %f ftrack %f %f", padrow, clusterTransformed.fY - y, clusterTransformed.fZ - z, - // clusterTransformed.fY - etrack.GetY(), clusterTransformed.fZ - etrack.GetZ(), - // clusterTransformed.fY - ftrack.GetY(), clusterTransformed.fZ - ftrack.GetZ()); - - float padtime[2]; - TransformReverse(slice, padrow, ftrack.GetY(), ftrack.GetZ(), padtime); - - // Check forward / backward transformation - /*float xyzChk[3]; - TransformForward(slice, padrow, padtime[0], padtime[1], xyzChk); - HLTImportant("BackwardForward Residual %f %f %f: %f %f", ftrack.GetX(), ftrack.GetY(), ftrack.GetZ(), ftrack.GetY() - xyzChk[1], ftrack.GetZ() - xyzChk[2]);*/ - - // Show residual wrt to raw cluster position - // HLTImportant("Raw Cluster Residual %d (%d/%d) %d: %f %f (%f %f)", i, ip, track->fNPoints, padrow, cluster.GetPad() - padtime[0], cluster.GetTime() - padtime[1], clusterTransformed.fY - ftrack.GetY(), clusterTransformed.fZ - ftrack.GetZ()); - if (fabsf(cluster.GetPad() - padtime[0]) > 5 || fabsf(cluster.GetTime() - padtime[1]) > 5) { - break; - } - - if (ip != 0) { - clustersTrackIDArray[slice][patch][index].fResidualPad = cluster.GetPad() - padtime[0]; - clustersTrackIDArray[slice][patch][index].fResidualTime = cluster.GetTime() - padtime[1]; - clustersTrackIDArray[slice][patch][index].fFirstHit = 0; - - residualTrackRawPad += cluster.GetPad() - padtime[0]; - residualTrackRawTime += cluster.GetTime() - padtime[1]; - residualTrackRawPadabs += fabsf(cluster.GetPad() - padtime[0]); - residualTrackRawTimeabs += fabsf(cluster.GetTime() - padtime[1]); - nClusterTracksRaw++; - } else { - clustersTrackIDArray[slice][patch][index].fResidualPad = cluster.GetPad(); - clustersTrackIDArray[slice][patch][index].fResidualTime = cluster.GetTime(); - clustersTrackIDArray[slice][patch][index].fFirstHit = 1; - } - clustersTrackIDArray[slice][patch][index].fID = i; - clustersTrackIDArray[slice][patch][index].fTrack = track; - if (hitsUsed >= 1024) { - HLTFatal("hitIndex cache exceeded"); - } - hitIndexCache[hitsUsed] = &clustersTrackIDArray[slice][patch][index]; - hitsUsed++; - averageCharge += cluster.GetCharge(); - averageQMax += cluster.GetQMax(); - - if (ip != 0) { - int32_t rowType = padrow < 64 ? 0 : (padrow < 128 ? 2 : 1); - prop.Update(xyz[1], xyz[2], rowType, *mSliceParam, 0, 0, nullptr, false, slice > 18, -1.f, 0.f, 0.f); - } - } - if (hitsUsed) { - averageCharge /= hitsUsed; - averageQMax /= hitsUsed; - } - for (int32_t ip = 0; ip < hitsUsed; ip++) { - hitIndexCache[ip]->fAverageQMax = averageQMax; - hitIndexCache[ip]->fAverageQTot = averageCharge; - } - pCurrent += sizeof(AliHLTExternalTrackParam) + track->fNPoints * sizeof(uint32_t); - } - } - - for (uint32_t is = 0; is < NSLICES; is++) { - for (uint32_t ip = 0; ip < NPATCHES; ip++) { - AliHLTTPCRawClusterData* clusters = clustersArray[is][ip]; - AliHLTTPCClusterXYZData* clustersTransformed = clustersTransformedArray[is][ip]; - int32_t firstRow = AliHLTTPCGeometry::GetFirstRow(ip); - - if (clusters == nullptr) { - HLTDebug("Clusters missing for slice %d patch %d\n", is, ip); - continue; - } - if (fCompressionStudy && (clustersTransformed == nullptr || clusters->fCount != clustersTransformed->fCount)) { - HLTError("Cluster cound not equal"); - continue; - } - - AliHLTTPCRawCluster* sortedClusters; - if (fSort) { - if (fCompressionStudy) { - HLTFatal("Cannot sort when compressionstudy is enabled"); - } - sortedClusters = new AliHLTTPCRawCluster[clusters->fCount]; - memcpy(sortedClusters, clusters->fClusters, sizeof(AliHLTTPCRawCluster) * clusters->fCount); - std::sort(sortedClusters, sortedClusters + clusters->fCount, AliHLTTPCClusterStat_sorthelper); - } - - for (uint32_t iCluster = 0; iCluster < clusters->fCount; iCluster++) { - AliHLTTPCRawCluster& cluster = clusters->fClusters[iCluster]; - AliHLTTPCClusterXYZ& clusterTransformed = clustersTransformed->fClusters[iCluster]; - static AliHLTTPCTrackHelperStruct tmp; - AliHLTTPCTrackHelperStruct& clusterTrack = fCompressionStudy ? clustersTrackIDArray[is][ip][iCluster] : tmp; - - if (fCompressionStudy) { - int32_t row = cluster.GetPadRow() + firstRow; - - float xyz[3]; - TransformForward(is, row, cluster.GetPad(), cluster.GetTime(), xyz); - - /*float xyzOrig[3], xyzLocGlob[3]; - { - int32_t sector = AliHLTTPCGeometry::GetNRowLow() ? is : is + NSLICES; - int32_t sectorrow = AliHLTTPCGeometry::GetNRowLow() ? row : row - AliHLTTPCGeometry::GetNRowLow(); - - Double_t xx[] = {(double) sectorrow, cluster.GetPad(), cluster.GetTime()}; - transform->Transform(xx, §or, 0, 1); - - Double_t yy[] = {(double) sectorrow, cluster.GetPad(), cluster.GetTime()}; - transform->Local2RotatedGlobal(sector, yy); - for (int32_t k = 0; k < 3; k++) - { - xyzOrig[k] = xx[k]; - xyzLocGlob[k] = yy[k]; - } - }*/ - - float padtime[2]; - TransformReverse(is, row, clusterTransformed.fY, clusterTransformed.fZ, padtime); - - nClusters++; - residualBacktransformPadabs += fabsf(cluster.GetPad() - padtime[0]); - residualBacktransformTimeabs += fabsf(cluster.GetTime() - padtime[1]); - residualBacktransformPad += cluster.GetPad() - padtime[0]; - residualBacktransformTime += cluster.GetTime() - padtime[1]; - } - - fTotal++; - if (cluster.GetFlagEdge()) { - fEdge++; - } - if (cluster.GetFlagSplitPad()) { - fSplitPad++; - } - if (cluster.GetFlagSplitTime()) { - fSplitTime++; - } - if (cluster.GetFlagSplitAny()) { - fSplitPadOrTime++; - } - if (cluster.GetFlagSplitPad() && cluster.GetFlagSplitTime()) { - fSplitPadTime++; - } - - AliHLTTPCRawCluster& cluster2 = fSort ? sortedClusters[iCluster] : cluster; - - if (fPrintClusters) { - HLTImportant("Event %d Slice %d, Patch %d, Row %d, Pad %.2f, Time %.2f, SPad %.2f, STime %.2f, QMax %d, QTot %d, SplitPad %d, SplitTime %d, Edge %d, TrackId %d, ResPad %.2f ResTime %.2f AvgQTot %d AvgQMax %d", fEvent, is, ip, (int32_t)cluster2.GetPadRow(), cluster2.GetPad(), - cluster2.GetTime(), cluster2.GetSigmaPad2(), cluster2.GetSigmaTime2(), (int32_t)cluster2.GetQMax(), (int32_t)cluster2.GetCharge(), (int32_t)cluster2.GetFlagSplitPad(), (int32_t)cluster2.GetFlagSplitTime(), (int32_t)cluster2.GetFlagEdge(), (int32_t)clusterTrack.fID, - clusterTrack.fResidualPad, clusterTrack.fResidualTime, (int32_t)clusterTrack.fAverageQTot, (int32_t)clusterTrack.fAverageQMax); - } - - if (fCompressionStudy && clusterTrack.fID == -1) { - PrintDumpClustersScaled(is, ip, cluster, clusterTransformed, clusterTrack); - } - } - if (fSort) { - delete[] sortedClusters; - } - } - } - - if (fDumpClusters || fPrintClustersScaled) { - const AliHLTUInt8_t* pCurrent = reinterpret_cast(tracks->fTracklets); - for (unsigned i = 0; i < tracks->fCount; i++) { - const AliHLTExternalTrackParam* track = reinterpret_cast(pCurrent); - for (int32_t ip = 0; ip < track->fNPoints; ip++) { - int32_t clusterID = track->fPointIDs[ip]; - int32_t slice = AliHLTTPCGeometry::CluID2Slice(clusterID); - int32_t patch = AliHLTTPCGeometry::CluID2Partition(clusterID); - int32_t index = AliHLTTPCGeometry::CluID2Index(clusterID); - - AliHLTTPCRawCluster& cluster = clustersArray[slice][patch]->fClusters[index]; - AliHLTTPCClusterXYZ& clusterTransformed = clustersTransformedArray[slice][patch]->fClusters[index]; - AliHLTTPCTrackHelperStruct& clusterTrack = clustersTrackIDArray[slice][patch][index]; - - if (clusterTrack.fID == i) { - PrintDumpClustersScaled(slice, patch, cluster, clusterTransformed, clusterTrack); - } - } - pCurrent += sizeof(AliHLTExternalTrackParam) + track->fNPoints * sizeof(uint32_t); - } - } - - for (uint32_t is = 0; is < NSLICES; is++) { - for (uint32_t ip = 0; ip < NPATCHES; ip++) { - if (clustersTrackIDArray[is][ip]) { - delete[] clustersTrackIDArray[is][ip]; - } - } - } - - int32_t total = fTotal == 0 ? 1 : fTotal; - fAssigned += nClusterTracks; - HLTImportant("Total %d Assigned %d (%2.0f\%) SplitPad %d (%2.0f\%) SplitTime %d (%2.0f\%) SplitPadTime %d (%2.0f\%) SplitPadOrTime %d (%2.0f\%) Edge %d (%2.0f\%)", fTotal, fAssigned, (float)fAssigned / (float)total * 100.f, fSplitPad, (float)fSplitPad / (float)total * 100.f, fSplitTime, - (float)fSplitTime / (float)total * 100.f, fSplitPadTime, (float)fSplitPadTime / (float)total * 100.f, fSplitPadOrTime, (float)fSplitPadOrTime / (float)total * 100.f, fEdge, (float)fEdge / (float)total * 100.f); - - if (nClusterTracks) { - residualBarrelTrackY /= nClusterTracks; - residualBarrelTrackZ /= nClusterTracks; - residualExternalTrackY /= nClusterTracks; - residualExternalTrackZ /= nClusterTracks; - residualBarrelTrackYabs /= nClusterTracks; - residualBarrelTrackZabs /= nClusterTracks; - residualExternalTrackYabs /= nClusterTracks; - residualExternalTrackZabs /= nClusterTracks; - residualFitTrackYabs /= nClusterTracks; - residualFitTrackZabs /= nClusterTracks; - residualFitTrackY /= nClusterTracks; - residualFitTrackZ /= nClusterTracks; - } - if (nClusterTracksRaw) { - residualTrackRawPadabs /= nClusterTracksRaw; - residualTrackRawTimeabs /= nClusterTracksRaw; - residualTrackRawPad /= nClusterTracksRaw; - residualTrackRawTime /= nClusterTracksRaw; - } - if (nClusters) { - residualBacktransformPad /= nClusters; - residualBacktransformTime /= nClusters; - residualBacktransformPadabs /= nClusters; - residualBacktransformTimeabs /= nClusters; - } - - if (fCompressionStudy) { - HLTImportant("Average Res: BarrelTr %f %f, ExtlTr %f %f, FitTr %f %f BackTr %f %f TrkRaw %f %f", residualBarrelTrackY, residualBarrelTrackZ, residualExternalTrackY, residualExternalTrackZ, residualFitTrackY, residualFitTrackZ, residualBacktransformPad, residualBacktransformTime, - residualTrackRawPad, residualTrackRawTime); - HLTImportant("Average Abs Res: BarrelTr %f %f, ExtTr %f %f, FitTr %f %f BackTr %f %f TrkRaw %f %f", residualBarrelTrackYabs, residualBarrelTrackZabs, residualExternalTrackYabs, residualExternalTrackZabs, residualFitTrackYabs, residualFitTrackZabs, residualBacktransformPadabs, - residualBacktransformTimeabs, residualTrackRawPadabs, residualTrackRawTimeabs); - } - - fEvent++; - - return iResult; -} - -void AliHLTTPCClusterStatComponent::PrintDumpClustersScaled(int32_t is, int32_t ip, AliHLTTPCRawCluster& cluster, AliHLTTPCClusterXYZ& clusterTransformed, AliHLTTPCClusterStatComponent::AliHLTTPCTrackHelperStruct& clusterTrack) -{ - AliHLTUInt64_t pad64 = 0; - if (!isnan(cluster.GetPad())) { - pad64 = (AliHLTUInt64_t)round(cluster.GetPad() * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kPad].fScale); - } - - AliHLTUInt64_t time64 = 0; - if (!isnan(cluster.GetTime())) { - time64 = (AliHLTUInt64_t)round(cluster.GetTime() * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kTime].fScale); - } - - AliHLTUInt64_t sigmaPad64 = 0; - if (!isnan(cluster.GetSigmaPad2())) { - sigmaPad64 = (AliHLTUInt64_t)round(cluster.GetSigmaPad2() * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaY2].fScale); - } - - AliHLTUInt64_t sigmaTime64 = 0; - if (!isnan(cluster.GetSigmaTime2())) { - sigmaTime64 = (AliHLTUInt64_t)round(cluster.GetSigmaTime2() * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaZ2].fScale); - } - - if (sigmaPad64 >= (unsigned)1 << AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaY2].fBitLength) { - sigmaPad64 = (1 << AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaY2].fBitLength) - 1; - } - if (sigmaTime64 >= (unsigned)1 << AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaZ2].fBitLength) { - sigmaTime64 = (1 << AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kSigmaZ2].fBitLength) - 1; - } - - AliHLTUInt64_t pad64res = 0; - pad64res = (AliHLTUInt64_t)round(clusterTrack.fResidualPad * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kPad].fScale); - - AliHLTUInt64_t time64res = 0; - time64res = (AliHLTUInt64_t)round(clusterTrack.fResidualTime * AliHLTTPCDefinitions::fgkClusterParameterDefinitions[AliHLTTPCDefinitions::kTime].fScale); - - if (fDumpClusters) { - int32_t dumpVals[16] = {fEvent, - (int32_t)is, - (int32_t)ip, - (int32_t)cluster.GetPadRow(), - (int32_t)pad64, - (int32_t)time64, - (int32_t)sigmaPad64, - (int32_t)sigmaTime64, - (int32_t)cluster.GetQMax(), - (int32_t)cluster.GetCharge(), - (int32_t)(cluster.GetFlagEdge() * 4 + cluster.GetFlagSplitPad() * 2 + cluster.GetFlagSplitTime()), - (int32_t)clusterTrack.fID, - (int32_t)pad64res, - (int32_t)time64res, - (int32_t)clusterTrack.fAverageQTot, - (int32_t)clusterTrack.fAverageQMax}; - fwrite(dumpVals, sizeof(int32_t), 16, fp); - } - - if (fPrintClustersScaled) { - HLTImportant("Event %d Slice %d, Patch %d, Row %d, Pad %d, Time %d, SPad %d, STime %d, QMax %d, QTot %d, SplitPad %d, SplitTime %d, Edge %d, TrackID %d, PadRes %d, TimeRes %d AvgTot %d AvgMax %d", fEvent, is, ip, (int32_t)cluster.GetPadRow(), (int32_t)pad64, (int32_t)time64, (int32_t)sigmaPad64, - (int32_t)sigmaTime64, (int32_t)cluster.GetQMax(), (int32_t)cluster.GetCharge(), (int32_t)cluster.GetFlagSplitPad(), (int32_t)cluster.GetFlagSplitTime(), (int32_t)cluster.GetFlagEdge(), (int32_t)clusterTrack.fID, (int32_t)pad64res, (int32_t)time64res, (int32_t)clusterTrack.fAverageQTot, - (int32_t)clusterTrack.fAverageQMax); - } -} diff --git a/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.h b/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.h deleted file mode 100644 index 2b58755217a61..0000000000000 --- a/GPU/GPUTracking/DataCompression/AliHLTTPCClusterStatComponent.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLTTPCClusterStatComponent.h -/// \author David Rohr - -#ifndef GPUTPCCLUSTERSTAT_H -#define GPUTPCCLUSTERSTAT_H - -#include "AliHLTProcessor.h" -#include "AliHLTComponentBenchmark.h" -#include "AliOptionParser.h" - -class AliHLTExternalTrackParam; -class AliHLTTPCRawCluster; -class AliHLTTPCClusterXYZ; -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -struct GPUParam; -} -} // namespace GPUCA_NAMESPACE - -class AliHLTTPCClusterStatComponent : public AliHLTProcessor, public AliOptionParser -{ - public: - /** standard constructor */ - AliHLTTPCClusterStatComponent(); - /** destructor */ - virtual ~AliHLTTPCClusterStatComponent(); - - static const uint32_t NSLICES = 36; - static const uint32_t NPATCHES = 6; - - struct AliHLTTPCTrackHelperStruct { - int32_t fID; - const AliHLTExternalTrackParam* fTrack; - float fResidualPad; - float fResidualTime; - bool fFirstHit; - int64_t fAverageQMax; - int64_t fAverageQTot; - }; - - // interface methods of base class - const char* GetComponentID() { return "TPCClusterStat"; }; - void GetInputDataTypes(AliHLTComponentDataTypeList& list); - AliHLTComponentDataType GetOutputDataType(); - void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - AliHLTComponent* Spawn() { return new AliHLTTPCClusterStatComponent; } - - static void TransformReverse(int32_t slice, int32_t row, float y, float z, float padtime[]); - static void TransformForward(int32_t slice, int32_t row, float pad, float time, float xyz[]); - - void PrintDumpClustersScaled(int32_t is, int32_t ip, AliHLTTPCRawCluster& cluster, AliHLTTPCClusterXYZ& clusterTransformed, AliHLTTPCTrackHelperStruct& clusterTrack); - - protected: - // interface methods of base class - int32_t DoInit(int argc, const char** argv); - int32_t DoDeinit(); - int32_t DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, AliHLTComponentBlockDataList& outputBlocks); - - using AliHLTProcessor::DoEvent; - int32_t ProcessOption(TString option, TString value); - - private: - /** copy constructor prohibited */ - AliHLTTPCClusterStatComponent(const AliHLTTPCClusterStatComponent&); - /** assignment operator prohibited */ - AliHLTTPCClusterStatComponent& operator=(const AliHLTTPCClusterStatComponent&); - - GPUCA_NAMESPACE::gpu::GPUParam* mSliceParam; - - int32_t fTotal, fEdge, fSplitPad, fSplitTime, fSplitPadTime, fSplitPadOrTime, fAssigned; //! - - int32_t fCompressionStudy; //! - int32_t fPrintClusters; //! - int32_t fPrintClustersScaled; //! - int32_t fDumpClusters; //! - int32_t fAggregate; //! - int32_t fSort; //! - int32_t fEvent; - - FILE* fp; - - protected: - ClassDef(AliHLTTPCClusterStatComponent, 0); -}; -#endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCClusterRejection.h b/GPU/GPUTracking/DataCompression/GPUTPCClusterRejection.h index 8e80f3223d04c..fcdfcfc9cc49a 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCClusterRejection.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCClusterRejection.h @@ -17,7 +17,7 @@ #include "GPUTPCGMMergerTypes.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -68,6 +68,6 @@ struct GPUTPCClusterRejection { } }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.cxx b/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.cxx index 33886f721c5db..e8f8de7658b28 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.cxx @@ -20,7 +20,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; // Small helper to compute Huffman probabilities namespace diff --git a/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.h b/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.h index a07857bbcd0e3..4728f97ef704a 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCClusterStatistics.h @@ -24,7 +24,7 @@ namespace o2::tpc struct ClusterNativeAccess; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCClusterStatistics { @@ -89,6 +89,6 @@ class GPUTPCClusterStatistics size_t mNTotalClusters = 0; #endif }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompression.cxx b/GPU/GPUTracking/DataCompression/GPUTPCCompression.cxx index f37f817a51822..8f8137a6307b0 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompression.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompression.cxx @@ -17,7 +17,7 @@ #include "GPUO2DataTypes.h" #include "GPUMemorySizeScalers.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUTPCCompression::InitializeProcessor() {} diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompression.h b/GPU/GPUTracking/DataCompression/GPUTPCCompression.h index ce525f175e616..3244a0ab2640a 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompression.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompression.h @@ -34,7 +34,7 @@ struct CompressedClustersFlat { } // namespace o2::tpc #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCGMMerger; @@ -125,6 +125,6 @@ GPUdi() void GPUTPCCompression::truncateSignificantBits(T& v, uint32_t nBits, ui v = val; } } -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx index 8f28cbe5563af..cf70e84ce1457 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.cxx @@ -22,7 +22,7 @@ #include "GPUTPCClusterRejection.h" #include "GPUTPCCompressionKernels.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; template <> diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h index 2fc114324830e..b0bb8a6c12ecc 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionKernels.h @@ -22,7 +22,7 @@ namespace o2::tpc struct ClusterNative; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCCompressionKernels : public GPUKernelTemplate { @@ -124,6 +124,6 @@ class GPUTPCCompressionGatherKernels : public GPUKernelTemplate GPUdii() static void gatherMulti(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.cxx b/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.cxx index f8fe18e915f28..2d8b69a4be516 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.cxx @@ -16,7 +16,7 @@ #include "GPUConstantMem.h" #include "GPUParam.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; // ATTENTION! This track model is used for the data compression. // Changes to the propagation and fit will prevent the decompression of data @@ -889,7 +889,6 @@ GPUd() float GPUTPCCompressionTrackModel::approximateBetheBloch(float beta2) GPUd() void GPUTPCCompressionTrackModel::getClusterErrors2(int32_t iRow, float z, float sinPhi, float DzDs, float& ErrY2, float& ErrZ2) const { - // Only O2 geometry considered at the moment. Is AliRoot geometry support needed? int32_t rowType = iRow < 97 ? (iRow < 63 ? 0 : 1) : (iRow < 127 ? 2 : 3); if (rowType > 2) { rowType = 2; // TODO: Add type 3 diff --git a/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.h b/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.h index 8003b388e1a68..66548c8d8ce52 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCCompressionTrackModel.h @@ -31,7 +31,7 @@ #else // Default internal track model for compression #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { // ATTENTION! This track model is used for the data compression. // Changes to the propagation and fit will prevent the decompression of data @@ -152,6 +152,6 @@ class GPUTPCCompressionTrackModel PhysicalTrackModel mTrk; #endif }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx b/GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx index 7c10f0eeef74f..16c6cb4b8d61c 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCDecompression.cxx @@ -19,7 +19,7 @@ #include "GPUMemorySizeScalers.h" #include "GPULogging.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUTPCDecompression::InitializeProcessor() {} diff --git a/GPU/GPUTracking/DataCompression/GPUTPCDecompression.h b/GPU/GPUTracking/DataCompression/GPUTPCDecompression.h index 47c64008b176e..c15564426f464 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCDecompression.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCDecompression.h @@ -35,7 +35,7 @@ struct CompressedClustersFlat { } // namespace o2::tpc #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCDecompression : public GPUProcessor @@ -85,5 +85,5 @@ class GPUTPCDecompression : public GPUProcessor int16_t mResourceClusterNativeAccess = -1; int16_t mResourceNClusterPerSectorRow = -1; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUTPCDECOMPRESSION_H diff --git a/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.cxx b/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.cxx index d7f1e2ac88368..2ba80bf4d3b21 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.cxx +++ b/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.cxx @@ -19,7 +19,7 @@ #include "GPUCommonAlgorithm.h" #include "TPCClusterDecompressionCore.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; template <> diff --git a/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.h b/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.h index b45af622ebac8..52ec4c0eef403 100644 --- a/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.h +++ b/GPU/GPUTracking/DataCompression/GPUTPCDecompressionKernels.h @@ -30,7 +30,7 @@ struct CompressedClusters { } // namespace o2::tpc #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCDecompressionKernels : public GPUKernelTemplate @@ -70,5 +70,5 @@ class GPUTPCDecompressionUtilKernels : public GPUKernelTemplate GPUdi() static bool isClusterKept(const o2::tpc::ClusterNative& cl, const GPUParam& GPUrestrict() param); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUTPCDECOMPRESSIONKERNELS_H diff --git a/GPU/GPUTracking/DataCompression/TPCClusterDecompressionCore.inc b/GPU/GPUTracking/DataCompression/TPCClusterDecompressionCore.inc index 73352182328d5..b46e304d83cbe 100644 --- a/GPU/GPUTracking/DataCompression/TPCClusterDecompressionCore.inc +++ b/GPU/GPUTracking/DataCompression/TPCClusterDecompressionCore.inc @@ -27,7 +27,7 @@ using namespace o2::tpc; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class TPCClusterDecompressionCore @@ -185,6 +185,6 @@ class TPCClusterDecompressionCore } } }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif \ No newline at end of file diff --git a/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.cxx b/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.cxx index 4a38c2e0d57e5..22641774cd9ee 100644 --- a/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.cxx +++ b/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.cxx @@ -22,7 +22,7 @@ #include #include "TPCClusterDecompressionCore.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; int32_t TPCClusterDecompressor::decompress(const CompressedClustersFlat* clustersCompressed, o2::tpc::ClusterNativeAccess& clustersNative, std::function allocator, const GPUParam& param, bool deterministicRec) diff --git a/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.h b/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.h index d8e404b8a2ab7..4a40b20e8d4f5 100644 --- a/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.h +++ b/GPU/GPUTracking/DataCompression/TPCClusterDecompressor.h @@ -25,7 +25,7 @@ struct ClusterNativeAccess; struct ClusterNative; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUParam; @@ -36,6 +36,6 @@ class TPCClusterDecompressor static int32_t decompress(const o2::tpc::CompressedClustersFlat* clustersCompressed, o2::tpc::ClusterNativeAccess& clustersNative, std::function allocator, const GPUParam& param, bool deterministicRec); static int32_t decompress(const o2::tpc::CompressedClusters* clustersCompressed, o2::tpc::ClusterNativeAccess& clustersNative, std::function allocator, const GPUParam& param, bool deterministicRec); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/CalibdEdxContainer.cxx b/GPU/GPUTracking/DataTypes/CalibdEdxContainer.cxx index 002bb1ed9e9d7..0b3ee65ef7578 100644 --- a/GPU/GPUTracking/DataTypes/CalibdEdxContainer.cxx +++ b/GPU/GPUTracking/DataTypes/CalibdEdxContainer.cxx @@ -20,7 +20,7 @@ #endif #include "CalibdEdxContainer.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) diff --git a/GPU/GPUTracking/DataTypes/CalibdEdxContainer.h b/GPU/GPUTracking/DataTypes/CalibdEdxContainer.h index 5781984b33222..33089ff301d06 100644 --- a/GPU/GPUTracking/DataTypes/CalibdEdxContainer.h +++ b/GPU/GPUTracking/DataTypes/CalibdEdxContainer.h @@ -280,9 +280,7 @@ class CalibdEdxContainer : public o2::gpu::FlatObject CalDet processThresholdMap(const CalDet& thresholdMap, const float maxThreshold, const int32_t nPadsInRowCl = 2, const int32_t nPadsInPadCl = 2) const; #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(CalibdEdxContainer, 2); -#endif }; } // namespace o2::tpc diff --git a/GPU/GPUTracking/DataTypes/CalibdEdxTrackTopologySpline.cxx b/GPU/GPUTracking/DataTypes/CalibdEdxTrackTopologySpline.cxx index 3b0e718026536..1714e61015121 100644 --- a/GPU/GPUTracking/DataTypes/CalibdEdxTrackTopologySpline.cxx +++ b/GPU/GPUTracking/DataTypes/CalibdEdxTrackTopologySpline.cxx @@ -19,7 +19,7 @@ #endif #include "CalibdEdxTrackTopologySpline.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; #if !defined(GPUCA_STANDALONE) diff --git a/GPU/GPUTracking/DataTypes/GPUConfigDump.cxx b/GPU/GPUTracking/DataTypes/GPUConfigDump.cxx index 4a9bb3dc195cc..7ec2df3a2f186 100644 --- a/GPU/GPUTracking/DataTypes/GPUConfigDump.cxx +++ b/GPU/GPUTracking/DataTypes/GPUConfigDump.cxx @@ -22,7 +22,7 @@ #include "utils/qconfig_helpers.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; namespace { diff --git a/GPU/GPUTracking/DataTypes/GPUConfigDump.h b/GPU/GPUTracking/DataTypes/GPUConfigDump.h index 300499f6180b7..b0c0a6d73a109 100644 --- a/GPU/GPUTracking/DataTypes/GPUConfigDump.h +++ b/GPU/GPUTracking/DataTypes/GPUConfigDump.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUSettingsRec; struct GPUSettingsProcessing; @@ -32,6 +32,6 @@ class GPUConfigDump static void dumpConfig(const GPUSettingsRec* rec, const GPUSettingsProcessing* proc, const GPUSettingsQA* qa, const GPUSettingsDisplay* display, const GPUSettingsDeviceBackend* device, const GPURecoStepConfiguration* workflow); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/GPUDataTypes.cxx b/GPU/GPUTracking/DataTypes/GPUDataTypes.cxx index 11680c3de118f..c544ac610cdfa 100644 --- a/GPU/GPUTracking/DataTypes/GPUDataTypes.cxx +++ b/GPU/GPUTracking/DataTypes/GPUDataTypes.cxx @@ -15,7 +15,7 @@ #include "GPUDataTypes.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; constexpr const char* const GPUDataTypes::DEVICE_TYPE_NAMES[]; constexpr const char* const GPUDataTypes::RECO_STEP_NAMES[]; diff --git a/GPU/GPUTracking/DataTypes/GPUDataTypes.h b/GPU/GPUTracking/DataTypes/GPUDataTypes.h index d252bb39857c2..4c275d6de1bf1 100644 --- a/GPU/GPUTracking/DataTypes/GPUDataTypes.h +++ b/GPU/GPUTracking/DataTypes/GPUDataTypes.h @@ -91,7 +91,7 @@ class CalibdEdxContainer; } // namespace tpc } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -100,9 +100,9 @@ class TPCFastTransform; struct TPCPadGainCalib; struct TPCZSLinkMapping; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -326,6 +326,6 @@ struct GPUTrackingInOutPointers { #undef ENUM_CLASS #undef ENUM_UINT } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUHostDataTypes.h b/GPU/GPUTracking/DataTypes/GPUHostDataTypes.h index 01909f5b2ab80..0788b445416b4 100644 --- a/GPU/GPUTracking/DataTypes/GPUHostDataTypes.h +++ b/GPU/GPUTracking/DataTypes/GPUHostDataTypes.h @@ -32,7 +32,7 @@ #include "SimulationDataFormat/ConstMCTruthContainer.h" #include "SimulationDataFormat/MCCompLabel.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -56,6 +56,6 @@ struct GPUTPCLinearLabels { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.cxx b/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.cxx index 0d9df9366d863..8b8fbc3ecae20 100644 --- a/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.cxx +++ b/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.cxx @@ -15,7 +15,7 @@ #include "GPUMemorySizeScalers.h" #include "GPULogging.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUMemorySizeScalers::rescaleMaxMem(size_t newAvailableMemory) { diff --git a/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.h b/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.h index 8b3d19295e989..2cec1775dd239 100644 --- a/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.h +++ b/GPU/GPUTracking/DataTypes/GPUMemorySizeScalers.h @@ -17,7 +17,7 @@ #include "GPUDef.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUMemorySizeScalers { @@ -84,6 +84,6 @@ struct GPUMemorySizeScalers { inline size_t NTPCUnattachedHitsBase1024(int32_t type) { return (returnMaxVal || conservative) ? 1024 : std::min(1024, tpcCompressedUnattachedHitsBase1024[type] * factor * temporaryFactor); } }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx index f4061fa12873c..3fa2f909911f0 100644 --- a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx +++ b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.cxx @@ -14,7 +14,7 @@ #include "GPUNewCalibValues.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUNewCalibValues::updateFrom(const GPUNewCalibValues* from) { diff --git a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h index 5d5a31785928c..e16fde9614911 100644 --- a/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h +++ b/GPU/GPUTracking/DataTypes/GPUNewCalibValues.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -34,6 +34,6 @@ struct GPUNewCalibValues { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUO2FakeClasses.h b/GPU/GPUTracking/DataTypes/GPUO2FakeClasses.h index 8e6fc4854d900..40222021126fd 100644 --- a/GPU/GPUTracking/DataTypes/GPUO2FakeClasses.h +++ b/GPU/GPUTracking/DataTypes/GPUO2FakeClasses.h @@ -94,7 +94,7 @@ class ConstMCTruthContainer } // namespace dataformats } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -143,6 +143,6 @@ class GPUTPCClusterStatistics }; #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUOutputControl.h b/GPU/GPUTracking/DataTypes/GPUOutputControl.h index 58eaf161f865f..cad554f355c8e 100644 --- a/GPU/GPUTracking/DataTypes/GPUOutputControl.h +++ b/GPU/GPUTracking/DataTypes/GPUOutputControl.h @@ -20,7 +20,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -84,6 +84,6 @@ struct GPUTrackingOutputs { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUSettings.h b/GPU/GPUTracking/DataTypes/GPUSettings.h index d4cee937b727f..eff95e07fe09d 100644 --- a/GPU/GPUTracking/DataTypes/GPUSettings.h +++ b/GPU/GPUTracking/DataTypes/GPUSettings.h @@ -22,7 +22,7 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -80,7 +80,7 @@ struct GPUSettingsDeviceBackend { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #ifdef GPUCA_GPUCODE_DEVICE #define QCONFIG_GPU diff --git a/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.cxx b/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.cxx index 475b7888a150d..58a52589404d8 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.cxx +++ b/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.cxx @@ -15,7 +15,7 @@ #include "GPUTPCClusterOccupancyMap.h" #include "GPUParam.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUd() uint32_t GPUTPCClusterOccupancyMapBin::getNBins(const GPUParam& param) { diff --git a/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.h b/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.h index ac76fd6e32a41..746fb1cf7d19f 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCClusterOccupancyMap.h @@ -18,7 +18,7 @@ #include "GPUCommonDef.h" #include "GPUDefConstantsAndSettings.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUParam; struct GPUTPCClusterOccupancyMapBin { @@ -28,6 +28,6 @@ struct GPUTPCClusterOccupancyMapBin { GPUd() static uint32_t getTotalSize(const GPUParam& param); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGMMergedTrackHit.h b/GPU/GPUTracking/DataTypes/GPUTPCGMMergedTrackHit.h index 771385d24e60a..2039638c81b9a 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGMMergedTrackHit.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCGMMergedTrackHit.h @@ -17,17 +17,13 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { struct GPUTPCGMMergedTrackHit { uint32_t num; uint8_t slice, row, leg, state; -#ifdef GPUCA_ALIROOT_LIB - float x, y, z; - uint16_t amp; -#endif // NOTE: the lower states must match those from ClusterNative! enum hitState { flagSplitPad = 0x1, @@ -53,6 +49,6 @@ struct GPUTPCGMMergedTrackHitXYZ { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.cxx b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.cxx index 37d32ed4c1bc5..f26d7c5e0c45d 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.cxx +++ b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.cxx @@ -13,9 +13,9 @@ /// \author Sergey Gorbunov, David Rohr #include "GPUTPCGMPolynomialField.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#if defined(GPUCA_ALIROOT_LIB) & !defined(GPUCA_GPUCODE) +#if !defined(GPUCA_GPUCODE) #include "GPUCommonConstants.h" #include diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h index 19b72c8a7be90..13940cecc86de 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCGMPolynomialField.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -290,6 +290,6 @@ GPUdi() float GPUTPCGMPolynomialField::GetFieldItsBz(float x, float y, float z) } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h b/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h index b77961c11c0d4..c9111103bd065 100644 --- a/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h +++ b/GPU/GPUTracking/DataTypes/GPUTPCGeometry.h @@ -26,7 +26,7 @@ #endif #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -137,5 +137,5 @@ class GPUTPCGeometry // TODO: Make values constexpr } }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTRDDef.h b/GPU/GPUTracking/DataTypes/GPUTRDDef.h index 75eb1f813780e..4340e854cd67d 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDDef.h +++ b/GPU/GPUTracking/DataTypes/GPUTRDDef.h @@ -17,16 +17,6 @@ #include "GPUCommonDef.h" -#ifdef GPUCA_ALIROOT_LIB -#define TRD_TRACK_TYPE_ALIROOT -#else -#define TRD_TRACK_TYPE_O2 -#endif - -#ifdef GPUCA_ALIROOT_LIB -class AliExternalTrackParam; -class AliTrackerBase; -#else namespace o2 { namespace track @@ -40,38 +30,19 @@ template class PropagatorImpl; } // namespace base } // namespace o2 -#endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { -#ifdef GPUCA_ALIROOT_LIB -typedef double My_Float; -#else -typedef float My_Float; -#endif - -#if defined(TRD_TRACK_TYPE_ALIROOT) -typedef AliExternalTrackParam TRDBaseTrack; -class GPUTPCGMTrackParam; -typedef GPUTPCGMTrackParam TRDBaseTrackGPU; -#elif defined(TRD_TRACK_TYPE_O2) typedef o2::track::TrackParametrizationWithError TRDBaseTrack; class GPUTPCGMTrackParam; typedef GPUTPCGMTrackParam TRDBaseTrackGPU; -#endif -#ifdef GPUCA_ALIROOT_LIB -typedef AliTrackerBase TRDBasePropagator; -class GPUTPCGMPropagator; -typedef GPUTPCGMPropagator TRDBasePropagatorGPU; -#else typedef o2::base::PropagatorImpl TRDBasePropagator; class GPUTPCGMPropagator; typedef GPUTPCGMPropagator TRDBasePropagatorGPU; -#endif template class trackInterface; @@ -92,6 +63,6 @@ typedef GPUTRDTracker_t GPUTRDTracker; typedef GPUTRDTracker_t GPUTRDTrackerGPU; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDDEF_H diff --git a/GPU/GPUTracking/DataTypes/GPUTRDInterfaceO2Track.h b/GPU/GPUTracking/DataTypes/GPUTRDInterfaceO2Track.h index 86bf799e1fb17..6b37afbde12d7 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDInterfaceO2Track.h +++ b/GPU/GPUTracking/DataTypes/GPUTRDInterfaceO2Track.h @@ -17,7 +17,7 @@ // This is the interface for the GPUTRDTrack based on the O2 track type #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -29,7 +29,7 @@ namespace gputpcgmmergertypes struct GPUTPCOuterParam; } // namespace gputpcgmmergertypes } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #include "ReconstructionDataFormats/Track.h" #include "ReconstructionDataFormats/TrackTPCITS.h" @@ -38,7 +38,7 @@ struct GPUTPCOuterParam; #include "ReconstructionDataFormats/TrackLTIntegral.h" #include "CommonConstants/LHCConstants.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -95,6 +95,6 @@ class trackInterface : public o2::track::TrackParCov }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx b/GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx index ab3bec3434c37..d9b7e2f3e829e 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx +++ b/GPU/GPUTracking/DataTypes/GPUTRDTrack.cxx @@ -15,21 +15,18 @@ #include "GPUTRDTrack.h" #include "GPUTRDInterfaces.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "GPUTRDTrack.inc" #if !defined(GPUCA_GPUCODE) -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { -#ifdef GPUCA_ALIROOT_LIB // Instantiate AliRoot track version -template class GPUTRDTrack_t>; -#endif #if defined(GPUCA_HAVE_O2HEADERS) && !defined(GPUCA_O2_LIB) // Instantiate O2 track version, for O2 this happens in GPUTRDTrackO2.cxx template class GPUTRDTrack_t>; #endif template class GPUTRDTrack_t>; // Always instatiate GM track version } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUTRDTrack.h b/GPU/GPUTracking/DataTypes/GPUTRDTrack.h index 21080499f6443..7327eca1bfa56 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDTrack.h +++ b/GPU/GPUTracking/DataTypes/GPUTRDTrack.h @@ -36,11 +36,11 @@ class GlobalTrackID; } // namespace o2 //_____________________________________________________________________________ -#if (!defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB)) || defined(GPUCA_HAVE_O2HEADERS) +#if (!defined(GPUCA_STANDALONE)) || defined(GPUCA_HAVE_O2HEADERS) #include "GPUTRDInterfaceO2Track.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -98,10 +98,6 @@ class GPUTRDTrack_t : public T GPUd() bool getIsFindable(int32_t iLayer) const { return (mFlags >> iLayer) & 0x1; } GPUd() int32_t getNmissingConsecLayers(int32_t iLayer) const; GPUd() int32_t getIsPenaltyAdded(int32_t iLayer) const { return getIsFindable(iLayer) && getTrackletIndex(iLayer) < 0; } - // for AliRoot compatibility. To be removed once HLT/global/AliHLTGlobalEsdConverterComponent.cxx does not require them anymore - GPUd() int32_t GetTPCtrackId() const { return mRefGlobalTrackId; } - GPUd() bool GetIsStopped() const { return getIsStopped(); } - GPUd() int32_t GetNtracklets() const { return getNtracklets(); } // setters GPUd() void setRefGlobalTrackIdRaw(uint32_t id) { mRefGlobalTrackId = id; } @@ -117,10 +113,6 @@ class GPUTRDTrack_t : public T GPUd() void setHasNeighbor() { mIsCrossingNeighbor |= (1U << 6); } GPUd() void setHasPadrowCrossing() { mIsCrossingNeighbor |= (1U << 7); } - // conversion to / from HLT track structure (only for AliRoot) - GPUd() void ConvertTo(GPUTRDTrackDataRecord& t) const; - GPUd() void ConvertFrom(const GPUTRDTrackDataRecord& t); - protected: float mChi2; // total chi2. float mSignal{-1.f}; // electron Likelihood for track @@ -132,12 +124,12 @@ class GPUTRDTrack_t : public T private: GPUd() void initialize(); -#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_STANDALONE) ClassDefNV(GPUTRDTrack_t, 4); #endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDTRACK_H diff --git a/GPU/GPUTracking/DataTypes/GPUTRDTrack.inc b/GPU/GPUTracking/DataTypes/GPUTRDTrack.inc index 44617680580f2..48fd3fc42d22f 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDTrack.inc +++ b/GPU/GPUTracking/DataTypes/GPUTRDTrack.inc @@ -27,7 +27,7 @@ GPUd() GPUTRDTrack_t::GPUTRDTrack_t() template GPUd() void GPUTRDTrack_t::initialize() { - // set all members to their default values (needed since in-class initialization not possible with AliRoot) + // TODO: Use in-class initialization instead of setting all members to their default values mChi2 = 0.f; mSignal = -1.f; mRefGlobalTrackId = 0; @@ -39,58 +39,6 @@ GPUd() void GPUTRDTrack_t::initialize() } } -#ifdef GPUCA_ALIROOT_LIB -#include "AliHLTExternalTrackParam.h" -#include "GPUTRDTrackData.h" - -template -GPUd() GPUTRDTrack_t::GPUTRDTrack_t(const AliHLTExternalTrackParam& t) : T(t) -{ - initialize(); -} - -template -GPUd() void GPUTRDTrack_t::ConvertTo(GPUTRDTrackDataRecord& t) const -{ - //------------------------------------------------------------------ - // convert to GPU structure - //------------------------------------------------------------------ - t.mAlpha = T::getAlpha(); - t.fX = T::getX(); - t.fY = T::getY(); - t.fZ = T::getZ(); - t.fq1Pt = T::getQ2Pt(); - t.mSinPhi = T::getSnp(); - t.fTgl = T::getTgl(); - for (int32_t i = 0; i < 15; i++) { - t.fC[i] = T::getCov()[i]; - } - t.fTPCTrackID = getRefGlobalTrackIdRaw(); - for (int32_t i = 0; i < kNLayers; i++) { - t.fAttachedTracklets[i] = getTrackletIndex(i); - } -} - -template -GPUd() void GPUTRDTrack_t::ConvertFrom(const GPUTRDTrackDataRecord& t) -{ - //------------------------------------------------------------------ - // convert from GPU structure - //------------------------------------------------------------------ - T::set(t.fX, t.mAlpha, &(t.fY), t.fC); - setRefGlobalTrackIdRaw(t.fTPCTrackID); - mChi2 = 0.f; - mSignal = -1.f; - mFlags = 0; - mIsCrossingNeighbor = 0; - mCollisionId = -1; - for (int32_t iLayer = 0; iLayer < kNLayers; iLayer++) { - mAttachedTracklets[iLayer] = t.fAttachedTracklets[iLayer]; - } -} - -#endif - #if defined(GPUCA_HAVE_O2HEADERS) #include "ReconstructionDataFormats/TrackTPCITS.h" #include "DataFormatsTPC/TrackTPC.h" diff --git a/GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx b/GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx index d2404f9d3b74b..8364093aa5c4a 100644 --- a/GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx +++ b/GPU/GPUTracking/DataTypes/GPUTRDTrackO2.cxx @@ -13,7 +13,7 @@ /// \author David Rohr #include "GPUTRDTrackO2.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "GPUTRDTrack.inc" #include "ReconstructionDataFormats/GlobalTrackID.h" diff --git a/GPU/GPUTracking/DataTypes/GPUTriggerOutputs.h b/GPU/GPUTracking/DataTypes/GPUTriggerOutputs.h index 76de1116999ff..7c610403ad62e 100644 --- a/GPU/GPUTracking/DataTypes/GPUTriggerOutputs.h +++ b/GPU/GPUTracking/DataTypes/GPUTriggerOutputs.h @@ -22,7 +22,7 @@ #include "DataFormatsTPC/ZeroSuppression.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -56,6 +56,6 @@ struct GPUTriggerOutputs { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/GPUdEdxInfo.h b/GPU/GPUTracking/DataTypes/GPUdEdxInfo.h index c5635b7c5d488..b4af969de46b3 100644 --- a/GPU/GPUTracking/DataTypes/GPUdEdxInfo.h +++ b/GPU/GPUTracking/DataTypes/GPUdEdxInfo.h @@ -19,7 +19,7 @@ #include "DataFormatsTPC/dEdxInfo.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -30,6 +30,6 @@ struct GPUdEdxInfo { }; #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx b/GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx index cb32cad984664..40ce8c0ccda81 100644 --- a/GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx +++ b/GPU/GPUTracking/DataTypes/TPCPadBitMap.cxx @@ -17,7 +17,7 @@ #include "GPUTPCGeometry.h" #include "DataFormatsTPC/Constants.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCPadBitMap::TPCPadBitMap() { diff --git a/GPU/GPUTracking/DataTypes/TPCPadBitMap.h b/GPU/GPUTracking/DataTypes/TPCPadBitMap.h index 591ca927e57c5..5a4beda82889e 100644 --- a/GPU/GPUTracking/DataTypes/TPCPadBitMap.h +++ b/GPU/GPUTracking/DataTypes/TPCPadBitMap.h @@ -24,7 +24,7 @@ template class CalDet; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct TPCPadBitMap { @@ -105,6 +105,6 @@ struct TPCPadBitMap { SectorBitMap mBitMap[GPUCA_NSLICES]; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/TPCPadGainCalib.cxx b/GPU/GPUTracking/DataTypes/TPCPadGainCalib.cxx index 198f6713a44a1..41f0ad819d1b6 100644 --- a/GPU/GPUTracking/DataTypes/TPCPadGainCalib.cxx +++ b/GPU/GPUTracking/DataTypes/TPCPadGainCalib.cxx @@ -17,7 +17,7 @@ #include "GPUTPCGeometry.h" #include "DataFormatsTPC/Constants.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCPadGainCalib::TPCPadGainCalib() { diff --git a/GPU/GPUTracking/DataTypes/TPCPadGainCalib.h b/GPU/GPUTracking/DataTypes/TPCPadGainCalib.h index e7908a4b87efc..35aa353a384e6 100644 --- a/GPU/GPUTracking/DataTypes/TPCPadGainCalib.h +++ b/GPU/GPUTracking/DataTypes/TPCPadGainCalib.h @@ -24,7 +24,7 @@ template class CalDet; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { template @@ -157,6 +157,6 @@ struct TPCPadGainCalib { SectorPadGainCorrection mGainCorrection[GPUCA_NSLICES]; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.cxx b/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.cxx index 73d8a06a43ff9..60f960d1b25f0 100644 --- a/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.cxx +++ b/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.cxx @@ -18,7 +18,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCZSLinkMapping::TPCZSLinkMapping(o2::tpc::Mapper& mapper) { diff --git a/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.h b/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.h index 8d2e9847c48a2..9f7862cef726d 100644 --- a/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.h +++ b/GPU/GPUTracking/DataTypes/TPCZSLinkMapping.h @@ -25,7 +25,7 @@ namespace o2::tpc class Mapper; } -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct TPCZSLinkMapping { @@ -38,6 +38,6 @@ struct TPCZSLinkMapping { #endif }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/Debug/GPUROOTDump.h b/GPU/GPUTracking/Debug/GPUROOTDump.h index 5734d8b5b3338..407076c98b4be 100644 --- a/GPU/GPUTracking/Debug/GPUROOTDump.h +++ b/GPU/GPUTracking/Debug/GPUROOTDump.h @@ -26,7 +26,7 @@ class TNtuple; #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -171,6 +171,6 @@ class GPUROOTDump }; #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Debug/GPUROOTDumpCore.cxx b/GPU/GPUTracking/Debug/GPUROOTDumpCore.cxx index a0b560f119373..846c85e8e1cb3 100644 --- a/GPU/GPUTracking/Debug/GPUROOTDumpCore.cxx +++ b/GPU/GPUTracking/Debug/GPUROOTDumpCore.cxx @@ -19,7 +19,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; std::weak_ptr GPUROOTDumpCore::sInstance; diff --git a/GPU/GPUTracking/Debug/GPUROOTDumpCore.h b/GPU/GPUTracking/Debug/GPUROOTDumpCore.h index 73a76ddba1706..f3f7890ebfa5b 100644 --- a/GPU/GPUTracking/Debug/GPUROOTDumpCore.h +++ b/GPU/GPUTracking/Debug/GPUROOTDumpCore.h @@ -21,7 +21,7 @@ class TFile; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -62,6 +62,6 @@ class GPUROOTDumpCore #endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h index 1c8134f11efda..a5fc85eb80713 100644 --- a/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h +++ b/GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h @@ -22,12 +22,12 @@ #include "GPUCommonDef.h" -#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) && !defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE) - #error You are using the CA GPU tracking without defining the build type (O2/AliRoot/Standalone). If you are running an O2 ROOT macro, please include GPUO2Interface.h first! +#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE) + #error You are using the CA GPU tracking without defining the build type (O2/Standalone). If you are running an O2 ROOT macro, please include GPUO2Interface.h first! #endif -#if (defined(GPUCA_ALIROOT_LIB) && defined(GPUCA_O2_LIB)) || (defined(GPUCA_ALIROOT_LIB) && defined(GPUCA_STANDALONE)) || (defined(GPUCA_O2_LIB) && defined(GPUCA_STANDALONE)) - #error Invalid Compile Definitions, need to build for either AliRoot or O2 or Standalone! +#if (defined(GPUCA_O2_LIB) && defined(GPUCA_STANDALONE)) + #error Invalid Compile Definitions, need to build for either O2 or Standalone! #endif #define GPUCA_TRACKLET_SELECTOR_MIN_HITS_B5(QPTB5) (CAMath::Abs(QPTB5) > 10 ? 10 : (CAMath::Abs(QPTB5) > 5 ? 15 : 29)) // Minimum hits should depend on Pt, low Pt tracks can have few hits. 29 Hits default, 15 for < 200 mev, 10 for < 100 mev diff --git a/GPU/GPUTracking/Definitions/GPULogging.h b/GPU/GPUTracking/Definitions/GPULogging.h index e33c9463a2f48..693512b15c3c2 100644 --- a/GPU/GPUTracking/Definitions/GPULogging.h +++ b/GPU/GPUTracking/Definitions/GPULogging.h @@ -44,9 +44,8 @@ fmt::fprintf(stderr, string "\n", ##__VA_ARGS__); \ throw std::exception(); \ } -#elif defined(GPUCA_STANDALONE) || defined(GPUCA_GPUCODE_DEVICE) || (defined(GPUCA_ALIROOT_LIB) && defined(GPUCA_GPUCODE)) +#elif defined(GPUCA_STANDALONE) || defined(GPUCA_GPUCODE_DEVICE) // For standalone / CUDA / HIP, we just use printf, which should be available - // Temporarily, we also have to handle CUDA on AliRoot with O2 defaults due to ROOT / CUDA incompatibilities #include #define GPUInfo(string, ...) \ { \ @@ -71,38 +70,6 @@ exit(1); \ } #endif -#elif defined(GPUCA_ALIROOT_LIB) - // Forward to HLT Logging functions for AliRoot - #include "AliHLTLogging.h" - #define GPUInfo(...) HLTInfo(__VA_ARGS__) - #define GPUImportant(...) HLTImportant(__VA_ARGS__) - #define GPUWarning(...) HLTWarning(__VA_ARGS__) - #define GPUAlarm(...) HLTWarning(__VA_ARGS__) - #define GPUError(...) HLTError(__VA_ARGS__) - #define GPUFatal(...) HLTFatal(__VA_ARGS__) - // Workaround for static functions / classes not deriving from AliHLTLogging - namespace AliGPU - { - namespace gpu - { - // We pollute the AliGPU::gpu namespace with some anonymous functions that catch the HLT...() magic - namespace - { - AliHLTLogging gAliGPULog; // This creates a couple of bogus instances, but there are plenty anyway - template - void LoggingVarargs(Args... args) - { - gAliGPULog.LoggingVarargs(args...); - } - template - bool CheckFilter(Args... args) - { - return gAliGPULog.CheckFilter(args...); - } - const char* Class_Name() { return "GPU"; }; - } // namespace - } // namespace gpu - } // namespace AliGPU #elif defined(GPUCA_O2_LIB) || defined(GPUCA_O2_INTERFACE) // Forward to O2 LOGF logginf for O2 #include "GPUCommonLogger.h" diff --git a/GPU/GPUTracking/Definitions/GPUSettingsList.h b/GPU/GPUTracking/Definitions/GPUSettingsList.h index b7881bd61978c..76370c17f9f53 100644 --- a/GPU/GPUTracking/Definitions/GPUSettingsList.h +++ b/GPU/GPUTracking/Definitions/GPUSettingsList.h @@ -27,10 +27,10 @@ // clang-format off #ifdef QCONFIG_INSTANCE -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #endif #ifdef BeginNamespace // File should not be included without defining the macros, but rootcling will do for dictionary generation -BeginNamespace(GPUCA_NAMESPACE) +BeginNamespace(o2) BeginNamespace(gpu) // Settings concerning the reconstruction, stored as parameters in GPU constant memory @@ -136,10 +136,10 @@ AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fractio AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(globalTracking, int8_t, 1, "", 0, "Enable Global Tracking (prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit (1: attachment, 2: propagation, 4: loop following, 8: mirroring)") -AddOptionRTC(rejectionStrategy, uint8_t, GPUCA_NAMESPACE::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression (0 = no, 1 = strategy A, 2 = strategy B)") +AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression (0 = no, 1 = strategy A, 2 = strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") -AddOptionRTC(compressionTypeMask, uint8_t, GPUCA_NAMESPACE::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits (1=truncate charge/width LSB, 2=differences, 4=track-model)") -AddOptionRTC(compressionSortOrder, uint8_t, GPUCA_NAMESPACE::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression (0 = time, 1 = pad, 2 = Z-time-pad, 3 = Z-pad-time, 4 = no sorting (use incoming order))") +AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits (1=truncate charge/width LSB, 2=differences, 4=track-model)") +AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression (0 = time, 1 = pad, 2 = Z-time-pad, 3 = Z-pad-time, 4 = no sorting (use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(forceEarlyTransform, int8_t, -1, "", 0, "Force early TPC transformation also for continuous data (-1 = auto)") @@ -299,7 +299,7 @@ AddOption(RTCprependCommand, std::string, "", "", 0, "Prepend RTC compilation co AddOption(RTCoverrideArchitecture, std::string, "", "", 0, "Override arhcitecture part of RTC compilation command line") AddOption(oclCompileFromSources, bool, false, "", 0, "Compile OpenCL binary from included source code instead of using included spirv code") AddOption(printSettings, bool, false, "", 0, "Print all settings when initializing") -AddVariable(eventDisplay, GPUCA_NAMESPACE::gpu::GPUDisplayFrontendInterface*, nullptr) +AddVariable(eventDisplay, o2::gpu::GPUDisplayFrontendInterface*, nullptr) AddSubConfig(GPUSettingsProcessingRTC, rtc) AddSubConfig(GPUSettingsProcessingParam, param) AddHelp("help", 'h') @@ -588,7 +588,7 @@ AddVariableRTC(debugLevel, int8_t, 0) // Debug level EndConfig() EndNamespace() // gpu -EndNamespace() // GPUCA_NAMESPACE +EndNamespace() // o2 #endif // #ifdef BeginNamespace // clang-format on diff --git a/GPU/GPUTracking/Definitions/clusterFinderDefs.h b/GPU/GPUTracking/Definitions/clusterFinderDefs.h index a681a176f9b5c..b36a94fc2bd54 100644 --- a/GPU/GPUTracking/Definitions/clusterFinderDefs.h +++ b/GPU/GPUTracking/Definitions/clusterFinderDefs.h @@ -54,7 +54,7 @@ #define CPU_PTR(x) x #endif -namespace GPUCA_NAMESPACE::gpu::tpccf +namespace o2::gpu::tpccf { using SizeT = size_t; @@ -72,6 +72,6 @@ using Delta2 = short2; using local_id = short2; -} // namespace GPUCA_NAMESPACE::gpu::tpccf +} // namespace o2::gpu::tpccf #endif diff --git a/GPU/GPUTracking/GPUTrackingLinkDef_AliRoot.h b/GPU/GPUTracking/GPUTrackingLinkDef_AliRoot.h deleted file mode 100644 index 8974b4bd89460..0000000000000 --- a/GPU/GPUTracking/GPUTrackingLinkDef_AliRoot.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTrackingLinkDef_AliRoot.h -/// \author David Rohr - -#if defined(__CLING__) - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ class AliGPU::gpu::GPUTPCTrack + ; -#pragma link C++ class AliGPU::gpu::GPUTPCTracklet + ; -#pragma link C++ class AliGPU::gpu::GPUTPCBaseTrackParam + ; -#pragma link C++ class AliGPU::gpu::GPUTPCTrackParam + ; -#pragma link C++ class AliGPU::gpu::GPUTPCRow + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGrid + ; -#pragma link C++ class GPUTPCTrackerComponent + ; -#pragma link C++ class AliGPU::gpu::GPUTPCNeighboursFinder + ; -#pragma link C++ class AliGPU::gpu::GPUTPCNeighboursCleaner + ; -#pragma link C++ class AliGPU::gpu::GPUTPCStartHitsFinder + ; -#pragma link C++ class AliGPU::gpu::GPUTPCTrackletConstructor + ; -#pragma link C++ class AliGPU::gpu::GPUTPCTrackletSelector + ; -#pragma link C++ class GPUTPCGlobalMergerComponent + ; -#pragma link C++ class AliGPU::gpu::GPUTPCSliceOutput + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGMTrackParam + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGMSliceTrack + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGMPolynomialField + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGMPropagator + ; -#pragma link C++ class AliGPU::gpu::GPUTPCGMPhysicalTrackModel + ; -#pragma link C++ class GPUTPCGMPolynomialFieldManager + ; -#pragma link C++ class AliHLTTPCClusterStatComponent + ; - -//#pragma link C++ class AliGPU::gpu::GPUTRDTrack+; //Templated, should add linkdef for specialization, but with an ifdef for ROOT >= 6 only -//#pragma link C++ class AliGPU::gpu::GPUTRDTracker+; -#pragma link C++ class GPUTRDTrackerComponent + ; -//#pragma link C++ class AliGPU::gpu::GPUTRDTrackletWord+; -#pragma link C++ class GPUTRDTrackletReaderComponent + ; - -#endif diff --git a/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.cxx b/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.cxx deleted file mode 100644 index e9b4bb758532b..0000000000000 --- a/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.cxx +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLTGPUDumpComponent.cxx -/// \author David Rohr - -#include "AliHLTGPUDumpComponent.h" - -#include "AliGeomManager.h" -#include "GPUReconstruction.h" -#include "GPUChainTracking.h" -#include "AliHLTTPCDefinitions.h" -#include "GPUTPCMCInfo.h" -#include "GPUTPCGMMergedTrackHit.h" -#include "AliHLTTPCClusterXYZ.h" -#include "AliHLTTPCClusterMCData.h" -#include "GPUTPCClusterData.h" -#include "AliHLTTPCRawCluster.h" -#include "AliHLTTPCGeometry.h" -#include "AliRunLoader.h" -#include "AliHeader.h" -#include "AliStack.h" -#include "AliExternalTrackParam.h" -#include "AliTrackReference.h" -#include "AliHLTTRDDefinitions.h" -#include "GPUTRDTrackletWord.h" -#include "GPUTRDTrackletLabels.h" -#include "TPCFastTransform.h" -#include "CorrectionMapsHelper.h" -#include "TPCFastTransformManager.h" -#include "AliRecoParam.h" -#include "AliTPCTransform.h" -#include "AliTPCcalibDB.h" -#include "AliCDBManager.h" -#include "AliGRPObject.h" -#include "AliCDBEntry.h" -#include "AliRunInfo.h" -#include "AliEventInfo.h" -#include "AliRawEventHeaderBase.h" -#include "AliTPCRecoParam.h" -#include -#include - -#include "TTree.h" -#include "TParticle.h" -#include "TParticlePDG.h" -#include "TPDGCode.h" - -using namespace GPUCA_NAMESPACE::gpu; - -AliHLTGPUDumpComponent::AliHLTGPUDumpComponent() : fSolenoidBz(0.f), fRec(nullptr), fChain(nullptr), fFastTransformManager(new TPCFastTransformManager), fCalib(nullptr), fRecParam(nullptr), fOfflineRecoParam(), fOrigTransform(nullptr), fIsMC(false), fInitTimestamp(0.) -{ - fRec = GPUReconstruction::CreateInstance(); - fChain = fRec->AddChain(); -} - -AliHLTGPUDumpComponent::~AliHLTGPUDumpComponent() -{ - delete fRec; - delete fFastTransformManager; -} - -const char* AliHLTGPUDumpComponent::GetComponentID() { return "GPUDump"; } - -void AliHLTGPUDumpComponent::GetInputDataTypes(vector& list) -{ - list.clear(); - list.push_back(AliHLTTPCDefinitions::RawClustersDataType()); - list.push_back(AliHLTTPCDefinitions::ClustersXYZDataType()); - list.push_back(AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo()); - list.push_back(AliHLTTRDDefinitions::fgkTRDTrackletDataType); - list.push_back(AliHLTTRDDefinitions::fgkTRDMCTrackletDataType); -} - -AliHLTComponentDataType AliHLTGPUDumpComponent::GetOutputDataType() { return AliHLTTPCDefinitions::RawClustersDataType(); } - -void AliHLTGPUDumpComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - constBase = 10000; // minimum size - inputMultiplier = 0.6; // size relative to input -} - -AliHLTComponent* AliHLTGPUDumpComponent::Spawn() { return new AliHLTGPUDumpComponent; } - -int32_t AliHLTGPUDumpComponent::DoInit(int argc, const char** argv) -{ - fSolenoidBz = GetBz(); - fIsMC = TVirtualMC::GetMC(); - - if (!AliGeomManager::GetGeometry()) { - AliGeomManager::LoadGeometry(); - } - if (!AliGeomManager::GetGeometry()) { - HLTFatal("Can not initialise geometry"); - } - - fCalib = AliTPCcalibDB::Instance(); - if (!fCalib) { - HLTFatal("Calibration not found"); - } - fCalib->SetRun(GetRunNo()); - fCalib->UpdateRunInformations(GetRunNo()); - - const AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - fCalib->SetExBField(field); - - if (!fCalib->GetTransform()) { - HLTFatal("No TPC transformation found"); - } - - AliGRPObject* pGRP = 0; - AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data"); - if (!entry) { - HLTFatal("No GRP object found in data base"); - } - pGRP = dynamic_cast(entry->GetObject()); - - if (!pGRP) { - HLTFatal("Unknown format of the GRP object in data base"); - } - - AliRunInfo runInfo(pGRP->GetLHCState(), pGRP->GetBeamType(), pGRP->GetBeamEnergy(), pGRP->GetRunType(), pGRP->GetDetectorMask()); - AliEventInfo evInfo; - evInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent); - - entry = AliCDBManager::Instance()->Get("TPC/Calib/RecoParam"); - if (!entry) { - HLTFatal("No TPC reco param entry found in data base"); - } - TObject* recoParamObj = entry->GetObject(); - if (dynamic_cast(recoParamObj)) { - TObjArray* copy = (TObjArray*)(static_cast(recoParamObj)->Clone()); - fOfflineRecoParam.AddDetRecoParamArray(1, copy); - } else if (dynamic_cast(recoParamObj)) { - AliDetectorRecoParam* copy = (AliDetectorRecoParam*)static_cast(recoParamObj)->Clone(); - fOfflineRecoParam.AddDetRecoParam(1, copy); - } else { - HLTFatal("Unknown format of the TPC Reco Param entry in the data base"); - } - - fOfflineRecoParam.SetEventSpecie(&runInfo, evInfo, 0); - fRecParam = const_cast(reinterpret_cast(fOfflineRecoParam.GetDetRecoParam(1))); - if (!fRecParam) { - HLTFatal("No TPC Reco Param entry found for the given event specification"); - } - fCalib->GetTransform()->SetCurrentRecoParam(fRecParam); - fInitTimestamp = GetTimeStamp(); - - return 0; -} - -int32_t AliHLTGPUDumpComponent::DoDeinit() { return 0; } - -int32_t AliHLTGPUDumpComponent::Reconfigure(const char* cdbEntry, const char* chainId) { return 0; } - -int32_t AliHLTGPUDumpComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks) -{ - if (GetFirstInputBlock(kAliHLTDataTypeSOR) || GetFirstInputBlock(kAliHLTDataTypeEOR)) { - return 0; - } - - if (evtData.fBlockCnt <= 0) { - HLTWarning("no blocks in event"); - return 0; - } - - // Prepare everything for all slices - const AliHLTTPCClusterMCData* clusterLabels[NSLICES][NPATCHES] = {nullptr}; - const AliHLTTPCClusterXYZData* clustersXYZ[NSLICES][NPATCHES] = {nullptr}; - const AliHLTTPCRawClusterData* clustersRaw[NSLICES][NPATCHES] = {nullptr}; - bool labelsPresent = false; - const GPUTRDTrackletWord* TRDtracklets = nullptr; - int32_t nTRDTrackletsTotal = 0; - - for (uint64_t ndx = 0; ndx < evtData.fBlockCnt; ndx++) { - const AliHLTComponentBlockData& pBlock = blocks[ndx]; - int32_t slice = AliHLTTPCDefinitions::GetMinSliceNr(pBlock); - int32_t patch = AliHLTTPCDefinitions::GetMinPatchNr(pBlock); - if (pBlock.fDataType == AliHLTTPCDefinitions::RawClustersDataType()) { - clustersRaw[slice][patch] = (const AliHLTTPCRawClusterData*)pBlock.fPtr; - } else if (pBlock.fDataType == AliHLTTPCDefinitions::ClustersXYZDataType()) { - clustersXYZ[slice][patch] = (const AliHLTTPCClusterXYZData*)pBlock.fPtr; - } else if (pBlock.fDataType == AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo()) { - clusterLabels[slice][patch] = (const AliHLTTPCClusterMCData*)pBlock.fPtr; - labelsPresent = true; - } else if (pBlock.fDataType == AliHLTTRDDefinitions::fgkTRDTrackletDataType) { - TRDtracklets = reinterpret_cast(pBlock.fPtr); - nTRDTrackletsTotal = pBlock.fSize / sizeof(GPUTRDTrackletWord); - } - } - - std::vector rawClusters[NSLICES]; - std::vector clusterData[NSLICES]; - - int32_t nClustersTotal = 0; - for (int32_t slice = 0; slice < NSLICES; slice++) { - int32_t nClustersSliceTotal = 0; - clusterData[slice].clear(); - rawClusters[slice].clear(); - for (int32_t patch = 0; patch < 6; patch++) { - if (clustersXYZ[slice][patch]) { - nClustersSliceTotal += clustersXYZ[slice][patch]->fCount; - } - } - GPUTPCClusterData cluster; - for (int32_t patch = 0; patch < 6; patch++) { - if (clustersXYZ[slice][patch] != nullptr && clustersRaw[slice][patch] != nullptr) { - const AliHLTTPCClusterXYZData& clXYZ = *clustersXYZ[slice][patch]; - const AliHLTTPCRawClusterData& clRaw = *clustersRaw[slice][patch]; - - if (clXYZ.fCount != clRaw.fCount) { - HLTError("Number of entries in raw and xyz clusters are not mached %d vs %d", clXYZ.fCount, clRaw.fCount); - continue; - } - - const int32_t firstRow = AliHLTTPCGeometry::GetFirstRow(patch); - for (int32_t ic = 0; ic < clXYZ.fCount; ic++) { - const AliHLTTPCClusterXYZ& c = clXYZ.fClusters[ic]; - const AliHLTTPCRawCluster& cRaw = clRaw.fClusters[ic]; - if (fabsf(c.GetZ()) > 300) { - continue; - } - if (c.GetX() < 1.f) { - continue; // cluster xyz position was not calculated for whatever reason - } - cluster.id = AliHLTTPCGeometry::CreateClusterID(slice, patch, ic); - cluster.x = c.GetX(); - cluster.y = c.GetY(); - cluster.z = c.GetZ(); - cluster.row = firstRow + cRaw.GetPadRow(); - cluster.flags = cRaw.GetFlags(); - if (cRaw.GetSigmaPad2() < kAlmost0 || cRaw.GetSigmaTime2() < kAlmost0) { - cluster.flags |= GPUTPCGMMergedTrackHit::flagSingle; - } - cluster.amp = cRaw.GetCharge(); -#ifdef GPUCA_FULL_CLUSTERDATA - cluster.pad = cRaw.GetPad(); - cluster.time = cRaw.GetTime(); - cluster.ampMax = cRaw.GetQMax(); - cluster.sigmaPad2 = cRaw.GetSigmaPad2(); - cluster.sigmaTime2 = cRaw.GetSigmaTime2(); -#endif - AliHLTTPCRawCluster tmp = cRaw; - tmp.fPadRow += firstRow; - if ((uint32_t)cluster.amp >= 25 * 1024) { - GPUError("Invalid cluster charge, truncating (%d >= %d)", (int32_t)cluster.amp, 25 * 1024); - cluster.amp = 25 * 1024 - 1; - } - if ((uint32_t)tmp.GetCharge() >= 25 * 1024) { - GPUError("Invalid raw cluster charge, truncating (%d >= %d)", (int32_t)tmp.GetCharge(), 25 * 1024); - tmp.SetCharge(25 * 1024 - 1); - } - if ((uint32_t)tmp.GetQMax() >= 1024) { - GPUError("Invalid raw cluster charge max, truncating (%d >= %d)", (int32_t)tmp.GetQMax(), 1024); - tmp.SetQMax(1024 - 1); - } - clusterData[slice].emplace_back(cluster); - rawClusters[slice].emplace_back(tmp); - - nClustersTotal++; - } - } - } - HLTDebug("Read %d->%d hits for slice %d", nClustersSliceTotal, (int32_t)clusterData[slice].size(), slice); - } - - if (nClustersTotal < 100) { - return (0); - } - fChain->ClearIOPointers(); - - for (int32_t i = 0; i < NSLICES; i++) { - fChain->mIOPtrs.nClusterData[i] = clusterData[i].size(); - fChain->mIOPtrs.clusterData[i] = clusterData[i].data(); - fChain->mIOPtrs.nRawClusters[i] = rawClusters[i].size(); - fChain->mIOPtrs.rawClusters[i] = rawClusters[i].data(); - HLTDebug("Slice %d - Clusters %d", i, (int32_t)clusterData[i].size()); - } - - std::vector labels; - std::vector mcInfo; - - if (labelsPresent) { - // Write cluster labels - for (uint32_t iSlice = 0; iSlice < NSLICES; iSlice++) { - GPUTPCClusterData* pCluster = clusterData[iSlice].data(); - for (uint32_t iPatch = 0; iPatch < NPATCHES; iPatch++) { - if (clusterLabels[iSlice][iPatch] == nullptr || clustersXYZ[iSlice][iPatch] == nullptr || clusterLabels[iSlice][iPatch]->fCount != clustersXYZ[iSlice][iPatch]->fCount) { - continue; - } - const AliHLTTPCClusterXYZData& clXYZ = *clustersXYZ[iSlice][iPatch]; - for (int32_t ic = 0; ic < clXYZ.fCount; ic++) { - if (pCluster->id != AliHLTTPCGeometry::CreateClusterID(iSlice, iPatch, ic)) { - continue; - } - pCluster->id = labels.size(); - labels.push_back(clusterLabels[iSlice][iPatch]->fLabels[ic]); - pCluster++; - } - } - } - - if (labels.size() != nClustersTotal) { - HLTFatal("Error getting cluster MC labels (%d labels, %d clusters)", (int32_t)labels.size(), nClustersTotal); - return (-EINVAL); - } - - fChain->mIOPtrs.nMCLabelsTPC = labels.size(); - fChain->mIOPtrs.mcLabelsTPC = labels.data(); - HLTDebug("Number of mc labels %d", (int32_t)labels.size()); - - // Write MC tracks - bool OK = false; - do { - AliRunLoader* rl = AliRunLoader::Instance(); - if (rl == nullptr) { - HLTFatal("error: RL"); - break; - } - - rl->LoadKinematics(); - rl->LoadTrackRefs(); - - int32_t nTracks = rl->GetHeader()->GetNtrack(); - mcInfo.resize(nTracks); - - AliStack* stack = rl->Stack(); - if (stack == nullptr) { - HLTFatal("error: stack"); - break; - } - TTree* TR = rl->TreeTR(); - if (TR == nullptr) { - HLTFatal("error: TR"); - break; - } - TBranch* branch = TR->GetBranch("TrackReferences"); - if (branch == nullptr) { - HLTFatal("error: branch"); - break; - } - - int32_t nPrimaries = stack->GetNprimary(); - - std::vector trackRefs(nTracks, nullptr); - TClonesArray* tpcRefs = nullptr; - branch->SetAddress(&tpcRefs); - int32_t nr = TR->GetEntries(); - for (int32_t r = 0; r < nr; r++) { - TR->GetEvent(r); - for (int32_t i = 0; i < tpcRefs->GetEntriesFast(); i++) { - AliTrackReference* tpcRef = (AliTrackReference*)tpcRefs->UncheckedAt(i); - if (tpcRef->DetectorId() != AliTrackReference::kTPC) { - continue; - } - if (tpcRef->Label() < 0 || tpcRef->Label() >= nTracks) { - HLTFatal("Invalid reference %d / %d", tpcRef->Label(), nTracks); - continue; - } - if (trackRefs[tpcRef->Label()] != nullptr) { - continue; - } - trackRefs[tpcRef->Label()] = new AliTrackReference(*tpcRef); - } - } - - memset(mcInfo.data(), 0, nTracks * sizeof(mcInfo[0])); - - for (int32_t i = 0; i < nTracks; i++) { - mcInfo[i].pid = -100; - TParticle* particle = (TParticle*)stack->Particle(i); - if (particle == nullptr) { - continue; - } - if (particle->GetPDG() == nullptr) { - continue; - } - - int32_t charge = (int32_t)particle->GetPDG()->Charge(); - int32_t prim = stack->IsPhysicalPrimary(i); - int32_t hasPrimDaughter = particle->GetFirstDaughter() != -1 && particle->GetFirstDaughter() < nPrimaries; - - mcInfo[i].charge = charge; - mcInfo[i].prim = prim; - mcInfo[i].primDaughters = hasPrimDaughter; - mcInfo[i].genRadius = sqrt(particle->Vx() * particle->Vx() + particle->Vy() * particle->Vy() + particle->Vz() * particle->Vz()); - - Int_t pid = -1; - if (TMath::Abs(particle->GetPdgCode()) == kElectron) { - pid = 0; - } - if (TMath::Abs(particle->GetPdgCode()) == kMuonMinus) { - pid = 1; - } - if (TMath::Abs(particle->GetPdgCode()) == kPiPlus) { - pid = 2; - } - if (TMath::Abs(particle->GetPdgCode()) == kKPlus) { - pid = 3; - } - if (TMath::Abs(particle->GetPdgCode()) == kProton) { - pid = 4; - } - mcInfo[i].pid = pid; - - AliTrackReference* ref = trackRefs[i]; - if (ref) { - mcInfo[i].x = ref->X(); - mcInfo[i].y = ref->Y(); - mcInfo[i].z = ref->Z(); - mcInfo[i].pX = ref->Px(); - mcInfo[i].pY = ref->Py(); - mcInfo[i].pZ = ref->Pz(); - } - - // if (ref) HLTImportant("Particle %d: Charge %d, Prim %d, PrimDaughter %d, Pt %f %f ref %p\n", i, charge, prim, hasPrimDaughter, ref->Pt(), particle->Pt(), ref); - } - for (int32_t i = 0; i < nTracks; i++) { - delete trackRefs[i]; - } - - OK = true; - } while (false); - - if (!OK) { - HLTFatal("Error accessing MC data"); - return (-EINVAL); - } - - fChain->mIOPtrs.nMCInfosTPC = mcInfo.size(); - fChain->mIOPtrs.mcInfosTPC = mcInfo.data(); - static const GPUTPCMCInfoCol mcColInfo = {0, (uint32_t)mcInfo.size()}; - fChain->mIOPtrs.mcInfosTPCCol = &mcColInfo; - fChain->mIOPtrs.nMCInfosTPCCol = 1; - HLTDebug("Number of MC infos: %d", (int32_t)mcInfo.size()); - } - uint32_t clusterNum = 0; - for (uint32_t slice = 0; slice < NSLICES; slice++) { - for (int32_t k = 0; k < fChain->mIOPtrs.nClusterData[slice]; k++) { - clusterData[slice][k].id = clusterNum++; - } - } - - fChain->mIOPtrs.nTRDTracklets = nTRDTrackletsTotal; - std::vector tracklets(nTRDTrackletsTotal); - for (int32_t i = 0; i < nTRDTrackletsTotal; i++) { - tracklets[i] = TRDtracklets[i]; - } - std::sort(tracklets.data(), tracklets.data() + nTRDTrackletsTotal); - fChain->mIOPtrs.trdTracklets = tracklets.data(); - - fChain->mIOPtrs.nTRDTriggerRecords = 1; - static float t = 0.f; - static int32_t o = 0; - fChain->mIOPtrs.trdTriggerTimes = &t; - fChain->mIOPtrs.trdTrackletIdxFirst = &o; - - HLTDebug("Number of TRD tracklets: %d", (int32_t)nTRDTrackletsTotal); - - static int32_t nEvent = 0; - char filename[256]; - std::ofstream out; - - if (nEvent == 0) { - std::unique_ptr fFastTransformIRS(new TPCFastTransform); - int64_t TimeStamp = (getenv("DUMP_TIMESTAMP_SOR") && atoi(getenv("DUMP_TIMESTAMP_SOR"))) ? fInitTimestamp : GetTimeStamp(); - if (fIsMC && !fRecParam->GetUseCorrectionMap()) { - TimeStamp = 0; - } - if (fFastTransformManager->create(*fFastTransformIRS, fCalib->GetTransform(), TimeStamp)) { - HLTFatal("Initialisation of Fast Transformation failed with error %s", fFastTransformManager->getLastError()); - } - std::unique_ptr tmpHelper; - tmpHelper->setCorrMap(fFastTransformIRS.get()); - fChain->SetTPCFastTransform(std::move(fFastTransformIRS), std::move(tmpHelper)); - - fRec->SetSettings(fSolenoidBz); - fRec->DumpSettings(); - } - - snprintf(filename, 256, GPUCA_EVDUMP_FILE ".%d.dump", nEvent++); - fChain->DumpData(filename); - return (0); -} diff --git a/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.h b/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.h deleted file mode 100644 index a4977e6859968..0000000000000 --- a/GPU/GPUTracking/Global/AliHLTGPUDumpComponent.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLTGPUDumpComponent.h -/// \author David Rohr - -#ifndef ALIHLTGPUDUMPCOMPONENT_H -#define ALIHLTGPUDUMPCOMPONENT_H - -#include "GPUCommonDef.h" -#include "AliHLTProcessor.h" - -class AliTPCcalibDB; -class AliTPCRecoParam; -#include "AliRecoParam.h" -class AliTPCTransform; -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -class TPCFastTransform; -class TPCFastTransformManager; -class GPUReconstruction; -class GPUChainTracking; -class GPUTPCClusterData; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -class AliHLTGPUDumpComponent : public AliHLTProcessor -{ - public: - static const uint32_t NSLICES = 36; - static const uint32_t NPATCHES = 6; - - AliHLTGPUDumpComponent(); - - AliHLTGPUDumpComponent(const AliHLTGPUDumpComponent&) = delete; - AliHLTGPUDumpComponent& operator=(const AliHLTGPUDumpComponent&) = delete; - - virtual ~AliHLTGPUDumpComponent(); - - const char* GetComponentID(); - void GetInputDataTypes(vector& list); - AliHLTComponentDataType GetOutputDataType(); - virtual void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - AliHLTComponent* Spawn(); - - protected: - int32_t DoInit(int argc, const char** argv); - int32_t DoDeinit(); - int32_t Reconfigure(const char* cdbEntry, const char* chainId); - int32_t DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks); - - private: - float fSolenoidBz; - GPUCA_NAMESPACE::gpu::GPUReconstruction* fRec; - GPUCA_NAMESPACE::gpu::GPUChainTracking* fChain; - GPUCA_NAMESPACE::gpu::TPCFastTransformManager* fFastTransformManager; - AliTPCcalibDB* fCalib; - AliTPCRecoParam* fRecParam; - AliRecoParam fOfflineRecoParam; - AliTPCTransform* fOrigTransform; - bool fIsMC; - int64_t fInitTimestamp; -}; - -#endif diff --git a/GPU/GPUTracking/Global/GPUChain.cxx b/GPU/GPUTracking/Global/GPUChain.cxx index 6f6bf33f3c001..6990d5e08b638 100644 --- a/GPU/GPUTracking/Global/GPUChain.cxx +++ b/GPU/GPUTracking/Global/GPUChain.cxx @@ -13,7 +13,7 @@ /// \author David Rohr #include "GPUChain.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; constexpr GPUChain::krnlRunRange GPUChain::krnlRunRangeNone; constexpr GPUChain::krnlEvent GPUChain::krnlEventNone; diff --git a/GPU/GPUTracking/Global/GPUChain.h b/GPU/GPUTracking/Global/GPUChain.h index 9c67a05eec443..06650f9d9c733 100644 --- a/GPU/GPUTracking/Global/GPUChain.h +++ b/GPU/GPUTracking/Global/GPUChain.h @@ -18,7 +18,7 @@ #include "GPUReconstructionCPU.h" #include "GPUReconstructionHelpers.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -308,6 +308,6 @@ int32_t GPUChain::runRecoStep(RecoStep step, S T::*func, Args... args) } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Global/GPUChainITS.cxx b/GPU/GPUTracking/Global/GPUChainITS.cxx index 89e56bf2d4c22..640b92a0eb0f4 100644 --- a/GPU/GPUTracking/Global/GPUChainITS.cxx +++ b/GPU/GPUTracking/Global/GPUChainITS.cxx @@ -18,7 +18,7 @@ #include "GPUReconstructionIncludesITS.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; namespace o2::its { diff --git a/GPU/GPUTracking/Global/GPUChainITS.h b/GPU/GPUTracking/Global/GPUChainITS.h index 7ef77da54285e..37cd5acc5264c 100644 --- a/GPU/GPUTracking/Global/GPUChainITS.h +++ b/GPU/GPUTracking/Global/GPUChainITS.h @@ -27,7 +27,7 @@ class TrackITSExt; class GPUFrameworkExternalAllocator; } // namespace o2::its -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUChainITS : public GPUChain { @@ -56,6 +56,6 @@ class GPUChainITS : public GPUChain uint32_t mMaxTracks; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/Global/GPUChainTracking.cxx b/GPU/GPUTracking/Global/GPUChainTracking.cxx index ff476716febe8..161dbcd8689d9 100644 --- a/GPU/GPUTracking/Global/GPUChainTracking.cxx +++ b/GPU/GPUTracking/Global/GPUChainTracking.cxx @@ -59,7 +59,7 @@ #include "utils/linux_helpers.h" #include "utils/strtag.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "GPUO2DataTypes.h" @@ -204,12 +204,10 @@ bool GPUChainTracking::ValidateSteps() return false; } bool tpcClustersAvail = (GetRecoStepsInputs() & GPUDataTypes::InOutType::TPCClusters) || (GetRecoSteps() & GPUDataTypes::RecoStep::TPCClusterFinding) || (GetRecoSteps() & GPUDataTypes::RecoStep::TPCDecompression); -#ifndef GPUCA_ALIROOT_LIB if ((GetRecoSteps() & GPUDataTypes::RecoStep::TPCMerging) && !tpcClustersAvail) { GPUError("Invalid Inputs for track merging, TPC Clusters required"); return false; } -#endif #ifndef GPUCA_TPC_GEOMETRY_O2 if (GetRecoSteps() & GPUDataTypes::RecoStep::TPCClusterFinding) { GPUError("Can not run TPC GPU Cluster Finding with Run 2 Data"); @@ -383,9 +381,7 @@ int32_t GPUChainTracking::Init() } } if (GetProcessingSettings().eventDisplay) { -#ifndef GPUCA_ALIROOT_LIB mEventDisplay.reset(GPUDisplayInterface::getDisplay(GetProcessingSettings().eventDisplay, this, GetQA())); -#endif if (mEventDisplay == nullptr) { throw std::runtime_error("Error loading event display"); } @@ -604,8 +600,6 @@ void GPUChainTracking::AllocateIOMemory() AllocateIOMemoryHelper(mIOPtrs.nTRDTriggerRecords, mIOPtrs.trdTrackletIdxFirst, mIOMem.trdTrackletIdxFirst); } -void GPUChainTracking::LoadClusterErrors() { param().LoadClusterErrors(); } - void GPUChainTracking::SetTPCFastTransform(std::unique_ptr&& tpcFastTransform, std::unique_ptr&& tpcTransformHelper) { mTPCFastTransformU = std::move(tpcFastTransform); diff --git a/GPU/GPUTracking/Global/GPUChainTracking.h b/GPU/GPUTracking/Global/GPUChainTracking.h index 9ca370d6cc308..6d6d82b518097 100644 --- a/GPU/GPUTracking/Global/GPUChainTracking.h +++ b/GPU/GPUTracking/Global/GPUChainTracking.h @@ -51,7 +51,7 @@ class MatLayerCylSet; } } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -193,7 +193,6 @@ class GPUChainTracking : public GPUChain, GPUReconstructionHelpers::helperDelega void SetCalibObjects(const GPUCalibObjectsConst& obj) { processors()->calibObjects = obj; } void SetCalibObjects(const GPUCalibObjects& obj) { memcpy((void*)&processors()->calibObjects, (const void*)&obj, sizeof(obj)); } void SetUpdateCalibObjects(const GPUCalibObjectsConst& obj, const GPUNewCalibValues& vals); - void LoadClusterErrors(); void SetSubOutputControl(int32_t i, GPUOutputControl* v) { mSubOutputControls[i] = v; } void SetFinalInputCallback(std::function v) { mWaitForFinalInputs = v; } @@ -327,6 +326,6 @@ class GPUChainTracking : public GPUChain, GPUReconstructionHelpers::helperDelega int32_t OutputStream() const { return mRec->NStreams() - 2; } }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx index 8eddab63df35c..f17c2f7de4720 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingClusterizer.cxx @@ -43,7 +43,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; using namespace o2::tpc::constants; using namespace o2::dataformats; @@ -716,7 +716,7 @@ int32_t GPUChainTracking::RunTPCClusterizer(bool synchronizeOutput) using ChargeMapType = decltype(*clustererShadow.mPchargeMap); using PeakMapType = decltype(*clustererShadow.mPpeakMap); - runKernel({GetGridAutoStep(lane, RecoStep::TPCClusterFinding)}, clustererShadow.mPchargeMap, TPCMapMemoryLayout::items(GetProcessingSettings().overrideClusterizerFragmentLen) * sizeof(ChargeMapType)); + runKernel({GetGridAutoStep(lane, RecoStep::TPCClusterFinding)}, clustererShadow.mPchargeMap, TPCMapMemoryLayout::items(GetProcessingSettings().overrideClusterizerFragmentLen) * sizeof(ChargeMapType)); // TODO: Not working in OpenCL2!!! runKernel({GetGridAutoStep(lane, RecoStep::TPCClusterFinding)}, clustererShadow.mPpeakMap, TPCMapMemoryLayout::items(GetProcessingSettings().overrideClusterizerFragmentLen) * sizeof(PeakMapType)); if (fragment.index == 0) { runKernel({GetGridAutoStep(lane, RecoStep::TPCClusterFinding)}, clustererShadow.mPpadIsNoisy, TPC_PADS_IN_SECTOR * sizeof(*clustererShadow.mPpadIsNoisy)); diff --git a/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx b/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx index 01e4d011d08b9..9878ad032cd3b 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingCompression.cxx @@ -24,7 +24,7 @@ #endif #include "utils/strtag.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; int32_t GPUChainTracking::RunTPCCompression() diff --git a/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx b/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx index 1b959cac94fd0..06ba08527bfdc 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingDebugAndProfiling.cxx @@ -29,7 +29,7 @@ #define PROFILE_MAX_SIZE (100 * 1024 * 1024) -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; static inline uint32_t RGB(uint8_t r, uint8_t g, uint8_t b) { return (uint32_t)r | ((uint32_t)g << 8) | ((uint32_t)b << 16); } diff --git a/GPU/GPUTracking/Global/GPUChainTrackingDefs.h b/GPU/GPUTracking/Global/GPUChainTrackingDefs.h index 52e8fda8666b6..31ef86bcd6f70 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingDefs.h +++ b/GPU/GPUTracking/Global/GPUChainTrackingDefs.h @@ -18,7 +18,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -29,6 +29,6 @@ struct GPUChainTrackingFinalContext { bool ready = false; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Global/GPUChainTrackingIO.cxx b/GPU/GPUTracking/Global/GPUChainTrackingIO.cxx index 16af17863bcb1..106f71cd745d7 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingIO.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingIO.cxx @@ -52,7 +52,7 @@ #include "utils/linux_helpers.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "GPUO2DataTypes.h" diff --git a/GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx b/GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx index aba8617ee244d..8dd5140db6952 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingMerger.cxx @@ -19,7 +19,7 @@ #include "utils/strtag.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUChainTracking::RunTPCTrackingMerger_MergeBorderTracks(int8_t withinSlice, int8_t mergeMode, GPUReconstruction::krnlDeviceType deviceType) { diff --git a/GPU/GPUTracking/Global/GPUChainTrackingRefit.cxx b/GPU/GPUTracking/Global/GPUChainTrackingRefit.cxx index 50ed3f115c02b..1d53177942b54 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingRefit.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingRefit.cxx @@ -16,7 +16,7 @@ #include "GPULogging.h" #include "GPUO2DataTypes.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; int32_t GPUChainTracking::RunRefit() { diff --git a/GPU/GPUTracking/Global/GPUChainTrackingSliceTracker.cxx b/GPU/GPUTracking/Global/GPUChainTrackingSliceTracker.cxx index 00b71aed7cb8b..b21745f64af0d 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingSliceTracker.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingSliceTracker.cxx @@ -22,7 +22,7 @@ #include "utils/strtag.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; int32_t GPUChainTracking::GlobalTracking(uint32_t iSlice, int32_t threadId, bool synchronizeOutput) { diff --git a/GPU/GPUTracking/Global/GPUChainTrackingTRD.cxx b/GPU/GPUTracking/Global/GPUChainTrackingTRD.cxx index 760f64833514e..d2e1ae295de05 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingTRD.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingTRD.cxx @@ -23,13 +23,12 @@ #include "GPUTRDTrackerKernels.h" #include "utils/strtag.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::trd; template int32_t GPUChainTracking::RunTRDTracking() { -#ifndef GPUCA_ALIROOT_LIB auto& Tracker = processors()->getTRDTracker(); if (!Tracker.IsInitialized()) { return 1; @@ -129,7 +128,6 @@ int32_t GPUChainTracking::RunTRDTracking() } mRec->PopNonPersistentMemory(RecoStep::TRDTracking, qStr2Tag("TRDTRACK")); -#endif // GPUCA_ALIROOT_LIB return 0; } diff --git a/GPU/GPUTracking/Global/GPUChainTrackingTransformation.cxx b/GPU/GPUTracking/Global/GPUChainTrackingTransformation.cxx index 5b7cf945a15c9..326bfbb4d2313 100644 --- a/GPU/GPUTracking/Global/GPUChainTrackingTransformation.cxx +++ b/GPU/GPUTracking/Global/GPUChainTrackingTransformation.cxx @@ -29,7 +29,7 @@ #endif #include "utils/strtag.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; bool GPUChainTracking::NeedTPCClustersOnGPU() diff --git a/GPU/GPUTracking/Global/GPUErrors.cxx b/GPU/GPUTracking/Global/GPUErrors.cxx index d9835c25abbfe..7f3ed1d8206d9 100644 --- a/GPU/GPUTracking/Global/GPUErrors.cxx +++ b/GPU/GPUTracking/Global/GPUErrors.cxx @@ -18,7 +18,7 @@ #include "GPUDefMacros.h" #include "GPULogging.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #define GPUCA_MAX_ERRORS 255u diff --git a/GPU/GPUTracking/Global/GPUErrors.h b/GPU/GPUTracking/Global/GPUErrors.h index 8da9b7de5b299..377736a5dacb9 100644 --- a/GPU/GPUTracking/Global/GPUErrors.h +++ b/GPU/GPUTracking/Global/GPUErrors.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -45,6 +45,6 @@ class GPUErrors }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Global/GPUTrackingInputProvider.cxx b/GPU/GPUTracking/Global/GPUTrackingInputProvider.cxx index bf6cd029a981b..445bb1a9c56fd 100644 --- a/GPU/GPUTracking/Global/GPUTrackingInputProvider.cxx +++ b/GPU/GPUTracking/Global/GPUTrackingInputProvider.cxx @@ -19,7 +19,7 @@ #include "GPUTPCClusterOccupancyMap.h" #include "GPUErrors.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; void GPUTrackingInputProvider::InitializeProcessor() {} diff --git a/GPU/GPUTracking/Global/GPUTrackingInputProvider.h b/GPU/GPUTracking/Global/GPUTrackingInputProvider.h index 4d9236de079fc..751c9f0229f3d 100644 --- a/GPU/GPUTracking/Global/GPUTrackingInputProvider.h +++ b/GPU/GPUTracking/Global/GPUTrackingInputProvider.h @@ -27,7 +27,7 @@ struct ClusterNativeAccess; } // namespace tpc } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -91,6 +91,6 @@ class GPUTrackingInputProvider : public GPUProcessor }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/ITS/GPUITSFitter.cxx b/GPU/GPUTracking/ITS/GPUITSFitter.cxx index f5a360145a9e9..a954d430f7ac3 100644 --- a/GPU/GPUTracking/ITS/GPUITSFitter.cxx +++ b/GPU/GPUTracking/ITS/GPUITSFitter.cxx @@ -19,7 +19,7 @@ #include "GPUITSTrack.h" #include "GPUReconstruction.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifndef GPUCA_GPUCODE void GPUITSFitter::InitializeProcessor() diff --git a/GPU/GPUTracking/ITS/GPUITSFitter.h b/GPU/GPUTracking/ITS/GPUITSFitter.h index 8a84a0df9da7f..9c0995a80749f 100644 --- a/GPU/GPUTracking/ITS/GPUITSFitter.h +++ b/GPU/GPUTracking/ITS/GPUITSFitter.h @@ -27,7 +27,7 @@ struct Cluster; class Cell; } // namespace o2::its -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUITSTrack; @@ -97,6 +97,6 @@ class GPUITSFitter : public GPUProcessor int16_t mMemoryResTracks = -1; int16_t mMemoryResMemory = -1; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/ITS/GPUITSFitterKernels.cxx b/GPU/GPUTracking/ITS/GPUITSFitterKernels.cxx index 5e6a70e1b8876..b81e816d6fc1d 100644 --- a/GPU/GPUTracking/ITS/GPUITSFitterKernels.cxx +++ b/GPU/GPUTracking/ITS/GPUITSFitterKernels.cxx @@ -26,7 +26,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2; using namespace o2::its; diff --git a/GPU/GPUTracking/ITS/GPUITSFitterKernels.h b/GPU/GPUTracking/ITS/GPUITSFitterKernels.h index 9b3d300fc2bec..5a2a30de28823 100644 --- a/GPU/GPUTracking/ITS/GPUITSFitterKernels.h +++ b/GPU/GPUTracking/ITS/GPUITSFitterKernels.h @@ -21,7 +21,7 @@ namespace o2::its struct TrackingFrameInfo; } // namespace o2::its -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCGMPropagator; class GPUITSFitter; @@ -37,6 +37,6 @@ class GPUITSFitterKernels : public GPUKernelTemplate protected: GPUd() static bool fitTrack(GPUITSFitter& Fitter, GPUTPCGMPropagator& prop, GPUITSTrack& track, int32_t start, int32_t end, int32_t step); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/ITS/GPUITSTrack.h b/GPU/GPUTracking/ITS/GPUITSTrack.h index 3ae48eeca97c5..5063985692a43 100644 --- a/GPU/GPUTracking/ITS/GPUITSTrack.h +++ b/GPU/GPUTracking/ITS/GPUITSTrack.h @@ -18,7 +18,7 @@ #include "GPUTPCGMMergerTypes.h" #include "GPUTPCGMTrackParam.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUITSTrack : public GPUTPCGMTrackParam { @@ -27,6 +27,6 @@ class GPUITSTrack : public GPUTPCGMTrackParam float mAlpha; int32_t mClusters[7]; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMBorderTrack.h b/GPU/GPUTracking/Merger/GPUTPCGMBorderTrack.h index 5c1d1d11861bd..70d9676c4fe26 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMBorderTrack.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMBorderTrack.h @@ -18,7 +18,7 @@ #include "GPUCommonDef.h" #include "GPUCommonMath.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -128,6 +128,6 @@ class GPUTPCGMBorderTrack ClassDefNV(GPUTPCGMBorderTrack, 1); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergedTrack.h b/GPU/GPUTracking/Merger/GPUTPCGMMergedTrack.h index c61dcd220e0c6..00d4b1822bdc1 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergedTrack.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergedTrack.h @@ -18,7 +18,7 @@ #include "GPUTPCGMTrackParam.h" #include "GPUTPCGMMergedTrackHit.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -126,6 +126,6 @@ class GPUTPCGMMergedTrack #endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx b/GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx index 6c90330efecc3..2278afd112384 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx @@ -62,20 +62,14 @@ #include "GPUO2FakeClasses.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; using namespace gputpcgmmergertypes; static constexpr int32_t kMaxParts = 400; static constexpr int32_t kMaxClusters = GPUCA_MERGER_MAX_TRACK_CLUSTERS; -//#define OFFLINE_FITTER - -#if !defined(GPUCA_ALIROOT_LIB) || defined(GPUCA_GPUCODE) -#undef OFFLINE_FITTER -#endif - -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct MergeLooperParam { float refz; @@ -83,7 +77,7 @@ struct MergeLooperParam { float y; uint32_t id; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #ifndef GPUCA_GPUCODE @@ -1808,12 +1802,6 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread const ClusterNative& c = GetConstantMem()->ioPtrs.clustersNative->clustersLinear[trackClusters[i].id]; state = c.getFlags(); } -#ifdef GPUCA_ALIROOT_LIB - cl[i].x = clXYZ[i].x; - cl[i].y = clXYZ[i].y; - cl[i].z = clXYZ[i].z; - cl[i].amp = clXYZ[i].amp; -#endif cl[i].state = state & GPUTPCGMMergedTrackHit::clustererAndSharedFlags; // Only allow edge, deconvoluted, and shared flags cl[i].row = trackClusters[i].row; if (!Param().rec.nonConsecutiveIDs) // We already have global consecutive numbers from the slice tracker, and we need to keep them for late cluster attachment diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMerger.h b/GPU/GPUTracking/Merger/GPUTPCGMMerger.h index 931b58d41e21b..a9b510e1714ba 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMerger.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMerger.h @@ -42,7 +42,7 @@ struct ClusterNative; } } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -298,6 +298,6 @@ class GPUTPCGMMerger : public GPUProcessor GPUTPCGMLoopData* mLoopData; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCGMMERGER_H diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx b/GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx index e1de4030d672c..b0a150bbd6a92 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergerDump.cxx @@ -40,7 +40,7 @@ #include "CorrectionMapsHelper.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace gputpcgmmergertypes; void GPUTPCGMMerger::DumpSliceTracks(std::ostream& out) const diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.cxx b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.cxx index 103fc0a4a08cc..c96fab2343d82 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.cxx @@ -12,14 +12,13 @@ /// \file GPUTPCGMMergerGPU.cxx /// \author David Rohr -#if !defined(GPUCA_GPUCODE) || !defined(GPUCA_ALIROOT_LIB) // GPU Merger was not available for Run 2 #include "GPUTPCGMMergerGPU.h" #include "GPUCommonAlgorithm.h" #if defined(WITH_OPENMP) && !defined(GPUCA_GPUCODE) #include "GPUReconstruction.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCGMMergerTrackFit::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() merger, int32_t mode) @@ -220,4 +219,3 @@ GPUdii() void GPUTPCGMMergerMergeLoopers::Thread<2>(int32_t nBlocks, int32_t nTh { merger.MergeLoopersMain(nBlocks, nThreads, iBlock, iThread); } -#endif // !defined(GPUCA_GPUCODE) || !defined(GPUCA_ALIROOT_LIB) diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h index 958d5081baf81..e1432830117c1 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergerGPU.h @@ -19,7 +19,7 @@ #include "GPUConstantMem.h" #include "GPUTPCGMMergerTypes.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -27,67 +27,53 @@ class GPUTPCGMMergerGeneral : public GPUKernelTemplate { public: GPUhdi() constexpr static GPUDataTypes::RecoStep GetRecoStep() { return GPUDataTypes::RecoStep::TPCMerging; } -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) typedef GPUTPCGMMerger processorType; GPUhdi() static processorType* Processor(GPUConstantMem& processors) { return &processors.tpcMerger; } -#endif }; class GPUTPCGMMergerTrackFit : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t mode); -#endif }; class GPUTPCGMMergerFollowLoopers : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerSliceRefit : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t iSlice); -#endif }; class GPUTPCGMMergerUnpackGlobal : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t iSlice); -#endif }; class GPUTPCGMMergerUnpackSaveNumber : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t id); -#endif }; class GPUTPCGMMergerUnpackResetIds : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t id); -#endif }; class GPUTPCGMMergerResolve : public GPUTPCGMMergerGeneral @@ -96,37 +82,29 @@ class GPUTPCGMMergerResolve : public GPUTPCGMMergerGeneral struct GPUSharedMemory : public gputpcgmmergertypes::GPUResolveSharedMemory { }; -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer, Args... args); -#endif }; class GPUTPCGMMergerClearLinks : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int8_t nOutput); -#endif }; class GPUTPCGMMergerMergeWithinPrepare : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerMergeSlicesPrepare : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, int32_t border0, int32_t border1, int8_t useOrigTrackParam); -#endif }; class GPUTPCGMMergerMergeBorders : public GPUTPCGMMergerGeneral @@ -137,94 +115,74 @@ class GPUTPCGMMergerMergeBorders : public GPUTPCGMMergerGeneral step1 = 1, step2 = 2, variant = 3 }; -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger, Args... args); -#endif }; class GPUTPCGMMergerMergeCE : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerLinkGlobalTracks : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerCollect : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerPrepareClusters : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerSortTracks : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerSortTracksQPt : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerSortTracksPrepare : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerFinalize : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; class GPUTPCGMMergerMergeLoopers : public GPUTPCGMMergerGeneral { public: -#if !defined(GPUCA_ALIROOT_LIB) || !defined(GPUCA_GPUCODE) template GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& merger); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h b/GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h index 3cd6870524060..3c8f21420a14f 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h @@ -18,7 +18,7 @@ #include "GPUTPCDef.h" #include "GPUGeneralKernels.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -61,6 +61,6 @@ struct GPUTPCOuterParam { } // namespace gputpcgmmergertypes } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.cxx b/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.cxx index b33392cd27db1..f237d1d18057e 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.cxx @@ -15,7 +15,7 @@ #include "GPUTPCGMPhysicalTrackModel.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUd() int32_t GPUTPCGMPhysicalTrackModel::PropagateToXBzLight(float x, float Bz, float& GPUrestrict() dLp) { diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.h b/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.h index c65e6df6c320f..d77cb861affa3 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMPhysicalTrackModel.h @@ -27,7 +27,7 @@ * */ -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -273,6 +273,6 @@ GPUdi() void GPUTPCGMPhysicalTrackModel::Rotate(float alpha) UpdateValues(); } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.cxx b/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.cxx index c444f3a399aae..7793fac7e03ac 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.cxx @@ -17,7 +17,7 @@ #include "GPUTPCGMPolynomialField.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; int32_t GPUTPCGMPolynomialFieldManager::GetPolynomialField(StoredField_t fieldType, float nominalFieldkG, GPUTPCGMPolynomialField& field) { @@ -206,605 +206,3 @@ int32_t GPUTPCGMPolynomialFieldManager::GetPolynomialField(float nominalFieldkG, return GetPolynomialField(type, nominalFieldkG, field); } - -/****************************************************************************************** - * - * the following code only works inside AliRoot framework with initialised magnetic field - * - *******************************************************************************************/ - -#if defined(GPUCA_ALIROOT_LIB) & !defined(GPUCA_GPUCODE) - -#include "AliHLTTPCPolynomFit.h" - -#include - -#include "AliTracker.h" -#include "AliHLTTPCGeometry.h" -#include "AliTRDgeometry.h" -#include "TGeoGlobalMagField.h" -#include "AliMagF.h" - -#include "TFile.h" -#include "TMath.h" -#include "TNtuple.h" -#include "Riostream.h" - -#include "TMatrixD.h" -#include "TH1F.h" -#include "TStyle.h" - -int32_t GPUTPCGMPolynomialFieldManager::GetPolynomialField(GPUTPCGMPolynomialField& field) -{ - // - // get pre-calculated polynomial field approximation of the TPC region appropriate for the current AliTracker field map (if exists) - // returns !=0 error when the polynomial field is not exist - // - - // check which field map is in use - - field.Reset(); - - AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - - if (!fld) { - return -1; - } - - AliMagF::BMap_t mapType = fld->GetMapType(); - - StoredField_t type = kUnknown; - - if (fld->IsUniform()) { - type = kUniform; - } else if (mapType == AliMagF::k2kG) { - type = k2kG; - } else if (mapType == AliMagF::k5kG) { - type = k5kG; - } - - return GetPolynomialField(type, AliTracker::GetBz(), field); -} - -int32_t GPUTPCGMPolynomialFieldManager::FitFieldTpc(AliMagF* inputFld, GPUTPCGMPolynomialField& polyField, double step) -{ - // - // Fit magnetic field with polynoms - // - - const double kAlmost0Field = 1.e-13; - - AliMagF* fld = inputFld; - - if (!fld) { - // fld = new AliMagF("Fit", "Fit", 1., 1., AliMagF::k2kG); - fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - } - if (!fld) { - return -1; - } - - const double sectorAngleShift = 10. / 180. * TMath::Pi(); - const double sectorAngle = 20. / 180. * TMath::Pi(); - const int32_t nRows = AliHLTTPCGeometry::GetNRows(); - - double xMin = AliHLTTPCGeometry::Row2X(0); - double xMax = AliHLTTPCGeometry::Row2X(nRows - 1); - double rMin = xMin; - double rMax = xMax / TMath::Cos(sectorAngle / 2.); - - double dA = 1. / rMax; // angular step == 1 cm at outer radius - dA *= step; - int32_t nSectorParticles = (int32_t)(sectorAngle / dA); - if (nSectorParticles < 1) { - nSectorParticles = 1; - } - dA = sectorAngle / nSectorParticles; - - double dZ = 1. * step; // step in z == 1 cm - - double zMin = -AliHLTTPCGeometry::GetZLength(); - double zMax = AliHLTTPCGeometry::GetZLength(); - - double alMin = -sectorAngle / 2.; - double alMax = sectorAngle / 2. - 0.5 * dA; - - Double_t solenoidBzkG = fld->SolenoidField(); - Double_t solenoidBzkGInv = (TMath::Abs(solenoidBzkG) > kAlmost0Field) ? 1. / solenoidBzkG : 0.; - - std::cout << "solenoidBz = " << solenoidBzkG << " kG" << std::endl; - - const int32_t M = GPUTPCGMPolynomialField::NTPCM; - AliHLTTPCPolynomFit fitBx(M); - AliHLTTPCPolynomFit fitBy(M); - AliHLTTPCPolynomFit fitBz(M); - - for (int32_t sector = 0; sector < 18; sector++) { - std::cout << "sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (int32_t row = 0; row < AliHLTTPCGeometry::GetNRows(); row++) { - double xl = AliHLTTPCGeometry::Row2X(row); - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - // std::cout<<"sector = "<IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - - float f[M]; - GPUTPCGMPolynomialField::GetPolynomsTpc(x, y, z, f); - fitBx.AddMeasurement(f, B[0]); - fitBy.AddMeasurement(f, B[1]); - fitBz.AddMeasurement(f, B[2]); - } - } - } - } - - // field coefficients - float cX[M]; - float cY[M]; - float cZ[M]; - - int32_t errX = fitBx.Fit(cX); - int32_t errY = fitBy.Fit(cY); - int32_t errZ = fitBz.Fit(cZ); - - if (errX != 0 || errY != 0 || errZ != 0) { - std::cout << "Fit of polynamial field failed!!!: errX " << errX << " errY " << errY << " errZ " << errZ << std::endl; - if (fld != inputFld) { - delete fld; - } - return -1; - } - - GPUTPCGMPolynomialField fittedField; - fittedField.SetFieldTpc(cX, cY, cZ); - - // scale result - double nominalBz = solenoidBzkG * gpu_common_constants::kCLight; - - for (int32_t i = 0; i < M; i++) { - cX[i] = nominalBz * cX[i]; - cY[i] = nominalBz * cY[i]; - cZ[i] = nominalBz * cZ[i]; - } - polyField.SetFieldNominal(nominalBz); - polyField.SetFieldTpc(cX, cY, cZ); - - gStyle->SetOptStat(1111111); - - TH1F histBx("Performance B_x", "Error B_x", 1000, -0.005, 0.005); - TH1F histBy("Performance B_y", "Error B_y", 1000, -0.005, 0.005); - TH1F histBz("Performance B_z", "Error B_z", 1000, -0.005, 0.005); - - for (int32_t sector = 0; sector < 18; sector++) { - std::cout << "check quality: sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "check quality: angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (int32_t row = 0; row < AliHLTTPCGeometry::GetNRows(); row++) { - double xl = AliHLTTPCGeometry::Row2X(row); - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - for (double z = zMin; z <= zMax; z += dZ) { - Double_t xyz[3] = {x, y, z}; - Double_t B[3]; - if (fld->IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - float approxB[3]; - fittedField.GetField(x, y, z, approxB); - - histBx.Fill(approxB[0] - B[0]); - histBy.Fill(approxB[1] - B[1]); - histBz.Fill(approxB[2] - B[2]); - } - } - } - } - - TFile file("FieldTpcFitQA.root", "RECREATE"); - file.cd(); - - histBx.Write(); - histBy.Write(); - histBz.Write(); - - file.Write(); - file.Close(); - - std::cout << "Fitted polynomial field: " << std::endl; - fittedField.Print(); - - return 0; -} - -int32_t GPUTPCGMPolynomialFieldManager::FitFieldTrd(AliMagF* inputFld, GPUTPCGMPolynomialField& polyField, double step) -{ - // - // Fit magnetic field with polynoms - // - - const double kAlmost0Field = 1.e-13; - - AliMagF* fld = inputFld; - - if (!fld) { - // fld = new AliMagF("Fit", "Fit", 1., 1., AliMagF::k2kG); - fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - } - if (!fld) { - return -1; - } - - const double sectorAngle = AliTRDgeometry::GetAlpha(); - const double sectorAngleShift = sectorAngle / 2; - - double zMax = 751.0 / 2.; - double zMin = -zMax; - double xMin = AliHLTTPCGeometry::Row2X(AliHLTTPCGeometry::GetNRows() - 1); - double xMax = AliTRDgeometry::GetXtrdEnd(); - double rMin = xMin; - double rMax = xMax / TMath::Cos(sectorAngle / 2.); - - double dA = 1. / rMax; // angular step == 1 cm at outer radius - dA *= step; - int32_t nSectorParticles = (int32_t)(sectorAngle / dA); - if (nSectorParticles < 1) { - nSectorParticles = 1; - } - dA = sectorAngle / nSectorParticles; - - double dZ = 1. * step; // step in z == 1 cm - - double alMin = -sectorAngle / 2.; - double alMax = sectorAngle / 2. - 0.5 * dA; - - Double_t solenoidBzkG = fld->SolenoidField(); - Double_t solenoidBzkGInv = (TMath::Abs(solenoidBzkG) > kAlmost0Field) ? 1. / solenoidBzkG : 0.; - - std::cout << "solenoidBz = " << solenoidBzkG << " kG" << std::endl; - - const int32_t M = GPUTPCGMPolynomialField::NTRDM; - AliHLTTPCPolynomFit fitBx(M); - AliHLTTPCPolynomFit fitBy(M); - AliHLTTPCPolynomFit fitBz(M); - - for (int32_t sector = 0; sector < AliTRDgeometry::Nsector(); sector++) { - std::cout << "sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (double xl = xMin; xl <= xMax; xl += step) { - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - // std::cout<<"sector = "<IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - - float f[M]; - GPUTPCGMPolynomialField::GetPolynomsTrd(x, y, z, f); - fitBx.AddMeasurement(f, B[0]); - fitBy.AddMeasurement(f, B[1]); - fitBz.AddMeasurement(f, B[2]); - } - } - } - } - - // field coefficients - float cX[M]; - float cY[M]; - float cZ[M]; - - int32_t errX = fitBx.Fit(cX); - int32_t errY = fitBy.Fit(cY); - int32_t errZ = fitBz.Fit(cZ); - - if (errX != 0 || errY != 0 || errZ != 0) { - std::cout << "Fit of polynamial field failed!!!" << std::endl; - if (fld != inputFld) { - delete fld; - } - return -1; - } - - GPUTPCGMPolynomialField fittedField; - fittedField.SetFieldTrd(cX, cY, cZ); - - // scale result - double nominalBz = solenoidBzkG * gpu_common_constants::kCLight; - - for (int32_t i = 0; i < M; i++) { - cX[i] = nominalBz * cX[i]; - cY[i] = nominalBz * cY[i]; - cZ[i] = nominalBz * cZ[i]; - } - polyField.SetFieldNominal(nominalBz); - polyField.SetFieldTrd(cX, cY, cZ); - - gStyle->SetOptStat(1111111); - - TH1F histBx("Performance B_x", "Error B_x", 1000, -0.005, 0.005); - TH1F histBy("Performance B_y", "Error B_y", 1000, -0.005, 0.005); - TH1F histBz("Performance B_z", "Error B_z", 1000, -0.005, 0.005); - - for (int32_t sector = 0; sector < AliTRDgeometry::Nsector(); sector++) { - std::cout << "check quality: sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "check quality: angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (double xl = xMin; xl <= xMax; xl += step) { - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - for (double z = zMin; z <= zMax; z += dZ) { - Double_t xyz[3] = {x, y, z}; - Double_t B[3]; - if (fld->IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - float approxB[3]; - fittedField.GetFieldTrd(x, y, z, approxB); - - histBx.Fill(approxB[0] - B[0]); - histBy.Fill(approxB[1] - B[1]); - histBz.Fill(approxB[2] - B[2]); - } - } - } - } - - TFile file("FieldTrdFitQA.root", "RECREATE"); - file.cd(); - - histBx.Write(); - histBy.Write(); - histBz.Write(); - - file.Write(); - file.Close(); - - std::cout << "Fitted polynomial field: " << std::endl; - fittedField.Print(); - - return 0; -} - -int32_t GPUTPCGMPolynomialFieldManager::FitFieldIts(AliMagF* inputFld, GPUTPCGMPolynomialField& polyField, double step) -{ - // - // Fit magnetic field with polynoms - // - - const double kAlmost0Field = 1.e-13; - - AliMagF* fld = inputFld; - - if (!fld) { - // fld = new AliMagF("Fit", "Fit", 1., 1., AliMagF::k2kG); - fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - } - if (!fld) { - return -1; - } - - const double sectorAngleShift = 10. / 180. * TMath::Pi(); - const double sectorAngle = 20. / 180. * TMath::Pi(); - - const double xITS = 3.9; - const double zITS = 24.5; - - double xMin = 0.5; - double xMax = AliHLTTPCGeometry::Row2X(0); - double rMin = xMin; - double rMax = xMax / TMath::Cos(sectorAngle / 2.); - - double dA = .1 / rMax; // angular step == 0.1 cm at the outer radius - dA *= step; - int32_t nSectorParticles = (int32_t)(sectorAngle / dA); - if (nSectorParticles < 1) { - nSectorParticles = 1; - } - dA = sectorAngle / nSectorParticles; - - double dX = .5 * step; // step in local x == 0.1 cm - double dZ = 1. * step; // step in z == 1 cm - - double zMin = -AliHLTTPCGeometry::GetZLength(); - double zMax = AliHLTTPCGeometry::GetZLength(); - - double alMin = -sectorAngle / 2.; - double alMax = sectorAngle / 2. - 0.5 * dA; - - Double_t solenoidBzkG = fld->SolenoidField(); - Double_t solenoidBzkGInv = (TMath::Abs(solenoidBzkG) > kAlmost0Field) ? 1. / solenoidBzkG : 0.; - - std::cout << "solenoidBz = " << solenoidBzkG << " kG" << std::endl; - - const int32_t M = GPUTPCGMPolynomialField::NITSM; - AliHLTTPCPolynomFit fitBx(M); - AliHLTTPCPolynomFit fitBy(M); - AliHLTTPCPolynomFit fitBz(M); - - double coneSlope = (zMax - zITS) / (xMax - xITS); - - for (int32_t sector = 0; sector < 18; sector++) { - std::cout << "sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (double xl = xMin; xl <= xMax; xl += dX) { - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - // std::cout<<"sector = "<IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - - float f[M]; - GPUTPCGMPolynomialField::GetPolynomsIts(x, y, z, f); - fitBx.AddMeasurement(f, B[0]); - fitBy.AddMeasurement(f, B[1]); - fitBz.AddMeasurement(f, B[2]); - } - } - } - } - - // field coefficients - float cX[M]; - float cY[M]; - float cZ[M]; - - int32_t errX = fitBx.Fit(cX); - int32_t errY = fitBy.Fit(cY); - int32_t errZ = fitBz.Fit(cZ); - - if (errX != 0 || errY != 0 || errZ != 0) { - std::cout << "Fit of polynamial field failed!!!: errX " << errX << " errY " << errY << " errZ " << errZ << std::endl; - if (fld != inputFld) { - delete fld; - } - return -1; - } - - GPUTPCGMPolynomialField fittedField; - fittedField.SetFieldIts(cX, cY, cZ); - - // scale result - double nominalBz = solenoidBzkG * gpu_common_constants::kCLight; - - for (int32_t i = 0; i < M; i++) { - cX[i] = nominalBz * cX[i]; - cY[i] = nominalBz * cY[i]; - cZ[i] = nominalBz * cZ[i]; - } - polyField.SetFieldNominal(nominalBz); - polyField.SetFieldIts(cX, cY, cZ); - - gStyle->SetOptStat(1111111); - - TH1F histBx("Performance B_x", "Error B_x", 1000, -0.005, 0.005); - TH1F histBy("Performance B_y", "Error B_y", 1000, -0.005, 0.005); - TH1F histBz("Performance B_z", "Error B_z", 1000, -0.005, 0.005); - - for (int32_t sector = 0; sector < 18; sector++) { - std::cout << "check quality: sector = " << sector << std::endl; - double asec = sectorAngleShift + sector * sectorAngle; - double cs = TMath::Cos(asec); - double ss = TMath::Sin(asec); - for (double al = alMin; al < alMax; al += dA) { - std::cout << "check quality: angle " << al / TMath::Pi() * 180. << " grad " << std::endl; - double tg = TMath::Tan(al); - for (double xl = xMin; xl <= xMax; xl += dX) { - double yl = xl * tg; - double x = xl * cs - yl * ss; - double y = xl * ss + yl * cs; - double zCone = zITS + (xl - xITS) * coneSlope; - for (double z = -zCone; z <= zCone; z += dZ) { - Double_t xyz[3] = {x, y, z}; - Double_t B[3]; - if (fld->IsUniform()) { - B[0] = B[1] = 0.; - B[2] = fld->SolenoidField(); - } else { - fld->Field(xyz, B); - } - B[0] *= solenoidBzkGInv; - B[1] *= solenoidBzkGInv; - B[2] *= solenoidBzkGInv; - float approxB[3]; - fittedField.GetFieldIts(x, y, z, approxB); - - histBx.Fill(approxB[0] - B[0]); - histBy.Fill(approxB[1] - B[1]); - histBz.Fill(approxB[2] - B[2]); - } - } - } - } - - TFile file("FieldItsFitQA.root", "RECREATE"); - file.cd(); - - histBx.Write(); - histBy.Write(); - histBz.Write(); - - file.Write(); - file.Close(); - - std::cout << "Fitted polynomial field: " << std::endl; - fittedField.Print(); - - return 0; -} - -#endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.h b/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.h index a58c3485321fd..15f2bd880e351 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMPolynomialFieldManager.h @@ -18,13 +18,13 @@ #include "GPUCommonDef.h" class AliMagF; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { class GPUTPCGMPolynomialField; } -} // namespace GPUCA_NAMESPACE +} // namespace o2 /** * @class GPUTPCGMPolynomialFieldManager @@ -43,31 +43,11 @@ class GPUTPCGMPolynomialFieldManager /* Get appropriate pre-calculated polynomial field for the given field value nominalFieldkG */ - static int32_t GetPolynomialField(float nominalFieldkG, GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field); - -#if defined(GPUCA_ALIROOT_LIB) & !defined(GPUCA_GPUCODE) - - /* Get pre-calculated polynomial field for the current ALICE field (if exists) - */ - static int32_t GetPolynomialField(GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field); - - /* Fit given field for TPC - */ - static int32_t FitFieldTpc(AliMagF* fld, GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field, double step = 1.); - - /* Fit given field for TRD - */ - static int32_t FitFieldTrd(AliMagF* fld, GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field, double step = 1.); - - /* Fit given field for ITS - */ - static int32_t FitFieldIts(AliMagF* fld, GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field, double step = 1.); - -#endif + static int32_t GetPolynomialField(float nominalFieldkG, o2::gpu::GPUTPCGMPolynomialField& field); /* Get pre-calculated polynomial field of type "type", scaled with respect to nominalFieldkG */ - static int32_t GetPolynomialField(StoredField_t type, float nominalFieldkG, GPUCA_NAMESPACE::gpu::GPUTPCGMPolynomialField& field); + static int32_t GetPolynomialField(StoredField_t type, float nominalFieldkG, o2::gpu::GPUTPCGMPolynomialField& field); }; #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx b/GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx index 32941e032019c..6355db9483b05 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx @@ -27,7 +27,7 @@ #include "AliMagF.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUd() void GPUTPCGMPropagator::GetBxByBzBase(float cosAlpha, float sinAlpha, float X, float Y, float Z, float B[3]) const { diff --git a/GPU/GPUTracking/Merger/GPUTPCGMPropagator.h b/GPU/GPUTracking/Merger/GPUTPCGMPropagator.h index 0a35875764ae5..eaff9be4f5e46 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMPropagator.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMPropagator.h @@ -29,7 +29,7 @@ class MatLayerCylSet; } // namespace base } // namespace o2 -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -276,6 +276,6 @@ GPUdi() float GPUTPCGMPropagator::getGlobalY(float X, float Y) const } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx b/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx index f7f753d8302d9..3c774b13ce5b1 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.cxx @@ -20,7 +20,7 @@ #include "GPUTPCConvertImpl.h" #include "GPUParam.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; GPUd() void GPUTPCGMSliceTrack::Set(const GPUTPCGMMerger* merger, const GPUTPCTrack* sliceTr, float alpha, int32_t slice) diff --git a/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h b/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h index 627fc5c73c21c..a2179b6c66b2a 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMSliceTrack.h @@ -20,7 +20,7 @@ #include "GPUCommonMath.h" #include "GPUO2DataTypes.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -143,6 +143,6 @@ class GPUTPCGMSliceTrack ClassDefNV(GPUTPCGMSliceTrack, 1); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx index 74cc12e9bbd9a..bb450f1f4112f 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx @@ -40,10 +40,6 @@ #include "GPUTPCGMMergerTypes.h" #include "GPUParam.inc" -#ifdef GPUCA_ALIROOT_LIB -#include "AliExternalTrackParam.h" -#endif - #ifdef GPUCA_CADEBUG_ENABLED #include "../utils/qconfig.h" #include "AliHLTTPCClusterMCData.h" @@ -54,7 +50,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger* GPUrestrict() merger, int32_t iTrk, GPUTPCGMMergedTrackHit* GPUrestrict() clusters, GPUTPCGMMergedTrackHitXYZ* GPUrestrict() clustersXYZ, int32_t& GPUrestrict() N, int32_t& GPUrestrict() NTolerated, float& GPUrestrict() Alpha, int32_t attempt, float maxSinPhi, gputpcgmmergertypes::GPUTPCOuterParam* GPUrestrict() outerParam) @@ -1080,59 +1076,6 @@ GPUd() bool GPUTPCGMTrackParam::CheckNumericalQuality(float overrideCovYY) const return ok; } -#if defined(GPUCA_ALIROOT_LIB) & !defined(GPUCA_GPUCODE) -bool GPUTPCGMTrackParam::GetExtParam(AliExternalTrackParam& T, double alpha) const -{ - //* Convert from GPUTPCGMTrackParam to AliExternalTrackParam parameterisation, - //* the angle alpha is the global angle of the local X axis - - bool ok = CheckNumericalQuality(); - - double par[5], cov[15]; - for (int32_t i = 0; i < 5; i++) { - par[i] = mP[i]; - } - for (int32_t i = 0; i < 15; i++) { - cov[i] = mC[i]; - } - - if (par[2] > GPUCA_MAX_SIN_PHI) { - par[2] = GPUCA_MAX_SIN_PHI; - } - if (par[2] < -GPUCA_MAX_SIN_PHI) { - par[2] = -GPUCA_MAX_SIN_PHI; - } - - if (CAMath::Abs(par[4]) < 1.e-5) { - par[4] = 1.e-5; // some other software will crash if q/Pt==0 - } - if (CAMath::Abs(par[4]) > 1. / 0.08) { - ok = 0; // some other software will crash if q/Pt is too big - } - T.Set((double)mX, alpha, par, cov); - return ok; -} - -void GPUTPCGMTrackParam::SetExtParam(const AliExternalTrackParam& T) -{ - //* Convert from AliExternalTrackParam parameterisation - - for (int32_t i = 0; i < 5; i++) { - mP[i] = T.GetParameter()[i]; - } - for (int32_t i = 0; i < 15; i++) { - mC[i] = T.GetCovariance()[i]; - } - mX = T.GetX(); - if (mP[2] > GPUCA_MAX_SIN_PHI) { - mP[2] = GPUCA_MAX_SIN_PHI; - } - if (mP[2] < -GPUCA_MAX_SIN_PHI) { - mP[2] = -GPUCA_MAX_SIN_PHI; - } -} -#endif - GPUd() void GPUTPCGMTrackParam::RefitTrack(GPUTPCGMMergedTrack& GPUrestrict() track, int32_t iTrk, GPUTPCGMMerger* GPUrestrict() merger, int32_t attempt) // TODO: Inline me, once __forceinline__ is fixed by HIP { if (!track.OK()) { diff --git a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h index 7ce6167b653d2..a2d7dcf2b3e3d 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h +++ b/GPU/GPUTracking/Merger/GPUTPCGMTrackParam.h @@ -27,7 +27,7 @@ class AliExternalTrackParam; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -207,11 +207,6 @@ class GPUTPCGMTrackParam GPUd() static void RefitTrack(GPUTPCGMMergedTrack& track, int32_t iTrk, GPUTPCGMMerger* merger, int32_t attempt); -#if defined(GPUCA_ALIROOT_LIB) & !defined(GPUCA_GPUCODE) - bool GetExtParam(AliExternalTrackParam& T, double alpha) const; - void SetExtParam(const AliExternalTrackParam& T); -#endif - GPUdi() void ConstrainSinPhi(float limit = GPUCA_MAX_SIN_PHI) { if (mP[2] > limit) { @@ -291,6 +286,6 @@ GPUdi() float GPUTPCGMTrackParam::GetMirroredY(float Bz) const return GetY() - 2.f * CAMath::Sqrt(cosPhi2) / qptBz; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/Merger/GPUTPCGMTracksToTPCSeeds.cxx b/GPU/GPUTracking/Merger/GPUTPCGMTracksToTPCSeeds.cxx index 1a00f2cc1abff..78015b347a8c6 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGMTracksToTPCSeeds.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGMTracksToTPCSeeds.cxx @@ -24,7 +24,7 @@ #include "TObjArray.h" #include "AliTPCclusterMI.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUTPCGMTracksToTPCSeeds::CreateSeedsFromHLTTracks(TObjArray* seeds, AliTPCtracker* tpctracker) { diff --git a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.cxx b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.cxx index 12253296b62fc..9f6467923f56a 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.cxx +++ b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.cxx @@ -21,7 +21,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCGlobalDebugSortKernels::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() merger, int8_t) diff --git a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h index e54fb8885091d..4daee67643cfd 100644 --- a/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h +++ b/GPU/GPUTracking/Merger/GPUTPCGlobalDebugSortKernels.h @@ -19,7 +19,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCGMMerger; @@ -40,6 +40,6 @@ class GPUTPCGlobalDebugSortKernels : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker, int8_t parameter); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUTPCGLOBALDEBUGSORTKERNELS_H diff --git a/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.cxx b/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.cxx deleted file mode 100644 index b905c72915670..0000000000000 --- a/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.cxx +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCGlobalMergerComponent.cxx -/// \author David Rohr, Sergey Gorbunov, Matthias Kretz - -#include "GPUTPCGlobalMergerComponent.h" -#include "GPUReconstruction.h" -#include "GPUChainTracking.h" -#include "GPUTPCSliceOutput.h" - -#include "GPUTPCDef.h" - -#include "GPUTPCGMMerger.h" -#include "GPUTPCGMMergedTrack.h" - -#include "AliHLTTPCDefinitions.h" -#include "GPUTPCDefinitions.h" -#include "AliHLTTPCGeometry.h" - -#include "AliExternalTrackParam.h" -#include "AliCDBEntry.h" -#include "AliCDBManager.h" -#include "TObjString.h" -#include "TObjArray.h" -#include "AliHLTExternalTrackParam.h" - -#include -#include -#include - -using namespace GPUCA_NAMESPACE::gpu; -using namespace std; - -// ROOT macro for the implementation of ROOT specific class methods -ClassImp(GPUTPCGlobalMergerComponent); - -const GPUChainTracking* GPUTPCGlobalMergerComponent::fgCurrentMergerReconstruction = nullptr; - -GPUTPCGlobalMergerComponent::GPUTPCGlobalMergerComponent() : AliHLTProcessor(), fSolenoidBz(0), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0), fNWays(1), fNWaysOuter(0), fNoClear(false), fBenchmark("GlobalMerger"), fRec(nullptr), fChain(nullptr) -{ - // see header file for class documentation -} - -GPUTPCGlobalMergerComponent::GPUTPCGlobalMergerComponent(const GPUTPCGlobalMergerComponent&) : AliHLTProcessor(), fSolenoidBz(0), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0), fNWays(1), fNWaysOuter(0), fNoClear(false), fBenchmark("GlobalMerger"), fRec(nullptr), fChain(nullptr) -{ - // dummy -} - -GPUTPCGlobalMergerComponent& GPUTPCGlobalMergerComponent::operator=(const GPUTPCGlobalMergerComponent&) -{ - // dummy - return *this; -} - -GPUTPCGlobalMergerComponent::~GPUTPCGlobalMergerComponent() -{ - if (fRec) { - delete fRec; - } -}; - -// Public functions to implement AliHLTComponent's interface. -// These functions are required for the registration process - -const char* GPUTPCGlobalMergerComponent::GetComponentID() -{ - // see header file for class documentation - return "TPCCAGlobalMerger"; -} - -void GPUTPCGlobalMergerComponent::GetInputDataTypes(AliHLTComponentDataTypeList& list) -{ - // see header file for class documentation - list.clear(); - list.push_back(GPUTPCDefinitions::fgkTrackletsDataType); -} - -AliHLTComponentDataType GPUTPCGlobalMergerComponent::GetOutputDataType() -{ - // see header file for class documentation - return kAliHLTMultipleDataType; -} - -int32_t GPUTPCGlobalMergerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) -{ - // see header file for class documentation - - tgtList.clear(); - tgtList.push_back(kAliHLTDataTypeTrack | kAliHLTDataOriginTPC); - tgtList.push_back(AliHLTTPCDefinitions::TracksOuterDataType() | kAliHLTDataOriginTPC); - return tgtList.size(); -} - -void GPUTPCGlobalMergerComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - // see header file for class documentation - // XXX TODO: Find more realistic values. - constBase = 0; - inputMultiplier = 1.0; -} - -AliHLTComponent* GPUTPCGlobalMergerComponent::Spawn() -{ - // see header file for class documentation - return new GPUTPCGlobalMergerComponent; -} - -void GPUTPCGlobalMergerComponent::SetDefaultConfiguration() -{ - // Set default configuration for the CA merger component - // Some parameters can be later overwritten from the OCDB - - fSolenoidBz = -5.00668; - fClusterErrorCorrectionY = 0; - fClusterErrorCorrectionZ = 0; - fNWays = 1; - fNWaysOuter = 0; - fNoClear = false; - fBenchmark.Reset(); - fBenchmark.SetTimer(0, "total"); - fBenchmark.SetTimer(1, "reco"); -} - -int32_t GPUTPCGlobalMergerComponent::ReadConfigurationString(const char* arguments) -{ - // Set configuration parameters for the CA merger component from the string - - int32_t iResult = 0; - if (!arguments) { - return iResult; - } - - TString allArgs = arguments; - TString argument; - int32_t bMissingParam = 0; - - TObjArray* pTokens = allArgs.Tokenize(" "); - - int32_t nArgs = pTokens ? pTokens->GetEntries() : 0; - - for (int32_t i = 0; i < nArgs; i++) { - argument = ((TObjString*)pTokens->At(i))->GetString(); - if (argument.IsNull()) { - continue; - } - - if (argument.CompareTo("-solenoidBz") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); - continue; - } - - if (argument.CompareTo("-errorCorrectionY") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fClusterErrorCorrectionY = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Cluster Y error correction factor set to: %f", fClusterErrorCorrectionY); - continue; - } - - if (argument.CompareTo("-errorCorrectionZ") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fClusterErrorCorrectionZ = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Cluster Z error correction factor set to: %f", fClusterErrorCorrectionZ); - continue; - } - - if (argument.CompareTo("-nways") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fNWays = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - HLTInfo("nways set to: %d", fNWays); - continue; - } - - if (argument.CompareTo("-nwaysouter") == 0) { - fNWaysOuter = 1; - HLTInfo("nwaysouter enabled"); - continue; - } - - if (argument.CompareTo("-noclear") == 0) { - fNoClear = true; - HLTInfo("noclear enabled"); - continue; - } - - HLTError("Unknown option \"%s\"", argument.Data()); - iResult = -EINVAL; - } - delete pTokens; - - if (bMissingParam) { - HLTError("Specifier missed for parameter \"%s\"", argument.Data()); - iResult = -EINVAL; - } - - return iResult; -} - -int32_t GPUTPCGlobalMergerComponent::ReadCDBEntry(const char* cdbEntry, const char* chainId) -{ - // see header file for class documentation - - const char* defaultNotify = ""; - - if (!cdbEntry) { - cdbEntry = "HLT/ConfigTPC/TPCCAGlobalMerger"; - defaultNotify = " (default)"; - chainId = 0; - } - - HLTInfo("configure from entry \"%s\"%s, chain id %s", cdbEntry, defaultNotify, (chainId != nullptr && chainId[0] != 0) ? chainId : ""); - AliCDBEntry* pEntry = AliCDBManager::Instance()->Get(cdbEntry); //,GetRunNo()); - - if (!pEntry) { - HLTError("cannot fetch object \"%s\" from CDB", cdbEntry); - return -EINVAL; - } - - TObjString* pString = dynamic_cast(pEntry->GetObject()); - - if (!pString) { - HLTError("configuration object \"%s\" has wrong type, required TObjString", cdbEntry); - return -EINVAL; - } - - HLTInfo("received configuration object string: \"%s\"", pString->GetString().Data()); - - return ReadConfigurationString(pString->GetString().Data()); -} - -int32_t GPUTPCGlobalMergerComponent::Configure(const char* cdbEntry, const char* chainId, const char* commandLine) -{ - // Configure the component - // There are few levels of configuration, - // parameters which are set on one step can be overwritten on the next step - - //* read hard-coded values - - SetDefaultConfiguration(); - - //* read the default CDB entry - - int32_t iResult = ReadCDBEntry(nullptr, chainId); - if (iResult) { - return iResult; - } - - //* read magnetic field - - fSolenoidBz = GetBz(); - - //* read the actual CDB entry if required - - iResult = (cdbEntry) ? ReadCDBEntry(cdbEntry, chainId) : 0; - if (iResult) { - return iResult; - } - - //* read extra parameters from input (if they are) - - if (commandLine && commandLine[0] != '\0') { - HLTInfo("received configuration string from HLT framework: \"%s\"", commandLine); - iResult = ReadConfigurationString(commandLine); - if (iResult) { - return iResult; - } - } - - fRec = GPUReconstruction::CreateInstance("CPU", true); - if (fRec == nullptr) { - return -EINVAL; - } - fChain = fRec->AddChain(); - - // Initialize the merger - - GPUSettingsGRP grp; - GPUSettingsRec rec; - GPUSettingsProcessing devProc; - grp.solenoidBzNominalGPU = fSolenoidBz; - if (fClusterErrorCorrectionY > 1.e-4) { - rec.tpc.clusterError2CorrectionY = fClusterErrorCorrectionY * fClusterErrorCorrectionY; - } - if (fClusterErrorCorrectionZ > 1.e-4) { - rec.tpc.clusterError2CorrectionZ = fClusterErrorCorrectionZ * fClusterErrorCorrectionZ; - } - rec.tpc.nWays = fNWays; - rec.tpc.nWaysOuter = fNWaysOuter; - rec.tpc.mergerInterpolateErrors = false; - rec.nonConsecutiveIDs = true; - rec.tpc.mergerReadFromTrackerDirectly = false; - devProc.ompThreads = 1; - devProc.ompKernels = false; - - GPURecoStepConfiguration steps; - steps.steps.set(GPUDataTypes::RecoStep::TPCMerging); - steps.inputs.set(GPUDataTypes::InOutType::TPCSectorTracks); - steps.outputs.set(GPUDataTypes::InOutType::TPCMergedTracks); - - fRec->SetSettings(&grp, &rec, &devProc, &steps); - fChain->LoadClusterErrors(); - if (fRec->Init()) { - return -EINVAL; - } - - return 0; -} - -int32_t GPUTPCGlobalMergerComponent::DoInit(int argc, const char** argv) -{ - // see header file for class documentation - - TString arguments = ""; - for (int32_t i = 0; i < argc; i++) { - if (!arguments.IsNull()) { - arguments += " "; - } - arguments += argv[i]; - } - - int32_t retVal = Configure(nullptr, nullptr, arguments.Data()); - - return retVal; -} - -int32_t GPUTPCGlobalMergerComponent::Reconfigure(const char* cdbEntry, const char* chainId) -{ - // Reconfigure the component from OCDB - - return Configure(cdbEntry, chainId, nullptr); -} - -int32_t GPUTPCGlobalMergerComponent::DoDeinit() -{ - // see header file for class documentation - if (fChain == fgCurrentMergerReconstruction) { - fgCurrentMergerReconstruction = nullptr; - } - delete fRec; - fRec = nullptr; - - return 0; -} - -int32_t GPUTPCGlobalMergerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, AliHLTComponentBlockDataList& outputBlocks) -{ - // see header file for class documentation - int32_t iResult = 0; - uint32_t maxBufferSize = size; - - size = 0; - - if (!outputPtr) { - return -ENOSPC; - } - if (!IsDataEvent()) { - return 0; - } - fBenchmark.StartNewEvent(); - fBenchmark.Start(0); - - fChain->GetTPCMerger().Clear(); - - int32_t nSlicesSet = 0; - const AliHLTComponentBlockData* const blocksEnd = blocks + evtData.fBlockCnt; - for (const AliHLTComponentBlockData* block = blocks; block < blocksEnd; ++block) { - if (block->fDataType != GPUTPCDefinitions::fgkTrackletsDataType) { - continue; - } - - fBenchmark.AddInput(block->fSize); - - int32_t slice = AliHLTTPCDefinitions::GetMinSliceNr(*block); - if (slice < 0 || slice >= AliHLTTPCGeometry::GetNSlice()) { - HLTError("invalid slice number %d extracted from specification 0x%08lx, skipping block of type %s", slice, block->fSpecification, DataType2Text(block->fDataType).c_str()); - // just remember the error, if there are other valid blocks ignore the error, return code otherwise - iResult = -EBADF; - continue; - } - - if (slice != AliHLTTPCDefinitions::GetMaxSliceNr(*block)) { - // the code was not written for/ never used with multiple slices in one data block/ specification - HLTWarning("specification 0x%08lx indicates multiple slices in data block %s: never used before, please audit the code", block->fSpecification, DataType2Text(block->fDataType).c_str()); - } - GPUTPCSliceOutput* sliceOut = reinterpret_cast(block->fPtr); - fChain->GetTPCMerger().SetSliceData(slice, sliceOut); - nSlicesSet++; - } - if (nSlicesSet != 36) { - if (nSlicesSet != 0) { - HLTError("Incomplete input data"); - return (-EINVAL); - } - return 0; - } - fBenchmark.Start(1); - fChain->RunTPCTrackingMerger(); - if (fChain->CheckErrorCodes()) { - return (-EINVAL); - } - fBenchmark.Stop(1); - - // Fill output - uint32_t mySize = 0; - { - AliHLTTracksData* outPtr = (AliHLTTracksData*)(outputPtr); - AliHLTExternalTrackParam* currOutTrack = outPtr->fTracklets; - mySize = ((AliHLTUInt8_t*)currOutTrack) - ((AliHLTUInt8_t*)outputPtr); - outPtr->fCount = 0; - int32_t nTracks = fChain->GetTPCMerger().NOutputTracks(); - - for (int32_t itr = 0; itr < nTracks; itr++) { - // convert GPUTPCGMMergedTrack to AliHLTTrack - - const GPUTPCGMMergedTrack& track = fChain->GetTPCMerger().OutputTracks()[itr]; - if (!track.OK()) { - continue; - } - uint32_t dSize = sizeof(AliHLTExternalTrackParam) + track.NClusters() * sizeof(uint32_t); - - if (mySize + dSize > maxBufferSize) { - HLTWarning("Output buffer size exceed (buffer size %d, current size %d), %d tracks are not stored", maxBufferSize, mySize, nTracks - itr + 1); - iResult = -ENOSPC; - break; - } - - // first convert to AliExternalTrackParam - - AliExternalTrackParam tp; - track.GetParam().GetExtParam(tp, track.GetAlpha()); - - // normalize the angle to +-Pi - - currOutTrack->fAlpha = tp.GetAlpha() - CAMath::Round(tp.GetAlpha() / CAMath::TwoPi()) * CAMath::TwoPi(); - currOutTrack->fX = tp.GetX(); - currOutTrack->fY = tp.GetY(); - currOutTrack->fZ = tp.GetZ(); - currOutTrack->fLastX = track.LastX(); - currOutTrack->fLastY = track.LastY(); - currOutTrack->fLastZ = track.LastZ(); - - currOutTrack->fq1Pt = tp.GetSigned1Pt(); - currOutTrack->fSinPhi = tp.GetSnp(); - currOutTrack->fTgl = tp.GetTgl(); - for (int32_t i = 0; i < 15; i++) { - currOutTrack->fC[i] = tp.GetCovariance()[i]; - } - currOutTrack->fTrackID = itr; - currOutTrack->fFlags = 0; - currOutTrack->fNPoints = 0; - for (int32_t i = 0; i < track.NClusters(); i++) { - if (fChain->GetTPCMerger().Clusters()[track.FirstClusterRef() + i].state & GPUTPCGMMergedTrackHit::flagReject) { - continue; - } - currOutTrack->fPointIDs[currOutTrack->fNPoints++] = fChain->GetTPCMerger().Clusters()[track.FirstClusterRef() + i].num; - } - dSize = sizeof(AliHLTExternalTrackParam) + currOutTrack->fNPoints * sizeof(uint32_t); - - currOutTrack = (AliHLTExternalTrackParam*)(((Byte_t*)currOutTrack) + dSize); - mySize += dSize; - outPtr->fCount++; - } - - AliHLTComponentBlockData resultData; - FillBlockData(resultData); - resultData.fOffset = 0; - resultData.fSize = mySize; - resultData.fDataType = kAliHLTDataTypeTrack | kAliHLTDataOriginTPC; - resultData.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification(0, 35, 0, 5); - outputBlocks.push_back(resultData); - fBenchmark.AddOutput(resultData.fSize); - - size = resultData.fSize; - } - - if (fNWays > 1 && fNWaysOuter) { - uint32_t newSize = 0; - AliHLTTracksData* outPtr = (AliHLTTracksData*)(outputPtr + size); - AliHLTExternalTrackParam* currOutTrack = outPtr->fTracklets; - newSize = ((AliHLTUInt8_t*)currOutTrack) - (outputPtr + size); - outPtr->fCount = 0; - int32_t nTracks = fChain->GetTPCMerger().NOutputTracks(); - - for (int32_t itr = 0; itr < nTracks; itr++) { - const GPUTPCGMMergedTrack& track = fChain->GetTPCMerger().OutputTracks()[itr]; - if (!track.OK()) { - continue; - } - uint32_t dSize = sizeof(AliHLTExternalTrackParam); - - if (mySize + newSize + dSize > maxBufferSize) { - HLTWarning("Output buffer size exceed (buffer size %d, current size %d), %d tracks are not stored", maxBufferSize, mySize + newSize + dSize, nTracks - itr + 1); - iResult = -ENOSPC; - break; - } - - // first convert to AliExternalTrackParam - - AliExternalTrackParam tp; - track.GetParam().GetExtParam(tp, track.GetAlpha()); - - // normalize the angle to +-Pi - - currOutTrack->fAlpha = track.OuterParam().alpha - CAMath::Round(tp.GetAlpha() / CAMath::TwoPi()) * CAMath::TwoPi(); - currOutTrack->fX = track.OuterParam().X; - currOutTrack->fY = track.OuterParam().P[0]; - currOutTrack->fZ = track.OuterParam().P[1]; - currOutTrack->fLastX = track.LastX(); - currOutTrack->fLastY = track.LastY(); - currOutTrack->fLastZ = track.LastZ(); - - currOutTrack->fq1Pt = track.OuterParam().P[4]; - currOutTrack->fSinPhi = track.OuterParam().P[2]; - currOutTrack->fTgl = track.OuterParam().P[3]; - for (int32_t i = 0; i < 15; i++) { - currOutTrack->fC[i] = track.OuterParam().C[i]; - } - currOutTrack->fTrackID = itr; - currOutTrack->fFlags = 0; - currOutTrack->fNPoints = 0; - - currOutTrack = (AliHLTExternalTrackParam*)(((Byte_t*)currOutTrack) + dSize); - newSize += dSize; - outPtr->fCount++; - } - - AliHLTComponentBlockData resultData; - FillBlockData(resultData); - resultData.fOffset = mySize; - resultData.fSize = newSize; - resultData.fDataType = AliHLTTPCDefinitions::TracksOuterDataType() | kAliHLTDataOriginTPC; - resultData.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification(0, 35, 0, 5); - outputBlocks.push_back(resultData); - fBenchmark.AddOutput(resultData.fSize); - - size = resultData.fSize; - } - - HLTInfo("CAGlobalMerger:: output %d tracks / %d hits", fChain->GetTPCMerger().NOutputTracks(), fChain->GetTPCMerger().NOutputTrackClusters()); - - if (fNoClear) { - fgCurrentMergerReconstruction = fChain; - } else { - fChain->GetTPCMerger().Clear(); - } - - fBenchmark.Stop(0); - HLTInfo(fBenchmark.GetStatistics()); - return iResult; -} - -const GPUTPCGMMerger* GPUTPCGlobalMergerComponent::GetCurrentMerger() -{ - if (fgCurrentMergerReconstruction == nullptr) { - return nullptr; - } - return &fgCurrentMergerReconstruction->GetTPCMerger(); -} diff --git a/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.h b/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.h deleted file mode 100644 index b34c5d3d799b6..0000000000000 --- a/GPU/GPUTracking/Merger/GPUTPCGlobalMergerComponent.h +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCGlobalMergerComponent.h -/// \author David Rohr, Sergey Gorbunov, Matthias Kretz - -#ifndef GPUTPCGLOBALMERGERCOMPONENT_H -#define GPUTPCGLOBALMERGERCOMPONENT_H - -/// @file GPUTPCGlobalMergerComponent.h -/// @author Matthias Kretz -/// @date -/// @brief HLT TPC CA global merger component. -/// - -#ifndef GPUCA_ALIROOT_LIB -#define GPUCA_ALIROOT_LIB -#endif - -#include "AliHLTProcessor.h" -#include "AliHLTComponentBenchmark.h" -#include "GPUParam.h" - -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -class GPUTPCGMMerger; -class GPUReconstruction; -class GPUChainTracking; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -/** - * @class GPUTPCGlobalMergerComponent - * The TPC global merger component - * - * Interface to the global merger of the CA tracker for HLT. - */ -class GPUTPCGlobalMergerComponent : public AliHLTProcessor -{ - public: - /** - * Constructs a GPUTPCGlobalMergerComponent. - */ - GPUTPCGlobalMergerComponent(); - - /** - * Destructs the GPUTPCGlobalMergerComponent - */ - virtual ~GPUTPCGlobalMergerComponent(); - - // Public functions to implement AliHLTComponent's interface. - // These functions are required for the registration process - - /** - * @copydoc AliHLTComponent::GetComponentID - */ - const char* GetComponentID(); - - /** - * @copydoc AliHLTComponent::GetInputDataTypes - */ - void GetInputDataTypes(AliHLTComponentDataTypeList& list); - int32_t GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList); - - /** - * @copydoc AliHLTComponent::GetOutputDataType - */ - AliHLTComponentDataType GetOutputDataType(); - - /** - * @copydoc AliHLTComponent::GetOutputDataSize - */ - virtual void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - - /** - * @copydoc AliHLTComponent::Spawn - */ - AliHLTComponent* Spawn(); - - static const GPUCA_NAMESPACE::gpu::GPUTPCGMMerger* GetCurrentMerger(); - - protected: - // Protected functions to implement AliHLTComponent's interface. - // These functions provide initialization as well as the actual processing - // capabilities of the component. - - /** - * @copydoc AliHLTComponent::DoInit - */ - int32_t DoInit(int argc, const char** argv); - - /** - * @copydoc AliHLTComponent::DoDeinit - */ - int32_t DoDeinit(); - - /** reconfigure **/ - int32_t Reconfigure(const char* cdbEntry, const char* chainId); - - /** - * @copydoc @ref AliHLTProcessor::DoEvent - */ - int32_t DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, AliHLTComponentBlockDataList& outputBlocks); - - using AliHLTProcessor::DoEvent; - - private: - static GPUTPCGlobalMergerComponent fgGPUTPCGlobalMergerComponent; - - // disable copy - GPUTPCGlobalMergerComponent(const GPUTPCGlobalMergerComponent&); - GPUTPCGlobalMergerComponent& operator=(const GPUTPCGlobalMergerComponent&); - - /** set configuration parameters **/ - void SetDefaultConfiguration(); - int32_t ReadConfigurationString(const char* arguments); - int32_t ReadCDBEntry(const char* cdbEntry, const char* chainId); - int32_t Configure(const char* cdbEntry, const char* chainId, const char* commandLine); - - /** the global merger object */ - - double fSolenoidBz; // magnetic field - double fClusterErrorCorrectionY; // correction for the cluster error during pre-fit - double fClusterErrorCorrectionZ; // correction for the cluster error during pre-fit - int32_t fNWays; // Setting for merger - int8_t fNWaysOuter; // Store outer param after n-way fit - bool fNoClear; // Do not clear memory after processing an event - static const GPUCA_NAMESPACE::gpu::GPUChainTracking* fgCurrentMergerReconstruction; // Pointer to current merger in case memory is not cleared after processing the event - AliHLTComponentBenchmark fBenchmark; // benchmark - GPUCA_NAMESPACE::gpu::GPUParam mParam; // ca params - GPUCA_NAMESPACE::gpu::GPUReconstruction* fRec; // GPUReconstruction - GPUCA_NAMESPACE::gpu::GPUChainTracking* fChain; - - ClassDef(GPUTPCGlobalMergerComponent, 0); -}; - -#endif // GPUTPCGLOBALMERGERCOMPONENT_H diff --git a/GPU/GPUTracking/Refit/GPUTrackingRefit.cxx b/GPU/GPUTracking/Refit/GPUTrackingRefit.cxx index 8cca91c0a0033..643ca7b7a99df 100644 --- a/GPU/GPUTracking/Refit/GPUTrackingRefit.cxx +++ b/GPU/GPUTracking/Refit/GPUTrackingRefit.cxx @@ -30,7 +30,7 @@ #include "GPUTrackParamConvert.h" #include "GPUCommonTypeTraits.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::track; using namespace o2::base; using namespace o2::tpc; diff --git a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx index f7e3bca47a0fc..f99544f239bb7 100644 --- a/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx +++ b/GPU/GPUTracking/Refit/GPUTrackingRefitKernel.cxx @@ -16,7 +16,7 @@ #include "GPUTrackingRefitKernel.h" #include "GPUTrackingRefit.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template GPUdii() void GPUTrackingRefitKernel::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCBaseTrackParam.h b/GPU/GPUTracking/SliceTracker/GPUTPCBaseTrackParam.h index c2fc7e58061da..0eabd82e59a02 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCBaseTrackParam.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCBaseTrackParam.h @@ -17,7 +17,7 @@ #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -81,6 +81,6 @@ struct GPUTPCBaseTrackParam { float mP[5]; // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCClusterData.h b/GPU/GPUTracking/SliceTracker/GPUTPCClusterData.h index cf35efbd8af6c..1961ffabd791c 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCClusterData.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCClusterData.h @@ -17,7 +17,7 @@ #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -38,6 +38,6 @@ struct GPUTPCClusterData { #endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // CLUSTERDATA_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.cxx index 18813d53932d8..bada60b9cec80 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.cxx @@ -15,7 +15,7 @@ #include "GPUTPCCreateOccupancyMap.h" #include "GPUTPCClusterOccupancyMap.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCCreateOccupancyMap::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors, GPUTPCClusterOccupancyMapBin* GPUrestrict() map) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h index 8b96ad8e74183..91f5816f69df2 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateOccupancyMap.h @@ -19,7 +19,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUTPCClusterOccupancyMapBin; @@ -34,6 +34,6 @@ class GPUTPCCreateOccupancyMap : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, Args... args); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.cxx index 5c3e473aab0c9..bd33927408a26 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.cxx @@ -16,7 +16,7 @@ #include "GPUTPCTracker.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCCreateSliceData::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h index 2789621a7de5c..9065b220bb44d 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCCreateSliceData.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -43,6 +43,6 @@ class GPUTPCCreateSliceData : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCCREATESLICEDATA_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCDef.h b/GPU/GPUTracking/SliceTracker/GPUTPCDef.h index a134954451e8c..4b4f130faed65 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCDef.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCDef.h @@ -21,7 +21,7 @@ #define CALINK_INVAL ((calink) -1) #define CALINK_DEAD_CHANNEL ((calink) -2) -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -34,7 +34,7 @@ typedef uint32_t cahit; #endif struct cahit2 { cahit x, y; }; } -} // GPUCA_NAMESPACE::GPU +} // o2::GPU #ifdef GPUCA_TPC_RAW_PROPAGATE_PAD_ROW_TIME // Needs full clusterdata #define GPUCA_FULL_CLUSTERDATA diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.cxx index c86249fbb6f77..cdc72047ef0a4 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.cxx @@ -20,7 +20,7 @@ #include "GPUCommonMath.h" #include "GPUParam.inc" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUd() int32_t GPUTPCGlobalTracking::PerformGlobalTrackingRun(GPUTPCTracker& tracker, GPUsharedref() GPUSharedMemory& smem, const GPUTPCTracker& GPUrestrict() sliceSource, int32_t iTrack, int32_t rowIndex, float angle, int32_t direction) { diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h index 5dc469e2654f5..c3f765f42cec5 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCGlobalTracking.h @@ -18,7 +18,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -62,6 +62,6 @@ class GPUTPCGlobalTrackingCopyNumbers : public GPUKernelTemplate }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKLETCONSTRUCTOR_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCGrid.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCGrid.cxx index 56d2e88db1c28..367a447b25a89 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCGrid.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCGrid.cxx @@ -14,7 +14,7 @@ #include "GPUTPCGrid.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #if !defined(assert) && !defined(GPUCA_GPUCODE) #include diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCGrid.h b/GPU/GPUTracking/SliceTracker/GPUTPCGrid.h index a3cd7916f0e6d..1fbb1c5a23c45 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCGrid.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCGrid.h @@ -17,7 +17,7 @@ #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -67,6 +67,6 @@ class GPUTPCGrid float mStepZInv; //* inverse bin size in Z }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCGRID_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCHit.h b/GPU/GPUTracking/SliceTracker/GPUTPCHit.h index 0fe86f8ef21a3..34a59b2f08dd2 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCHit.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCHit.h @@ -17,7 +17,7 @@ #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -44,6 +44,6 @@ class GPUTPCHit friend class GPUTPCNeighboursFinder; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCHIT_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCHitId.h b/GPU/GPUTracking/SliceTracker/GPUTPCHitId.h index 9fb27d7a1a892..19cfde1d76f4b 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCHitId.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCHitId.h @@ -15,7 +15,7 @@ #ifndef GPUTPCHITID_H #define GPUTPCHITID_H -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -30,6 +30,6 @@ class GPUTPCHitId int32_t mId; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCHITID_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCMCInfo.h b/GPU/GPUTracking/SliceTracker/GPUTPCMCInfo.h index 25b423b965f07..13f2753db6c93 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCMCInfo.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCMCInfo.h @@ -15,7 +15,7 @@ #ifndef GPUTPCMCINFO_H #define GPUTPCMCINFO_H -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -40,6 +40,6 @@ struct GPUTPCMCInfoCol { uint32_t num; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.cxx index 9293801f5f5f9..04b303949e9f4 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.cxx @@ -15,7 +15,7 @@ #include "GPUTPCNeighboursCleaner.h" #include "GPUTPCTracker.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCNeighboursCleaner::Thread<0>(int32_t /*nBlocks*/, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h index 311fef5204c3d..1682e18244732 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursCleaner.h @@ -19,7 +19,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -49,6 +49,6 @@ class GPUTPCNeighboursCleaner : public GPUKernelTemplate GPUd() static void Thread(int32_t /*nBlocks*/, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCNEIGHBOURSCLEANER_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.cxx index 69d05fc3176b4..36254243e81b8 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.cxx @@ -17,7 +17,7 @@ #include "GPUTPCTracker.h" //#include "GPUCommonMath.h" #include "GPUDefMacros.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCNeighboursFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h index 882428821ae84..2d71d948ad9e1 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCNeighboursFinder.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -60,6 +60,6 @@ class GPUTPCNeighboursFinder : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCNEIGHBOURSFINDER_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCRow.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCRow.cxx index 8ee5e2cbddd62..3d0102f2938e6 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCRow.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCRow.cxx @@ -13,7 +13,7 @@ /// \author Sergey Gorbunov, Ivan Kisel, David Rohr #include "GPUTPCRow.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #if !defined(GPUCA_GPUCODE) GPUTPCRow::GPUTPCRow() : mNHits(0), mX(0), mMaxY(0), mGrid(), mHy0(0), mHz0(0), mHstepY(0), mHstepZ(0), mHstepYi(0), mHstepZi(0), mHitNumberOffset(0), mFirstHitInBinOffset(0) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCRow.h b/GPU/GPUTracking/SliceTracker/GPUTPCRow.h index 7c8e96c8352a8..d401311683f28 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCRow.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCRow.h @@ -18,7 +18,7 @@ #include "GPUTPCDef.h" #include "GPUTPCGrid.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -79,6 +79,6 @@ class GPUTPCRow uint32_t mFirstHitInBinOffset; // offset in Tracker::mRowData to find the FirstHitInBin }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCROW_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.cxx index ba5da49ff6ff9..9f06b00f30c3f 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.cxx @@ -22,7 +22,7 @@ #include "GPUCommonAlgorithm.h" #include "GPUTPCSectorDebugSortKernels.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCSectorDebugSortKernels::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h index 04001603a2a28..5617f9745311e 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSectorDebugSortKernels.h @@ -19,7 +19,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCTracker; @@ -38,6 +38,6 @@ class GPUTPCSectorDebugSortKernels : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUTPCSECTORDEBUGSORTKERNELS_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx index 48c490a6f5559..e02cba2144920 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.cxx @@ -28,7 +28,7 @@ #include "GPUReconstruction.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifndef GPUCA_GPUCODE diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.h b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.h index c45c35c667f25..72e9f9d2c19d5 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceData.h @@ -21,7 +21,7 @@ #include "GPUParam.h" #include "GPUProcessor.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -192,6 +192,6 @@ GPUdi() void GPUTPCSliceData::SetHitWeight(const GPUTPCRow& row, uint32_t hitInd GPUdi() int32_t GPUTPCSliceData::HitWeight(const GPUTPCRow& row, uint32_t hitIndex) const { return mHitWeights[row.mHitNumberOffset + hitIndex]; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCSLICEDATA_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutCluster.h b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutCluster.h index 59d079d7e6328..1d958de1ff7a4 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutCluster.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutCluster.h @@ -17,7 +17,7 @@ #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -64,6 +64,6 @@ class GPUTPCSliceOutCluster #endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.cxx index b7f876dc87e2e..06b87c7a682d3 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.cxx @@ -17,7 +17,7 @@ #include "GPUCommonMath.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; uint32_t GPUTPCSliceOutput::EstimateSize(uint32_t nOfTracks, uint32_t nOfTrackClusters) { diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.h b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.h index 6d322601789b6..3b5712ccbb8f4 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCSliceOutput.h @@ -18,7 +18,7 @@ #include "GPUTPCDef.h" #include "GPUTPCTrack.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -78,5 +78,5 @@ class GPUTPCSliceOutput size_t mMemorySize; // Amount of memory really used }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.cxx index 2b097ab8f1835..7b60e0621e78f 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.cxx @@ -16,7 +16,7 @@ #include "GPUTPCTracker.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCStartHitsFinder::Thread<0>(int32_t /*nBlocks*/, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h index ed49fad8fc6dc..f818e6986dbc6 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsFinder.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -49,6 +49,6 @@ class GPUTPCStartHitsFinder : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCSTARTHITSFINDER_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.cxx index 84ad70b58b964..034fa8f053f42 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.cxx @@ -19,7 +19,7 @@ #include "GPUCommonMath.h" #include "GPUDefMacros.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCStartHitsSorter::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) { diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h index 4c937b0414e30..0877b6c15a511 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCStartHitsSorter.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -49,6 +49,6 @@ class GPUTPCStartHitsSorter : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCSTARTHITSSORTER_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrack.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrack.cxx index 573c1f6f9c8ba..72cabd7c35ad2 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrack.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrack.cxx @@ -13,4 +13,4 @@ /// \author Sergey Gorbunov, David Rohr #include "GPUTPCTrack.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrack.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrack.h index 9553435fc49ab..18418bc031d7e 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrack.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrack.h @@ -19,7 +19,7 @@ #include "GPUTPCDef.h" #include "GPUTPCSliceOutCluster.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -68,6 +68,6 @@ class GPUTPCTrack private: }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACK_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackLinearisation.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackLinearisation.h index 972c62ffe7e20..c9ab6158179bd 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackLinearisation.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackLinearisation.h @@ -17,7 +17,7 @@ #include "GPUTPCTrackParam.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -88,6 +88,6 @@ GPUdi() void GPUTPCTrackLinearisation::Set(float SinPhi1, float CosPhi1, float D SetQPt(QPt1); } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKLINEARISATION_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.cxx index 5c1c99c4d75b2..68ced574a18a9 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.cxx @@ -16,7 +16,7 @@ #include "GPUTPCTrackParam.h" #include "GPUTPCGeometry.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; // // Circle in XY: diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.h index 792cba4f519e1..72f9d5fbaa23d 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackParam.h @@ -19,7 +19,7 @@ #include "GPUTPCDef.h" #include "GPUCommonMath.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -182,6 +182,6 @@ GPUdi() void GPUTPCTrackParam::InitParam() SetZOffset(0); } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKPARAM_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTracker.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTracker.cxx index 4970ff90a934c..c038146cf8497 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTracker.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTracker.cxx @@ -34,7 +34,7 @@ #include "GPUMemorySizeScalers.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; #if !defined(GPUCA_GPUCODE) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTracker.h b/GPU/GPUTracking/SliceTracker/GPUTPCTracker.h index bd1ca018186e4..10259c80ac80c 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTracker.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTracker.h @@ -27,7 +27,7 @@ #include "GPUTPCTracklet.h" #include "GPUProcessor.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -281,6 +281,6 @@ class GPUTPCTracker : public GPUProcessor static int32_t StarthitSortComparison(const void* a, const void* b); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKER_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.cxx deleted file mode 100644 index 4539cf334bddd..0000000000000 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.cxx +++ /dev/null @@ -1,709 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCTrackerComponent.cxx -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#include "GPUTPCTrackerComponent.h" -#include "GPUReconstruction.h" -#include "GPUChainTracking.h" -#include "GPUParam.h" - -#include "AliHLTTPCRawCluster.h" -#include "AliHLTTPCClusterXYZ.h" -#include "AliHLTTPCClusterMCData.h" -#include "AliHLTTPCGeometry.h" -#include "AliHLTTPCDefinitions.h" -#include "GPUTPCDefinitions.h" -#include "AliExternalTrackParam.h" -#include "TMath.h" -#include "AliCDBEntry.h" -#include "AliCDBManager.h" -#include "TObjString.h" -#include "TObjArray.h" -#include "GPUTPCSliceOutput.h" -#include "GPUTPCClusterData.h" -#include "GPUTPCGMMergedTrackHit.h" -#if __GNUC__ >= 3 -using namespace std; -#endif - -using namespace GPUCA_NAMESPACE::gpu; - -const AliHLTComponentDataType GPUTPCDefinitions::fgkTrackletsDataType = AliHLTComponentDataTypeInitializer("CATRACKL", kAliHLTDataOriginTPC); - -/** ROOT macro for the implementation of ROOT specific class methods */ -ClassImp(GPUTPCTrackerComponent); - -GPUTPCTrackerComponent::GPUTPCTrackerComponent() - : fSolenoidBz(0), fMinNTrackClusters(-1), fMinTrackPt(GPUCA_MIN_TRACK_PTB5_DEFAULT), fClusterZCut(500.), mNeighboursSearchArea(0), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0), fBenchmark("CATracker"), fAllowGPU(0), fGPUHelperThreads(-1), fCPUTrackers(0), fGlobalTracking(0), fGPUDeviceNum(-1), fGPUType("CPU"), fGPUStuckProtection(0), fAsync(0), fSearchWindowDZDR(0.), fRec(0), fChain(0), fAsyncProcessor() -{ - // see header file for class documentation - // or - // refer to README to build package - // or - // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt -} - -GPUTPCTrackerComponent::GPUTPCTrackerComponent(const GPUTPCTrackerComponent&) - : AliHLTProcessor(), fSolenoidBz(0), fMinNTrackClusters(-1), fMinTrackPt(GPUCA_MIN_TRACK_PTB5_DEFAULT), fClusterZCut(500.), mNeighboursSearchArea(0), fClusterErrorCorrectionY(0), fClusterErrorCorrectionZ(0), fBenchmark("CATracker"), fAllowGPU(0), fGPUHelperThreads(-1), fCPUTrackers(0), fGlobalTracking(0), fGPUDeviceNum(-1), fGPUType("CPU"), fGPUStuckProtection(0), fAsync(0), fSearchWindowDZDR(0.), fRec(0), fChain(0), fAsyncProcessor() -{ - // see header file for class documentation - HLTFatal("copy constructor untested"); -} - -GPUTPCTrackerComponent& GPUTPCTrackerComponent::operator=(const GPUTPCTrackerComponent&) -{ - // see header file for class documentation - HLTFatal("assignment operator untested"); - return *this; -} - -GPUTPCTrackerComponent::~GPUTPCTrackerComponent() -{ - // see header file for class documentation - if (fRec) { - delete fRec; - } -} - -// -// Public functions to implement AliHLTComponent's interface. -// These functions are required for the registration process -// - -const char* GPUTPCTrackerComponent::GetComponentID() -{ - // see header file for class documentation - return "TPCCATracker"; -} - -void GPUTPCTrackerComponent::GetInputDataTypes(vector& list) -{ - // see header file for class documentation - list.clear(); - list.push_back(AliHLTTPCDefinitions::RawClustersDataType()); - list.push_back(AliHLTTPCDefinitions::ClustersXYZDataType()); - list.push_back(AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo()); -} - -AliHLTComponentDataType GPUTPCTrackerComponent::GetOutputDataType() -{ - // see header file for class documentation - return GPUTPCDefinitions::fgkTrackletsDataType; -} - -void GPUTPCTrackerComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - // define guess for the output data size - constBase = 10000; // minimum size - inputMultiplier = 0.6; // size relative to input -} - -AliHLTComponent* GPUTPCTrackerComponent::Spawn() -{ - // see header file for class documentation - return new GPUTPCTrackerComponent; -} - -void GPUTPCTrackerComponent::SetDefaultConfiguration() -{ - // Set default configuration for the CA tracker component - // Some parameters can be later overwritten from the OCDB - - fSolenoidBz = -5.00668; - fMinNTrackClusters = -1; - fMinTrackPt = GPUCA_MIN_TRACK_PTB5_DEFAULT; - fClusterZCut = 500.; - mNeighboursSearchArea = 0; - fClusterErrorCorrectionY = 0; - fClusterErrorCorrectionZ = 0; - fBenchmark.Reset(); - fBenchmark.SetTimer(0, "total"); - fBenchmark.SetTimer(1, "reco"); -} - -int32_t GPUTPCTrackerComponent::ReadConfigurationString(const char* arguments) -{ - // Set configuration parameters for the CA tracker component from the string - - int32_t iResult = 0; - if (!arguments) { - return iResult; - } - - TString allArgs = arguments; - TString argument; - int32_t bMissingParam = 0; - - TObjArray* pTokens = allArgs.Tokenize(" "); - - int32_t nArgs = pTokens ? pTokens->GetEntries() : 0; - - for (int32_t i = 0; i < nArgs; i++) { - argument = ((TObjString*)pTokens->At(i))->GetString(); - if (argument.IsNull()) { - continue; - } - - if (argument.CompareTo("-solenoidBz") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - HLTWarning("argument -solenoidBz is deprecated, magnetic field set up globally (%f)", GetBz()); - continue; - } - - if (argument.CompareTo("-minNClustersOnTrack") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fMinNTrackClusters = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - HLTInfo("minNClustersOnTrack set to: %d", fMinNTrackClusters); - continue; - } - - if (argument.CompareTo("-minTrackPt") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fMinTrackPt = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("minTrackPt set to: %f", fMinTrackPt); - continue; - } - - if (argument.CompareTo("-clusterZCut") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fClusterZCut = TMath::Abs(((TObjString*)pTokens->At(i))->GetString().Atof()); - HLTInfo("ClusterZCut set to: %f", fClusterZCut); - continue; - } - - if (argument.CompareTo("-neighboursSearchArea") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - mNeighboursSearchArea = TMath::Abs(((TObjString*)pTokens->At(i))->GetString().Atof()); - HLTInfo("NeighboursSearchArea set to: %f", mNeighboursSearchArea); - continue; - } - - if (argument.CompareTo("-errorCorrectionY") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fClusterErrorCorrectionY = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Cluster Y error correction factor set to: %f", fClusterErrorCorrectionY); - continue; - } - - if (argument.CompareTo("-errorCorrectionZ") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fClusterErrorCorrectionZ = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Cluster Z error correction factor set to: %f", fClusterErrorCorrectionZ); - continue; - } - - if (argument.CompareTo("-allowGPU") == 0) { - fAllowGPU = 1; - HLTInfo("Will try to run tracker on GPU"); - continue; - } - - if (argument.CompareTo("-GlobalTracking") == 0) { - fGlobalTracking = 1; - HLTInfo("Global Tracking Activated"); - continue; - } - - if (argument.CompareTo("-GPUHelperThreads") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fGPUHelperThreads = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - HLTInfo("Number of GPU Helper Threads set to: %d", fGPUHelperThreads); - continue; - } - - if (argument.CompareTo("-CPUTrackers") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fCPUTrackers = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - HLTInfo("Number of CPU Trackers set to: %d", fCPUTrackers); - continue; - } - - if (argument.CompareTo("-SearchWindowDZDR") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fSearchWindowDZDR = ((TObjString*)pTokens->At(i))->GetString().Atof(); - HLTInfo("Search Window DZDR set to: %f", fSearchWindowDZDR); - continue; - } - - if (argument.CompareTo("-GPUDeviceNum") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fGPUDeviceNum = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - HLTInfo("Using GPU Device Number %d", fGPUDeviceNum); - continue; - } - - if (argument.CompareTo("-GPUType") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fGPUType = ((TObjString*)pTokens->At(i))->GetString(); - continue; - } - - if (argument.CompareTo("-GPUStuckProtection") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fGPUStuckProtection = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - continue; - } - - if (argument.CompareTo("-AsyncGPUStuckProtection") == 0) { - if ((bMissingParam = (++i >= pTokens->GetEntries()))) { - break; - } - fAsync = ((TObjString*)pTokens->At(i))->GetString().Atoi(); - continue; - } - - HLTError("Unknown option \"%s\"", argument.Data()); - iResult = -EINVAL; - } - delete pTokens; - - if (bMissingParam) { - HLTError("Specifier missed for parameter \"%s\"", argument.Data()); - iResult = -EINVAL; - } - - return iResult; -} - -int32_t GPUTPCTrackerComponent::ReadCDBEntry(const char* cdbEntry, const char* chainId) -{ - // see header file for class documentation - - const char* defaultNotify = ""; - - if (!cdbEntry) { - cdbEntry = "HLT/ConfigTPC/TPCCATracker"; - defaultNotify = " (default)"; - chainId = 0; - } - - HLTInfo("configure from entry \"%s\"%s, chain id %s", cdbEntry, defaultNotify, (chainId != nullptr && chainId[0] != 0) ? chainId : ""); - AliCDBEntry* pEntry = AliCDBManager::Instance()->Get(cdbEntry); //,GetRunNo()); - - if (!pEntry) { - HLTError("cannot fetch object \"%s\" from CDB", cdbEntry); - return -EINVAL; - } - - TObjString* pString = dynamic_cast(pEntry->GetObject()); - - if (!pString) { - HLTError("configuration object \"%s\" has wrong type, required TObjString", cdbEntry); - return -EINVAL; - } - - HLTInfo("received configuration object string: \"%s\"", pString->GetString().Data()); - - return ReadConfigurationString(pString->GetString().Data()); -} - -int32_t GPUTPCTrackerComponent::Configure(const char* cdbEntry, const char* chainId, const char* commandLine) -{ - // Configure the component - // There are few levels of configuration, - // parameters which are set on one step can be overwritten on the next step - - //* read hard-coded values - SetDefaultConfiguration(); - - //* read the default CDB entry - int32_t iResult1 = ReadCDBEntry(nullptr, chainId); - - //* read magnetic field - fSolenoidBz = GetBz(); - - //* read the actual CDB entry if required - int32_t iResult2 = (cdbEntry) ? ReadCDBEntry(cdbEntry, chainId) : 0; - - //* read extra parameters from input (if they are) - int32_t iResult3 = 0; - - if (commandLine && commandLine[0] != '\0') { - HLTInfo("received configuration string from HLT framework: \"%s\"", commandLine); - iResult3 = ReadConfigurationString(commandLine); - } - - if (fRec) { - ConfigureSlices(); - } - - return iResult1 ? iResult1 : (iResult2 ? iResult2 : iResult3); -} - -int32_t GPUTPCTrackerComponent::ConfigureSlices() -{ - // Initialize the tracker slices - GPUSettingsRec rec; - GPUSettingsGRP grp; - GPUSettingsProcessing devProc; - - grp.solenoidBzNominalGPU = fSolenoidBz; - grp.grpContinuousMaxTimeBin = 0; // triggered events - if (mNeighboursSearchArea > 0) { - rec.tpc.neighboursSearchArea = mNeighboursSearchArea; - } - if (fClusterErrorCorrectionY > 1.e-4) { - rec.tpc.clusterError2CorrectionY = fClusterErrorCorrectionY * fClusterErrorCorrectionY; - } - if (fClusterErrorCorrectionZ > 1.e-4) { - rec.tpc.clusterError2CorrectionZ = fClusterErrorCorrectionZ * fClusterErrorCorrectionZ; - } - rec.tpc.minNClustersTrackSeed = fMinNTrackClusters; - rec.SetMinTrackPtB5(fMinTrackPt * fabsf(fSolenoidBz / 5)); - rec.tpc.searchWindowDZDR = fSearchWindowDZDR; - devProc.nDeviceHelperThreads = fGPUHelperThreads; - rec.tpc.globalTracking = fGlobalTracking; - devProc.stuckProtection = fGPUStuckProtection; - rec.nonConsecutiveIDs = true; - rec.tpc.mergerReadFromTrackerDirectly = false; - devProc.ompThreads = 1; - devProc.ompKernels = false; - - GPURecoStepConfiguration steps; - steps.steps.set(GPUDataTypes::RecoStep::TPCSliceTracking); - steps.inputs.set(GPUDataTypes::InOutType::TPCClusters); - steps.outputs.set(GPUDataTypes::InOutType::TPCSectorTracks); - - fRec->SetSettings(&grp, &rec, &devProc, &steps); - fChain->LoadClusterErrors(); - return fRec->Init(); -} - -void* GPUTPCTrackerComponent::TrackerInit(void* par) -{ - // Create tracker instance and set parameters - fRec = GPUReconstruction::CreateInstance(fAllowGPU ? fGPUType.Data() : "CPU", true); - if (fRec == nullptr) { - return ((void*)-1); - } - fChain = fRec->AddChain(); - - if (ConfigureSlices()) { - return ((void*)-1); - } - return (nullptr); -} - -int32_t GPUTPCTrackerComponent::DoInit(int argc, const char** argv) -{ - if (fRec) { - return EINPROGRESS; - } - - // Configure the CA tracker component - TString arguments = ""; - for (int32_t i = 0; i < argc; i++) { - if (!arguments.IsNull()) { - arguments += " "; - } - arguments += argv[i]; - } - - int32_t retVal = Configure(nullptr, nullptr, arguments.Data()); - if (retVal == 0) { - if (fAsync) { - if (fAsyncProcessor.Initialize(1)) { - return (-ENODEV); - } - void* initRetVal; - if (fAsyncProcessor.InitializeAsyncMemberTask(this, &GPUTPCTrackerComponent::TrackerInit, nullptr, &initRetVal) != 0) { - return (-ENODEV); - } - if (initRetVal) { - return (-ENODEV); - } - } else { - if (TrackerInit(nullptr) != nullptr) { - return (-ENODEV); - } - } - } - - return (retVal); -} - -void* GPUTPCTrackerComponent::TrackerExit(void* par) -{ - if (fRec) { - delete fRec; - } - fRec = nullptr; - return (nullptr); -} - -int32_t GPUTPCTrackerComponent::DoDeinit() -{ - // see header file for class documentation - if (fAsync) { - void* initRetVal = nullptr; - fAsyncProcessor.InitializeAsyncMemberTask(this, &GPUTPCTrackerComponent::TrackerExit, nullptr, &initRetVal); - fAsyncProcessor.Deinitialize(); - } else { - TrackerExit(nullptr); - } - return 0; -} - -int32_t GPUTPCTrackerComponent::Reconfigure(const char* cdbEntry, const char* chainId) -{ - // Reconfigure the component from OCDB . - return Configure(cdbEntry, chainId, nullptr); -} - -int32_t GPUTPCTrackerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks) -{ - //* process event - if (!fRec) { - HLTError("CATracker not initialized properly"); - return -ENOENT; - } - - AliHLTTPCTrackerWrapperData tmpPar; - tmpPar.fEvtData = &evtData; - tmpPar.fBlocks = blocks; - tmpPar.mOutputPtr = outputPtr; - tmpPar.fSize = &size; - tmpPar.mOutputBlocks = &outputBlocks; - - static int32_t trackerTimeout = 0; - if (trackerTimeout) { - size = 0; - return (0); - } - - int32_t retVal; - if (fAsync) { - void* asyncRetVal = nullptr; - if (fAsyncProcessor.InitializeAsyncMemberTask(this, &GPUTPCTrackerComponent::TrackerDoEvent, &tmpPar, &asyncRetVal, fAsync) != 0) { - HLTError("Tracking timed out, disabling this tracker instance"); - trackerTimeout = 1; - size = 0; - return (-ENODEV); - } else { - retVal = (int32_t)(size_t)asyncRetVal; - } - } else { - retVal = (int32_t)(size_t)TrackerDoEvent(&tmpPar); - } - return (retVal); -} - -void* GPUTPCTrackerComponent::TrackerDoEvent(void* par) -{ - AliHLTTPCTrackerWrapperData* tmpPar = reinterpret_cast(par); - - const AliHLTComponentEventData& evtData = *(tmpPar->fEvtData); - const AliHLTComponentBlockData* blocks = tmpPar->fBlocks; - AliHLTUInt8_t* outputPtr = tmpPar->mOutputPtr; - AliHLTUInt32_t& size = *(tmpPar->fSize); - vector& outputBlocks = *(tmpPar->mOutputBlocks); - - AliHLTUInt32_t maxBufferSize = size; - size = 0; // output size - - if (GetFirstInputBlock(kAliHLTDataTypeSOR) || GetFirstInputBlock(kAliHLTDataTypeEOR)) { - return 0; - } - - fBenchmark.StartNewEvent(); - fBenchmark.Start(0); - - // Logging( kHLTLogWarning, "HLT::TPCCATracker::DoEvent", "DoEvent", "CA::DoEvent()" ); - if (evtData.fBlockCnt <= 0) { - HLTWarning("no blocks in event"); - return 0; - } - - // Prepare everything for all slices - const AliHLTTPCClusterXYZData* clustersXYZ[NSLICES][fgkNPatches] = {nullptr}; - const AliHLTTPCRawClusterData* clustersRaw[NSLICES][fgkNPatches] = {nullptr}; - - for (uint64_t ndx = 0; ndx < evtData.fBlockCnt; ndx++) { - const AliHLTComponentBlockData& pBlock = blocks[ndx]; - int32_t slice = AliHLTTPCDefinitions::GetMinSliceNr(pBlock); - int32_t patch = AliHLTTPCDefinitions::GetMinPatchNr(pBlock); - if (pBlock.fDataType == AliHLTTPCDefinitions::RawClustersDataType()) { - clustersRaw[slice][patch] = (const AliHLTTPCRawClusterData*)pBlock.fPtr; - } else if (pBlock.fDataType == AliHLTTPCDefinitions::ClustersXYZDataType()) { - clustersXYZ[slice][patch] = (const AliHLTTPCClusterXYZData*)pBlock.fPtr; - } - } - - GPUTPCClusterData* clusterData[NSLICES] = {nullptr}; - int32_t nClusters[NSLICES] = {0}; - - int32_t nClustersTotal = 0; - for (int32_t slice = 0; slice < NSLICES; slice++) { - int32_t nClustersSliceTotal = 0; - for (int32_t patch = 0; patch < 6; patch++) { - if (clustersXYZ[slice][patch]) { - nClustersSliceTotal += clustersXYZ[slice][patch]->fCount; - } - } - if (nClustersSliceTotal > 500000) { - HLTWarning("Too many clusters in tracker input: Slice %d, Number of Clusters %d, slice not included in tracking", slice, nClustersSliceTotal); - nClusters[slice] = nClustersSliceTotal; - } else if (nClustersSliceTotal == 0) { - nClusters[slice] = nClustersSliceTotal; - } else { - clusterData[slice] = new GPUTPCClusterData[nClustersSliceTotal]; - nClusters[slice] = nClustersSliceTotal; - GPUTPCClusterData* pCluster = clusterData[slice]; - for (int32_t patch = 0; patch < 6; patch++) { - if (clustersXYZ[slice][patch] != nullptr && clustersRaw[slice][patch] != nullptr) { - const AliHLTTPCClusterXYZData& clXYZ = *clustersXYZ[slice][patch]; - const AliHLTTPCRawClusterData& clRaw = *clustersRaw[slice][patch]; - - if (clXYZ.fCount != clRaw.fCount) { - HLTError("Number of entries in raw and xyz clusters are not mached %d vs %d", clXYZ.fCount, clRaw.fCount); - continue; - } - - const int32_t firstRow = AliHLTTPCGeometry::GetFirstRow(patch); - for (int32_t ic = 0; ic < clXYZ.fCount; ic++) { - const AliHLTTPCClusterXYZ& c = clXYZ.fClusters[ic]; - const AliHLTTPCRawCluster& cRaw = clRaw.fClusters[ic]; - if (c.GetZ() > fClusterZCut || c.GetZ() < -fClusterZCut) { - continue; - } - if (c.GetX() < 1.f) { - continue; // cluster xyz position was not calculated for whatever reason - } - pCluster->id = AliHLTTPCGeometry::CreateClusterID(slice, patch, ic); - pCluster->x = c.GetX(); - pCluster->y = c.GetY(); - pCluster->z = c.GetZ(); - pCluster->row = firstRow + cRaw.GetPadRow(); - pCluster->flags = cRaw.GetFlags(); - if (cRaw.GetSigmaPad2() < kAlmost0 || cRaw.GetSigmaTime2() < kAlmost0) { - pCluster->flags |= GPUTPCGMMergedTrackHit::flagSingle; - } - pCluster->amp = cRaw.GetCharge(); -#ifdef GPUCA_FULL_CLUSTERDATA - pCluster->pad = cRaw.GetPad(); - pCluster->time = cRaw.GetTime(); - pCluster->ampMax = cRaw.GetQMax(); - pCluster->sigmaPad2 = cRaw.GetSigmaPad2(); - pCluster->sigmaTime2 = cRaw.GetSigmaTime2(); -#endif - pCluster++; - } - } - } - nClusters[slice] = pCluster - clusterData[slice]; - nClustersTotal += nClusters[slice]; - HLTDebug("Read %d->%d hits for slice %d", nClustersSliceTotal, nClusters[slice], slice); - } - } - - if (nClustersTotal == 0) { - // No input, skip processing - fBenchmark.Stop(0); - return (0); - } - - fChain->ClearIOPointers(); - for (int32_t i = 0; i < NSLICES; i++) { - fChain->mIOPtrs.clusterData[i] = clusterData[i]; - fChain->mIOPtrs.nClusterData[i] = nClusters[i]; - } - - // Prepare Output - fRec->SetOutputControl(outputPtr, maxBufferSize); - - // reconstruct the event - fBenchmark.Start(1); - try { - fRec->PrepareEvent(); - } catch (const std::bad_alloc& e) { - printf("Memory Allocation Error\n"); - return ((void*)(size_t)-EINVAL); - } - if (fChain->RunTPCTrackingSlices()) { - HLTError("Error running tracking!"); - return ((void*)(size_t)-EINVAL); - } - if (fChain->CheckErrorCodes()) { - return ((void*)(size_t)-EINVAL); - } - fBenchmark.Stop(1); - HLTInfo("Processed %d clusters", nClustersTotal); - for (int32_t i = 0; i < NSLICES; i++) { - fChain->GetTPCSliceTrackers()[i].Clear(); - } - - int32_t ret = 0; - size = 0; - - if (fRec->OutputControl().size == 1) { - HLTWarning("Output buffer size exceeded buffer size %d, tracks are not stored", maxBufferSize); - ret = -ENOSPC; - } else { - for (int32_t slice = 0; slice < NSLICES; slice++) { - GPUTPCSliceOutput* pOut = fChain->GetTPCSliceTrackers()[slice].Output(); - if (!pOut) { - continue; - } - HLTDebug("%d tracks found for slice %d", pOut->NTracks(), slice); - uint32_t blockSize = pOut->Size(); - if (blockSize > 0) { - AliHLTComponentBlockData bd; - FillBlockData(bd); - bd.fOffset = ((char*)pOut - (char*)outputPtr); - bd.fSize = blockSize; - bd.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification(slice, slice, 0, fgkNPatches); - bd.fDataType = GPUTPCDefinitions::fgkTrackletsDataType; - outputBlocks.push_back(bd); - size += bd.fSize; - fBenchmark.AddOutput(bd.fSize); - } - } - } - - for (int32_t i = 0; i < NSLICES; i++) { - if (clusterData[i]) { - delete[] clusterData[i]; - } - } - - fBenchmark.Stop(0); - HLTInfo(fBenchmark.GetStatistics()); - - return ((void*)(size_t)ret); -} diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.h deleted file mode 100644 index 5b09f50bf62bc..0000000000000 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerComponent.h +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCTrackerComponent.h -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#ifndef GPUTPCTRACKERCOMPONENT_H -#define GPUTPCTRACKERCOMPONENT_H - -#ifndef GPUCA_ALIROOT_LIB -#define GPUCA_ALIROOT_LIB -#endif - -#include "GPUCommonDef.h" -#include "AliHLTProcessor.h" -#include "AliHLTComponentBenchmark.h" -#include "AliHLTAsyncMemberProcessor.h" - -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -class GPUTPCClusterData; -class GPUReconstruction; -class GPUChainTracking; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -/** - * @class GPUTPCTrackerComponent - * The Cellular Automaton tracker component. - */ -class GPUTPCTrackerComponent : public AliHLTProcessor -{ - public: - /** standard constructor */ - GPUTPCTrackerComponent(); - - /** dummy copy constructor, defined according to effective C++ style */ - GPUTPCTrackerComponent(const GPUTPCTrackerComponent&); - - /** dummy assignment op, but defined according to effective C++ style */ - GPUTPCTrackerComponent& operator=(const GPUTPCTrackerComponent&); - - /** standard destructor */ - virtual ~GPUTPCTrackerComponent(); - - // Public functions to implement AliHLTComponent's interface. - // These functions are required for the registration process - - /** @see component interface @ref AliHLTComponent::GetComponentID */ - const char* GetComponentID(); - - /** @see component interface @ref AliHLTComponent::GetInputDataTypes */ - void GetInputDataTypes(vector& list); - - /** @see component interface @ref AliHLTComponent::GetOutputDataType */ - AliHLTComponentDataType GetOutputDataType(); - - /** @see component interface @ref AliHLTComponent::GetOutputDataSize */ - virtual void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - - /** @see component interface @ref AliHLTComponent::Spawn */ - AliHLTComponent* Spawn(); - - protected: - // Protected functions to implement AliHLTComponent's interface. - // These functions provide initialization as well as the actual processing - // capabilities of the component. - - /** @see component interface @ref AliHLTComponent::DoInit */ - int32_t DoInit(int argc, const char** argv); - - /** @see component interface @ref AliHLTComponent::DoDeinit */ - int32_t DoDeinit(); - - /** reconfigure **/ - int32_t Reconfigure(const char* cdbEntry, const char* chainId); - - /** @see component interface @ref AliHLTProcessor::DoEvent */ - int32_t DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks); - - private: - struct AliHLTTPCTrackerWrapperData { - const AliHLTComponentEventData* fEvtData; - const AliHLTComponentBlockData* fBlocks; - AliHLTUInt8_t* mOutputPtr; - AliHLTUInt32_t* fSize; - vector* mOutputBlocks; - }; - - static const int32_t NSLICES = 36; //* N slices - static const int32_t fgkNPatches = 6; //* N slices - - /** magnetic field */ - double fSolenoidBz; // see above - int32_t fMinNTrackClusters; //* required min number of clusters on the track - double fMinTrackPt; //* required min Pt of tracks - double fClusterZCut; //* cut on cluster Z position (for noise rejection at the age of TPC) - double mNeighboursSearchArea; //* area in cm for the neighbour search algorithm - double fClusterErrorCorrectionY; // correction for the cluster errors - double fClusterErrorCorrectionZ; // correction for the cluster errors - - AliHLTComponentBenchmark fBenchmark; // benchmarks - int8_t fAllowGPU; //* Allow this tracker to run on GPU - int32_t fGPUHelperThreads; // Number of helper threads for GPU tracker, set to -1 to use default number - int32_t fCPUTrackers; // Number of CPU trackers to run in addition to GPU tracker - int8_t fGlobalTracking; // Activate global tracking feature - int32_t fGPUDeviceNum; // GPU Device to use, default -1 for auto detection - TString fGPUType; // GPU type to use "CUDA", "HIP", "OCL" - int32_t fGPUStuckProtection; // Protect from stuck GPUs - int32_t fAsync; // Run tracking in async thread to catch GPU hangs.... - float fSearchWindowDZDR; // See TPCCAParam - GPUCA_NAMESPACE::gpu::GPUReconstruction* fRec; // GPUReconstruction - GPUCA_NAMESPACE::gpu::GPUChainTracking* fChain; - - /** set configuration parameters **/ - void SetDefaultConfiguration(); - int32_t ReadConfigurationString(const char* arguments); - int32_t ReadCDBEntry(const char* cdbEntry, const char* chainId); - int32_t Configure(const char* cdbEntry, const char* chainId, const char* commandLine); - int32_t ConfigureSlices(); - - AliHLTAsyncMemberProcessor fAsyncProcessor; - void* TrackerInit(void*); - void* TrackerExit(void*); - void* TrackerDoEvent(void*); - - ClassDef(GPUTPCTrackerComponent, 0); -}; -#endif // GPUTPCTRACKERCOMPONENT_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerDump.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrackerDump.cxx index c1f731105dc5a..5c2ed83d47966 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackerDump.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackerDump.cxx @@ -24,7 +24,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUTPCTracker::DumpOutput(std::ostream& out) { diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTracklet.h b/GPU/GPUTracking/SliceTracker/GPUTPCTracklet.h index 9190cdb94aa5f..873368f1635a0 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTracklet.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTracklet.h @@ -18,7 +18,7 @@ #include "GPUTPCBaseTrackParam.h" #include "GPUTPCDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -55,6 +55,6 @@ class GPUTPCTracklet uint32_t mFirstHit; // first hit in row hit array }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKLET_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.cxx index e7735b4b2580c..27d531543bf6d 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.cxx @@ -29,7 +29,7 @@ #include "GPUParam.inc" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUdii() void GPUTPCTrackletConstructor::InitTracklet(GPUTPCTrackParam& GPUrestrict() tParam) { diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h index a961501207911..88a2d9c94d305 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletConstructor.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -109,6 +109,6 @@ class GPUTPCTrackletConstructor }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKLETCONSTRUCTOR_H diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.cxx b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.cxx index b8cbbae06e8b0..d5492602a4283 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.cxx +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.cxx @@ -19,7 +19,7 @@ #include "GPUTPCTracklet.h" #include "GPUCommonMath.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCTrackletSelector::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& s, processorType& GPUrestrict() tracker) diff --git a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h index 115f0785fc212..80a29d21edac3 100644 --- a/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h +++ b/GPU/GPUTracking/SliceTracker/GPUTPCTrackletSelector.h @@ -20,7 +20,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -53,6 +53,6 @@ class GPUTPCTrackletSelector : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& tracker); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTPCTRACKLETSELECTOR_H diff --git a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx index 8bef787b85e8e..ae92f8a380bda 100644 --- a/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx +++ b/GPU/GPUTracking/Standalone/Benchmark/standalone.cxx @@ -62,11 +62,11 @@ #include "GPUChainITS.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; // #define BROKEN_EVENTS -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { extern GPUSettingsStandalone configStandalone; } diff --git a/GPU/GPUTracking/Standalone/tools/createGeo.C b/GPU/GPUTracking/Standalone/tools/createGeo.C index b0837ff2604b4..5684f2cc92da6 100644 --- a/GPU/GPUTracking/Standalone/tools/createGeo.C +++ b/GPU/GPUTracking/Standalone/tools/createGeo.C @@ -7,7 +7,7 @@ #include "GPUReconstruction.h" #include "GPUChainTracking.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void createGeo() { @@ -16,7 +16,6 @@ void createGeo() gm->createPadPlaneArray(); gm->createClusterMatrixArray(); o2::trd::GeometryFlat gf(*gm); - //if (!gf.readMatricesFromFile()) return; // uncomment this line when the matrices dumped from AliRoot should be used gSystem->Load("libO2GPUTracking"); GPUReconstruction* rec = GPUReconstruction::CreateInstance(GPUReconstruction::DeviceType::CPU); GPUChainTracking* chain = rec->AddChain(); diff --git a/GPU/GPUTracking/Standalone/tools/createLUT.C b/GPU/GPUTracking/Standalone/tools/createLUT.C index 4cda80a8b5a9c..83e46da29b9a3 100644 --- a/GPU/GPUTracking/Standalone/tools/createLUT.C +++ b/GPU/GPUTracking/Standalone/tools/createLUT.C @@ -5,7 +5,7 @@ #include "GPUReconstruction.h" #include "GPUChainTracking.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void createLUT() { diff --git a/GPU/GPUTracking/TPCClusterFinder/Array2D.h b/GPU/GPUTracking/TPCClusterFinder/Array2D.h index b8f01f199cc98..b62176fdc4365 100644 --- a/GPU/GPUTracking/TPCClusterFinder/Array2D.h +++ b/GPU/GPUTracking/TPCClusterFinder/Array2D.h @@ -18,7 +18,7 @@ #include "clusterFinderDefs.h" #include "ChargePos.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { template @@ -121,6 +121,6 @@ using TPCMapMemoryLayout = LinearLayout; template using Array2D = AbstractArray2D>; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/CfConsts.h b/GPU/GPUTracking/TPCClusterFinder/CfConsts.h index 235fc6444e8af..a53f73ed69e26 100644 --- a/GPU/GPUTracking/TPCClusterFinder/CfConsts.h +++ b/GPU/GPUTracking/TPCClusterFinder/CfConsts.h @@ -17,7 +17,7 @@ #include "clusterFinderDefs.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -192,6 +192,6 @@ GPUconstexpr() uint32_t NoiseSuppressionMinima[NOISE_SUPPRESSION_NEIGHBOR_NUM] = } // namespace cfconsts } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/CfFragment.h b/GPU/GPUTracking/TPCClusterFinder/CfFragment.h index 48e3cbf6200fe..de5dfe9e1d683 100644 --- a/GPU/GPUTracking/TPCClusterFinder/CfFragment.h +++ b/GPU/GPUTracking/TPCClusterFinder/CfFragment.h @@ -18,7 +18,7 @@ #include "clusterFinderDefs.h" #include "GPUCommonMath.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct CfFragment { @@ -117,6 +117,6 @@ struct CfFragment { } }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/CfUtils.h b/GPU/GPUTracking/TPCClusterFinder/CfUtils.h index 2e929ecdcf9be..4504b8288aee0 100644 --- a/GPU/GPUTracking/TPCClusterFinder/CfUtils.h +++ b/GPU/GPUTracking/TPCClusterFinder/CfUtils.h @@ -20,7 +20,7 @@ #include "Array2D.h" #include "CfConsts.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class CfUtils @@ -274,6 +274,6 @@ class CfUtils } }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/ChargePos.h b/GPU/GPUTracking/TPCClusterFinder/ChargePos.h index f852212d180f8..10e375ee6f4bd 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ChargePos.h +++ b/GPU/GPUTracking/TPCClusterFinder/ChargePos.h @@ -17,7 +17,7 @@ #include "clusterFinderDefs.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -60,6 +60,6 @@ struct ChargePos { inline constexpr ChargePos INVALID_CHARGE_POS{255, 255, INVALID_TIME_BIN}; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx index e8176ecb60d78..d145aaed705d9 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.cxx @@ -18,8 +18,8 @@ #include "GPUParam.h" #include "DataFormatsTPC/ClusterNative.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; GPUd() bool ClusterAccumulator::toNative(const ChargePos& pos, Charge q, tpc::ClusterNative& cn, const GPUParam& param) const { diff --git a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h index c6a05c46a7642..26decbf0a5b14 100644 --- a/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h +++ b/GPU/GPUTracking/TPCClusterFinder/ClusterAccumulator.h @@ -18,7 +18,7 @@ #include "clusterFinderDefs.h" #include "PackedCharge.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace tpc @@ -56,6 +56,6 @@ class ClusterAccumulator }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChainContext.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChainContext.h index 99e2e998c04fc..d6107a6503e86 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChainContext.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChainContext.h @@ -22,7 +22,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -84,6 +84,6 @@ struct GPUTPCCFChainContext { }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx index 287dad6f5367f..8f184836de6df 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.cxx @@ -17,8 +17,8 @@ #include "DataFormatsTPC/Digit.h" #include "TPCPadGainCalib.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFChargeMapFiller::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h index 8a0d8089ad1f5..44df676c0d73e 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFChargeMapFiller.h @@ -27,7 +27,7 @@ namespace o2::tpc class Digit; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct ChargePos; @@ -65,6 +65,6 @@ class GPUTPCCFChargeMapFiller : public GPUKernelTemplate static GPUd() size_t findTransition(int32_t, const tpc::Digit*, size_t, size_t); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx index 9a890202524f0..7c52e0374bd3d 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.cxx @@ -25,8 +25,8 @@ #endif #endif -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUd() void GPUTPCCFCheckPadBaseline::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h index 1e1b94cd43b74..670eb3a8700c6 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFCheckPadBaseline.h @@ -20,7 +20,7 @@ #include "clusterFinderDefs.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate @@ -58,6 +58,6 @@ class GPUTPCCFCheckPadBaseline : public GPUKernelTemplate GPUd() static void updatePadBaseline(int32_t pad, const GPUTPCClusterFinder&, int32_t totalCharges, int32_t consecCharges, tpccf::Charge maxCharge); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx index c051f01a71bf1..ad07f2b93f3e0 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.cxx @@ -22,8 +22,8 @@ #include "MCLabelAccumulator.h" #endif -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFClusterizer::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer, int8_t onlyMC) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h index ff8820efc1d69..c04a9e167529f 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFClusterizer.h @@ -27,7 +27,7 @@ namespace o2::tpc struct ClusterNative; } // namespace o2::tpc -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class ClusterAccumulator; @@ -71,6 +71,6 @@ class GPUTPCCFClusterizer : public GPUKernelTemplate static GPUd() uint32_t sortIntoBuckets(processorType&, const tpc::ClusterNative&, uint32_t, uint32_t, uint32_t*, tpc::ClusterNative*); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx index daacbc0994295..3727e23bcf16c 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.cxx @@ -23,8 +23,8 @@ #include "TPCPadGainCalib.h" #include "TPCZSLinkMapping.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; using namespace o2::tpc; using namespace o2::tpc::constants; diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h index bf34b78227f19..abd6deefd4c28 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDecodeZS.h @@ -23,7 +23,7 @@ #include "DataFormatsTPC/ZeroSuppressionLinkBased.h" #include "DetectorsRaw/RDHUtils.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCClusterFinder; @@ -181,6 +181,6 @@ class GPUTPCCFDecodeZSDenseLink : public GPUTPCCFDecodeZSLinkBase GPUd() static uint16_t DecodeTBMultiThread(processorType& clusterer, GPUSharedMemory& smem, const int32_t iThread, const uint8_t*& page, uint32_t pageDigitOffset, const header::RAWDataHeader* rawDataHeader, int32_t firstHBF, int32_t cru, const uint8_t* payloadEnd, const uint8_t* nextPage); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.cxx index 5c609a9775bd9..dab8123698abf 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.cxx @@ -18,8 +18,8 @@ #include "ChargePos.h" #include "GPUDefMacros.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFDeconvolution::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h index 0fb27c07e2825..e907728e089b9 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFDeconvolution.h @@ -23,7 +23,7 @@ #include "Array2D.h" #include "PackedCharge.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCCFDeconvolution : public GPUKernelTemplate @@ -59,6 +59,6 @@ class GPUTPCCFDeconvolution : public GPUKernelTemplate static GPUdi() uint8_t countPeaksOuter(uint16_t, uint8_t, const uint8_t*); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.cxx index baba573b67aa8..b64f4f3f6b689 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.cxx @@ -13,8 +13,8 @@ /// \author David Rohr #include "GPUTPCCFGather.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFGather::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer, o2::tpc::ClusterNative* ptr) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h index da486741ea62c..a7b3b4938b1dd 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFGather.h @@ -18,7 +18,7 @@ #include "GPUGeneralKernels.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCClusterFinder; @@ -43,6 +43,6 @@ class GPUTPCCFGather : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer, Args... args); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx index a44bf2f327054..f7488821d545f 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.cxx @@ -18,8 +18,8 @@ #include "GPUHostDataTypes.h" #endif -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; #if !defined(GPUCA_GPUCODE) void GPUTPCCFMCLabelFlattener::setGlobalOffsetsAndAllocate( diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h index b1c266cf5fed1..6bde9bf468eaa 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFMCLabelFlattener.h @@ -21,7 +21,7 @@ #include "GPUTPCClusterFinder.h" #include "GPUConstantMem.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUTPCLinearLabels; @@ -57,6 +57,6 @@ class GPUTPCCFMCLabelFlattener : public GPUKernelTemplate static void setGlobalOffsetsAndAllocate(GPUTPCClusterFinder&, GPUTPCLinearLabels&); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx index ec590bd5d1ab3..05fddda5bec68 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.cxx @@ -18,8 +18,8 @@ #include "CfUtils.h" #include "ChargePos.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFNoiseSuppression::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h index 41f463fd4fe89..a11fbeb7d852f 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFNoiseSuppression.h @@ -22,7 +22,7 @@ #include "Array2D.h" #include "PackedCharge.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct ChargePos; @@ -72,6 +72,6 @@ class GPUTPCCFNoiseSuppression : public GPUKernelTemplate static GPUd() void findMinimaAndPeaks(const Array2D&, const Array2D&, const GPUSettingsRec&, float, const ChargePos&, ChargePos*, PackedCharge*, uint64_t*, uint64_t*, uint64_t*); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.cxx index be403c98c4acc..30fdac92e8607 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.cxx @@ -19,8 +19,8 @@ #include "PackedCharge.h" #include "TPCPadGainCalib.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFPeakFinder::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h index 4aa3574abd3ff..5cb5b208c2fde 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.h @@ -22,7 +22,7 @@ #include "Array2D.h" #include "PackedCharge.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct ChargePos; @@ -58,6 +58,6 @@ class GPUTPCCFPeakFinder : public GPUKernelTemplate static GPUd() bool isPeak(GPUSharedMemory&, tpccf::Charge, const ChargePos&, uint16_t, const Array2D&, const GPUSettingsRec&, ChargePos*, PackedCharge*); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.cxx index 909d7eb6b7192..edc4fd6bab56c 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.cxx @@ -18,8 +18,8 @@ #include "ChargePos.h" #include "CfUtils.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; template <> GPUdii() void GPUTPCCFStreamCompaction::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUSharedMemory& smem, processorType& clusterer, int32_t iBuf, int32_t stage) diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h index 8b2206da3088c..9de0aab11e6f1 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCCFStreamCompaction.h @@ -20,7 +20,7 @@ #include "GPUConstantMem.h" #include "GPUTPCClusterFinder.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUTPCCFStreamCompaction : public GPUKernelTemplate @@ -58,6 +58,6 @@ class GPUTPCCFStreamCompaction : public GPUKernelTemplate static GPUd() int32_t CompactionElems(processorType& clusterer, int32_t stage); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.cxx index f8ff6b15465c8..e009ac12389b4 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.cxx @@ -23,7 +23,7 @@ #include "ChargePos.h" #include "Array2D.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace o2::tpc; void GPUTPCClusterFinder::InitializeProcessor() diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.h b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.h index d4838dda26fdd..a02d32f250604 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.h +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinder.h @@ -41,7 +41,7 @@ class Digit; } // namespace o2 -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUTPCClusterMCInterimArray; struct TPCPadGainCalib; @@ -153,6 +153,6 @@ class GPUTPCClusterFinder : public GPUProcessor #endif }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx index 9b52a0ec94170..eb5d7505eea22 100644 --- a/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/GPUTPCClusterFinderDump.cxx @@ -17,8 +17,8 @@ #include "Array2D.h" #include "DataFormatsTPC/Digit.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; void GPUTPCClusterFinder::DumpDigits(std::ostream& out) { diff --git a/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.cxx b/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.cxx index c68f10d388d3c..19ef7aa9ecd0d 100644 --- a/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.cxx +++ b/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.cxx @@ -18,8 +18,8 @@ #include "GPUTPCClusterFinder.h" #include "SimulationDataFormat/MCTruthContainer.h" -using namespace GPUCA_NAMESPACE::gpu; -using namespace GPUCA_NAMESPACE::gpu::tpccf; +using namespace o2::gpu; +using namespace o2::gpu::tpccf; MCLabelAccumulator::MCLabelAccumulator(GPUTPCClusterFinder& clusterer) : mIndexMap(clusterer.mPindexMap), mLabels(clusterer.mPinputLabels), mOutput(clusterer.mPlabelsByRow) diff --git a/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.h b/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.h index 53446dd4391ac..176fbea02befe 100644 --- a/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.h +++ b/GPU/GPUTracking/TPCClusterFinder/MCLabelAccumulator.h @@ -32,7 +32,7 @@ using ConstMCLabelContainerView = o2::dataformats::ConstMCTruthContainerView mClusterLabels; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCClusterFinder/PackedCharge.h b/GPU/GPUTracking/TPCClusterFinder/PackedCharge.h index 9d13f431adc2b..03c1ca9b79ae7 100644 --- a/GPU/GPUTracking/TPCClusterFinder/PackedCharge.h +++ b/GPU/GPUTracking/TPCClusterFinder/PackedCharge.h @@ -18,7 +18,7 @@ #include "clusterFinderDefs.h" #include "GPUCommonMath.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class PackedCharge @@ -57,6 +57,6 @@ class PackedCharge BasicType mVal; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvert.cxx b/GPU/GPUTracking/TPCConvert/GPUTPCConvert.cxx index 0f3f50bb17a58..3d6b45c372ea0 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvert.cxx +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvert.cxx @@ -18,7 +18,7 @@ #include "GPUReconstruction.h" #include "GPUO2DataTypes.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUTPCConvert::InitializeProcessor() {} diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvert.h b/GPU/GPUTracking/TPCConvert/GPUTPCConvert.h index 3e46b31d1a597..222c2ffa65648 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvert.h +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvert.h @@ -18,7 +18,7 @@ #include "GPUDef.h" #include "GPUProcessor.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -54,6 +54,6 @@ class GPUTPCConvert : public GPUProcessor int16_t mMemoryResMemory = -1; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvertImpl.h b/GPU/GPUTracking/TPCConvert/GPUTPCConvertImpl.h index 8df31462d4995..8dfe4ac6c28bc 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvertImpl.h +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvertImpl.h @@ -20,7 +20,7 @@ #include "TPCFastTransform.h" #include "CorrectionMapsHelper.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -47,6 +47,6 @@ class GPUTPCConvertImpl }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.cxx b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.cxx index 4d59a3ca4e428..dc01b3782daf9 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.cxx +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.cxx @@ -19,7 +19,7 @@ #include "GPUO2DataTypes.h" #include "GPUTPCConvertImpl.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template <> GPUdii() void GPUTPCConvertKernel::Thread<0>(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& GPUrestrict() processors) diff --git a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h index 5bfe05de0c631..085260dc48067 100644 --- a/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h +++ b/GPU/GPUTracking/TPCConvert/GPUTPCConvertKernel.h @@ -17,7 +17,7 @@ #include "GPUGeneralKernels.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -29,6 +29,6 @@ class GPUTPCConvertKernel : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h b/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h index 49a6178dbbff1..8564b0ea7371c 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDGeometry.h @@ -17,35 +17,7 @@ #include "GPUCommonDef.h" -#ifdef GPUCA_ALIROOT_LIB -#include "AliTRDgeometry.h" -#include "AliTRDpadPlane.h" -#include "AliGeomManager.h" -#include "TGeoMatrix.h" - -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ - -typedef AliTRDpadPlane GPUTRDpadPlane; - -class GPUTRDGeometry : public AliTRDgeometry -{ - public: - static bool CheckGeometryAvailable() { return AliGeomManager::GetGeometry(); } - - // Make sub-functionality available directly in GPUTRDGeometry - double GetPadPlaneWidthIPad(int32_t det) const { return GetPadPlane(det)->GetWidthIPad(); } - double GetPadPlaneRowPos(int32_t layer, int32_t stack, int32_t row) const { return GetPadPlane(layer, stack)->GetRowPos(row); } - double GetPadPlaneRowSize(int32_t layer, int32_t stack, int32_t row) const { return GetPadPlane(layer, stack)->GetRowSize(row); } - int32_t GetGeomManagerVolUID(int32_t det, int32_t modId) const { return AliGeomManager::LayerToVolUID(AliGeomManager::ELayerID(AliGeomManager::kTRD1 + GetLayer(det)), modId); } - float GetCdrHght() const { return CdrHght(); } -}; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -#elif defined(GPUCA_HAVE_O2HEADERS) //&& defined(GPUCA_GPUCODE) +#if defined(GPUCA_HAVE_O2HEADERS) //&& defined(GPUCA_GPUCODE) class TObjArray; #include "GPUDef.h" @@ -54,7 +26,7 @@ class TObjArray; #include "DataFormatsTRD/Constants.h" #include "GPUCommonTransform3D.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -109,13 +81,13 @@ class GPUTRDGeometry : private o2::trd::GeometryFlat static constexpr int32_t kNstack = o2::trd::constants::NSTACK; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -#else // below are dummy definitions to enable building the standalone version with AliRoot +#else // below are dummy definitions to enable building the standalone version without O2 Headers #include "GPUDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -178,8 +150,8 @@ class GPUTRDGeometry static constexpr const int32_t kNstack = 0; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -#endif // !GPUCA_ALIROOT_LIB && !defined(GPUCA_HAVE_O2HEADERS) +#endif // !defined(GPUCA_HAVE_O2HEADERS) #endif // GPUTRDGEOMETRY_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDInterfaces.h b/GPU/GPUTracking/TRDTracking/GPUTRDInterfaces.h index f0ae1bde58334..16347aae5c535 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDInterfaces.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDInterfaces.h @@ -15,7 +15,7 @@ #ifndef GPUTRDINTERFACES_H #define GPUTRDINTERFACES_H -// This is an interface header for making the TRD tracking portable between O2, AliRoot, and HLT standalone framework +// This is an interface header for making the TRD tracking portable between O2, and Ru2 format #include "GPUCommonDef.h" #include "GPUCommonMath.h" @@ -23,7 +23,7 @@ #include "GPUTPCGMTrackParam.h" #include "GPUTRDDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -32,110 +32,14 @@ class trackInterface; template class propagatorInterface; } // namespace gpu -} // namespace GPUCA_NAMESPACE - -#ifdef GPUCA_ALIROOT_LIB // Interface for AliRoot, build only with AliRoot -#include "AliExternalTrackParam.h" -#include "AliHLTExternalTrackParam.h" -#include "AliTrackerBase.h" - -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ - -template <> -class trackInterface : public AliExternalTrackParam -{ - - public: - trackInterface() : AliExternalTrackParam(){}; - trackInterface(const trackInterface& param) : AliExternalTrackParam(param){}; - trackInterface(const AliExternalTrackParam& param) = delete; - trackInterface(const AliHLTExternalTrackParam& param) : AliExternalTrackParam() - { - float paramTmp[5] = {param.fY, param.fZ, param.fSinPhi, param.fTgl, param.fq1Pt}; - Set(param.fX, param.fAlpha, paramTmp, param.fC); - } - trackInterface(const GPUTPCGMMergedTrack& trk) : AliExternalTrackParam() - { - Set(trk.GetParam().GetX(), trk.GetAlpha(), trk.GetParam().GetPar(), trk.GetParam().GetCov()); - } - trackInterface(const gputpcgmmergertypes::GPUTPCOuterParam& param) : AliExternalTrackParam() - { - Set(param.X, param.alpha, param.P, param.C); - } - - // parameter + covariance - float getX() const { return GetX(); } - float getAlpha() const { return GetAlpha(); } - float getY() const { return GetY(); } - float getZ() const { return GetZ(); } - float getSnp() const { return GetSnp(); } - float getTgl() const { return GetTgl(); } - float getQ2Pt() const { return GetSigned1Pt(); } - float getEta() const { return Eta(); } - float getPt() const { return Pt(); } - float getSigmaY2() const { return GetSigmaY2(); } - float getSigmaZ2() const { return GetSigmaZ2(); } - - const My_Float* getPar() const { return GetParameter(); } - const My_Float* getCov() const { return GetCovariance(); } - void resetCovariance(float s) { ResetCovariance(10.f); } - void updateCovZ2(float) {} - bool CheckNumericalQuality() const { return true; } - - // parameter manipulation - bool update(const My_Float p[2], const My_Float cov[3]) { return Update(p, cov); } - float getPredictedChi2(const My_Float p[2], const My_Float cov[3]) const { return GetPredictedChi2(p, cov); } - bool rotate(float alpha) { return Rotate(alpha); } - - void set(float x, float alpha, const float param[5], const float cov[15]) { Set(x, alpha, param, cov); } - - typedef AliExternalTrackParam baseClass; -}; - -template <> -class propagatorInterface : public AliTrackerBase -{ - - public: - typedef void propagatorParam; - propagatorInterface(const propagatorParam* = nullptr) : AliTrackerBase(), mParam(nullptr){}; - propagatorInterface(const propagatorInterface&) = delete; - propagatorInterface& operator=(const propagatorInterface&) = delete; - - bool propagateToX(float x, float maxSnp, float maxStep) { return PropagateTrackToBxByBz(mParam, x, 0.13957f, maxStep, false, maxSnp); } - int32_t getPropagatedYZ(float x, float& projY, float& projZ) - { - Double_t yz[2] = {0.}; - mParam->GetYZAt(x, GetBz(), yz); - projY = yz[0]; - projZ = yz[1]; - return 0; - } - - void setTrack(trackInterface* trk) { mParam = trk; } - void setFitInProjections(bool flag) {} - - float getAlpha() { return (mParam) ? mParam->GetAlpha() : 99999.f; } - bool update(const My_Float p[2], const My_Float cov[3]) { return (mParam) ? mParam->update(p, cov) : false; } - float getPredictedChi2(const My_Float p[2], const My_Float cov[3]) { return (mParam) ? mParam->getPredictedChi2(p, cov) : 99999.f; } - bool rotate(float alpha) { return (mParam) ? mParam->rotate(alpha) : false; } - - trackInterface* mParam; -}; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -#endif // GPUCA_ALIROOT_LIB +} // namespace o2 #if defined(GPUCA_HAVE_O2HEADERS) // Interface for O2, build only with O2 #include "DetectorsBase/Propagator.h" #include "GPUTRDInterfaceO2Track.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -159,7 +63,7 @@ class propagatorInterface GPUdi() void setFitInProjections(bool flag) {} GPUdi() float getAlpha() { return (mParam) ? mParam->getAlpha() : 99999.f; } - GPUdi() bool update(const My_Float p[2], const My_Float cov[3]) + GPUdi() bool update(const float p[2], const float cov[3]) { if (mParam) { gpustd::array pTmp = {p[0], p[1]}; @@ -169,7 +73,7 @@ class propagatorInterface return false; } } - GPUdi() float getPredictedChi2(const My_Float p[2], const My_Float cov[3]) + GPUdi() float getPredictedChi2(const float p[2], const float cov[3]) { if (mParam) { gpustd::array pTmp = {p[0], p[1]}; @@ -186,7 +90,7 @@ class propagatorInterface }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUCA_HAVE_O2HEADERS @@ -198,7 +102,7 @@ class propagatorInterface #include "ReconstructionDataFormats/TrackTPCITS.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -222,20 +126,6 @@ class trackInterface : public GPUTPCGMTrackParam }; GPUdDefault() trackInterface(const trackInterface& param) = default; GPUdDefault() trackInterface& operator=(const trackInterface& param) = default; -#ifdef GPUCA_ALIROOT_LIB - trackInterface(const AliHLTExternalTrackParam& param) : GPUTPCGMTrackParam(), mAlpha(param.fAlpha) - { - SetX(param.fX); - SetPar(0, param.fY); - SetPar(1, param.fZ); - SetPar(2, param.fSinPhi); - SetPar(3, param.fTgl); - SetPar(4, param.fq1Pt); - for (int32_t i = 0; i < 15; i++) { - SetCov(i, param.fC[i]); - } - }; -#endif #if defined(GPUCA_HAVE_O2HEADERS) GPUd() trackInterface(const o2::dataformats::TrackTPCITS& param) : GPUTPCGMTrackParam(), mAlpha(param.getParamOut().getAlpha()) { @@ -342,18 +232,18 @@ class propagatorInterface : public GPUTPCGMPropagator } return false; } - GPUd() bool update(const My_Float p[2], const My_Float cov[3]) + GPUd() bool update(const float p[2], const float cov[3]) { // TODO sigma_yz not taken into account yet, is not zero due to pad tilting! return Update(p[0], p[1], 0, false, cov[0], cov[2]) == 0 ? true : false; } GPUd() float getAlpha() { return GetAlpha(); } // TODO sigma_yz not taken into account yet, is not zero due to pad tilting! - GPUd() float getPredictedChi2(const My_Float p[2], const My_Float cov[3]) const { return PredictChi2(p[0], p[1], cov[0], cov[2]); } + GPUd() float getPredictedChi2(const float p[2], const float cov[3]) const { return PredictChi2(p[0], p[1], cov[0], cov[2]); } trackInterface* mTrack; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDINTERFACES_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDSpacePoint.h b/GPU/GPUTracking/TRDTracking/GPUTRDSpacePoint.h index 23e26d8354343..f7e89169cde24 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDSpacePoint.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDSpacePoint.h @@ -18,7 +18,7 @@ #ifndef GPUCA_TPC_GEOMETRY_O2 // compatibility to Run 2 data types -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -45,13 +45,13 @@ class GPUTRDSpacePoint }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #else // compatibility with Run 3 data types #include "DataFormatsTRD/CalibratedTracklet.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -63,7 +63,7 @@ class GPUTRDSpacePoint : public o2::trd::CalibratedTracklet static_assert(sizeof(GPUTRDSpacePoint) == sizeof(o2::trd::CalibratedTracklet), "Incorrect memory layout"); } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUCA_TPC_GEOMETRY_O2 diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx index 0f184036e73ea..c14e61071e2d8 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.cxx @@ -15,9 +15,6 @@ //#define ENABLE_GPUTRDDEBUG #define ENABLE_WARNING 0 #define ENABLE_INFO 0 -#ifdef GPUCA_ALIROOT_LIB -#define ENABLE_GPUMC -#endif #include "GPUTRDTracker.h" #include "GPUTRDTrackletWord.h" @@ -26,7 +23,7 @@ #include "GPUCommonMath.h" #include "GPUCommonAlgorithm.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; class GPUTPCGMPolynomialField; @@ -38,11 +35,6 @@ class GPUTPCGMPolynomialField; #endif // WITH_OPENMP #include #include -#ifdef GPUCA_ALIROOT_LIB -#include "TDatabasePDG.h" -#include "AliMCParticle.h" -#include "AliMCEvent.h" -#endif // GPUCA_ALIROOT_LIB #include "GPUChainTracking.h" @@ -125,12 +117,6 @@ void GPUTRDTracker_t::InitializeProcessor() // Initialise tracker //-------------------------------------------------------------------- -#ifdef GPUCA_ALIROOT_LIB - for (int32_t iCandidate = 0; iCandidate < mNCandidates * 2 * mMaxThreads; ++iCandidate) { - new (&mCandidates[iCandidate]) TRDTRK; - } -#endif - UpdateGeometry(); mDebug->ExpandVectors(); @@ -143,7 +129,7 @@ void GPUTRDTracker_t::UpdateGeometry() //-------------------------------------------------------------------- // Update Geometry of TRDTracker //-------------------------------------------------------------------- - mGeo = (TRD_GEOMETRY_CONST GPUTRDGeometry*)GetConstantMem()->calibObjects.trdGeometry; + mGeo = (const GPUTRDGeometry*)GetConstantMem()->calibObjects.trdGeometry; if (!mGeo) { GPUFatal("TRD geometry must be provided externally"); } @@ -186,8 +172,8 @@ void GPUTRDTracker_t::UpdateGeometry() // obtain average radius of TRD chambers float x0[kNLayers] = {300.2f, 312.8f, 325.4f, 338.0f, 350.6f, 363.2f}; // used as default value in case no transformation matrix can be obtained auto* matrix = mGeo->GetClusterMatrix(0); - My_Float loc[3] = {mGeo->AnodePos(), 0.f, 0.f}; - My_Float glb[3] = {0.f, 0.f, 0.f}; + float loc[3] = {mGeo->AnodePos(), 0.f, 0.f}; + float glb[3] = {0.f, 0.f, 0.f}; for (int32_t iDet = 0; iDet < kNChambers; ++iDet) { matrix = mGeo->GetClusterMatrix(iDet); if (!matrix) { @@ -304,11 +290,7 @@ GPUdi() const GPUTRDPropagatorGPU::propagatorParam* GPUTRDTracker_t GPUdi() const typename PROP::propagatorParam* GPUTRDTracker_t::getPropagatorParam() { -#if defined GPUCA_ALIROOT_LIB - return nullptr; -#else return GetConstantMem()->calibObjects.o2Propagator; -#endif } template @@ -338,11 +320,7 @@ GPUd() int32_t GPUTRDTracker_t::LoadTrack(const TRDTRK& trk, uint3 if (checkTrack && !CheckTrackTRDCandidate(trk)) { return 2; } -#ifdef GPUCA_ALIROOT_LIB - new (&mTracks[mNTracks]) TRDTRK(trk); // We need placement new, since the class is virtual -#else mTracks[mNTracks] = trk; -#endif mTracks[mNTracks].setRefGlobalTrackIdRaw(tpcTrackId); if (attribs) { mTrackAttribs[mNTracks] = *attribs; @@ -428,37 +406,6 @@ GPUd() void GPUTRDTracker_t::DoTrackingThread(int32_t iTrk, int32_ } } -#ifndef GPUCA_ALIROOT_LIB // AliRoot TRD geometry functions are non-const, and cannot work with a const geometry -template -GPUd() bool GPUTRDTracker_t::ConvertTrkltToSpacePoint(const GPUTRDGeometry& geo, GPUTRDTrackletWord& trklt, GPUTRDSpacePoint& sp) -{ - // converts a single GPUTRDTrackletWord into GPUTRDSpacePoint - // returns true if successfull - int32_t det = trklt.GetDetector(); - if (!geo.ChamberInGeometry(det)) { - return false; - } - auto* matrix = geo.GetClusterMatrix(det); - if (!matrix) { - return false; - } - const GPUTRDpadPlane* pp = geo.GetPadPlane(det); - int32_t trkltZbin = trklt.GetZbin(); - My_Float xTrkltDet[3] = {0.f}; // trklt position in chamber coordinates - My_Float xTrkltSec[3] = {0.f}; // trklt position in sector coordinates - xTrkltDet[0] = geo.AnodePos() - sRadialOffset; - xTrkltDet[1] = trklt.GetY(); - xTrkltDet[2] = pp->GetRowPos(trkltZbin) - pp->GetRowSize(trkltZbin) / 2.f - pp->GetRowPos(pp->GetNrows() / 2); - matrix->LocalToMaster(xTrkltDet, xTrkltSec); - sp.setX(xTrkltSec[0]); - sp.setY(xTrkltSec[1]); - sp.setZ(xTrkltSec[2]); - sp.setDy(trklt.GetdY()); - - return true; -} -#endif - template GPUd() bool GPUTRDTracker_t::CalculateSpacePoints(int32_t iCollision) { @@ -495,8 +442,8 @@ GPUd() bool GPUTRDTracker_t::CalculateSpacePoints(int32_t iCollisi int32_t trkltIdxStart = trkltIdxOffset + iFirstTrackletInDet; for (int32_t trkltIdx = trkltIdxStart; trkltIdx < trkltIdxStart + nTrackletsInDet; ++trkltIdx) { int32_t trkltZbin = tracklets[trkltIdx].GetZbin(); - My_Float xTrkltDet[3] = {0.f}; // trklt position in chamber coordinates - My_Float xTrkltSec[3] = {0.f}; // trklt position in sector coordinates + float xTrkltDet[3] = {0.f}; // trklt position in chamber coordinates + float xTrkltSec[3] = {0.f}; // trklt position in sector coordinates xTrkltDet[0] = mGeo->AnodePos() + sRadialOffset; xTrkltDet[1] = tracklets[trkltIdx].GetY(); xTrkltDet[2] = pp->GetRowPos(trkltZbin) - pp->GetRowSize(trkltZbin) / 2.f - pp->GetRowPos(pp->GetNrows() / 2); @@ -681,8 +628,8 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK zPosCorr -= zShiftTrk; // shift tracklet instead of track in order to avoid having to do a re-fit for each collision float deltaY = yPosCorr - projY; float deltaZ = zPosCorr - projZ; - My_Float trkltPosTmpYZ[2] = {yPosCorr, zPosCorr}; - My_Float trkltCovTmp[3] = {0.f}; + float trkltPosTmpYZ[2] = {yPosCorr, zPosCorr}; + float trkltCovTmp[3] = {0.f}; if ((CAMath::Abs(deltaY) < roadY) && (CAMath::Abs(deltaZ) < roadZ)) { // TODO: check if this is still necessary after the cut before propagation of track // tracklet is in windwow: get predicted chi2 for update and store tracklet index if best guess RecalcTrkltCov(tilt, trkWork->getSnp(), pad->GetRowSize(tracklets[trkltIdx].GetZbin()), trkltCovTmp); @@ -772,8 +719,8 @@ GPUd() bool GPUTRDTracker_t::FollowProlongation(PROP* prop, TRDTRK if (!((trkWork->getSigmaZ2() < (padLength * padLength / 12.f)) && (CAMath::Abs(spacePoints[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].getZ() - trkWork->getZ()) < padLength))) { tiltCorrUp = 0.f; } - My_Float trkltPosUp[2] = {spacePoints[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].getY() - tiltCorrUp, zPosCorrUp}; - My_Float trkltCovUp[3] = {0.f}; + float trkltPosUp[2] = {spacePoints[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].getY() - tiltCorrUp, zPosCorrUp}; + float trkltCovUp[3] = {0.f}; RecalcTrkltCov(tilt, trkWork->getSnp(), pad->GetRowSize(tracklets[mHypothesis[iUpdate + hypothesisIdxOffset].mTrackletId].GetZbin()), trkltCovUp); #ifdef ENABLE_GPUTRDDEBUG @@ -1015,7 +962,7 @@ GPUd() float GPUTRDTracker_t::GetAlphaOfSector(const int32_t sec) } template -GPUd() void GPUTRDTracker_t::RecalcTrkltCov(const float tilt, const float snp, const float rowSize, My_Float (&cov)[3]) +GPUd() void GPUTRDTracker_t::RecalcTrkltCov(const float tilt, const float snp, const float rowSize, float (&cov)[3]) { //-------------------------------------------------------------------- // recalculate tracklet covariance taking track phi angle into account @@ -1161,16 +1108,16 @@ GPUd() bool GPUTRDTracker_t::IsGeoFindable(const TRDTRK* t, const #ifndef GPUCA_GPUCODE -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { // instantiate version for AliExternalTrackParam / o2::TrackParCov data types -#if defined(GPUCA_ALIROOT_LIB) || defined(GPUCA_HAVE_O2HEADERS) +#if defined(GPUCA_HAVE_O2HEADERS) template class GPUTRDTracker_t; #endif // always instantiate version for GPU Track Model template class GPUTRDTracker_t; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h index d688e2957846d..59e753e239cf9 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTracker.h @@ -30,17 +30,11 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { -#ifdef GPUCA_ALIROOT_LIB -#define TRD_GEOMETRY_CONST -#else -#define TRD_GEOMETRY_CONST const -#endif - class GPUTRDTrackletWord; class GPUTRDGeometry; class GPUChainTracking; @@ -102,7 +96,7 @@ class GPUTRDTracker_t : public GPUProcessor int16_t MemoryPermanent() const { return mMemoryPermanent; } - GPUhd() void OverrideGPUGeometry(TRD_GEOMETRY_CONST GPUTRDGeometry* geo) { mGeo = geo; } + GPUhd() void OverrideGPUGeometry(const GPUTRDGeometry* geo) { mGeo = geo; } void Reset(); template GPUd() bool PreCheckTrackTRDCandidate(const T& trk) const @@ -126,7 +120,7 @@ class GPUTRDTracker_t : public GPUProcessor GPUd() float GetAngularResolution(float snp) const { return mDyA2 + mDyC2 * (snp - mDyB) * (snp - mDyB); } // a^2 + c^2 * (snp - b)^2 GPUd() float ConvertAngleToDy(float snp) const { return mAngleToDyA + mAngleToDyB * snp + mAngleToDyC * snp * snp; } // a + b*snp + c*snp^2 is more accurate than sin(phi) = (dy / xDrift) / sqrt(1+(dy/xDrift)^2) GPUd() float GetAngularPull(float dYtracklet, float snp) const; - GPUd() void RecalcTrkltCov(const float tilt, const float snp, const float rowSize, My_Float (&cov)[3]); + GPUd() void RecalcTrkltCov(const float tilt, const float snp, const float rowSize, float (&cov)[3]); GPUd() void FindChambersInRoad(const TRDTRK* t, const float roadY, const float roadZ, const int32_t iLayer, int32_t* det, const float zMax, const float alpha, const float zShiftTrk) const; GPUd() bool IsGeoFindable(const TRDTRK* t, const int32_t layer, const float alpha, const float zShiftTrk) const; GPUd() void InsertHypothesis(Hypothesis hypo, int32_t& nCurrHypothesis, int32_t idxOffset); @@ -181,7 +175,7 @@ class GPUTRDTracker_t : public GPUProcessor Hypothesis* mHypothesis; // array with multiple track hypothesis TRDTRK* mCandidates; // array of tracks for multiple hypothesis tracking GPUTRDSpacePoint* mSpacePoints; // array with tracklet coordinates in global tracking frame - TRD_GEOMETRY_CONST GPUTRDGeometry* mGeo; // TRD geometry + const GPUTRDGeometry* mGeo; // TRD geometry /// ---- error parametrization depending on magnetic field ---- float mRPhiA2; // parameterization for tracklet position resolution float mRPhiB; // parameterization for tracklet position resolution @@ -203,6 +197,6 @@ class GPUTRDTracker_t : public GPUProcessor GPUTRDTrackerDebug* mDebug; // debug output }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDTRACKER_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.cxx deleted file mode 100644 index c6a60afc9b4bd..0000000000000 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.cxx +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTRDTrackerComponent.cxx -/// \brief A TRD tracker processing component for the GPU - -/// \author Ole Schmidt - -#include "TSystem.h" -#include "TTimeStamp.h" -#include "TObjString.h" -#include "TClonesArray.h" -#include "TObjArray.h" -#include "AliESDEvent.h" -#include "AliHLTErrorGuard.h" -#include "AliHLTDataTypes.h" -#include "GPUTRDGeometry.h" -#include "GPUTRDTracker.h" -#include "GPUTRDTrack.h" -#include "GPUTRDTrackerComponent.h" -#include "GPUTRDSpacePoint.h" -#include "GPUTRDTrackletWord.h" -#include "GPUTRDTrackletLabels.h" -#include "AliHLTTRDDefinitions.h" -#include "AliHLTTPCDefinitions.h" -#include "GPUTRDTrackPoint.h" -#include "AliHLTGlobalBarrelTrack.h" -#include "AliExternalTrackParam.h" -#include "AliHLTExternalTrackParam.h" -#include "AliHLTTrackMCLabel.h" -#include "GPUTRDTrackData.h" -#include "AliGeomManager.h" -#include "GPUReconstruction.h" -#include "GPUChainTracking.h" -#include "GPUSettings.h" -#include -#include -#include - -using namespace GPUCA_NAMESPACE::gpu; - -ClassImp(GPUTRDTrackerComponent); - -GPUTRDTrackerComponent::GPUTRDTrackerComponent() - : fTracker(0x0), fGeo(0x0), fTrackList(0x0), fDebugTrackOutput(false), fVerboseDebugOutput(false), fRequireITStrack(false), fBenchmark("TRDTracker") -{ -} - -GPUTRDTrackerComponent::GPUTRDTrackerComponent(const GPUTRDTrackerComponent&) : fTracker(0x0), fGeo(0x0), fRec(0x0), fChain(0x0), fTrackList(0x0), AliHLTProcessor(), fDebugTrackOutput(false), fVerboseDebugOutput(false), fRequireITStrack(false), fBenchmark("TRDTracker") -{ - // see header file for class documentation - HLTFatal("copy constructor untested"); -} - -GPUTRDTrackerComponent& GPUTRDTrackerComponent::operator=(const GPUTRDTrackerComponent&) -{ - // see header file for class documentation - HLTFatal("assignment operator untested"); - return *this; -} - -GPUTRDTrackerComponent::~GPUTRDTrackerComponent() { delete fTracker; } - -const char* GPUTRDTrackerComponent::GetComponentID() { return "TRDTracker"; } - -void GPUTRDTrackerComponent::GetInputDataTypes(std::vector& list) -{ - list.clear(); - list.push_back(kAliHLTDataTypeTrack | kAliHLTDataOriginITS); - // list.push_back( kAliHLTDataTypeTrack|kAliHLTDataOriginTPC ); - list.push_back(AliHLTTPCDefinitions::TracksOuterDataType() | kAliHLTDataOriginTPC); - list.push_back(kAliHLTDataTypeTrackMC | kAliHLTDataOriginTPC); - list.push_back(AliHLTTRDDefinitions::fgkTRDTrackletDataType); - list.push_back(AliHLTTRDDefinitions::fgkTRDMCTrackletDataType); -} - -AliHLTComponentDataType GPUTRDTrackerComponent::GetOutputDataType() { return kAliHLTMultipleDataType; } - -int32_t GPUTRDTrackerComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) -{ - // see header file for class documentation - tgtList.clear(); - tgtList.push_back(AliHLTTRDDefinitions::fgkTRDTrackDataType | kAliHLTDataOriginTRD); - tgtList.push_back(AliHLTTRDDefinitions::fgkTRDTrackPointDataType | kAliHLTDataOriginTRD); - tgtList.push_back(kAliHLTDataTypeTObject | kAliHLTDataOriginTRD); - return tgtList.size(); -} - -void GPUTRDTrackerComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - // define guess for the output data size - constBase = 1000; // minimum size - inputMultiplier = 2.; // size relative to input -} - -AliHLTComponent* GPUTRDTrackerComponent::Spawn() -{ - // see header file for class documentation - return new GPUTRDTrackerComponent; -} - -int32_t GPUTRDTrackerComponent::ReadConfigurationString(const char* arguments) -{ - // Set configuration parameters for the TRD tracker component from the string - - int32_t iResult = 0; - if (!arguments) { - return iResult; - } - - TString allArgs = arguments; - TString argument; - - TObjArray* pTokens = allArgs.Tokenize(" "); - - int32_t nArgs = pTokens ? pTokens->GetEntries() : 0; - - for (int32_t i = 0; i < nArgs; i++) { - argument = ((TObjString*)pTokens->At(i))->GetString(); - if (argument.IsNull()) { - continue; - } - - if (argument.CompareTo("-debugOutput") == 0) { - fDebugTrackOutput = true; - fVerboseDebugOutput = true; - HLTInfo("Tracks are dumped in the GPUTRDTrackGPU format"); - continue; - } - - if (argument.CompareTo("-requireITStrack") == 0) { - fRequireITStrack = true; - HLTInfo("TRD tracker requires seeds (TPC tracks) to have an ITS match"); - continue; - } - - HLTError("Unknown option \"%s\"", argument.Data()); - iResult = -EINVAL; - } - delete pTokens; - - return iResult; -} - -// ################################################################################# -int32_t GPUTRDTrackerComponent::DoInit(int argc, const char** argv) -{ - // see header file for class documentation - - int32_t iResult = 0; - if (fTracker) { - return -EINPROGRESS; - } - - fBenchmark.Reset(); - fBenchmark.SetTimer(0, "total"); - fBenchmark.SetTimer(1, "reco"); - - if (AliGeomManager::GetGeometry() == nullptr) { - AliGeomManager::LoadGeometry(); - } - - fTrackList = new TList(); - if (!fTrackList) { - return -ENOMEM; - } - fTrackList->SetOwner(kFALSE); - - TString arguments = ""; - for (int32_t i = 0; i < argc; i++) { - if (!arguments.IsNull()) { - arguments += " "; - } - arguments += argv[i]; - } - - iResult = ReadConfigurationString(arguments.Data()); - - GPUSettingsGRP cfgGRP; - cfgGRP.solenoidBzNominalGPU = GetBz(); - GPUSettingsRec cfgRec; - GPUSettingsProcessing cfgDeviceProcessing; - GPURecoStepConfiguration cfgRecoStep; - cfgRecoStep.steps = GPUDataTypes::RecoStep::NoRecoStep; - cfgRecoStep.inputs.clear(); - cfgRecoStep.outputs.clear(); - fRec = GPUReconstruction::CreateInstance("CPU", true); - fRec->SetSettings(&cfgGRP, &cfgRec, &cfgDeviceProcessing, &cfgRecoStep); - fChain = fRec->AddChain(); - - fGeo = new GPUTRDGeometry(); - if (!fGeo) { - return -ENOMEM; - } - if (!GPUTRDGeometry::CheckGeometryAvailable()) { - HLTError("TRD geometry not available"); - return -EINVAL; - } - fTracker = new GPUTRDTrackerGPU(); - if (!fTracker) { - return -ENOMEM; - } - if (fVerboseDebugOutput) { - fTracker->EnableDebugOutput(); - } - fRec->RegisterGPUProcessor(fTracker, false); - fChain->SetTRDGeometry(reinterpret_cast(fGeo)); - if (fRec->Init()) { - return -EINVAL; - } - - return iResult; -} - -// ################################################################################# -int32_t GPUTRDTrackerComponent::DoDeinit() -{ - // see header file for class documentation - delete fTracker; - fTracker = 0x0; - delete fGeo; - fGeo = 0x0; - return 0; -} - -// ################################################################################# -int32_t GPUTRDTrackerComponent::DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& /*trigData*/, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, std::vector& outputBlocks) -{ - // process event - - if (!IsDataEvent()) { - return 0; - } - - if (evtData.fBlockCnt <= 0) { - HLTWarning("no blocks in event"); - return 0; - } - - fBenchmark.StartNewEvent(); - fBenchmark.Start(0); - - AliHLTUInt32_t maxBufferSize = size; - size = 0; // output size - - int32_t iResult = 0; - - if (fTrackList->GetEntries() != 0) { - fTrackList->Clear(); // tracks are owned by GPUTRDTrackerGPU - } - - int32_t nBlocks = evtData.fBlockCnt; - - const AliHLTTracksData* tpcData = nullptr; - const AliHLTTracksData* itsData = nullptr; - const AliHLTTrackMCData* tpcDataMC = nullptr; - - std::vector tracksTPC; - std::vector tracksTPCId; - - bool hasMCtracklets = false; - - int32_t nTrackletsTotal = 0; - int32_t nTrackletsTotalMC = 0; - const GPUTRDTrackletWord* tracklets = nullptr; - const GPUTRDTrackletLabels* trackletsMC = nullptr; - - for (int32_t iBlock = 0; iBlock < nBlocks; iBlock++) { - if (blocks[iBlock].fDataType == (kAliHLTDataTypeTrack | kAliHLTDataOriginITS) && fRequireITStrack) { - itsData = (const AliHLTTracksData*)blocks[iBlock].fPtr; - fBenchmark.AddInput(blocks[iBlock].fSize); - } else if (blocks[iBlock].fDataType == (AliHLTTPCDefinitions::TracksOuterDataType() | kAliHLTDataOriginTPC)) { - tpcData = (const AliHLTTracksData*)blocks[iBlock].fPtr; - fBenchmark.AddInput(blocks[iBlock].fSize); - } else if (blocks[iBlock].fDataType == (kAliHLTDataTypeTrackMC | kAliHLTDataOriginTPC)) { - tpcDataMC = (const AliHLTTrackMCData*)blocks[iBlock].fPtr; - fBenchmark.AddInput(blocks[iBlock].fSize); - } else if (blocks[iBlock].fDataType == (AliHLTTRDDefinitions::fgkTRDTrackletDataType)) { - tracklets = reinterpret_cast(blocks[iBlock].fPtr); - nTrackletsTotal = blocks[iBlock].fSize / sizeof(GPUTRDTrackletWord); - fBenchmark.AddInput(blocks[iBlock].fSize); - } else if (blocks[iBlock].fDataType == (AliHLTTRDDefinitions::fgkTRDMCTrackletDataType)) { - hasMCtracklets = true; - trackletsMC = reinterpret_cast(blocks[iBlock].fPtr); - nTrackletsTotalMC = blocks[iBlock].fSize / sizeof(GPUTRDTrackletLabels); - fBenchmark.AddInput(blocks[iBlock].fSize); - } - } - - if (tpcData == nullptr) { - HLTInfo("did not receive any TPC tracks. Skipping event"); - return 0; - } - - if (nTrackletsTotal == 0) { - HLTInfo("did not receive any TRD tracklets. Skipping event"); - return 0; - } - - if (hasMCtracklets && nTrackletsTotal != nTrackletsTotalMC) { - HLTError("the numbers of input tracklets does not match the number of input MC labels for them"); - return -EINVAL; - } - - // copy tracklets into temporary vector to allow for sorting them (the input array is const) - std::vector trackletsTmp(nTrackletsTotal); - for (int32_t iTrklt = 0; iTrklt < nTrackletsTotal; ++iTrklt) { - trackletsTmp[iTrklt] = tracklets[iTrklt]; - } - - int32_t nTPCtracks = tpcData->fCount; - std::vector itsAvail(nTPCtracks, false); - if (itsData) { - // look for ITS tracks with >= 2 hits - int32_t nITStracks = itsData->fCount; - const AliHLTExternalTrackParam* currITStrack = itsData->fTracklets; - for (int32_t iTrkITS = 0; iTrkITS < nITStracks; iTrkITS++) { - if (currITStrack->fNPoints >= 2) { - itsAvail.at(currITStrack->fTrackID) = true; - } - uint32_t dSize = sizeof(AliHLTExternalTrackParam) + currITStrack->fNPoints * sizeof(uint32_t); - currITStrack = (AliHLTExternalTrackParam*)(((Byte_t*)currITStrack) + dSize); - } - } - std::map mcLabels; - if (tpcDataMC) { - // look for TPC track MC labels - int32_t nMCtracks = tpcDataMC->fCount; - for (int32_t iMC = 0; iMC < nMCtracks; iMC++) { - const AliHLTTrackMCLabel& lab = tpcDataMC->fLabels[iMC]; - mcLabels[lab.fTrackID] = lab.fMCLabel; - } - } - const AliHLTExternalTrackParam* currOutTrackTPC = tpcData->fTracklets; - for (int32_t iTrk = 0; iTrk < nTPCtracks; iTrk++) { - // store TPC tracks (if required only the ones with >=2 ITS hits) - if (itsData != nullptr && !itsAvail.at(currOutTrackTPC->fTrackID)) { - continue; - } - GPUTRDTrackGPU t(*currOutTrackTPC); - int32_t mcLabel = -1; - if (tpcDataMC) { - if (mcLabels.find(currOutTrackTPC->fTrackID) != mcLabels.end()) { - mcLabel = mcLabels[currOutTrackTPC->fTrackID]; - } - } - tracksTPC.push_back(t); - tracksTPCId.push_back(currOutTrackTPC->fTrackID); - uint32_t dSize = sizeof(AliHLTExternalTrackParam) + currOutTrackTPC->fNPoints * sizeof(uint32_t); - currOutTrackTPC = (AliHLTExternalTrackParam*)+(((Byte_t*)currOutTrackTPC) + dSize); - } - - if (fVerboseDebugOutput) { - HLTInfo("TRDTrackerComponent received %i tracklets\n", nTrackletsTotal); - } - - fTracker->SetGenerateSpacePoints(true); - fTracker->Reset(); - fChain->mIOPtrs.nMergedTracks = tracksTPC.size(); - fChain->mIOPtrs.nTRDTracklets = nTrackletsTotal; - fChain->mIOPtrs.nTRDTriggerRecords = 1; - uint8_t trigRecMaskDummy[1] = {1}; - fChain->mIOPtrs.trdTrigRecMask = &(trigRecMaskDummy[0]); - fRec->PrepareEvent(); - fRec->SetupGPUProcessor(fTracker, true); - - std::sort(trackletsTmp.begin(), trackletsTmp.end()); - fChain->mIOPtrs.trdTracklets = &(trackletsTmp[0]); - - // loop over all tracks - for (uint32_t iTrack = 0; iTrack < tracksTPC.size(); ++iTrack) { - fTracker->LoadTrack(tracksTPC[iTrack], tracksTPCId[iTrack]); - } - - fBenchmark.Start(1); - fChain->DoTRDGPUTracking<1>(fTracker); - fBenchmark.Stop(1); - - GPUTRDTrackGPU* trackArray = fTracker->Tracks(); - int32_t nTracks = fTracker->NTracks(); - GPUTRDSpacePoint* spacePoints = fTracker->SpacePoints(); - - // TODO delete fTrackList since it only works for TObjects (or use compiler flag after tests with GPU track type) - // for (int32_t iTrack=0; iTrackAddLast(&trackArray[iTrack]); - //} - - // push back GPUTRDTracks for debugging purposes - if (fDebugTrackOutput) { - PushBack(fTrackList, (kAliHLTDataTypeTObject | kAliHLTDataOriginTRD), 0x3fffff); - } - // push back AliHLTExternalTrackParam (default) - else { - - AliHLTUInt32_t blockSize = GPUTRDTrackData::GetSize(nTracks); - if (size + blockSize > maxBufferSize) { - HLTWarning("Output buffer exceeded for tracks"); - return -ENOSPC; - } - - GPUTRDTrackData* outTracks = (GPUTRDTrackData*)(outputPtr); - outTracks->fCount = 0; - int32_t assignedTracklets = 0; - - for (int32_t iTrk = 0; iTrk < nTracks; ++iTrk) { - GPUTRDTrackGPU& t = trackArray[iTrk]; - if (t.getNtracklets() == 0) { - continue; - } - assignedTracklets += t.getNtracklets(); - GPUTRDTrackDataRecord& currOutTrack = outTracks->fTracks[outTracks->fCount]; - t.ConvertTo(currOutTrack); - outTracks->fCount++; - } - - AliHLTComponentBlockData resultData; - FillBlockData(resultData); - resultData.fOffset = size; - resultData.fSize = blockSize; - resultData.fDataType = AliHLTTRDDefinitions::fgkTRDTrackDataType; - outputBlocks.push_back(resultData); - fBenchmark.AddOutput(resultData.fSize); - - size += blockSize; - outputPtr += resultData.fSize; - - blockSize = 0; - - // space points calculated from tracklets - - blockSize = sizeof(GPUTRDTrackPointData) + sizeof(GPUTRDTrackPoint) * nTrackletsTotal; - - if (size + blockSize > maxBufferSize) { - HLTWarning("Output buffer exceeded for space points"); - return -ENOSPC; - } - - GPUTRDTrackPointData* outTrackPoints = (GPUTRDTrackPointData*)(outputPtr); - outTrackPoints->fCount = nTrackletsTotal; - - { // fill array with 0 for a case.. - GPUTRDTrackPoint empty; - empty.fX[0] = 0; - empty.fX[1] = 0; - empty.fX[2] = 0; - empty.fVolumeId = 0; - for (int32_t i = 0; i < nTrackletsTotal; ++i) { - outTrackPoints->fPoints[i] = empty; - } - } - - for (int32_t i = 0; i < nTrackletsTotal; ++i) { - const GPUTRDSpacePoint& sp = spacePoints[i]; - GPUTRDTrackPoint* currOutPoint = &outTrackPoints->fPoints[i]; - currOutPoint->fX[0] = sp.getX(); // x in sector coordinates - currOutPoint->fX[1] = sp.getY(); // y in sector coordinates - currOutPoint->fX[2] = sp.getZ(); // z in sector coordinates - int32_t detId = trackletsTmp[i].GetDetector(); - int32_t layer = detId % 6; // TRD layer number for given detector - int32_t modId = (detId / 18) * 5 + ((detId % 30) / 6); // global TRD stack number [0..89] - int32_t volId = (UShort_t(9 + layer) << 11) | UShort_t(modId); // taken from AliGeomManager::LayerToVolUID(). AliGeomManager::ELayerID(AliGeomManager::kTRD1) == 9 - currOutPoint->fVolumeId = volId; - } - AliHLTComponentBlockData resultDataSP; - FillBlockData(resultDataSP); - resultDataSP.fOffset = size; - resultDataSP.fSize = blockSize; - resultDataSP.fDataType = AliHLTTRDDefinitions::fgkTRDTrackPointDataType | kAliHLTDataOriginTRD; - outputBlocks.push_back(resultDataSP); - fBenchmark.AddOutput(resultData.fSize); - size += blockSize; - outputPtr += resultDataSP.fSize; - - HLTInfo("TRD tracker: output %d tracks (%d assigned tracklets) and %d track points", outTracks->fCount, assignedTracklets, outTrackPoints->fCount); - } - - fBenchmark.Stop(0); - HLTInfo(fBenchmark.GetStatistics()); - - return iResult; -} - -// ################################################################################# -int32_t GPUTRDTrackerComponent::Reconfigure(const char* cdbEntry, const char* chainId) -{ - // see header file for class documentation - - int32_t iResult = 0; - TString cdbPath; - if (cdbEntry) { - cdbPath = cdbEntry; - } else { - cdbPath = "HLT/ConfigGlobal/"; - cdbPath += GetComponentID(); - } - - AliInfoClass(Form("reconfigure '%s' from entry %s%s", chainId, cdbPath.Data(), cdbEntry ? "" : " (default)")); - iResult = ConfigureFromCDBTObjString(cdbPath); - - return iResult; -} diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.h deleted file mode 100644 index e6d4ef609e101..0000000000000 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerComponent.h +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTRDTrackerComponent.h -/// \brief A TRD tracker processing component for the GPU - -/// \author Ole Schmidt - -#ifndef GPUTRDTRACKERCOMPONENT_H -#define GPUTRDTRACKERCOMPONENT_H - -#ifndef GPUCA_ALIROOT_LIB -#define GPUCA_ALIROOT_LIB -#endif - -#include "AliHLTProcessor.h" -#include "AliHLTComponentBenchmark.h" -#include "AliHLTDataTypes.h" - -class TH1F; -class TList; - -#include "GPUTRDDef.h" -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ -class GPUTRDGeometry; -class GPUReconstruction; -class GPUChainTracking; -} // namespace gpu -} // namespace GPUCA_NAMESPACE - -class GPUTRDTrackerComponent : public AliHLTProcessor -{ - public: - /* - * --------------------------------------------------------------------------------- - * Constructor / Destructor - * --------------------------------------------------------------------------------- - */ - - /** constructor */ - GPUTRDTrackerComponent(); - - /** dummy copy constructor, defined according to effective C++ style */ - GPUTRDTrackerComponent(const GPUTRDTrackerComponent&); - - /** dummy assignment op, but defined according to effective C++ style */ - GPUTRDTrackerComponent& operator=(const GPUTRDTrackerComponent&); - - /** destructor */ - virtual ~GPUTRDTrackerComponent(); - - /* - * --------------------------------------------------------------------------------- - * Public functions to implement AliHLTComponent's interface. - * These functions are required for the registration process - * --------------------------------------------------------------------------------- - */ - - /** interface function, see @ref AliHLTComponent for description */ - const char* GetComponentID(); - - /** interface function, see @ref AliHLTComponent for description */ - void GetInputDataTypes(vector& list); - - /** interface function, see @ref AliHLTComponent for description */ - AliHLTComponentDataType GetOutputDataType(); - - /** @see component interface @ref AliHLTComponent::GetOutputDataType */ - int32_t GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList); - - /** interface function, see @ref AliHLTComponent for description */ - void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - - /** interface function, see @ref AliHLTComponent for description */ - AliHLTComponent* Spawn(); - - int32_t ReadConfigurationString(const char* arguments); - - protected: - /* - * --------------------------------------------------------------------------------- - * Protected functions to implement AliHLTComponent's interface. - * These functions provide initialization as well as the actual processing - * capabilities of the component. - * --------------------------------------------------------------------------------- - */ - - // AliHLTComponent interface functions - - /** interface function, see @ref AliHLTComponent for description */ - int32_t DoInit(int argc, const char** argv); - - /** interface function, see @ref AliHLTComponent for description */ - int32_t DoDeinit(); - - /** interface function, see @ref AliHLTComponent for description */ - int32_t DoEvent(const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, AliHLTUInt32_t& size, vector& outputBlocks); - - /** interface function, see @ref AliHLTComponent for description */ - int32_t Reconfigure(const char* cdbEntry, const char* chainId); - - /////////////////////////////////////////////////////////////////////////////////// - - private: - /* - * --------------------------------------------------------------------------------- - * Private functions to implement AliHLTComponent's interface. - * These functions provide initialization as well as the actual processing - * capabilities of the component. - * --------------------------------------------------------------------------------- - */ - - /* - * --------------------------------------------------------------------------------- - * Helper - * --------------------------------------------------------------------------------- - */ - - /* - * --------------------------------------------------------------------------------- - * Members - private - * --------------------------------------------------------------------------------- - */ - GPUCA_NAMESPACE::gpu::GPUTRDTrackerGPU* fTracker; // the tracker itself - GPUCA_NAMESPACE::gpu::GPUTRDGeometry* fGeo; // TRD geometry needed by the tracker - GPUCA_NAMESPACE::gpu::GPUReconstruction* fRec; // GPU Reconstruction object - GPUCA_NAMESPACE::gpu::GPUChainTracking* fChain; // Tracking Chain Object - - TList* fTrackList; - bool fDebugTrackOutput; // output GPUTRDTracks instead AliHLTExternalTrackParam - bool fVerboseDebugOutput; // more verbose information is printed - bool fRequireITStrack; // only TPC tracks with ITS match are used as seeds for tracking - AliHLTComponentBenchmark fBenchmark; // benchmark - - ClassDef(GPUTRDTrackerComponent, 0); -}; -#endif // GPUTRDTRACKERCOMPONENT_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerDebug.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerDebug.h index ed590ff7b89ad..45b083a4cca66 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerDebug.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerDebug.h @@ -17,299 +17,13 @@ #ifndef GPUTRDTRACKERDEBUG_H #define GPUTRDTRACKERDEBUG_H -#if defined(ENABLE_GPUTRDDEBUG) && defined(GPUCA_ALIROOT_LIB) +#if defined(ENABLE_GPUTRDDEBUG) && 0 -#include "TVectorF.h" -#include "TTreeStream.h" -#include "GPULogging.h" -#include "GPUTRDTrack.h" - -namespace GPUCA_NAMESPACE -{ -namespace gpu -{ - -template -class GPUTRDTrackerDebug -{ - public: - GPUTRDTrackerDebug() : fStreamer(0x0) {} - ~GPUTRDTrackerDebug() { delete fStreamer; } - - void CreateStreamer() - { - GPUInfo("Creating streamer for debugging"); - fStreamer = new TTreeSRedirector("TRDhlt.root", "recreate"); - } - - int32_t GetSector(float alpha) - { - if (alpha < 0) { - alpha += 2.f * M_PI; - } - return (int32_t)(alpha * 18 / (2.f * M_PI)); - } - - void ExpandVectors() - { - fTrackX.ResizeTo(6); - fTrackY.ResizeTo(6); - fTrackZ.ResizeTo(6); - fTrackPhi.ResizeTo(6); - fTrackLambda.ResizeTo(6); - fTrackPt.ResizeTo(6); - fTrackQPt.ResizeTo(6); - fTrackSector.ResizeTo(6); - fTrackYerr.ResizeTo(6); - fTrackZerr.ResizeTo(6); - fTrackNoUpX.ResizeTo(6); - fTrackNoUpY.ResizeTo(6); - fTrackNoUpZ.ResizeTo(6); - fTrackNoUpPhi.ResizeTo(6); - fTrackNoUpLambda.ResizeTo(6); - fTrackNoUpPt.ResizeTo(6); - fTrackNoUpSector.ResizeTo(6); - fTrackNoUpYerr.ResizeTo(6); - fTrackNoUpZerr.ResizeTo(6); - fTrackletX.ResizeTo(6); - fTrackletY.ResizeTo(6); - fTrackletZ.ResizeTo(6); - ; - fTrackletYcorr.ResizeTo(6); - fTrackletZcorr.ResizeTo(6); - fTrackletY2err.ResizeTo(6); - fTrackletYZerr.ResizeTo(6); - fTrackletZ2err.ResizeTo(6); - fTrackletDy.ResizeTo(6); - fTrackletDet.ResizeTo(6); - fRoadY.ResizeTo(6); - fRoadZ.ResizeTo(6); - fChi2Update.ResizeTo(6); - fFindable.ResizeTo(6); - } - - void Reset() - { - fTrackX.Zero(); - fTrackY.Zero(); - fTrackZ.Zero(); - fTrackPhi.Zero(); - fTrackLambda.Zero(); - fTrackPt.Zero(); - fTrackQPt.Zero(); - fTrackSector.Zero(); - fTrackYerr.Zero(); - fTrackZerr.Zero(); - fTrackNoUpX.Zero(); - fTrackNoUpY.Zero(); - fTrackNoUpZ.Zero(); - fTrackNoUpPhi.Zero(); - fTrackNoUpLambda.Zero(); - fTrackNoUpPt.Zero(); - fTrackNoUpSector.Zero(); - fTrackNoUpYerr.Zero(); - fTrackNoUpZerr.Zero(); - fTrackletX.Zero(); - fTrackletY.Zero(); - fTrackletZ.Zero(); - ; - fTrackletYcorr.Zero(); - fTrackletZcorr.Zero(); - fTrackletY2err.Zero(); - fTrackletYZerr.Zero(); - fTrackletZ2err.Zero(); - fTrackletDy.Zero(); - fTrackletDet.Zero(); - fRoadY.Zero(); - fRoadZ.Zero(); - fChi2Update.Zero(); - fFindable.Zero(); - fEv = 0; - fNTPCtracks = 0; - fTrk = 0; - fPtTPC = 0.f; - fNtrklts = 0; - fNlayers = 0; - fChi2 = 0.f; - } - - // general information - void SetGeneralInfo(int32_t iEv, int32_t nTPCtracks, int32_t iTrk, float pt) - { - fEv = iEv; - fNTPCtracks = nTPCtracks; - fTrk = iTrk; - fPtTPC = pt; - } - - // track parameters - void SetTrackParameter(const T& trk, int32_t ly) - { - fTrackX(ly) = trk.getX(); - fTrackY(ly) = trk.getY(); - fTrackZ(ly) = trk.getZ(); - fTrackPhi(ly) = trk.getSnp(); - fTrackLambda(ly) = trk.getTgl(); - fTrackPt(ly) = trk.getPt(); - fTrackQPt(ly) = trk.getQ2Pt(); - fTrackSector(ly) = GetSector(trk.getAlpha()); - fTrackYerr(ly) = trk.getSigmaY2(); - fTrackZerr(ly) = trk.getSigmaZ2(); - } - void SetTrackParameterNoUp(const T& trk, int32_t ly) - { - fTrackNoUpX(ly) = trk.getX(); - fTrackNoUpY(ly) = trk.getY(); - fTrackNoUpZ(ly) = trk.getZ(); - fTrackNoUpPhi(ly) = trk.getSnp(); - fTrackNoUpLambda(ly) = trk.getTgl(); - fTrackNoUpPt(ly) = trk.getPt(); - fTrackNoUpSector(ly) = GetSector(trk.getAlpha()); - fTrackNoUpYerr(ly) = trk.getSigmaY2(); - fTrackNoUpZerr(ly) = trk.getSigmaZ2(); - } - void SetTrack(const T& trk) - { - fChi2 = trk.getChi2(); - fNlayers = trk.getNlayers(); - fNtrklts = trk.getNtracklets(); - for (int32_t iLy = 0; iLy < 6; iLy++) { - if (trk.getIsFindable(iLy)) { - fFindable(iLy) = 1; - } - } - } - - // tracklet parameters - void SetRawTrackletPosition(const float fX, const float fY, const float fZ, int32_t ly) - { - fTrackletX(ly) = fX; - fTrackletY(ly) = fY; - fTrackletZ(ly) = fZ; - } - void SetCorrectedTrackletPosition(const My_Float* fYZ, int32_t ly) - { - fTrackletYcorr(ly) = fYZ[0]; - fTrackletZcorr(ly) = fYZ[1]; - } - void SetTrackletCovariance(const My_Float* fCov, int32_t ly) - { - fTrackletY2err(ly) = fCov[0]; - fTrackletYZerr(ly) = fCov[1]; - fTrackletZ2err(ly) = fCov[2]; - } - void SetTrackletProperties(const float dy, const int32_t det, int32_t ly) - { - fTrackletDy(ly) = dy; - fTrackletDet(ly) = det; - } - - // update information - void SetChi2Update(float chi2, int32_t ly) { fChi2Update(ly) = chi2; } - - // other infos - void SetRoad(float roadY, float roadZ, int32_t ly) - { - fRoadY(ly) = roadY; - fRoadZ(ly) = roadZ; - } - - void Output() - { - (*fStreamer) << "tracksFinal" - << "event=" << fEv << // event number - "nTPCtracks=" << fNTPCtracks << // total number of TPC tracks for this event - "iTrack=" << fTrk << // track index in event - "trackPtTPC=" << fPtTPC << // track pT before any propagation - "trackX.=" << &fTrackX << // x-pos of track (layerwise) - "trackY.=" << &fTrackY << // y-pos of track (layerwise) - "trackZ.=" << &fTrackZ << // z-pos of track (layerwise) - "trackPhi.=" << &fTrackPhi << // phi angle of track (track.fP[2]) - "trackLambda.=" << &fTrackLambda << // lambda angle of track (track.fP[3]) - "trackQPt.=" << &fTrackQPt << // track q/pT (track.fP[4]) - "trackPt.=" << &fTrackPt << // track pT (layerwise) - "trackYerr.=" << &fTrackYerr << // sigma_y^2 for track - "trackZerr.=" << &fTrackZerr << // sigma_z^2 for track - "trackSec.=" << &fTrackSector << // TRD sector of track - "trackNoUpX.=" << &fTrackNoUpX << // x-pos of track w/o updates (layerwise) - "trackNoUpY.=" << &fTrackNoUpY << // y-pos of track w/o updates (layerwise) - "trackNoUpZ.=" << &fTrackNoUpZ << // z-pos of track w/o updates (layerwise) - "trackNoUpPhi.=" << &fTrackNoUpPhi << // phi angle of track w/o updates (track.fP[2]) - "trackNoUpLambda.=" << &fTrackNoUpLambda << // lambda angle of track w/o updates (track.fP[3]) - "trackNoUpPt.=" << &fTrackNoUpPt << // track pT w/o updates (layerwise) - "trackNoUpYerr.=" << &fTrackNoUpYerr << // sigma_y^2 for track w/o updates - "trackNoUpZerr.=" << &fTrackNoUpZerr << // sigma_z^2 for track w/o updates - "trackNoUpSec.=" << &fTrackNoUpSector << // TRD sector of track w/o updates - "trackletX.=" << &fTrackletX << // x position of tracklet used for update (sector coords) - "trackletY.=" << &fTrackletYcorr << // y position of tracklet used for update (sector coords, tilt corrected position) - "trackletZ.=" << &fTrackletZcorr << // z position of tracklet used for update (sector coords, tilt corrected position) - "trackletYRaw.=" << &fTrackletY << // y position of tracklet used for update (sector coords) - "trackletZRaw.=" << &fTrackletZ << // z position of tracklet used for update (sector coords) - "trackletYerr.=" << &fTrackletY2err << // sigma_y^2 for tracklet - "trackletYZerr.=" << &fTrackletYZerr << // sigma_yz for tracklet - "trackletZerr.=" << &fTrackletZ2err << // sigma_z^2 for tracklet - "trackletDy.=" << &fTrackletDy << // deflection for tracklet - "trackletDet.=" << &fTrackletDet << // TRD chamber of tracklet - "chi2Update.=" << &fChi2Update << // chi2 for update - "chi2Total=" << fChi2 << // total chi2 for track - "nLayers=" << fNlayers << // number of layers in which track was findable - "nTracklets=" << fNtrklts << // number of attached tracklets - "roadY.=" << &fRoadY << // search road width in Y - "roadZ.=" << &fRoadZ << // search road width in Z - "findable.=" << &fFindable << // whether or not track was in active TRD volume (layerwise) - "\n"; - } - - private: - int32_t fEv; - int32_t fNTPCtracks; - int32_t fTrk; - float fPtTPC; - int32_t fNlayers; - float fChi2; - TVectorF fTrackX; - TVectorF fTrackY; - TVectorF fTrackZ; - TVectorF fTrackPhi; - TVectorF fTrackLambda; - TVectorF fTrackPt; - TVectorF fTrackQPt; - TVectorF fTrackSector; - TVectorF fTrackYerr; - TVectorF fTrackZerr; - TVectorF fTrackNoUpX; - TVectorF fTrackNoUpY; - TVectorF fTrackNoUpZ; - TVectorF fTrackNoUpPhi; - TVectorF fTrackNoUpLambda; - TVectorF fTrackNoUpPt; - TVectorF fTrackNoUpSector; - TVectorF fTrackNoUpYerr; - TVectorF fTrackNoUpZerr; - TVectorF fTrackletX; - TVectorF fTrackletY; - TVectorF fTrackletZ; - TVectorF fTrackletYcorr; - TVectorF fTrackletZcorr; - TVectorF fTrackletY2err; - TVectorF fTrackletYZerr; - TVectorF fTrackletZ2err; - TVectorF fTrackletDy; - TVectorF fTrackletDet; - TVectorF fChi2Update; - TVectorF fRoadY; - TVectorF fRoadZ; - TVectorF fFindable; - - TTreeSRedirector* fStreamer; -}; -template class GPUTRDTrackerDebug; -} // namespace gpu -} // namespace GPUCA_NAMESPACE +// could implement debug code, as we had for AliRoot #else -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -332,8 +46,8 @@ class GPUTRDTrackerDebug // tracklet parameters GPUd() void SetRawTrackletPosition(const float fX, const float fY, const float fZ, int32_t ly) {} - GPUd() void SetCorrectedTrackletPosition(const My_Float* fYZ, int32_t ly) {} - GPUd() void SetTrackletCovariance(const My_Float* fCov, int32_t ly) {} + GPUd() void SetCorrectedTrackletPosition(const float* fYZ, int32_t ly) {} + GPUd() void SetTrackletCovariance(const float* fCov, int32_t ly) {} GPUd() void SetTrackletProperties(const float dy, const int32_t det, int32_t ly) {} // update information @@ -346,15 +60,13 @@ class GPUTRDTrackerDebug GPUd() void Output() {} }; #if !defined(GPUCA_GPUCODE) || defined(GPUCA_GPUCODE_DEVICE) // FIXME: DR: WORKAROUND to avoid CUDA bug creating host symbols for device code. -#ifndef GPUCA_ALIROOT_LIB template class GPUTRDTrackerDebug; -#endif #if !defined(GPUCA_STANDALONE) && !defined(GPUCA_GPUCODE) template class GPUTRDTrackerDebug; #endif #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif #endif // GPUTRDTRACKERDEBUG_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx index 336e54e9efc67..376194e4a586c 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.cxx @@ -20,7 +20,7 @@ #include "GPUReconstruction.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template GPUdii() void GPUTRDTrackerKernels::Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, T* externalInstance) diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h index 4430ce850fb14..8745eabb02473 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackerKernels.h @@ -17,7 +17,7 @@ #include "GPUGeneralKernels.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -33,6 +33,6 @@ class GPUTRDTrackerKernels : public GPUKernelTemplate GPUd() static void Thread(int32_t nBlocks, int32_t nThreads, int32_t iBlock, int32_t iThread, GPUsharedref() GPUSharedMemory& smem, processorType& processors, T* externalInstance = nullptr); }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDTRACKERKERNELSCA_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletLabels.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletLabels.h index dea3f5ffe4d27..d56ee1cbbba5e 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletLabels.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletLabels.h @@ -17,7 +17,7 @@ #ifndef GPUTRDTRACKLETLABELS_H #define GPUTRDTRACKLETLABELS_H -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -26,6 +26,6 @@ struct GPUTRDTrackletLabels { int32_t mLabel[3]; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUTRDTRACKLETLABELS_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.cxx deleted file mode 100644 index 02c6891fc45b4..0000000000000 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.cxx +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTRDTrackletReaderComponent.cxx -/// \brief A pre-processing component for TRD tracking/trigger data on FEP-level - -/// \author Felix Rettig, Stefan Kirsch, Ole Schmidt - -#include -#include "AliLog.h" -#include "AliHLTDataTypes.h" -#include "AliHLTTRDDefinitions.h" -#include "GPUTRDTrackletReaderComponent.h" -#include "AliRawReaderMemory.h" -#include "AliTRDrawStream.h" -#include "GPUTRDTrackletWord.h" -#include "GPUTRDTrackletLabels.h" -#include "AliTRDtrackletWord.h" -#include "AliTRDtrackletMCM.h" -#include "TTree.h" -#include "TEventList.h" -#include "AliRunLoader.h" -#include "AliLoader.h" -#include "AliDataLoader.h" - -using namespace GPUCA_NAMESPACE::gpu; - -ClassImp(GPUTRDTrackletReaderComponent); - -#define LogError(...) \ - { \ - HLTError(__VA_ARGS__); \ - if (fDebugLevel >= 1) { \ - DbgLog("ERROR", __VA_ARGS__); \ - } \ - } -#define LogInfo(...) \ - { \ - HLTInfo(__VA_ARGS__); \ - if (fDebugLevel >= 1) { \ - DbgLog("INFO", __VA_ARGS__); \ - } \ - } -#define LogInspect(...) \ - { \ - HLTDebug(__VA_ARGS__); \ - if (fDebugLevel >= 1) { \ - DbgLog("INSPECT", __VA_ARGS__); \ - } \ - } -#define LogDebug(...) \ - { \ - if (fDebugLevel >= 1) { \ - HLTInfo(__VA_ARGS__); \ - DbgLog("DEBUG", __VA_ARGS__); \ - } \ - } - -GPUTRDTrackletReaderComponent::GPUTRDTrackletReaderComponent() - : AliHLTProcessor(), fDebugLevel(0), fEventId(fgkInvalidEventId), fTrackletArray(nullptr), fRawReaderMem(nullptr), fRawReaderTrd(nullptr) -{ - // constructor -} - -GPUTRDTrackletReaderComponent::~GPUTRDTrackletReaderComponent() -{ - // destructor -} - -const char* GPUTRDTrackletReaderComponent::GetComponentID() { return "TRDTrackletReader"; } - -void GPUTRDTrackletReaderComponent::GetInputDataTypes(vector& list) -{ - list.push_back(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD); - list.push_back(kAliHLTDataTypeAliTreeD | kAliHLTDataOriginTRD); -} - -AliHLTComponentDataType GPUTRDTrackletReaderComponent::GetOutputDataType() { return kAliHLTMultipleDataType; } - -int32_t GPUTRDTrackletReaderComponent::GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList) -{ - tgtList.clear(); - tgtList.push_back(AliHLTTRDDefinitions::fgkTRDTrackletDataType); - tgtList.push_back(AliHLTTRDDefinitions::fgkTRDMCTrackletDataType); - return tgtList.size(); -} - -void GPUTRDTrackletReaderComponent::GetOutputDataSize(uint64_t& constBase, double& inputMultiplier) -{ - constBase = 5000000; - inputMultiplier = 0; -} - -void GPUTRDTrackletReaderComponent::GetOCDBObjectDescription(TMap* const /*targetMap*/) {} - -AliHLTComponent* GPUTRDTrackletReaderComponent::Spawn() { return new GPUTRDTrackletReaderComponent; } - -int32_t GPUTRDTrackletReaderComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/) { return 0; } - -int32_t GPUTRDTrackletReaderComponent::ReadPreprocessorValues(const char* /*modules*/) { return 0; } - -int32_t GPUTRDTrackletReaderComponent::ScanConfigurationArgument(int argc, const char** argv) -{ - - if (argc <= 0) { - return 0; - } - - uint16_t iArg = 0; - TString argument(argv[iArg]); - - if (!argument.CompareTo("-debug")) { - if (++iArg >= argc) { - return -EPROTO; - } - argument = argv[iArg]; - fDebugLevel = argument.Atoi(); - LogInfo("debug level set to %d.", fDebugLevel); - return 2; - } - - return 0; -} - -int32_t GPUTRDTrackletReaderComponent::DoInit(int argc, const char** argv) -{ - - int32_t iResult = 0; - - do { - - fRawReaderMem = new AliRawReaderMemory; - if (!fRawReaderMem) { - iResult = -ENOMEM; - break; - } - - fTrackletArray = new TClonesArray("AliTRDtrackletWord", 1000); - if (!fTrackletArray) { - iResult = -ENOMEM; - break; - } - - fRawReaderTrd = new AliTRDrawStream(fRawReaderMem); - if (!fRawReaderTrd) { - iResult = -ENOMEM; - break; - } - - fRawReaderTrd->SetTrackletArray(fTrackletArray); - - // Disable raw reader error messages that could flood HLT logbook - AliLog::SetClassDebugLevel("AliTRDrawStream", 0); - fRawReaderTrd->SetErrorDebugLevel(AliTRDrawStream::kLinkMonitor, 1); - - } while (0); - - if (iResult < 0) { - - if (fRawReaderTrd) { - delete fRawReaderTrd; - } - fRawReaderTrd = nullptr; - - if (fRawReaderMem) { - delete fRawReaderMem; - } - fRawReaderMem = nullptr; - - if (fTrackletArray) { - delete fTrackletArray; - } - fTrackletArray = nullptr; - } - - vector remainingArgs; - for (int32_t i = 0; i < argc; ++i) { - remainingArgs.push_back(argv[i]); - } - - if (argc > 0) { - ConfigureFromArgumentString(remainingArgs.size(), &(remainingArgs[0])); - } - - return iResult; -} - -int32_t GPUTRDTrackletReaderComponent::DoDeinit() -{ - - if (fRawReaderTrd) { - delete fRawReaderTrd; - } - fRawReaderTrd = nullptr; - - if (fRawReaderMem) { - delete fRawReaderMem; - } - fRawReaderMem = nullptr; - - if (fTrackletArray) { - delete fTrackletArray; - } - fTrackletArray = nullptr; - - return 0; -} - -// void GPUTRDTrackletReaderComponent::DbgLog(const char* prefix, const char* msg){ -// AliHLTEventID_t eventNumber = fEventId; -// int32_t runNumber = -1; -// HLTInfo("TRDGM %s-%s: [PRE] %s%s", -// (runNumber >= 0) ? Form("%06d", runNumber) : "XXXXXX", -// (eventNumber != fgkInvalidEventId) ? Form("%05llu", eventNumber) : "XXXXX", -// (strlen(prefix) > 0) ? Form("<%s> ", prefix) : "", msg); -//} - -void GPUTRDTrackletReaderComponent::DbgLog(const char* prefix, ...) -{ -#ifdef __TRDHLTDEBUG - AliHLTEventID_t eventNumber = fEventId; - int32_t runNumber = -1; - printf("TRDHLTGM %s-X-%s: [PRE] %s", (runNumber >= 0) ? Form("%06d", runNumber) : "XXXXXX", (eventNumber != fgkInvalidEventId) ? Form("%05llu", eventNumber) : "XXXXX", (strlen(prefix) > 0) ? Form("<%s> ", prefix) : ""); -#endif - va_list args; - va_start(args, prefix); - char* fmt = va_arg(args, char*); - vprintf(fmt, args); - printf("\n"); - va_end(args); -} - -int32_t GPUTRDTrackletReaderComponent::DoEvent(const AliHLTComponentEventData& hltEventData, AliHLTComponentTriggerData& /*trigData*/) -{ - - fEventId = hltEventData.fEventID; - - HLTInfo("### START DoEvent [event id: %lu, %d blocks, size: %d]", hltEventData.fEventID, hltEventData.fBlockCnt, hltEventData.fStructSize); - - // event processing function - int32_t iResult = 0; - - fTrackletArray->Clear(); - fRawReaderMem->ClearBuffers(); - - if (!IsDataEvent()) { // process data events only - HLTInfo("### END DoEvent [event id: %lu, %d blocks, size: %d] (skipped: no data event)", hltEventData.fEventID, hltEventData.fBlockCnt, hltEventData.fStructSize); - return iResult; - } - - std::vector outputTrkls; - std::vector outputTrklsMC; - - { // read raw data - - TString infoStr(""); - uint32_t sourceSectors = 0; - - // loop over all incoming TRD raw data blocks - for (const AliHLTComponentBlockData* pBlock = GetFirstInputBlock(kAliHLTDataTypeDDLRaw | kAliHLTDataOriginTRD); pBlock != nullptr && iResult >= 0; pBlock = GetNextInputBlock()) { - - int32_t trdSector = -1; - - // determine sector from block specification - for (unsigned pos = 0; pos < 8 * sizeof(AliHLTUInt32_t); pos++) { - if (pBlock->fSpecification & (0x1 << pos)) { - if (trdSector >= 0) { - HLTWarning("Cannot uniquely identify DDL number from specification, skipping data block %s 0x%08x", DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification); - trdSector = -1; - break; - } - trdSector = pos; - } - } - if (trdSector < 0) { - continue; - } - - // add data block to rawreader - infoStr += Form("%02d, ", trdSector); - sourceSectors |= pBlock->fSpecification; - if (!fRawReaderMem->AddBuffer((uint8_t*)pBlock->fPtr, pBlock->fSize, trdSector + 1024)) { - LogError("Could not add buffer of data block %s, 0x%08x to rawreader", DataType2Text(pBlock->fDataType).c_str(), pBlock->fSpecification); - continue; - } - } // loop over all incoming TRD raw data blocks - - if (sourceSectors) { - infoStr.Remove(infoStr.Length() - 2, 2); - LogDebug("preprocessing raw data from sectors: %s...", infoStr.Data()); - - // extract header info and TRD tracklets from raw data - fRawReaderTrd->ReadEvent(); - - // read and process TRD tracklets - int32_t nTracklets = fTrackletArray->GetEntriesFast(); - - HLTInfo("There are %i tracklets in this event\n", nTracklets); - for (int32_t iTracklet = 0; iTracklet < nTracklets; ++iTracklet) { - GPUTRDTrackletWord trkl = *((AliTRDtrackletWord*)fTrackletArray->At(iTracklet)); - outputTrkls.push_back(trkl); - } - LogDebug("pushing data for sectors: 0x%05x", sourceSectors); - } - fRawReaderMem->ClearBuffers(); - } - - { // loop over all incoming TRD MC tracklets data blocks - - for (const TObject* iter = GetFirstInputObject(kAliHLTDataTypeAliTreeD | kAliHLTDataOriginTRD); iter != nullptr; iter = GetNextInputObject()) { - TTree* trackletTree = dynamic_cast(const_cast(iter)); - if (!trackletTree) { - HLTFatal("No Tracklet Tree found"); - return -EINVAL; - } - - TBranch* trklbranch = trackletTree->GetBranch("mcmtrklbranch"); - if (!trklbranch) { - HLTFatal("No tracklet branch found in tracklet tree"); - return -EINVAL; - } - int32_t nTracklets = trklbranch->GetEntries(); - HLTInfo("Input tree with %d TRD MCM tracklets", nTracklets); - - //----------------------------------- - // Deploy same hack as in ITS Clusterizer - AliRunLoader* pRunLoader = AliRunLoader::Instance(); - if (!pRunLoader) { - HLTError("failed to get global runloader instance"); - return -ENOSYS; - } - pRunLoader->GetEvent(GetEventCount()); - const char* loaderType = "TRDLoader"; - AliLoader* pLoader = pRunLoader->GetLoader(loaderType); - if (!pLoader) { - HLTError("can not get loader \"%s\" from runloader", loaderType); - return -ENOSYS; - } - pLoader->LoadDigits("read"); - AliDataLoader* dataLoader = pLoader->GetDataLoader("tracklets"); - if (dataLoader) { - trackletTree = dataLoader->Tree(); - dataLoader->Load("read"); - } else { - HLTWarning("TRD tracklet loader not found"); - } - trklbranch = trackletTree->GetBranch("mcmtrklbranch"); - if (!trklbranch) { - HLTFatal("No tracklet branch found in tracklet tree"); - return -EINVAL; - } - if (trklbranch->GetEntries() != nTracklets) { - HLTFatal("Incorrect number of tracklets in tree"); - return -EINVAL; - } - //----------------------------------- - - AliTRDtrackletMCM* trkl = 0x0; - trklbranch->SetAddress(&trkl); - - for (int32_t iTracklet = 0; iTracklet < nTracklets; iTracklet++) { - int32_t nbytes = trklbranch->GetEntry(iTracklet, 1); - if (!trkl || nbytes <= 0) { - HLTWarning("Can not read entry from tracklet branch"); - continue; - } - GPUTRDTrackletWord hltTrkl = *trkl; - outputTrkls.push_back(hltTrkl); - GPUTRDTrackletLabels trklMC; - trklMC.mLabel[0] = trkl->GetLabel(0); - trklMC.mLabel[1] = trkl->GetLabel(1); - trklMC.mLabel[2] = trkl->GetLabel(2); - outputTrklsMC.push_back(trklMC); - } - } - } - - if (outputTrkls.size() > 0) { - iResult = PushBack(&outputTrkls[0], outputTrkls.size() * sizeof(outputTrkls[0]), AliHLTTRDDefinitions::fgkTRDTrackletDataType, 0); - } - if (outputTrklsMC.size() > 0) { - iResult = PushBack(&outputTrklsMC[0], outputTrklsMC.size() * sizeof(outputTrklsMC[0]), AliHLTTRDDefinitions::fgkTRDMCTrackletDataType, 0); - } - - HLTInfo("### END DoEvent [event id: %lu, %d blocks, size: %d, output tracklets: %d]", hltEventData.fEventID, hltEventData.fBlockCnt, hltEventData.fStructSize, outputTrkls.size()); - - return iResult; -} diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.h deleted file mode 100644 index 5aa60cc68291f..0000000000000 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletReaderComponent.h +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTRDTrackletReaderComponent.h -/// \brief A pre-processing component for TRD tracking/trigger data on FEP-level - -/// \author Felix Rettig, Stefan Kirsch, Ole Schmidt - -#ifndef GPUTRDTRACKLETREADERCOMPONENT_H -#define GPUTRDTRACKLETREADERCOMPONENT_H - -#ifndef GPUCA_ALIROOT_LIB -#define GPUCA_ALIROOT_LIB -#endif - -#include "AliHLTProcessor.h" - -class AliRawReaderMemory; -class TTree; -class AliTRDrawStream; -class AliTRDonlineTrackingDataContainer; -class TClonesArray; - -/** - * @class GPUTRDTrackletReaderComponent - * Component fetches raw data input objects in DDL format and extracts tracklets. - * It also instantiates a RawReader in order to be used with some reconstruction. - * - * More information and examples can be found here (relative to $ALICE_ROOT): - * - * -- HLT/BASE/AliHLTComponent.h/.cxx, HLT/BASE/AliHLTProcessor.h/.cxx - * Interface definition and description - * -- HLT/SampleLib: example implementations of components - * - * - *

General properties:

- * - * Component ID: \b TRDReaderComponent
- * Library: \b libAliHLTTRD.so
- * Input Data Types: @ref kAliHLTDataTypeDDLRaw|kAliHLTDataOriginTRD
- * Output Data Types: @ref kAliHLTTrackDataTypeID|kAliHLTDataOriginTRD
- * - *

Mandatory arguments:

- * none - * - *

Optional arguments:

- * none - * - *

Configuration:

- * none - * - *

Default CDB entries:

- * none - * - *

Performance:

- * minmal - * - *

Memory consumption:

- * don't know yet - * - *

Output size:

- * not very much - * - * @ingroup The component has no output data. - */ -class GPUTRDTrackletReaderComponent : public AliHLTProcessor -{ - public: - GPUTRDTrackletReaderComponent(); - virtual ~GPUTRDTrackletReaderComponent(); - - // AliHLTComponent interface functions - const char* GetComponentID(); - void GetInputDataTypes(vector& list); - AliHLTComponentDataType GetOutputDataType(); - int32_t GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList); - void GetOutputDataSize(uint64_t& constBase, double& inputMultiplier); - void GetOCDBObjectDescription(TMap* const targetMap); - - // Spawn function, return new class instance - AliHLTComponent* Spawn(); - - protected: - // AliHLTComponent interface functions - int32_t DoInit(int argc, const char** argv); - int32_t DoDeinit(); - int32_t DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData); - int32_t ScanConfigurationArgument(int argc, const char** argv); - int32_t Reconfigure(const char* cdbEntry, const char* chainId); - int32_t ReadPreprocessorValues(const char* modules); - - using AliHLTProcessor::DoEvent; - - private: - /** copy constructor prohibited */ - GPUTRDTrackletReaderComponent(const GPUTRDTrackletReaderComponent&); - /** assignment operator prohibited */ - GPUTRDTrackletReaderComponent& operator=(const GPUTRDTrackletReaderComponent&); - - void DbgLog(const char* prefix, ...); - - // general - static const AliHLTEventID_t fgkInvalidEventId = 18446744073709551615llu; - - UShort_t fDebugLevel; //! set debug checks/output level, 0: debug off - AliHLTEventID_t fEventId; //! event ID - - // trd specific data - TClonesArray* fTrackletArray; //! internal tracklet array - - // rawreader instance - AliRawReaderMemory* fRawReaderMem; //! TRD raw reader memory instance - AliTRDrawStream* fRawReaderTrd; //! TRD raw stream instance - - ClassDef(GPUTRDTrackletReaderComponent, 0); -}; - -#endif // GPUTRDTRACKLETREADERCOMPONENT_H diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.cxx b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.cxx index cc7b6b77fd4a0..c14f80ed2d8e0 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.cxx +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.cxx @@ -13,7 +13,7 @@ /// \author Ole Schmidt #include "GPUTRDTrackletWord.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifndef GPUCA_TPC_GEOMETRY_O2 @@ -22,24 +22,6 @@ GPUd() GPUTRDTrackletWord::GPUTRDTrackletWord(uint32_t trackletWord) : mHCId(-1) } GPUd() GPUTRDTrackletWord::GPUTRDTrackletWord(uint32_t trackletWord, int32_t hcid) : mHCId(hcid), mTrackletWord(trackletWord) {} -#ifdef GPUCA_ALIROOT_LIB -#include "AliTRDtrackletWord.h" -#include "AliTRDtrackletMCM.h" - -GPUTRDTrackletWord::GPUTRDTrackletWord(const AliTRDtrackletWord& rhs) : mHCId(rhs.GetHCId()), mTrackletWord(rhs.GetTrackletWord()) -{ -} -GPUTRDTrackletWord::GPUTRDTrackletWord(const AliTRDtrackletMCM& rhs) : mHCId(rhs.GetHCId()), mTrackletWord(rhs.GetTrackletWord()) {} - -GPUTRDTrackletWord& GPUTRDTrackletWord::operator=(const AliTRDtrackletMCM& rhs) -{ - this->~GPUTRDTrackletWord(); - new (this) GPUTRDTrackletWord(rhs); - return *this; -} - -#endif // GPUCA_ALIROOT_LIB - GPUd() int32_t GPUTRDTrackletWord::GetYbin() const { // returns (signed) value of Y diff --git a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.h b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.h index 542700b7fe355..83acbcda8e3a1 100644 --- a/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.h +++ b/GPU/GPUTracking/TRDTracking/GPUTRDTrackletWord.h @@ -24,7 +24,7 @@ class AliTRDtrackletWord; class AliTRDtrackletMCM; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -73,13 +73,13 @@ class GPUTRDTrackletWord // bits: 8 4 7 13 }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #else // compatibility with Run 3 data types #include "DataFormatsTRD/Tracklet64.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -109,7 +109,7 @@ class GPUTRDTrackletWord : private o2::trd::Tracklet64 static_assert(sizeof(GPUTRDTrackletWord) == sizeof(o2::trd::Tracklet64), "Incorrect memory layout"); } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUCA_TPC_GEOMETRY_O2 diff --git a/GPU/GPUTracking/TRDTracking/macros/run_trd_tracker.C b/GPU/GPUTracking/TRDTracking/macros/run_trd_tracker.C index b098d3e16b5ea..3d86a77b6d9cc 100644 --- a/GPU/GPUTracking/TRDTracking/macros/run_trd_tracker.C +++ b/GPU/GPUTracking/TRDTracking/macros/run_trd_tracker.C @@ -40,8 +40,7 @@ #endif -using namespace GPUCA_NAMESPACE::gpu; - +using namespace o2::gpu; void run_trd_tracker(std::string path = "./", std::string inputTracks = "o2match_itstpc.root", diff --git a/GPU/GPUTracking/cmake/kernel_helpers.cmake b/GPU/GPUTracking/cmake/kernel_helpers.cmake index 1667ad867a9e7..ff003eca78948 100644 --- a/GPU/GPUTracking/cmake/kernel_helpers.cmake +++ b/GPU/GPUTracking/cmake/kernel_helpers.cmake @@ -52,10 +52,6 @@ function(o2_gpu_add_kernel kernel_name kernel_files kernel_bounds kernel_type) endif() set(TMP_PRE "") set(TMP_POST "") - if(NOT kernel_bounds MATCHES "_ALIR") - set(TMP_PRE "#ifdef GPUCA_KRNL_NOALIROOT\n") - set(TMP_POST "#endif\n") - endif() set(TMP_KERNEL "GPUCA_KRNL${TMP_BOUNDS}((${kernel_name}), (${kernel_type}), (${OPT1}), (${OPT2}), (${OPT3}))\n") separate_arguments(kernel_files NATIVE_COMMAND ${kernel_files}) list(GET kernel_files 0 TMP_KERNEL_CLASS_FILE) diff --git a/GPU/GPUTracking/dEdx/GPUdEdx.cxx b/GPU/GPUTracking/dEdx/GPUdEdx.cxx index 6ea59c4c2c9fe..2e67ddda7c99c 100644 --- a/GPU/GPUTracking/dEdx/GPUdEdx.cxx +++ b/GPU/GPUTracking/dEdx/GPUdEdx.cxx @@ -18,7 +18,7 @@ #include "GPUCommonAlgorithm.h" #include "GPUParam.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifndef GPUCA_GPUCODE_DEVICE GPUd() void GPUdEdx::clear() diff --git a/GPU/GPUTracking/dEdx/GPUdEdx.h b/GPU/GPUTracking/dEdx/GPUdEdx.h index 8c042d51514c4..8cff279076348 100644 --- a/GPU/GPUTracking/dEdx/GPUdEdx.h +++ b/GPU/GPUTracking/dEdx/GPUdEdx.h @@ -26,7 +26,7 @@ #include "GPUDebugStreamer.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -214,6 +214,6 @@ GPUdi() void GPUdEdx::fillSubThreshold(int32_t padRow, const GPUParam& GPUrestri #endif // !GPUCA_HAVE_O2HEADERS } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/display/GPUDisplay.cxx b/GPU/GPUTracking/display/GPUDisplay.cxx index 56e59d664491a..4c770b32ee66a 100644 --- a/GPU/GPUTracking/display/GPUDisplay.cxx +++ b/GPU/GPUTracking/display/GPUDisplay.cxx @@ -44,7 +44,7 @@ constexpr hmm_mat4 MY_HMM_IDENTITY = {{{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}}}; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; static const GPUSettingsDisplay& GPUDisplay_GetConfig(GPUChainTracking* chain) { diff --git a/GPU/GPUTracking/display/GPUDisplay.h b/GPU/GPUTracking/display/GPUDisplay.h index ab6fe540d01bf..e7836461e4fd9 100644 --- a/GPU/GPUTracking/display/GPUDisplay.h +++ b/GPU/GPUTracking/display/GPUDisplay.h @@ -29,7 +29,7 @@ #include "utils/timer.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -322,6 +322,6 @@ class GPUDisplay : public GPUDisplayInterface float mYFactor = 1.0f; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/display/GPUDisplayInterface.cxx b/GPU/GPUTracking/display/GPUDisplayInterface.cxx index 12b7b96540f79..2f5cc9cbb5dd5 100644 --- a/GPU/GPUTracking/display/GPUDisplayInterface.cxx +++ b/GPU/GPUTracking/display/GPUDisplayInterface.cxx @@ -21,7 +21,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; static constexpr const char* libName = "lib" LIBRARY_PREFIX "GPUTrackingDisplay" LIBRARY_EXTENSION; static constexpr const char* funcName = "GPUTrackingDisplayLoader"; diff --git a/GPU/GPUTracking/display/GPUDisplayInterface.h b/GPU/GPUTracking/display/GPUDisplayInterface.h index 49cdb7e9e2038..44ae35068cac3 100644 --- a/GPU/GPUTracking/display/GPUDisplayInterface.h +++ b/GPU/GPUTracking/display/GPUDisplayInterface.h @@ -17,7 +17,7 @@ #include "GPUSettings.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -62,6 +62,6 @@ class GPUDisplayFrontendInterface }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif // GPUDISPLAYINTERFACE_H diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackend.cxx b/GPU/GPUTracking/display/backend/GPUDisplayBackend.cxx index 15b759e658354..508c9d0b2e4ff 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackend.cxx +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackend.cxx @@ -36,7 +36,7 @@ #include "GPUDisplay.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayBackend::GPUDisplayBackend() = default; GPUDisplayBackend::~GPUDisplayBackend() = default; diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackend.h b/GPU/GPUTracking/display/backend/GPUDisplayBackend.h index 8f00f39b97ce3..c2c23f659e418 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackend.h +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackend.h @@ -28,7 +28,7 @@ union hmm_mat4; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplay; class GPUDisplayFrontend; @@ -131,6 +131,6 @@ class GPUDisplayBackend std::unique_ptr mMagneticFieldVisualization; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.cxx b/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.cxx index b92872a79c6de..10acbea3a2586 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.cxx +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.cxx @@ -30,7 +30,7 @@ #define OPENGL_EMULATE_MULTI_DRAW 0 -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifdef GPUCA_BUILD_EVENT_DISPLAY_VULKAN #include "utils/qGetLdBinarySymbols.h" diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.h b/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.h index b1bcb25740ed4..d9bb50d7bead8 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.h +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackendOpenGL.h @@ -19,7 +19,7 @@ #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GLfb { uint32_t fb_id = 0, fbCol_id = 0, fbDepth_id = 0; @@ -120,6 +120,6 @@ class GPUDisplayBackendOpenGL : public GPUDisplayBackend GLfb mMixBuffer; GLfb mOffscreenBufferMSAA, mOffscreenBuffer; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.cxx b/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.cxx index 5491555ace8d2..64167afaa536d 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.cxx +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.cxx @@ -21,7 +21,7 @@ VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE #include "GPUDisplayBackendVulkan.h" #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #include "utils/qGetLdBinarySymbols.h" QGET_LD_BINARY_SYMBOLS(shaders_shaders_vertex_vert_spv); diff --git a/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.h b/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.h index 00310e58dd5a8..97c24084915f6 100644 --- a/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.h +++ b/GPU/GPUTracking/display/backend/GPUDisplayBackendVulkan.h @@ -22,7 +22,7 @@ #include #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayBackendVulkan : public GPUDisplayBackend @@ -217,6 +217,6 @@ class GPUDisplayBackendVulkan : public GPUDisplayBackend vk::Fence mSingleCommitFence; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.cxx index b48d5b994fcf8..590d8648eb5bb 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.cxx @@ -33,15 +33,15 @@ #ifdef GPUCA_BUILD_EVENT_DISPLAY_QT #include "GPUDisplayGUIWrapper.h" #else -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayGUIWrapper { }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayFrontend::~GPUDisplayFrontend() = default; diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.h index 1c459d77beee9..ceb63e788564a 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontend.h @@ -19,7 +19,7 @@ #include "GPUDisplayInterface.h" #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUReconstruction; class GPUDisplay; @@ -146,6 +146,6 @@ class GPUDisplayFrontend : public GPUDisplayFrontendInterface void ExitDisplay(); // Callback to clean up the GL Display int32_t& drawTextFontSize(); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.cxx index d9cfbedf3ba53..4d80917a26215 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.cxx @@ -46,7 +46,7 @@ extern "C" int32_t gl3wInit(); #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayFrontendGlfw::GPUDisplayFrontendGlfw() { diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.h index 792abcf64b839..5276652a370a1 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlfw.h @@ -20,7 +20,7 @@ struct GLFWwindow; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendGlfw : public GPUDisplayFrontend { @@ -65,6 +65,6 @@ class GPUDisplayFrontendGlfw : public GPUDisplayFrontend uint8_t mLastKeyDown = 0; bool mUseIMGui = false; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.cxx index ab435586820e8..334a60446a4f3 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.cxx @@ -23,7 +23,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; static GPUDisplayFrontendGlut* me = nullptr; GPUDisplayFrontendGlut::GPUDisplayFrontendGlut() diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.h index 71d7d17c935c8..96f8f4af6cba5 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendGlut.h @@ -18,7 +18,7 @@ #include "GPUDisplayFrontend.h" #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendGlut : public GPUDisplayFrontend { @@ -56,6 +56,6 @@ class GPUDisplayFrontendGlut : public GPUDisplayFrontend int32_t mHeight = INIT_HEIGHT; bool mFullScreen = false; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.cxx index 080d48b41cd93..c48000bd80685 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.cxx @@ -13,4 +13,4 @@ /// \author David Rohr #include "GPUDisplayFrontendNone.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.h index c95927c6655b9..defd759ac4df6 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendNone.h @@ -17,7 +17,7 @@ #include "GPUDisplayFrontend.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendNone : public GPUDisplayFrontend { @@ -31,6 +31,6 @@ class GPUDisplayFrontendNone : public GPUDisplayFrontend void SetVSync(bool enable) override {} void OpenGLPrint(const char* s, float x, float y, float r, float g, float b, float a, bool fromBotton = true) override {} }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.cxx index b920259a1e70d..ed0d08fb24add 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.cxx @@ -37,7 +37,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayFrontendWayland::GPUDisplayFrontendWayland() { diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.h index f13c6fe831e0d..6dfe0a361fbb6 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWayland.h @@ -28,7 +28,7 @@ struct xkb_context; struct xkb_keymap; struct xkb_state; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendWayland : public GPUDisplayFrontend { @@ -85,6 +85,6 @@ class GPUDisplayFrontendWayland : public GPUDisplayFrontend int32_t mWidthRequested = 0; int32_t mHeightRequested = 0; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.cxx index d8e05a3f03b9b..8d48536e0a351 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.cxx @@ -24,7 +24,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; HDC hDC = nullptr; // Private GDI Device Context HGLRC hRC = nullptr; // Permanent Rendering Context diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.h index 62b1a7437a58f..a8534f3f0fc1f 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendWindows.h @@ -17,7 +17,7 @@ #include "GPUDisplayFrontend.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendWindows : public GPUDisplayFrontend { @@ -35,6 +35,6 @@ class GPUDisplayFrontendWindows : public GPUDisplayFrontend private: int32_t FrontendMain() override; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.cxx index 2ef2ccca92baf..96011aa064bac 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.cxx @@ -30,7 +30,7 @@ typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int32_t*); -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayFrontendX11::GPUDisplayFrontendX11() { diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.h b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.h index 16920ce77460e..f14d05b3080bd 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayFrontendX11.h @@ -21,7 +21,7 @@ #include #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayFrontendX11 : public GPUDisplayFrontend { @@ -55,6 +55,6 @@ class GPUDisplayFrontendX11 : public GPUDisplayFrontend PFNGLXSWAPINTERVALEXTPROC mGlXSwapIntervalEXT = nullptr; bool vsync_supported = false; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.cxx index a5ba968f9e50d..69d24538123c6 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.cxx @@ -22,9 +22,9 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUDisplayGUIWrapperObjects { std::unique_ptr app; @@ -39,7 +39,7 @@ struct GPUDisplayGUIWrapperObjects { std::mutex mutex, mutexRet; std::condition_variable signal, signalRet; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu GPUDisplayGUIWrapper::GPUDisplayGUIWrapper() { diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.h b/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.h index ef632c6f2d54b..00542321d6a19 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.h +++ b/GPU/GPUTracking/display/frontend/GPUDisplayGUIWrapper.h @@ -18,7 +18,7 @@ #include "GPUCommonDef.h" #include -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUDisplayGUIWrapperObjects; @@ -39,5 +39,5 @@ class GPUDisplayGUIWrapper void guiThread(); }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUDISPLAYGUIWRAPPER_H diff --git a/GPU/GPUTracking/display/frontend/GPUDisplayKeys.cxx b/GPU/GPUTracking/display/frontend/GPUDisplayKeys.cxx index 8dccdc60c0d93..431240e93b732 100644 --- a/GPU/GPUTracking/display/frontend/GPUDisplayKeys.cxx +++ b/GPU/GPUTracking/display/frontend/GPUDisplayKeys.cxx @@ -14,7 +14,7 @@ #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; const char* HelpText[] = { "[ESC] Quit", diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayAnimation.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayAnimation.cxx index 77b7181a3a377..6c0595b073cd0 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayAnimation.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayAnimation.cxx @@ -14,7 +14,7 @@ #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; constexpr hmm_mat4 MY_HMM_FROM(float (&v)[16]) { return {{{v[0], v[1], v[2], v[3]}, {v[4], v[5], v[6], v[7]}, {v[8], v[9], v[10], v[11]}, {v[12], v[13], v[14], v[15]}}}; } diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayBackendOpenGLMagneticField.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayBackendOpenGLMagneticField.cxx index 16166baa9a91c..b04c93ab8496e 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayBackendOpenGLMagneticField.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayBackendOpenGLMagneticField.cxx @@ -32,7 +32,7 @@ #include "shaders/GPUDisplayShaders.h" #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; // Runtime minimum version defined in GPUDisplayFrontend.h, keep in sync! #define GPUCA_BUILD_EVENT_DISPLAY_OPENGL diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayColors.inc b/GPU/GPUTracking/display/helpers/GPUDisplayColors.inc index 2994af86980d8..c10e0d3a55876 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayColors.inc +++ b/GPU/GPUTracking/display/helpers/GPUDisplayColors.inc @@ -14,7 +14,7 @@ #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; inline void GPUDisplay::ActivateColor() { diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayHelpers.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayHelpers.cxx index d782898380281..866d4a59aab82 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayHelpers.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayHelpers.cxx @@ -21,7 +21,7 @@ #include "bitmapfile.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; int32_t GPUDisplay::getNumThreads() { diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayInterpolation.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayInterpolation.cxx index 3df61bfc81110..644995929acb7 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayInterpolation.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayInterpolation.cxx @@ -15,7 +15,7 @@ #include #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUDisplay::opengl_spline::create(const vecpod& x, const vecpod& y) { diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayLoader.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayLoader.cxx index 27f0355e95583..ee50f32e3c1ac 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayLoader.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayLoader.cxx @@ -19,7 +19,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; extern "C" void* GPUTrackingDisplayLoader(const char*, void*); diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.cxx index 352f029ab3648..7e23e6694d377 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.cxx @@ -28,7 +28,7 @@ #include "DetectorsBase/Propagator.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; GPUDisplayMagneticField::GPUDisplayMagneticField() { diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.h b/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.h index f8461e4c036f4..d4eb5b571fdc0 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.h +++ b/GPU/GPUTracking/display/helpers/GPUDisplayMagneticField.h @@ -23,7 +23,7 @@ #include #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUDisplayMagneticField { @@ -141,6 +141,6 @@ class GPUDisplayMagneticField std::unique_ptr mDipoleParameterization; std::vector mFieldLineSeedPoints; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // GPUDISPLAYMAGNETICFIELD_H diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayQuaternion.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayQuaternion.cxx index 6caaabe938df4..1b77a685c0242 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayQuaternion.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayQuaternion.cxx @@ -15,7 +15,7 @@ #include "GPUDisplay.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUDisplay::createQuaternionFromMatrix(float* v, const float* mat) { diff --git a/GPU/GPUTracking/display/helpers/GPUDisplayROOT.cxx b/GPU/GPUTracking/display/helpers/GPUDisplayROOT.cxx index 4d99c3aa38cfc..dbeefc7bf9b07 100644 --- a/GPU/GPUTracking/display/helpers/GPUDisplayROOT.cxx +++ b/GPU/GPUTracking/display/helpers/GPUDisplayROOT.cxx @@ -17,7 +17,7 @@ #endif #include "GPUDisplay.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifndef GPUCA_NO_ROOT #include "Rtypes.h" // Include ROOT header first, to use ROOT and disable replacements diff --git a/GPU/GPUTracking/display/helpers/field-uniform-exporter.cxx b/GPU/GPUTracking/display/helpers/field-uniform-exporter.cxx index d8210979efa64..e57c7389e6d74 100644 --- a/GPU/GPUTracking/display/helpers/field-uniform-exporter.cxx +++ b/GPU/GPUTracking/display/helpers/field-uniform-exporter.cxx @@ -21,7 +21,7 @@ #include "GPUDisplayMagneticField.h" namespace bpo = boost::program_options; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template void saveSegments(std::ofstream& file, int32_t NSegDim1, int32_t NSegDim2, int32_t NSegDim3, GPUDisplayMagneticField::SegmentsUniform& segments) diff --git a/GPU/GPUTracking/display/render/GPUDisplayDraw.cxx b/GPU/GPUTracking/display/render/GPUDisplayDraw.cxx index ffebc373b253f..3d15077c8cf10 100644 --- a/GPU/GPUTracking/display/render/GPUDisplayDraw.cxx +++ b/GPU/GPUTracking/display/render/GPUDisplayDraw.cxx @@ -42,7 +42,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #define GET_CID(slice, i) (mParam->par.earlyTpcTransform ? mIOPtrs->clusterData[slice][i].id : (mIOPtrs->clustersNative->clusterOffset[slice][0] + i)) diff --git a/GPU/GPUTracking/display/render/GPUDisplayImportEvent.cxx b/GPU/GPUTracking/display/render/GPUDisplayImportEvent.cxx index 072119f7d528f..56ce3bef39082 100644 --- a/GPU/GPUTracking/display/render/GPUDisplayImportEvent.cxx +++ b/GPU/GPUTracking/display/render/GPUDisplayImportEvent.cxx @@ -35,7 +35,7 @@ #include "ITSMFTBase/DPLAlpideParam.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void GPUDisplay::DrawGLScene_updateEventData() { diff --git a/GPU/GPUTracking/display/shaders/GPUDisplayShaders.h b/GPU/GPUTracking/display/shaders/GPUDisplayShaders.h index ff22006ceb37e..63673505f4732 100644 --- a/GPU/GPUTracking/display/shaders/GPUDisplayShaders.h +++ b/GPU/GPUTracking/display/shaders/GPUDisplayShaders.h @@ -16,7 +16,7 @@ #define GPUDISPLAYSHADERS_H #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -469,6 +469,6 @@ void main() { )"; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/kernels.cmake b/GPU/GPUTracking/kernels.cmake index bfa738201b637..c46419c439eb0 100644 --- a/GPU/GPUTracking/kernels.cmake +++ b/GPU/GPUTracking/kernels.cmake @@ -33,16 +33,16 @@ o2_gpu_kernel_file_list(MATLUT) o2_gpu_kernel_file_list(TPCMERGER) endif() -o2_gpu_add_kernel("GPUTPCNeighboursFinder" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCNeighboursCleaner" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCStartHitsFinder" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCStartHitsSorter" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCTrackletConstructor, singleSlice" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCTrackletConstructor, allSlices" "= TPCTRACKER" LB_ALIR single) -o2_gpu_add_kernel("GPUTPCTrackletSelector" "= TPCTRACKER" LB_ALIR both) -o2_gpu_add_kernel("GPUMemClean16" "GPUGeneralKernels" NO_ALIR "simple, REG, (GPUCA_THREAD_COUNT, 1)" void* ptr "uint64_t" size) -o2_gpu_add_kernel("GPUitoa" "GPUGeneralKernels" NO_ALIR "simple, REG, (GPUCA_THREAD_COUNT, 1)" int32_t* ptr "uint64_t" size) -o2_gpu_add_kernel("GPUTPCGlobalTrackingCopyNumbers" "GPUTPCGlobalTracking TPCTRACKER" NO_ALIR single int32_t n) +o2_gpu_add_kernel("GPUTPCNeighboursFinder" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCNeighboursCleaner" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCStartHitsFinder" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCStartHitsSorter" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCTrackletConstructor, singleSlice" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCTrackletConstructor, allSlices" "= TPCTRACKER" LB single) +o2_gpu_add_kernel("GPUTPCTrackletSelector" "= TPCTRACKER" LB both) +o2_gpu_add_kernel("GPUMemClean16" "GPUGeneralKernels" NO "simple, REG, (GPUCA_THREAD_COUNT, 1)" void* ptr "uint64_t" size) +o2_gpu_add_kernel("GPUitoa" "GPUGeneralKernels" NO "simple, REG, (GPUCA_THREAD_COUNT, 1)" int32_t* ptr "uint64_t" size) +o2_gpu_add_kernel("GPUTPCGlobalTrackingCopyNumbers" "GPUTPCGlobalTracking TPCTRACKER" NO single int32_t n) o2_gpu_add_kernel("GPUTPCGlobalTracking" "= TPCTRACKER TPCTRACKLETCONS" LB single) o2_gpu_add_kernel("GPUTPCCreateSliceData" "= TPCTRACKER TPCSLICEDATA" LB single) o2_gpu_add_kernel("GPUTPCSectorDebugSortKernels, hitData" "= TPCTRACKER" NO single) diff --git a/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.cxx b/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.cxx deleted file mode 100644 index 4cac2612e4cb2..0000000000000 --- a/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.cxx +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLT3DTrackParam.cxx -/// \author Sergey Gorbunov - -#include "AliHLT3DTrackParam.h" -#include "TMath.h" - -ClassImp(AliHLT3DTrackParam); - -//* Transport utilities - -double AliHLT3DTrackParam::GetDStoPoint(double Bz, const double xyz[3], const double* T0) const -{ - //* Get DS = Path/Momentum to a certain space point for Bz field - - double q = fSignQ; - if (!T0) { - T0 = mParam; - } else { - q = T0[6]; - } - - const double kCLight = 0.000299792458; - double bq = Bz * q * kCLight; - double pt2 = T0[3] * T0[3] + T0[4] * T0[4]; - if (pt2 < 1.e-4) { - return 0; - } - double dx = xyz[0] - T0[0]; - double dy = xyz[1] - T0[1]; - double a = dx * T0[3] + dy * T0[4]; - double dS = 0; - if (TMath::Abs(bq) < 1.e-8) { - dS = a / pt2; - } else { - dS = TMath::ATan2(bq * a, pt2 + bq * (dy * T0[3] - dx * T0[4])) / bq; - } - return dS; -} - -void AliHLT3DTrackParam::TransportToDS(double Bz, double DS, double* T0) -{ - //* Transport the particle on DS = Path/Momentum, for Bz field - - double tmp[7]; - if (!T0) { - T0 = tmp; - T0[0] = mParam[0]; - T0[1] = mParam[1]; - T0[2] = mParam[2]; - T0[3] = mParam[3]; - T0[4] = mParam[4]; - T0[5] = mParam[5]; - T0[6] = fSignQ; - } - const double kCLight = 0.000299792458; - Bz = Bz * T0[6] * kCLight; - double bs = Bz * DS; - double s = TMath::Sin(bs), c = TMath::Cos(bs); - double sB, cB; - if (TMath::Abs(bs) > 1.e-10) { - sB = s / Bz; - cB = (1 - c) / Bz; - } else { - const Double_t kOvSqr6 = 1. / TMath::Sqrt(6.); - sB = (1. - bs * kOvSqr6) * (1. + bs * kOvSqr6) * DS; - cB = .5 * sB * bs; - } - - double px = T0[3]; - double py = T0[4]; - double pz = T0[5]; - - double d[6] = {mParam[0] - T0[0], mParam[1] - T0[1], mParam[2] - T0[2], mParam[3] - T0[3], mParam[4] - T0[4], mParam[5] - T0[5]}; - - T0[0] = T0[0] + sB * px + cB * py; - T0[1] = T0[1] - cB * px + sB * py; - T0[2] = T0[2] + DS * pz; - T0[3] = c * px + s * py; - T0[4] = -s * px + c * py; - T0[5] = T0[5]; - - // clang-format off - double mJ[6][6] = { {1, 0, 0, sB, cB, 0, }, - {0, 1, 0, -cB, sB, 0, }, - {0, 0, 1, 0, 0, DS, }, - {0, 0, 0, c, s, 0, }, - {0, 0, 0, -s, c, 0, }, - {0, 0, 0, 0, 0, 1, }}; - // clang-format on - - for (int32_t i = 0; i < 6; i++) { - mParam[i] = T0[i]; - for (int32_t j = 0; j < 6; j++) { - mParam[i] += mJ[i][j] * d[j]; - } - } - - double mA[6][6]; - for (int32_t k = 0, i = 0; i < 6; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - mA[i][j] = mA[j][i] = fCov[k]; - } - } - - double mJC[6][6]; - for (int32_t i = 0; i < 6; i++) { - for (int32_t j = 0; j < 6; j++) { - mJC[i][j] = 0; - for (int32_t k = 0; k < 6; k++) { - mJC[i][j] += mJ[i][k] * mA[k][j]; - } - } - } - - for (int32_t k = 0, i = 0; i < 6; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - fCov[k] = 0; - for (int32_t l = 0; l < 6; l++) { - fCov[k] += mJC[i][l] * mJ[j][l]; - } - } - } -} - -//* Fit utilities - -void AliHLT3DTrackParam::InitializeCovarianceMatrix() -{ - //* Initialization of covariance matrix - - for (int32_t i = 0; i < 21; i++) { - fCov[i] = 0; - } - fSignQ = 0; - fCov[0] = fCov[2] = fCov[5] = 100.; - fCov[9] = fCov[14] = fCov[20] = 10000.; - fChi2 = 0; - fNDF = -5; -} - -void AliHLT3DTrackParam::GetGlueMatrix(const double xyz[3], double G[6], const double* T0) const -{ - //* ! - - if (!T0) { - T0 = mParam; - } - - double dx = xyz[0] - T0[0], dy = xyz[1] - T0[1], dz = xyz[2] - T0[2]; - double px2 = T0[3] * T0[3], py2 = T0[4] * T0[4], pz2 = T0[5] * T0[5]; - double s2 = (dx * dx + dy * dy + dz * dz); - double p2 = px2 + py2 + pz2; - if (p2 > 1.e-4) { - s2 /= p2; - } - double x = T0[3] * s2; - double xx = px2 * s2, xy = x * T0[4], xz = x * T0[5], yy = py2 * s2, yz = T0[4] * T0[5] * s2; - G[0] = xx; - G[1] = xy; - G[2] = yy; - G[3] = xz; - G[4] = yz; - G[5] = pz2 * s2; -} - -void AliHLT3DTrackParam::Filter(const double m[3], const double V[6], const double G[6]) -{ - //* ! - - // clang-format off - double - c00 = fCov[0], - c10 = fCov[1], c11 = fCov[2], - c20 = fCov[3], c21 = fCov[4], c22 = fCov[5], - c30 = fCov[6], c31 = fCov[7], c32 = fCov[8], - c40 = fCov[10], c41 = fCov[11], c42 = fCov[12], - c50 = fCov[15], c51 = fCov[16], c52 = fCov[17]; - // clang-format on - - double z0 = m[0] - mParam[0], z1 = m[1] - mParam[1], z2 = m[2] - mParam[2]; - - double mS[6] = {c00 + V[0] + G[0], c10 + V[1] + G[1], c11 + V[2] + G[2], c20 + V[3] + G[3], c21 + V[4] + G[4], c22 + V[5] + G[5]}; - double mSi[6]; - mSi[0] = mS[4] * mS[4] - mS[2] * mS[5]; - mSi[1] = mS[1] * mS[5] - mS[3] * mS[4]; - mSi[3] = mS[2] * mS[3] - mS[1] * mS[4]; - double det = 1. / (mS[0] * mSi[0] + mS[1] * mSi[1] + mS[3] * mSi[3]); - mSi[0] *= det; - mSi[1] *= det; - mSi[3] *= det; - mSi[2] = (mS[3] * mS[3] - mS[0] * mS[5]) * det; - mSi[4] = (mS[0] * mS[4] - mS[1] * mS[3]) * det; - mSi[5] = (mS[1] * mS[1] - mS[0] * mS[2]) * det; - - fNDF += 2; - fChi2 += (+(mSi[0] * z0 + mSi[1] * z1 + mSi[3] * z2) * z0 + (mSi[1] * z0 + mSi[2] * z1 + mSi[4] * z2) * z1 + (mSi[3] * z0 + mSi[4] * z1 + mSi[5] * z2) * z2); - - double k0, k1, k2; // k = CHtS - - k0 = c00 * mSi[0] + c10 * mSi[1] + c20 * mSi[3]; - k1 = c00 * mSi[1] + c10 * mSi[2] + c20 * mSi[4]; - k2 = c00 * mSi[3] + c10 * mSi[4] + c20 * mSi[5]; - - mParam[0] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[0] -= k0 * c00 + k1 * c10 + k2 * c20; - - k0 = c10 * mSi[0] + c11 * mSi[1] + c21 * mSi[3]; - k1 = c10 * mSi[1] + c11 * mSi[2] + c21 * mSi[4]; - k2 = c10 * mSi[3] + c11 * mSi[4] + c21 * mSi[5]; - - mParam[1] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[1] -= k0 * c00 + k1 * c10 + k2 * c20; - fCov[2] -= k0 * c10 + k1 * c11 + k2 * c21; - - k0 = c20 * mSi[0] + c21 * mSi[1] + c22 * mSi[3]; - k1 = c20 * mSi[1] + c21 * mSi[2] + c22 * mSi[4]; - k2 = c20 * mSi[3] + c21 * mSi[4] + c22 * mSi[5]; - - mParam[2] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[3] -= k0 * c00 + k1 * c10 + k2 * c20; - fCov[4] -= k0 * c10 + k1 * c11 + k2 * c21; - fCov[5] -= k0 * c20 + k1 * c21 + k2 * c22; - - k0 = c30 * mSi[0] + c31 * mSi[1] + c32 * mSi[3]; - k1 = c30 * mSi[1] + c31 * mSi[2] + c32 * mSi[4]; - k2 = c30 * mSi[3] + c31 * mSi[4] + c32 * mSi[5]; - - mParam[3] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[6] -= k0 * c00 + k1 * c10 + k2 * c20; - fCov[7] -= k0 * c10 + k1 * c11 + k2 * c21; - fCov[8] -= k0 * c20 + k1 * c21 + k2 * c22; - fCov[9] -= k0 * c30 + k1 * c31 + k2 * c32; - - k0 = c40 * mSi[0] + c41 * mSi[1] + c42 * mSi[3]; - k1 = c40 * mSi[1] + c41 * mSi[2] + c42 * mSi[4]; - k2 = c40 * mSi[3] + c41 * mSi[4] + c42 * mSi[5]; - - mParam[4] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[10] -= k0 * c00 + k1 * c10 + k2 * c20; - fCov[11] -= k0 * c10 + k1 * c11 + k2 * c21; - fCov[12] -= k0 * c20 + k1 * c21 + k2 * c22; - fCov[13] -= k0 * c30 + k1 * c31 + k2 * c32; - fCov[14] -= k0 * c40 + k1 * c41 + k2 * c42; - - k0 = c50 * mSi[0] + c51 * mSi[1] + c52 * mSi[3]; - k1 = c50 * mSi[1] + c51 * mSi[2] + c52 * mSi[4]; - k2 = c50 * mSi[3] + c51 * mSi[4] + c52 * mSi[5]; - - mParam[5] += k0 * z0 + k1 * z1 + k2 * z2; - fCov[15] -= k0 * c00 + k1 * c10 + k2 * c20; - fCov[16] -= k0 * c10 + k1 * c11 + k2 * c21; - fCov[17] -= k0 * c20 + k1 * c21 + k2 * c22; - fCov[18] -= k0 * c30 + k1 * c31 + k2 * c32; - fCov[19] -= k0 * c40 + k1 * c41 + k2 * c42; - fCov[20] -= k0 * c50 + k1 * c51 + k2 * c52; - - // fit charge - - double px = mParam[3]; - double py = mParam[4]; - double pz = mParam[5]; - - double p = TMath::Sqrt(px * px + py * py + pz * pz); - double pi = 1. / p; - double qp = fSignQ * pi; - double qp3 = qp * pi * pi; - double c60 = qp3 * (c30 + c40 + c50), c61 = qp3 * (c31 + c41 + c51), c62 = qp3 * (c32 + c42 + c52); - - k0 = c60 * mSi[0] + c61 * mSi[1] + c62 * mSi[3]; - k1 = c60 * mSi[1] + c61 * mSi[2] + c62 * mSi[4]; - k2 = c60 * mSi[3] + c61 * mSi[4] + c62 * mSi[5]; - - qp += k0 * z0 + k1 * z1 + k2 * z2; - if (qp > 0) { - fSignQ = 1; - } else if (qp < 0) { - fSignQ = -1; - } else { - fSignQ = 0; - } -} - -//* Other utilities - -void AliHLT3DTrackParam::SetDirection(double Direction[3]) -{ - //* Change track direction - - if (mParam[3] * Direction[0] + mParam[4] * Direction[1] + mParam[5] * Direction[2] >= 0) { - return; - } - - mParam[3] = -mParam[3]; - mParam[4] = -mParam[4]; - mParam[5] = -mParam[5]; - fSignQ = -fSignQ; - - fCov[6] = -fCov[6]; - fCov[7] = -fCov[7]; - fCov[8] = -fCov[8]; - fCov[10] = -fCov[10]; - fCov[11] = -fCov[11]; - fCov[12] = -fCov[12]; - fCov[15] = -fCov[15]; - fCov[16] = -fCov[16]; - fCov[17] = -fCov[17]; -} - -void AliHLT3DTrackParam::RotateCoordinateSystem(double alpha) -{ - //* ! - - double cA = TMath::Cos(alpha); - double sA = TMath::Sin(alpha); - double x = mParam[0], y = mParam[1], px = mParam[3], py = mParam[4]; - mParam[0] = x * cA + y * sA; - mParam[1] = -x * sA + y * cA; - mParam[2] = mParam[2]; - mParam[3] = px * cA + py * sA; - mParam[4] = -px * sA + py * cA; - mParam[5] = mParam[5]; - - // clang-format off - double mJ[6][6] = { { cA, sA, 0, 0, 0, 0 }, - { -sA, cA, 0, 0, 0, 0 }, - { 0, 0, 1, 0, 0, 0 }, - { 0, 0, 0, cA, sA, 0 }, - { 0, 0, 0, -sA, cA, 0 }, - { 0, 0, 0, 0, 0, 1 }}; - // clang-format on - - double mA[6][6]; - for (int32_t k = 0, i = 0; i < 6; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - mA[i][j] = mA[j][i] = fCov[k]; - } - } - - double mJC[6][6]; - for (int32_t i = 0; i < 6; i++) { - for (int32_t j = 0; j < 6; j++) { - mJC[i][j] = 0; - for (int32_t k = 0; k < 6; k++) { - mJC[i][j] += mJ[i][k] * mA[k][j]; - } - } - } - - for (int32_t k = 0, i = 0; i < 6; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - fCov[k] = 0; - for (int32_t l = 0; l < 6; l++) { - fCov[k] += mJC[i][l] * mJ[j][l]; - } - } - } -} - -void AliHLT3DTrackParam::Get5Parameters(double alpha, double T[6], double C[15]) const -{ - //* ! - - AliHLT3DTrackParam t = *this; - t.RotateCoordinateSystem(alpha); - double x = t.mParam[0], y = t.mParam[1], z = t.mParam[2], px = t.mParam[3], py = t.mParam[4], pz = t.mParam[5], q = t.fSignQ; - - double p2 = px * px + py * py + pz * pz; - if (p2 < 1.e-8) { - p2 = 1; - } - double n2 = 1. / p2; - double n = sqrt(n2); - - T[5] = x; - T[0] = y; - T[1] = z; - T[2] = py / px; - T[3] = pz / px; - T[4] = q * n; - - // clang-format off - double mJ[5][6] = { { -T[2], 1, 0, 0, 0, 0 }, - { -T[3], 0, 1, 0, 0, 0 }, - { 0, 0, 0, -T[2] / px, 1. / px, 0 }, - { 0, 0, 0, -T[3] / px, 0, 1. / px }, - { 0, 0, 0, -T[4]*n2*px, -T[4]*n2*py, -T[4]*n2*pz}}; - // clang-format on - - double mA[6][6]; - for (int32_t k = 0, i = 0; i < 6; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - mA[i][j] = mA[j][i] = t.fCov[k]; - } - } - - double mJC[5][6]; - for (int32_t i = 0; i < 5; i++) { - for (int32_t j = 0; j < 6; j++) { - mJC[i][j] = 0; - for (int32_t k = 0; k < 6; k++) { - mJC[i][j] += mJ[i][k] * mA[k][j]; - } - } - } - - for (int32_t k = 0, i = 0; i < 5; i++) { - for (int32_t j = 0; j <= i; j++, k++) { - C[k] = 0; - for (int32_t l = 0; l < 6; l++) { - C[k] += mJC[i][l] * mJ[j][l]; - } - } - } -} diff --git a/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.h b/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.h deleted file mode 100644 index a762f22eb46dd..0000000000000 --- a/GPU/GPUTracking/oldFiles/AliHLT3DTrackParam.h +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file AliHLT3DTrackParam.h -/// \author Sergey Gorbunov - -#ifndef ALIHLT3DTRACKPARAM_H -#define ALIHLT3DTRACKPARAM_H - -#include "TObject.h" - -/** - * @class AliHLT3DTrackParam - */ -class AliHLT3DTrackParam : public TObject -{ - public: - //* - //* INITIALIZATION - //* - - //* Constructor - - AliHLT3DTrackParam() : fChi2(0), fNDF(0), fSignQ(0) {} - - //* Destructor (empty) - - virtual ~AliHLT3DTrackParam() {} - - //* - //* ACCESSORS - //* - - //* Simple accessors - - double GetX() const { return mParam[0]; } - double GetY() const { return mParam[1]; } - double GetZ() const { return mParam[2]; } - double GetPx() const { return mParam[3]; } - double GetPy() const { return mParam[4]; } - double GetPz() const { return mParam[5]; } - double GetChi2() const { return fChi2; } - int32_t GetNDF() const { return fNDF; } - int32_t GetCharge() const { return fSignQ; } - - double GetParameter(int32_t i) const { return mParam[i]; } - double GetCovariance(int32_t i) const { return fCov[i]; } - double GetCovariance(int32_t i, int32_t j) const { return fCov[(j <= i) ? i * (i + 1) / 2 + j : j * (j + 1) / 2 + i]; } - - //* - //* Accessors - //* - - const double* Param() const { return mParam; } - const double* Cov() const { return fCov; } - double X() const { return mParam[0]; } - double Y() const { return mParam[1]; } - double Z() const { return mParam[2]; } - double Px() const { return mParam[3]; } - double Py() const { return mParam[4]; } - double Pz() const { return mParam[5]; } - double Chi2() const { return fChi2; } - int32_t NDF() const { return fNDF; } - int32_t Charge() const { return fSignQ; } - - //* Accessors with calculations( &value, &estimated sigma ) - //* error flag returned (0 means no error during calculations) - - //* - //* MODIFIERS - //* - - void SetParam(int32_t i, double v) { mParam[i] = v; } - void SetCov(int32_t i, double v) { fCov[i] = v; } - void SetX(double v) { mParam[0] = v; } - void SetY(double v) { mParam[1] = v; } - void SetZ(double v) { mParam[2] = v; } - void SetPx(double v) { mParam[3] = v; } - void SetPy(double v) { mParam[4] = v; } - void SetPz(double v) { mParam[5] = v; } - void SetChi2(double v) { fChi2 = v; } - void SetNDF(int32_t v) { fNDF = v; } - void SetCharge(int32_t v) { fSignQ = v; } - - //* - //* UTILITIES - //* - - //* Transport utilities - - double GetDStoPoint(double Bz, const double xyz[3], const double* T0 = 0) const; - - void TransportToDS(double Bz, double DS, double* T0 = 0); - - void TransportToPoint(double Bz, const double xyz[3], double* T0 = 0) { TransportToDS(Bz, GetDStoPoint(Bz, xyz, T0), T0); } - - void TransportToPoint(double Bz, double x, double y, double z, const double* T0 = 0) - { - double xyz[3] = {x, y, z}; - TransportToPoint(Bz, xyz, T0); - } - - //* Fit utilities - - void InitializeCovarianceMatrix(); - - void GetGlueMatrix(const double p[3], double G[6], const double* T0 = 0) const; - - void Filter(const double m[3], const double V[6], const double G[6]); - - //* Other utilities - - void SetDirection(double Direction[3]); - - void RotateCoordinateSystem(double alpha); - - void Get5Parameters(double alpha, double T[6], double C[15]) const; - - protected: - double mParam[6]; // Parameters ( x, y, z, px, py, pz ): 3-position and 3-momentum - double fCov[21]; // Covariance matrix - double fChi2; // Chi^2 - int32_t fNDF; // Number of Degrees of Freedom - int32_t fSignQ; // Charge - - ClassDef(AliHLT3DTrackParam, 1); -}; - -#endif diff --git a/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.cxx b/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.cxx deleted file mode 100644 index efecae4fc9b47..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.cxx +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCGMOfflineFitter.cxx -/// \author Sergey Gorbunov - -#if (defined(GPUCA_ALIROOT_LIB) && !defined(GPUCA_GPUCODE)) - -#include "GPUTPCGMOfflineFitter.h" - -#include "GPUCommonMath.h" -#include "GPUTPCGMMergedTrack.h" -#include "GPUTPCGMMergedTrackHit.h" -#include "AliHLTTPCGeometry.h" -#include -#include "AliTracker.h" -#include "AliMagF.h" -#include "AliExternalTrackParam.h" -#include "AliTPCtracker.h" -#include "AliTPCParam.h" -#include "AliTPCseed.h" -#include "AliTPCclusterMI.h" -#include "AliTPCcalibDB.h" -#include "AliTPCParamSR.h" -#include "GPUTPCGMPropagator.h" -#include "AliTPCReconstructor.h" -#include "AliHLTTPCClusterTransformation.h" - -#define DOUBLE 1 - -GPUTPCGMOfflineFitter::GPUTPCGMOfflineFitter() : fCAParam() {} - -GPUTPCGMOfflineFitter::~GPUTPCGMOfflineFitter() {} - -void GPUTPCGMOfflineFitter::Initialize(const GPUParam& hltParam, long TimeStamp, bool isMC) -{ - // - - AliHLTTPCClusterTransformation hltTransform; - hltTransform.Init(0., TimeStamp, isMC, 1); - - // initialisation of AliTPCtracker as it is done in AliTPCReconstructor.cxx - - AliTPCcalibDB* calib = AliTPCcalibDB::Instance(); - const AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - calib->SetExBField(field); - - AliTPCParam* param = AliTPCcalibDB::Instance()->GetParameters(); - if (!param) { - AliWarning("Loading default TPC parameters !"); - param = new AliTPCParamSR; - } - param->ReadGeoMatrices(); - - AliTPCReconstructor* tpcRec = new AliTPCReconstructor(); - tpcRec->SetRecoParam(AliTPCcalibDB::Instance()->GetTransform()->GetCurrentRecoParam()); - - //(this)->~AliTPCtracker(); //call the destructor explicitly - // new (this) AliTPCtracker(param); // call the constructor - - AliTPCtracker::fSectors = AliTPCtracker::fInnerSec; - // AliTPCReconstructor::ParseOptions(tracker); : not important, it only set useHLTClusters flag - - fCAParam = hltParam; -} - -void GPUTPCGMOfflineFitter::RefitTrack(GPUTPCGMMergedTrack& track, const GPUTPCGMPolynomialField* field, GPUTPCGMMergedTrackHit* clusters) -{ - // copy of HLT RefitTrack() with calling of the offline fit utilities - - if (!track.OK()) { - return; - } - - int32_t nTrackHits = track.NClusters(); - cout << "call FitOffline .. " << endl; - bool ok = FitOffline(field, track, clusters + track.FirstClusterRef(), nTrackHits); - cout << ".. end of call FitOffline " << endl; - - GPUTPCGMTrackParam t = track.Param(); - float Alpha = track.Alpha(); - - if (fabsf(t.QPt()) < 1.e-4) { - t.QPt() = 1.e-4; - } - - track.SetOK(ok); - track.SetNClustersFitted(nTrackHits); - track.Param() = t; - track.Alpha() = Alpha; - - { - int32_t ind = track.FirstClusterRef(); - float alphaa = fCAParam.Alpha(clusters[ind].slice); - float xx = clusters[ind].fX; - float yy = clusters[ind].fY; - float zz = clusters[ind].fZ - track.Param().GetZOffset(); - float sinA = CAMath::Sin(alphaa - track.Alpha()); - float cosA = CAMath::Cos(alphaa - track.Alpha()); - track.SetLastX(xx * cosA - yy * sinA); - track.SetLastY(xx * sinA + yy * cosA); - track.SetLastZ(zz); - } -} - -int32_t GPUTPCGMOfflineFitter::CreateTPCclusterMI(const GPUTPCGMMergedTrackHit& h, AliTPCclusterMI& c) -{ - // Create AliTPCclusterMI for the HLT hit - - AliTPCclusterMI tmp; // everything is set to 0 by constructor - c = tmp; - - // add the information we have - - Int_t sector, row; - AliHLTTPCGeometry::Slice2Sector(h.slice, h.row, sector, row); - c.SetDetector(sector); - c.SetRow(row); // ?? is it right row numbering for the TPC tracker ?? - c.SetX(h.fX); - c.SetY(h.fY); - c.SetZ(h.fZ); - int32_t index = (((sector << 8) + row) << 16) + 0; - return index; -} - -bool GPUTPCGMOfflineFitter::FitOffline(const GPUTPCGMPolynomialField* field, GPUTPCGMMergedTrack& gmtrack, GPUTPCGMMergedTrackHit* clusters, int32_t& N) -{ - const float maxSinPhi = GPUCA_MAX_SIN_PHI; - - int32_t maxN = N; - float covYYUpd = 0.; - float lastUpdateX = -1.; - - const bool rejectChi2ThisRound = 0; - const bool markNonFittedClusters = 0; - const double kDeg2Rad = 3.14159265358979323846 / 180.; - const float maxSinForUpdate = CAMath::Sin(70. * kDeg2Rad); - - bool ok = 1; - - AliTPCtracker::SetIteration(2); - - AliTPCseed seed; - gmtrack.Param().GetExtParam(seed, gmtrack.Alpha()); - - AliTPCtracker::AddCovariance(&seed); - - N = 0; - lastUpdateX = -1; - - // find last leg - int32_t ihitStart = 0; - for (int32_t ihit = 0; ihit < maxN; ihit++) { - if (clusters[ihit].leg != clusters[ihitStart].leg) { - ihitStart = ihit; - } - } - - for (int32_t ihit = ihitStart; ihit < maxN; ihit++) { - if (clusters[ihit].fState < 0) { - continue; // hit is excluded from fit - } - float xx = clusters[ihit].fX; - float yy = clusters[ihit].fY; - float zz = clusters[ihit].fZ; - - if (DOUBLE && ihit + 1 >= 0 && ihit + 1 < maxN && clusters[ihit].row == clusters[ihit + 1].row) { - float count = 1.; - do { - if (clusters[ihit].slice != clusters[ihit + 1].slice || clusters[ihit].leg != clusters[ihit + 1].leg || fabsf(clusters[ihit].fY - clusters[ihit + 1].fY) > 4. || fabsf(clusters[ihit].fZ - clusters[ihit + 1].fZ) > 4.) { - break; - } - ihit += 1; - xx += clusters[ihit].fX; - yy += clusters[ihit].fY; - zz += clusters[ihit].fZ; - count += 1.; - } while (ihit + 1 >= 0 && ihit + 1 < maxN && clusters[ihit].row == clusters[ihit + 1].row); - xx /= count; - yy /= count; - zz /= count; - } - - // Create AliTPCclusterMI for the hit - - AliTPCclusterMI cluster; - Int_t tpcindex = CreateTPCclusterMI(clusters[ihit], cluster); - if (tpcindex < 0) { - continue; - } - Double_t sy2 = 0, sz2 = 0; - AliTPCtracker::ErrY2Z2(&seed, &cluster, sy2, sz2); - cluster.SetSigmaY2(sy2); - cluster.SetSigmaZ2(sz2); - cluster.SetQ(10); - cluster.SetMax(10); - - Int_t iRow = clusters[ihit].row; - - if (iRow < AliHLTTPCGeometry::GetNRowLow()) { - AliTPCtracker::fSectors = AliTPCtracker::fInnerSec; - } else { - AliTPCtracker::fSectors = AliTPCtracker::fOuterSec; - } - - seed.SetClusterIndex2(iRow, tpcindex); - seed.SetClusterPointer(iRow, &cluster); - seed.SetCurrentClusterIndex1(tpcindex); - - int32_t retVal; - float threshold = 3. + (lastUpdateX >= 0 ? (fabsf(seed.GetX() - lastUpdateX) / 2) : 0.); - if (N > 2 && (fabsf(yy - seed.GetY()) > threshold || fabsf(zz - seed.GetZ()) > threshold)) { - retVal = 2; - } else { - Int_t err = !(AliTPCtracker::FollowToNext(seed, iRow)); - - const int32_t err2 = N > 0 && CAMath::Abs(seed.GetSnp()) >= maxSinForUpdate; - if (err || err2) { - if (markNonFittedClusters) { - if (N > 0 && (fabsf(yy - seed.GetY()) > 3 || fabsf(zz - seed.GetZ()) > 3)) { - clusters[ihit].fState = -2; - } else if (err && err >= -3) { - clusters[ihit].fState = -1; - } - } - continue; - } - - // retVal = prop.Update( yy, zz, clusters[ihit].row, param, rejectChi2ThisRound); - retVal = 0; - } - - if (retVal == 0) // track is updated - { - lastUpdateX = seed.GetX(); - covYYUpd = seed.GetCovariance()[0]; - ihitStart = ihit; - N++; - } else if (retVal == 2) { // cluster far away form the track - if (markNonFittedClusters) { - clusters[ihit].fState = -2; - } - } else { - break; // bad chi2 for the whole track, stop the fit - } - } // end loop over clusters - - GPUTPCGMTrackParam t; - t.SetExtParam(seed); - - float Alpha = seed.GetAlpha(); - - t.ConstrainSinPhi(); - - bool ok1 = N >= GPUCA_TRACKLET_SELECTOR_MIN_HITS_B5(t.GetQPt()) && t.CheckNumericalQuality(covYYUpd); - if (!ok1) { - return (false); - } - - // const float kDeg2Rad = 3.1415926535897 / 180.f; - const float kSectAngle = 2 * 3.1415926535897 / 18.f; - - if (fCAParam.GetTrackReferenceX() <= 500) { - GPUTPCGMPropagator prop; - prop.SetMaterialTPC(); - prop.SetPolynomialField(field); - prop.SetMaxSinPhi(maxSinPhi); - prop.SetToyMCEventsFlag(fCAParam.ToyMCEventsFlag()); - - for (int32_t k = 0; k < 3; k++) // max 3 attempts - { - int32_t err = prop.PropagateToXAlpha(fCAParam.GetTrackReferenceX(), Alpha, 0); - t.ConstrainSinPhi(); - if (fabsf(t.GetY()) <= t.GetX() * tan(kSectAngle / 2.f)) { - break; - } - float dAngle = floor(atan2(t.GetY(), t.GetX()) / kDeg2Rad / 20.f + 0.5f) * kSectAngle; - Alpha += dAngle; - if (err || k == 2) { - t.Rotate(dAngle); - break; - } - } - } else if (fabsf(t.GetY()) > t.GetX() * tan(kSectAngle / 2.f)) { - float dAngle = floor(atan2(t.GetY(), t.GetX()) / kDeg2Rad / 20.f + 0.5f) * kSectAngle; - t.Rotate(dAngle); - Alpha += dAngle; - } - if (Alpha > 3.1415926535897) { - Alpha -= 2 * 3.1415926535897; - } else if (Alpha <= -3.1415926535897) { - Alpha += 2 * 3.1415926535897; - } - - gmtrack.Param() = t; - gmtrack.Alpha() = Alpha; - - return (ok); -} - -#endif diff --git a/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.h b/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.h deleted file mode 100644 index 8daf8102a8d20..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCGMOfflineFitter.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCGMOfflineFitter.h -/// \author Sergey Gorbunov - -#ifndef GPUTPCGMOfflineFitter_H -#define GPUTPCGMOfflineFitter_H - -#if (defined(GPUCA_ALIROOT_LIB) && !defined(GPUCA_GPUCODE)) - -#include "GPUParam.h" -#include "AliTPCtracker.h" - -class GPUTPCGMMergedTrack; -class GPUTPCGMMergedTrackHit; -class AliTPCclusterMI; -class GPUTPCGMPolynomialField; - -class GPUTPCGMOfflineFitter : public AliTPCtracker -{ - public: - GPUTPCGMOfflineFitter(); - ~GPUTPCGMOfflineFitter(); - - void Initialize(const GPUParam& hltParam, long TimeStamp, bool isMC); - - void RefitTrack(GPUTPCGMMergedTrack& track, const GPUTPCGMPolynomialField* field, GPUTPCGMMergedTrackHit* clusters); - - int32_t CreateTPCclusterMI(const GPUTPCGMMergedTrackHit& h, AliTPCclusterMI& c); - - bool FitOffline(const GPUTPCGMPolynomialField* field, GPUTPCGMMergedTrack& gmtrack, GPUTPCGMMergedTrackHit* clusters, int32_t& N); - - private: - GPUParam fCAParam; -}; - -#endif - -#endif diff --git a/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.cxx b/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.cxx deleted file mode 100644 index 83a9225afd86d..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.cxx +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCMCPoint.cxx -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#include "GPUTPCMCPoint.h" - -GPUTPCMCPoint::GPUTPCMCPoint() : fX(0), fY(0), fZ(0), fSx(0), fSy(0), fSz(0), fTime(0), mISlice(0), fTrackID(0) -{ - //* Default constructor -} diff --git a/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.h b/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.h deleted file mode 100644 index be283433061e3..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCMCPoint.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCMCPoint.h -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#ifndef GPUTPCMCPOINT_H -#define GPUTPCMCPOINT_H - -#include "GPUTPCDef.h" - -/** - * @class GPUTPCMCPoint - * store MC point information for GPUTPCPerformance - */ -class GPUTPCMCPoint -{ - public: - GPUTPCMCPoint(); - - float X() const { return fX; } - float Y() const { return fY; } - float Z() const { return fZ; } - float Sx() const { return fSx; } - float Sy() const { return fSy; } - float Sz() const { return fSz; } - float Time() const { return fTime; } - int32_t ISlice() const { return mISlice; } - int32_t TrackID() const { return fTrackID; } - - void SetX(float v) { fX = v; } - void SetY(float v) { fY = v; } - void SetZ(float v) { fZ = v; } - void SetSx(float v) { fSx = v; } - void SetSy(float v) { fSy = v; } - void SetSz(float v) { fSz = v; } - void SetTime(float v) { fTime = v; } - void SetISlice(int32_t v) { mISlice = v; } - void SetTrackID(int32_t v) { fTrackID = v; } - - static bool Compare(const GPUTPCMCPoint& p1, const GPUTPCMCPoint& p2) - { - if (p1.fTrackID != p2.fTrackID) { - return (p1.fTrackID < p2.fTrackID); - } - if (p1.mISlice != p2.mISlice) { - return (p1.mISlice < p2.mISlice); - } - return (p1.Sx() < p2.Sx()); - } - - static bool CompareSlice(const GPUTPCMCPoint& p, int32_t slice) { return (p.ISlice() < slice); } - - static bool CompareX(const GPUTPCMCPoint& p, float X) { return (p.Sx() < X); } - - protected: - float fX; //* global X position - float fY; //* global Y position - float fZ; //* global Z position - float fSx; //* slice X position - float fSy; //* slice Y position - float fSz; //* slice Z position - float fTime; //* time - int32_t mISlice; //* slice number - int32_t fTrackID; //* mc track number -}; - -#endif // GPUTPCMCPOINT_H diff --git a/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.cxx b/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.cxx deleted file mode 100644 index 12a52e0e04b4f..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.cxx +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCMCTrack.cxx -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#include "GPUTPCMCTrack.h" -#include "GPUCommonMath.h" -#include "TDatabasePDG.h" -#include "TParticle.h" - -GPUTPCMCTrack::GPUTPCMCTrack() : fPDG(0), fP(0), fPt(0), mNHits(0), fNMCPoints(0), fFirstMCPointID(0), fNReconstructed(0), fSet(0), fNTurns(0) -{ - //* Default constructor - for (int32_t i = 0; i < 7; i++) { - fPar[i] = 0; - fTPCPar[i] = 0; - } -} - -GPUTPCMCTrack::GPUTPCMCTrack(const TParticle* part) : fPDG(0), fP(0), fPt(0), mNHits(0), fNMCPoints(0), fFirstMCPointID(0), fNReconstructed(0), fSet(0), fNTurns(0) -{ - //* Constructor from TParticle - - for (int32_t i = 0; i < 7; i++) { - fPar[i] = 0; - } - for (int32_t i = 0; i < 7; i++) { - fTPCPar[i] = 0; - } - fP = 0; - fPt = 0; - - if (!part) { - return; - } - TLorentzVector mom, vtx; - part->ProductionVertex(vtx); - part->Momentum(mom); - fPar[0] = part->Vx(); - fPar[1] = part->Vy(); - fPar[2] = part->Vz(); - fP = part->P(); - fPt = part->Pt(); - double pi = (fP > 1.e-4) ? 1. / fP : 0; - fPar[3] = part->Px() * pi; - fPar[4] = part->Py() * pi; - fPar[5] = part->Pz() * pi; - fPar[6] = 0; - fPDG = part->GetPdgCode(); - if (CAMath::Abs(fPDG) < 100000) { - TParticlePDG* pPDG = TDatabasePDG::Instance()->GetParticle(fPDG); - if (pPDG) { - fPar[6] = pPDG->Charge() / 3.0 * pi; - } - } -} - -void GPUTPCMCTrack::SetTPCPar(float X, float Y, float Z, float Px, float Py, float Pz) -{ - //* Set parameters at TPC entrance - - for (int32_t i = 0; i < 7; i++) { - fTPCPar[i] = 0; - } - - fTPCPar[0] = X; - fTPCPar[1] = Y; - fTPCPar[2] = Z; - double p = CAMath::Sqrt(Px * Px + Py * Py + Pz * Pz); - double pi = (p > 1.e-4) ? 1. / p : 0; - fTPCPar[3] = Px * pi; - fTPCPar[4] = Py * pi; - fTPCPar[5] = Pz * pi; - fTPCPar[6] = 0; - if (CAMath::Abs(fPDG) < 100000) { - TParticlePDG* pPDG = TDatabasePDG::Instance()->GetParticle(fPDG); - if (pPDG) { - fTPCPar[6] = pPDG->Charge() / 3.0 * pi; - } - } -} diff --git a/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.h b/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.h deleted file mode 100644 index 9f2e4da6ada54..0000000000000 --- a/GPU/GPUTracking/oldFiles/GPUTPCMCTrack.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file GPUTPCMCTrack.h -/// \author Sergey Gorbunov, Ivan Kisel, David Rohr - -#ifndef GPUTPCMCTRACK_H -#define GPUTPCMCTRACK_H - -#include "GPUTPCDef.h" - -class TParticle; - -/** - * @class GPUTPCMCTrack - * store MC track information for GPUTPCPerformance - */ -class GPUTPCMCTrack -{ - public: - GPUTPCMCTrack(); - GPUTPCMCTrack(const TParticle* part); - - void SetTPCPar(float X, float Y, float Z, float Px, float Py, float Pz); - - int32_t PDG() const { return fPDG; } - const double* Par() const { return fPar; } - const double* TPCPar() const { return fTPCPar; } - double P() const { return fP; } - double Pt() const { return fPt; } - - int32_t NHits() const { return mNHits; } - int32_t NMCPoints() const { return fNMCPoints; } - int32_t FirstMCPointID() const { return fFirstMCPointID; } - int32_t NReconstructed() const { return fNReconstructed; } - int32_t Set() const { return fSet; } - int32_t NTurns() const { return fNTurns; } - - void SetP(float v) { fP = v; } - void SetPt(float v) { fPt = v; } - void SetPDG(int32_t v) { fPDG = v; } - void SetPar(int32_t i, double v) { fPar[i] = v; } - void SetTPCPar(int32_t i, double v) { fTPCPar[i] = v; } - void SetNHits(int32_t v) { mNHits = v; } - void SetNMCPoints(int32_t v) { fNMCPoints = v; } - void SetFirstMCPointID(int32_t v) { fFirstMCPointID = v; } - void SetNReconstructed(int32_t v) { fNReconstructed = v; } - void SetSet(int32_t v) { fSet = v; } - void SetNTurns(int32_t v) { fNTurns = v; } - - protected: - int32_t fPDG; //* particle pdg code - double fPar[7]; //* x,y,z,ex,ey,ez,q/p - double fTPCPar[7]; //* x,y,z,ex,ey,ez,q/p at TPC entrance (x=y=0 means no information) - double fP, fPt; //* momentum and transverse momentum - int32_t mNHits; //* N TPC clusters - int32_t fNMCPoints; //* N MC points - int32_t fFirstMCPointID; //* id of the first MC point in the points array - int32_t fNReconstructed; //* how many times is reconstructed - int32_t fSet; //* set of tracks 0-OutSet, 1-ExtraSet, 2-RefSet - int32_t fNTurns; //* N of turns in the current sector -}; - -#endif // GPUTPCMCTrack diff --git a/GPU/GPUTracking/qa/GPUQA.cxx b/GPU/GPUTracking/qa/GPUQA.cxx index 59293dbfd1812..34318a1bab613 100644 --- a/GPU/GPUTracking/qa/GPUQA.cxx +++ b/GPU/GPUTracking/qa/GPUQA.cxx @@ -78,7 +78,7 @@ #include "utils/qconfig.h" #include "utils/timer.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #ifdef GPUCA_MERGER_BY_MC_LABEL #define CHECK_CLUSTER_STATE_INIT_LEG_BY_MC() \ @@ -315,12 +315,12 @@ void GPUQA::createHist(T*& h, const char* name, Args... args) p.second->emplace_back(&h); } -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { struct GPUQAGarbageCollection { std::tuple>, std::vector>, std::vector>, std::vector>, std::vector>> v; }; -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu template T* GPUQA::createGarbageCollected(Args... args) @@ -1379,7 +1379,7 @@ void GPUQA::RunQA(bool matchOnly, const std::vector* tracksEx prop.SetTrack(¶m, alpha); bool inFlyDirection = 0; if (mConfig.strict) { - const float dx = param.X() - std::max(mclocal[0], TRACK_EXPECTED_REFERENCE_X_DEFAULT); // Limit distance check if the O2 MC position is farther inside than the AliRoot MC position. + const float dx = param.X() - std::max(mclocal[0], TRACK_EXPECTED_REFERENCE_X_DEFAULT); // Limit distance check const float dy = param.Y() - mclocal[1]; const float dz = getdz(); if (dx * dx + dy * dy + dz * dz > 5.f * 5.f) { diff --git a/GPU/GPUTracking/qa/GPUQA.h b/GPU/GPUTracking/qa/GPUQA.h index b3175d9fd32c7..76774f740477f 100644 --- a/GPU/GPUTracking/qa/GPUQA.h +++ b/GPU/GPUTracking/qa/GPUQA.h @@ -33,7 +33,7 @@ typedef int16_t Color_t; #if !defined(GPUCA_BUILD_QA) || defined(GPUCA_GPUCODE) -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -60,7 +60,7 @@ class GPUQA void UpdateChain(GPUChainTracking* chain) {} }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #else @@ -84,7 +84,7 @@ struct ClusterNativeAccess; struct AliHLTTPCClusterMCLabel; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { class GPUChainTracking; struct GPUParam; @@ -352,7 +352,7 @@ inline bool GPUQA::SuppressTrack(int32_t iTrack) const { return (mConfig.matchMC inline bool GPUQA::SuppressHit(int32_t iHit) const { return (mConfig.matchMCLabels.size() && !mGoodHits[mNEvents - 1][iHit]); } inline int32_t GPUQA::HitAttachStatus(int32_t iHit) const { return (mClusterParam.size() && mClusterParam[iHit].fakeAttached ? (mClusterParam[iHit].attached ? 1 : 2) : 0); } -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif #endif diff --git a/GPU/GPUTracking/qa/genEvents.cxx b/GPU/GPUTracking/qa/genEvents.cxx index 20c9b7bec096c..3bd4779dd13f0 100644 --- a/GPU/GPUTracking/qa/genEvents.cxx +++ b/GPU/GPUTracking/qa/genEvents.cxx @@ -40,9 +40,9 @@ #include "../utils/qconfig.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace std; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { extern GPUSettingsStandalone configStandalone; } diff --git a/GPU/GPUTracking/qa/genEvents.h b/GPU/GPUTracking/qa/genEvents.h index 943fa1e787674..43c091099bcf0 100644 --- a/GPU/GPUTracking/qa/genEvents.h +++ b/GPU/GPUTracking/qa/genEvents.h @@ -17,7 +17,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -76,6 +76,6 @@ class genEvents #endif } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/GPUTracking/utils/qlibload.h b/GPU/GPUTracking/utils/qlibload.h index 85d81236fde3c..a0dfca8ef3f1e 100644 --- a/GPU/GPUTracking/utils/qlibload.h +++ b/GPU/GPUTracking/utils/qlibload.h @@ -29,9 +29,7 @@ #define LIBRARY_FUNCTION dlsym #endif -#if defined(GPUCA_ALIROOT_LIB) -#define LIBRARY_PREFIX "Ali" -#elif defined(GPUCA_O2_LIB) +#if defined(GPUCA_O2_LIB) #define LIBRARY_PREFIX "O2" #else #define LIBRARY_PREFIX "" diff --git a/GPU/TPCFastTransformation/BandMatrixSolver.cxx b/GPU/TPCFastTransformation/BandMatrixSolver.cxx index 680216d6e14de..d05d1ed221b4e 100644 --- a/GPU/TPCFastTransformation/BandMatrixSolver.cxx +++ b/GPU/TPCFastTransformation/BandMatrixSolver.cxx @@ -21,9 +21,9 @@ #include using namespace std; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -templateClassImp(GPUCA_NAMESPACE::gpu::BandMatrixSolver); +templateClassImp(o2::gpu::BandMatrixSolver); template <> int32_t BandMatrixSolver<0>::test(bool prn) @@ -193,4 +193,4 @@ int32_t BandMatrixSolver<0>::test(bool prn) return ok && ok1; } -template class GPUCA_NAMESPACE::gpu::BandMatrixSolver<0>; +template class o2::gpu::BandMatrixSolver<0>; diff --git a/GPU/TPCFastTransformation/BandMatrixSolver.h b/GPU/TPCFastTransformation/BandMatrixSolver.h index b548ad60f58e8..f11f538e49275 100644 --- a/GPU/TPCFastTransformation/BandMatrixSolver.h +++ b/GPU/TPCFastTransformation/BandMatrixSolver.h @@ -25,7 +25,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -113,9 +113,7 @@ class BandMatrixSolver std::vector mA; std::vector mB; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(BandMatrixSolver, 0); -#endif }; template <> @@ -260,6 +258,6 @@ inline void BandMatrixSolver::solveType1() } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/CMakeLists.txt b/GPU/TPCFastTransformation/CMakeLists.txt index b338e1492cc6c..32c22c5193603 100644 --- a/GPU/TPCFastTransformation/CMakeLists.txt +++ b/GPU/TPCFastTransformation/CMakeLists.txt @@ -119,60 +119,6 @@ if(${ALIGPU_BUILD_TYPE} STREQUAL "O2") endif() -if(${ALIGPU_BUILD_TYPE} STREQUAL "ALIROOT") - add_definitions(-DGPUCA_ALIROOT_LIB -DGPUCA_NO_FMT) - - set(SRCS ${SRCS} TPCFastTransformManager.cxx TPCFastTransformQA.cxx - ${AliRoot_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCGeometry.cxx - ${AliRoot_SOURCE_DIR}/HLT/TPCLib/AliHLTTPCLog.cxx) - #set(HDRS_CINT ${HDRS_CINT_O2} TPCFastTransformManager.h TPCFastTransformQA.h ) - set(HDRS_CINT TPCFastTransformManager.h TPCFastTransformQA.h ) - - # Enable Vc - alice_usevc() - - include_directories(SYSTEM ${ROOT_INCLUDE_DIR}) - include_directories(${AliRoot_SOURCE_DIR}/GPU/TPCFastTransformation - ${AliRoot_SOURCE_DIR}/GPU/TPCFastTransformation/devtools - ${AliRoot_SOURCE_DIR}/GPU/Common - ${AliRoot_SOURCE_DIR}/GPU/Utils - ${AliRoot_SOURCE_DIR}/HLT/BASE - ${AliRoot_SOURCE_DIR}/HLT/TPCLib - ${AliRoot_SOURCE_DIR}/TPC/TPCbase - ${AliRoot_SOURCE_DIR}/STEER/STEERBase) - - # Generate the dictionary - get_directory_property(incdirs INCLUDE_DIRECTORIES) - generate_dictionary_flat("Ali${MODULE}" "TPCFastTransformationLinkDef_AliRoot.h" - "${HDRS_CINT}" "${incdirs}") - - # Generate the ROOT map Dependecies - set(LIBDEPS STEERBase HLTbase TPCbase) - generate_rootmap( - "Ali${MODULE}" "${LIBDEPS}" - "${CMAKE_CURRENT_SOURCE_DIR}/TPCFastTransformationLinkDef_AliRoot.h") - # Don't pass Vc to root - set(LIBDEPS ${LIBDEPS} Vc) - - # Add a library to the project using the specified source files - add_library_tested(Ali${MODULE} SHARED ${SRCS} G__Ali${MODULE}.cxx) - target_link_libraries(Ali${MODULE} ${LIBDEPS}) - - # Additional compilation flags - set_target_properties(Ali${MODULE} PROPERTIES COMPILE_FLAGS "") - - # System dependent: Modify the way the library is build - if(${CMAKE_SYSTEM} MATCHES Darwin) - set_target_properties(Ali${MODULE} - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - endif(${CMAKE_SYSTEM} MATCHES Darwin) - - # Installation - install(TARGETS Ali${MODULE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS_CINT_O2} DESTINATION include) -endif() - if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") add_library(${MODULE} SHARED ${SRCS}) endif() diff --git a/GPU/TPCFastTransformation/ChebyshevFit1D.cxx b/GPU/TPCFastTransformation/ChebyshevFit1D.cxx index 011243f5e158f..d709e5b9af92d 100644 --- a/GPU/TPCFastTransformation/ChebyshevFit1D.cxx +++ b/GPU/TPCFastTransformation/ChebyshevFit1D.cxx @@ -20,7 +20,7 @@ #include "GPUCommonLogger.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; void ChebyshevFit1D::reset(int32_t order, double xMin, double xMax) { diff --git a/GPU/TPCFastTransformation/ChebyshevFit1D.h b/GPU/TPCFastTransformation/ChebyshevFit1D.h index f1726ce063f64..591641839dd20 100644 --- a/GPU/TPCFastTransformation/ChebyshevFit1D.h +++ b/GPU/TPCFastTransformation/ChebyshevFit1D.h @@ -20,7 +20,7 @@ #include "GPUCommonDef.h" #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -106,6 +106,6 @@ inline double ChebyshevFit1D::eval(double x) } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx index 26f565b15dab4..e12c98a8a400b 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.cxx @@ -12,7 +12,7 @@ #include "CorrectionMapsHelper.h" #include "GPUCommonLogger.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; //________________________________________________________ void CorrectionMapsHelper::clear() diff --git a/GPU/TPCFastTransformation/CorrectionMapsHelper.h b/GPU/TPCFastTransformation/CorrectionMapsHelper.h index 100f871f2ec63..32ff6e1f06b10 100644 --- a/GPU/TPCFastTransformation/CorrectionMapsHelper.h +++ b/GPU/TPCFastTransformation/CorrectionMapsHelper.h @@ -23,7 +23,7 @@ #include "GPUCommonDef.h" #include "TPCFastTransform.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -57,15 +57,15 @@ class CorrectionMapsHelper mCorrMap->InverseTransformYZtoNominalYZ(slice, row, y, z, ny, nz, mCorrMapRef, mCorrMapMShape, (mScaleInverse ? mLumiScale : 0), (mScaleInverse ? 1 : 0), mLumiScaleMode); } - GPUd() const GPUCA_NAMESPACE::gpu::TPCFastTransform* getCorrMap() const { return mCorrMap; } - GPUd() const GPUCA_NAMESPACE::gpu::TPCFastTransform* getCorrMapRef() const { return mCorrMapRef; } - GPUd() const GPUCA_NAMESPACE::gpu::TPCFastTransform* getCorrMapMShape() const { return mCorrMapMShape; } + GPUd() const o2::gpu::TPCFastTransform* getCorrMap() const { return mCorrMap; } + GPUd() const o2::gpu::TPCFastTransform* getCorrMapRef() const { return mCorrMapRef; } + GPUd() const o2::gpu::TPCFastTransform* getCorrMapMShape() const { return mCorrMapMShape; } bool getOwner() const { return mOwner; } - void setCorrMap(GPUCA_NAMESPACE::gpu::TPCFastTransform* m); - void setCorrMapRef(GPUCA_NAMESPACE::gpu::TPCFastTransform* m); - void setCorrMapMShape(GPUCA_NAMESPACE::gpu::TPCFastTransform* m); + void setCorrMap(o2::gpu::TPCFastTransform* m); + void setCorrMapRef(o2::gpu::TPCFastTransform* m); + void setCorrMapMShape(o2::gpu::TPCFastTransform* m); void reportScaling(); void setInstLumiCTP(float v) { @@ -125,9 +125,9 @@ class CorrectionMapsHelper void setUpdatedLumi() { mUpdatedFlags |= UpdateFlags::LumiBit; } #if !defined(GPUCA_GPUCODE_DEVICE) - void setCorrMap(std::unique_ptr&& m); - void setCorrMapRef(std::unique_ptr&& m); - void setCorrMapMShape(std::unique_ptr&& m); + void setCorrMap(std::unique_ptr&& m); + void setCorrMapRef(std::unique_ptr&& m); + void setCorrMapMShape(std::unique_ptr&& m); #endif void setOwner(bool v); void acknowledgeUpdate() { mUpdatedFlags = 0; } @@ -181,15 +181,13 @@ class CorrectionMapsHelper float mInstCTPLumiOverride = -1.f; // optional value to override inst lumi from CTP bool mEnableMShape = false; ///< use v shape correction bool mScaleInverse{false}; // if set to false the inverse correction is already scaled and will not scaled again - GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform - GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform - GPUCA_NAMESPACE::gpu::TPCFastTransform* mCorrMapMShape{nullptr}; // correction map for v-shape distortions on A-side -#ifndef GPUCA_ALIROOT_LIB + o2::gpu::TPCFastTransform* mCorrMap{nullptr}; // current transform + o2::gpu::TPCFastTransform* mCorrMapRef{nullptr}; // reference transform + o2::gpu::TPCFastTransform* mCorrMapMShape{nullptr}; // correction map for v-shape distortions on A-side ClassDefNV(CorrectionMapsHelper, 6); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/MultivariatePolynomial.h b/GPU/TPCFastTransformation/MultivariatePolynomial.h index 8da69b6978134..4fd2157409133 100644 --- a/GPU/TPCFastTransformation/MultivariatePolynomial.h +++ b/GPU/TPCFastTransformation/MultivariatePolynomial.h @@ -28,7 +28,7 @@ #endif #endif -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { /// Class for multivariate polynomials. @@ -158,9 +158,7 @@ class MultivariatePolynomial : public FlatObject, public MultivariatePolynomialH void construct(); #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(MultivariatePolynomial, 1); -#endif }; //================================================================================= @@ -177,9 +175,7 @@ void MultivariatePolynomial::loadFromFile(TFile& i setFromContainer(*polTmp); delete polTmp; } else { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "couldnt load object {} from input file", name); -#endif } } @@ -188,21 +184,15 @@ void MultivariatePolynomial::setFromContainer(cons { if constexpr (Dim > 0 && Degree > 0) { if (this->getDim() != container.mDim) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "wrong number of dimensions! this {} container {}", this->getDim(), container.mDim); -#endif return; } if (this->getDegree() != container.mDegree) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "wrong number of degrees! this {} container {}", this->getDegree(), container.mDegree); -#endif return; } if (this->isInteractionOnly() != container.mInteractionOnly) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "InteractionOnly is set for this object to {}, but stored as {} in the container", this->isInteractionOnly(), container.mInteractionOnly); -#endif return; } setParams(container.mParams.data()); @@ -279,6 +269,6 @@ void MultivariatePolynomial::setFutureBufferAddres FlatObject::setFutureBufferAddress(futureFlatBufferPtr); } -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/TPCFastTransformation/MultivariatePolynomialHelper.cxx b/GPU/TPCFastTransformation/MultivariatePolynomialHelper.cxx index 80cb691d80fad..7ccc82b3512d3 100644 --- a/GPU/TPCFastTransformation/MultivariatePolynomialHelper.cxx +++ b/GPU/TPCFastTransformation/MultivariatePolynomialHelper.cxx @@ -20,7 +20,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) void MultivariatePolynomialHelper<0, 0, false>::print() const @@ -156,14 +156,12 @@ Type MultivariatePolynomialHelper<0, 0, false>::combination_with_repetiton(const } val += term; } else { -#if !defined(GPUCA_ALIROOT_LIB) std::string term{}; for (size_t i = 1; i <= degree; ++i) { term += fmt::format("x[{}] * ", pos[i]); } term += fmt::format("par[{}]", indexPar++); val.emplace_back(term); -#endif } } diff --git a/GPU/TPCFastTransformation/MultivariatePolynomialHelper.h b/GPU/TPCFastTransformation/MultivariatePolynomialHelper.h index 69c2052f83138..52c30b3241adc 100644 --- a/GPU/TPCFastTransformation/MultivariatePolynomialHelper.h +++ b/GPU/TPCFastTransformation/MultivariatePolynomialHelper.h @@ -28,7 +28,7 @@ class TLinearFitter; -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { #if !defined(GPUCA_GPUCODE) @@ -325,6 +325,6 @@ GPUd() constexpr float MultivariatePolynomialHelper void NDPiecewisePolynomials::setFromContainer(const NDPiecewisePolynomialContainer& container) { if (Dim != container.mDim) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "wrong number of dimensions! this {} container {}", Dim, container.mDim); -#endif return; } if (Degree != container.mDegree) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "wrong number of degrees! this {} container {}", Degree, container.mDegree); -#endif return; } if (InteractionOnly != container.mInteractionOnly) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "InteractionOnly is set for this object to {}, but stored as {} in the container", InteractionOnly, container.mInteractionOnly); -#endif return; } init(container.mMin.data(), container.mMax.data(), container.mN.data()); @@ -479,6 +471,6 @@ GPUdi() void NDPiecewisePolynomials::clamp(float x } } -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif diff --git a/GPU/TPCFastTransformation/NDPiecewisePolynomials.inc b/GPU/TPCFastTransformation/NDPiecewisePolynomials.inc index d7bb9d702e96f..2538e30056448 100644 --- a/GPU/TPCFastTransformation/NDPiecewisePolynomials.inc +++ b/GPU/TPCFastTransformation/NDPiecewisePolynomials.inc @@ -20,10 +20,9 @@ #include "CommonUtils/TreeStreamRedirector.h" #include "NDPiecewisePolynomials.h" -namespace GPUCA_NAMESPACE::gpu +namespace o2::gpu { -#ifndef GPUCA_ALIROOT_LIB template void NDPiecewisePolynomials::dumpToTree(const uint32_t nSamplingPoints[/* Dim */], const char* outName, const char* treeName, const bool recreateFile) const { @@ -61,7 +60,6 @@ void NDPiecewisePolynomials::dumpToTree(const uint } pcstream.Close(); } -#endif // GPUCA_ALIROOT_LIB #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) @@ -74,9 +72,7 @@ void NDPiecewisePolynomials::loadFromFile(TFile& i setFromContainer(*gridTmp); delete gridTmp; } else { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "couldnt load object {} from input file", name); -#endif } } @@ -98,9 +94,7 @@ template void NDPiecewisePolynomials::performFits(const std::function& func, const uint32_t nAuxiliaryPoints[/* Dim */]) { const int32_t nTotalFits = getNPolynomials(); -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "Perform fitting of {}D-Polynomials of degree {} for a total of {} fits.", Dim, Degree, nTotalFits); -#endif MultivariatePolynomialHelper<0, 0, false> pol(Dim, Degree, InteractionOnly); TLinearFitter fitter = pol.getTLinearFitter(); @@ -127,9 +121,7 @@ void NDPiecewisePolynomials::performFits(const std for (;;) { const bool debug = !(++counter % printDebugForNFits); if (debug) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "Performing fit {} out of {}", counter, nTotalFits); -#endif } checkPos(nPolynomials, pos); @@ -149,9 +141,7 @@ template void NDPiecewisePolynomials::performFits(const std::vector& x, const std::vector& y) { const int32_t nTotalFits = getNPolynomials(); -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "Perform fitting of {}D-Polynomials of degree {} for a total of {} fits.", Dim, Degree, nTotalFits); -#endif // approximate number of points uint32_t nPoints = 2 * y.size() / nTotalFits; @@ -196,16 +186,12 @@ void NDPiecewisePolynomials::performFits(const std for (int32_t i = 0; i < nTotalFits; ++i) { const bool debug = !(++counter % printDebugForNFits); if (debug) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "Performing fit {} out of {}", counter, nTotalFits); -#endif } // store values for fitting if (dataPointsIndices[i].empty()) { -#ifndef GPUCA_ALIROOT_LIB LOGP(info, "No data points to fit"); -#endif continue; } @@ -269,7 +255,7 @@ void NDPiecewisePolynomials::fitInnerGrid(const st std::copy(params.begin(), params.end(), &mParams[index]); } -} // namespace GPUCA_NAMESPACE::gpu +} // namespace o2::gpu #endif // !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) diff --git a/GPU/TPCFastTransformation/Spline.cxx b/GPU/TPCFastTransformation/Spline.cxx index 01cb96bc28482..70d69c465dd9e 100644 --- a/GPU/TPCFastTransformation/Spline.cxx +++ b/GPU/TPCFastTransformation/Spline.cxx @@ -17,8 +17,8 @@ #include "Spline.h" #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation -templateClassImp(GPUCA_NAMESPACE::gpu::Spline); +templateClassImp(o2::gpu::Spline); #endif -template class GPUCA_NAMESPACE::gpu::Spline; -template class GPUCA_NAMESPACE::gpu::Spline; +template class o2::gpu::Spline; +template class o2::gpu::Spline; diff --git a/GPU/TPCFastTransformation/Spline.h b/GPU/TPCFastTransformation/Spline.h index 9b514c984785d..ee3625a3793c1 100644 --- a/GPU/TPCFastTransformation/Spline.h +++ b/GPU/TPCFastTransformation/Spline.h @@ -19,7 +19,7 @@ #include "SplineSpec.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -99,7 +99,7 @@ class Spline Spline(const Spline&) = delete; #endif -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) /// read a class object from the file static Spline* readFromFile(TFile& inpf, const char* name) { @@ -107,12 +107,10 @@ class Spline } #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline1D.cxx b/GPU/TPCFastTransformation/Spline1D.cxx index c1ef8a45346ef..1ac8df93ab263 100644 --- a/GPU/TPCFastTransformation/Spline1D.cxx +++ b/GPU/TPCFastTransformation/Spline1D.cxx @@ -17,8 +17,8 @@ #include "Spline1D.h" #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation -templateClassImp(GPUCA_NAMESPACE::gpu::Spline1D); +templateClassImp(o2::gpu::Spline1D); #endif -template class GPUCA_NAMESPACE::gpu::Spline1D; -template class GPUCA_NAMESPACE::gpu::Spline1D; \ No newline at end of file +template class o2::gpu::Spline1D; +template class o2::gpu::Spline1D; \ No newline at end of file diff --git a/GPU/TPCFastTransformation/Spline1D.h b/GPU/TPCFastTransformation/Spline1D.h index 62c6f82ad166a..ccadaeed23b79 100644 --- a/GPU/TPCFastTransformation/Spline1D.h +++ b/GPU/TPCFastTransformation/Spline1D.h @@ -19,7 +19,7 @@ #include "Spline1DSpec.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -165,7 +165,7 @@ class Spline1D Spline1D(const Spline1D&) = delete; #endif -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) /// read a class object from the file static Spline1D* readFromFile(TFile& inpf, const char* name) { @@ -173,12 +173,10 @@ class Spline1D } #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1D, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline1DHelper.cxx b/GPU/TPCFastTransformation/Spline1DHelper.cxx index bfa9614b2abb8..938604bb9172d 100644 --- a/GPU/TPCFastTransformation/Spline1DHelper.cxx +++ b/GPU/TPCFastTransformation/Spline1DHelper.cxx @@ -33,9 +33,9 @@ #include "GPUCommonMath.h" #include -templateClassImp(GPUCA_NAMESPACE::gpu::Spline1DHelper); +templateClassImp(o2::gpu::Spline1DHelper); -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template Spline1DHelper::Spline1DHelper() : mError(), mSpline() @@ -502,7 +502,6 @@ void Spline1DHelper::setSpline(const Spline1DContainer& spline) mSpline.setXrange(spline.getXmin(), spline.getXmax()); } -#ifndef GPUCA_ALIROOT_LIB template int32_t Spline1DHelper::test(const bool draw, const bool drawDataPoints) { @@ -754,7 +753,6 @@ int32_t Spline1DHelper::test(const bool draw, const bool drawDataPoints) } return 0; } -#endif -template class GPUCA_NAMESPACE::gpu::Spline1DHelper; -template class GPUCA_NAMESPACE::gpu::Spline1DHelper; +template class o2::gpu::Spline1DHelper; +template class o2::gpu::Spline1DHelper; diff --git a/GPU/TPCFastTransformation/Spline1DHelper.h b/GPU/TPCFastTransformation/Spline1DHelper.h index 31a100d28c319..61a3e648ccc01 100644 --- a/GPU/TPCFastTransformation/Spline1DHelper.h +++ b/GPU/TPCFastTransformation/Spline1DHelper.h @@ -24,7 +24,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -99,7 +99,7 @@ class Spline1DHelper /// Gives error string const char* getLastError() const { return mError.c_str(); } -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the Spline1D class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -119,12 +119,10 @@ class Spline1DHelper Spline1D mSpline; ///< copy of the spline grid -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1DHelper, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline1DHelperOld.cxx b/GPU/TPCFastTransformation/Spline1DHelperOld.cxx index 7b75a8409eada..2ace188aa57f1 100644 --- a/GPU/TPCFastTransformation/Spline1DHelperOld.cxx +++ b/GPU/TPCFastTransformation/Spline1DHelperOld.cxx @@ -32,9 +32,9 @@ #include "GPUCommonMath.h" #include -templateClassImp(GPUCA_NAMESPACE::gpu::Spline1DHelperOld); +templateClassImp(o2::gpu::Spline1DHelperOld); -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template Spline1DHelperOld::Spline1DHelperOld() : mError(), mSpline(), mFdimensions(0) @@ -857,7 +857,6 @@ void Spline1DHelperOld::approximateDerivatives( } } -#ifndef GPUCA_ALIROOT_LIB template int32_t Spline1DHelperOld::test(const bool draw, const bool drawDataPoints) { @@ -1108,9 +1107,8 @@ int32_t Spline1DHelperOld::test(const bool draw, const bool drawDataPoint } return 0; } -#endif -template class GPUCA_NAMESPACE::gpu::Spline1DHelperOld; -template class GPUCA_NAMESPACE::gpu::Spline1DHelperOld; +template class o2::gpu::Spline1DHelperOld; +template class o2::gpu::Spline1DHelperOld; #endif diff --git a/GPU/TPCFastTransformation/Spline1DHelperOld.h b/GPU/TPCFastTransformation/Spline1DHelperOld.h index 013b4974c8c60..fc8d33ad64f87 100644 --- a/GPU/TPCFastTransformation/Spline1DHelperOld.h +++ b/GPU/TPCFastTransformation/Spline1DHelperOld.h @@ -26,7 +26,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -147,7 +147,7 @@ class Spline1DHelperOld /// Gives error string const char* getLastError() const { return mError.c_str(); } -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the Spline1D class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -168,12 +168,10 @@ class Spline1DHelperOld std::vector mLSMmatrixSderivatives; std::vector mLSMmatrixSvalues; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1DHelperOld, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline1DSpec.cxx b/GPU/TPCFastTransformation/Spline1DSpec.cxx index 7a5b76a71678e..603013d5e0808 100644 --- a/GPU/TPCFastTransformation/Spline1DSpec.cxx +++ b/GPU/TPCFastTransformation/Spline1DSpec.cxx @@ -25,12 +25,12 @@ #include "Spline1DHelper.h" #include "TFile.h" #include "GPUCommonMath.h" -templateClassImp(GPUCA_NAMESPACE::gpu::Spline1DContainer); -templateClassImp(GPUCA_NAMESPACE::gpu::Spline1DSpec); +templateClassImp(o2::gpu::Spline1DContainer); +templateClassImp(o2::gpu::Spline1DSpec); #endif using namespace std; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; #if !defined(GPUCA_GPUCODE) @@ -173,7 +173,6 @@ void Spline1DContainer::approximateFunction( helper.approximateFunction(*reinterpret_cast*>(this), xMin, xMax, F, nAxiliaryDataPoints); } -#ifndef GPUCA_ALIROOT_LIB template int32_t Spline1DContainer::writeToFile(TFile& outf, const char* name) { @@ -189,7 +188,6 @@ Spline1DContainer* Spline1DContainer::readFromFile( return FlatObject::readFromFile>(inpf, name); } -#endif #endif #if !defined(GPUCA_GPUCODE) @@ -261,7 +259,7 @@ void Spline1DContainer::setFutureBufferAddress(char* futureFlatBufferPtr) FlatObject::setFutureBufferAddress(futureFlatBufferPtr); } -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) template int32_t Spline1DContainer::test(const bool draw, const bool drawDataPoints) { @@ -269,7 +267,7 @@ int32_t Spline1DContainer::test(const bool draw, const bool drawDataPoint } #endif // GPUCA_GPUCODE -template class GPUCA_NAMESPACE::gpu::Spline1DContainer; -template class GPUCA_NAMESPACE::gpu::Spline1DContainer; -template class GPUCA_NAMESPACE::gpu::Spline1DSpec; -template class GPUCA_NAMESPACE::gpu::Spline1DSpec; +template class o2::gpu::Spline1DContainer; +template class o2::gpu::Spline1DContainer; +template class o2::gpu::Spline1DSpec; +template class o2::gpu::Spline1DSpec; diff --git a/GPU/TPCFastTransformation/Spline1DSpec.h b/GPU/TPCFastTransformation/Spline1DSpec.h index 65223d551e2ee..1ed1cc322ede3 100644 --- a/GPU/TPCFastTransformation/Spline1DSpec.h +++ b/GPU/TPCFastTransformation/Spline1DSpec.h @@ -27,7 +27,7 @@ class TFile; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -173,7 +173,7 @@ class Spline1DContainer : public FlatObject ///_______________ Test tools _______________ -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -219,9 +219,7 @@ class Spline1DContainer : public FlatObject int32_t* mUtoKnotMap = nullptr; //! (transient!!) pointer to (integer U -> knot index) map inside the mFlatBufferPtr array DataT* mParameters = nullptr; //! (transient!!) pointer to F-dependent parameters inside the mFlatBufferPtr array -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1DContainer, 1); -#endif }; template @@ -365,9 +363,7 @@ class Spline1DSpec : public Spline1DContainer using TBase::mParameters; using TBase::mYdim; using TBase::TBase; // inherit constructors and hide them -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1DSpec, 0); -#endif }; /// ================================================================================================== @@ -507,9 +503,7 @@ class Spline1DSpec /// _______ Expert tools: interpolation with given nYdim and external Parameters _______ using TBase::interpolateU; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline1DSpec, 0); -#endif }; /// ================================================================================================== @@ -534,6 +528,6 @@ class Spline1DSpec }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline2D.cxx b/GPU/TPCFastTransformation/Spline2D.cxx index 3055bcaccbbc1..70e9f85a6f6e3 100644 --- a/GPU/TPCFastTransformation/Spline2D.cxx +++ b/GPU/TPCFastTransformation/Spline2D.cxx @@ -17,8 +17,8 @@ #include "Spline2D.h" #if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation -templateClassImp(GPUCA_NAMESPACE::gpu::Spline2D); +templateClassImp(o2::gpu::Spline2D); #endif -template class GPUCA_NAMESPACE::gpu::Spline2D; -template class GPUCA_NAMESPACE::gpu::Spline2D; +template class o2::gpu::Spline2D; +template class o2::gpu::Spline2D; diff --git a/GPU/TPCFastTransformation/Spline2D.h b/GPU/TPCFastTransformation/Spline2D.h index 64c1b487987fc..788816f73d6dd 100644 --- a/GPU/TPCFastTransformation/Spline2D.h +++ b/GPU/TPCFastTransformation/Spline2D.h @@ -29,7 +29,7 @@ class TFile; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -96,7 +96,7 @@ class Spline2D Spline2D(const Spline2D&) = delete; #endif -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) /// read a class object from the file static Spline2D* readFromFile(TFile& inpf, const char* name) { @@ -104,12 +104,10 @@ class Spline2D } #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline2D, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline2DHelper.cxx b/GPU/TPCFastTransformation/Spline2DHelper.cxx index 0801d3b134e88..03ecf4a3f1707 100644 --- a/GPU/TPCFastTransformation/Spline2DHelper.cxx +++ b/GPU/TPCFastTransformation/Spline2DHelper.cxx @@ -36,7 +36,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template Spline2DHelper::Spline2DHelper() : mError(), mFdimensions(0), mHelperU1(), mHelperU2() @@ -405,7 +405,6 @@ void Spline2DHelper::approximateDataPoints( } } -#ifndef GPUCA_ALIROOT_LIB template int32_t Spline2DHelper::test(const bool draw, const bool drawDataPoints) { @@ -668,7 +667,6 @@ int32_t Spline2DHelper::test(const bool draw, const bool drawDataPoints) return 0; } -#endif -template class GPUCA_NAMESPACE::gpu::Spline2DHelper; -template class GPUCA_NAMESPACE::gpu::Spline2DHelper; +template class o2::gpu::Spline2DHelper; +template class o2::gpu::Spline2DHelper; diff --git a/GPU/TPCFastTransformation/Spline2DHelper.h b/GPU/TPCFastTransformation/Spline2DHelper.h index 19630adacd581..7195bab925f85 100644 --- a/GPU/TPCFastTransformation/Spline2DHelper.h +++ b/GPU/TPCFastTransformation/Spline2DHelper.h @@ -28,7 +28,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -110,7 +110,7 @@ class Spline2DHelper /// Gives error string const char* getLastError() const { return mError.c_str(); } -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the Spline2D class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -130,9 +130,7 @@ class Spline2DHelper Spline1D fGridU; Spline1D fGridV; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline2DHelper, 0); -#endif }; template @@ -168,6 +166,6 @@ int32_t Spline2DHelper::setSpline( } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/Spline2DSpec.cxx b/GPU/TPCFastTransformation/Spline2DSpec.cxx index aabf63f3252fe..4571110bdedaa 100644 --- a/GPU/TPCFastTransformation/Spline2DSpec.cxx +++ b/GPU/TPCFastTransformation/Spline2DSpec.cxx @@ -34,13 +34,13 @@ #include "TFile.h" #include "GPUCommonMath.h" -templateClassImp(GPUCA_NAMESPACE::gpu::Spline2DContainer); -templateClassImp(GPUCA_NAMESPACE::gpu::Spline2DSpec); +templateClassImp(o2::gpu::Spline2DContainer); +templateClassImp(o2::gpu::Spline2DSpec); #endif using namespace std; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template void Spline2DContainer::destroy() @@ -215,7 +215,6 @@ void Spline2DContainer::approximateFunctionViaDataPoints( helper.approximateFunctionViaDataPoints(*reinterpret_cast*>(this), x1Min, x1Max, x2Min, x2Max, F, nAuxiliaryDataPointsX1, nAuxiliaryDataPointsX2); } -#ifndef GPUCA_ALIROOT_LIB template int32_t Spline2DContainer::writeToFile(TFile& outf, const char* name) { @@ -236,9 +235,8 @@ int32_t Spline2DContainer::test(const bool draw, const bool drawDataPoint { return Spline2DHelper::test(draw, drawDataPoints); } -#endif #endif // GPUCA_GPUCODE && !GPUCA_STANDALONE -template class GPUCA_NAMESPACE::gpu::Spline2DContainer; -template class GPUCA_NAMESPACE::gpu::Spline2DContainer; +template class o2::gpu::Spline2DContainer; +template class o2::gpu::Spline2DContainer; diff --git a/GPU/TPCFastTransformation/Spline2DSpec.h b/GPU/TPCFastTransformation/Spline2DSpec.h index b626df3fa7e51..e7a9db8e6ae9c 100644 --- a/GPU/TPCFastTransformation/Spline2DSpec.h +++ b/GPU/TPCFastTransformation/Spline2DSpec.h @@ -29,7 +29,7 @@ class TFile; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -159,7 +159,7 @@ class Spline2DContainer : public FlatObject ///_______________ Test tools _______________ -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -196,9 +196,7 @@ class Spline2DContainer : public FlatObject Spline1D mGridX2; ///< grid for V axis DataT* mParameters = nullptr; //! (transient!!) F-dependent parameters of the spline -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(Spline2DContainer, 1); -#endif }; /// ================================================================================================== @@ -537,6 +535,6 @@ class Spline2DSpec using TBase::interpolate; }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/SplineHelper.cxx b/GPU/TPCFastTransformation/SplineHelper.cxx index b79ba08f8fd4c..b0d1f4348ca60 100644 --- a/GPU/TPCFastTransformation/SplineHelper.cxx +++ b/GPU/TPCFastTransformation/SplineHelper.cxx @@ -33,7 +33,7 @@ #include "GPUCommonMath.h" #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template SplineHelper::SplineHelper() : mError(), mXdimensions(0), mFdimensions(0), mNumberOfDataPoints(0), mHelpers() @@ -578,7 +578,7 @@ int32_t SplineHelper::test(const bool draw, const bool drawDataPoints) return 0; } -template class GPUCA_NAMESPACE::gpu::SplineHelper; -template class GPUCA_NAMESPACE::gpu::SplineHelper; +template class o2::gpu::SplineHelper; +template class o2::gpu::SplineHelper; #endif diff --git a/GPU/TPCFastTransformation/SplineHelper.h b/GPU/TPCFastTransformation/SplineHelper.h index ab558f82eaa17..986297e368aab 100644 --- a/GPU/TPCFastTransformation/SplineHelper.h +++ b/GPU/TPCFastTransformation/SplineHelper.h @@ -28,7 +28,7 @@ #include "Spline1DHelperOld.h" #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -160,6 +160,6 @@ int32_t SplineHelper::setSpline( } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/SplineSpec.cxx b/GPU/TPCFastTransformation/SplineSpec.cxx index 521b418e3f099..aa1af8ad30ba5 100644 --- a/GPU/TPCFastTransformation/SplineSpec.cxx +++ b/GPU/TPCFastTransformation/SplineSpec.cxx @@ -34,13 +34,13 @@ #include "TFile.h" #include "GPUCommonMath.h" -templateClassImp(GPUCA_NAMESPACE::gpu::SplineContainer); -templateClassImp(GPUCA_NAMESPACE::gpu::SplineSpec); +templateClassImp(o2::gpu::SplineContainer); +templateClassImp(o2::gpu::SplineSpec); #endif using namespace std; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; template void SplineContainer::destroy() @@ -206,7 +206,6 @@ void SplineContainer:: helper.approximateFunction(*reinterpret_cast*>(this), xMin, xMax, F, nAuxiliaryDataPoints); } -#ifndef GPUCA_ALIROOT_LIB template int32_t SplineContainer::writeToFile(TFile& outf, const char* name) { @@ -227,9 +226,8 @@ int32_t SplineContainer::test(const bool draw, const bool drawDataPoints) { return SplineHelper::test(draw, drawDataPoints); } -#endif #endif // GPUCA_GPUCODE && !GPUCA_STANDALONE -template class GPUCA_NAMESPACE::gpu::SplineContainer; -template class GPUCA_NAMESPACE::gpu::SplineContainer; +template class o2::gpu::SplineContainer; +template class o2::gpu::SplineContainer; diff --git a/GPU/TPCFastTransformation/SplineSpec.h b/GPU/TPCFastTransformation/SplineSpec.h index f9d3ec0613f64..dae17b22f42ea 100644 --- a/GPU/TPCFastTransformation/SplineSpec.h +++ b/GPU/TPCFastTransformation/SplineSpec.h @@ -29,7 +29,7 @@ class TFile; -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -150,7 +150,7 @@ class SplineContainer : public FlatObject ///_______________ Test tools _______________ -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) // code invisible on GPU and in the standalone compilation +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) // code invisible on GPU and in the standalone compilation /// Test the class functionality static int32_t test(const bool draw = 0, const bool drawDataPoints = 1); #endif @@ -189,9 +189,7 @@ class SplineContainer : public FlatObject Spline1D* mGrid; //! (transient!!) mXdim grids DataT* mParameters; //! (transient!!) F-dependent parameters of the spline -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SplineContainer, 1); -#endif }; template @@ -550,6 +548,6 @@ class SplineSpec }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/SplineUtil.h b/GPU/TPCFastTransformation/SplineUtil.h index b2226eb8e383a..23c786f33dc6f 100644 --- a/GPU/TPCFastTransformation/SplineUtil.h +++ b/GPU/TPCFastTransformation/SplineUtil.h @@ -17,7 +17,7 @@ #ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SPLINEUTIL_H #define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SPLINEUTIL_H -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -39,7 +39,6 @@ class SplineUtil // 2 - at least one of the dimensions must be set during runtime // 3 - specialization where nYdim==1 (a small add-on on top of the other specs) - // calculate it as one return statement to make the AliRoot compiler happy return (nYdim == 1) ? 3 : ((nXdim > 0 && nYdim > 0) ? 1 : 2); /* if (nYdim == 1) { @@ -111,6 +110,6 @@ class SplineUtil::Switch }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/SymMatrixSolver.cxx b/GPU/TPCFastTransformation/SymMatrixSolver.cxx index 1991dd76e7ad0..ea574eeec01b6 100644 --- a/GPU/TPCFastTransformation/SymMatrixSolver.cxx +++ b/GPU/TPCFastTransformation/SymMatrixSolver.cxx @@ -23,11 +23,9 @@ #include using namespace std; -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#ifndef GPUCA_ALIROOT_LIB -ClassImp(GPUCA_NAMESPACE::gpu::SymMatrixSolver); -#endif +ClassImp(o2::gpu::SymMatrixSolver); void SymMatrixSolver::solve() { diff --git a/GPU/TPCFastTransformation/SymMatrixSolver.h b/GPU/TPCFastTransformation/SymMatrixSolver.h index c84c1699c07f3..4ccb75bfa6888 100644 --- a/GPU/TPCFastTransformation/SymMatrixSolver.h +++ b/GPU/TPCFastTransformation/SymMatrixSolver.h @@ -23,7 +23,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -75,12 +75,10 @@ class SymMatrixSolver int32_t mShift = 0; std::vector mA; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SymMatrixSolver, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 -#endif \ No newline at end of file +#endif diff --git a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx index ec32eca959d4f..5a7dffd2a753b 100644 --- a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx +++ b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx @@ -23,11 +23,9 @@ #include "Spline2DHelper.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#ifndef GPUCA_ALIROOT_LIB ClassImp(TPCFastSpaceChargeCorrection); -#endif TPCFastSpaceChargeCorrection::TPCFastSpaceChargeCorrection() : FlatObject(), diff --git a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.h b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.h index 70ca6c99ed853..c353f3f3329e7 100644 --- a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.h +++ b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.h @@ -23,7 +23,7 @@ #include "GPUCommonDef.h" #include "GPUCommonMath.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -45,9 +45,7 @@ class TPCFastSpaceChargeCorrection : public FlatObject struct RowInfo { int32_t splineScenarioID{0}; ///< scenario index (which of Spline2D splines to use) size_t dataOffsetBytes[3]{0}; ///< offset for the spline data withing a TPC slice -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(RowInfo, 1); -#endif }; struct RowActiveArea { @@ -56,9 +54,7 @@ class TPCFastSpaceChargeCorrection : public FlatObject float cuMin{0.f}; float cuMax{0.f}; float cvMax{0.f}; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(RowActiveArea, 1); -#endif }; struct SliceRowInfo { @@ -68,16 +64,12 @@ class TPCFastSpaceChargeCorrection : public FlatObject float scaleCorrUtoGrid{0.f}; ///< scale corrected U to U-grid coordinate float scaleCorrVtoGrid{0.f}; ///< scale corrected V to V-grid coordinate RowActiveArea activeArea; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SliceRowInfo, 1); -#endif }; struct SliceInfo { float vMax{0.f}; ///< Max value of V coordinate -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SliceInfo, 1); -#endif }; typedef Spline2D SplineType; @@ -277,9 +269,7 @@ class TPCFastSpaceChargeCorrection : public FlatObject float fInterpolationSafetyMargin{0.1f}; // 10% area around the TPC row. Outside of this area the interpolation returns the boundary values. -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(TPCFastSpaceChargeCorrection, 3); -#endif }; /// ==================================================== @@ -504,6 +494,6 @@ GPUdi() float TPCFastSpaceChargeCorrection::getMaxDriftLength(int32_t slice) con } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.cxx b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.cxx index 92cbc2ba49a11..12d0c37f5f12f 100644 --- a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.cxx +++ b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.cxx @@ -17,8 +17,6 @@ #include "TPCFastSpaceChargeCorrectionMap.h" #include "GPUCommonLogger.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; -#ifndef GPUCA_ALIROOT_LIB ClassImp(TPCFastSpaceChargeCorrectionMap); -#endif \ No newline at end of file diff --git a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.h b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.h index 998c810300098..97b824aa6da32 100644 --- a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.h +++ b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrectionMap.h @@ -21,7 +21,7 @@ #include "GPUCommonRtypes.h" #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -97,12 +97,10 @@ class TPCFastSpaceChargeCorrectionMap int32_t mNrows{0}; std::vector> fDataPoints; //! (transient!!) points with space charge correction -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(TPCFastSpaceChargeCorrectionMap, 0); -#endif }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastTransform.cxx b/GPU/TPCFastTransformation/TPCFastTransform.cxx index eee8527962a6b..aea6589761403 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransform.cxx @@ -30,11 +30,11 @@ #include "GPUCommonLogger.h" #endif -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) #include "TPCSpaceCharge/SpaceCharge.h" #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCFastTransform::TPCFastTransform() : FlatObject(), mTimeStamp(0), mCorrection(), mApplyCorrection(1), mT0(0.f), mVdrift(0.f), mVdriftCorrY(0.f), mLdriftCorr(0.f), mTOFcorr(0.f), mPrimVtxZ(0.f), mLumi(0.f), mLumiError(0.f), mLumiScaleFactor(1.0f) @@ -165,7 +165,7 @@ void TPCFastTransform::print() const #endif } -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) int32_t TPCFastTransform::writeToFile(std::string outFName, std::string name) { @@ -231,7 +231,7 @@ TPCFastTransform* TPCFastTransform::loadFromFile(std::string inpFName, std::stri #endif -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) TPCSlowSpaceChargeCorrection::~TPCSlowSpaceChargeCorrection() { delete mCorr; diff --git a/GPU/TPCFastTransformation/TPCFastTransform.h b/GPU/TPCFastTransformation/TPCFastTransform.h index 936a19d3f30fa..4e0403422ee06 100644 --- a/GPU/TPCFastTransformation/TPCFastTransform.h +++ b/GPU/TPCFastTransformation/TPCFastTransform.h @@ -33,7 +33,7 @@ template class SpaceCharge; } -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -41,7 +41,7 @@ namespace gpu /// simple struct to hold the space charge object which can be used for CPU reconstruction only struct TPCSlowSpaceChargeCorrection { -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) /// destructor ~TPCSlowSpaceChargeCorrection(); @@ -61,9 +61,7 @@ struct TPCSlowSpaceChargeCorrection { } #endif -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(TPCSlowSpaceChargeCorrection, 2); -#endif }; /// @@ -268,7 +266,7 @@ class TPCFastTransform : public FlatObject /// maximal possible drift time of the active area GPUd() float getMaxDriftTime(int32_t slice) const; -#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) && !defined(GPUCA_ALIROOT_LIB) +#if !defined(GPUCA_GPUCODE) && !defined(GPUCA_STANDALONE) int32_t writeToFile(std::string outFName = "", std::string name = ""); @@ -341,9 +339,7 @@ class TPCFastTransform : public FlatObject GPUd() void TransformInternal(int32_t slice, int32_t row, float& u, float& v, float& x, const TPCFastTransform* ref, const TPCFastTransform* ref2, float scale, float scale2, int32_t scaleMode) const; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(TPCFastTransform, 3); -#endif }; // ======================================================================= @@ -887,6 +883,6 @@ GPUdi() void TPCFastTransform::InverseTransformXYZtoNominalXYZ(int32_t slice, in } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastTransformGeo.cxx b/GPU/TPCFastTransformation/TPCFastTransformGeo.cxx index b4cfc7e7eb5b6..3c624b3222d77 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformGeo.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransformGeo.cxx @@ -23,7 +23,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCFastTransformGeo::TPCFastTransformGeo() { diff --git a/GPU/TPCFastTransformation/TPCFastTransformGeo.h b/GPU/TPCFastTransformation/TPCFastTransformGeo.h index a24dcbf1e80c2..5eddada1e9acc 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformGeo.h +++ b/GPU/TPCFastTransformation/TPCFastTransformGeo.h @@ -23,7 +23,7 @@ #include "GPUCommonRtypes.h" #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -38,9 +38,7 @@ class TPCFastTransformGeo struct SliceInfo { float sinAlpha; float cosAlpha; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SliceInfo, 1); -#endif }; /// The struct contains necessary info about TPC padrow @@ -54,9 +52,7 @@ class TPCFastTransformGeo /// get width in U GPUd() float getUwidth() const { return -2.f * u0; } -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(RowInfo, 1); -#endif }; /// _____________ Constructors / destructors __________________________ @@ -209,9 +205,7 @@ class TPCFastTransformGeo SliceInfo mSliceInfos[NumberOfSlices + 1]; ///< array of slice information [fixed size] RowInfo mRowInfos[MaxNumberOfRows + 1]; ///< array of row information [fixed size] -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(TPCFastTransformGeo, 1); -#endif }; // ======================================================================= @@ -338,6 +332,6 @@ GPUdi() float TPCFastTransformGeo::convUtoPad(int32_t row, float u) const } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastTransformManager.cxx b/GPU/TPCFastTransformation/TPCFastTransformManager.cxx index f16a84c96d565..7d0aa29545578 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformManager.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransformManager.cxx @@ -23,7 +23,7 @@ #include "TPCFastTransform.h" #include "Spline2DHelper.h" -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; TPCFastTransformManager::TPCFastTransformManager() : mError(), mOrigTransform(nullptr), fLastTimeBin(0) {} diff --git a/GPU/TPCFastTransformation/TPCFastTransformManager.h b/GPU/TPCFastTransformation/TPCFastTransformManager.h index 14a85f1030bd8..f981b05bec241 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformManager.h +++ b/GPU/TPCFastTransformation/TPCFastTransformManager.h @@ -24,7 +24,7 @@ #include "TString.h" #include "AliTPCTransform.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -81,6 +81,6 @@ inline int32_t TPCFastTransformManager::storeError(int32_t code, const char* msg return code; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastTransformQA.cxx b/GPU/TPCFastTransformation/TPCFastTransformQA.cxx index cbe9e10060c36..8616311038952 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformQA.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransformQA.cxx @@ -31,7 +31,7 @@ #include #include -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; using namespace std; TPCFastTransformQA::TPCFastTransformQA() {} diff --git a/GPU/TPCFastTransformation/TPCFastTransformQA.h b/GPU/TPCFastTransformation/TPCFastTransformQA.h index 6030ceedc5c94..727a8a87dbbc0 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformQA.h +++ b/GPU/TPCFastTransformation/TPCFastTransformQA.h @@ -28,7 +28,7 @@ #include "TString.h" #include "AliTPCTransform.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -75,6 +75,6 @@ inline int32_t TPCFastTransformQA::storeError(int32_t code, const char* msg) return code; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/TPCFastTransformationLinkDef_AliRoot.h b/GPU/TPCFastTransformation/TPCFastTransformationLinkDef_AliRoot.h deleted file mode 100644 index acdd2d701bb86..0000000000000 --- a/GPU/TPCFastTransformation/TPCFastTransformationLinkDef_AliRoot.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file TPCFastTransformationLinkDef_AliRoot.h -/// \author Sergey Gorbunov - -#if defined(__CLING__) - -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#endif diff --git a/GPU/TPCFastTransformation/alirootMacro/createTPCFastTransform.C b/GPU/TPCFastTransformation/alirootMacro/createTPCFastTransform.C deleted file mode 100644 index 3af3be7760ecf..0000000000000 --- a/GPU/TPCFastTransformation/alirootMacro/createTPCFastTransform.C +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ -/** - * @file createTPCFastTransform.C - * @brief A macro to create TPCFastTransform object - * - *
- * Usage:
- *
- * aliroot
- * .x initTPCcalibration.C("alien://Folder=/alice/data/2015/OCDB",246984,1)
- *  gSystem->Load("libAliTPCFastTransformation")
- * .L createTPCFastTransform.C++
- * GPUCA_NAMESPACE::gpu::TPCFastTransform fastTransform;
- * createTPCFastTransform(fastTransform);
- *
- * 
- * - * @author sergey gorbunov - * - */ - -#include "AliTPCcalibDB.h" -#include "Riostream.h" -#include "TStopwatch.h" - -#define GPUCA_ALIROOT_LIB - -#include "TPCFastTransform.h" -#include "TPCFastTransformManager.h" -#include "TPCFastTransformQA.h" - -using namespace std; -using namespace GPUCA_NAMESPACE::gpu; - -int32_t createTPCFastTransform(TPCFastTransform& fastTransform) -{ - - AliTPCcalibDB* tpcCalib = AliTPCcalibDB::Instance(); - if (!tpcCalib) { - cerr << "AliTPCcalibDB does not exist" << endl; - return -1; - } - AliTPCTransform* origTransform = tpcCalib->GetTransform(); - uint32_t timeStamp = origTransform->GetCurrentTimeStamp(); - - TPCFastTransformManager manager; - - TStopwatch timer; - timer.Start(); - - int32_t err = manager.create(fastTransform, origTransform, timeStamp); - - timer.Stop(); - - cout << "\n\n Initialisation: " << timer.CpuTime() << " / " << timer.RealTime() << " sec.\n\n" - << endl; - - if (err != 0) { - cerr << "Cannot create fast transformation object from AliTPCcalibDB, TPCFastTransformManager returns " << err << endl; - return -1; - } - - // qa - - // GPUCA_NAMESPACE::gpu::TPCFastTransformQA qa; - // qa.doQA( timeStamp ); - - return 0; -} diff --git a/GPU/TPCFastTransformation/alirootMacro/generateTPCDistortionNTupleAliRoot.C b/GPU/TPCFastTransformation/alirootMacro/generateTPCDistortionNTupleAliRoot.C deleted file mode 100644 index e63e045373b11..0000000000000 --- a/GPU/TPCFastTransformation/alirootMacro/generateTPCDistortionNTupleAliRoot.C +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2019-2020 CERN and copyright holders of ALICE O2. -// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. -// All rights not expressly granted are reserved. -// -// This software is distributed under the terms of the GNU General Public -// License v3 (GPL Version 3), copied verbatim in the file "COPYING". -// -// In applying this license CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -/// \file generateTPCDistortionNTupleAliRoot.C -/// \brief A developer macro for generating TPC distortion ntuple to test the TPCFastTransformation class -/// Works only with AliRoot, not with O2 -/// -/// \author Sergey Gorbunov -/// - -/* - Run the macro: - uncomment the first #define - - aliroot - .x initTPCcalibration.C("alien://Folder=/alice/data/2015/OCDB",246984,1) - gSystem->Load("libAliTPCFastTransformation") - .x generateTPCDistortionNTupleAliRoot.C+ -*/ - -// A developer code. -// It is hidden inside #ifdef in order to avoid an automatic compilation during the O2 build -// Uncomment the #define for compiling the code - -//#define FASTTRANSFORM_DEVELOPING - -#include "AliTPCcalibDB.h" -#include "AliTPCRecoParam.h" -#include "Riostream.h" -#include "TStopwatch.h" -#include "TFile.h" -#include "TNtuple.h" - -#define GPUCA_ALIROOT_LIB - -#include "TPCFastTransform.h" -#include "TPCFastTransformManager.h" -#include "TPCFastTransformQA.h" -#include "AliHLTTPCGeometry.h" - -using namespace std; -using namespace GPUCA_NAMESPACE::gpu; - -int32_t generateTPCDistortionNTupleAliRoot() -{ - AliTPCcalibDB* tpcCalib = AliTPCcalibDB::Instance(); - if (!tpcCalib) { - cerr << "AliTPCcalibDB does not exist" << endl; - return -1; - } - AliTPCTransform* origTransform = tpcCalib->GetTransform(); - - AliTPCRecoParam* recoParam = origTransform->GetCurrentRecoParamNonConst(); - if (!recoParam) { - std::cout << "TPCFastTransformManager::Init: No TPC Reco Param set in transformation" << std::endl; - return -1; - } - - uint32_t timeStamp = origTransform->GetCurrentTimeStamp(); - - TPCFastTransformManager manager; - TPCFastTransform fastTransform; - - int32_t err = manager.create(fastTransform, origTransform, timeStamp); - - if (err != 0) { - cerr << "Cannot create fast transformation object from AliTPCcalibDB, TPCFastTransformManager returns " << err << endl; - return -1; - } - - const TPCFastTransformGeo& geo = fastTransform.getGeometry(); - - recoParam->SetUseTOFCorrection(kFALSE); - - cout << " generate NTuple " << endl; - - TFile* f = new TFile("tpcDistortionNTuple.root", "RECREATE"); - TNtuple* nt = new TNtuple("dist", "dist", "slice:row:su:sv:dx:du:dv"); - - int32_t nSlices = 1; // fastTransform.getNumberOfSlices(); - // for( int32_t slice=0; slice (x,y,z) without time-of-flight correction - float ox = 0, oy = 0, oz = 0; - { - int32_t sector = 0, secrow = 0; - AliHLTTPCGeometry::Slice2Sector(slice, row, sector, secrow); - int32_t is[] = {sector}; - double xx[] = {static_cast(secrow), pad, time}; - origTransform->Transform(xx, is, 0, 1); - ox = xx[0]; - oy = xx[1]; - oz = xx[2]; - } - - // convert to u,v - float ou = 0, ov = 0; - geo.convLocalToUV(slice, oy, oz, ou, ov); - - // distortions in x,u,v: - float dx = ox - x; - float du = ou - u; - float dv = ov - v; - - cout << slice << " " << row << " " << su << " " << sv << " " << dx << " " << du << " " << dv << endl; - nt->Fill(slice, row, su, sv, dx, du, dv); - } - } - } - } - nt->Write(); - f->Write(); - recoParam->SetUseTOFCorrection(kTRUE); - - return 0; -} diff --git a/GPU/TPCFastTransformation/alirootMacro/initTPCcalibration.C b/GPU/TPCFastTransformation/alirootMacro/initTPCcalibration.C deleted file mode 100644 index 9ae938f67907c..0000000000000 --- a/GPU/TPCFastTransformation/alirootMacro/initTPCcalibration.C +++ /dev/null @@ -1,198 +0,0 @@ -/** - * @file initTPCcalibration.C - * @brief A macro to initialize AliTPCTransform cluster transformation in AliTPCcalib - * - *
- * Usage:
- *
- * aliroot $ALICE_ROOT/GPU/TPCFastTransformation/macro/initTPCcalibration.C'("uri", runNumber, isMC)'
- * uri == "alien://Folder=/alice/data/2015/OCDB"
- * uri == "local://$HOME/alice/OCDB"
- * uri == "OCDBsim.root"
- *
- * 
- * - * Parameters:
- * - uri the OCDB URI. When ==nullptr, AliCDBManager::Instance().IsDefaultStorageSet() should be 1 - * - runNumber run number - * - isMC initialize for Monte Carlo - * - * @author sergey gorbunov - * - */ - -/* - aliroot - .L initTPCcalibration.C - initTPCcalibration("alien://Folder=/alice/data/2015/OCDB",246984,1) - initTPCcalibration("$ALICE_ROOT/../aliceEventsPbPb/OCDBsim.root",246984,1) - */ - -#include "AliTPCcalibDB.h" -#include "Riostream.h" -#include "TGeoGlobalMagField.h" -#include "AliGRPObject.h" -#include "AliGRPManager.h" -#include "AliGeomManager.h" -#include "AliTracker.h" -#include "AliCDBRunRange.h" -#include "AliCDBManager.h" -#include "AliCDBStorage.h" -#include "AliTPCRecoParam.h" -#include "AliCDBEntry.h" -#include "TMap.h" -#include "AliRawEventHeaderBase.h" -#include "AliEventInfo.h" -#include "AliRunInfo.h" -#include "AliTPCTransform.h" - -using namespace std; - -int32_t initTPCcalibration(const Char_t* cdbUri, int32_t runNumber, bool isMC) -{ - - // -------------------------------------- - // -- Setup CDB - // -------------------------------------- - - // cdbUri = "local://$ALICE_ROOT/OCDB"; - // cdbUri = "alien://Folder=/alice/data/2015/OCDB"; - // cdbUri = "OCDBsim.root"; - // cdbUri = "$ALICE_ROOT/../aliceEventsPbPb/OCDBsim.root"; - // cdbUri="/home/gorbunov/alice/aliceEventsPbPb/OCDB.root"; - - AliCDBManager* cdbm = AliCDBManager::Instance(); - if (!cdbm) { - cerr << "Error : Can not get AliCDBManager" << endl; - return -1; - } - - if (cdbUri != 0) { - TString storage = cdbUri; - cout << storage.Data() << endl; - if (storage.Contains(".root")) { - // local file - cout << "Snapshot mode" << endl; - cdbm->SetSnapshotMode(cdbUri); - cdbm->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); - } else { - if (!storage.Contains("://")) { // add prefix to local path - storage = "local://"; - storage += cdbUri; - } - cdbm->SetDefaultStorage(storage); - } - } - - if (!cdbm->IsDefaultStorageSet()) { - cerr << "OCDB storage is not set!!" << endl; - return -1; - } - - cdbm->SetRun(runNumber); - - AliGRPManager grp; - grp.ReadGRPEntry(); - grp.SetMagField(); - - const AliGRPObject* grpObj = grp.GetGRPData(); - - if (!grpObj) { - cerr << "No GRP object found!!" << endl; - return -1; - } - - if (!AliGeomManager::GetGeometry()) { - AliGeomManager::LoadGeometry(); - } - if (!AliGeomManager::GetGeometry()) { - cerr << "Can not initialise geometry" << endl; - return -1; - } - - AliTPCcalibDB* tpcCalib = AliTPCcalibDB::Instance(); - if (!tpcCalib) { - cerr << "AliTPCcalibDB does not exist" << endl; - return -1; - } - - const AliMagF* field = (AliMagF*)TGeoGlobalMagField::Instance()->GetField(); - - if (!field) { - cerr << "no magnetic field found " << endl; - return -1; - } - - tpcCalib->SetExBField(field); - tpcCalib->SetRun(runNumber); - tpcCalib->UpdateRunInformations(runNumber); - - if (!tpcCalib->GetTransform()) { - cerr << "No TPC transformation found" << endl; - return -1; - } - - // -- Get AliRunInfo variables - - AliRunInfo runInfo(grpObj->GetLHCState(), grpObj->GetBeamType(), grpObj->GetBeamEnergy(), grpObj->GetRunType(), grpObj->GetDetectorMask()); - AliEventInfo evInfo; - evInfo.SetEventType(AliRawEventHeaderBase::kPhysicsEvent); - - AliCDBEntry* entry = AliCDBManager::Instance()->Get("TPC/Calib/RecoParam"); - - if (!entry) { - cerr << "No TPC reco param entry found in data base" << endl; - return -1; - } - - TObject* aliRecoParamObj = entry->GetObject(); - if (!aliRecoParamObj) { - cerr << " Empty TPC reco param entry in data base" << endl; - return -1; - } - - AliRecoParam aliRecoParam; - - if (dynamic_cast(aliRecoParamObj)) { - // cout<<"\n\nSet reco param from AliHLTTPCClusterTransformation: TObjArray found \n"<(aliRecoParamObj)->Clone()); - aliRecoParam.AddDetRecoParamArray(1, copy); - } else if (dynamic_cast(aliRecoParamObj)) { - // cout<<"\n\nSet reco param from AliHLTTPCClusterTransformation: AliDetectorRecoParam found \n"<(aliRecoParamObj)->Clone(); - aliRecoParam.AddDetRecoParam(1, copy); - } else { - cerr << "Unknown format of the TPC Reco Param entry in the data base" << endl; - return -1; - } - - aliRecoParam.SetEventSpecie(&runInfo, evInfo, 0); - - // - - AliTPCRecoParam* recParam = (AliTPCRecoParam*)aliRecoParam.GetDetRecoParam(1); - - if (!recParam) { - cerr << "No TPC Reco Param entry found for the given event specification" << endl; - return -1; - } - - recParam = new AliTPCRecoParam(*recParam); - - uint32_t timeStamp = grpObj->GetTimeStart(); - - if (isMC && !recParam->GetUseCorrectionMap()) { - timeStamp = 0; - } - - tpcCalib->GetTransform()->SetCurrentRecoParam(recParam); - - AliTPCTransform* origTransform = tpcCalib->GetTransform(); - origTransform->SetCurrentTimeStamp(static_cast(timeStamp)); - - Double_t bz = AliTracker::GetBz(); - cout << "\n\nBz field is set to " << bz << ", time stamp is set to " << timeStamp << endl - << endl; - - return 0; -} diff --git a/GPU/TPCFastTransformation/alirootMacro/moveTPCFastTransform.C b/GPU/TPCFastTransformation/alirootMacro/moveTPCFastTransform.C deleted file mode 100644 index 8d34d973210d7..0000000000000 --- a/GPU/TPCFastTransformation/alirootMacro/moveTPCFastTransform.C +++ /dev/null @@ -1,69 +0,0 @@ -// $Id$ -/** - * @file moveTPCFastTransform.C - * @brief Example of creation of TPCFastTransform object and moving it to another place - * - *
- * Usage:
- *
- * aliroot
- *  gSystem->Load("libAliTPCFastTransformation")
- * .L initTPCcalibration.C++
- * .L createTPCFastTransform.C++
- * .x moveTPCFastTransform.C
- *
- * 
- * - * @author sergey gorbunov - * - */ - -#include "TPCFastTransform.h" - -using namespace std; -using namespace GPUCA_NAMESPACE::gpu; - -int32_t moveTPCFastTransform() -{ - - // gSystem->Load("libAliTPCFastTransformation"); - // gROOT->LoadMacro("initTPCcalibration.C++"); - // gROOT->LoadMacro("createTPCFastTransform.C++"); - - initTPCcalibration("alien://Folder=/alice/data/2015/OCDB", 246984, 1); - - TPCFastTransform fastTransform; - createTPCFastTransform(fastTransform); - - // make flat buffer external - - std::unique_ptr buff(fastTransform.releaseInternalBuffer()); - - // example of moving the transformation object to another place - - { - char* newBuff = new char[fastTransform.getFlatBufferSize()]; - char* newObj = new char[sizeof(TPCFastTransform)]; - - memcpy((void*)newObj, (void*)&fastTransform, sizeof(fastTransform)); - memcpy((void*)newBuff, (void*)buff.get(), fastTransform.getFlatBufferSize()); - - TPCFastTransform& newTransform = *(TPCFastTransform*)newObj; - newTransform.setActualBufferAddress(newBuff); - } - - // another example of moving the transformation object to another place - { - char* newBuff = new char[fastTransform.getFlatBufferSize()]; - char* newObj = new char[sizeof(TPCFastTransform)]; - - fastTransform.setFutureBufferAddress(newBuff); - - memcpy((void*)newObj, (void*)&fastTransform, sizeof(fastTransform)); - memcpy((void*)newBuff, (void*)buff.get(), fastTransform.getFlatBufferSize()); - - TPCFastTransform& newTransform = *(TPCFastTransform*)newObj; - } - - return 0; -} diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline1D.cxx b/GPU/TPCFastTransformation/devtools/IrregularSpline1D.cxx index 3a125628d898c..456447720b2c1 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline1D.cxx +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline1D.cxx @@ -24,7 +24,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; IrregularSpline1D::IrregularSpline1D() : FlatObject(), mNumberOfKnots(0), mNumberOfAxisBins(0), mBin2KnotMapOffset(0) { diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline1D.h b/GPU/TPCFastTransformation/devtools/IrregularSpline1D.h index 62229c2afe087..39c090dd9bd94 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline1D.h +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline1D.h @@ -27,7 +27,7 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -266,9 +266,7 @@ class IrregularSpline1D : public FlatObject int32_t mNumberOfAxisBins; ///< number of axis bins uint32_t mBin2KnotMapOffset; ///< pointer to (axis bin) -> (knot) map in mFlatBufferPtr array -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(IrregularSpline1D, 1); -#endif }; /// ==================================================== @@ -401,6 +399,6 @@ GPUdi() void IrregularSpline1D::correctEdges(T* data) const data[i] = c0 * data[i - 0] + c1 * data[i - 1] + c2 * data[i - 2] + c3 * data[i - 3]; } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline1DTest.C b/GPU/TPCFastTransformation/devtools/IrregularSpline1DTest.C index a5e2dfc2261eb..086a6ce636698 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline1DTest.C +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline1DTest.C @@ -42,7 +42,7 @@ typedef double myfloat; int32_t IrregularSpline1DTest() { - using namespace GPUCA_NAMESPACE::gpu; + using namespace o2::gpu; std::cout << "Test roundf(): " << std::endl; for (float x = 0.; x <= 1.; x += 0.1) { diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.cxx b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.cxx index fca4b2da84c2b..1e5a7f7cd80f7 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.cxx +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.cxx @@ -21,7 +21,7 @@ #include #endif -using namespace GPUCA_NAMESPACE::gpu; +using namespace o2::gpu; IrregularSpline2D3D::IrregularSpline2D3D() : FlatObject(), mGridU(), mGridV() { diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h index 026338b3380fa..d60326ddf76ab 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3D.h @@ -26,7 +26,7 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -194,9 +194,7 @@ class IrregularSpline2D3D : public FlatObject IrregularSpline1D mGridU; ///< grid for U axis IrregularSpline1D mGridV; ///< grid for V axis -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(IrregularSpline2D3D, 1); -#endif }; /// ==================================================== @@ -374,6 +372,6 @@ GPUdi() void IrregularSpline2D3D::getSplineVec(const float* correctedData, float #endif } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.cxx b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.cxx index ffce9376fe60b..27500d12d9d5d 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.cxx +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.cxx @@ -22,7 +22,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -443,4 +443,4 @@ double IrregularSpline2D3DCalibrator::getIntegralDeviationArea(const IrregularSp } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 diff --git a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.h b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.h index 4b3ba8f787a79..8ba8a2c22fa5e 100644 --- a/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.h +++ b/GPU/TPCFastTransformation/devtools/IrregularSpline2D3DCalibrator.h @@ -24,7 +24,7 @@ #include #include -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -142,6 +142,6 @@ class IrregularSpline2D3DCalibrator }; } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/devtools/RegularSpline1D.h b/GPU/TPCFastTransformation/devtools/RegularSpline1D.h index b97903f7d5aac..2398ff4cd1cbc 100644 --- a/GPU/TPCFastTransformation/devtools/RegularSpline1D.h +++ b/GPU/TPCFastTransformation/devtools/RegularSpline1D.h @@ -20,7 +20,7 @@ #include "GPUCommonDef.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -174,6 +174,6 @@ inline void RegularSpline1D::correctEdges(T* data) const } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.cxx b/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.cxx index 2401a16dc6f16..076e4ee0ed780 100644 --- a/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.cxx +++ b/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.cxx @@ -17,7 +17,7 @@ #include "SemiregularSpline2D3D.h" -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -164,4 +164,4 @@ void SemiregularSpline2D3D::construct(const int32_t numberOfRowsInput, const int } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 diff --git a/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.h b/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.h index 4e14b69583d74..4da954c8096ac 100644 --- a/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.h +++ b/GPU/TPCFastTransformation/devtools/SemiregularSpline2D3D.h @@ -28,7 +28,7 @@ #include #endif -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -183,9 +183,7 @@ class SemiregularSpline2D3D : public FlatObject int32_t mNumberOfKnots; int32_t mDataIndexMapOffset; -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(SemiregularSpline2D3D, 1); -#endif }; /// ==================================================== @@ -472,6 +470,6 @@ inline void SemiregularSpline2D3D::getSplineVec(const float* correctedData, floa #endif } } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif diff --git a/GPU/Utils/CMakeLists.txt b/GPU/Utils/CMakeLists.txt index c90ddb929e689..e4612e6a9490f 100644 --- a/GPU/Utils/CMakeLists.txt +++ b/GPU/Utils/CMakeLists.txt @@ -33,29 +33,6 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") target_compile_definitions(${targetName} PRIVATE GPUCA_O2_LIB GPUCA_TPC_GEOMETRY_O2 GPUCA_HAVE_O2HEADERS) - - install(FILES ${HDRS_CINT} ${HDRS_INSTALL} DESTINATION include/GPU) -endif() - -if(ALIGPU_BUILD_TYPE STREQUAL "ALIROOT") - add_definitions(-DGPUCA_ALIROOT_LIB) - - set(SRCS ${SRCS} ../GPUTracking/utils/EmptyFile.cxx) - - # Add a library to the project using the specified source files - add_library_tested(Ali${MODULE} SHARED ${SRCS}) - # Additional compilation flags - set_target_properties(Ali${MODULE} PROPERTIES COMPILE_FLAGS "") - - # System dependent: Modify the way the library is build - if(${CMAKE_SYSTEM} MATCHES Darwin) - set_target_properties(Ali${MODULE} - PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") - endif(${CMAKE_SYSTEM} MATCHES Darwin) - - # Installation - install(TARGETS Ali${MODULE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) - - install(FILES ${HDRS_CINT} ${HDRS_INSTALL} DESTINATION include) + install(FILES ${HDRS_CINT} ${HDRS_INSTALL} DESTINATION include/GPU) endif() diff --git a/GPU/Utils/FlatObject.h b/GPU/Utils/FlatObject.h index 99fcdab8a6cae..eba81a2ba06a2 100644 --- a/GPU/Utils/FlatObject.h +++ b/GPU/Utils/FlatObject.h @@ -30,7 +30,7 @@ //#define GPUCA_GPUCODE // uncomment to test "GPU" mode -namespace GPUCA_NAMESPACE +namespace o2 { namespace gpu { @@ -324,9 +324,7 @@ class FlatObject char* mFlatBufferContainer = nullptr; //[mFlatBufferSize] Optional container for the flat buffer char* mFlatBufferPtr = nullptr; //! Pointer to the flat buffer -#ifndef GPUCA_ALIROOT_LIB ClassDefNV(FlatObject, 1); -#endif }; /// ======================================================================================================== @@ -574,6 +572,6 @@ inline void FlatObject::setFutureBufferAddress(char* futureFlatBufferPtr) #endif //GPUCA_GPUCODE_DEVICE } // namespace gpu -} // namespace GPUCA_NAMESPACE +} // namespace o2 #endif