diff --git a/Detectors/TPC/reconstruction/include/TPCReconstruction/GPUCATracking.h b/Detectors/TPC/reconstruction/include/TPCReconstruction/GPUCATracking.h index 7ff7d2d0e8729..b28fdc483b60a 100644 --- a/Detectors/TPC/reconstruction/include/TPCReconstruction/GPUCATracking.h +++ b/Detectors/TPC/reconstruction/include/TPCReconstruction/GPUCATracking.h @@ -58,7 +58,6 @@ class GPUCATracking //Input: cluster structure, possibly including MC labels, pointers to std::vectors for tracks and track MC labels. outputTracksMCTruth may be nullptr to indicate missing cluster MC labels. Otherwise, cluster MC labels are assumed to be present. int runTracking(o2::gpu::GPUO2InterfaceIOPtrs* data, o2::gpu::GPUInterfaceOutputs* outputs = nullptr); - float getPseudoVDrift(); //Return artificial VDrift used to convert time to Z void GetClusterErrors2(int row, float z, float sinPhi, float DzDs, short clusterState, float& ErrY2, float& ErrZ2) const; int registerMemoryForGPU(const void* ptr, size_t size); diff --git a/Detectors/TPC/reconstruction/src/GPUCATracking.cxx b/Detectors/TPC/reconstruction/src/GPUCATracking.cxx index c764e68674db9..63becdd24962e 100644 --- a/Detectors/TPC/reconstruction/src/GPUCATracking.cxx +++ b/Detectors/TPC/reconstruction/src/GPUCATracking.cxx @@ -13,17 +13,10 @@ #include "TPCReconstruction/GPUCATracking.h" -#include "FairLogger.h" #include "ReconstructionDataFormats/Track.h" #include "SimulationDataFormat/MCCompLabel.h" #include "SimulationDataFormat/ConstMCTruthContainer.h" -#include "TChain.h" -#include "TClonesArray.h" -#include "TPCBase/Mapper.h" #include "TPCBase/PadRegionInfo.h" -#include "TPCBase/ParameterDetector.h" -#include "TPCBase/ParameterElectronics.h" -#include "TPCBase/ParameterGas.h" #include "TPCBase/Sector.h" #include "DataFormatsTPC/Digit.h" #include "DataFormatsTPC/ClusterNativeHelper.h" @@ -84,11 +77,6 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs* LOG(ERROR) << "Output tracks or clusRefs vectors are not initialized"; return 0; } - auto& detParam = ParameterDetector::Instance(); - auto& gasParam = ParameterGas::Instance(); - auto& elParam = ParameterElectronics::Instance(); - float vzbin = (elParam.ZbinWidth * gasParam.DriftV); - Mapper& mapper = Mapper::instance(); std::vector gpuDigits[Sector::MAXSECTOR]; o2::dataformats::MCTruthContainer gpuDigitsMC[Sector::MAXSECTOR]; @@ -245,9 +233,6 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs* int globalRow = trackClusters[tracks[i].FirstClusterRef() + j].row; int clusterIdInRow = clusterIdGlobal - data->clusters->clusterOffset[sector][globalRow]; int regionNumber = 0; - while (globalRow > mapper.getGlobalRowOffsetRegion(regionNumber) + mapper.getNumberOfRowsRegion(regionNumber)) { - regionNumber++; - } clIndArr[nOutCl2] = clusterIdInRow; sectorIndexArr[nOutCl2] = sector; rowIndexArr[nOutCl2] = globalRow; @@ -317,13 +302,6 @@ int GPUCATracking::runTracking(GPUO2InterfaceIOPtrs* data, GPUInterfaceOutputs* return (retVal); } -float GPUCATracking::getPseudoVDrift() -{ - auto& gasParam = ParameterGas::Instance(); - auto& elParam = ParameterElectronics::Instance(); - return (elParam.ZbinWidth * gasParam.DriftV); -} - void GPUCATracking::GetClusterErrors2(int row, float z, float sinPhi, float DzDs, short clusterState, float& ErrY2, float& ErrZ2) const { if (mTrackingCAO2Interface == nullptr) { diff --git a/Detectors/TPC/workflow/src/CATrackerSpec.cxx b/Detectors/TPC/workflow/src/CATrackerSpec.cxx index a6e9bb169a6c7..08f46532e7072 100644 --- a/Detectors/TPC/workflow/src/CATrackerSpec.cxx +++ b/Detectors/TPC/workflow/src/CATrackerSpec.cxx @@ -26,7 +26,6 @@ #include "Framework/Logger.h" #include "Framework/CallbackService.h" #include "DataFormatsTPC/TPCSectorHeader.h" -#include "DataFormatsTPC/ClusterGroupAttribute.h" #include "DataFormatsTPC/ClusterNative.h" #include "DataFormatsTPC/CompressedClusters.h" #include "DataFormatsTPC/Helpers.h" diff --git a/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h b/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h index 0eaea415281b7..c1fbfd1065d31 100644 --- a/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h +++ b/GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h @@ -131,15 +131,6 @@ struct GPUO2InterfaceIOPtrs { // Output for entropy-reduced clusters of TPC compression const o2::tpc::CompressedClustersFlat* compressedClusters = nullptr; - - // Hint for GPUCATracking to place its output in this buffer if possible. - // This enables to create the output directly in a shared memory segment of the framework. - // This allows further processing with zero-copy. - // So far this is only a hint, GPUCATracking will not always follow. - // If outputBuffer = nullptr, GPUCATracking will allocate the output internally and own the memory. - // TODO: Make this mandatory if outputBuffer != nullptr, and throw an error if outputBufferSize is too small. - void* outputBuffer = nullptr; - size_t outputBufferSize = 0; }; } // namespace gpu } // namespace o2 diff --git a/macro/CMakeLists.txt b/macro/CMakeLists.txt index f159d724cbb4e..06b60abc19584 100644 --- a/macro/CMakeLists.txt +++ b/macro/CMakeLists.txt @@ -32,7 +32,6 @@ install(FILES CheckDigits_mft.C readEMCHits.C readITSDigits.C rootlogon.C - runCATrackingClusterNative.C runTPCRefit.C run_CRUDataSkimming_its.C run_calib_tof.C @@ -231,13 +230,6 @@ o2_add_test_root_macro(readITSDigits.C O2::SimulationDataFormat LABELS its) -# FIXME: move to subsystem dir -o2_add_test_root_macro(runCATrackingClusterNative.C - PUBLIC_LINK_LIBRARIES O2::DataFormatsTPC - O2::ReconstructionDataFormats - O2::SimulationDataFormat - O2::TPCReconstruction -LABELS tpc) # FIXME: move to subsystem dir o2_add_test_root_macro(runTPCRefit.C PUBLIC_LINK_LIBRARIES O2::DataFormatsTPC diff --git a/macro/runCATrackingClusterNative.C b/macro/runCATrackingClusterNative.C deleted file mode 100644 index 95d1f215fbeb9..0000000000000 --- a/macro/runCATrackingClusterNative.C +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright CERN and copyright holders of ALICE O2. This software is -// distributed under the terms of the GNU General Public License v3 (GPL -// Version 3), copied verbatim in the file "COPYING". -// -// See http://alice-o2.web.cern.ch/license for full licensing information. -// -// 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. - -#if !defined(__CLING__) || defined(__ROOTCLING__) -#include -#include -#include -#include "TSystem.h" - -#include "TChain.h" -#include "TClonesArray.h" -#include "TFile.h" -#include "TROOT.h" -#include "TTree.h" - -#include "DataFormatsTPC/ClusterNative.h" -#include "DataFormatsTPC/ClusterNativeHelper.h" -#include "DataFormatsTPC/Helpers.h" -#include "ReconstructionDataFormats/Track.h" -#include "SimulationDataFormat/MCCompLabel.h" -#include "SimulationDataFormat/MCTruthContainer.h" -#include "DataFormatsTPC/Constants.h" -#include "TPCReconstruction/GPUCATracking.h" -#include "GPUO2InterfaceConfiguration.h" -#include "DataFormatsTPC/TrackTPC.h" -#else -#pragma cling load("libO2TPCReconstruction") -#pragma cling load("libO2DataFormatsTPC") -#endif - -using namespace o2::gpu; -using namespace o2::tpc; -using namespace o2::dataformats; -using namespace std; - -#if !defined(__CLING__) || defined(__ROOTCLING__) // Disable in interpreted mode due to missing rootmaps - -// This is a prototype of a macro to test running the HLT O2 CA Tracking library on a root input file containg -// TClonesArray of clusters. -// It wraps the GPUCATracking class -int runCATrackingClusterNative(TString inputFile, TString outputFile) -{ - if (inputFile.EqualTo("") || outputFile.EqualTo("")) { - printf("Filename missing\n"); - return (1); - } - GPUCATracking tracker; - - // Just some default options to keep the macro running for now - // Should be deprecated anyway in favor of the TPC workflow - GPUO2InterfaceConfiguration config; - config.configEvent.continuousMaxTimeBin = GPUSettings::TPC_MAX_TF_TIME_BIN; - config.configReconstruction.NWays = 3; - config.configReconstruction.NWaysOuter = true; - config.configReconstruction.SearchWindowDZDR = 2.5f; - if (tracker.initialize(config)) { - printf("Error initializing tracker\n"); - return (0); - } - - std::vector cont; - std::vector contMC; - std::unique_ptr clusterBuffer; - MCLabelContainer clusterMCBuffer; - bool doMC = true; - - TFile fin(inputFile); - for (int i = 0; i < o2::tpc::constants::MAXSECTOR; i++) { - for (int j = 0; j < o2::tpc::constants::MAXGLOBALPADROW; j++) { - TString contName = Form("clusters_sector_%d_row_%d", i, j); - TObject* tmp = fin.FindObjectAny(contName); - if (tmp == nullptr) { - printf("Error reading clusters %s\n", contName.Data()); - } else { - cont.emplace_back(std::move(*reinterpret_cast(tmp))); - tmp = fin.FindObjectAny(Form("clustersMCTruth_sector_%d_row_%d", i, j)); - - if (tmp == nullptr) { - printf("Error, clustersMCTruth missing or clusters and clustersMCtruth out of sync! Disabling MC data\n"); - doMC = false; - } else { - contMC.emplace_back(std::move(*reinterpret_cast(tmp))); - } - } - } - } - fin.Close(); - - std::unique_ptr clusters = - ClusterNativeHelper::createClusterNativeIndex(clusterBuffer, cont, doMC ? &clusterMCBuffer : nullptr, doMC ? &contMC : nullptr); - - vector tracks; - vector trackClusRefs; - std::vector tracksMC; - - TFile fout(outputFile, "recreate"); - TTree tout("events", "events"); - tout.Branch("Tracks", &tracks); - tout.Branch("TracksClusRefs", &trackClusRefs); - tout.Branch("TracksMCTruth", &tracksMC); - - printf("Processing time frame\n"); - GPUO2InterfaceIOPtrs ptrs; - ptrs.clusters = clusters.get(); - ptrs.outputTracks = &tracks; - ptrs.outputClusRefs = &trackClusRefs; - ptrs.outputTracksMCTruth = doMC ? &tracksMC : nullptr; - if (tracker.runTracking(&ptrs) == 0) { - printf("\tFound %d tracks\n", (int)tracks.size()); - } else { - printf("\tError during tracking\n"); - } - - float artificialVDrift = tracker.getPseudoVDrift(); - - // partial printout of 100 tracks - int step = tracks.size() / 100; - step = step < 1 ? 1 : step; - for (unsigned int i = 0; i < tracks.size(); i += step) { - // Loop over clusters - for (int j = tracks[i].getNClusterReferences() - 1; j >= 0; j--) { - // Get cluster references - uint8_t sector, row; - uint32_t clusterIndexInRow; - tracks[i].getClusterReference(trackClusRefs, j, sector, row, clusterIndexInRow); - const ClusterNative& cl = tracks[i].getCluster(trackClusRefs, j, *clusters, sector, row); - const ClusterNative& clLast = tracks[i].getCluster(trackClusRefs, 0, *clusters); - // RS: TODO: account for possible A/C merged tracks - float sideFactor = tracks[i].hasASideClustersOnly() ? -1.f : 1.f; - printf( - "Track %d: Side %s Estimated timeVertex: %f, num clusters %d, innermost cluster: sector %d, row %d, " - "ClusterTime %f, TrackParam X %f Z %f --> T %f, LastClusterT: %f\n", - i, tracks[i].hasBothSidesClusters() ? "AC" : (tracks[i].hasASideClusters() ? "A" : "C"), tracks[i].getTime0(), - tracks[i].getNClusterReferences(), (int)sector, (int)row, cl.getTime(), tracks[i].getX(), tracks[i].getZ(), - tracks[i].getTime0() - sideFactor * tracks[i].getZ() / artificialVDrift, clLast.getTime()); - break; // Reduce output in this example code - } - } - - tout.Fill(); - fout.Write(); - fout.Close(); - - tracker.deinitialize(); - return (0); -} - -#endif