File indexing completed on 2025-07-01 08:41:10
0001
0002
0003 #ifndef PODIODATAMODEL_ExampleHit_H
0004 #define PODIODATAMODEL_ExampleHit_H
0005
0006 #include "PodioDatamodel/ExampleHitObj.h"
0007
0008 #include <cstdint>
0009
0010 #include "podio/utilities/MaybeSharedPtr.h"
0011 #include "podio/detail/OrderKey.h"
0012
0013 #include <ostream>
0014 #include <cstdint>
0015
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019
0020
0021 class ExampleHitCollection;
0022
0023
0024 namespace podio::detail {
0025
0026 OrderKey getOrderKey(const ::ExampleHit& obj);
0027 };
0028
0029
0030 class MutableExampleHit;
0031 class ExampleHitCollection;
0032 class ExampleHitCollectionData;
0033
0034
0035
0036
0037
0038 class ExampleHit {
0039
0040 friend class MutableExampleHit;
0041 friend class ExampleHitCollection;
0042 friend class ExampleHitCollectionData;
0043 friend class ExampleHitCollectionIterator;
0044 friend podio::detail::OrderKey podio::detail::getOrderKey(const ExampleHit & obj);
0045
0046 public:
0047 using mutable_type = MutableExampleHit;
0048 using collection_type = ExampleHitCollection;
0049
0050
0051 ExampleHit();
0052
0053
0054 ExampleHit(std::uint64_t cellID, double x, double y, double z, double energy, std::uint64_t time);
0055
0056
0057 ExampleHit(const ExampleHit& other) = default;
0058
0059
0060 ExampleHit& operator=(ExampleHit other);
0061
0062
0063
0064 MutableExampleHit clone(bool cloneRelations=true) const;
0065
0066
0067 ~ExampleHit() = default;
0068
0069
0070 ExampleHit(const MutableExampleHit& other);
0071
0072 static ExampleHit makeEmpty();
0073
0074 public:
0075
0076 static constexpr auto typeName = "ExampleHit";
0077
0078
0079 std::uint64_t cellID() const;
0080
0081
0082 double x() const;
0083
0084
0085 double y() const;
0086
0087
0088 double z() const;
0089
0090
0091 double energy() const;
0092
0093
0094 std::uint64_t time() const;
0095
0096
0097
0098
0099
0100
0101 bool isAvailable() const;
0102
0103 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ExampleHitObj>{nullptr}; }
0104
0105 bool operator==(const ExampleHit& other) const { return m_obj == other.m_obj; }
0106 bool operator==(const MutableExampleHit& other) const;
0107
0108 bool operator!=(const ExampleHit& other) const { return !(*this == other); }
0109 bool operator!=(const MutableExampleHit& other) const { return !(*this == other); }
0110
0111
0112 bool operator<(const ExampleHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0113
0114 podio::ObjectID id() const { return getObjectID(); }
0115
0116 const podio::ObjectID getObjectID() const;
0117
0118 friend void swap(ExampleHit& a, ExampleHit& b) {
0119 using std::swap;
0120 swap(a.m_obj, b.m_obj);
0121 }
0122
0123 private:
0124
0125 explicit ExampleHit(podio::utils::MaybeSharedPtr<ExampleHitObj> obj);
0126 ExampleHit(ExampleHitObj* obj);
0127
0128 podio::utils::MaybeSharedPtr<ExampleHitObj> m_obj{nullptr};
0129 };
0130
0131 std::ostream& operator<<(std::ostream& o, const ExampleHit& value);
0132
0133 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0134 void to_json(nlohmann::json& j, const ExampleHit& value);
0135 #endif
0136
0137
0138
0139
0140 #endif