EDM4eic
EIC data model
Loading...
Searching...
No Matches
MutableMCRecoTrackParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MutableMCRecoTrackParticleAssociation_H
4#define EDM4EIC_MutableMCRecoTrackParticleAssociation_H
5
7// Make the immutable class available from its mutable version but not vice versa
9
10#include <cstdint>
11
12#include "podio/utilities/MaybeSharedPtr.h"
13
14#include <cstdint>
15
16#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
17#include "nlohmann/json_fwd.hpp"
18#endif
19
20// forward declarations
21namespace edm4eic {
22class Track;
23class MutableTrack;
24}
25namespace edm4hep {
26class MCParticle;
27class MutableMCParticle;
28}
29
30
31namespace edm4eic {
32
33
34/** @class MutableMCRecoTrackParticleAssociation
35 * Association between a Track and a MCParticle
36 * @author: S. Joosten
37 */
39
43
44public:
47
48 /// default constructor
50
51 /// Constructor initializing all members
52 MutableMCRecoTrackParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
53
54 /// copy constructor
56
57 /// copy-assignment operator
59
60 /// create a mutable deep-copy of the object with identical relations
61 /// if cloneRelations=false, the relations are not cloned and will be empty
62 MutableMCRecoTrackParticleAssociation clone(bool cloneRelations=true) const;
63
64 /// destructor
66
67
68public:
69
70 /// Access the Index of corresponding MCParticle (position in MCParticles array)
71 std::uint32_t getSimID() const;
72
73 /// Access the Index of corresponding Track (position in Tracks array)
74 std::uint32_t getRecID() const;
75
76 /// Access the weight of this association
77 float getWeight() const;
78
79
80 /// Access the reference to the track
81 const edm4eic::Track getRec() const;
82 /// Access the reference to the Monte-Carlo particle
83 const edm4hep::MCParticle getSim() const;
84
85 /// Set the Index of corresponding MCParticle (position in MCParticles array)
86 void setSimID(std::uint32_t value);
87 /// Get mutable reference to Index of corresponding MCParticle (position in MCParticles array)
88 std::uint32_t& getSimID();
89 /// Get reference to Index of corresponding MCParticle (position in MCParticles array)
90 [[deprecated("use getSimID instead")]]
91 std::uint32_t& simID();
92
93 /// Set the Index of corresponding Track (position in Tracks array)
94 void setRecID(std::uint32_t value);
95 /// Get mutable reference to Index of corresponding Track (position in Tracks array)
96 std::uint32_t& getRecID();
97 /// Get reference to Index of corresponding Track (position in Tracks array)
98 [[deprecated("use getRecID instead")]]
99 std::uint32_t& recID();
100
101 /// Set the weight of this association
102 void setWeight(float value);
103 /// Get mutable reference to weight of this association
104 float& getWeight();
105 /// Get reference to weight of this association
106 [[deprecated("use getWeight instead")]]
107 float& weight();
108
109
110 /// Set the reference to the track
111 void setRec(const edm4eic::Track& value);
112 /// Set the reference to the Monte-Carlo particle
113 void setSim(const edm4hep::MCParticle& value);
114
115
116
117
118 /// check whether the object is actually available
119 bool isAvailable() const;
120 /// disconnect from MCRecoTrackParticleAssociationObj instance
121 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj>{nullptr}; }
122
123 bool operator==(const MutableMCRecoTrackParticleAssociation& other) const { return m_obj == other.m_obj; }
124 bool operator==(const MCRecoTrackParticleAssociation& other) const;
125
126 bool operator!=(const MutableMCRecoTrackParticleAssociation& other) const { return !(*this == other); }
127 bool operator!=(const MCRecoTrackParticleAssociation& other) const { return !(*this == other); }
128
129 // less comparison operator, so that objects can be e.g. stored in sets.
130 bool operator<(const MutableMCRecoTrackParticleAssociation& other) const { return m_obj < other.m_obj; }
131
132 podio::ObjectID id() const { return getObjectID(); }
133
134 const podio::ObjectID getObjectID() const;
135
137 using std::swap;
138 swap(a.m_obj, b.m_obj); // swap out the internal pointers
139 }
140
141private:
142 /// constructor from existing MCRecoTrackParticleAssociationObj
143 explicit MutableMCRecoTrackParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> obj);
144
145 podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> m_obj{nullptr};
146};
147
148#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
149void to_json(nlohmann::json& j, const MutableMCRecoTrackParticleAssociation& value);
150#endif
151
152
153} // namespace edm4eic
154
155
156#endif
Definition MCRecoTrackParticleAssociationCollection.h:92
Definition MCRecoTrackParticleAssociation.h:40
Definition MCRecoTrackParticleAssociationCollection.h:63
Definition MutableMCRecoTrackParticleAssociation.h:38
friend class MCRecoTrackParticleAssociationCollection
Definition MutableMCRecoTrackParticleAssociation.h:40
bool operator==(const MutableMCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:123
MutableMCRecoTrackParticleAssociation clone(bool cloneRelations=true) const
Definition MutableMCRecoTrackParticleAssociation.cc:35
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoTrackParticleAssociation.cc:45
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MutableMCRecoTrackParticleAssociation.cc:56
podio::ObjectID id() const
Definition MutableMCRecoTrackParticleAssociation.h:132
std::uint32_t getRecID() const
Access the Index of corresponding Track (position in Tracks array)
Definition MutableMCRecoTrackParticleAssociation.cc:46
bool operator!=(const MutableMCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:126
~MutableMCRecoTrackParticleAssociation()=default
destructor
void setRecID(std::uint32_t value)
Set the Index of corresponding Track (position in Tracks array)
Definition MutableMCRecoTrackParticleAssociation.cc:67
const podio::ObjectID getObjectID() const
Definition MutableMCRecoTrackParticleAssociation.cc:94
friend void swap(MutableMCRecoTrackParticleAssociation &a, MutableMCRecoTrackParticleAssociation &b)
Definition MutableMCRecoTrackParticleAssociation.h:136
void setSim(const edm4hep::MCParticle &value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoTrackParticleAssociation.cc:79
bool operator<(const MutableMCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:130
MutableMCRecoTrackParticleAssociation & operator=(MutableMCRecoTrackParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoTrackParticleAssociation.cc:30
void unlink()
disconnect from MCRecoTrackParticleAssociationObj instance
Definition MutableMCRecoTrackParticleAssociation.h:121
std::uint32_t & simID()
Get reference to Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoTrackParticleAssociation.cc:66
float getWeight() const
Access the weight of this association.
Definition MutableMCRecoTrackParticleAssociation.cc:47
MutableMCRecoTrackParticleAssociation(const MutableMCRecoTrackParticleAssociation &other)=default
copy constructor
friend class MCRecoTrackParticleAssociation
Definition MutableMCRecoTrackParticleAssociation.h:42
const edm4eic::Track getRec() const
Access the reference to the track.
Definition MutableMCRecoTrackParticleAssociation.cc:49
bool isAvailable() const
check whether the object is actually available
Definition MutableMCRecoTrackParticleAssociation.cc:90
void setRec(const edm4eic::Track &value)
Set the reference to the track.
Definition MutableMCRecoTrackParticleAssociation.cc:74
MutableMCRecoTrackParticleAssociation()
default constructor
Definition MutableMCRecoTrackParticleAssociation.cc:20
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoTrackParticleAssociation.cc:70
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoTrackParticleAssociation.cc:64
float & weight()
Get reference to weight of this association.
Definition MutableMCRecoTrackParticleAssociation.cc:72
bool operator!=(const MCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:127
std::uint32_t & recID()
Get reference to Index of corresponding Track (position in Tracks array)
Definition MutableMCRecoTrackParticleAssociation.cc:69
Definition Track.h:41
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:21