EICd
EIC data model
EventInfo.h
Go to the documentation of this file.
1 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2 
3 #ifndef EICD_EventInfo_H
4 #define EICD_EventInfo_H
5 
6 #include "eicd/EventInfoConst.h"
7 #include "eicd/EventInfoObj.h"
8 
9 #include "eicd/Weight.h"
10 #include "podio/ObjectID.h"
11 #include <ostream>
12 
13 
14 
15 namespace eic {
16 
17 
18 /** @class EventInfo
19  * Event Info
20  * @author: W. Armstrong, S. Joosten
21  */
22 class EventInfo {
23 
24  friend class EventInfoCollection;
26  friend class ConstEventInfo;
27 
28 public:
29 
30  /// default constructor
31  EventInfo();
32  EventInfo(std::uint64_t run, std::uint64_t number, std::int32_t type, std::int32_t proc, std::int32_t source, eic::Weight weight);
33 
34  /// constructor from existing EventInfoObj
35  EventInfo(EventInfoObj* obj);
36 
37  /// copy constructor
38  EventInfo(const EventInfo& other);
39 
40  /// copy-assignment operator
41  EventInfo& operator=(const EventInfo& other);
42 
43  /// support cloning (deep-copy)
44  EventInfo clone() const;
45 
46  /// destructor
47  ~EventInfo();
48 
49  /// conversion to const object
50  operator ConstEventInfo() const;
51 
52 public:
53 
54  /// Access the Run number.
55  const std::uint64_t& run() const;
56 
57  /// Access the Event number.
58  const std::uint64_t& number() const;
59 
60  /// Access the event type identifier (TBD).
61  const std::int32_t& type() const;
62 
63  /// Access the Process identifier (TBD).
64  const std::int32_t& proc() const;
65 
66  /// Access the Source/identifier (TBD)
67  const std::int32_t& source() const;
68 
69  /// Access the Optional event weight (useful for MC)
70  const eic::Weight& weight() const;
71 
72 
73 
74  /// Set the Run number.
75  void run(std::uint64_t value);
76 
77  /// Set the Event number.
78  void number(std::uint64_t value);
79 
80  /// Set the event type identifier (TBD).
81  void type(std::int32_t value);
82 
83  /// Set the Process identifier (TBD).
84  void proc(std::int32_t value);
85 
86  /// Set the Source/identifier (TBD)
87  void source(std::int32_t value);
88 
89  /// Set the Optional event weight (useful for MC)
90  void weight(eic::Weight value);
91  /// Get reference to Optional event weight (useful for MC)
93 
94 
95 
96 
97 
98 
99  /// check whether the object is actually available
100  bool isAvailable() const;
101  /// disconnect from EventInfoObj instance
102  void unlink() { m_obj = nullptr; }
103 
104  bool operator==(const EventInfo& other) const { return m_obj == other.m_obj; }
105  bool operator==(const ConstEventInfo& other) const;
106 
107  // less comparison operator, so that objects can be e.g. stored in sets.
108  bool operator<(const EventInfo& other) const { return m_obj < other.m_obj; }
109 
110  unsigned int id() const { return getObjectID().collectionID * 10000000 + getObjectID().index; }
111 
112  const podio::ObjectID getObjectID() const;
113 
114 private:
115  EventInfoObj* m_obj;
116 };
117 
118 std::ostream& operator<<(std::ostream& o, const ConstEventInfo& value);
119 
120 } // namespace eic
121 
122 
123 #endif
eic::operator<<
std::ostream & operator<<(std::ostream &o, const ConstBasicParticle &value)
Definition: BasicParticle.cc:102
EventInfoConst.h
eic::EventInfo::operator==
bool operator==(const EventInfo &other) const
Definition: EventInfo.h:104
EventInfoObj.h
eic::EventInfo::isAvailable
bool isAvailable() const
check whether the object is actually available
Definition: EventInfo.cc:75
eic::EventInfo::run
const std::uint64_t & run() const
Access the Run number.
Definition: EventInfo.cc:53
eic
Definition: BasicParticle.cc:13
eic::EventInfo::operator=
EventInfo & operator=(const EventInfo &other)
copy-assignment operator
Definition: EventInfo.cc:34
eic::EventInfo
Definition: EventInfo.h:22
eic::ConstEventInfo
Definition: EventInfoConst.h:20
eic::EventInfo::getObjectID
const podio::ObjectID getObjectID() const
Definition: EventInfo.cc:82
eic::EventInfo::operator<
bool operator<(const EventInfo &other) const
Definition: EventInfo.h:108
eic::Weight
Definition: Weight.h:11
eic::EventInfo::id
unsigned int id() const
Definition: EventInfo.h:110
eic::EventInfo::ConstEventInfo
friend class ConstEventInfo
Definition: EventInfo.h:26
eic::EventInfo::~EventInfo
~EventInfo()
destructor
Definition: EventInfo.cc:48
Weight.h
eic::EventInfo::unlink
void unlink()
disconnect from EventInfoObj instance
Definition: EventInfo.h:102
eic::EventInfo::EventInfo
EventInfo()
default constructor
Definition: EventInfo.cc:16
eic::EventInfoObj
Definition: EventInfoObj.h:18
eic::EventInfo::type
const std::int32_t & type() const
Access the event type identifier (TBD).
Definition: EventInfo.cc:55
eic::EventInfo::number
const std::uint64_t & number() const
Access the Event number.
Definition: EventInfo.cc:54
eic::EventInfo::weight
const eic::Weight & weight() const
Access the Optional event weight (useful for MC)
Definition: EventInfo.cc:58
eic::EventInfo::proc
const std::int32_t & proc() const
Access the Process identifier (TBD).
Definition: EventInfo.cc:56
eic::EventInfo::clone
EventInfo clone() const
support cloning (deep-copy)
Definition: EventInfo.cc:44
eic::EventInfoCollectionIterator
Definition: EventInfoCollection.h:29
eic::EventInfo::source
const std::int32_t & source() const
Access the Source/identifier (TBD)
Definition: EventInfo.cc:57
eic::EventInfoCollection
Definition: EventInfoCollection.h:76