Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_Vertex_H
0004 #define EDM4HEP_Vertex_H
0005 
0006 #include "edm4hep/VertexObj.h"
0007 
0008 #include "edm4hep/Vector3f.h"
0009 #include "podio/RelationRange.h"
0010 #include <array>
0011 #include <cstdint>
0012 #include <vector>
0013 
0014 #include "podio/utilities/MaybeSharedPtr.h"
0015 
0016 #include <cstdint>
0017 #include <ostream>
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 ReconstructedParticle;
0026 class MutableReconstructedParticle;
0027 } // namespace edm4hep
0028 
0029 namespace edm4hep {
0030 
0031 class MutableVertex;
0032 class VertexCollection;
0033 class VertexCollectionData;
0034 
0035 /** @class Vertex
0036  *  Vertex
0037  *  @author: F.Gaede, DESY
0038  */
0039 class Vertex {
0040 
0041   friend class MutableVertex;
0042   friend class VertexCollection;
0043   friend class edm4hep::VertexCollectionData;
0044   friend class VertexCollectionIterator;
0045 
0046 public:
0047   using mutable_type = MutableVertex;
0048   using collection_type = VertexCollection;
0049 
0050   /// default constructor
0051   Vertex();
0052 
0053   /// Constructor initializing all members
0054   Vertex(std::int32_t primary, float chi2, float probability, edm4hep::Vector3f position,
0055          std::array<float, 6> covMatrix, std::int32_t algorithmType);
0056 
0057   /// copy constructor
0058   Vertex(const Vertex& other) = default;
0059 
0060   /// copy-assignment operator
0061   Vertex& operator=(Vertex other);
0062 
0063   /// create a mutable deep-copy of the object with identical relations
0064   /// if cloneRelations=false, the relations are not cloned and will be empty
0065   MutableVertex clone(bool cloneRelations = true) const;
0066 
0067   /// destructor
0068   ~Vertex() = default;
0069 
0070   /// converting constructor from mutable object
0071   Vertex(const MutableVertex& other);
0072 
0073   static Vertex makeEmpty();
0074 
0075 public:
0076   /// Access the boolean flag, if vertex is the primary vertex of the event
0077   std::int32_t getPrimary() const;
0078 
0079   /// Access the chi-squared of the vertex fit
0080   float getChi2() const;
0081 
0082   /// Access the probability of the vertex fit
0083   float getProbability() const;
0084 
0085   /// Access the [mm] position of the vertex.
0086   const edm4hep::Vector3f& getPosition() const;
0087 
0088   /// Access the covariance matrix of the position (stored as lower triangle matrix, i.e.
0089   /// cov(xx),cov(y,x),cov(z,x),cov(y,y),... )
0090   const std::array<float, 6>& getCovMatrix() const;
0091   /// Access item i of the covariance matrix of the position (stored as lower triangle matrix, i.e.
0092   /// cov(xx),cov(y,x),cov(z,x),cov(y,y),... )
0093   float getCovMatrix(size_t i) const;
0094   /// Access the type code for the algorithm that has been used to create the vertex - check/set the collection
0095   /// parameters AlgorithmName and AlgorithmType.
0096   std::int32_t getAlgorithmType() const;
0097 
0098   /// Access the reconstructed particle associated to this vertex.
0099   const edm4hep::ReconstructedParticle getAssociatedParticle() const;
0100 
0101   std::size_t parameters_size() const;
0102   float getParameters(std::size_t) const;
0103   std::vector<float>::const_iterator parameters_begin() const;
0104   std::vector<float>::const_iterator parameters_end() const;
0105   podio::RelationRange<float> getParameters() const;
0106 
0107   /// check whether the object is actually available
0108   bool isAvailable() const;
0109   /// disconnect from VertexObj instance
0110   void unlink() {
0111     m_obj = podio::utils::MaybeSharedPtr<VertexObj>{nullptr};
0112   }
0113 
0114   bool operator==(const Vertex& other) const {
0115     return m_obj == other.m_obj;
0116   }
0117   bool operator==(const MutableVertex& other) const;
0118 
0119   bool operator!=(const Vertex& other) const {
0120     return !(*this == other);
0121   }
0122   bool operator!=(const MutableVertex& other) const {
0123     return !(*this == other);
0124   }
0125 
0126   // less comparison operator, so that objects can be e.g. stored in sets.
0127   bool operator<(const Vertex& other) const {
0128     return m_obj < other.m_obj;
0129   }
0130 
0131   podio::ObjectID id() const {
0132     return getObjectID();
0133   }
0134 
0135   const podio::ObjectID getObjectID() const;
0136 
0137   friend void swap(Vertex& a, Vertex& b) {
0138     using std::swap;
0139     swap(a.m_obj, b.m_obj); // swap out the internal pointers
0140   }
0141 
0142 private:
0143   /// constructor from existing VertexObj
0144   explicit Vertex(podio::utils::MaybeSharedPtr<VertexObj> obj);
0145   Vertex(VertexObj* obj);
0146 
0147   podio::utils::MaybeSharedPtr<VertexObj> m_obj{nullptr};
0148 };
0149 
0150 std::ostream& operator<<(std::ostream& o, const Vertex& value);
0151 
0152 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0153 void to_json(nlohmann::json& j, const Vertex& value);
0154 #endif
0155 
0156 } // namespace edm4hep
0157 
0158 #endif