EDM4eic
EIC data model
Loading...
Searching...
No Matches
TrackSeed.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_TrackSeed_H
4#define EDM4EIC_TrackSeed_H
5
7
9#include "edm4hep/Vector3f.h"
10#include "podio/RelationRange.h"
11#include <vector>
12
13#include "podio/utilities/MaybeSharedPtr.h"
14#include "podio/detail/OrderKey.h"
15
16#include <ostream>
17#include <cstdint>
18
19#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
20#include "nlohmann/json_fwd.hpp"
21#endif
22
23// forward declarations
24namespace edm4eic {
26class TrackParameters;
28}
29
30
31namespace podio::detail {
32// Internal function used in less comparison operators of the datatypes and interface types
33OrderKey getOrderKey(const edm4eic::TrackSeed& obj);
34};
35
36namespace edm4eic {
37
41
42/** @class TrackSeed
43 * Seed info from the realistic seed finder
44 * @author: S. Li, B. Schmookler, J. Osborn
45 */
46class TrackSeed {
47
48 friend class MutableTrackSeed;
49 friend class TrackSeedCollection;
52 friend podio::detail::OrderKey podio::detail::getOrderKey(const TrackSeed & obj);
53
54public:
57
58 /// default constructor
59 TrackSeed();
60
61 /// Constructor initializing all members
62 TrackSeed(const edm4hep::Vector3f& perigee);
63
64 /// copy constructor
65 TrackSeed(const TrackSeed& other) = default;
66
67 /// copy-assignment operator
68 TrackSeed& operator=(TrackSeed other) &; // Rebind this to other's internal object
69 TrackSeed& operator=(TrackSeed other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableTrackSeed clone(bool cloneRelations=true) const;
74
75 /// destructor
76 ~TrackSeed() = default;
77
78 /// converting constructor from mutable object
79 TrackSeed(const MutableTrackSeed& other);
80
81 static TrackSeed makeEmpty();
82
83public:
84
85 static constexpr std::string_view typeName = "edm4eic::TrackSeed";
86
87 /// Access the Vector for the perigee (line surface)
88 const edm4hep::Vector3f& getPerigee() const;
89
90
91 /// Access the Initial track parameters
93
94 std::size_t hits_size() const;
95 edm4eic::TrackerHit getHits(std::size_t) const;
96 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
97 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
98 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
99
100
101 /// check whether the object is actually available
102 bool isAvailable() const;
103 /// disconnect from TrackSeedObj instance
104 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
105
106 bool operator==(const TrackSeed& other) const { return m_obj == other.m_obj; }
107 bool operator==(const MutableTrackSeed& other) const;
108
109 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
110 bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
111
112 // less comparison operator, so that objects can be e.g. stored in sets.
113 bool operator<(const TrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
114
115 podio::ObjectID id() const { return getObjectID(); }
116
117 const podio::ObjectID getObjectID() const;
118
119 friend std::hash<TrackSeed>;
120
121 friend void swap(TrackSeed& a, TrackSeed& b) {
122 using std::swap;
123 swap(a.m_obj, b.m_obj); // swap out the internal pointers
124 }
125
126private:
127 /// constructor from existing TrackSeedObj
128 explicit TrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
130
131 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{nullptr};
132};
133
134std::ostream& operator<<(std::ostream& o, const TrackSeed& value);
135
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
137void to_json(nlohmann::json& j, const TrackSeed& value);
138#endif
139
140
141} // namespace edm4eic
142
143
144
145template<>
146struct std::hash<edm4eic::TrackSeed> {
147 std::size_t operator()(const edm4eic::TrackSeed& obj) const {
148 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
149 }
150};
151
152
153// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
154// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
155// and https://github.com/AIDASoft/podio/issues/770
156#if defined(__clang__)
157#pragma clang diagnostic push
158#pragma clang diagnostic ignored "-Wunknown-warning-option"
159#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
160#pragma clang diagnostic ignored "-Wdeprecated"
161constexpr std::string_view edm4eic::TrackSeed::typeName;
162#pragma clang diagnostic pop
163#elif defined(__GNUC__)
164#pragma GCC diagnostic push
165#pragma GCC diagnostic ignored "-Wdeprecated"
166constexpr std::string_view edm4eic::TrackSeed::typeName;
167#pragma GCC diagnostic pop
168#endif
169
170#endif
Definition MutableTrackParameters.h:35
Definition MutableTrackSeed.h:38
Definition TrackParameters.h:43
Definition TrackSeedCollectionData.h:32
Definition TrackSeedCollection.h:137
Definition TrackSeed.h:46
MutableTrackSeed mutable_type
Definition TrackSeed.h:55
bool operator!=(const MutableTrackSeed &other) const
Definition TrackSeed.h:110
friend void swap(TrackSeed &a, TrackSeed &b)
Definition TrackSeed.h:121
podio::ObjectID id() const
Definition TrackSeed.h:115
bool operator<(const TrackSeed &other) const
Definition TrackSeed.h:113
TrackSeed & operator=(TrackSeed other) &
copy-assignment operator
Definition TrackSeed.cc:29
bool isAvailable() const
check whether the object is actually available
Definition TrackSeed.cc:113
static constexpr std::string_view typeName
Definition TrackSeed.h:85
MutableTrackSeed clone(bool cloneRelations=true) const
Definition TrackSeed.cc:34
friend class TrackSeedCollectionIterator
Definition TrackSeed.h:51
TrackSeed()
default constructor
Definition TrackSeed.cc:21
void unlink()
disconnect from TrackSeedObj instance
Definition TrackSeed.h:104
bool operator==(const TrackSeed &other) const
Definition TrackSeed.h:106
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition TrackSeed.cc:78
friend class TrackSeedCollection
Definition TrackSeed.h:49
friend class MutableTrackSeed
Definition TrackSeed.h:48
TrackSeedCollection collection_type
Definition TrackSeed.h:56
const edm4eic::TrackParameters getParams() const
Access the Initial track parameters.
Definition TrackSeed.cc:69
const edm4hep::Vector3f & getPerigee() const
Access the Vector for the perigee (line surface)
Definition TrackSeed.cc:67
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition TrackSeed.cc:101
const podio::ObjectID getObjectID() const
Definition TrackSeed.cc:117
TrackSeed(const TrackSeed &other)=default
copy constructor
~TrackSeed()=default
destructor
static TrackSeed makeEmpty()
Definition TrackSeed.cc:63
std::size_t hits_size() const
Definition TrackSeed.cc:90
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition TrackSeed.cc:84
TrackSeed & operator=(TrackSeed other) &&=delete
bool operator!=(const TrackSeed &other) const
Definition TrackSeed.h:109
Definition TrackSeedObj.h:24
Definition TrackerHit.h:45
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::TrackSeed &obj) const
Definition TrackSeed.h:147