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() = default;
60
61 /// Constructor initializing all members
62 TrackSeed(const edm4hep::Vector3f& perigee, const float quality);
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 /// Access the Seed quality reported by finder
91 float getQuality() const;
92
93
94 /// Access the Initial track parameters
96
97 std::size_t hits_size() const;
98 edm4eic::TrackerHit getHits(std::size_t) const;
99 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
100 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
101 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
102
103
104 /// check whether the object is actually available
105 bool isAvailable() const;
106 /// disconnect from TrackSeedObj instance
107 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
108
109 bool operator==(const TrackSeed& other) const { return m_obj == other.m_obj; }
110 bool operator==(const MutableTrackSeed& other) const;
111
112 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
113 bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
114
115 // less comparison operator, so that objects can be e.g. stored in sets.
116 bool operator<(const TrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
117
118 podio::ObjectID id() const { return getObjectID(); }
119
120 const podio::ObjectID getObjectID() const;
121
122 friend std::hash<TrackSeed>;
123
124 friend void swap(TrackSeed& a, TrackSeed& b) {
125 using std::swap;
126 swap(a.m_obj, b.m_obj); // swap out the internal pointers
127 }
128
129private:
130 /// constructor from existing TrackSeedObj
131 explicit TrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
133
134 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
135};
136
137std::ostream& operator<<(std::ostream& o, const TrackSeed& value);
138
139#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
140void to_json(nlohmann::json& j, const TrackSeed& value);
141#endif
142
143
144} // namespace edm4eic
145
146
147
148template<>
149struct std::hash<edm4eic::TrackSeed> {
150 std::size_t operator()(const edm4eic::TrackSeed& obj) const {
151 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
152 }
153};
154
155
156// This is needed to avoid triggering opening every library in LD_LIBRARY_PATH
157// until it's fixed in ROOT. See https://github.com/root-project/root/issues/18489
158// and https://github.com/AIDASoft/podio/issues/770
159#if defined(__clang__)
160 #pragma clang diagnostic push
161 #pragma clang diagnostic ignored "-Wunknown-warning-option"
162 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
163 #pragma clang diagnostic ignored "-Wdeprecated"
164constexpr std::string_view edm4eic::TrackSeed::typeName;
165 #pragma clang diagnostic pop
166#elif defined(__GNUC__)
167 #pragma GCC diagnostic push
168 #pragma GCC diagnostic ignored "-Wdeprecated"
169constexpr std::string_view edm4eic::TrackSeed::typeName;
170 #pragma GCC diagnostic pop
171#endif
172
173
174#endif
Definition MutableTrackParameters.h:35
Definition MutableTrackSeed.h:38
Definition TrackParameters.h:43
Definition TrackSeedCollectionData.h:33
Definition TrackSeedCollection.h:138
Definition TrackSeed.h:46
MutableTrackSeed mutable_type
Definition TrackSeed.h:55
bool operator!=(const MutableTrackSeed &other) const
Definition TrackSeed.h:113
friend void swap(TrackSeed &a, TrackSeed &b)
Definition TrackSeed.h:124
podio::ObjectID id() const
Definition TrackSeed.h:118
bool operator<(const TrackSeed &other) const
Definition TrackSeed.h:116
TrackSeed & operator=(TrackSeed other) &
copy-assignment operator
Definition TrackSeed.cc:26
bool isAvailable() const
check whether the object is actually available
Definition TrackSeed.cc:111
static constexpr std::string_view typeName
Definition TrackSeed.h:85
MutableTrackSeed clone(bool cloneRelations=true) const
Definition TrackSeed.cc:31
friend class TrackSeedCollectionIterator
Definition TrackSeed.h:51
TrackSeed()=default
default constructor
void unlink()
disconnect from TrackSeedObj instance
Definition TrackSeed.h:107
bool operator==(const TrackSeed &other) const
Definition TrackSeed.h:109
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition TrackSeed.cc:76
float getQuality() const
Access the Seed quality reported by finder.
Definition TrackSeed.cc:65
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:67
const edm4hep::Vector3f & getPerigee() const
Access the Vector for the perigee (line surface)
Definition TrackSeed.cc:64
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition TrackSeed.cc:99
const podio::ObjectID getObjectID() const
Definition TrackSeed.cc:115
TrackSeed(const TrackSeed &other)=default
copy constructor
~TrackSeed()=default
destructor
static TrackSeed makeEmpty()
Definition TrackSeed.cc:60
std::size_t hits_size() const
Definition TrackSeed.cc:88
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition TrackSeed.cc:82
TrackSeed & operator=(TrackSeed other) &&=delete
bool operator!=(const TrackSeed &other) const
Definition TrackSeed.h:112
Definition TrackSeedObj.h:24
Definition TrackerHit.h:45
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::TrackSeed &obj) const
Definition TrackSeed.h:150