Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/edm4eic/MutablePMTHit.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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