Skip to content

Commit 9d593ec

Browse files
committed
Enable shared memory hits for HMPID
1 parent 63f56d2 commit 9d593ec

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

Detectors/HMPID/base/include/HMPIDBase/Hit.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,33 @@
1212
#define DETECTORS_HMPID_BASE_INCLUDE_HMPIDBASE_HIT_H_
1313

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

1617
namespace o2
1718
{
1819
namespace hmpid
1920
{
2021

2122
// define HMPID hit type
22-
using HitType = o2::BasicXYZEHit<float>;
23+
class HitType : public o2::BasicXYZEHit<float>
24+
{
25+
public:
26+
using Base = o2::BasicXYZEHit<float>;
27+
using Base::Base;
28+
ClassDef(HitType, 1);
29+
};
2330

2431
} // namespace hmpid
2532
} // namespace o2
2633

34+
#ifdef USESHM
35+
namespace std
36+
{
37+
template <>
38+
class allocator<o2::hmpid::HitType> : public o2::utils::ShmAllocator<o2::hmpid::HitType>
39+
{
40+
};
41+
} // namespace std
42+
#endif
43+
2744
#endif /* DETECTORS_HMPID_BASE_INCLUDE_HMPIDBASE_HIT_H_ */

Detectors/HMPID/base/src/HMPIDBaseLinkDef.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#pragma link C++ class o2::hmpid::Param + ;
1818
#pragma link C++ class o2::hmpid::Digit + ;
19-
#pragma link C++ class vector < o2::hmpid::Digit> + ;
19+
#pragma link C++ class vector<o2::hmpid::Digit>+;
20+
#pragma link C++ class o2::hmpid::HitType+;
21+
#pragma link C++ class vector<o2::hmpid::HitType>+;
2022

2123
#endif

Detectors/HMPID/simulation/include/HMPIDSimulation/Detector.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,18 @@ class Detector : public o2::Base::DetImpl<Detector>
8686
} // end namespace hmpid
8787
} // end namespace o2
8888

89+
// enable shared mem for HMPID
90+
#ifdef USESHM
91+
namespace o2
92+
{
93+
namespace Base
94+
{
95+
template <>
96+
struct UseShm<o2::hmpid::Detector> {
97+
static constexpr bool value = true;
98+
};
99+
} // namespace Base
100+
} // namespace o2
101+
#endif
102+
89103
#endif /* ALICEO2_HMPID_DETECTOR_H_ */

cmake/O2Dependencies.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,13 +1598,15 @@ o2_define_bucket(
15981598
Geom
15991599
SimulationDataFormat
16001600
CommonDataFormat
1601-
1601+
CommonUtils
1602+
16021603
INCLUDE_DIRECTORIES
16031604
${FAIRROOT_INCLUDE_DIR}
16041605
${CMAKE_SOURCE_DIR}/DataFormats/simulation/include
16051606
${CMAKE_SOURCE_DIR}/DataFormats/common/include
16061607
${CMAKE_SOURCE_DIR}/Common/MathUtils/include
16071608
${CMAKE_SOURCE_DIR}/Detectors/HMPID/base/include
1609+
${CMAKE_SOURCE_DIR}/Common/Utils/include
16081610
)
16091611

16101612
o2_define_bucket(

0 commit comments

Comments
 (0)