3#ifndef EDM4EIC_TrackerHit_H
4#define EDM4EIC_TrackerHit_H
9#include "edm4hep/Vector3f.h"
12#include "podio/utilities/MaybeSharedPtr.h"
13#include "podio/detail/OrderKey.h"
18#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
19#include "nlohmann/json_fwd.hpp"
32OrderKey
getOrderKey(
const edm4eic::TrackerHit& obj);
61 TrackerHit(
const std::uint64_t cellID,
const edm4hep::Vector3f& position,
const edm4eic::CovDiag3f& positionError,
const float time,
const float timeError,
const float edep,
const float edepError);
84 static constexpr std::string_view
typeName =
"edm4eic::TrackerHit";
116 void unlink() { m_obj = podio::utils::MaybeSharedPtr<TrackerHitObj>{
nullptr}; }
131 friend std::hash<TrackerHit>;
135 swap(a.m_obj, b.m_obj);
140 explicit TrackerHit(podio::utils::MaybeSharedPtr<TrackerHitObj> obj);
143 podio::utils::MaybeSharedPtr<TrackerHitObj> m_obj{
new TrackerHitObj{}, podio::utils::MarkOwned};
148#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
149void to_json(nlohmann::json& j,
const TrackerHit& value);
160 return std::hash<edm4eic::TrackerHitObj*>{}(obj.m_obj.get());
168#if defined(__clang__)
169 #pragma clang diagnostic push
170 #pragma clang diagnostic ignored "-Wunknown-warning-option"
171 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
172 #pragma clang diagnostic ignored "-Wdeprecated"
174 #pragma clang diagnostic pop
175#elif defined(__GNUC__)
176 #pragma GCC diagnostic push
177 #pragma GCC diagnostic ignored "-Wdeprecated"
179 #pragma GCC diagnostic pop
Definition CovDiag3f.h:19
Definition MutableRawTrackerHit.h:33
Definition MutableTrackerHit.h:37
Definition RawTrackerHit.h:41
Definition TrackerHitCollectionData.h:32
Definition TrackerHitCollection.h:138
Definition TrackerHit.h:45
friend class TrackerHitCollection
Definition TrackerHit.h:48
bool operator!=(const TrackerHit &other) const
Definition TrackerHit.h:121
float getEdep() const
Access the Energy deposit in this hit [GeV].
Definition TrackerHit.cc:63
const edm4eic::CovDiag3f & getPositionError() const
Access the Covariance Matrix.
Definition TrackerHit.cc:60
~TrackerHit()=default
destructor
bool isAvailable() const
check whether the object is actually available
Definition TrackerHit.cc:78
const edm4eic::RawTrackerHit getRawHit() const
Access the Related raw tracker hit.
Definition TrackerHit.cc:66
friend void swap(TrackerHit &a, TrackerHit &b)
Definition TrackerHit.h:133
MutableTrackerHit mutable_type
Definition TrackerHit.h:54
bool operator!=(const MutableTrackerHit &other) const
Definition TrackerHit.h:122
MutableTrackerHit clone(bool cloneRelations=true) const
Definition TrackerHit.cc:36
float getTimeError() const
Access the Error on the time.
Definition TrackerHit.cc:62
static TrackerHit makeEmpty()
Definition TrackerHit.cc:54
float getEdepError() const
Access the Error on the energy deposit [GeV].
Definition TrackerHit.cc:64
TrackerHit & operator=(TrackerHit other) &
copy-assignment operator
Definition TrackerHit.cc:31
const podio::ObjectID getObjectID() const
Definition TrackerHit.cc:82
bool operator==(const TrackerHit &other) const
Definition TrackerHit.h:118
friend class TrackerHitCollectionIterator
Definition TrackerHit.h:50
TrackerHit()=default
default constructor
float getTime() const
Access the Hit time [ns].
Definition TrackerHit.cc:61
TrackerHitCollection collection_type
Definition TrackerHit.h:55
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition TrackerHit.cc:58
void unlink()
disconnect from TrackerHitObj instance
Definition TrackerHit.h:116
TrackerHit(const TrackerHit &other)=default
copy constructor
friend class MutableTrackerHit
Definition TrackerHit.h:47
bool operator<(const TrackerHit &other) const
Definition TrackerHit.h:125
podio::ObjectID id() const
Definition TrackerHit.h:127
const edm4hep::Vector3f & getPosition() const
Access the Hit (cell) position [mm].
Definition TrackerHit.cc:59
TrackerHit & operator=(TrackerHit other) &&=delete
static constexpr std::string_view typeName
Definition TrackerHit.h:84
Definition TrackerHitObj.h:21
Definition CalorimeterHit.cc:17
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:99
Definition CalorimeterHit.h:31
OrderKey getOrderKey(const edm4eic::CalorimeterHit &obj)
Definition CalorimeterHit.cc:146
std::size_t operator()(const edm4eic::TrackerHit &obj) const
Definition TrackerHit.h:159