MpdFemtoXi.cxx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // Main class holding xi information
  3. //
  4. // C++ headers
  5. #include <limits>
  6. // MpdFemtoMaker headers
  7. #include "MpdFemtoXi.h"
  8. ClassImp(MpdFemtoXi)
  9. //_________________
  10. MpdFemtoXi::MpdFemtoXi() :
  11. MpdFemtoV0(),
  12. mCharge(false),
  13. mDecayVertexXiX(0), mDecayVertexXiY(0), mDecayVertexXiZ(0),
  14. mDcaXiDaughters(999), mDcaXiToPrimVertex(999),
  15. mMomXiX(0), mMomXiY(0), mMomXiZ(0),
  16. mChi2Xi(std::numeric_limits<unsigned char>::max()),
  17. mClXi(0),
  18. mBachelor(nullptr),
  19. mMomBacAtDca2DecayPointX(0), mMomBacAtDca2DecayPointY(0), mMomBacAtDca2DecayPointZ(0) {
  20. // Default constructor
  21. if (!mBachelor) {
  22. mBachelor = new MpdFemtoTrack();
  23. }
  24. }
  25. //_________________
  26. MpdFemtoXi::MpdFemtoXi(const MpdFemtoXi& xi) :
  27. MpdFemtoV0(xi),
  28. mCharge(xi.mCharge),
  29. mDecayVertexXiX(xi.mDecayVertexXiX),
  30. mDecayVertexXiY(xi.mDecayVertexXiY),
  31. mDecayVertexXiZ(xi.mDecayVertexXiZ),
  32. mDcaXiDaughters(xi.mDcaXiDaughters),
  33. mDcaXiToPrimVertex(xi.mDcaXiToPrimVertex),
  34. mMomXiX(xi.mMomXiX), mMomXiY(xi.mMomXiY), mMomXiZ(xi.mMomXiZ),
  35. mChi2Xi(xi.mChi2Xi),
  36. mBachelor(nullptr),
  37. mMomBacAtDca2DecayPointX(xi.mMomBacAtDca2DecayPointX),
  38. mMomBacAtDca2DecayPointY(xi.mMomBacAtDca2DecayPointY),
  39. mMomBacAtDca2DecayPointZ(xi.mMomBacAtDca2DecayPointZ) {
  40. // Copy bachelor info
  41. if (!mBachelor) {
  42. mBachelor = new MpdFemtoTrack(*xi.mBachelor);
  43. } else {
  44. mBachelor = xi.mBachelor;
  45. }
  46. }
  47. //_________________
  48. MpdFemtoXi& MpdFemtoXi::operator=(const MpdFemtoXi& xi) {
  49. // Assignment operator
  50. if (this != &xi) {
  51. mCharge = xi.mCharge;
  52. mDecayVertexXiX = xi.mDecayVertexXiX;
  53. mDecayVertexXiY = xi.mDecayVertexXiY;
  54. mDecayVertexXiZ = xi.mDecayVertexXiZ;
  55. mDcaXiDaughters = xi.mDcaXiDaughters;
  56. mDcaXiToPrimVertex = xi.mDcaXiToPrimVertex;
  57. mMomXiX = xi.mMomXiX;
  58. mMomXiY = xi.mMomXiY;
  59. mMomXiZ = xi.mMomXiZ;
  60. mChi2Xi = xi.mChi2Xi;
  61. if (!mBachelor) {
  62. mBachelor = new MpdFemtoTrack(*xi.mBachelor);
  63. } else {
  64. mBachelor = xi.mBachelor;
  65. }
  66. mMomBacAtDca2DecayPointX = xi.mMomBacAtDca2DecayPointX;
  67. mMomBacAtDca2DecayPointY = xi.mMomBacAtDca2DecayPointY;
  68. mMomBacAtDca2DecayPointZ = xi.mMomBacAtDca2DecayPointZ;
  69. }
  70. return *this;
  71. }
  72. //_________________
  73. MpdFemtoXi::~MpdFemtoXi() {
  74. if (mBachelor) delete mBachelor;
  75. }
  76. //_________________
  77. void MpdFemtoXi::updateXi() {
  78. // TODO:
  79. // Momentum and the logic of Xi decay point MUST be written here!!!!
  80. // Not yet done due to the lack of time.
  81. // For example, mMomBacAtDca2DecayPointX(Y,Z) should be calculated here
  82. }
  83. //_________________
  84. float MpdFemtoXi::alphaArmXi() const {
  85. float MomV0AlongXi = momV0() * momXi() / ptotXi();
  86. float MomBacAlongXi = momBac() * momXi() / ptotXi();
  87. return ( (MomBacAlongXi - MomV0AlongXi) / (MomBacAlongXi + MomV0AlongXi));
  88. }
  89. //_________________
  90. float MpdFemtoXi::ptArmXi() const {
  91. float MomBacAlongXi = momBac() * momXi() / ptotXi();
  92. return TMath::Sqrt(ptot2Bac() - MomBacAlongXi * MomBacAlongXi);
  93. }
  94. //_________________
  95. void MpdFemtoXi::setChi2Xi(const float& chi2) {
  96. if (chi2 < 0) {
  97. mChi2Xi = 0;
  98. } else {
  99. mChi2Xi = ((chi2 * 10) > std::numeric_limits<unsigned char>::max() ?
  100. std::numeric_limits<unsigned char>::max() :
  101. (unsigned char) (chi2 * 10));
  102. }
  103. }