From 226104837b238456ffde4db0434a6f7836332f88 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 13 Jun 2024 14:21:32 +0200 Subject: [PATCH] Move labels int label namespace and deprecated old versions --- include/edm4hep/Constants.h | 39 ++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/include/edm4hep/Constants.h b/include/edm4hep/Constants.h index 48020809c..636015197 100644 --- a/include/edm4hep/Constants.h +++ b/include/edm4hep/Constants.h @@ -21,12 +21,33 @@ #include +#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 @@ -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