Skip to content

Commit fa49c26

Browse files
authored
[Common] Enclose Metadata and CollisionType Helper in o2 namespace (#11657)
1 parent cad9bd9 commit fa49c26

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

Common/Core/CollisionTypeHelper.cxx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
///
1717

1818
#include "Common/Core/CollisionTypeHelper.h"
19+
20+
#include "DataFormatsParameters/GRPLHCIFData.h"
21+
1922
#include <fairlogger/Logger.h>
23+
2024
#include <string>
21-
#include "DataFormatsParameters/GRPLHCIFData.h"
2225

23-
std::string CollisionSystemType::getCollisionSystemName(collType collSys)
26+
std::string o2::common::core::CollisionSystemType::getCollisionSystemName(collType collSys)
2427
{
2528
switch (collSys) {
2629
case kCollSyspp:
@@ -36,7 +39,7 @@ std::string CollisionSystemType::getCollisionSystemName(collType collSys)
3639
}
3740
}
3841

39-
int CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif)
42+
int o2::common::core::CollisionSystemType::getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif)
4043
{
4144
const int ZBeamA = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamA);
4245
const int ZBeamC = grplhcif->getBeamZ(o2::constants::lhc::BeamDirection::BeamC);

Common/Core/CollisionTypeHelper.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
#ifndef COMMON_CORE_COLLISIONTYPEHELPER_H_
1919
#define COMMON_CORE_COLLISIONTYPEHELPER_H_
2020

21-
#include <string>
2221
#include "DataFormatsParameters/GRPLHCIFData.h"
2322

23+
#include <string>
24+
25+
namespace o2::common::core
26+
{
2427
// Container for the collision system type
2528
struct CollisionSystemType {
2629
// Enum type for the collision system
@@ -38,4 +41,8 @@ struct CollisionSystemType {
3841
static int getCollisionTypeFromGrp(o2::parameters::GRPLHCIFData* grplhcif);
3942
};
4043

44+
} // namespace o2::common::core
45+
46+
using CollisionSystemType = o2::common::core::CollisionSystemType;
47+
4148
#endif // COMMON_CORE_COLLISIONTYPEHELPER_H_

Common/Core/MetadataHelper.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "Framework/InitContext.h"
2121
#include "Framework/RunningWorkflowInfo.h"
2222

23+
using namespace o2::common::core;
24+
2325
MetadataHelper::MetadataHelper()
2426
{
2527
const std::array<std::string, 8> keyList = {"DataType",

Common/Core/MetadataHelper.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
#ifndef COMMON_CORE_METADATAHELPER_H_
1919
#define COMMON_CORE_METADATAHELPER_H_
2020

21-
#include <string>
22-
#include <map>
2321
#include "Framework/ConfigContext.h"
2422

23+
#include <map>
24+
#include <string>
25+
26+
namespace o2::common::core
27+
{
28+
2529
struct MetadataHelper {
2630
/// @brief Constructor for the MetadataHelper. Defines the all the metadata keys that will be looked for and accessible
2731
MetadataHelper();
@@ -64,4 +68,8 @@ struct MetadataHelper {
6468
bool mIsInitialized = false; /// < Flag to check if the metadata has been initialized
6569
};
6670

71+
} // namespace o2::common::core
72+
73+
using MetadataHelper = o2::common::core::MetadataHelper; // Alias for the MetadataHelper
74+
6775
#endif // COMMON_CORE_METADATAHELPER_H_

0 commit comments

Comments
 (0)