Skip to content

Commit

Permalink
Workaround ROOT serialization bug affecting CalDet<PadFlafs>
Browse files Browse the repository at this point in the history
ROOT has an issue when serializing std::vector<T> where T is a scoped
enum backed by something which has size different from int one.

This is true for any architecture, it just happens to be more lethal on
ARM. For more details root-project/root#16312.

Add explicitly types to the linkdef while at it.
  • Loading branch information
ktf committed Aug 30, 2024
1 parent ed85b4c commit 36f06de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DataFormats/Detectors/TPC/include/DataFormatsTPC/Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ enum class StatisticsType {
MeanStdDev ///< Use mean and standard deviation
};

enum class PadFlags : unsigned short {
enum class PadFlags : unsigned int {
flagGoodPad = 1 << 0, ///< flag for a good pad binary 0001
flagDeadPad = 1 << 1, ///< flag for a dead pad binary 0010
flagUnknownPad = 1 << 2, ///< flag for unknown status binary 0100
Expand Down
1 change: 1 addition & 0 deletions Detectors/TPC/base/include/TPCBase/CalArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class CalArray

/// initialize the data array depending on what is set as PadSubset
void initData();
ClassDefNV(CalArray, 1)
};

#ifndef GPUCA_ALIGPUCODE
Expand Down
3 changes: 3 additions & 0 deletions Detectors/TPC/base/src/TPCBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma link C++ class o2::tpc::CalArray < unsigned> + ;
#pragma link C++ class o2::tpc::CalArray < short> + ;
#pragma link C++ class o2::tpc::CalArray < bool> + ;
#pragma link C++ class o2::tpc::CalArray < o2::tpc::PadFlags> + ;
#pragma link C++ class o2::tpc::CalDet < float> + ;
#pragma link C++ class o2::tpc::CalDet < double> + ;
#pragma link C++ class o2::tpc::CalDet < int> + ;
Expand Down Expand Up @@ -60,6 +61,8 @@
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::tpc::ParameterGas> + ;
#pragma link C++ enum o2::tpc::AmplificationMode;
#pragma link C++ enum o2::tpc::DigitzationMode;
#pragma link C++ enum o2::tpc::PadFlags;
#pragma link C++ enum o2::tpc::PadSubset;
#pragma link C++ struct o2::tpc::ParameterGEM;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::tpc::ParameterGEM> + ;
#pragma link C++ class o2::tpc::IonTailSettings + ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct IDCOne;
struct FourierCoeff;
template <typename DataT>
struct IDCDelta;
enum class PadFlags : unsigned short;
enum class PadFlags : unsigned int;

template <class T>
class CalDet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace o2::tpc
{

enum class PadFlags : unsigned short;
enum class PadFlags : unsigned int;

template <class T>
class CalDet;
Expand Down

0 comments on commit 36f06de

Please sign in to comment.