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_MutableRawTrackerHit_H
0004 #define EDM4EIC_MutableRawTrackerHit_H
0005 
0006 #include "edm4eic/RawTrackerHitObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4eic/RawTrackerHit.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 
0021 
0022 namespace edm4eic {
0023 
0024 
0025 /** @class MutableRawTrackerHit
0026  *  Raw (digitized) tracker hit
0027  *  @author: W. Armstrong, S. Joosten
0028  */
0029 class MutableRawTrackerHit {
0030 
0031   friend class RawTrackerHitCollection;
0032   friend class RawTrackerHitMutableCollectionIterator;
0033   friend class RawTrackerHit;
0034 
0035 public:
0036   using object_type = RawTrackerHit;
0037   using collection_type = RawTrackerHitCollection;
0038 
0039   /// default constructor
0040   MutableRawTrackerHit();
0041 
0042   /// Constructor initializing all members
0043   MutableRawTrackerHit(std::uint64_t cellID, std::int32_t charge, std::int32_t timeStamp);
0044 
0045   /// copy constructor
0046   MutableRawTrackerHit(const MutableRawTrackerHit& other) = default;
0047 
0048   /// copy-assignment operator
0049   MutableRawTrackerHit& operator=(MutableRawTrackerHit other);
0050 
0051   /// create a mutable deep-copy of the object with identical relations
0052   /// if cloneRelations=false, the relations are not cloned and will be empty
0053   MutableRawTrackerHit clone(bool cloneRelations=true) const;
0054 
0055   /// destructor
0056   ~MutableRawTrackerHit() = default;
0057 
0058 
0059 public:
0060 
0061   /// Access the The detector specific (geometrical) cell id.
0062   std::uint64_t getCellID() const;
0063 
0064   /// Access the ADC value
0065   std::int32_t getCharge() const;
0066 
0067   /// Access the TDC value.
0068   std::int32_t getTimeStamp() const;
0069 
0070 
0071 
0072   /// Set the The detector specific (geometrical) cell id.
0073   void setCellID(std::uint64_t value);
0074   /// Get mutable reference to The detector specific (geometrical) cell id.
0075   std::uint64_t& getCellID();
0076   /// Get reference to The detector specific (geometrical) cell id.
0077   [[deprecated("use getCellID instead")]]
0078   std::uint64_t& cellID();
0079 
0080   /// Set the ADC value
0081   void setCharge(std::int32_t value);
0082   /// Get mutable reference to ADC value
0083   std::int32_t& getCharge();
0084   /// Get reference to ADC value
0085   [[deprecated("use getCharge instead")]]
0086   std::int32_t& charge();
0087 
0088   /// Set the TDC value.
0089   void setTimeStamp(std::int32_t value);
0090   /// Get mutable reference to TDC value.
0091   std::int32_t& getTimeStamp();
0092   /// Get reference to TDC value.
0093   [[deprecated("use getTimeStamp instead")]]
0094   std::int32_t& timeStamp();
0095 
0096 
0097 
0098 
0099 
0100 
0101   /// check whether the object is actually available
0102   bool isAvailable() const;
0103   /// disconnect from RawTrackerHitObj instance
0104   void unlink() { m_obj = podio::utils::MaybeSharedPtr<RawTrackerHitObj>{nullptr}; }
0105 
0106   bool operator==(const MutableRawTrackerHit& other) const { return m_obj == other.m_obj; }
0107   bool operator==(const RawTrackerHit& other) const;
0108 
0109   bool operator!=(const MutableRawTrackerHit& other) const { return !(*this == other); }
0110   bool operator!=(const RawTrackerHit& other) const { return !(*this == other); }
0111 
0112   // less comparison operator, so that objects can be e.g. stored in sets.
0113   bool operator<(const MutableRawTrackerHit& other) const { return m_obj < other.m_obj; }
0114 
0115   podio::ObjectID id() const { return getObjectID(); }
0116 
0117   const podio::ObjectID getObjectID() const;
0118 
0119   friend void swap(MutableRawTrackerHit& a, MutableRawTrackerHit& b) {
0120     using std::swap;
0121     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0122   }
0123 
0124 private:
0125   /// constructor from existing RawTrackerHitObj
0126   explicit MutableRawTrackerHit(podio::utils::MaybeSharedPtr<RawTrackerHitObj> obj);
0127 
0128   podio::utils::MaybeSharedPtr<RawTrackerHitObj> m_obj{nullptr};
0129 };
0130 
0131 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0132 void to_json(nlohmann::json& j, const MutableRawTrackerHit& value);
0133 #endif
0134 
0135 
0136 } // namespace edm4eic
0137 
0138 
0139 #endif