MpdV0.cxx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #include "MpdV0.h"
  2. //Default constructor
  3. MpdV0::MpdV0()
  4. : TNamed("V0", "Global"),
  5. fID0(0),
  6. fID1(0),
  7. fID2(0),
  8. fB(0),
  9. fchi2(0),
  10. fmass(0),
  11. fcosa(0),
  12. fDCA(0),
  13. fPx(0),
  14. fPy(0),
  15. fPz(0),
  16. fRx(0),
  17. fRy(0),
  18. fRz(0),
  19. fX(0),
  20. fY(0),
  21. fZ(0){}
  22. //__________________________________________________________________________
  23. //Constructor with name and title
  24. MpdV0::MpdV0(const char* name, const char* title) : TNamed(name, title),
  25. fID0(0),
  26. fID1(0),
  27. fID2(0),
  28. fB(0),
  29. fchi2(0),
  30. fmass(0),
  31. fcosa(0),
  32. fDCA(0),
  33. fPx(0),
  34. fPy(0),
  35. fPz(0),
  36. fRx(0),
  37. fRy(0),
  38. fRz(0),
  39. fX(0),
  40. fY(0),
  41. fZ(0) {}
  42. //__________________________________________________________________________
  43. //constructor with all parameters
  44. MpdV0::MpdV0(const char* name, const char* title,
  45. Double_t vtx[3], Double_t chi2, Double_t p[3],
  46. Double_t DCA, Double_t cosa, Double_t mass,
  47. Double_t r[3] , Int_t B, Int_t id1, Int_t id2, Int_t id0) : TNamed(name, title) {
  48. fID0 = id0;
  49. fID1 = id1;
  50. fID2 = id2;
  51. fB = B;
  52. fchi2 = chi2;
  53. fmass = mass;
  54. fcosa = cosa;
  55. fDCA = DCA;
  56. fPx = p[0];
  57. fPy = p[1];
  58. fPz = p[2];
  59. fRx = r[0];
  60. fRy = r[1];
  61. fRz = r[2];
  62. fX = vtx[0];
  63. fY = vtx[1];
  64. fZ = vtx[2];
  65. }
  66. //__________________________________________________________________________
  67. MpdV0::~MpdV0(){};
  68. void MpdV0::SetV0(
  69. Double_t vtx[3], Double_t chi2, Double_t p[3],
  70. Double_t DCA, Double_t cosa, Double_t mass,
  71. Double_t r[3] , Int_t B, Int_t id1, Int_t id2, Int_t id0){
  72. fID0 = id0;
  73. fID1 = id1;
  74. fID2 = id2;
  75. fB = B;
  76. fchi2 = chi2;
  77. fmass = mass;
  78. fcosa = cosa;
  79. fDCA = DCA;
  80. fPx = p[0];
  81. fPy = p[1];
  82. fPz = p[2];
  83. fRx = r[0];
  84. fRy = r[1];
  85. fRz = r[2];
  86. fX = vtx[0];
  87. fY = vtx[1];
  88. fZ = vtx[2];
  89. }
  90. MpdV0 & MpdV0::operator=(const MpdV0& V0) {
  91. if (this == &V0) return *this;
  92. }
  93. Double_t* MpdV0::GetPxPyPz(Double_t p[3]) {
  94. p[0] = fPx;
  95. p[1] = fPy;
  96. p[2] = fPz;
  97. return p;
  98. }
  99. Double_t* MpdV0::GetXYZ(Double_t vtx[3]) {
  100. vtx[0] = fX ;
  101. vtx[1] = fY ;
  102. vtx[2] = fZ;
  103. return vtx;
  104. }
  105. Double_t MpdV0::GetP(){
  106. Double_t P = TMath::Sqrt(fPx*fPx + fPy*fPy + fPz*fPz);
  107. return P;
  108. }
  109. Double_t MpdV0::GetDist() {
  110. Double_t dist = TMath::Sqrt(fRx * fRx + fRy * fRy + fRz * fRz);
  111. return dist;
  112. }
  113. ClassImp(MpdV0)