Skip to content

Commit fb16d23

Browse files
committed
Enable shared memory hits for EMCAL
1 parent 9d593ec commit fb16d23

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

Detectors/EMCAL/base/include/EMCALBase/Hit.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define ALICEO2_EMCAL_HIT_H
1313

1414
#include "SimulationDataFormat/BaseHits.h"
15+
#include "CommonUtils/ShmAllocator.h"
1516

1617
namespace o2
1718
{
@@ -111,4 +112,14 @@ std::ostream& operator<<(std::ostream& stream, const Hit& point);
111112
}
112113
}
113114

115+
#ifdef USESHM
116+
namespace std
117+
{
118+
template <>
119+
class allocator<o2::EMCAL::Hit> : public o2::utils::ShmAllocator<o2::EMCAL::Hit>
120+
{
121+
};
122+
} // namespace std
123+
#endif
124+
114125
#endif /* Point_h */

Detectors/EMCAL/simulation/include/EMCALSimulation/Detector.h

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,11 @@
1616
#include "MathUtils/Cartesian3D.h"
1717
#include "RStringView.h"
1818
#include "Rtypes.h"
19-
#include "CommonUtils/ShmAllocator.h"
20-
2119
#include <vector>
2220

2321
class FairVolume;
2422
class TClonesArray;
2523

26-
#ifdef USESHM
27-
namespace std
28-
{
29-
template <>
30-
class allocator<o2::EMCAL::Hit> : public o2::utils::ShmAllocator<o2::EMCAL::Hit>
31-
{
32-
};
33-
} // namespace std
34-
#endif
35-
3624
namespace o2
3725
{
3826
namespace EMCAL
@@ -206,4 +194,18 @@ class Detector : public o2::Base::DetImpl<Detector>
206194
};
207195
}
208196
}
197+
198+
#ifdef USESHM
199+
namespace o2
200+
{
201+
namespace Base
202+
{
203+
template <>
204+
struct UseShm<o2::EMCAL::Detector> {
205+
static constexpr bool value = true;
206+
};
207+
} // namespace Base
208+
} // namespace o2
209+
#endif
210+
209211
#endif

cmake/O2Dependencies.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ o2_define_bucket(
14021402
${CMAKE_SOURCE_DIR}/DataFormats/simulation/include
14031403
${CMAKE_SOURCE_DIR}/DataFormats/common/include
14041404
${CMAKE_SOURCE_DIR}/Common/MathUtils/include
1405+
${CMAKE_SOURCE_DIR}/Common/Utils/include
14051406
)
14061407

14071408
o2_define_bucket(

0 commit comments

Comments
 (0)