Skip to content

Commit 515e4cb

Browse files
committed
TPC: move PadFlags and related classes to TPCBaseRecSim
o2::tpc::PadFlags and in particular vectors of thereof are affected by an old ROOT bug in serializing `std::vector<enum struct : short>`. Because of this we have a custom streamer which needs to be initialised very early in order to function correctly. This is fine, however, due to the fact we invoke `TClass::GetClass()` too early, ROOT is forced a bunch of extra stuff, unneededly, resulting in much increased memory footprint in analysis, which happens to use DataFormatsTPC. This makes sure the custom streamer is not initialised statically by DataFormatsTPC and prevents ROOT from loading the kitchen sink when the TClass::GetClass is invoked too early.
1 parent ea23c37 commit 515e4cb

File tree

73 files changed

+183
-118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+183
-118
lines changed

DataFormats/Detectors/TPC/include/DataFormatsTPC/Defs.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -97,23 +97,6 @@ enum class StatisticsType {
9797
MeanStdDev ///< Use mean and standard deviation
9898
};
9999

100-
enum class PadFlags : unsigned short {
101-
flagGoodPad = 1 << 0, ///< flag for a good pad binary 0001
102-
flagDeadPad = 1 << 1, ///< flag for a dead pad binary 0010
103-
flagUnknownPad = 1 << 2, ///< flag for unknown status binary 0100
104-
flagSaturatedPad = 1 << 3, ///< flag for saturated status binary 0100
105-
flagHighPad = 1 << 4, ///< flag for pad with extremly high IDC value
106-
flagLowPad = 1 << 5, ///< flag for pad with extremly low IDC value
107-
flagSkip = 1 << 6, ///< flag for defining a pad which is just ignored during the calculation of I1 and IDCDelta
108-
flagFEC = 1 << 7, ///< flag for a whole masked FEC
109-
flagNeighbour = 1 << 8, ///< flag if n neighbouring pads are outlier
110-
flagAllNoneGood = flagDeadPad | flagUnknownPad | flagSaturatedPad | flagHighPad | flagLowPad | flagSkip | flagFEC | flagNeighbour,
111-
};
112-
113-
inline PadFlags operator&(PadFlags a, PadFlags b) { return static_cast<PadFlags>(static_cast<int>(a) & static_cast<int>(b)); }
114-
inline PadFlags operator~(PadFlags a) { return static_cast<PadFlags>(~static_cast<int>(a)); }
115-
inline PadFlags operator|(PadFlags a, PadFlags b) { return static_cast<PadFlags>(static_cast<int>(a) | static_cast<int>(b)); }
116-
117100
// default point definitions for PointND, PointNDlocal, PointNDglobal are in
118101
// MathUtils/CartesianND.h
119102

DataFormats/Detectors/TPC/src/DataFormatsTPCLinkDef.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,13 @@
2222
#pragma link C++ class o2::tpc::ClusterHardwareContainerFixedSize < 8192> + ;
2323
#pragma link C++ class o2::tpc::ClusterNativeContainer + ;
2424
#pragma link C++ class o2::tpc::Digit + ;
25-
#pragma link C++ enum o2::tpc::PadFlags + ; // enum itself
2625
#pragma link C++ class o2::tpc::ZeroSuppressedContainer8kb + ;
2726
#pragma link C++ class std::vector < o2::tpc::ClusterNative> + ;
2827
#pragma link C++ class std::vector < o2::tpc::ClusterNativeContainer> + ;
2928
#pragma link C++ class std::vector < o2::tpc::ClusterHardware> + ;
3029
#pragma link C++ class std::vector < o2::tpc::ClusterHardwareContainerFixedSize < 8192>> + ;
3130
#pragma link C++ class std::vector < o2::tpc::ClusterHardwareContainer8kb> + ;
3231
#pragma link C++ class std::vector < o2::tpc::Digit> + ;
33-
#pragma link C++ class std::vector < o2::tpc::PadFlags> + ;
3432
#pragma link C++ class std::vector < o2::tpc::ZeroSuppressedContainer8kb> + ;
3533
#pragma link C++ class o2::tpc::TrackTPC + ;
3634
#pragma link C++ class o2::tpc::LaserTrack + ;

Detectors/TPC/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# or submit itself to any jurisdiction.
1111

1212
add_subdirectory(base)
13+
add_subdirectory(baserecsim)
1314
add_subdirectory(reconstruction)
1415
add_subdirectory(calibration)
1516
add_subdirectory(simulation)

Detectors/TPC/base/CMakeLists.txt

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
o2_add_library(TPCBase
1313
SOURCES src/CalArray.cxx
1414
src/CalDet.cxx
15-
src/CDBInterface.cxx
1615
src/ContainerFactory.cxx
1716
src/CRU.cxx
1817
src/DigitPos.cxx
@@ -24,7 +23,6 @@ o2_add_library(TPCBase
2423
src/PadRegionInfo.cxx
2524
src/PadROCPos.cxx
2625
src/PadSecPos.cxx
27-
src/Painter.cxx
2826
src/ParameterDetector.cxx
2927
src/ParameterElectronics.cxx
3028
src/ParameterGas.cxx
@@ -37,16 +35,13 @@ o2_add_library(TPCBase
3735
src/CRUCalibHelpers.cxx
3836
src/IonTailSettings.cxx
3937
src/FEEConfig.cxx
40-
src/DeadChannelMapCreator.cxx
4138
src/CommonModeCorrection.cxx
4239
PUBLIC_LINK_LIBRARIES Vc::Vc Boost::boost O2::DataFormatsTPC
4340
O2::DetectorsRaw O2::CCDB FairRoot::Base)
4441

4542
o2_target_root_dictionary(TPCBase
46-
EXTRA_PATCH src/TPCFlagsMemberCustomStreamer.cxx
4743
HEADERS include/TPCBase/CalArray.h
4844
include/TPCBase/CalDet.h
49-
include/TPCBase/CDBInterface.h
5045
include/TPCBase/ContainerFactory.h
5146
include/TPCBase/CRU.h
5247
include/TPCBase/DigitPos.h
@@ -58,7 +53,6 @@ o2_target_root_dictionary(TPCBase
5853
include/TPCBase/PadRegionInfo.h
5954
include/TPCBase/PadROCPos.h
6055
include/TPCBase/PadSecPos.h
61-
include/TPCBase/Painter.h
6256
include/TPCBase/ParameterDetector.h
6357
include/TPCBase/ParameterElectronics.h
6458
include/TPCBase/ParameterGas.h
@@ -71,26 +65,13 @@ o2_target_root_dictionary(TPCBase
7165
include/TPCBase/CRUCalibHelpers.h
7266
include/TPCBase/IonTailSettings.h
7367
include/TPCBase/FEEConfig.h
74-
include/TPCBase/DeadChannelMapCreator.h
75-
include/TPCBase/CommonModeCorrection.h
76-
include/TPCBase/CDBTypes.h)
68+
include/TPCBase/CommonModeCorrection.h)
7769
o2_add_test(Base
7870
COMPONENT_NAME tpc
7971
PUBLIC_LINK_LIBRARIES O2::TPCBase
8072
SOURCES test/testTPCBase.cxx
8173
LABELS tpc)
8274

83-
if(BUILD_SIMULATION)
84-
# this test needs CCDB/XROOTD which is for sure
85-
# available in the default-o2 software stack
86-
o2_add_test(CalDet
87-
COMPONENT_NAME tpc
88-
PUBLIC_LINK_LIBRARIES O2::TPCBase
89-
SOURCES test/testTPCCalDet.cxx
90-
ENVIRONMENT O2_ROOT=${CMAKE_BINARY_DIR}/stage
91-
LABELS tpc)
92-
endif()
93-
9475
o2_add_test(Mapper
9576
COMPONENT_NAME tpc
9677
PUBLIC_LINK_LIBRARIES O2::TPCBase

Detectors/TPC/base/src/TPCBaseLinkDef.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@
2121
#pragma link C++ class o2::tpc::CalArray < unsigned> + ;
2222
#pragma link C++ class o2::tpc::CalArray < short> + ;
2323
#pragma link C++ class o2::tpc::CalArray < bool> + ;
24-
#pragma link C++ class o2::tpc::CalArray < o2::tpc::PadFlags> + ;
2524
#pragma link C++ class o2::tpc::CalDet < float> + ;
2625
#pragma link C++ class o2::tpc::CalDet < double> + ;
2726
#pragma link C++ class o2::tpc::CalDet < int> + ;
2827
#pragma link C++ class o2::tpc::CalDet < unsigned> + ;
2928
#pragma link C++ class o2::tpc::CalDet < short> + ;
3029
#pragma link C++ class o2::tpc::CalDet < bool> + ;
31-
#pragma link C++ class o2::tpc::CalDet < o2::tpc::PadFlags> + ;
3230
#pragma link C++ class std::vector < o2::tpc::CalDet < float>> + ;
3331
#pragma link C++ class std::vector < o2::tpc::CalDet < float>*> + ;
3432
#pragma link C++ class std::unordered_map < std::string, o2::tpc::CalDet < float>> + ;
35-
#pragma link C++ enum o2::tpc::CDBType;
36-
#pragma link C++ class o2::tpc::CDBInterface;
37-
#pragma link C++ class o2::tpc::CDBStorage;
3833
#pragma link C++ class o2::tpc::ContainerFactory;
3934
#pragma link C++ class o2::tpc::CRU;
4035
#pragma link C++ class o2::tpc::DigitPos;
@@ -50,8 +45,6 @@
5045
#pragma link C++ class o2::tpc::ROC;
5146
#pragma link C++ class o2::tpc::Sector;
5247

53-
#pragma link C++ class o2::tpc::painter + ;
54-
5548
// #pragma link C++ class std::vector <TCanvas*> + ;
5649
#pragma link C++ class o2::tpc::ParameterDetector;
5750
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::tpc::ParameterDetector> + ;
@@ -90,5 +83,4 @@
9083
#pragma link C++ function o2::tpc::cru_calib_helpers::getCalPad < 2>(const std::string_view, const std::string_view, std::string_view)
9184
#pragma link C++ function o2::tpc::cru_calib_helpers::getCalPad < 6>(const std::string_view, const std::string_view, std::string_view)
9285

93-
#pragma link C++ class o2::tpc::DeadChannelMapCreator + ;
9486
#endif

Detectors/TPC/base/test/testTPCCDBInterface.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "TFile.h"
2222

2323
// o2 includes
24-
#include "TPCBase/CDBInterface.h"
24+
#include "TPCBaseRecSim/CDBInterface.h"
2525
#include "TPCBase/CalArray.h"
2626
#include "TPCBase/CalDet.h"
2727
#include "TPCBase/Mapper.h"
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2019-2025 CERN and copyright holders of ALICE O2.
2+
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
# All rights not expressly granted are reserved.
4+
#
5+
# This software is distributed under the terms of the GNU General Public
6+
# License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
#
8+
# In applying this license CERN does not waive the privileges and immunities
9+
# granted to it by virtue of its status as an Intergovernmental Organization
10+
# or submit itself to any jurisdiction.
11+
12+
o2_add_library(TPCBaseRecSim
13+
SOURCES src/DeadChannelMapCreator.cxx
14+
src/Painter.cxx
15+
src/CDBInterface.cxx
16+
PUBLIC_LINK_LIBRARIES O2::TPCBase)
17+
18+
o2_target_root_dictionary(TPCBaseRecSim
19+
EXTRA_PATCH src/TPCFlagsMemberCustomStreamer.cxx
20+
HEADERS include/TPCBaseRecSim/Painter.h
21+
include/TPCBaseRecSim/PadFlags.h
22+
include/TPCBaseRecSim/DeadChannelMapCreator.h
23+
include/TPCBaseRecSim/CDBTypes.h
24+
include/TPCBaseRecSim/CDBInterface.h)
25+
26+
if(BUILD_SIMULATION)
27+
# this test needs CCDB/XROOTD which is for sure
28+
# available in the default-o2 software stack
29+
o2_add_test(CalDet
30+
COMPONENT_NAME tpc
31+
PUBLIC_LINK_LIBRARIES O2::TPCBaseRecSim
32+
SOURCES test/testTPCCalDet.cxx
33+
ENVIRONMENT O2_ROOT=${CMAKE_BINARY_DIR}/stage
34+
LABELS tpc)
35+
endif()

Detectors/TPC/base/include/TPCBase/CDBInterface.h renamed to Detectors/TPC/baserecsim/include/TPCBaseRecSim/CDBInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
#include "CCDB/CcdbApi.h"
2626
#include "TPCBase/CalDet.h"
2727
#include "TPCBase/FEEConfig.h"
28-
#include "TPCBase/CDBTypes.h"
29-
#include "TPCBase/DeadChannelMapCreator.h"
28+
#include "TPCBaseRecSim/CDBTypes.h"
29+
#include "TPCBaseRecSim/DeadChannelMapCreator.h"
3030
#include "DataFormatsTPC/LtrCalibData.h"
3131
#include "DataFormatsTPC/Defs.h"
3232
#include "CommonUtils/NameConf.h"
File renamed without changes.

Detectors/TPC/base/include/TPCBase/DeadChannelMapCreator.h renamed to Detectors/TPC/baserecsim/include/TPCBaseRecSim/DeadChannelMapCreator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
#include "CCDB/CcdbApi.h"
2323

24-
#include "DataFormatsTPC/Defs.h"
25-
#include "TPCBase/CDBTypes.h"
24+
#include "TPCBaseRecSim/PadFlags.h"
25+
#include "TPCBaseRecSim/CDBTypes.h"
2626
#include "TPCBase/CalDet.h"
2727
#include "TPCBase/FEEConfig.h"
2828

0 commit comments

Comments
 (0)