Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:50:40

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_PMTHit_H
0004 #define EDM4EIC_PMTHit_H
0005 
0006 #include "edm4eic/PMTHitObj.h"
0007 
0008 #include "edm4hep/Vector3f.h"
0009 #include <cstdint>
0010 
0011 #include "podio/utilities/MaybeSharedPtr.h"
0012 #include "podio/detail/OrderKey.h"
0013 
0014 #include <ostream>
0015 #include <cstdint>
0016 
0017 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0018 #include "nlohmann/json_fwd.hpp"
0019 #endif
0020 
0021 // forward declarations
0022 namespace edm4eic {
0023 class PMTHitCollection;
0024 }
0025 
0026 
0027 namespace podio::detail {
0028 // Internal function used in less comparison operators of the datatypes and interface types
0029 OrderKey getOrderKey(const edm4eic::PMTHit& obj);
0030 };
0031 
0032 namespace edm4eic {
0033 
0034 class MutablePMTHit;
0035 class PMTHitCollection;
0036 class PMTHitCollectionData;
0037 
0038 /** @class PMTHit
0039  *  EIC PMT hit
0040  *  @author: S. Joosten, C. Peng
0041  */
0042 class PMTHit {
0043 
0044   friend class MutablePMTHit;
0045   friend class PMTHitCollection;
0046   friend class edm4eic::PMTHitCollectionData;
0047   friend class PMTHitCollectionIterator;
0048   friend podio::detail::OrderKey podio::detail::getOrderKey(const PMTHit & obj);
0049 
0050 public:
0051   using mutable_type = MutablePMTHit;
0052   using collection_type = PMTHitCollection;
0053 
0054   /// default constructor
0055   PMTHit();
0056 
0057   /// Constructor initializing all members
0058   PMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
0059 
0060   /// copy constructor
0061   PMTHit(const PMTHit& other) = default;
0062 
0063   /// copy-assignment operator
0064   PMTHit& operator=(PMTHit other);
0065 
0066   /// create a mutable deep-copy of the object with identical relations
0067   /// if cloneRelations=false, the relations are not cloned and will be empty
0068   MutablePMTHit clone(bool cloneRelations=true) const;
0069 
0070   /// destructor
0071   ~PMTHit() = default;
0072 
0073   /// converting constructor from mutable object
0074   PMTHit(const MutablePMTHit& other);
0075 
0076   static PMTHit makeEmpty();
0077 
0078 public:
0079 
0080   static constexpr auto typeName = "edm4eic::PMTHit";
0081 
0082   /// Access the The detector specific (geometrical) cell id.
0083   std::uint64_t getCellID() const;
0084 
0085   /// Access the Estimated number of photo-electrons [#]
0086   float getNpe() const;
0087 
0088   /// Access the Time [ns]
0089   float getTime() const;
0090 
0091   /// Access the Error on the time [ns]
0092   float getTimeError() const;
0093 
0094   /// Access the PMT hit position [mm]
0095   const edm4hep::Vector3f& getPosition() const;
0096 
0097   /// Access the The dimension information of the pixel [mm].
0098   const edm4hep::Vector3f& getDimension() const;
0099 
0100   /// Access the The sector this hit occurred in
0101   std::int32_t getSector() const;
0102 
0103   /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
0104   const edm4hep::Vector3f& getLocal() const;
0105 
0106 
0107 
0108 
0109 
0110   /// check whether the object is actually available
0111   bool isAvailable() const;
0112   /// disconnect from PMTHitObj instance
0113   void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
0114 
0115   bool operator==(const PMTHit& other) const { return m_obj == other.m_obj; }
0116   bool operator==(const MutablePMTHit& other) const;
0117 
0118   bool operator!=(const PMTHit& other) const { return !(*this == other); }
0119   bool operator!=(const MutablePMTHit& other) const { return !(*this == other); }
0120 
0121   // less comparison operator, so that objects can be e.g. stored in sets.
0122   bool operator<(const PMTHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0123 
0124   podio::ObjectID id() const { return getObjectID(); }
0125 
0126   const podio::ObjectID getObjectID() const;
0127 
0128   friend void swap(PMTHit& a, PMTHit& b) {
0129     using std::swap;
0130     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0131   }
0132 
0133 private:
0134   /// constructor from existing PMTHitObj
0135   explicit PMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
0136   PMTHit(PMTHitObj* obj);
0137 
0138   podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
0139 };
0140 
0141 std::ostream& operator<<(std::ostream& o, const PMTHit& value);
0142 
0143 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0144 void to_json(nlohmann::json& j, const PMTHit& value);
0145 #endif
0146 
0147 
0148 } // namespace edm4eic
0149 
0150 
0151 #endif