Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-11 09:08:25

0001 /*
0002  * Copyright (c) 2014-2024 Key4hep-Project.
0003  *
0004  * This file is part of Key4hep.
0005  * See https://key4hep.github.io/key4hep-doc/ for further info.
0006  *
0007  * Licensed under the Apache License, Version 2.0 (the "License");
0008  * you may not use this file except in compliance with the License.
0009  * You may obtain a copy of the License at
0010  *
0011  *     http://www.apache.org/licenses/LICENSE-2.0
0012  *
0013  * Unless required by applicable law or agreed to in writing, software
0014  * distributed under the License is distributed on an "AS IS" BASIS,
0015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0016  * See the License for the specific language governing permissions and
0017  * limitations under the License.
0018  */
0019 #ifndef EDM4HEP_CONSTANTS_H
0020 #define EDM4HEP_CONSTANTS_H
0021 
0022 #include <cstdint>
0023 
0024 namespace edm4hep {
0025 /// @namespace edm4hep::labels
0026 /// @brief Namespace that contains commonly used collection, parameter or
0027 /// configuration names
0028 ///
0029 /// The constants defined in this namespace are agreed upon or conventional
0030 /// names for commonly used collection, parameter or configuration names.
0031 /// Whenever possible these should be used instead of the string constants they
0032 /// are defined as. For some of the parameters their proper usage is also
0033 /// detailed in the documentation of datatypes.
0034 ///
0035 /// ## Example Usage
0036 ///
0037 /// Labels can be used from both python and c++, e.g. via
0038 /// ~~~{.cpp}
0039 /// #include <edm4hep/Constants.h>
0040 ///
0041 /// const auto& mcParticles = event.get<edm4hep::MCParticleCollection>(edm4hep::lables::MCParticles);
0042 /// ~~~
0043 /// or
0044 /// ~~~{.py}
0045 /// import edm4hep
0046 ///
0047 /// algorithm.InputMCCollection = edm4hep.labels.MCParticles
0048 /// ~~~
0049 ///
0050 /// ## Adding new labels
0051 ///
0052 /// New labels can simply be added. They should codify an already existing
0053 /// convention or be used to introduce one in case it's necessary to do so.
0054 namespace labels {
0055   static constexpr const char* CellIDEncoding = "CellIDEncoding";
0056   static constexpr const char* EventHeader = "EventHeader";
0057   static constexpr const char* EventWeightsNames = "EventWeightNames";
0058   static constexpr const char* ShapeParameterNames = "shapeParameterNames";
0059   static constexpr const char* EventFilterStats = "EventFilterStats";
0060   /// The canonical name for the main MCParticle collection
0061   static constexpr const char* MCParticles = "MCParticles";
0062   /// The collection parameter name for accessing the names of the parameters for
0063   /// a ParticleID collection
0064   static constexpr const char* PIDParameterNames = "ParameterNames";
0065   static constexpr const char* PIDAlgoName = "AlgoName";
0066   static constexpr const char* PIDAlgoType = "AlgoType";
0067 
0068   // Parameter names for Generator level metadata
0069   static constexpr const char* GeneratorToolVersions = "GeneratorToolVersions";
0070   static constexpr const char* GeneratorToolNames = "GeneratorToolNames";
0071   static constexpr const char* GeneratorToolDescriptions = "GeneratorToolDescriptions";
0072   static constexpr const char* GeneratorEventParameters = "GeneratorEventParameters";
0073   static constexpr const char* GeneratorWeightNames = "GeneratorWeightNames";
0074 } // namespace labels
0075 
0076 // Use 16 bits to encode the dimension
0077 // Could go to 8 bits, but would need a fix in podio first
0078 using DimType = std::uint16_t;
0079 
0080 /// The enum for accessing cartesian coordinate values in covariance matrices
0081 enum class Cartesian : DimType { x = 0, y, z };
0082 
0083 /// The enum for accessing four momentum coordinate values in covariance
0084 /// matrices
0085 enum class FourMomCoords : DimType { x = 0, y, z, t };
0086 
0087 /// The enum for accessing track parameter values in covariance matrices
0088 enum class TrackParams : DimType { d0 = 0, phi, omega, z0, tanLambda, time };
0089 
0090 /// Enum for accessing the covariance matrix in the TrackerPulse
0091 enum class TrackerPulseDims : DimType { charge = 0, time };
0092 
0093 } // namespace edm4hep
0094 
0095 #endif // EDM4HEP_CONSTANTS_H