Skip to content

Commit

Permalink
Move labels int label namespace and deprecated old versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jun 13, 2024
1 parent cd24d43 commit 2261048
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions include/edm4hep/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,33 @@

#include <cstdint>

#define DEPRECATED_LABEL(name, newname) \
static constexpr const auto name [[deprecated("Use 'edm4hep::labels::" #newname "' instead")]] = labels::newname

namespace edm4hep {
static constexpr const char* CellIDEncoding = "CellIDEncoding";
static constexpr const char* EventHeaderName = "EventHeader";
static constexpr const char* EventWeights = "EventWeightNames";
static constexpr const char* shapeParameterNames = "shapeParameterNames";
static constexpr const char* EventFilterStats = "EventFilterStats";
namespace labels {
static constexpr const char* CellIDEncoding = "CellIDEncoding";
static constexpr const char* EventHeader = "EventHeader";
static constexpr const char* EventWeights = "EventWeightNames";
static constexpr const char* ShapeParameterNames = "shapeParameterNames";
static constexpr const char* EventFilterStats = "EventFilterStats";

/// The collection parameter name for accessing the names of the parameters for
/// a ParticleID collection
static constexpr const char* PIDParameterNames = "ParameterNames";
static constexpr const char* PIDAlgoName = "AlgoName";
static constexpr const char* PIDAlgoType = "AlgoType";
} // namespace labels

DEPRECATED_LABEL(CellIDEncoding, CellIDEncoding);
DEPRECATED_LABEL(EventHeaderName, EventHeader);
DEPRECATED_LABEL(EventWeights, EventWeights);
DEPRECATED_LABEL(shapeParameterNames, ShapeParameterNames);
DEPRECATED_LABEL(EventFilterStats, EventFilterStats);

DEPRECATED_LABEL(pidParameterNames, PIDParameterNames);
DEPRECATED_LABEL(pidAlgoName, PIDAlgoName);
DEPRECATED_LABEL(pidAlgoType, PIDAlgoType);

// Use 16 bits to encode the dimension
// Could go to 8 bits, but would need a fix in podio first
Expand All @@ -45,12 +66,8 @@ enum class TrackParams : DimType { d0 = 0, phi, omega, z0, tanLambda, time };
/// Enum for accessing the covariance matrix in the TrackerPulse
enum class TrackerPulseDims : DimType { charge = 0, time };

/// The collection parameter name for accessing the names of the parameters for
/// a ParticleID collection
static constexpr const char* pidParameterNames = "ParameterNames";
static constexpr const char* pidAlgoName = "AlgoName";
static constexpr const char* pidAlgoType = "AlgoType";

} // namespace edm4hep

#undef DEPRECATED_LABEL

#endif // EDM4HEP_CONSTANTS_H

0 comments on commit 2261048

Please sign in to comment.