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_MutableRecIonizationCluster_H
0004 #define EDM4HEP_MutableRecIonizationCluster_H
0005 
0006 #include "edm4hep/RecIonizationClusterObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/RecIonizationCluster.h"
0009 
0010 #include "edm4hep/TrackerPulse.h"
0011 #include "podio/RelationRange.h"
0012 #include <cstdint>
0013 #include <vector>
0014 
0015 #include "podio/utilities/MaybeSharedPtr.h"
0016 
0017 #include <cstdint>
0018 
0019 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0020 #include "nlohmann/json_fwd.hpp"
0021 #endif
0022 
0023 namespace edm4hep {
0024 
0025 /** @class MutableRecIonizationCluster
0026  *  Reconstructed Ionization Cluster
0027  *  @author: Wenxing Fang, IHEP
0028  */
0029 class MutableRecIonizationCluster {
0030 
0031   friend class RecIonizationClusterCollection;
0032   friend class RecIonizationClusterMutableCollectionIterator;
0033   friend class RecIonizationCluster;
0034 
0035 public:
0036   using object_type = RecIonizationCluster;
0037   using collection_type = RecIonizationClusterCollection;
0038 
0039   /// default constructor
0040   MutableRecIonizationCluster();
0041 
0042   /// Constructor initializing all members
0043   MutableRecIonizationCluster(std::uint64_t cellID, float significance, std::int16_t type);
0044 
0045   /// copy constructor
0046   MutableRecIonizationCluster(const MutableRecIonizationCluster& other) = default;
0047 
0048   /// copy-assignment operator
0049   MutableRecIonizationCluster& operator=(MutableRecIonizationCluster 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   MutableRecIonizationCluster clone(bool cloneRelations = true) const;
0054 
0055   /// destructor
0056   ~MutableRecIonizationCluster() = default;
0057 
0058 public:
0059   /// Access the cell id.
0060   std::uint64_t getCellID() const;
0061 
0062   /// Access the significance.
0063   float getSignificance() const;
0064 
0065   /// Access the type.
0066   std::int16_t getType() const;
0067 
0068   /// Set the cell id.
0069   void setCellID(std::uint64_t value);
0070   /// Get mutable reference to cell id.
0071   std::uint64_t& getCellID();
0072   /// Get reference to cell id.
0073   [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0074 
0075   /// Set the significance.
0076   void setSignificance(float value);
0077   /// Get mutable reference to significance.
0078   float& getSignificance();
0079   /// Get reference to significance.
0080   [[deprecated("use getSignificance instead")]] float& significance();
0081 
0082   /// Set the type.
0083   void setType(std::int16_t value);
0084   /// Get mutable reference to type.
0085   std::int16_t& getType();
0086   /// Get reference to type.
0087   [[deprecated("use getType instead")]] std::int16_t& type();
0088 
0089   void addToTrackerPulse(const edm4hep::TrackerPulse&);
0090   std::size_t trackerPulse_size() const;
0091   edm4hep::TrackerPulse getTrackerPulse(std::size_t) const;
0092   std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_begin() const;
0093   std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_end() const;
0094   podio::RelationRange<edm4hep::TrackerPulse> getTrackerPulse() const;
0095 
0096   /// check whether the object is actually available
0097   bool isAvailable() const;
0098   /// disconnect from RecIonizationClusterObj instance
0099   void unlink() {
0100     m_obj = podio::utils::MaybeSharedPtr<RecIonizationClusterObj>{nullptr};
0101   }
0102 
0103   bool operator==(const MutableRecIonizationCluster& other) const {
0104     return m_obj == other.m_obj;
0105   }
0106   bool operator==(const RecIonizationCluster& other) const;
0107 
0108   bool operator!=(const MutableRecIonizationCluster& other) const {
0109     return !(*this == other);
0110   }
0111   bool operator!=(const RecIonizationCluster& other) const {
0112     return !(*this == other);
0113   }
0114 
0115   // less comparison operator, so that objects can be e.g. stored in sets.
0116   bool operator<(const MutableRecIonizationCluster& other) const {
0117     return m_obj < other.m_obj;
0118   }
0119 
0120   podio::ObjectID id() const {
0121     return getObjectID();
0122   }
0123 
0124   const podio::ObjectID getObjectID() const;
0125 
0126   friend void swap(MutableRecIonizationCluster& a, MutableRecIonizationCluster& b) {
0127     using std::swap;
0128     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0129   }
0130 
0131 private:
0132   /// constructor from existing RecIonizationClusterObj
0133   explicit MutableRecIonizationCluster(podio::utils::MaybeSharedPtr<RecIonizationClusterObj> obj);
0134 
0135   podio::utils::MaybeSharedPtr<RecIonizationClusterObj> m_obj{nullptr};
0136 };
0137 
0138 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0139 void to_json(nlohmann::json& j, const MutableRecIonizationCluster& value);
0140 #endif
0141 
0142 } // namespace edm4hep
0143 
0144 #endif