/** @file CbmVertex.h ** @author V.Friese **/ #ifndef CBMVERTEX_H #define CBMVERTEX_H 1 #include #include "TMatrixFSym.h" #include "TNamed.h" #include "TVector3.h" /** @class CbmVertex ** @brief Data class for a vertex in CBM. ** @author V. Friese ** @version 2.0 **/ class CbmVertex : public TNamed { public: /** Default constructor **/ CbmVertex(); /** Constructor with name and title ** @param name Vertex name ** @param title Vertex title **/ CbmVertex(const char* name, const char* title); /** Constructor with all member variables ** @param name Name of object ** @param title Title of object ** @param x x coordinate [cm] ** @param y y coordinate [cm] ** @param z z coordinate [cm] ** @param chi2 chi square of vertex fit ** @param ndf Number of degrees of freedom of vertex fit ** @param nTracks Number of tracks used for vertex fit ** @param covMat Covariance Matrix (symmetric, 3x3) **/ CbmVertex(const char* name, const char* title, Double_t x, Double_t y, Double_t z, Double_t chi2, Int_t ndf, Int_t nTracks, const TMatrixFSym& covMat); /** Destructor **/ virtual ~CbmVertex(); /** x coordinate ** value x coordinate of vertex [cm] **/ Double_t GetX() const { return fX; } /** y coordinate ** value y coordinate of vertex [cm] **/ Double_t GetY() const { return fY; } /** z coordinate ** value z coordinate of vertex [cm] **/ Double_t GetZ() const { return fZ; } /** chi square ** @value chi square of vertex fit **/ Double_t GetChi2() const { return fChi2; } /** Degrees-of-freedom ** value Number of degrees-of-freedom for vertex fit **/ Int_t GetNDF() const { return fNDF; } /** Number of tracks used for the vertex fit ** @value Number of tracks used for the vertex fit **/ Int_t GetNTracks() const { return fNTracks; } ; /** Vertex position ** @param[out] Vertex position vector */ void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); } /** Covariance matrix ** @param[out] Covariance matrix **/ void CovMatrix(TMatrixFSym& covMat) const { covMat = fCovMatrix; } /** Covariance matrix elements ** @param i Matrix row index ** @param j Matrix column index ** @value Covariance matrix element (i,j) **/ Double_t GetCovariance(Int_t i, Int_t j) const { return fCovMatrix(i, j); } /** Reset the member variables **/ void Reset(); /** Set the member variables ** @param x x coordinate [cm] ** @param y y coordinate [cm] ** @param z z coordinate [cm] ** @param chi2 chi square of vertex fit ** @param ndf Number of degrees of freedom of vertex fit ** @param nTracks Number of tracks used for vertex fit ** @param covMat Covariance Matrix (symmetric, 3x3) **/ void SetVertex(Double_t x, Double_t y, Double_t z, Double_t chi2, Int_t ndf, Int_t nTracks, const TMatrixFSym& covMat); /** String output **/ virtual std::string ToString() const; private: /** Position coordinates [cm] **/ Double32_t fX, fY, fZ; /** Chi2 of vertex fit **/ Double32_t fChi2; /** Number of degrees of freedom of vertex fit **/ Int_t fNDF; /** Number of tracks used for the vertex fit **/ Int_t fNTracks; /** Covariance matrix for x, y, and z stored in an array. The ** sequence is a[0,0], a[0,1], a[0,2], a[1,1], a[1,2], a[2,2] **/ TMatrixFSym fCovMatrix; ClassDef(CbmVertex,2); }; #endif