3#ifndef EDM4EIC_MutableReconstructedParticle_H
4#define EDM4EIC_MutableReconstructedParticle_H
13#include "edm4hep/ParticleID.h"
14#include "edm4hep/Vector3f.h"
15#include "podio/RelationRange.h"
19#include "podio/utilities/MaybeSharedPtr.h"
23#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
24#include "nlohmann/json_fwd.hpp"
35class MutableParticleID;
104 std::int32_t
getPDG()
const;
117 [[deprecated(
"use getType instead")]]
118 std::int32_t&
type();
125 [[deprecated(
"use getEnergy instead")]]
133 [[deprecated(
"use getMomentum instead")]]
141 [[deprecated(
"use getReferencePoint instead")]]
149 [[deprecated(
"use getCharge instead")]]
157 [[deprecated(
"use getMass instead")]]
165 [[deprecated(
"use getGoodnessOfPID instead")]]
173 [[deprecated(
"use getCovMatrix instead")]]
181 [[deprecated(
"use getPDG instead")]]
193 std::vector<edm4eic::Cluster>::const_iterator
clusters_begin()
const;
194 std::vector<edm4eic::Cluster>::const_iterator
clusters_end()
const;
195 podio::RelationRange<edm4eic::Cluster>
getClusters()
const;
199 std::vector<edm4eic::Track>::const_iterator
tracks_begin()
const;
200 std::vector<edm4eic::Track>::const_iterator
tracks_end()
const;
201 podio::RelationRange<edm4eic::Track>
getTracks()
const;
205 std::vector<edm4eic::ReconstructedParticle>::const_iterator
particles_begin()
const;
206 std::vector<edm4eic::ReconstructedParticle>::const_iterator
particles_end()
const;
207 podio::RelationRange<edm4eic::ReconstructedParticle>
getParticles()
const;
212 std::vector<edm4hep::ParticleID>::const_iterator
particleIDs_end()
const;
222 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{
nullptr}; }
237 friend std::hash<MutableReconstructedParticle>;
241 swap(a.m_obj, b.m_obj);
248 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{
new ReconstructedParticleObj{}, podio::utils::MarkOwned};
251#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
261struct std::hash<
edm4eic::MutableReconstructedParticle> {
263 return std::hash<edm4eic::ReconstructedParticleObj*>{}(obj.m_obj.get());
Definition MutableReconstructedParticle.h:46
ReconstructedParticle object_type
Definition MutableReconstructedParticle.h:53
void setReferencePoint(const edm4hep::Vector3f &referencePoint)
Set the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:93
std::size_t clusters_size() const
Definition MutableReconstructedParticle.cc:138
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:69
void addToParticleIDs(const edm4hep::ParticleID &)
Definition MutableReconstructedParticle.cc:229
void unlink()
disconnect from ReconstructedParticleObj instance
Definition MutableReconstructedParticle.h:222
bool isCompound() const
Definition MutableReconstructedParticle.h:215
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition MutableReconstructedParticle.cc:162
void addToTracks(const edm4eic::Track &)
Definition MutableReconstructedParticle.cc:157
MutableReconstructedParticle clone(bool cloneRelations=true) const
Definition MutableReconstructedParticle.cc:37
void setGoodnessOfPID(const float goodnessOfPID)
Set the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:102
podio::ObjectID id() const
Definition MutableReconstructedParticle.h:233
friend class ReconstructedParticleCollection
Definition MutableReconstructedParticle.h:48
MutableReconstructedParticle & operator=(MutableReconstructedParticle other) &&=delete
std::size_t particleIDs_size() const
Definition MutableReconstructedParticle.cc:246
MutableReconstructedParticle & operator=(MutableReconstructedParticle other) &
copy-assignment operator
Definition MutableReconstructedParticle.cc:32
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition MutableReconstructedParticle.cc:126
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:61
void setCharge(const float charge)
Set the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:96
edm4eic::Cov4f & covMatrix()
Get reference to covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:107
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition MutableReconstructedParticle.cc:60
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition MutableReconstructedParticle.cc:198
float & goodnessOfPID()
Get reference to overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:104
void setMomentum(const edm4hep::Vector3f &momentum)
Set the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:90
bool operator<(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:231
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition MutableReconstructedParticle.cc:240
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition MutableReconstructedParticle.cc:67
float & mass()
Get reference to [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:101
const edm4hep::Vector3f & getReferencePoint() const
Access the [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:62
float & charge()
Get reference to charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:98
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition MutableReconstructedParticle.cc:168
const podio::ObjectID getObjectID() const
Definition MutableReconstructedParticle.cc:274
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition MutableReconstructedParticle.cc:65
bool operator==(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:224
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition MutableReconstructedParticle.cc:132
MutableReconstructedParticle()=default
default constructor
void setCovMatrix(const edm4eic::Cov4f &covMatrix)
Set the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:105
const edm4eic::Cov4f & getCovMatrix() const
Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition MutableReconstructedParticle.cc:66
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition MutableReconstructedParticle.cc:149
void setParticleIDUsed(const edm4hep::ParticleID &value)
Set the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:116
std::int32_t & PDG()
Get reference to PDG code for this particle.
Definition MutableReconstructedParticle.cc:110
bool operator!=(const MutableReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:227
std::int32_t & type()
Get reference to type of reconstructed particle. Check/set collection parameters ReconstructedParticl...
Definition MutableReconstructedParticle.cc:86
~MutableReconstructedParticle()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition MutableReconstructedParticle.cc:270
std::size_t tracks_size() const
Definition MutableReconstructedParticle.cc:174
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition MutableReconstructedParticle.cc:221
edm4hep::Vector3f & referencePoint()
Get reference to [mm] reference, i.e. where the particle has been measured.
Definition MutableReconstructedParticle.cc:95
friend class ReconstructedParticleMutableCollectionIterator
Definition MutableReconstructedParticle.h:49
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition MutableReconstructedParticle.cc:59
void setEnergy(const float energy)
Set the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent intern...
Definition MutableReconstructedParticle.cc:87
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:64
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition MutableReconstructedParticle.cc:234
float & energy()
Get reference to [GeV] energy of the reconstructed particle. Four momentum state is not kept consiste...
Definition MutableReconstructedParticle.cc:89
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition MutableReconstructedParticle.cc:76
MutableReconstructedParticle(const MutableReconstructedParticle &other)=default
copy constructor
ReconstructedParticleCollection collection_type
Definition MutableReconstructedParticle.h:54
std::size_t particles_size() const
Definition MutableReconstructedParticle.cc:210
friend class ReconstructedParticle
Definition MutableReconstructedParticle.h:50
edm4hep::Vector3f & momentum()
Get reference to [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition MutableReconstructedParticle.cc:92
void setPDG(const std::int32_t PDG)
Set the PDG code for this particle.
Definition MutableReconstructedParticle.cc:108
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition MutableReconstructedParticle.cc:204
friend void swap(MutableReconstructedParticle &a, MutableReconstructedParticle &b)
Definition MutableReconstructedParticle.h:239
float getCharge() const
Access the charge of the reconstructed particle.
Definition MutableReconstructedParticle.cc:63
void setType(const std::int32_t type)
Set the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeName...
Definition MutableReconstructedParticle.cc:84
bool operator!=(const ReconstructedParticle &other) const
Definition MutableReconstructedParticle.h:228
void addToParticles(const edm4eic::ReconstructedParticle &)
Definition MutableReconstructedParticle.cc:193
podio::RelationRange< edm4eic::Track > getTracks() const
Definition MutableReconstructedParticle.cc:185
void setStartVertex(const edm4eic::Vertex &value)
Set the Start vertex associated to this particle.
Definition MutableReconstructedParticle.cc:112
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition MutableReconstructedParticle.cc:257
void addToClusters(const edm4eic::Cluster &)
Definition MutableReconstructedParticle.cc:121
void setMass(const float mass)
Set the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition MutableReconstructedParticle.cc:99
Definition MutableVertex.h:38
Definition ReconstructedParticleCollection.h:138
Definition ReconstructedParticle.h:54
Definition ReconstructedParticleObj.h:29
Definition CalorimeterHit.cc:17
Definition CalorimeterHit.h:25
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::MutableReconstructedParticle &obj) const
Definition MutableReconstructedParticle.h:262