3#ifndef EDM4EIC_PMTHit_H
4#define EDM4EIC_PMTHit_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"
58 PMTHit(
const std::uint64_t cellID,
const float npe,
const float time,
const float timeError,
const edm4hep::Vector3f& position,
const edm4hep::Vector3f& dimension,
const std::int32_t sector,
const edm4hep::Vector3f& local);
84 static constexpr std::string_view
typeName =
"edm4eic::PMTHit";
108 const edm4hep::Vector3f&
getLocal()
const;
117 void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{
nullptr}; }
132 friend std::hash<PMTHit>;
136 swap(a.m_obj, b.m_obj);
141 explicit PMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
144 podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{
new PMTHitObj{}, podio::utils::MarkOwned};
149#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
150void to_json(nlohmann::json& j,
const PMTHit& value);
161 return std::hash<edm4eic::PMTHitObj*>{}(obj.m_obj.get());
169#if defined(__clang__)
170 #pragma clang diagnostic push
171 #pragma clang diagnostic ignored "-Wunknown-warning-option"
172 #pragma clang diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
173 #pragma clang diagnostic ignored "-Wdeprecated"
175 #pragma clang diagnostic pop
176#elif defined(__GNUC__)
177 #pragma GCC diagnostic push
178 #pragma GCC diagnostic ignored "-Wdeprecated"
180 #pragma GCC diagnostic pop
Definition MutablePMTHit.h:34
Definition PMTHitCollectionData.h:31
Definition PMTHitCollection.h:139
void unlink()
disconnect from PMTHitObj instance
Definition PMTHit.h:117
constexpr bool operator==(const PMTHit &other) const
Definition PMTHit.h:119
float getNpe() const
Access the Estimated number of photo-electrons [#].
Definition PMTHit.cc:56
MutablePMTHit clone(bool cloneRelations=true) const
Definition PMTHit.cc:36
PMTHit & operator=(PMTHit other) &
copy-assignment operator
Definition PMTHit.cc:31
bool operator<(const PMTHit &other) const
Definition PMTHit.h:126
friend class PMTHitCollection
Definition PMTHit.h:45
friend class MutablePMTHit
Definition PMTHit.h:44
const edm4hep::Vector3f & getDimension() const
Access the The dimension information of the pixel [mm].
Definition PMTHit.cc:60
constexpr bool operator!=(const PMTHit &other) const
Definition PMTHit.h:122
MutablePMTHit mutable_type
Definition PMTHit.h:51
PMTHit(PMTHit &&other) noexcept=default
move constructor
std::uint64_t getCellID() const
Access the The detector specific (geometrical) cell id.
Definition PMTHit.cc:55
static constexpr std::string_view typeName
Definition PMTHit.h:84
friend void swap(PMTHit &a, PMTHit &b)
Definition PMTHit.h:134
const edm4hep::Vector3f & getLocal() const
Access the The local position of the hit in detector coordinates (relative to the sector) [mm].
Definition PMTHit.cc:62
~PMTHit()=default
destructor
float getTime() const
Access the Time [ns].
Definition PMTHit.cc:57
friend class PMTHitCollectionIterator
Definition PMTHit.h:47
const podio::ObjectID getObjectID() const
Definition PMTHit.cc:73
bool operator!=(const MutablePMTHit &other) const
Definition PMTHit.h:123
const edm4hep::Vector3f & getPosition() const
Access the PMT hit position [mm].
Definition PMTHit.cc:59
PMTHit(const PMTHit &other) noexcept=default
copy constructor
float getTimeError() const
Access the Error on the time [ns].
Definition PMTHit.cc:58
PMTHitCollection collection_type
Definition PMTHit.h:52
static PMTHit makeEmpty()
Definition PMTHit.cc:51
PMTHit()=default
default constructor
PMTHit & operator=(PMTHit other) &&=delete
podio::ObjectID id() const
Definition PMTHit.h:128
bool isAvailable() const
check whether the object is actually available
Definition PMTHit.cc:69
std::int32_t getSector() const
Access the The sector this hit occurred in.
Definition PMTHit.cc:61
Definition PMTHitObj.h:17
Definition ArrowMapper.cc:63
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::PMTHit &obj) const
Definition PMTHit.h:160