Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:35:41

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_MutableCluster_H
0004 #define EDM4HEP_MutableCluster_H
0005 
0006 #include "edm4hep/ClusterObj.h"
0007 // Make the immutable class available from its mutable version but not vice versa
0008 #include "edm4hep/Cluster.h"
0009 
0010 #include "edm4hep/CalorimeterHit.h"
0011 #include "edm4hep/ParticleID.h"
0012 #include "edm4hep/Vector3f.h"
0013 #include "podio/RelationRange.h"
0014 #include <array>
0015 #include <cstdint>
0016 #include <vector>
0017 
0018 #include "podio/utilities/MaybeSharedPtr.h"
0019 
0020 #include <cstddef>
0021 #include <ostream>
0022 
0023 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0024 #include "nlohmann/json_fwd.hpp"
0025 #endif
0026 
0027 namespace edm4hep {
0028 
0029 /** @class MutableCluster
0030  *  Calorimeter Hit Cluster
0031  *  @author: F.Gaede, DESY
0032  */
0033 class MutableCluster {
0034 
0035   friend class ClusterCollection;
0036   friend class ClusterMutableCollectionIterator;
0037   friend class Cluster;
0038 
0039 public:
0040   using object_type = Cluster;
0041   using collection_type = ClusterCollection;
0042 
0043   /// default constructor
0044   MutableCluster();
0045 
0046   /// Constructor initializing all members
0047   MutableCluster(std::int32_t type, float energy, float energyError, edm4hep::Vector3f position,
0048                  std::array<float, 6> positionError, float iTheta, float phi, edm4hep::Vector3f directionError);
0049 
0050   /// copy constructor
0051   MutableCluster(const MutableCluster& other) = default;
0052 
0053   /// copy-assignment operator
0054   MutableCluster& operator=(MutableCluster other);
0055 
0056   /// create a mutable deep-copy of the object with identical relations
0057   MutableCluster clone() const;
0058 
0059   /// destructor
0060   ~MutableCluster() = default;
0061 
0062   /// conversion to const object
0063   operator Cluster() const;
0064 
0065 public:
0066   /// Access the flagword that defines the type of cluster. Bits 16-31 are used internally.
0067   std::int32_t getType() const;
0068 
0069   /// Access the energy of the cluster [GeV]
0070   float getEnergy() const;
0071 
0072   /// Access the error on the energy
0073   float getEnergyError() const;
0074 
0075   /// Access the position of the cluster [mm]
0076   const edm4hep::Vector3f& getPosition() const;
0077 
0078   /// Access the covariance matrix of the position (6 Parameters)
0079   const std::array<float, 6>& getPositionError() const;
0080   /// Access item i of the covariance matrix of the position (6 Parameters)
0081   float getPositionError(size_t i) const;
0082   /// Access the intrinsic direction of cluster at position  Theta. Not to be confused with direction cluster is seen
0083   /// from IP.
0084   float getITheta() const;
0085 
0086   /// Access the intrinsic direction of cluster at position - Phi. Not to be confused with direction cluster is seen
0087   /// from IP.
0088   float getPhi() const;
0089 
0090   /// Access the covariance matrix of the direction (3 Parameters) [mm^2]
0091   const edm4hep::Vector3f& getDirectionError() const;
0092 
0093   /// Set the flagword that defines the type of cluster. Bits 16-31 are used internally.
0094   void setType(std::int32_t value);
0095 
0096   /// Set the energy of the cluster [GeV]
0097   void setEnergy(float value);
0098 
0099   /// Set the error on the energy
0100   void setEnergyError(float value);
0101 
0102   /// Set the position of the cluster [mm]
0103   void setPosition(edm4hep::Vector3f value);
0104   /// Get reference to position of the cluster [mm]
0105   edm4hep::Vector3f& position();
0106 
0107   /// Set the covariance matrix of the position (6 Parameters)
0108   void setPositionError(std::array<float, 6> value);
0109   void setPositionError(size_t i, float value);
0110   /// Get reference to covariance matrix of the position (6 Parameters)
0111   std::array<float, 6>& positionError();
0112 
0113   /// Set the intrinsic direction of cluster at position  Theta. Not to be confused with direction cluster is seen from
0114   /// IP.
0115   void setITheta(float value);
0116 
0117   /// Set the intrinsic direction of cluster at position - Phi. Not to be confused with direction cluster is seen from
0118   /// IP.
0119   void setPhi(float value);
0120 
0121   /// Set the covariance matrix of the direction (3 Parameters) [mm^2]
0122   void setDirectionError(edm4hep::Vector3f value);
0123   /// Get reference to covariance matrix of the direction (3 Parameters) [mm^2]
0124   edm4hep::Vector3f& directionError();
0125 
0126   void addToClusters(edm4hep::Cluster);
0127   std::size_t clusters_size() const;
0128   edm4hep::Cluster getClusters(std::size_t) const;
0129   std::vector<edm4hep::Cluster>::const_iterator clusters_begin() const;
0130   std::vector<edm4hep::Cluster>::const_iterator clusters_end() const;
0131   podio::RelationRange<edm4hep::Cluster> getClusters() const;
0132   void addToHits(edm4hep::CalorimeterHit);
0133   std::size_t hits_size() const;
0134   edm4hep::CalorimeterHit getHits(std::size_t) const;
0135   std::vector<edm4hep::CalorimeterHit>::const_iterator hits_begin() const;
0136   std::vector<edm4hep::CalorimeterHit>::const_iterator hits_end() const;
0137   podio::RelationRange<edm4hep::CalorimeterHit> getHits() const;
0138   void addToParticleIDs(edm4hep::ParticleID);
0139   std::size_t particleIDs_size() const;
0140   edm4hep::ParticleID getParticleIDs(std::size_t) const;
0141   std::vector<edm4hep::ParticleID>::const_iterator particleIDs_begin() const;
0142   std::vector<edm4hep::ParticleID>::const_iterator particleIDs_end() const;
0143   podio::RelationRange<edm4hep::ParticleID> getParticleIDs() const;
0144   void addToShapeParameters(float);
0145   std::size_t shapeParameters_size() const;
0146   float getShapeParameters(std::size_t) const;
0147   std::vector<float>::const_iterator shapeParameters_begin() const;
0148   std::vector<float>::const_iterator shapeParameters_end() const;
0149   podio::RelationRange<float> getShapeParameters() const;
0150   void addToSubdetectorEnergies(float);
0151   std::size_t subdetectorEnergies_size() const;
0152   float getSubdetectorEnergies(std::size_t) const;
0153   std::vector<float>::const_iterator subdetectorEnergies_begin() const;
0154   std::vector<float>::const_iterator subdetectorEnergies_end() const;
0155   podio::RelationRange<float> getSubdetectorEnergies() const;
0156 
0157   /// check whether the object is actually available
0158   bool isAvailable() const;
0159   /// disconnect from ClusterObj instance
0160   void unlink() {
0161     m_obj = podio::utils::MaybeSharedPtr<ClusterObj>{nullptr};
0162   }
0163 
0164   bool operator==(const MutableCluster& other) const {
0165     return m_obj == other.m_obj;
0166   }
0167   bool operator==(const Cluster& other) const;
0168 
0169   // less comparison operator, so that objects can be e.g. stored in sets.
0170   bool operator<(const MutableCluster& other) const {
0171     return m_obj < other.m_obj;
0172   }
0173 
0174   podio::ObjectID id() const {
0175     return getObjectID();
0176   }
0177 
0178   const podio::ObjectID getObjectID() const;
0179 
0180   friend void swap(MutableCluster& a, MutableCluster& b) {
0181     using std::swap;
0182     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0183   }
0184 
0185 private:
0186   /// constructor from existing ClusterObj
0187   explicit MutableCluster(podio::utils::MaybeSharedPtr<ClusterObj> obj);
0188 
0189   podio::utils::MaybeSharedPtr<ClusterObj> m_obj{nullptr};
0190 };
0191 
0192 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0193 void to_json(nlohmann::json& j, const MutableCluster& value);
0194 #endif
0195 
0196 } // namespace edm4hep
0197 
0198 #endif