3#ifndef EDM4EIC_CalorimeterHit_H
4#define EDM4EIC_CalorimeterHit_H
8#include "edm4hep/Vector3f.h"
11#include "podio/utilities/MaybeSharedPtr.h"
12#include "podio/detail/OrderKey.h"
17#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
18#include "nlohmann/json_fwd.hpp"
26class RawCalorimeterHit;
27class MutableRawCalorimeterHit;
38class MutableCalorimeterHit;
39class CalorimeterHitCollection;
40class CalorimeterHitCollectionData;
62 CalorimeterHit(
const std::uint64_t cellID,
const float energy,
const float energyError,
const float time,
const float timeError,
const edm4hep::Vector3f& position,
const edm4hep::Vector3f& dimension,
const std::int32_t sector,
const std::int32_t layer,
const edm4hep::Vector3f& local);
85 static constexpr std::string_view
typeName =
"edm4eic::CalorimeterHit";
115 const edm4hep::Vector3f&
getLocal()
const;
119 const edm4hep::RawCalorimeterHit
getRawHit()
const;
126 void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{
nullptr}; }
141 friend std::hash<CalorimeterHit>;
145 swap(a.m_obj, b.m_obj);
150 explicit CalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
153 podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{
nullptr};
158#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
170 return std::hash<edm4eic::CalorimeterHitObj*>{}(obj.m_obj.get());
178#if defined(__clang__)
179#pragma clang diagnostic push
180#pragma clang diagnostic ignored "-Wunknown-warning-option"
181#pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
182#pragma clang diagnostic ignored "-Wdeprecated"
184#pragma clang diagnostic pop
185#elif defined(__GNUC__)
186#pragma GCC diagnostic push
187#pragma GCC diagnostic ignored "-Wdeprecated"
189#pragma GCC diagnostic pop
Definition CalorimeterHitCollectionData.h:31
Definition CalorimeterHitCollection.h:137
Definition CalorimeterHit.h:46
float getTime() const
Access the The time of the hit in [ns].
Definition CalorimeterHit.cc:68
friend void swap(CalorimeterHit &a, CalorimeterHit &b)
Definition CalorimeterHit.h:143
static constexpr std::string_view typeName
Definition CalorimeterHit.h:85
CalorimeterHitCollection collection_type
Definition CalorimeterHit.h:56
const podio::ObjectID getObjectID() const
Definition CalorimeterHit.cc:92
const edm4hep::Vector3f & getPosition() const
Access the The global position of the hit in world coordinates [mm].
Definition CalorimeterHit.cc:70
bool isAvailable() const
check whether the object is actually available
Definition CalorimeterHit.cc:88
float getTimeError() const
Access the Error on the time.
Definition CalorimeterHit.cc:69
bool operator==(const CalorimeterHit &other) const
Definition CalorimeterHit.h:128
float getEnergy() const
Access the The energy for this hit in [GeV].
Definition CalorimeterHit.cc:66
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the cell [mm].
Definition CalorimeterHit.cc:71
bool operator!=(const CalorimeterHit &other) const
Definition CalorimeterHit.h:131
float getEnergyError() const
Access the Error on energy [GeV].
Definition CalorimeterHit.cc:67
friend class CalorimeterHitCollectionIterator
Definition CalorimeterHit.h:51
MutableCalorimeterHit mutable_type
Definition CalorimeterHit.h:55
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition CalorimeterHit.cc:65
bool operator<(const CalorimeterHit &other) const
Definition CalorimeterHit.h:135
std::int32_t getSector() const
Access the Sector that this hit occurred in.
Definition CalorimeterHit.cc:72
MutableCalorimeterHit clone(bool cloneRelations=true) const
Definition CalorimeterHit.cc:43
const edm4hep::Vector3f & getLocal() const
Access the The local coordinates of the hit in the detector segment [mm].
Definition CalorimeterHit.cc:74
static CalorimeterHit makeEmpty()
Definition CalorimeterHit.cc:61
void unlink()
disconnect from CalorimeterHitObj instance
Definition CalorimeterHit.h:126
CalorimeterHit(const CalorimeterHit &other)=default
copy constructor
friend class CalorimeterHitCollection
Definition CalorimeterHit.h:49
friend class MutableCalorimeterHit
Definition CalorimeterHit.h:48
CalorimeterHit()
default constructor
Definition CalorimeterHit.cc:21
CalorimeterHit & operator=(CalorimeterHit other) &
copy-assignment operator
Definition CalorimeterHit.cc:38
~CalorimeterHit()=default
destructor
podio::ObjectID id() const
Definition CalorimeterHit.h:137
std::int32_t getLayer() const
Access the Layer that the hit occurred in.
Definition CalorimeterHit.cc:73
bool operator!=(const MutableCalorimeterHit &other) const
Definition CalorimeterHit.h:132
const edm4hep::RawCalorimeterHit getRawHit() const
Access the Related raw calorimeter hit.
Definition CalorimeterHit.cc:76
CalorimeterHit & operator=(CalorimeterHit other) &&=delete
Definition CalorimeterHitObj.h:21
Definition MutableCalorimeterHit.h:38
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::CalorimeterHit &obj) const
Definition CalorimeterHit.h:169