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
50
51 /// Constructor initializing all members
52 MutableTrackSeed(const edm4hep::Vector3f& perigee);
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
75 /// Access the Initial track parameters
77
78 /// Set the Vector for the perigee (line surface)
79 void setPerigee(const edm4hep::Vector3f& perigee);
80 /// Get mutable reference to Vector for the perigee (line surface)
81 edm4hep::Vector3f& getPerigee();
82 /// Get reference to Vector for the perigee (line surface)
83 [[deprecated("use getPerigee instead")]]
84 edm4hep::Vector3f& perigee();
85
86
87 /// Set the Initial track parameters
88 void setParams(const edm4eic::TrackParameters& value);
89
90 void addToHits(const edm4eic::TrackerHit&);
91 std::size_t hits_size() const;
92 edm4eic::TrackerHit getHits(std::size_t) const;
93 std::vector<edm4eic::TrackerHit>::const_iterator hits_begin() const;
94 std::vector<edm4eic::TrackerHit>::const_iterator hits_end() const;
95 podio::RelationRange<edm4eic::TrackerHit> getHits() const;
96
97
98
99 /// check whether the object is actually available
100 bool isAvailable() const;
101 /// disconnect from TrackSeedObj instance
102 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackSeedObj>{nullptr}; }
103
104 bool operator==(const MutableTrackSeed& other) const { return m_obj == other.m_obj; }
105 bool operator==(const TrackSeed& other) const;
106
107 bool operator!=(const MutableTrackSeed& other) const { return !(*this == other); }
108 bool operator!=(const TrackSeed& other) const { return !(*this == other); }
109
110 // less comparison operator, so that objects can be e.g. stored in sets.
111 bool operator<(const MutableTrackSeed& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
112
113 podio::ObjectID id() const { return getObjectID(); }
114
115 const podio::ObjectID getObjectID() const;
116
117 friend std::hash<MutableTrackSeed>;
118
120 using std::swap;
121 swap(a.m_obj, b.m_obj); // swap out the internal pointers
122 }
123
124private:
125 /// constructor from existing TrackSeedObj
126 explicit MutableTrackSeed(podio::utils::MaybeSharedPtr<TrackSeedObj> obj);
127
128 podio::utils::MaybeSharedPtr<TrackSeedObj> m_obj{nullptr};
129};
130
131#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
132void to_json(nlohmann::json& j, const MutableTrackSeed& value);
133#endif
134
135
136} // namespace edm4eic
137
138
139
140template<>
141struct std::hash<edm4eic::MutableTrackSeed> {
142 std::size_t operator()(const edm4eic::MutableTrackSeed& obj) const {
143 return std::hash<edm4eic::TrackSeedObj*>{}(obj.m_obj.get());
144 }
145};
146
147
148#endif
Definition MutableTrackParameters.h:35
Definition MutableTrackSeed.h:38
TrackSeed object_type
Definition MutableTrackSeed.h:45
const podio::ObjectID getObjectID() const
Definition MutableTrackSeed.cc:109
friend class TrackSeedMutableCollectionIterator
Definition MutableTrackSeed.h:41
bool operator!=(const TrackSeed &other) const
Definition MutableTrackSeed.h:108
edm4hep::Vector3f & perigee()
Get reference to Vector for the perigee (line surface)
Definition MutableTrackSeed.cc:57
~MutableTrackSeed()=default
destructor
void setPerigee(const edm4hep::Vector3f &perigee)
Set the Vector for the perigee (line surface)
Definition MutableTrackSeed.cc:55
MutableTrackSeed clone(bool cloneRelations=true) const
Definition MutableTrackSeed.cc:32
const edm4eic::TrackParameters getParams() const
Access the Initial track parameters.
Definition MutableTrackSeed.cc:47
void addToHits(const edm4eic::TrackerHit &)
Definition MutableTrackSeed.cc:64
MutableTrackSeed & operator=(MutableTrackSeed other) &
copy-assignment operator
Definition MutableTrackSeed.cc:27
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:45
void unlink()
disconnect from TrackSeedObj instance
Definition MutableTrackSeed.h:102
MutableTrackSeed(const MutableTrackSeed &other)=default
copy constructor
bool operator!=(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:107
podio::ObjectID id() const
Definition MutableTrackSeed.h:113
MutableTrackSeed()
default constructor
Definition MutableTrackSeed.cc:19
void setParams(const edm4eic::TrackParameters &value)
Set the Initial track parameters.
Definition MutableTrackSeed.cc:59
std::size_t hits_size() const
Definition MutableTrackSeed.cc:81
bool operator<(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:111
MutableTrackSeed & operator=(MutableTrackSeed other) &&=delete
bool isAvailable() const
check whether the object is actually available
Definition MutableTrackSeed.cc:105
friend void swap(MutableTrackSeed &a, MutableTrackSeed &b)
Definition MutableTrackSeed.h:119
podio::RelationRange< edm4eic::TrackerHit > getHits() const
Definition MutableTrackSeed.cc:92
std::vector< edm4eic::TrackerHit >::const_iterator hits_begin() const
Definition MutableTrackSeed.cc:69
bool operator==(const MutableTrackSeed &other) const
Definition MutableTrackSeed.h:104
std::vector< edm4eic::TrackerHit >::const_iterator hits_end() const
Definition MutableTrackSeed.cc:75
Definition TrackParameters.h:43
Definition TrackSeedCollection.h:137
Definition TrackSeed.h:46
Definition TrackerHit.h:45
Definition CalorimeterHit.cc:17
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150
std::size_t operator()(const edm4eic::MutableTrackSeed &obj) const
Definition MutableTrackSeed.h:142