Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-03 08:34:32

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4EIC_MutableCalorimeterHit_H
0004 #define EDM4EIC_MutableCalorimeterHit_H
0005 
0006 #include "edm4eic/CalorimeterHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/CalorimeterHit.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 CalorimeterHitCollection;
0024 }
0025 namespace edm4hep {
0026 class RawCalorimeterHit;
0027 class MutableRawCalorimeterHit;
0028 }
0029 
0030 
0031 namespace edm4eic {
0032 
0033 
0034 /** @class MutableCalorimeterHit
0035  *  Calorimeter hit
0036  *  @author: W. Armstrong, S. Joosten
0037  */
0038 class MutableCalorimeterHit {
0039 
0040   friend class CalorimeterHitCollection;
0041   friend class CalorimeterHitMutableCollectionIterator;
0042   friend class CalorimeterHit;
0043 
0044 public:
0045   using object_type = CalorimeterHit;
0046   using collection_type = CalorimeterHitCollection;
0047 
0048   /// default constructor
0049   MutableCalorimeterHit();
0050 
0051   /// Constructor initializing all members
0052   MutableCalorimeterHit(std::uint64_t cellID, float energy, float energyError, float time, float timeError, edm4hep::Vector3f position, edm4hep::Vector3f dimension, std::int32_t sector, std::int32_t layer, edm4hep::Vector3f local);
0053 
0054   /// copy constructor
0055   MutableCalorimeterHit(const MutableCalorimeterHit& other) = default;
0056 
0057   /// copy-assignment operator
0058   MutableCalorimeterHit& operator=(MutableCalorimeterHit other);
0059 
0060   /// create a mutable deep-copy of the object with identical relations
0061   /// if cloneRelations=false, the relations are not cloned and will be empty
0062   MutableCalorimeterHit clone(bool cloneRelations=true) const;
0063 
0064   /// destructor
0065   ~MutableCalorimeterHit() = default;
0066 
0067 
0068 public:
0069 
0070   /// Access the The detector specific (geometrical) cell id.
0071   std::uint64_t getCellID() const;
0072 
0073   /// Access the The energy for this hit in [GeV].
0074   float getEnergy() const;
0075 
0076   /// Access the Error on energy [GeV].
0077   float getEnergyError() const;
0078 
0079   /// Access the The time of the hit in [ns].
0080   float getTime() const;
0081 
0082   /// Access the Error on the time
0083   float getTimeError() const;
0084 
0085   /// Access the The global position of the hit in world coordinates [mm].
0086   const edm4hep::Vector3f& getPosition() const;
0087 
0088   /// Access the The dimension information of the cell [mm].
0089   const edm4hep::Vector3f& getDimension() const;
0090 
0091   /// Access the Sector that this hit occurred in
0092   std::int32_t getSector() const;
0093 
0094   /// Access the Layer that the hit occurred in
0095   std::int32_t getLayer() const;
0096 
0097   /// Access the The local coordinates of the hit in the detector segment [mm].
0098   const edm4hep::Vector3f& getLocal() const;
0099 
0100 
0101   /// Access the Related raw calorimeter hit
0102   const edm4hep::RawCalorimeterHit getRawHit() const;
0103 
0104   /// Set the The detector specific (geometrical) cell id.
0105   void setCellID(std::uint64_t value);
0106   /// Get mutable reference to The detector specific (geometrical) cell id.
0107   std::uint64_t& getCellID();
0108   /// Get reference to The detector specific (geometrical) cell id.
0109   [[deprecated("use getCellID instead")]]
0110   std::uint64_t& cellID();
0111 
0112   /// Set the The energy for this hit in [GeV].
0113   void setEnergy(float value);
0114   /// Get mutable reference to The energy for this hit in [GeV].
0115   float& getEnergy();
0116   /// Get reference to The energy for this hit in [GeV].
0117   [[deprecated("use getEnergy instead")]]
0118   float& energy();
0119 
0120   /// Set the Error on energy [GeV].
0121   void setEnergyError(float value);
0122   /// Get mutable reference to Error on energy [GeV].
0123   float& getEnergyError();
0124   /// Get reference to Error on energy [GeV].
0125   [[deprecated("use getEnergyError instead")]]
0126   float& energyError();
0127 
0128   /// Set the The time of the hit in [ns].
0129   void setTime(float value);
0130   /// Get mutable reference to The time of the hit in [ns].
0131   float& getTime();
0132   /// Get reference to The time of the hit in [ns].
0133   [[deprecated("use getTime instead")]]
0134   float& time();
0135 
0136   /// Set the Error on the time
0137   void setTimeError(float value);
0138   /// Get mutable reference to Error on the time
0139   float& getTimeError();
0140   /// Get reference to Error on the time
0141   [[deprecated("use getTimeError instead")]]
0142   float& timeError();
0143 
0144   /// Set the The global position of the hit in world coordinates [mm].
0145   void setPosition(edm4hep::Vector3f value);
0146   /// Get mutable reference to The global position of the hit in world coordinates [mm].
0147   edm4hep::Vector3f& getPosition();
0148   /// Get reference to The global position of the hit in world coordinates [mm].
0149   [[deprecated("use getPosition instead")]]
0150   edm4hep::Vector3f& position();
0151 
0152   /// Set the The dimension information of the cell [mm].
0153   void setDimension(edm4hep::Vector3f value);
0154   /// Get mutable reference to The dimension information of the cell [mm].
0155   edm4hep::Vector3f& getDimension();
0156   /// Get reference to The dimension information of the cell [mm].
0157   [[deprecated("use getDimension instead")]]
0158   edm4hep::Vector3f& dimension();
0159 
0160   /// Set the Sector that this hit occurred in
0161   void setSector(std::int32_t value);
0162   /// Get mutable reference to Sector that this hit occurred in
0163   std::int32_t& getSector();
0164   /// Get reference to Sector that this hit occurred in
0165   [[deprecated("use getSector instead")]]
0166   std::int32_t& sector();
0167 
0168   /// Set the Layer that the hit occurred in
0169   void setLayer(std::int32_t value);
0170   /// Get mutable reference to Layer that the hit occurred in
0171   std::int32_t& getLayer();
0172   /// Get reference to Layer that the hit occurred in
0173   [[deprecated("use getLayer instead")]]
0174   std::int32_t& layer();
0175 
0176   /// Set the The local coordinates of the hit in the detector segment [mm].
0177   void setLocal(edm4hep::Vector3f value);
0178   /// Get mutable reference to The local coordinates of the hit in the detector segment [mm].
0179   edm4hep::Vector3f& getLocal();
0180   /// Get reference to The local coordinates of the hit in the detector segment [mm].
0181   [[deprecated("use getLocal instead")]]
0182   edm4hep::Vector3f& local();
0183 
0184 
0185   /// Set the Related raw calorimeter hit
0186   void setRawHit(const edm4hep::RawCalorimeterHit& value);
0187 
0188 
0189 
0190 
0191   /// check whether the object is actually available
0192   bool isAvailable() const;
0193   /// disconnect from CalorimeterHitObj instance
0194   void unlink() { m_obj = podio::utils::MaybeSharedPtr<CalorimeterHitObj>{nullptr}; }
0195 
0196   bool operator==(const MutableCalorimeterHit& other) const { return m_obj == other.m_obj; }
0197   bool operator==(const CalorimeterHit& other) const;
0198 
0199   bool operator!=(const MutableCalorimeterHit& other) const { return !(*this == other); }
0200   bool operator!=(const CalorimeterHit& other) const { return !(*this == other); }
0201 
0202   // less comparison operator, so that objects can be e.g. stored in sets.
0203   bool operator<(const MutableCalorimeterHit& other) const { return podio::detail::getOrderKey(*this) < podio::detail::getOrderKey(other); }
0204 
0205   podio::ObjectID id() const { return getObjectID(); }
0206 
0207   const podio::ObjectID getObjectID() const;
0208 
0209   friend void swap(MutableCalorimeterHit& a, MutableCalorimeterHit& b) {
0210     using std::swap;
0211     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0212   }
0213 
0214 private:
0215   /// constructor from existing CalorimeterHitObj
0216   explicit MutableCalorimeterHit(podio::utils::MaybeSharedPtr<CalorimeterHitObj> obj);
0217 
0218   podio::utils::MaybeSharedPtr<CalorimeterHitObj> m_obj{nullptr};
0219 };
0220 
0221 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0222 void to_json(nlohmann::json& j, const MutableCalorimeterHit& value);
0223 #endif
0224 
0225 
0226 } // namespace edm4eic
0227 
0228 
0229 #endif