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 <ostream>
15#include <cstddef>
16
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
19#endif
20
21// forward declarations
22namespace edm4eic {
23class Track;
24class MutableTrack;
25}
26namespace edm4hep {
27class MCParticle;
28class MutableMCParticle;
29}
30
31
32namespace edm4eic {
33
34
35/** @class MutableMCRecoTrackParticleAssociation
36 * Association between a Track and a MCParticle
37 * @author: S. Joosten
38 */
40
44
45public:
48
49 /// default constructor
51
52 /// Constructor initializing all members
53 MutableMCRecoTrackParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
54
55 /// copy constructor
57
58 /// copy-assignment operator
60
61 /// create a mutable deep-copy of the object with identical relations
63
64 /// destructor
66
67
68 /// conversion to const object
69 operator MCRecoTrackParticleAssociation() const;
70
71public:
72
73 /// Access the Index of corresponding MCParticle (position in MCParticles array)
74 std::uint32_t getSimID() const;
75
76 /// Access the Index of corresponding Track (position in Tracks array)
77 std::uint32_t getRecID() const;
78
79 /// Access the weight of this association
80 float getWeight() const;
81
82
83 /// Access the reference to the track
84 const edm4eic::Track getRec() const;
85 /// Access the reference to the Monte-Carlo particle
86 const edm4hep::MCParticle getSim() const;
87
88 /// Set the Index of corresponding MCParticle (position in MCParticles array)
89 void setSimID(std::uint32_t value);
90
91 /// Set the Index of corresponding Track (position in Tracks array)
92 void setRecID(std::uint32_t value);
93
94 /// Set the weight of this association
95 void setWeight(float value);
96
97
98 /// Set the reference to the track
99 void setRec(edm4eic::Track value);
100 /// Set the reference to the Monte-Carlo particle
101 void setSim(edm4hep::MCParticle value);
102
103
104
105
106 /// check whether the object is actually available
107 bool isAvailable() const;
108 /// disconnect from MCRecoTrackParticleAssociationObj instance
109 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj>{nullptr}; }
110
111 bool operator==(const MutableMCRecoTrackParticleAssociation& other) const { return m_obj == other.m_obj; }
112 bool operator==(const MCRecoTrackParticleAssociation& other) const;
113
114 // less comparison operator, so that objects can be e.g. stored in sets.
115 bool operator<(const MutableMCRecoTrackParticleAssociation& other) const { return m_obj < other.m_obj; }
116
117 podio::ObjectID id() const { return getObjectID(); }
118
119 const podio::ObjectID getObjectID() const;
120
122 using std::swap;
123 swap(a.m_obj, b.m_obj); // swap out the internal pointers
124 }
125
126private:
127 /// constructor from existing MCRecoTrackParticleAssociationObj
128 explicit MutableMCRecoTrackParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> obj);
129
130 podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> m_obj{nullptr};
131};
132
133#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
134void to_json(nlohmann::json& j, const MutableMCRecoTrackParticleAssociation& value);
135#endif
136
137
138} // namespace edm4eic
139
140
141#endif
Definition MCRecoTrackParticleAssociationCollection.h:95
Definition MCRecoTrackParticleAssociation.h:40
Definition MCRecoTrackParticleAssociationCollection.h:66
Definition MutableMCRecoTrackParticleAssociation.h:39
friend class MCRecoTrackParticleAssociationCollection
Definition MutableMCRecoTrackParticleAssociation.h:41
bool operator==(const MutableMCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:111
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:117
std::uint32_t getRecID() const
Access the Index of corresponding Track (position in Tracks array)
Definition MutableMCRecoTrackParticleAssociation.cc:46
~MutableMCRecoTrackParticleAssociation()=default
destructor
void setSim(edm4hep::MCParticle value)
Set the reference to the Monte-Carlo particle.
Definition MutableMCRecoTrackParticleAssociation.cc:75
void setRecID(std::uint32_t value)
Set the Index of corresponding Track (position in Tracks array)
Definition MutableMCRecoTrackParticleAssociation.cc:65
const podio::ObjectID getObjectID() const
Definition MutableMCRecoTrackParticleAssociation.cc:95
friend void swap(MutableMCRecoTrackParticleAssociation &a, MutableMCRecoTrackParticleAssociation &b)
Definition MutableMCRecoTrackParticleAssociation.h:121
bool operator<(const MutableMCRecoTrackParticleAssociation &other) const
Definition MutableMCRecoTrackParticleAssociation.h:115
MutableMCRecoTrackParticleAssociation & operator=(MutableMCRecoTrackParticleAssociation other)
copy-assignment operator
Definition MutableMCRecoTrackParticleAssociation.cc:33
void unlink()
disconnect from MCRecoTrackParticleAssociationObj instance
Definition MutableMCRecoTrackParticleAssociation.h:109
void setRec(edm4eic::Track value)
Set the reference to the track.
Definition MutableMCRecoTrackParticleAssociation.cc:68
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:43
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:88
MutableMCRecoTrackParticleAssociation clone() const
create a mutable deep-copy of the object with identical relations
Definition MutableMCRecoTrackParticleAssociation.cc:38
MutableMCRecoTrackParticleAssociation()
default constructor
Definition MutableMCRecoTrackParticleAssociation.cc:23
void setWeight(float value)
Set the weight of this association.
Definition MutableMCRecoTrackParticleAssociation.cc:66
void setSimID(std::uint32_t value)
Set the Index of corresponding MCParticle (position in MCParticles array)
Definition MutableMCRecoTrackParticleAssociation.cc:64
Definition Track.h:41
Definition CalorimeterHit.cc:18
Definition CalorimeterHit.h:21