EDM4eic
EIC data model
Loading...
Searching...
No Matches
MCRecoTrackParticleAssociation.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_MCRecoTrackParticleAssociation_H
4#define EDM4EIC_MCRecoTrackParticleAssociation_H
5
7
8#include <cstdint>
9
10#include "podio/utilities/MaybeSharedPtr.h"
11#include "podio/detail/OrderKey.h"
12
13#include <ostream>
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 MCRecoTrackParticleAssociationCollection;
23class Track;
24class MutableTrack;
25}
26namespace edm4hep {
27class MCParticle;
28class MutableMCParticle;
29}
30
31
32namespace podio::detail {
33// Internal function used in less comparison operators of the datatypes and interface types
35};
36
37namespace edm4eic {
38
39class MutableMCRecoTrackParticleAssociation;
40class MCRecoTrackParticleAssociationCollection;
41class MCRecoTrackParticleAssociationCollectionData;
42
43/** @class MCRecoTrackParticleAssociation
44 * Association between a Track and a MCParticle
45 * @author: S. Joosten
46 */
48
53 friend podio::detail::OrderKey podio::detail::getOrderKey(const MCRecoTrackParticleAssociation & obj);
54
55public:
58
59 /// default constructor
61
62 /// Constructor initializing all members
63 MCRecoTrackParticleAssociation(std::uint32_t simID, std::uint32_t recID, float weight);
64
65 /// copy constructor
67
68 /// copy-assignment operator
70
71 /// create a mutable deep-copy of the object with identical relations
72 /// if cloneRelations=false, the relations are not cloned and will be empty
73 MutableMCRecoTrackParticleAssociation clone(bool cloneRelations=true) const;
74
75 /// destructor
77
78 /// converting constructor from mutable object
80
82
83public:
84
85 static constexpr auto typeName = "edm4eic::MCRecoTrackParticleAssociation";
86
87 /// Access the Index of corresponding MCParticle (position in MCParticles array)
88 std::uint32_t getSimID() const;
89
90 /// Access the Index of corresponding Track (position in Tracks array)
91 std::uint32_t getRecID() const;
92
93 /// Access the weight of this association
94 float getWeight() const;
95
96
97 /// Access the reference to the track
98 const edm4eic::Track getRec() const;
99 /// Access the reference to the Monte-Carlo particle
100 const edm4hep::MCParticle getSim() const;
101
102
103
104 /// check whether the object is actually available
105 bool isAvailable() const;
106 /// disconnect from MCRecoTrackParticleAssociationObj instance
107 void unlink() { m_obj = podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj>{nullptr}; }
108
109 bool operator==(const MCRecoTrackParticleAssociation& other) const { return m_obj == other.m_obj; }
110 bool operator==(const MutableMCRecoTrackParticleAssociation& other) const;
111
112 bool operator!=(const MCRecoTrackParticleAssociation& other) const { return !(*this == other); }
113 bool operator!=(const MutableMCRecoTrackParticleAssociation& other) const { return !(*this == other); }
114
115 // less comparison operator, so that objects can be e.g. stored in sets.
117
118 podio::ObjectID id() const { return getObjectID(); }
119
120 const podio::ObjectID getObjectID() const;
121
123 using std::swap;
124 swap(a.m_obj, b.m_obj); // swap out the internal pointers
125 }
126
127private:
128 /// constructor from existing MCRecoTrackParticleAssociationObj
129 explicit MCRecoTrackParticleAssociation(podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> obj);
131
132 podio::utils::MaybeSharedPtr<MCRecoTrackParticleAssociationObj> m_obj{nullptr};
133};
134
135std::ostream& operator<<(std::ostream& o, const MCRecoTrackParticleAssociation& value);
136
137#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
138void to_json(nlohmann::json& j, const MCRecoTrackParticleAssociation& value);
139#endif
140
141
142} // namespace edm4eic
143
144
145#endif
Definition MCRecoTrackParticleAssociationCollectionData.h:32
Definition MCRecoTrackParticleAssociationCollection.h:91
Definition MCRecoTrackParticleAssociationCollection.h:36
Definition MCRecoTrackParticleAssociation.h:47
friend class MCRecoTrackParticleAssociationCollection
Definition MCRecoTrackParticleAssociation.h:50
const edm4hep::MCParticle getSim() const
Access the reference to the Monte-Carlo particle.
Definition MCRecoTrackParticleAssociation.cc:73
MCRecoTrackParticleAssociation & operator=(MCRecoTrackParticleAssociation other)
copy-assignment operator
Definition MCRecoTrackParticleAssociation.cc:32
bool operator!=(const MutableMCRecoTrackParticleAssociation &other) const
Definition MCRecoTrackParticleAssociation.h:113
friend class MutableMCRecoTrackParticleAssociation
Definition MCRecoTrackParticleAssociation.h:49
static MCRecoTrackParticleAssociation makeEmpty()
Definition MCRecoTrackParticleAssociation.cc:58
friend void swap(MCRecoTrackParticleAssociation &a, MCRecoTrackParticleAssociation &b)
Definition MCRecoTrackParticleAssociation.h:122
std::uint32_t getSimID() const
Access the Index of corresponding MCParticle (position in MCParticles array)
Definition MCRecoTrackParticleAssociation.cc:62
std::uint32_t getRecID() const
Access the Index of corresponding Track (position in Tracks array)
Definition MCRecoTrackParticleAssociation.cc:63
bool operator!=(const MCRecoTrackParticleAssociation &other) const
Definition MCRecoTrackParticleAssociation.h:112
bool isAvailable() const
check whether the object is actually available
Definition MCRecoTrackParticleAssociation.cc:85
MutableMCRecoTrackParticleAssociation clone(bool cloneRelations=true) const
Definition MCRecoTrackParticleAssociation.cc:37
MCRecoTrackParticleAssociation()
default constructor
Definition MCRecoTrackParticleAssociation.cc:22
~MCRecoTrackParticleAssociation()=default
destructor
MCRecoTrackParticleAssociation(const MCRecoTrackParticleAssociation &other)=default
copy constructor
podio::ObjectID id() const
Definition MCRecoTrackParticleAssociation.h:118
float getWeight() const
Access the weight of this association.
Definition MCRecoTrackParticleAssociation.cc:64
const podio::ObjectID getObjectID() const
Definition MCRecoTrackParticleAssociation.cc:89
static constexpr auto typeName
Definition MCRecoTrackParticleAssociation.h:85
bool operator<(const MCRecoTrackParticleAssociation &other) const
Definition MCRecoTrackParticleAssociation.h:116
bool operator==(const MCRecoTrackParticleAssociation &other) const
Definition MCRecoTrackParticleAssociation.h:109
void unlink()
disconnect from MCRecoTrackParticleAssociationObj instance
Definition MCRecoTrackParticleAssociation.h:107
const edm4eic::Track getRec() const
Access the reference to the track.
Definition MCRecoTrackParticleAssociation.cc:66
Definition MCRecoTrackParticleAssociationObj.h:24
Definition MutableMCRecoTrackParticleAssociation.h:39
Definition Track.h:48
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:103
Definition CalorimeterHit.h:25
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:150