// ******************************************************* // 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 // 08-AUG-2001 : Thumbnail unpacker (S. Baffioni) // 28-Oct-2001 : Add initial vertex index (A.S) // 28-Oct-2001 : Add parent vertex index (A.S) // 15-NOV-2001 : Add Momentum (A.S) // ******************************************************* #ifndef VERTEX_H #define VERTEX_H /** Vertex class. This class contains the information about a fitted vertex. */ #include "edm/LinkIndex.hpp" #ifndef __CINT__ #include "LinearAlgebra/Matrix.h" #include "LinearAlgebra/ColumnVector.h" #endif #include "vertexutil/VtxTmbObj.hpp" class GTrack; namespace vertex { class Vertex { friend class VtxTmbObj; 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, GTrackIndices trackIDs); // Vertex(ColumnVector* vertexpos, Matrix* ematrixvertexpos, // ColumnVector* momentum, Matrix* momentumError, double mass, // double massError, double chisq, int ndof, int ntrk, // GTrackIndices trackIDs); Vertex(ColumnVector* vertexpos, Matrix* ematrixvertexpos, double chisq, int ndof, int ntrk, GTrackIndices trackIDs, double prob = -1.0); Vertex(ColumnVector* vertexpos, Matrix* ematrixvertexpos, ColumnVector* momentum, Matrix* momentumError, double mass, double massError, double chisq, int ndof, int ntrk, GTrackIndices trackIDs, double prob = -1.0); #endif ///Destructor ~Vertex(); // Information for Thumbnail #ifndef __CINT__ /// return ThumbNail information VtxTmbObj getThumbNail() const; /// unpack ThumbNail information void unpThumbNail(const VtxTmbObj* tmbptr); #endif /// unpack ThumbNail information void unpThumbNail(kinem::TmbObj& tmbobj); #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; /// Momentum const ColumnVector& get_momentum() const; const Matrix& get_momentumError() const; double Prob() const; void Prob(double prob); double mass() const; double massError() const; void set_momentum(ColumnVector& aMomentum); void set_momentumError(Matrix& aMomentumError); void set_mass(double aMass); void set_massError(double anError); #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; /// decay length void decayLength(vertex::Vertex& primary, double& Lxy, double& sigmaLxy, double& Lz, double& sigmaLz, double phiJet = 0.0); /// set Gtrack LinkIndices void add_trackIndex(GTrackIndex& trkid); /// return a vector of LinkIndices to GTrack GTrackIndices get_trackIndices() const; /// return an identifying index VertexIndex index() const; /// set index of initial vertex void initialVertexIndex(int anInteger); /// return index of initial vertex int get_initialVertexIndex() const; /// set index of parent vertex void parentVertexIndex(int anInteger); /// return index of parent vertex int get_parentVertexIndex() const; /// return mass of the vertex double get_mass() const; double get_massError() 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; /// Return version number int version() const {return _version;} //@} 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 vertex momentum (in transient form) mutable ColumnVector _momentum; //!transient /// The error matrix (in transient form) mutable Matrix _momentumError; //!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; /// index of initial vertex int _initialVertexIndex; /// index of parent vertex int _parentVertexIndex; /// Vertex Index mutable VertexIndex _index; //! transient /// Link indices for GTracks associated with this vertex GTrackIndices _trackIndices; /// double _mass; double _emass; /// 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; /// The persistent momentum mutable std::vector _momentum_vector; /// The persistent momentum error mutable std::vector _momentum_error; int _version; double _prob; //@} }; //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