Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutablePMTHit_H
0004 #define EDM4EIC_MutablePMTHit_H
0005 
0006 #include "edm4eic/PMTHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/PMTHit.h"
0009 
0010 #include "edm4hep/Vector3f.h"
0011 #include <cstdint>
0012 
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 
0015 #include <cstdint>
0016 
0017 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0018 #include "nlohmann/json_fwd.hpp"
0019 #endif
0020 
0021 
0022 
0023 namespace edm4eic {
0024 
0025 
0026 /** @class MutablePMTHit
0027  *  EIC PMT hit
0028  *  @author: S. Joosten, C. Peng
0029  */
0030 class MutablePMTHit {
0031 
0032   friend class PMTHitCollection;
0033   friend class PMTHitMutableCollectionIterator;
0034   friend class PMTHit;
0035 
0036 public:
0037   using object_type = PMTHit;
0038   using collection_type = PMTHitCollection;
0039 
0040   /// default constructor
0041   MutablePMTHit();
0042 
0043   /// Constructor initializing all members
0044   MutablePMTHit(std::uint64_t cellID, float npe, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, edm4hep::Vector3f local);
0045 
0046   /// copy constructor
0047   MutablePMTHit(const MutablePMTHit& other) = default;
0048 
0049   /// copy-assignment operator
0050   MutablePMTHit& operator=(MutablePMTHit other);
0051 
0052   /// create a mutable deep-copy of the object with identical relations
0053   /// if cloneRelations=false, the relations are not cloned and will be empty
0054   MutablePMTHit clone(bool cloneRelations=true) const;
0055 
0056   /// destructor
0057   ~MutablePMTHit() = default;
0058 
0059 
0060 public:
0061 
0062   /// Access the The detector specific (geometrical) cell id.
0063   std::uint64_t getCellID() const;
0064 
0065   /// Access the Estimated number of photo-electrons [#]
0066   float getNpe() const;
0067 
0068   /// Access the Time [ns]
0069   float getTime() const;
0070 
0071   /// Access the Error on the time [ns]
0072   float getTimeError() const;
0073 
0074   /// Access the PMT hit position [mm]
0075   const edm4hep::Vector3f& getPosition() const;
0076 
0077   /// Access the The dimension information of the pixel [mm].
0078   const edm4hep::Vector3f& getDimension() const;
0079 
0080   /// Access the The sector this hit occurred in
0081   std::int32_t getSector() const;
0082 
0083   /// Access the The local position of the hit in detector coordinates (relative to the sector) [mm]
0084   const edm4hep::Vector3f& getLocal() const;
0085 
0086 
0087 
0088   /// Set the The detector specific (geometrical) cell id.
0089   void setCellID(std::uint64_t value);
0090   /// Get mutable reference to The detector specific (geometrical) cell id.
0091   std::uint64_t& getCellID();
0092   /// Get reference to The detector specific (geometrical) cell id.
0093   [[deprecated("use getCellID instead")]]
0094   std::uint64_t& cellID();
0095 
0096   /// Set the Estimated number of photo-electrons [#]
0097   void setNpe(float value);
0098   /// Get mutable reference to Estimated number of photo-electrons [#]
0099   float& getNpe();
0100   /// Get reference to Estimated number of photo-electrons [#]
0101   [[deprecated("use getNpe instead")]]
0102   float& npe();
0103 
0104   /// Set the Time [ns]
0105   void setTime(float value);
0106   /// Get mutable reference to Time [ns]
0107   float& getTime();
0108   /// Get reference to Time [ns]
0109   [[deprecated("use getTime instead")]]
0110   float& time();
0111 
0112   /// Set the Error on the time [ns]
0113   void setTimeError(float value);
0114   /// Get mutable reference to Error on the time [ns]
0115   float& getTimeError();
0116   /// Get reference to Error on the time [ns]
0117   [[deprecated("use getTimeError instead")]]
0118   float& timeError();
0119 
0120   /// Set the PMT hit position [mm]
0121   void setPosition(edm4hep::Vector3f value);
0122   /// Get mutable reference to PMT hit position [mm]
0123   edm4hep::Vector3f& getPosition();
0124   /// Get reference to PMT hit position [mm]
0125   [[deprecated("use getPosition instead")]]
0126   edm4hep::Vector3f& position();
0127 
0128   /// Set the The dimension information of the pixel [mm].
0129   void setDimension(edm4hep::Vector3f value);
0130   /// Get mutable reference to The dimension information of the pixel [mm].
0131   edm4hep::Vector3f& getDimension();
0132   /// Get reference to The dimension information of the pixel [mm].
0133   [[deprecated("use getDimension instead")]]
0134   edm4hep::Vector3f& dimension();
0135 
0136   /// Set the The sector this hit occurred in
0137   void setSector(std::int32_t value);
0138   /// Get mutable reference to The sector this hit occurred in
0139   std::int32_t& getSector();
0140   /// Get reference to The sector this hit occurred in
0141   [[deprecated("use getSector instead")]]
0142   std::int32_t& sector();
0143 
0144   /// Set the The local position of the hit in detector coordinates (relative to the sector) [mm]
0145   void setLocal(edm4hep::Vector3f value);
0146   /// Get mutable reference to The local position of the hit in detector coordinates (relative to the sector) [mm]
0147   edm4hep::Vector3f& getLocal();
0148   /// Get reference to The local position of the hit in detector coordinates (relative to the sector) [mm]
0149   [[deprecated("use getLocal instead")]]
0150   edm4hep::Vector3f& local();
0151 
0152 
0153 
0154 
0155 
0156 
0157   /// check whether the object is actually available
0158   bool isAvailable() const;
0159   /// disconnect from PMTHitObj instance
0160   void unlink() { m_obj = podio::utils::MaybeSharedPtr<PMTHitObj>{nullptr}; }
0161 
0162   bool operator==(const MutablePMTHit& other) const { return m_obj == other.m_obj; }
0163   bool operator==(const PMTHit& other) const;
0164 
0165   bool operator!=(const MutablePMTHit& other) const { return !(*this == other); }
0166   bool operator!=(const PMTHit& other) const { return !(*this == other); }
0167 
0168   // less comparison operator, so that objects can be e.g. stored in sets.
0169   bool operator<(const MutablePMTHit& other) const { return m_obj < other.m_obj; }
0170 
0171   podio::ObjectID id() const { return getObjectID(); }
0172 
0173   const podio::ObjectID getObjectID() const;
0174 
0175   friend void swap(MutablePMTHit& a, MutablePMTHit& b) {
0176     using std::swap;
0177     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0178   }
0179 
0180 private:
0181   /// constructor from existing PMTHitObj
0182   explicit MutablePMTHit(podio::utils::MaybeSharedPtr<PMTHitObj> obj);
0183 
0184   podio::utils::MaybeSharedPtr<PMTHitObj> m_obj{nullptr};
0185 };
0186 
0187 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0188 void to_json(nlohmann::json& j, const MutablePMTHit& value);
0189 #endif
0190 
0191 
0192 } // namespace edm4eic
0193 
0194 
0195 #endif