Skip to content

Commit e9f3883

Browse files
committed
fix:Update for compilation with FairRoot v19.0.0
Clang-format
1 parent b666f7e commit e9f3883

6 files changed

Lines changed: 24 additions & 50 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
2-
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2025 Members of R3B Collaboration #
2+
# Copyright (C) 2013 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2013-2026 Members of R3B Collaboration #
44
# #
55
# This software is distributed under the terms of the #
66
# GNU General Public Licence (GPL) version 3, #
@@ -14,7 +14,7 @@
1414
# The name of our project is “R3BROOT”. CMakeLists files in this project can refer to the root
1515
# source directory of the project as ${R3BROOT_SOURCE_DIR} or as ${CMAKE_SOURCE_DIR} and to the root
1616
# binary directory of the project as ${R3BROOT_BINARY_DIR} or ${CMAKE_BINARY_DIR}. This difference
17-
# is is important for the base classes which are in R3BROOT and PANDAROOT.
17+
# is important for the base classes which are in R3BROOT and PANDAROOT.
1818

1919
if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
2020
message(FATAL_ERROR "In-source builds are not supported, please, create a folder build.")
@@ -24,7 +24,7 @@ endif()
2424
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
2525

2626
# set cmake policies
27-
cmake_policy(VERSION 3.27...4.1)
27+
cmake_policy(VERSION 3.27...4.2)
2828

2929
# Set name of our project to "R3BROOT". Has to be done after check of cmake version
3030
project(R3BROOT LANGUAGES C CXX Fortran)
@@ -97,8 +97,7 @@ find_package2(PUBLIC FairRoot CONFIG REQUIRED)
9797

9898
# FairRoot_VERSION is eventually set by find_package, for now let's set it explicitly
9999
execute_process(
100-
COMMAND ${FAIRROOTPATH}/bin/fairroot-config --version
101-
COMMAND sed "s/^v//"
100+
COMMAND bash -c "${FAIRROOTPATH}/bin/fairroot-config --version | sed 's/^v//'"
102101
OUTPUT_VARIABLE FairRoot_VERSION
103102
OUTPUT_STRIP_TRAILING_WHITESPACE)
104103
if("${FairRoot_VERSION}" VERSION_LESS 18.2.1)
@@ -520,8 +519,8 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/R3BRootConfigVersion.cmake.in
520519

521520
r3b_generate_version_info()
522521

523-
# Recurse into the given subdirectories. This does not actually cause another cmake executable to
524-
# run. The same process will walk through the project's entire directory structure.
522+
# Recurse into the given subdirectories. This does not actually cause another cmake executable to
523+
# run. The same process will walk through the project's entire directory structure.
525524

526525
# FIXME in FairSoft / FairRoot
527526
find_package(VMC QUIET)

analysis/online/R3BFootVsAlpideOnlineSpectra.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2019-2025 Members of R3B Collaboration *
3+
* Copyright (C) 2019-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -135,5 +135,5 @@ class R3BFootVsAlpideOnlineSpectra : public FairTask
135135
Int_t fNbDet = 8; /**< Number of FOOT detectors. */
136136

137137
public:
138-
ClassDef(R3BFootVsAlpideOnlineSpectra, 1)
138+
ClassDefOverride(R3BFootVsAlpideOnlineSpectra, 1)
139139
};

r3bdata/alpideData/R3BAlpideHitData.cxx

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2023 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *
@@ -17,38 +17,6 @@
1717

1818
#include "R3BAlpideHitData.h"
1919
#include <fmt/core.h>
20-
// Needed for TVector3 fmt
21-
template <>
22-
struct fmt::formatter<TVector3>
23-
{
24-
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
25-
26-
template <typename FormatContext>
27-
auto format(const TVector3& vec, FormatContext& ctx)
28-
{
29-
return fmt::format_to(ctx.out(), "({}, {}, {})", vec.X(), vec.Y(), vec.Z());
30-
}
31-
};
32-
// Needed for std::vector<double>
33-
template <>
34-
struct fmt::formatter<std::vector<double>>
35-
{
36-
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
37-
38-
template <typename FormatContext>
39-
auto format(const std::vector<double>& v, FormatContext& ctx)
40-
{
41-
std::string s = "[";
42-
for (size_t i = 0; i < v.size(); ++i)
43-
{
44-
s += fmt::format("{}", v[i]);
45-
if (i + 1 < v.size())
46-
s += ", ";
47-
}
48-
s += "]";
49-
return fmt::format_to(ctx.out(), "{}", s);
50-
}
51-
};
5220
R3BAlpideHitData::R3BAlpideHitData(uint16_t sensorId,
5321
uint16_t clustersize,
5422
uint16_t genus,
@@ -83,16 +51,14 @@ R3BAlpideHitData::R3BAlpideHitData(uint16_t sensorId,
8351

8452
std::string R3BAlpideHitData::toString() const
8553
{
86-
return fmt::format("SensorID: {}, ClusterSize: {},Genus: {},Elong: {},MajorUnit:{},HolePerimeter: "
87-
"{},TotalPerimeter:{},Hu:{}, Xpos: {}, Ypos: {}, Zpos: {}",
54+
return fmt::format("SensorID: {}, ClusterSize: {},Genus: {},Elong: {},HolePerimeter: "
55+
"{},TotalPerimeter:{}, Xpos: {}, Ypos: {}, Zpos: {}",
8856
GetSensorId(),
8957
GetClusterSize(),
9058
GetGenus(),
9159
GetElong(),
92-
GetMajorUnit(),
9360
GetHolePerimeter(),
9461
GetTotalPerimeter(),
95-
GetHu(),
9662
GetX(),
9763
GetY(),
9864
GetZ());

r3bdata/alpideData/R3BAlpideHitData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
* Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3-
* Copyright (C) 2022-2025 Members of R3B Collaboration *
3+
* Copyright (C) 2022-2026 Members of R3B Collaboration *
44
* *
55
* This software is distributed under the terms of the *
66
* GNU General Public Licence (GPL) version 3, *

r3bsource/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##############################################################################
2-
# Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3-
# Copyright (C) 2019-2026 Members of R3B Collaboration #
2+
# Copyright (C) 2015 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2015-2026 Members of R3B Collaboration #
44
# #
55
# This software is distributed under the terms of the #
66
# GNU General Public Licence (GPL) version 3, #
@@ -302,3 +302,8 @@ add_library_with_dictionary(
302302
R3BData
303303
R3BActaf
304304
Ucesb)
305+
306+
if("${FairRoot_VERSION}" VERSION_GREATER_EQUAL 19.0.0)
307+
target_compile_definitions(R3BSource PUBLIC FAIRROOT_GE_19)
308+
endif()
309+

r3bsource/base/R3BUcesbSource.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ Bool_t R3BUcesbSource::Init()
7272
}
7373
else
7474
{
75+
#ifdef FAIRROOT_GE_19
76+
run->SetEventHeader(std::unique_ptr<R3BEventHeader>());
77+
#else
7578
eventHeader = new R3BEventHeader();
7679
run->SetEventHeader(eventHeader); // Implicit conversion and transfer ownership to FairRun
80+
#endif
7781
R3BLOG(warn, "EventHeader. has been created from R3BEventHeader");
7882
}
7983

0 commit comments

Comments
 (0)