Skip to content

Commit 6972191

Browse files
committed
TPC: move PadFlags and related classes to TPCCore
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 93ff0dc commit 6972191

File tree

73 files changed

+190
-125
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

+190
-125
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(core)
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 "TPCCore/CDBInterface.h"
2525
#include "TPCBase/CalArray.h"
2626
#include "TPCBase/CalDet.h"
2727
#include "TPCBase/Mapper.h"

Detectors/TPC/calibration/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ o2_add_library(TPCCalibration
5858
src/DigitAdd.cxx
5959
src/CorrectdEdxDistortions.cxx
6060
src/PressureTemperatureHelper.cxx
61-
PUBLIC_LINK_LIBRARIES O2::DataFormatsTPC O2::TPCBase
61+
PUBLIC_LINK_LIBRARIES O2::DataFormatsTPC O2::TPCCore
6262
O2::TPCReconstruction ROOT::Minuit
6363
Microsoft.GSL::GSL
6464
O2::DetectorsCalibration
@@ -118,16 +118,16 @@ o2_target_root_dictionary(TPCCalibration
118118
include/TPCCalibration/PressureTemperatureHelper.h)
119119

120120
o2_add_test_root_macro(macro/comparePedestalsAndNoise.C
121-
PUBLIC_LINK_LIBRARIES O2::TPCBase
121+
PUBLIC_LINK_LIBRARIES O2::TPCCore
122122
LABELS tpc)
123123
o2_add_test_root_macro(macro/drawNoiseAndPedestal.C
124-
PUBLIC_LINK_LIBRARIES O2::TPCBase
124+
PUBLIC_LINK_LIBRARIES O2::TPCCore
125125
LABELS tpc)
126126
o2_add_test_root_macro(macro/drawPulser.C
127-
PUBLIC_LINK_LIBRARIES O2::TPCBase
127+
PUBLIC_LINK_LIBRARIES O2::TPCCore
128128
LABELS tpc)
129129
o2_add_test_root_macro(macro/mergeNoiseAndPedestal.C
130-
PUBLIC_LINK_LIBRARIES O2::TPCBase
130+
PUBLIC_LINK_LIBRARIES O2::TPCCore
131131
LABELS tpc)
132132
o2_add_test_root_macro(macro/runPedestal.C
133133
PUBLIC_LINK_LIBRARIES O2::TPCCalibration

Detectors/TPC/calibration/include/TPCCalibration/IDCCCDBHelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#define ALICEO2_TPC_IDCCCDBHELPER_H_
1818
#include <Framework/Logger.h>
1919
#include "DataFormatsTPC/Defs.h"
20+
#include "TPCCore/PadFlags.h"
2021
#include "TPCBase/Sector.h"
2122
#include "Rtypes.h"
2223

Detectors/TPC/calibration/include/TPCCalibration/IDCFactorization.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "TPCCalibration/IDCContainer.h"
2525
#include "TPCCalibration/IDCGroupHelperSector.h"
2626
#include "DataFormatsTPC/Defs.h"
27+
#include "TPCCore/PadFlags.h"
2728
#include <boost/property_tree/ptree.hpp>
2829

2930
namespace o2::tpc

Detectors/TPC/calibration/macro/comparePedestalsAndNoise.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#if !defined(__CLING__) || defined(__ROOTCLING__)
1313
#include "TROOT.h"
1414
#include "TFile.h"
15-
#include "TPCBase/CalDet.h"
15+
#include "TPCCore/CalDet.h"
1616
#include "TH1F.h"
1717
#include "TH2F.h"
1818
#include "TCanvas.h"
19-
#include "TPCBase/Painter.h"
19+
#include "TPCCore/Painter.h"
2020
#endif
2121

2222
std::tuple<TH1*, TH1*, TH1*, TH1*> getNoiseAndPedestalHistogram(const TString pedestalFile, int roc)

0 commit comments

Comments
 (0)