//******************************************************* // Class: Vertex // // Author: Meenakshi Narain // // Purpose: Definition of Primary and Secondary Interaction vertices // This is the output of VertexReco // // Date : 12-FEB-1998 : Creation // 01-DEC-1998 : remove some attributes (vertex type and name) // 02-DEC-1998 : Add outputVertex method //******************************************************* #ifndef VERTEX_H #define VERTEX_H #include #include #include #include #include "edm/LinkIndex.hpp" #ifndef __CINT__ #include "LinearAlgebra/Matrix.h" #include "LinearAlgebra/ColumnVector.h" #endif namespace edm{class ChunkID;} class GTrack; //using namespace std; /** Vertex class. This class contains the information about a fitted vertex. */ namespace vertex { class Vertex { public: /**@name Methods */ //@{ /// VertexIndex typedef edm::LinkIndex VertexIndex; /// GTrack Indices typedef edm::LinkIndex GTrackIndex; typedef std::vector GTrackIndices; /// Default Constructor Vertex(); /// Copy Constructor Vertex(const Vertex &); #ifndef __CINT__ /// Full constructor defining all the vertex attributes Vertex(ColumnVector* vertexpos, Matrix* ematrixvertexpos, double chisq, int ndof, int ntrk, std::vector trackIDs); #endif ///Destructor ~Vertex(); #ifndef __CINT__ /// Retrieve the position of this vertex (data must be active) const ColumnVector& get_vertexpos() const; ColumnVector get_vertexpos2() const; /// Retrieve the error matrix (data must be active) const Matrix& get_ematrixvertexpos() const; Matrix get_ematrixvertexpos2() const; #endif /// Get the $\chi^2$ of the vertex fit double get_chisqvertex() const; /// Get the number of degrees of freedom int get_numdof() const; /// Return the number of attached tracks int get_trkcount() const; /// Return indices of the {\bf GTrack} objects associated with this {\bf Vertex} object std::vector get_trackIDs() const; /// set Gtrack LinkIndices void add_trackIndex(GTrackIndex& trkid); /// return link indixecs to GTrack GTrackIndices get_trackIndices() const; /// return an identifying index VertexIndex index() const; /// set own LinkIndex void setLinkIndex(edm::ChunkID cid, int indx) const; /// complete all Links in object void completeLinks(const edm::AbsChunk* c) const; /// Print essential information in Vertex to stream void outputVertex(std::ostream& out) const; /// Print the content of this vertex friend std::ostream& operator<<(std::ostream& os, const Vertex& vertex); /// Construct active data and delete persistent data. // Either active or persistent data should be present. // Active data is not constructed if it is already present. // Called by d0om immediately after persistent data is read in. void activate(); /// Construct persistent data. // Either active or persistent data should be present. // Persistent data is not constructed if it is already present. // Called by d0om before data is written. void deactivate() const; /// Return if the active data is present. bool is_active() const; /// Return if the persistent data is present. bool is_persistent() const; //@} protected: /**@name Attributes */ //@{ #ifndef __CINT__ /// The vertex position (in transient form) mutable ColumnVector _vertexpos; //!transient /// The error matrix (in transient form) mutable Matrix _ematrixvertexpos; //!transient /// The $\chi^2$ of the vertex fit #endif double _chisqvertex; /// The number of degrees of freedom int _numdof; /// The number of attached tracks int _trkcount; /// Indices of the {\bf GTrack} object associated with this {\bf Vertex} object std::vector _trackIDs; /// Vertex Index mutable VertexIndex _index; //! transient /// Link indices for GTracks associated with this vertex GTrackIndices _trackIndices; /// Flag indicating that active data are present. mutable bool _active; //! transient /// Flag indicating that persistent data are present. mutable bool _persistent; //! transient /// The persistent vertex position mutable std::vector _vertexpos_vector; /// The persistent vertex error matrix mutable std::vector _vertexpos_errors; //@} }; //external functions bool operator==(const Vertex& v1, const Vertex& v2); //AS bool operator!=(const Vertex& v1, const Vertex& v2); //AS bool operator< (const Vertex& v1, const Vertex& v2 ); //AS } #endif