EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableTrackSeed.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableTrackSeed_H
4#define EDM4EIC_MutableTrackSeed_H
5
7// Make the immutable class available from its mutable version but not vice versa
8#include "edm4eic/TrackSeed.h"
9
10#include "edm4eic/TrackerHit.h"
11#include "edm4hep/Vector3f.h"
12#include "podio/RelationRange.h"
13#include <vector>
14
15#include "podio/utilities/MaybeSharedPtr.h"
16
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 edm4eic {
32
33
34/** @class MutableTrackSeed
35 * Seed info from the realistic seed finder
36 * @author: S. Li, B. Schmookler, J. Osborn
37 */
39
40 friend class TrackSeedCollection;
42 friend class TrackSeed;
43
44public:
47
48 /// default constructor
49 MutableTrackSeed() = default;
50
51 /// Constructor initializing all members
52 MutableTrackSeed(const edm4hep::Vector3f& perigee, const float quality);
53
54 /// copy constructor
55 MutableTrackSeed(const MutableTrackSeed& other) noexcept = default;
56
57 /// move constructor
58 MutableTrackSeed(MutableTrackSeed&& other) noexcept = default;
59
60 /// copy-assignment operator
61 MutableTrackSeed& operator=(MutableTrackSeed other) &; // Rebind this to other's internal object
62 MutableTrackSeed& operator=(MutableTrackSeed other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
63
64 /// create a mutable deep-copy of the object with identical relations
65 /// if cloneRelations=false, the relations are not cloned and will be empty
66 MutableTrackSeed clone(bool cloneRelations=true) const;
67
68 /// destructor
69 ~MutableTrackSeed() = default;
70
71
72public:
73
74 /// Access the Vector for the perigee (line surface)
75 const edm4hep::Vector3f& getPerigee() const;
76
77 /// Access the Seed quality reported by finder
78 float getQuality() const;
79
80
81 /// Access the Initial track parameters
83
84 /// Set the Vector for the perigee (line surface)
85 void setPerigee(const edm4hep::Vector3f& perigee);
86 /// Get mutable reference to Vector for the perigee (line surface)
87 edm4hep::Vector3f& getPerigee();
88
89 /// Set the Seed quality reported by finder
90 void setQuality(const float quality);
91 /// Get mutable reference to Seed quality reported by finder
92 float& getQuality();
93
94
95 /// Set the Initial track parameters
96 void setParams(const edm4eic::TrackParameters& value);
97
98 void addToHits(const edm4eic::TrackerHit&);
99 std::size_t hits_size() const;
100 edm4eic::TrackerHit getHits(std::size_t) const;
101 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
102 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
103 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
104
105
106
107 /// check whether the object is actually available
108 bool isAvailable() const;
109 /// disconnect from TrackSeedObj instance
110 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
111
112 constexpr bool operator==(const MutableTrackSeed& other) const { return m_obj == other.m_obj; }
113 bool operator==(const TrackSeed& other) const;
114
115 constexpr bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
116 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
117
118 // less comparison operator, so that objects can be e.g. stored in sets.
119 bool operator<(const MutableTrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
120
121 podio::ObjectID id() const { return getObjectID(); }
122
123 const podio::ObjectID getObjectID() const;
124
125 friend std::hash<MutableTrackSeed>;
126
128 using std::swap;
129 swap(a.m_obj, b.m_obj); // swap out the internal pointers
130 }
131
132private:
133 /// constructor from existing TrackSeedObj
134 explicit MutableTrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
135
136 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
137};
138
139#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
140void to_json(nlohmann::json& j, const MutableTrackSeed& value);
141#endif
142
143
144} // namespace edm4eic
145
146
147
148template<>
149struct std::hash<edm4eic::MutableTrackSeed> {
150 std::size_t operator()(const edm4eic::MutableTrackSeed& obj) const {
151 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
152 }
153};
154
155
156#endif
Definition MutableTrackParameters.h:35
Definition MutableTrackSeed.h:38
TrackSeed object_type
Definition MutableTrackSeed.h:45
const podio::ObjectID getObjectID() const
Definition MutableTrackSeed.cc:108
friend class TrackSeedMutableCollectionIterator
Definition MutableTrackSeed.h:41
bool operator!=(const TrackSeed &other) const
Definition MutableTrackSeed.h:116
void setQuality(const float quality)
Set the Seed quality reported by finder.
Definition MutableTrackSeed.cc:55
MutableTrackSeed()=default
default constructor
~MutableTrackSeed()=default
destructor
void setPerigee(const edm4hep::Vector3f &perigee)
Set the Vector for the perigee (line surface).
Definition MutableTrackSeed.cc:53
MutableTrackSeed clone(bool cloneRelations=true) const
Definition MutableTrackSeed.cc:29
const edm4eic::TrackParameters getParams() const
Access the Initial track parameters.
Definition MutableTrackSeed.cc:45
void addToHits(const edm4eic::TrackerHit &)
Definition MutableTrackSeed.cc:63
MutableTrackSeed & operator=(MutableTrackSeed other) &
copy-assignment operator
Definition MutableTrackSeed.cc:24
friend class TrackSeed
Definition MutableTrackSeed.h:42
TrackSeedCollection collection_type
Definition MutableTrackSeed.h:46
friend class TrackSeedCollection
Definition MutableTrackSeed.h:40
const edm4hep::Vector3f & getPerigee() const
Access the Vector for the perigee (line surface).
Definition MutableTrackSeed.cc:42
void unlink()
disconnect from TrackSeedObj instance
Definition MutableTrackSeed.h:110
podio::ObjectID id() const
Definition MutableTrackSeed.h:121
void setParams(const edm4eic::TrackParameters &value)
Set the Initial track parameters.
Definition MutableTrackSeed.cc:58
MutableTrackSeed(MutableTrackSeed &&other) noexcept=default
move constructor
std::size_t hits_size() const
Definition MutableTrackSeed.cc:80
constexpr bool operator!=(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:115
constexpr bool operator==(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:112
bool operator<(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:119
float getQuality() const
Access the Seed quality reported by finder.
Definition MutableTrackSeed.cc:43
MutableTrackSeed & operator=(MutableTrackSeed other) &&=delete
MutableTrackSeed(const MutableTrackSeed &other) noexcept=default
copy constructor
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackSeed.cc:104
friend void swap(MutableTrackSeed &a, MutableTrackSeed &b)
Definition MutableTrackSeed.h:127
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition MutableTrackSeed.cc:91
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition MutableTrackSeed.cc:68
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition MutableTrackSeed.cc:74
Definition TrackParameters.h:43
Definition TrackSeedCollection.h:139
Definition TrackSeed.h:46
Definition TrackSeedObj.h:24
Definition TrackerHit.h:45
Definition ArrowMapper.cc:63
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackSeed &obj) const
Definition MutableTrackSeed.h:150