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