Skip to content

Commit 60e17d7

Browse files
committed
GPU Standalone: Add recreateTrivialCalibObjects option
1 parent 0755ca3 commit 60e17d7

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed

Detectors/TPC/reconstruction/include/TPCReconstruction/TPCFastTransformHelperO2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ class TPCFastTransformHelperO2
6969
{
7070
return updateCalibrationImpl(fastTransform, TimeStamp, vDriftFactor, vDriftRef, driftTimeOffset);
7171
}
72-
7372
/// _______________ Utilities ________________________
7473

7574
const TPCFastTransformGeo& getGeometry() { return mGeo; }

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ AddOption(runCompression, int32_t, 1, "", 0, "Enable TPC Compression")
638638
AddOption(runTransformation, int32_t, 1, "", 0, "Enable TPC Transformation")
639639
AddOption(runRefit, bool, false, "", 0, "Enable final track refit")
640640
AddOption(setO2Settings, bool, false, "", 0, "Set O2 defaults for output of shared cluster map, referenceX")
641+
AddOption(recreateTrivialCalibObjects, bool, false, "", 0, "Recreate trivial calibration objects (TPCTransform, dEdxCorrection) from scratch")
641642
AddHelp("help", 'h')
642643
AddHelpAll("helpall", 'H')
643644
AddSubConfig(GPUSettingsRec, rec)

GPU/GPUTracking/Standalone/Benchmark/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2")
2020
o2_add_executable(standalone-benchmark
2121
COMPONENT_NAME gpu
2222
TARGETVARNAME targetName
23-
PUBLIC_LINK_LIBRARIES O2::GPUO2Interface O2::GPUTracking
23+
PUBLIC_LINK_LIBRARIES O2::GPUO2Interface O2::GPUTracking O2::TPCReconstruction
2424
SOURCES ${SRCS})
2525
endif()
2626

2727
if(ALIGPU_BUILD_TYPE STREQUAL "Standalone")
2828
add_executable(ca ${SRCS})
2929
set(targetName ca)
30-
target_link_libraries(${targetName} PUBLIC GPUTracking)
30+
target_link_libraries(${targetName} PUBLIC GPUTracking standalone_support2)
31+
install(TARGETS ca)
3132
endif()
3233

3334
install(DIRECTORY ../tools DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/GPU)

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@
2424
#include "display/GPUDisplayInterface.h"
2525
#include "genEvents.h"
2626

27-
#include "TPCFastTransformPOD.h"
2827
#include "GPUTPCGMMergedTrack.h"
2928
#include "GPUSettings.h"
3029
#include "GPUConstantMem.h"
3130

3231
#include "GPUO2DataTypes.h"
3332
#include "GPUChainITS.h"
3433

34+
// For creating default objects
35+
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
36+
#include "CalibdEdxContainer.h"
37+
#include "TPCFastTransformPOD.h"
38+
#include "GPUTRDRecoParam.h"
39+
#include "TPCZSLinkMapping.h"
40+
3541
#include "DataFormatsTPC/CompressedClusters.h"
3642

3743
#include <iostream>
@@ -286,6 +292,31 @@ int32_t ReadConfiguration(int argc, char** argv)
286292
return (0);
287293
}
288294

295+
void CreateTrivialCalibObjects()
296+
{
297+
GPUCalibObjectsConst calib;
298+
299+
aligned_unique_buffer_ptr<TPCFastTransformPOD> tmpFastTransformBuffer;
300+
TPCFastTransformPOD::create(tmpFastTransformBuffer, *o2::tpc::TPCFastTransformHelperO2::instance()->create(0));
301+
calib.fastTransform = tmpFastTransformBuffer.get();
302+
auto tmpTRDGeometry = std::make_unique<o2::trd::GeometryFlat>();
303+
calib.trdGeometry = tmpTRDGeometry.get();
304+
auto tmpTRDRecoParam = std::make_unique<GPUTRDRecoParam>();
305+
calib.trdRecoParam = tmpTRDRecoParam.get();
306+
auto tmpdEdxCalibContainer = std::make_unique<o2::tpc::CalibdEdxContainer>();
307+
tmpdEdxCalibContainer->setDefaultZeroSupresssionThreshold();
308+
tmpdEdxCalibContainer->setDefaultPolTopologyCorrection();
309+
calib.dEdxCalibContainer = tmpdEdxCalibContainer.get();
310+
auto tmpTPCPadGainCalib = std::make_unique<TPCPadGainCalib>();
311+
calib.tpcPadGain = tmpTPCPadGainCalib.get();
312+
auto tmpTPCZSLinkMapping = std::make_unique<TPCZSLinkMapping>();
313+
calib.tpcZSLinkMapping = tmpTPCZSLinkMapping.get();
314+
315+
chainTracking->SetCalibObjects(calib);
316+
rec->DumpSettings("./");
317+
printf("Wrote trivial calibration objects to current folder\n");
318+
}
319+
289320
int32_t SetupReconstruction()
290321
{
291322
if (!configStandalone.eventGenerator) {
@@ -770,6 +801,11 @@ int32_t main(int argc, char** argv)
770801
}
771802
}
772803

804+
if (configStandalone.recreateTrivialCalibObjects) {
805+
CreateTrivialCalibObjects();
806+
return 0;
807+
}
808+
773809
if (SetupReconstruction()) {
774810
return 1;
775811
}

GPU/GPUTracking/Standalone/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ add_library(standalone_support SHARED
159159
${O2_DIR}/Detectors/Base/src/Ray.cxx
160160
${O2_DIR}/Detectors/Base/src/Propagator.cxx)
161161

162+
add_library(standalone_support2 SHARED
163+
${O2_DIR}/Detectors/TPC/reconstruction/src/TPCFastTransformHelperO2.cxx)
164+
162165
target_compile_definitions(standalone_support PUBLIC $<TARGET_PROPERTY:O2::GPUTracking,COMPILE_DEFINITIONS>)
163166
target_include_directories(standalone_support PUBLIC $<TARGET_PROPERTY:O2::GPUTracking,INCLUDE_DIRECTORIES>)
164167

@@ -196,15 +199,20 @@ target_include_directories(standalone_support PUBLIC
196199
${O2_DIR}/Detectors/TRD/base/include
197200
${O2_DIR}/Detectors/TRD/base/src
198201
${O2_DIR}/Framework/Foundation/3rdparty/include)
202+
target_include_directories(standalone_support2 PUBLIC
203+
${O2_DIR}/Detectors/TPC/reconstruction/include)
204+
199205

200-
target_link_libraries(standalone_support PUBLIC#
206+
target_link_libraries(standalone_support PUBLIC
201207
dl
202208
pthread
203209
Microsoft.GSL::GSL)
204210

205211
target_link_libraries(GPUTracking PUBLIC standalone_support)
206212
target_link_libraries(TPCFastTransformation PUBLIC standalone_support)
207213

214+
target_link_libraries(standalone_support2 PUBLIC GPUTracking TPCFastTransformation standalone_support)
215+
208216
if(NOT GPUCA_CONFIG_O2)
209217
target_compile_definitions(GPUTracking PRIVATE GPUCA_RUN2)
210218
endif()
@@ -243,7 +251,7 @@ if (GPUCA_BUILD_DEBUG_SANITIZE AND CMAKE_CXX_COMPILER MATCHES "clang\\+\\+")
243251
endif()
244252

245253
# Installation
246-
install(TARGETS ca TPCFastTransformation standalone_support)
254+
install(TARGETS standalone_support standalone_support2)
247255
install(FILES "cmake/makefile" DESTINATION "${CMAKE_INSTALL_PREFIX}")
248256
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${O2_DIR} ${CMAKE_INSTALL_PREFIX}/src)")
249257
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/config.cmake ${CMAKE_INSTALL_PREFIX}/config.cmake)")

GPU/TPCFastTransformation/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ if(ALIGPU_BUILD_TYPE STREQUAL "Standalone")
123123
add_library(${MODULE} SHARED ${SRCS})
124124
set(targetName ${MODULE})
125125
target_include_directories(${targetName} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
126+
install(TARGETS TPCFastTransformation)
126127
endif()
127128

128129
install(FILES ${HDRS_CINT_O2} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/GPU)

0 commit comments

Comments
 (0)