diff --git a/DataFormats/Detectors/TPC/include/DataFormatsTPC/AltroSyncSignal.h b/DataFormats/Detectors/TPC/include/DataFormatsTPC/AltroSyncSignal.h index 6dee49e4ed6c6..01ab9593c1eb0 100644 --- a/DataFormats/Detectors/TPC/include/DataFormatsTPC/AltroSyncSignal.h +++ b/DataFormats/Detectors/TPC/include/DataFormatsTPC/AltroSyncSignal.h @@ -12,6 +12,9 @@ /// \file AltroSyncSignal.h /// \brief Definition of the timebin from which syncronization starts +#ifndef ALICEO2_DATAFORMATSTPC_ALTROSYNCSIGNAL_H +#define ALICEO2_DATAFORMATSTPC_ALTROSYNCSIGNAL_H + #include "GPUCommonRtypes.h" namespace o2::tpc @@ -28,3 +31,5 @@ struct AltroSyncSignal { ClassDefNV(AltroSyncSignal, 1); }; } // namespace o2::tpc + +#endif // ALICEO2_DATAFORMATSTPC_ALTROSYNCSIGNAL_H diff --git a/Detectors/EMCAL/calib/include/EMCALCalib/TriggerSTUErrorCounter.h b/Detectors/EMCAL/calib/include/EMCALCalib/TriggerSTUErrorCounter.h index 38079676c60e8..9a7ad914ac9ba 100644 --- a/Detectors/EMCAL/calib/include/EMCALCalib/TriggerSTUErrorCounter.h +++ b/Detectors/EMCAL/calib/include/EMCALCalib/TriggerSTUErrorCounter.h @@ -8,6 +8,9 @@ // 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. +#ifndef ALICEO2_EMCAL_TRIGGERSTUERRORCOUNTER_H +#define ALICEO2_EMCAL_TRIGGERSTUERRORCOUNTER_H + #include #include #include @@ -80,3 +83,5 @@ class TriggerSTUErrorCounter } // namespace emcal } // namespace o2 + +#endif // ALICEO2_EMCAL_TRIGGERSTUERRORCOUNTER_H diff --git a/Detectors/ITSMFT/ITS/simulation/include/ITSSimulation/ITSDataSimulator.h b/Detectors/ITSMFT/ITS/simulation/include/ITSSimulation/ITSDataSimulator.h index c8bb9becbd2da..f8bd6c61f4cfb 100644 --- a/Detectors/ITSMFT/ITS/simulation/include/ITSSimulation/ITSDataSimulator.h +++ b/Detectors/ITSMFT/ITS/simulation/include/ITSSimulation/ITSDataSimulator.h @@ -13,6 +13,9 @@ /// \brief Infrastructure to simulate ALPIDE chip data. /// \author knaumov@cern.ch +#ifndef ALICEO2_ITSSIMULATION_ITSDATASIMULATOR_H +#define ALICEO2_ITSSIMULATION_ITSDATASIMULATOR_H + #include "ITSMFTBase/SegmentationAlpide.h" #include "ITSMFTReconstruction/PixelData.h" @@ -52,3 +55,5 @@ class ITSDataSimulator } // namespace itsmft } // namespace o2 + +#endif // ALICEO2_ITSSIMULATION_ITSDATASIMULATOR_H diff --git a/Detectors/TPC/qc/include/TPCQC/Tracks.h b/Detectors/TPC/qc/include/TPCQC/Tracks.h index ff215b68ce3b1..1ba4ea11ece4f 100644 --- a/Detectors/TPC/qc/include/TPCQC/Tracks.h +++ b/Detectors/TPC/qc/include/TPCQC/Tracks.h @@ -27,6 +27,7 @@ #include "TH1.h" #include "TH1F.h" #include "TH2F.h" +#include "MathUtils/Cartesian.h" namespace o2 { diff --git a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h index 05ec269a89219..b62ccb38765c1 100644 --- a/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h +++ b/Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/IOUtils.h @@ -8,6 +8,9 @@ // 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. +#ifndef ALICEO2_ITS3RECONSTRUCTION_IOUTILS_H +#define ALICEO2_ITS3RECONSTRUCTION_IOUTILS_H + #include #include "SimulationDataFormat/MCTruthContainer.h" #include "ReconstructionDataFormats/BaseCluster.h" @@ -87,3 +90,5 @@ int loadROFrameDataITS3(its::TimeFrame<7>* tf, const dataformats::MCTruthContainer* mcLabels = nullptr); } // namespace its3::ioutils } // namespace o2 + +#endif // ALICEO2_ITS3RECONSTRUCTION_IOUTILS_H diff --git a/Detectors/ZDC/macro/CreateSimCondition.C b/Detectors/ZDC/macro/CreateSimCondition.C index 9f29aafc979bb..94e1aa478e3a5 100644 --- a/Detectors/ZDC/macro/CreateSimCondition.C +++ b/Detectors/ZDC/macro/CreateSimCondition.C @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#if !defined(__CLING__) || defined(__ROOTCLING__) #include "Framework/Logger.h" +#if !defined(__CLING__) || defined(__ROOTCLING__) #include "CCDB/CcdbApi.h" #include #include diff --git a/Detectors/ZDC/macro/CreateSimCondition_pp.C b/Detectors/ZDC/macro/CreateSimCondition_pp.C index f38634ef18fac..41b14d1c1964e 100644 --- a/Detectors/ZDC/macro/CreateSimCondition_pp.C +++ b/Detectors/ZDC/macro/CreateSimCondition_pp.C @@ -9,8 +9,8 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#if !defined(__CLING__) || defined(__ROOTCLING__) #include "Framework/Logger.h" +#if !defined(__CLING__) || defined(__ROOTCLING__) #include "CCDB/CcdbApi.h" #include #include diff --git a/Generators/include/Generators/Generator.h b/Generators/include/Generators/Generator.h index ac98b6f7b33a5..5a34ca9882a66 100644 --- a/Generators/include/Generators/Generator.h +++ b/Generators/include/Generators/Generator.h @@ -15,6 +15,8 @@ #define ALICEO2_EVENTGEN_GENERATOR_H_ #include "FairGenerator.h" +// Needed inclusion for the many external generators using LOG after FairRoot was included in O2 (07/2026) +#include #include "TParticle.h" #include "Generators/Trigger.h" #include diff --git a/cmake/AddRootDictionary.cmake b/cmake/AddRootDictionary.cmake index f088a86709910..2b8c752b324cc 100644 --- a/cmake/AddRootDictionary.cmake +++ b/cmake/AddRootDictionary.cmake @@ -140,6 +140,19 @@ function(add_root_dictionary target) set(pcmDeps) endif() + # Public headers of this dictionary. rootcling writes rootmap entries only for a few of them + # so RunRootcling.cmake adds the missing ones. Without this + # a ROOT macro including the header makes cling parse automatically the + # whole dictionary payload from inside the half-parsed header, failing with + # "unknown type name" / "incomplete type" errors and this can cause the interpreter to crash + set(rootmapHeaders) + foreach(h IN LISTS A_HEADERS) + if(h MATCHES "(^|/)include/(.+)$") + list(APPEND rootmapHeaders ${CMAKE_MATCH_2}) + endif() + endforeach() + string(REPLACE ";" "|" rootmapHeaders "${rootmapHeaders}") + if(A_EXTRA_PATCH) set(extraPatch -DPATCH=${CMAKE_CURRENT_LIST_DIR}/${A_EXTRA_PATCH}) else() @@ -163,6 +176,8 @@ function(add_root_dictionary target) "-DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}" ${extraPatch} "-DARGS=${rootclingArgs}" + "-DROOTMAP=${rootmapFile}" + "-DROOTMAP_HEADERS=${rootmapHeaders}" -P ${O2_RUN_ROOTCLING_SCRIPT} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${pcmBase} ${pcmFile} diff --git a/cmake/RunRootcling.cmake b/cmake/RunRootcling.cmake index b2d7d74860f33..84a19e43bd9db 100644 --- a/cmake/RunRootcling.cmake +++ b/cmake/RunRootcling.cmake @@ -9,8 +9,9 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -# Runs rootcling, optionally appends PATCH to the generated dictionary, and -# turns the "Unused class rule" warning into an error. +# Runs rootcling, optionally appends PATCH to the generated dictionary, turns +# the "Unused class rule" warning into an error, and completes the rootmap with +# a "header" entry for each of ROOTMAP_HEADERS (see AddRootDictionary.cmake). # # rootcling only offers -failOnWarnings, which is all or nothing, so the # output still has to be inspected to single out that one warning. @@ -55,3 +56,19 @@ if(PATCH) file(READ ${PATCH} patchContent) file(APPEND ${DICTIONARY} "${patchContent}") endif() + +if(ROOTMAP AND ROOTMAP_HEADERS AND EXISTS ${ROOTMAP}) + cmake_policy(SET CMP0007 NEW) # keep empty rootmap lines as list elements + file(STRINGS ${ROOTMAP} rootmapLines) + string(REPLACE "|" ";" rootmapHeaders "${ROOTMAP_HEADERS}") + set(missing "") + foreach(h IN LISTS rootmapHeaders) + list(FIND rootmapLines "header ${h}" index) + if(index EQUAL -1) + string(APPEND missing "header ${h}\n") + endif() + endforeach() + if(missing) + file(APPEND ${ROOTMAP} "# Public headers of this dictionary not listed by rootcling\n${missing}") + endif() +endif()