Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /analysis/Corral/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 project(corral LANGUAGES CXX)
0003 
0004 set(CMAKE_CXX_STANDARD 17)
0005 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0006 if(NOT CMAKE_BUILD_TYPE)
0007         set(CMAKE_BUILD_TYPE RelWithDebInfo)
0008 endif()
0009 
0010 # Relies on ROOT's own CMake config (ROOTConfig.cmake) being discoverable --
0011 # e.g. via `source thisroot.sh`, which sets CMAKE_PREFIX_PATH, same as this
0012 # machine's environment already does.
0013 find_package(ROOT REQUIRED)
0014 include(${ROOT_USE_FILE})
0015 
0016 # corral runs corral_loop.cxx over the outTree with CalcRm (event mixing).
0017 # (An earlier convolution version, CalcRc, was removed 2026-09-26: convolution
0018 # cannot work on datasets that need pair cuts.)
0019 set(COMMON_SOURCES
0020         src/corral_main.cxx
0021         src/corral_utils.cxx
0022         src/corral_loop.cxx
0023         src/corral_finalize.cxx
0024 )
0025 
0026 # The old Makefile linked root-config's --evelibs set plus -lMinuit -lGuiHtml
0027 # -lHistPainter -- template leftovers from a shared base Makefile. Nothing here
0028 # includes or calls into TEve/TGeo/TGWindow/TMinuit/RDataFrame/threading/network
0029 # APIs (checked via grep over every #include and call site in src/), so this is
0030 # trimmed to what the source actually uses: Core services, histogramming/graphs,
0031 # canvas+PostScript output (for the QA .ps/.pdf), tree I/O via TTreeReader, and
0032 # TVector3/TLorentzVector (Physics) + TMath (MathCore).
0033 set(CORRAL_ROOT_LIBS
0034         ROOT::Core ROOT::RIO ROOT::Hist ROOT::Graf ROOT::Graf3d ROOT::Gpad
0035         ROOT::Tree ROOT::TreePlayer ROOT::Postscript ROOT::Physics ROOT::MathCore
0036 )
0037 
0038 # The binary lands at the repo root (not a build/ subdir) so the run scripts'
0039 # `./corral` works from the repo root (the binary was called corral_m until 2026-09-27).
0040 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
0041 
0042 add_executable(corral ${COMMON_SOURCES} src/CalcRm.cxx)
0043 target_include_directories(corral PRIVATE src ${CMAKE_BINARY_DIR})
0044 
0045 # corral_version.h (git commit + build time, recorded in info/code of every output file) is rewritten at every build
0046 add_custom_target(corral_version
0047         COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_SOURCE_DIR} -DOUT=${CMAKE_BINARY_DIR}/corral_version.h -P ${CMAKE_SOURCE_DIR}/corral_version.cmake
0048         BYPRODUCTS ${CMAKE_BINARY_DIR}/corral_version.h)
0049 add_dependencies(corral corral_version)
0050 target_link_libraries(corral PRIVATE ${CORRAL_ROOT_LIBS})
0051 
0052 # Default project directory (lists/<set>/, root/<set>/ read by Finalize) = this source tree;
0053 # the environment variable CORRAL_DIR overrides it at run time (finalize_hists.h, CorralDir()).
0054 target_compile_definitions(corral PRIVATE CORRAL_DIR_DEFAULT="${CMAKE_SOURCE_DIR}/")