Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_RecIonizationCluster_H
0004 #define EDM4HEP_RecIonizationCluster_H
0005 
0006 #include "edm4hep/RecIonizationClusterObj.h"
0007 
0008 #include "edm4hep/TrackerPulse.h"
0009 #include "podio/RelationRange.h"
0010 #include <cstdint>
0011 #include <vector>
0012 
0013 #include "podio/utilities/MaybeSharedPtr.h"
0014 
0015 #include <cstdint>
0016 #include <ostream>
0017 
0018 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0019 #include "nlohmann/json_fwd.hpp"
0020 #endif
0021 
0022 namespace edm4hep {
0023 
0024 class MutableRecIonizationCluster;
0025 class RecIonizationClusterCollection;
0026 class RecIonizationClusterCollectionData;
0027 
0028 /** @class RecIonizationCluster
0029  *  Reconstructed Ionization Cluster
0030  *  @author: Wenxing Fang, IHEP
0031  */
0032 class RecIonizationCluster {
0033 
0034   friend class MutableRecIonizationCluster;
0035   friend class RecIonizationClusterCollection;
0036   friend class edm4hep::RecIonizationClusterCollectionData;
0037   friend class RecIonizationClusterCollectionIterator;
0038 
0039 public:
0040   using mutable_type = MutableRecIonizationCluster;
0041   using collection_type = RecIonizationClusterCollection;
0042 
0043   /// default constructor
0044   RecIonizationCluster();
0045 
0046   /// Constructor initializing all members
0047   RecIonizationCluster(std::uint64_t cellID, float significance, std::int16_t type);
0048 
0049   /// copy constructor
0050   RecIonizationCluster(const RecIonizationCluster& other) = default;
0051 
0052   /// copy-assignment operator
0053   RecIonizationCluster& operator=(RecIonizationCluster other);
0054 
0055   /// create a mutable deep-copy of the object with identical relations
0056   /// if cloneRelations=false, the relations are not cloned and will be empty
0057   MutableRecIonizationCluster clone(bool cloneRelations = true) const;
0058 
0059   /// destructor
0060   ~RecIonizationCluster() = default;
0061 
0062   /// converting constructor from mutable object
0063   RecIonizationCluster(const MutableRecIonizationCluster& other);
0064 
0065   static RecIonizationCluster makeEmpty();
0066 
0067 public:
0068   /// Access the cell id.
0069   std::uint64_t getCellID() const;
0070 
0071   /// Access the significance.
0072   float getSignificance() const;
0073 
0074   /// Access the type.
0075   std::int16_t getType() const;
0076 
0077   std::size_t trackerPulse_size() const;
0078   edm4hep::TrackerPulse getTrackerPulse(std::size_t) const;
0079   std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_begin() const;
0080   std::vector<edm4hep::TrackerPulse>::const_iterator trackerPulse_end() const;
0081   podio::RelationRange<edm4hep::TrackerPulse> getTrackerPulse() const;
0082 
0083   /// check whether the object is actually available
0084   bool isAvailable() const;
0085   /// disconnect from RecIonizationClusterObj instance
0086   void unlink() {
0087     m_obj = podio::utils::MaybeSharedPtr<RecIonizationClusterObj>{nullptr};
0088   }
0089 
0090   bool operator==(const RecIonizationCluster& other) const {
0091     return m_obj == other.m_obj;
0092   }
0093   bool operator==(const MutableRecIonizationCluster& other) const;
0094 
0095   bool operator!=(const RecIonizationCluster& other) const {
0096     return !(*this == other);
0097   }
0098   bool operator!=(const MutableRecIonizationCluster& other) const {
0099     return !(*this == other);
0100   }
0101 
0102   // less comparison operator, so that objects can be e.g. stored in sets.
0103   bool operator<(const RecIonizationCluster& other) const {
0104     return m_obj < other.m_obj;
0105   }
0106 
0107   podio::ObjectID id() const {
0108     return getObjectID();
0109   }
0110 
0111   const podio::ObjectID getObjectID() const;
0112 
0113   friend void swap(RecIonizationCluster& a, RecIonizationCluster& b) {
0114     using std::swap;
0115     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0116   }
0117 
0118 private:
0119   /// constructor from existing RecIonizationClusterObj
0120   explicit RecIonizationCluster(podio::utils::MaybeSharedPtr<RecIonizationClusterObj> obj);
0121   RecIonizationCluster(RecIonizationClusterObj* obj);
0122 
0123   podio::utils::MaybeSharedPtr<RecIonizationClusterObj> m_obj{nullptr};
0124 };
0125 
0126 std::ostream& operator<<(std::ostream& o, const RecIonizationCluster& value);
0127 
0128 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0129 void to_json(nlohmann::json& j, const RecIonizationCluster& value);
0130 #endif
0131 
0132 } // namespace edm4hep
0133 
0134 #endif