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_MutableSimPrimaryIonizationCluster_H
0004 #define EDM4HEP_MutableSimPrimaryIonizationCluster_H
0005 
0006 #include "edm4hep/SimPrimaryIonizationClusterObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/SimPrimaryIonizationCluster.h"
0009 
0010 #include "edm4hep/Vector3d.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 // forward declarations
0024 namespace edm4hep {
0025 class MCParticle;
0026 class MutableMCParticle;
0027 } // namespace edm4hep
0028 
0029 namespace edm4hep {
0030 
0031 /** @class MutableSimPrimaryIonizationCluster
0032  *  Simulated Primary Ionization
0033  *  @author: Wenxing Fang, IHEP
0034  */
0035 class MutableSimPrimaryIonizationCluster {
0036 
0037   friend class SimPrimaryIonizationClusterCollection;
0038   friend class SimPrimaryIonizationClusterMutableCollectionIterator;
0039   friend class SimPrimaryIonizationCluster;
0040 
0041 public:
0042   using object_type = SimPrimaryIonizationCluster;
0043   using collection_type = SimPrimaryIonizationClusterCollection;
0044 
0045   /// default constructor
0046   MutableSimPrimaryIonizationCluster();
0047 
0048   /// Constructor initializing all members
0049   MutableSimPrimaryIonizationCluster(std::uint64_t cellID, float time, edm4hep::Vector3d position, std::int16_t type);
0050 
0051   /// copy constructor
0052   MutableSimPrimaryIonizationCluster(const MutableSimPrimaryIonizationCluster& other) = default;
0053 
0054   /// copy-assignment operator
0055   MutableSimPrimaryIonizationCluster& operator=(MutableSimPrimaryIonizationCluster 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   MutableSimPrimaryIonizationCluster clone(bool cloneRelations = true) const;
0060 
0061   /// destructor
0062   ~MutableSimPrimaryIonizationCluster() = default;
0063 
0064 public:
0065   /// Access the cell id.
0066   std::uint64_t getCellID() const;
0067 
0068   /// Access the the primary ionization's time in the lab frame [ns].
0069   float getTime() const;
0070 
0071   /// Access the the primary ionization's position [mm].
0072   const edm4hep::Vector3d& getPosition() const;
0073 
0074   /// Access the type.
0075   std::int16_t getType() const;
0076 
0077   /// Access the the particle that caused the ionizing collisions.
0078   const edm4hep::MCParticle getMCParticle() const;
0079 
0080   /// Set the cell id.
0081   void setCellID(std::uint64_t value);
0082   /// Get mutable reference to cell id.
0083   std::uint64_t& getCellID();
0084   /// Get reference to cell id.
0085   [[deprecated("use getCellID instead")]] std::uint64_t& cellID();
0086 
0087   /// Set the the primary ionization's time in the lab frame [ns].
0088   void setTime(float value);
0089   /// Get mutable reference to the primary ionization's time in the lab frame [ns].
0090   float& getTime();
0091   /// Get reference to the primary ionization's time in the lab frame [ns].
0092   [[deprecated("use getTime instead")]] float& time();
0093 
0094   /// Set the the primary ionization's position [mm].
0095   void setPosition(edm4hep::Vector3d value);
0096   /// Get mutable reference to the primary ionization's position [mm].
0097   edm4hep::Vector3d& getPosition();
0098   /// Get reference to the primary ionization's position [mm].
0099   [[deprecated("use getPosition instead")]] edm4hep::Vector3d& position();
0100 
0101   /// Set the type.
0102   void setType(std::int16_t value);
0103   /// Get mutable reference to type.
0104   std::int16_t& getType();
0105   /// Get reference to type.
0106   [[deprecated("use getType instead")]] std::int16_t& type();
0107 
0108   /// Set the the particle that caused the ionizing collisions.
0109   void setMCParticle(const edm4hep::MCParticle& value);
0110 
0111   void addToElectronCellID(const std::uint64_t&);
0112   std::size_t electronCellID_size() const;
0113   std::uint64_t getElectronCellID(std::size_t) const;
0114   std::vector<std::uint64_t>::const_iterator electronCellID_begin() const;
0115   std::vector<std::uint64_t>::const_iterator electronCellID_end() const;
0116   podio::RelationRange<std::uint64_t> getElectronCellID() const;
0117   void addToElectronTime(const float&);
0118   std::size_t electronTime_size() const;
0119   float getElectronTime(std::size_t) const;
0120   std::vector<float>::const_iterator electronTime_begin() const;
0121   std::vector<float>::const_iterator electronTime_end() const;
0122   podio::RelationRange<float> getElectronTime() const;
0123   void addToElectronPosition(const edm4hep::Vector3d&);
0124   std::size_t electronPosition_size() const;
0125   edm4hep::Vector3d getElectronPosition(std::size_t) const;
0126   std::vector<edm4hep::Vector3d>::const_iterator electronPosition_begin() const;
0127   std::vector<edm4hep::Vector3d>::const_iterator electronPosition_end() const;
0128   podio::RelationRange<edm4hep::Vector3d> getElectronPosition() const;
0129   void addToPulseTime(const float&);
0130   std::size_t pulseTime_size() const;
0131   float getPulseTime(std::size_t) const;
0132   std::vector<float>::const_iterator pulseTime_begin() const;
0133   std::vector<float>::const_iterator pulseTime_end() const;
0134   podio::RelationRange<float> getPulseTime() const;
0135   void addToPulseAmplitude(const float&);
0136   std::size_t pulseAmplitude_size() const;
0137   float getPulseAmplitude(std::size_t) const;
0138   std::vector<float>::const_iterator pulseAmplitude_begin() const;
0139   std::vector<float>::const_iterator pulseAmplitude_end() const;
0140   podio::RelationRange<float> getPulseAmplitude() const;
0141 
0142   /// check whether the object is actually available
0143   bool isAvailable() const;
0144   /// disconnect from SimPrimaryIonizationClusterObj instance
0145   void unlink() {
0146     m_obj = podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj>{nullptr};
0147   }
0148 
0149   bool operator==(const MutableSimPrimaryIonizationCluster& other) const {
0150     return m_obj == other.m_obj;
0151   }
0152   bool operator==(const SimPrimaryIonizationCluster& other) const;
0153 
0154   bool operator!=(const MutableSimPrimaryIonizationCluster& other) const {
0155     return !(*this == other);
0156   }
0157   bool operator!=(const SimPrimaryIonizationCluster& other) const {
0158     return !(*this == other);
0159   }
0160 
0161   // less comparison operator, so that objects can be e.g. stored in sets.
0162   bool operator<(const MutableSimPrimaryIonizationCluster& other) const {
0163     return m_obj < other.m_obj;
0164   }
0165 
0166   podio::ObjectID id() const {
0167     return getObjectID();
0168   }
0169 
0170   const podio::ObjectID getObjectID() const;
0171 
0172   friend void swap(MutableSimPrimaryIonizationCluster& a, MutableSimPrimaryIonizationCluster& b) {
0173     using std::swap;
0174     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0175   }
0176 
0177 private:
0178   /// constructor from existing SimPrimaryIonizationClusterObj
0179   explicit MutableSimPrimaryIonizationCluster(podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj> obj);
0180 
0181   podio::utils::MaybeSharedPtr<SimPrimaryIonizationClusterObj> m_obj{nullptr};
0182 };
0183 
0184 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0185 void to_json(nlohmann::json& j, const MutableSimPrimaryIonizationCluster& value);
0186 #endif
0187 
0188 } // namespace edm4hep
0189 
0190 #endif