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