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
86 /// Set the Seed quality reported by finder
87 void setQuality(const float quality);
88 /// Get mutable reference to Seed quality reported by finder
89 float& getQuality();
90
91
92 /// Set the Initial track parameters
93 void setParams(const edm4eic::TrackParameters& value);
94
95 void addToHits(const edm4eic::TrackerHit&);
96 std::size_t hits_size() const;
97 edm4eic::TrackerHit getHits(std::size_t) const;
98 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
99 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
100 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
101
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 constexpr bool operator==(const MutableTrackSeed& other) const { return m_obj == other.m_obj; }
110 bool operator==(const TrackSeed& other) const;
111
112 constexpr bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
113 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
114
115 // less comparison operator, so that objects can be e.g. stored in sets.
116 bool operator<(const MutableTrackSeed& 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<MutableTrackSeed>;
123
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 MutableTrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
132
133 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{new TrackSeedObj{}, podio::utils::MarkOwned};
134};
135
136#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
137void to_json(nlohmann::json& j, const MutableTrackSeed& value);
138#endif
139
140
141} // namespace edm4eic
142
143
144
145template<>
146struct std::hash<edm4eic::MutableTrackSeed> {
147 std::size_t operator()(const edm4eic::MutableTrackSeed& obj) const {
148 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
149 }
150};
151
152
153#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:113
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:107
MutableTrackSeed(const MutableTrackSeed &other)=default
copy constructor
podio::ObjectID id() const
Definition MutableTrackSeed.h:118
void setParams(const edm4eic::TrackParameters &value)
Set the Initial track parameters.
Definition MutableTrackSeed.cc:58
std::size_t hits_size() const
Definition MutableTrackSeed.cc:80
constexpr bool operator!=(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:112
constexpr bool operator==(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:109
bool operator<(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:116
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:104
friend void swap(MutableTrackSeed &a, MutableTrackSeed &b)
Definition MutableTrackSeed.h:124
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:61
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableTrackSeed &obj) const
Definition MutableTrackSeed.h:147