|
|
|||
File indexing completed on 2026-09-02 08:37:58
0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT 0002 0003 #ifndef ActsPodioEdmDATAMODEL_DEFINITION_H 0004 #define ActsPodioEdmDATAMODEL_DEFINITION_H 0005 0006 #include "podio/DatamodelRegistry.h" 0007 #include "podio/SchemaEvolution.h" 0008 0009 namespace ActsPodioEdm::meta { 0010 /** 0011 * The complete definition of the datamodel at generation time in JSON format. 0012 */ 0013 static constexpr auto ActsPodioEdm__JSONDefinition = 0014 R"DATAMODELDEF({"options": {"getSyntax": true, "exposePODMembers": false, "includeSubfolder": "ActsPodioEdm/"}, "schema_version": 1, "components": {"ActsPodioEdm::Surface": {"Members": ["int surfaceType", "int boundsType", "std::uint64_t geometryId", "std::uint64_t identifier", "std::array<double, 10> boundValues", "std::uint32_t boundValuesSize", "std::array<double, 16> transform"]}, "ActsPodioEdm::TrackInfo": {"Members": ["std::array<double, 6> parameters", "std::array<double, 36> covariance // local covariance", "std::uint32_t tipIndex // index of the outermost track state", "std::uint32_t stemIndex // index of the innermost track state", "unsigned int nMeasurements // number of measurements", "unsigned int nHoles // number of holes", "float chi2 // chi squared of the track", "unsigned int ndf // number of degrees of freedom", "unsigned int nOutliers // number of outliers", "unsigned int nSharedHits // number of shared hits"]}, "ActsPodioEdm::TrackStateInfo": {"Members": ["std::uint32_t previous", "std::uint32_t next", "std::uint32_t ipredicted", "std::uint32_t ifiltered", "std::uint32_t ismoothed", "std::array<double, 6> measurement", "std::array<double, 36> measurementCovariance", "std::uint32_t measdim", "std::uint32_t ijacobian", "std::uint64_t projector", "bool hasProjector", "float chi2", "double pathLength", "std::uint64_t typeFlags", "std::uint64_t uncalibratedIdentifier"]}, "ActsPodioEdm::BoundParametersInfo": {"Members": ["std::array<double, 6> values", "std::array<double, 36> covariance"]}, "ActsPodioEdm::JacobianInfo": {"Members": ["std::array<double, 36> values"]}, "ActsPodioEdm::ParticleHypothesis": {"Members": ["std::uint32_t absPdg", "float mass", "float absQ"]}}, "datatypes": {"ActsPodioEdm::Track": {"Description": "Reconstructed track", "Author": "Paul Gessinger, CERN", "Members": ["ActsPodioEdm::TrackInfo data // local parameters and covariance", "ActsPodioEdm::Surface referenceSurface // reference surface", "ActsPodioEdm::ParticleHypothesis particleHypothesis // particle hypothesis"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "ActsPodioEdm::TrackState": {"Description": "Local state on a track", "Author": "Paul Gessinger, CERN", "Members": ["ActsPodioEdm::TrackStateInfo data // local information", "ActsPodioEdm::Surface referenceSurface // reference surface"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "ActsPodioEdm::BoundParameters": {"Description": "Local track parameters", "Author": "Paul Gessinger, CERN", "Members": ["ActsPodioEdm::BoundParametersInfo data // parameter information"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "ActsPodioEdm::Jacobian": {"Description": "Jacobian matrix from the previous track state to the current one", "Author": "Paul Gessinger, CERN", "Members": ["ActsPodioEdm::JacobianInfo data // the jacobian data"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "ActsPodioEdm::Measurement": {"Description": "Local representation of a measurement", "Author": "Paul Gessinger, CERN", "Members": ["std::uint64_t geometryId // the associated surface identifier"], "VectorMembers": ["std::uint16_t indices // the local indices", "double parameterValues // the measurement parameter value", "double covarianceValues // the measurement covairance value"], "OneToOneRelations": ["edm4hep::SimTrackerHit simHit // the associated simulated hit"], "ExtraCode": {"declaration": "std::size_t size() const {\n return indices_size();\n}\n"}, "OneToManyRelations": [], "MutableExtraCode": {}}, "ActsPodioEdm::TrackerHitLocal": {"Description": "Sensor-local tracker hit", "Author": "Paul Gessinger, CERN", "Members": ["std::uint64_t cellID // ID of the sensor that created this hit", "std::int32_t type // type of raw data hit, use depends on writer", "float time[ns] // time of the hit (depends on measurement type)", "edm4hep::Vector3d position[mm] // global hit position (depends on measurement type)"], "VectorMembers": ["float measurement // Entries in the measurement value vector", "float covariance // Entries in the measurement covariance vector. Order is column major"], "ExtraCode": {"includes": "#include <ActsPodioEdm/detail/SubspaceIndexHelpers.hpp>", "declaration": "/// Number of active subspace dimensions\n/// @return The number of active subspace dimensions\nstd::size_t getSize() const {\n return getSubspaceIndices().size();\n}\n\n\n/// Get the value for the passed subspace index\n/// @param valueIndex The index of the value\n/// @return The value\nfloat getValue(std::size_t valueIndex) const {\n const auto dim = getSize();\n auto values = getMeasurement();\n if (values.size() != dim) {\n throw std::runtime_error(\"Measurement vector size mismatch\");\n }\n\n if (valueIndex >= dim) {\n throw std::runtime_error(\"Measurement index out of range\");\n }\n return values[valueIndex];\n}\n\n/// Get covariance value for the two passed matrix indices\n/// @param indexI The first index\n/// @param indexJ The second index\n/// @return The covariance value\nfloat getCov(std::size_t indexI, std::size_t indexJ) const {\n auto cov = getCovariance();\n const auto dim = getSize();\n if (indexI >= dim || indexJ >= dim) {\n throw std::runtime_error(\"Covariance index out of range\");\n }\n if (cov.size() != dim * dim) {\n throw std::runtime_error(\"Covariance matrix size mismatch\");\n }\n const auto offset = indexJ * dim + indexI;\n return cov[offset];\n}\n\n/// Decode and return the subspace indices stored in the type field\n/// @return The subspace indices\nstd::vector<std::uint8_t> getSubspaceIndices() const {\n return ActsPodioEdm::detail::decodeIndices(getType());\n}\n\n/// Find the measurement-vector index for an enum-coded subspace coordinate\n///\n/// @tparam E Enum type whose underlying value encodes a subspace index\n/// @param enumVal The enum value to look up\n/// @return The position in the measurement/covariance vector\n/// @throws std::runtime_error if enumVal is not in the active subspace\ntemplate <typename E> requires std::is_enum_v<E>\nstd::size_t findSubspaceIndex(E enumVal) const {\n const auto indices = getSubspaceIndices();\n return ActsPodioEdm::detail::findSubspaceIndex(\n std::span<const std::uint8_t>{indices}, enumVal);\n}\n\n/// Get measurement value for an enum-coded subspace coordinate\n///\n/// Equivalent to getValue(findSubspaceIndex(enumVal)).\n///\n/// @tparam E Enum type whose underlying value encodes a subspace index\n/// @param enumVal The enum value identifying the coordinate\n/// @return The measurement value\ntemplate <typename E> requires std::is_enum_v<E>\nfloat getValue(E enumVal) const {\n return getValue(findSubspaceIndex(enumVal));\n}\n\n/// Get covariance value for two enum-coded subspace coordinates\n///\n/// Equivalent to getCov(findSubspaceIndex(enumI), findSubspaceIndex(enumJ)).\n///\n/// @tparam E Enum type whose underlying value encodes a subspace index\n/// @param enumI The first coordinate's enum value\n/// @param enumJ The second coordinate's enum value\n/// @return The covariance value at (enumI, enumJ)\ntemplate <typename E> requires std::is_enum_v<E>\nfloat getCov(E enumI, E enumJ) const {\n return getCov(findSubspaceIndex(enumI), findSubspaceIndex(enumJ));\n}\n\n// --- edm4hep::TrackerHit interface stubs (not implemented) ---\n\n/// @throws std::logic_error always \u2014 quality is not used in TrackerHitLocal\nstd::int32_t getQuality() const {\n throw std::logic_error(\"getQuality() is not implemented in TrackerHitLocal\");\n}\n\n/// @throws std::logic_error always \u2014 eDep is not used in TrackerHitLocal\nfloat getEDep() const {\n throw std::logic_error(\"getEDep() is not implemented in TrackerHitLocal\");\n}\n\n/// @throws std::logic_error always \u2014 eDepError is not used in TrackerHitLocal\nfloat getEDepError() const {\n throw std::logic_error(\"getEDepError() is not implemented in TrackerHitLocal\");\n}\n"}, "MutableExtraCode": {"includes": "#include <ActsPodioEdm/detail/SubspaceIndexHelpers.hpp>", "declaration": "/// Set the value for the passed measurement-vector index\n/// @param val The value to set\n/// @param valueIndex The index of the value\nvoid setValue(float val, std::size_t valueIndex) {\n const auto dim = getSize();\n if (m_obj->m_measurement->size() != dim) {\n throw std::runtime_error(\"Measurement vector not initialized - call setSubspaceIndices first\");\n }\n if (valueIndex >= dim) {\n throw std::runtime_error(\"Measurement index out of range\");\n }\n (*m_obj->m_measurement)[valueIndex] = val;\n}\n\n/// Set the covariance value for the two passed matrix indices\n/// @param val The value to set\n/// @param indexI The first index\n/// @param indexJ The second index\nvoid setCov(float val, std::size_t indexI, std::size_t indexJ) {\n const auto dim = getSize();\n if (m_obj->m_covariance->size() != dim * dim) {\n throw std::runtime_error(\"Covariance vector not initialized - call setSubspaceIndices first\");\n }\n if (indexI >= dim || indexJ >= dim) {\n throw std::runtime_error(\"Covariance index out of range\");\n }\n const auto offset = indexJ * dim + indexI;\n (*m_obj->m_covariance)[offset] = val;\n}\n\n/// Encode and store subspace indices into the type field\n/// @param indices The subspace indices\n/// @note This will initialize the measurement and covariance vectors if they are not already initialized\nvoid setSubspaceIndices(std::span<const std::uint8_t> indices) {\n setType(ActsPodioEdm::detail::encodeIndices(indices));\n m_obj->m_measurement->assign(indices.size(), 0.f);\n m_obj->m_covariance->assign(indices.size() * indices.size(), 0.f);\n m_obj->data.measurement_begin = 0u;\n m_obj->data.measurement_end = indices.size();\n m_obj->data.covariance_begin = 0u;\n m_obj->data.covariance_end = indices.size() * indices.size();\n}\n\n/// Set measurement value for an enum-coded subspace coordinate\n///\n/// Equivalent to setValue(val, findSubspaceIndex(enumVal)).\n///\n/// @tparam E Enum type whose underlying value encodes a subspace index\n/// @param val The value to set\n/// @param enumVal The enum value identifying the coordinate\ntemplate <typename E> requires std::is_enum_v<E>\nvoid setValue(float val, E enumVal) {\n setValue(val, findSubspaceIndex(enumVal));\n}\n\n/// Set covariance value for two enum-coded subspace coordinates\n///\n/// Equivalent to setCov(val, findSubspaceIndex(enumI), findSubspaceIndex(enumJ)).\n///\n/// @tparam E Enum type whose underlying value encodes a subspace index\n/// @param val The value to set\n/// @param enumI The first coordinate's enum value\n/// @param enumJ The second coordinate's enum value\ntemplate <typename E> requires std::is_enum_v<E>\nvoid setCov(float val, E enumI, E enumJ) {\n setCov(val, findSubspaceIndex(enumI), findSubspaceIndex(enumJ));\n}\n"}, "OneToOneRelations": [], "OneToManyRelations": []}}, "interfaces": {}, "links": {"ActsPodioEdm::TrackStateHitLink": {"Description": "A link between a TrackState and a TrackerHit", "Author": "Paul Gessinger, CERN", "From": "ActsPodioEdm::TrackState", "To": "ActsPodioEdm::TrackerHitLocal"}, "ActsPodioEdm::TrackerHitLocalSimTrackerHitLink": {"Description": "Link between ActsPodioEdm::TrackerHitLocal and edm4hep::SimTrackerHit. Interim replacement for edm4hep::TrackerHitSimTrackerHitLink until TrackerHitLocal is upstreamed to edm4hep.", "Author": "Paul Gessinger, CERN", "From": "ActsPodioEdm::TrackerHitLocal", "To": "edm4hep::SimTrackerHit"}}})DATAMODELDEF"; 0015 0016 /** 0017 * The names of all relations and vector members for all datatypes 0018 */ 0019 inline podio::RelationNameMapping ActsPodioEdm__getRelationNames() { 0020 using namespace std::string_view_literals; 0021 return { 0022 { 0023 "ActsPodioEdm::Track"sv, 0024 {}, 0025 {}, 0026 }, 0027 { 0028 "ActsPodioEdm::TrackState"sv, 0029 {}, 0030 {}, 0031 }, 0032 { 0033 "ActsPodioEdm::BoundParameters"sv, 0034 {}, 0035 {}, 0036 }, 0037 { 0038 "ActsPodioEdm::Jacobian"sv, 0039 {}, 0040 {}, 0041 }, 0042 { 0043 "ActsPodioEdm::Measurement"sv, 0044 {"simHit"sv}, 0045 {"indices"sv, "parameterValues"sv, "covarianceValues"sv}, 0046 }, 0047 { 0048 "ActsPodioEdm::TrackerHitLocal"sv, 0049 {}, 0050 {"measurement"sv, "covariance"sv}, 0051 }, 0052 }; 0053 } 0054 0055 /** 0056 * The schema version at generation time 0057 */ 0058 static constexpr podio::SchemaVersionT schemaVersion = 1; 0059 0060 /** 0061 * The helper class that takes care of registering the datamodel definition to 0062 * the DatamodelRegistry and to provide the index in that registry. 0063 * 0064 * Implemented as a singleton mainly to ensure only a single registration of 0065 * each datamodel, during the constructor 0066 */ 0067 class DatamodelRegistryIndex { 0068 public: 0069 static size_t value() { 0070 static const auto relationNames = ActsPodioEdm__getRelationNames(); 0071 static auto index = DatamodelRegistryIndex( 0072 podio::DatamodelRegistry::mutInstance().registerDatamodel( 0073 "ActsPodioEdm", ActsPodioEdm__JSONDefinition, relationNames)); 0074 return index.m_value; 0075 } 0076 0077 private: 0078 DatamodelRegistryIndex(size_t v) : m_value(v) {} 0079 size_t m_value{podio::DatamodelRegistry::NoDefinitionAvailable}; 0080 }; 0081 0082 namespace static_registration { 0083 // The usual trick via an IIFE and a const variable that we assign to, to 0084 // ensure that we populate this before everything starts 0085 inline bool ensureRegistration() { 0086 const static auto reg = []() { 0087 return ActsPodioEdm::meta::DatamodelRegistryIndex::value() != 0088 podio::DatamodelRegistry::NoDefinitionAvailable; 0089 }(); 0090 return reg; 0091 } 0092 0093 const auto registrationEnsured = ensureRegistration(); 0094 } // namespace static_registration 0095 0096 } // namespace ActsPodioEdm::meta 0097 0098 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|