Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableRawCalorimeterHit_H
0004 #define EDM4HEP_MutableRawCalorimeterHit_H
0005 
0006 #include "edm4hep/RawCalorimeterHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/RawCalorimeterHit.h"
0009 
0010 #include <cstdint>
0011 
0012 #include "podio/utilities/MaybeSharedPtr.h"
0013 
0014 #include <cstdint>
0015 
0016 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0017 #include "nlohmann/json_fwd.hpp"
0018 #endif
0019 
0020 namespace edm4hep {
0021 
0022 /** @class MutableRawCalorimeterHit
0023  *  Raw calorimeter hit
0024  *  @author: F.Gaede, DESY
0025  */
0026 class MutableRawCalorimeterHit {
0027 
0028   friend class RawCalorimeterHitCollection;
0029   friend class RawCalorimeterHitMutableCollectionIterator;
0030   friend class RawCalorimeterHit;
0031 
0032 public:
0033   using object_type = RawCalorimeterHit;
0034   using collection_type = RawCalorimeterHitCollection;
0035 
0036   /// default constructor
0037   MutableRawCalorimeterHit();
0038 
0039   /// Constructor initializing all members
0040   MutableRawCalorimeterHit(std::uint64_t cellID, std::int32_t amplitude, std::int32_t timeStamp);
0041 
0042   /// copy constructor
0043   MutableRawCalorimeterHit(const MutableRawCalorimeterHit& other) = default;
0044 
0045   /// copy-assignment operator
0046   MutableRawCalorimeterHit& operator=(MutableRawCalorimeterHit other);
0047 
0048   /// create a mutable deep-copy of the object with identical relations
0049   /// if cloneRelations=false, the relations are not cloned and will be empty
0050   MutableRawCalorimeterHit clone(bool cloneRelations = true) const;
0051 
0052   /// destructor
0053   ~MutableRawCalorimeterHit() = default;
0054 
0055 public:
0056   /// Access the detector specific (geometrical) cell id.
0057   std::uint64_t getCellID() const;
0058 
0059   /// Access the amplitude of the hit in ADC counts.
0060   std::int32_t getAmplitude() const;
0061 
0062   /// Access the time stamp for the hit.
0063   std::int32_t getTimeStamp() const;
0064 
0065   /// Set the detector specific (geometrical) cell id.
0066   void setCellID(std::uint64_t value);
0067   /// Get mutable reference to detector specific (geometrical) cell id.
0068   std::uint64_t& getCellID();
0069   /// Get reference to detector specific (geometrical) cell id.
0070   [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0071 
0072   /// Set the amplitude of the hit in ADC counts.
0073   void setAmplitude(std::int32_t value);
0074   /// Get mutable reference to amplitude of the hit in ADC counts.
0075   std::int32_t& getAmplitude();
0076   /// Get reference to amplitude of the hit in ADC counts.
0077   [[deprecated("use getAmplitude instead")]] std::int32_t& amplitude();
0078 
0079   /// Set the time stamp for the hit.
0080   void setTimeStamp(std::int32_t value);
0081   /// Get mutable reference to time stamp for the hit.
0082   std::int32_t& getTimeStamp();
0083   /// Get reference to time stamp for the hit.
0084   [[deprecated("use getTimeStamp instead")]] std::int32_t& timeStamp();
0085 
0086   /// check whether the object is actually available
0087   bool isAvailable() const;
0088   /// disconnect from RawCalorimeterHitObj instance
0089   void unlink() {
0090     m_obj = podio::utils::MaybeSharedPtr<RawCalorimeterHitObj>{nullptr};
0091   }
0092 
0093   bool operator==(const MutableRawCalorimeterHit& other) const {
0094     return m_obj == other.m_obj;
0095   }
0096   bool operator==(const RawCalorimeterHit& other) const;
0097 
0098   bool operator!=(const MutableRawCalorimeterHit& other) const {
0099     return !(*this == other);
0100   }
0101   bool operator!=(const RawCalorimeterHit& other) const {
0102     return !(*this == other);
0103   }
0104 
0105   // less comparison operator, so that objects can be e.g. stored in sets.
0106   bool operator<(const MutableRawCalorimeterHit& other) const {
0107     return m_obj < other.m_obj;
0108   }
0109 
0110   podio::ObjectID id() const {
0111     return getObjectID();
0112   }
0113 
0114   const podio::ObjectID getObjectID() const;
0115 
0116   friend void swap(MutableRawCalorimeterHit& a, MutableRawCalorimeterHit& b) {
0117     using std::swap;
0118     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0119   }
0120 
0121 private:
0122   /// constructor from existing RawCalorimeterHitObj
0123   explicit MutableRawCalorimeterHit(podio::utils::MaybeSharedPtr<RawCalorimeterHitObj> obj);
0124 
0125   podio::utils::MaybeSharedPtr<RawCalorimeterHitObj> m_obj{nullptr};
0126 };
0127 
0128 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0129 void to_json(nlohmann::json& j, const MutableRawCalorimeterHit& value);
0130 #endif
0131 
0132 } // namespace edm4hep
0133 
0134 #endif