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) = default;
56
57 /// copy-assignment operator
58 MutableTrackSeed& operator=(MutableTrackSeed other) &; // Rebind this to other's internal object
59 MutableTrackSeed& operator=(MutableTrackSeed other) && = delete; // Prevent rebinding temporary as the changes wouldn't persist
60
61 /// create a mutable deep-copy of the object with identical relations
62 /// if cloneRelations=false, the relations are not cloned and will be empty
63 MutableTrackSeed clone(bool cloneRelations=true) const;
64
65 /// destructor
66 ~MutableTrackSeed() = default;
67
68
69public:
70
71 /// Access the Vector for the perigee (line surface)
72 const edm4hep::Vector3f& getPerigee() const;
73
74 /// Access the Seed quality reported by finder
75 float getQuality() const;
76
77
78 /// Access the Initial track parameters
80
81 /// Set the Vector for the perigee (line surface)
82 void setPerigee(const edm4hep::Vector3f& perigee);
83 /// Get mutable reference to Vector for the perigee (line surface)
84 edm4hep::Vector3f& getPerigee();
85 /// Get reference to Vector for the perigee (line surface)
86 [[deprecated("use getPerigee instead")]]
87 edm4hep::Vector3f& perigee();
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 /// Get reference to Seed quality reported by finder
94 [[deprecated("use getQuality instead")]]
95 float& quality();
96
97
98 /// Set the Initial track parameters
99 void setParams(const edm4eic::TrackParameters& value);
100
101 void addToHits(const edm4eic::TrackerHit&);
102 std::size_t hits_size() const;
103 edm4eic::TrackerHit getHits(std::size_t) const;
104 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
105 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
106 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
107
108
109
110 /// check whether the object is actually available
111 bool isAvailable() const;
112 /// disconnect from TrackSeedObj instance
113 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
114
115 bool operator==(const MutableTrackSeed& other) const { return m_obj == other.m_obj; }
116 bool operator==(const TrackSeed& other) const;
117
118 bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
119 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
120
121 // less comparison operator, so that objects can be e.g. stored in sets.
122 bool operator<(const MutableTrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
123
124 podio::ObjectID id() const { return getObjectID(); }
125
126 const podio::ObjectID getObjectID() const;
127
128 friend std::hash<MutableTrackSeed>;
129
131 using std::swap;
132 swap(a.m_obj, b.m_obj); // swap out the internal pointers
133 }
134
135private:
136 /// constructor from existing TrackSeedObj
137 explicit MutableTrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
138
139 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
140};
141
142#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
143void to_json(nlohmann::json& j, const MutableTrackSeed& value);
144#endif
145
146
147} // namespace edm4eic
148
149
150
151template<>
152struct std::hash<edm4eic::MutableTrackSeed> {
153 std::size_t operator()(const edm4eic::MutableTrackSeed& obj) const {
154 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
155 }
156};
157
158
159#endif
Definition MutableTrackParameters.h:35
Definition MutableTrackSeed.h:38
TrackSeed object_type
Definition MutableTrackSeed.h:45
const podio::ObjectID getObjectID() const
Definition MutableTrackSeed.cc:110
friend class TrackSeedMutableCollectionIterator
Definition MutableTrackSeed.h:41
bool operator!=(const TrackSeed &other) const
Definition MutableTrackSeed.h:119
void setQuality(const float quality)
Set the Seed quality reported by finder.
Definition MutableTrackSeed.cc:56
MutableTrackSeed()=default
default constructor
edm4hep::Vector3f & perigee()
Get reference to Vector for the perigee (line surface)
Definition MutableTrackSeed.cc:55
~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:65
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:113
MutableTrackSeed(const MutableTrackSeed &other)=default
copy constructor
bool operator!=(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:118
podio::ObjectID id() const
Definition MutableTrackSeed.h:124
void setParams(const edm4eic::TrackParameters &value)
Set the Initial track parameters.
Definition MutableTrackSeed.cc:60
std::size_t hits_size() const
Definition MutableTrackSeed.cc:82
bool operator<(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:122
float getQuality() const
Access the Seed quality reported by finder.
Definition MutableTrackSeed.cc:43
MutableTrackSeed & operator=(MutableTrackSeed other) &&=delete
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackSeed.cc:106
friend void swap(MutableTrackSeed &a, MutableTrackSeed &b)
Definition MutableTrackSeed.h:130
float & quality()
Get reference to Seed quality reported by finder.
Definition MutableTrackSeed.cc:58
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition MutableTrackSeed.cc:93
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition MutableTrackSeed.cc:70
bool operator==(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:115
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition MutableTrackSeed.cc:76
Definition TrackParameters.h:43
Definition TrackSeedCollection.h:138
Definition TrackSeed.h:46
Definition TrackSeedObj.h:24
Definition TrackerHit.h:45
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackSeed &obj) const
Definition MutableTrackSeed.h:153