3#ifndef EDM4EIC_ReconstructedParticle_H
4#define EDM4EIC_ReconstructedParticle_H
11#include "edm4hep/ParticleID.h"
12#include "edm4hep/Vector3f.h"
13#include "podio/RelationRange.h"
17#include "podio/utilities/MaybeSharedPtr.h"
18#include "podio/detail/OrderKey.h"
23#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
24#include "nlohmann/json_fwd.hpp"
35class MutableParticleID;
41OrderKey
getOrderKey(
const edm4eic::ReconstructedParticle& obj);
70 ReconstructedParticle(
const std::int32_t type,
const float energy,
const edm4hep::Vector3f& momentum,
const edm4hep::Vector3f& referencePoint,
const float charge,
const float mass,
const float goodnessOfPID,
const edm4eic::Cov4f& covMatrix,
const std::int32_t PDG);
93 static constexpr std::string_view
typeName =
"edm4eic::ReconstructedParticle";
120 std::int32_t
getPDG()
const;
130 std::vector<edm4eic::Cluster>::const_iterator
clusters_begin()
const;
131 std::vector<edm4eic::Cluster>::const_iterator
clusters_end()
const;
132 podio::RelationRange<edm4eic::Cluster>
getClusters()
const;
135 std::vector<edm4eic::Track>::const_iterator
tracks_begin()
const;
136 std::vector<edm4eic::Track>::const_iterator
tracks_end()
const;
137 podio::RelationRange<edm4eic::Track>
getTracks()
const;
140 std::vector<edm4eic::ReconstructedParticle>::const_iterator
particles_begin()
const;
141 std::vector<edm4eic::ReconstructedParticle>::const_iterator
particles_end()
const;
142 podio::RelationRange<edm4eic::ReconstructedParticle>
getParticles()
const;
146 std::vector<edm4hep::ParticleID>::const_iterator
particleIDs_end()
const;
155 void unlink() { m_obj = podio::utils::MaybeSharedPtr<ReconstructedParticleObj>{
nullptr}; }
170 friend std::hash<ReconstructedParticle>;
174 swap(a.m_obj, b.m_obj);
182 podio::utils::MaybeSharedPtr<ReconstructedParticleObj> m_obj{
nullptr};
187#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
197struct std::hash<
edm4eic::ReconstructedParticle> {
199 return std::hash<edm4eic::ReconstructedParticleObj*>{}(obj.m_obj.get());
207#if defined(__clang__)
208#pragma clang diagnostic push
209#pragma clang diagnostic ignored "-Wunknown-warning-option"
210#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
211#pragma clang diagnostic ignored "-Wdeprecated"
213#pragma clang diagnostic pop
214#elif defined(__GNUC__)
215#pragma GCC diagnostic push
216#pragma GCC diagnostic ignored "-Wdeprecated"
218#pragma GCC diagnostic pop
Definition MutableReconstructedParticle.h:46
Definition MutableVertex.h:38
Definition ReconstructedParticleCollectionData.h:34
Definition ReconstructedParticleCollection.h:137
Definition ReconstructedParticle.h:54
bool operator!=(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:160
std::size_t particleIDs_size() const
Definition ReconstructedParticle.cc:246
ReconstructedParticle()
default constructor
Definition ReconstructedParticle.cc:22
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_end() const
Definition ReconstructedParticle.cc:240
friend class ReconstructedParticleCollection
Definition ReconstructedParticle.h:57
const edm4eic::Cov4f & getCovMatrix() const
Access the covariance matrix of the reconstructed particle 4vector (10 parameters).
Definition ReconstructedParticle.cc:119
std::size_t clusters_size() const
Definition ReconstructedParticle.cc:150
ReconstructedParticle(const ReconstructedParticle &other)=default
copy constructor
std::size_t tracks_size() const
Definition ReconstructedParticle.cc:182
std::vector< edm4eic::Cluster >::const_iterator clusters_begin() const
Definition ReconstructedParticle.cc:138
std::int32_t getType() const
Access the type of reconstructed particle. Check/set collection parameters ReconstructedParticleTypeN...
Definition ReconstructedParticle.cc:112
float getGoodnessOfPID() const
Access the overall goodness of the PID on a scale of [0;1].
Definition ReconstructedParticle.cc:118
podio::RelationRange< edm4eic::Cluster > getClusters() const
Definition ReconstructedParticle.cc:161
std::vector< edm4hep::ParticleID >::const_iterator particleIDs_begin() const
Definition ReconstructedParticle.cc:234
podio::ObjectID id() const
Definition ReconstructedParticle.h:166
std::vector< edm4eic::Track >::const_iterator tracks_end() const
Definition ReconstructedParticle.cc:176
friend class MutableReconstructedParticle
Definition ReconstructedParticle.h:56
const edm4hep::Vector3f & getReferencePoint() const
Access the [mm] reference, i.e. where the particle has been measured.
Definition ReconstructedParticle.cc:115
std::int32_t getPDG() const
Access the PDG code for this particle.
Definition ReconstructedParticle.cc:120
MutableReconstructedParticle clone(bool cloneRelations=true) const
Definition ReconstructedParticle.cc:43
ReconstructedParticleCollection collection_type
Definition ReconstructedParticle.h:64
std::vector< edm4eic::Track >::const_iterator tracks_begin() const
Definition ReconstructedParticle.cc:170
const edm4hep::Vector3f & getMomentum() const
Access the [GeV] particle momentum. Four momentum state is not kept consistent internally.
Definition ReconstructedParticle.cc:114
friend void swap(ReconstructedParticle &a, ReconstructedParticle &b)
Definition ReconstructedParticle.h:172
ReconstructedParticle & operator=(ReconstructedParticle other) &
copy-assignment operator
Definition ReconstructedParticle.cc:38
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_end() const
Definition ReconstructedParticle.cc:208
bool isCompound() const
Definition ReconstructedParticle.h:149
const edm4eic::Vertex getStartVertex() const
Access the Start vertex associated to this particle.
Definition ReconstructedParticle.cc:122
bool operator==(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:157
friend class ReconstructedParticleCollectionIterator
Definition ReconstructedParticle.h:59
~ReconstructedParticle()=default
destructor
const podio::ObjectID getObjectID() const
Definition ReconstructedParticle.cc:273
bool isAvailable() const
check whether the object is actually available
Definition ReconstructedParticle.cc:269
ReconstructedParticle & operator=(ReconstructedParticle other) &&=delete
float getMass() const
Access the [GeV] mass of the reconstructed particle, set independently from four vector....
Definition ReconstructedParticle.cc:117
float getCharge() const
Access the charge of the reconstructed particle.
Definition ReconstructedParticle.cc:116
float getEnergy() const
Access the [GeV] energy of the reconstructed particle. Four momentum state is not kept consistent int...
Definition ReconstructedParticle.cc:113
const edm4hep::ParticleID getParticleIDUsed() const
Access the particle ID used for the kinematics of this particle.
Definition ReconstructedParticle.cc:129
podio::RelationRange< edm4eic::Track > getTracks() const
Definition ReconstructedParticle.cc:193
static constexpr std::string_view typeName
Definition ReconstructedParticle.h:93
std::vector< edm4eic::Cluster >::const_iterator clusters_end() const
Definition ReconstructedParticle.cc:144
std::size_t particles_size() const
Definition ReconstructedParticle.cc:214
std::vector< edm4eic::ReconstructedParticle >::const_iterator particles_begin() const
Definition ReconstructedParticle.cc:202
static ReconstructedParticle makeEmpty()
Definition ReconstructedParticle.cc:108
bool operator<(const ReconstructedParticle &other) const
Definition ReconstructedParticle.h:164
bool operator!=(const MutableReconstructedParticle &other) const
Definition ReconstructedParticle.h:161
MutableReconstructedParticle mutable_type
Definition ReconstructedParticle.h:63
podio::RelationRange< edm4eic::ReconstructedParticle > getParticles() const
Definition ReconstructedParticle.cc:225
void unlink()
disconnect from ReconstructedParticleObj instance
Definition ReconstructedParticle.h:155
podio::RelationRange< edm4hep::ParticleID > getParticleIDs() const
Definition ReconstructedParticle.cc:257
Definition ReconstructedParticleObj.h:29
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
std::size_t operator()(const edm4eic::ReconstructedParticle &obj) const
Definition ReconstructedParticle.h:198