Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:31

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