Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:56

0001 /**
0002  *  @file   PandoraSDK/include/Objects/Vertex.h
0003  * 
0004  *  @brief  Header file for the vertex class.
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_VERTEX_H
0009 #define PANDORA_VERTEX_H 1
0010 
0011 #include "Pandora/ObjectCreation.h"
0012 #include "Pandora/StatusCodes.h"
0013 
0014 namespace pandora
0015 {
0016 
0017 template<typename T> class AlgorithmObjectManager;
0018 template<typename T, typename S> class PandoraObjectFactory;
0019 
0020 //------------------------------------------------------------------------------------------------------------------------------------------
0021 
0022 /**
0023  *  @brief  Vertex class
0024  */
0025 class Vertex
0026 {
0027 public:
0028     /**
0029      *  @brief  Get the vertex position
0030      * 
0031      *  @return the vertex position
0032      */
0033     const CartesianVector &GetPosition() const;
0034 
0035     /**
0036      *  @brief  For LArTPC usage, the x-coordinate shift associated with a drift time t0 shift, units mm
0037      * 
0038      *  @return the x-coordinate shift
0039      */
0040     float GetX0() const;
0041 
0042     /**
0043      *  @brief  Get the vertex label
0044      * 
0045      *  @return the vertex label
0046      */
0047     VertexLabel GetVertexLabel() const;
0048 
0049     /**
0050      *  @brief  Get the vertex type
0051      * 
0052      *  @return the vertex type
0053      */
0054     VertexType GetVertexType() const;
0055 
0056     /**
0057      *  @brief  Whether the vertex is available to be added to a particle flow object
0058      * 
0059      *  @return boolean
0060      */
0061     bool IsAvailable() const;
0062 
0063 protected:
0064     /**
0065      *  @brief  Constructor
0066      * 
0067      *  @param  parameters the vertex parameters
0068      */
0069     Vertex(const object_creation::Vertex::Parameters &parameters);
0070 
0071     /**
0072      *  @brief  Destructor
0073      */
0074     virtual ~Vertex();
0075 
0076     /**
0077      *  @brief  Alter the metadata information stored in a vertex
0078      * 
0079      *  @param  metaData the metadata (only populated metadata fields will be propagated to the object)
0080      */
0081     StatusCode AlterMetadata(const object_creation::Vertex::Metadata &metadata);
0082 
0083     /**
0084      *  @brief  Set availability of vertex to be added to a particle flow object
0085      * 
0086      *  @param  isAvailable the vertex availability
0087      */
0088     void SetAvailability(bool isAvailable);
0089 
0090     CartesianVector         m_position;                 ///< The vertex position
0091     float                   m_x0;                       ///< For LArTPC usage, the x-coordinate shift associated with a drift time t0 shift, units mm
0092     VertexLabel             m_vertexLabel;              ///< The vertex label (interaction, start, end, etc.)
0093     VertexType              m_vertexType;               ///< The vertex type (3d, view u, v, w, etc.)
0094     bool                    m_isAvailable;              ///< Whether the track is available to be added to a particle flow object
0095 
0096     friend class VertexManager;
0097     friend class AlgorithmObjectManager<Vertex>;
0098     friend class PandoraObjectFactory<object_creation::Vertex::Parameters, object_creation::Vertex::Object>;
0099 };
0100 
0101 //------------------------------------------------------------------------------------------------------------------------------------------
0102 
0103 inline const CartesianVector &Vertex::GetPosition() const
0104 {
0105     return m_position;
0106 }
0107 
0108 //------------------------------------------------------------------------------------------------------------------------------------------
0109 
0110 inline float Vertex::GetX0() const
0111 {
0112     return m_x0;
0113 }
0114 
0115 //------------------------------------------------------------------------------------------------------------------------------------------
0116 
0117 inline VertexLabel Vertex::GetVertexLabel() const
0118 {
0119     return m_vertexLabel;
0120 }
0121 
0122 //------------------------------------------------------------------------------------------------------------------------------------------
0123 
0124 inline VertexType Vertex::GetVertexType() const
0125 {
0126     return m_vertexType;
0127 }
0128 
0129 //------------------------------------------------------------------------------------------------------------------------------------------
0130 
0131 inline bool Vertex::IsAvailable() const
0132 {
0133     return m_isAvailable;
0134 }
0135 
0136 //------------------------------------------------------------------------------------------------------------------------------------------
0137 
0138 inline void Vertex::SetAvailability(bool isAvailable)
0139 {
0140     m_isAvailable = isAvailable;
0141 }
0142 
0143 } // namespace pandora
0144 
0145 #endif // #ifndef PANDORA_VERTEX_H