Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-11 10:20:46

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef jana2_tutorial_podio_datamodelDATAMODEL_DEFINITION_H
0004 #define jana2_tutorial_podio_datamodelDATAMODEL_DEFINITION_H
0005 
0006 #include "podio/DatamodelRegistry.h"
0007 #include "podio/SchemaEvolution.h"
0008 
0009 namespace jana2_tutorial_podio_datamodel::meta {
0010 /**
0011  * The complete definition of the datamodel at generation time in JSON format.
0012  */
0013 static constexpr auto jana2_tutorial_podio_datamodel__JSONDefinition = R"DATAMODELDEF({"options": {"getSyntax": true, "exposePODMembers": true, "includeSubfolder": "jana2_tutorial_podio_datamodel/"}, "schema_version": 1, "components": {}, "datatypes": {"EventHeader": {"Description": "Persistent IDs for each entry/frame/JEvent", "Author": "N. Brei", "Members": ["int run_number // run number", "int timeframe_number // timeframe number", "int event_number // event number"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "CalorimeterHit": {"Description": "A simple calorimeter hit", "Author": "N. Brei", "Members": ["std::uint64_t cell_id // Cell ID", "std::uint64_t row // Cell row (zero-indexed)", "std::uint64_t col // Cell column (zero-indexed)", "double x // x coordinate of cell center [cm]", "double y // y coordinate of cell center [cm]", "double z // z coordinate of cell center [cm]", "double energy // Measured energy deposit [GeV]", "std::uint64_t time // Time [ns]"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "CalorimeterCluster": {"Description": "A simple calorimeter cluster", "Author": "N. Brei", "Members": ["double x_center // x location of cluster center [cm]", "double y_center // y location of cluster center [cm]", "double z_center // z location of cluster center [cm]", "double energy // Total energy deposited [GeV]", "std::uint64_t time_begin // Timestamp of earliest hit [ns]", "std::uint64_t time_end // Timestamp of latest hit [ns]"], "OneToManyRelations": ["CalorimeterHit hits // hits that comprise this cluster", "CalorimeterCluster clusters // (proto) clusters that comprise this cluster"], "VectorMembers": [], "OneToOneRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "SimParticle": {"Description": "A 'truth' particle, used by a Monte Carlo simulation", "Author": "N. Brei", "Members": ["double momentum_z // Momentum in the z direction", "double momentum_theta // Momentum in the theta direction", "double momentum_phi // Momentum in the phi direction", "double energy // Total energy", "std::uint32_t pdg // PDG particle id"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}, "ADCHit": {"Description": "The raw hit read off the DAQ, or produced by digitization", "Author": "N. Brei", "Members": ["std::uint32_t crate // DAQ crate index", "std::uint32_t slot // DAQ slot index", "std::uint32_t channel // DAQ channel index", "std::uint32_t energy // Energy measured", "std::uint32_t timestamp // Timestamp [ns]"], "VectorMembers": [], "OneToOneRelations": [], "OneToManyRelations": [], "ExtraCode": {}, "MutableExtraCode": {}}}, "interfaces": {}, "links": {}})DATAMODELDEF";
0014 
0015 
0016 /**
0017  * The names of all relations and vector members for all datatypes
0018  */
0019 inline podio::RelationNameMapping jana2_tutorial_podio_datamodel__getRelationNames() {
0020   using namespace std::string_view_literals;
0021   return {
0022     {"EventHeader"sv,
0023       {  },
0024       {  },
0025     },
0026     {"CalorimeterHit"sv,
0027       {  },
0028       {  },
0029     },
0030     {"CalorimeterCluster"sv,
0031       { "hits"sv, "clusters"sv },
0032       {  },
0033     },
0034     {"SimParticle"sv,
0035       {  },
0036       {  },
0037     },
0038     {"ADCHit"sv,
0039       {  },
0040       {  },
0041     },
0042   };
0043 }
0044 
0045 /**
0046  * The schema version at generation time
0047  */
0048 static constexpr podio::SchemaVersionT schemaVersion = 1;
0049 
0050 /**
0051  * The helper class that takes care of registering the datamodel definition to
0052  * the DatamodelRegistry and to provide the index in that registry.
0053  *
0054  * Implemented as a singleton mainly to ensure only a single registration of
0055  * each datamodel, during the constructor
0056  */
0057 class DatamodelRegistryIndex {
0058 public:
0059   static size_t value() {
0060     static const auto relationNames = jana2_tutorial_podio_datamodel__getRelationNames();
0061     static auto index =
0062       DatamodelRegistryIndex(podio::DatamodelRegistry::mutInstance().registerDatamodel(
0063                                "jana2_tutorial_podio_datamodel",
0064                                jana2_tutorial_podio_datamodel__JSONDefinition,
0065                                relationNames
0066                              ));
0067     return index.m_value;
0068   }
0069 private:
0070   DatamodelRegistryIndex(size_t v) : m_value(v) {}
0071   size_t m_value{podio::DatamodelRegistry::NoDefinitionAvailable};
0072 };
0073 
0074 
0075 namespace static_registration {
0076   // The usual trick via an IIFE and a const variable that we assign to, to
0077   // ensure that we populate this before everything starts
0078   inline  bool ensureRegistration() {
0079     const static auto reg = []() {
0080       return jana2_tutorial_podio_datamodel::meta::DatamodelRegistryIndex::value() != podio::DatamodelRegistry::NoDefinitionAvailable;
0081     }();
0082     return reg;
0083   }
0084 
0085   const auto registrationEnsured = ensureRegistration();
0086 }
0087 
0088 } // namespace jana2_tutorial_podio_datamodel::meta
0089 
0090 #endif