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