MpdVertex.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // -------------------------------------------------------------------------
  2. // ----- MpdVertex header file -----
  3. // ----- Created 10/07/09 by A. Zinchenko -----
  4. // -------------------------------------------------------------------------
  5. /** MpdVertex.h
  6. *@author A.Zinchenko <Alexander.Zinchenko@jinr.ru>
  7. **
  8. ** Data class for a vertex in MPD (adapted from CBM).
  9. ** Data level: RECO
  10. **/
  11. #ifndef MPDVERTEX_H
  12. #define MPDVERTEX_H 1
  13. #include "TArrayI.h"
  14. #include "TMatrixFSym.h"
  15. #include "TNamed.h"
  16. #include "TVector3.h"
  17. class MpdVertex : public TNamed
  18. {
  19. public:
  20. /** Default constructor **/
  21. MpdVertex();
  22. /** Constructor with name and title **/
  23. MpdVertex(const char* name, const char* title);
  24. /** Constructor with all member variables
  25. *@param name Name of object
  26. *@param title Title of object
  27. *@param x x coordinate [cm]
  28. *@param y y coordinate [cm]
  29. *@param z z coordinate [cm]
  30. *@param chi2 chi square of vertex fit
  31. *@param ndf Number of degrees of freedom of vertex fit
  32. *@param nTracks Number of tracks used for vertex fit
  33. *@param covMat Covariance Matrix (symmetric, 3x3)
  34. **/
  35. MpdVertex(const char* name, const char* title,
  36. Double_t x, Double_t y, Double_t z, Double_t chi2,
  37. Int_t ndf, Int_t nTracks, const TMatrixFSym& covMat);
  38. MpdVertex(const MpdVertex& vert); ///< copy constructor
  39. MpdVertex& operator= (const MpdVertex& vert); ///< assignment operator
  40. /** Destructor **/
  41. virtual ~MpdVertex();
  42. /** Ouput to screen **/
  43. void Print();
  44. /** Accessors **/
  45. Double_t GetX() const { return fX; }; // x position [cm]
  46. Double_t GetY() const { return fY; }; // y position [cm]
  47. Double_t GetZ() const { return fZ; }; // z posiiton [cm]
  48. Double_t GetChi2() const { return fChi2; }; // chi2
  49. Int_t GetNDF() const { return fNDF; }; // nof degrees of freedom
  50. Int_t GetNTracks() const { return fNTracks; }; // nof tracks used
  51. void Position(TVector3& pos) const { pos.SetXYZ(fX,fY,fZ); }
  52. void CovMatrix(TMatrixFSym& covMat) const;
  53. Double_t GetCovariance(Int_t i, Int_t j) const;
  54. TArrayI* GetIndices() { return fTrInd; }
  55. /** Set the member variables
  56. *@param x x coordinate [cm]
  57. *@param y y coordinate [cm]
  58. *@param z z coordinate [cm]
  59. *@param chi2 chi square of vertex fit
  60. *@param ndf Number of degrees of freedom of vertex fit
  61. *@param nTracks Number of tracks used for vertex fit
  62. *@param covMat Covariance Matrix (symmetric, 3x3)
  63. **/
  64. void SetVertex(Double_t x, Double_t y, Double_t z, Double_t chi2,
  65. Int_t ndf, Int_t nTracks, const TMatrixFSym& covMat);
  66. void SetIndices(TArrayI *inds) { *fTrInd = *inds; } // set track indices
  67. void SetCovMatrix(const Double_t *array)
  68. { Int_t iii = 0;
  69. for (Int_t ind = 0; ind < 9; ++ind) {
  70. Int_t i = ind % 3;
  71. Int_t j = ind / 3;
  72. if (j > i) continue;
  73. fCovMatrix[iii++] = array[ind];
  74. }
  75. }
  76. /** Reset the member variables **/
  77. void Reset();
  78. private:
  79. /** Position coordinates [cm] **/
  80. Double32_t fX, fY, fZ;
  81. /** Chi2 of vertex fit **/
  82. Double32_t fChi2;
  83. /** Number of degrees of freedom of vertex fit **/
  84. Int_t fNDF;
  85. /** Number of tracks used for the vertex fit **/
  86. Int_t fNTracks;
  87. /** Covariance matrix for x, y, and z stored in an array. The
  88. ** sequence is a[0,0], a[0,1], a[0,2], a[1,1], a[1,2], a[2,2]
  89. **/
  90. Double32_t fCovMatrix[6];
  91. TArrayI *fTrInd; // indices of tracks used for the vertex fit
  92. ClassDef(MpdVertex,1);
  93. };
  94. #endif