StPicoTrack.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #ifndef StPicoTrack_hh
  2. #define StPicoTrack_hh
  3. class StMuTrack;
  4. class StPicoDst;
  5. #include "TObject.h"
  6. #include "StThreeVectorF.hh"
  7. #include "TVector2.h"
  8. #include <stdio.h>
  9. #include <math.h>
  10. // Macro to control EMC variables
  11. #define EMCON 1
  12. class StPicoTrack : public TObject {
  13. public:
  14. StPicoTrack();
  15. ~StPicoTrack();
  16. StPicoTrack(StMuTrack *, StMuTrack *, float, int, double,
  17. int, int, float*, float*, int*, int*);
  18. void Clear(const Option_t *opt="");
  19. virtual void Print(const Char_t *option = "") const; ///< Print track info
  20. Int_t id() const { return (Int_t)mId; }
  21. Float_t chi2() const { return (Float_t)mChi2/1000.; }
  22. Float_t chi2prob() const { return (Float_t)mChi2Prob/1000.;}
  23. StThreeVectorF gMom() const { return mGMomentum; }
  24. StThreeVectorF pMom() const { return mPMomentum; }
  25. StThreeVectorF origin() const { return StThreeVectorF(mOriginX/100.,mOriginY/100.,mOriginZ/100.); }
  26. Int_t flowFlag() const { return (Int_t)mFlowFlag; }
  27. // TVector2 Qi() const { return TVector2(mQXi, mQYi); }
  28. TVector2 Qi() const { return TVector2(-9999., -9999.); }
  29. Float_t dca() const { return (Float_t)mGDca/1000.; }
  30. Short_t charge() const { return (mNHitsFit>0) ? +1 : -1; }
  31. Int_t nHitsFit() const { return (mNHitsFit>0) ? (Int_t)mNHitsFit : (Int_t)(-1*mNHitsFit); }
  32. Int_t nHitsMax() const { return (Int_t)mNHitsMax; }
  33. Int_t nHitsDedx() const { return (Int_t)mNHitsDedx; }
  34. Float_t dEdx() const { return (Float_t)mDedx/1000.; }
  35. Float_t nSigmaPion() const { return (Float_t)mNSigmaPion/100.; }
  36. Float_t nSigmaKaon() const { return (Float_t)mNSigmaKaon/100.; }
  37. Float_t nSigmaProton() const { return (Float_t)mNSigmaProton/100.; }
  38. Float_t nSigmaElectron() const { return (Float_t)mNSigmaElectron/100.; }
  39. Int_t btofCellId() const { return (Int_t)mBTofCellId; }
  40. Int_t btofMatchFlag() const { return (Int_t)mBTofMatchFlag; }
  41. Float_t btof() const { return (Float_t)mBTof/1000.; }
  42. Float_t btofBeta() const { return (Float_t)mBTofBeta/20000.; }
  43. Float_t btofYLocal() const { return (Float_t)mBTofYLocal/1000.; }
  44. Float_t btofZLocal() const { return (Float_t)mBTofZLocal/1000.; }
  45. StThreeVectorF btofHisPos() const { return StThreeVectorF(mBTofHitPosX/100., mBTofHitPosY/100., mBTofHitPosZ/100.); }
  46. #if EMCON == 1
  47. Int_t bemcId() const { return (Int_t)mBEMCId; }
  48. Int_t adc0() const { return (Int_t)mBTOWADC0; }
  49. Float_t e0() const { return (Float_t)mBTOWE0/1000.; }
  50. Float_t e() const { return (Float_t)mBTOWE/1000.; }
  51. Float_t zDist() const { return (Float_t)mBEMCDistZ/100.; }
  52. Float_t phiDist() const { return (Float_t)mBEMCDistPhi/10000.; }
  53. Int_t nEta() const { return (Int_t)mBSMDNEta; }
  54. Int_t nPhi() const { return (Int_t)mBSMDNPhi; }
  55. Int_t btowId() const { return (Int_t)mBTOWId; }
  56. Int_t btowId2() const { return (Int_t)mBTOWId23/10; }
  57. Int_t btowId3() const { return (Int_t)mBTOWId23%10; }
  58. Float_t e1() const { return (Float_t)mBTOWE1/1000.; }
  59. Float_t e2() const { return (Float_t)mBTOWE2/1000.; }
  60. Float_t e3() const { return (Float_t)mBTOWE3/1000.; }
  61. Float_t etaTowDist() const { return (Float_t)mBTOWDistEta/10000.; }
  62. Float_t phiTowDist() const { return (Float_t)mBTOWDistPhi/10000.; }
  63. #else
  64. Int_t bemcId() const { return -9999; }
  65. Int_t adc0() const { return -9999; }
  66. Float_t e0() const { return -9999.; }
  67. Float_t e() const { return -9999.; }
  68. Float_t zDist() const { return -9999.; }
  69. Float_t phiDist() const { return -9999.; }
  70. Int_t nEta() const { return -9999; }
  71. Int_t nPhi() const { return -9999; }
  72. Int_t btowId() const { return -9999; }
  73. Int_t btowId2() const { return -9999; }
  74. Int_t btowId3() const { return -9999; }
  75. Float_t e1() const { return -9999.; }
  76. Float_t e2() const { return -9999.; }
  77. Float_t e3() const { return -9999.; }
  78. Float_t etaTowDist() const { return -9999.; }
  79. Float_t phiTowDist() const { return -9999.; }
  80. #endif
  81. protected:
  82. UShort_t mId; // track Id
  83. UShort_t mChi2; // chi2*1000
  84. UShort_t mChi2Prob; // chi2prob*1000
  85. StThreeVectorF mGMomentum; // Global momentum
  86. StThreeVectorF mPMomentum; // primary momentum, (0.,0.,0.) if none
  87. UChar_t mFlowFlag; // 1 - tpc EP, 2 - ftpc EP, 0 - none
  88. // Float_t mQXi; //
  89. // Float_t mQYi; // Q-vector for this track
  90. Short_t mOriginX; // global helix origin X * 100
  91. Short_t mOriginY; // global helix origin Y * 100
  92. Short_t mOriginZ; // global helix origin Z * 100
  93. UShort_t mGDca; // global dca*1000
  94. UShort_t mDedx; // dEdx*1000
  95. Char_t mNHitsFit; // q*nHitsFit
  96. UChar_t mNHitsMax; // nHitsMax
  97. UChar_t mNHitsDedx; // nHitsDedx
  98. Short_t mNSigmaPion; // nsigmaPi * 100
  99. Short_t mNSigmaKaon; // nsigmaK * 100
  100. Short_t mNSigmaProton; // nsigmaP * 100
  101. Short_t mNSigmaElectron; // nsigmaE * 100
  102. // BTOF variables
  103. Short_t mBTofCellId; // (tray-1)*192+(module-1)*6+(cell-1): -1 - no match
  104. UChar_t mBTofMatchFlag; // 0 - no match, 1 - one-to-one, 2 - one-to-multiple
  105. UShort_t mBTof; // time-Of-Flight * 1000 in ns
  106. UShort_t mBTofBeta; // beta * 20000
  107. Short_t mBTofYLocal; // ylocal * 1000
  108. Short_t mBTofZLocal; // zlocal * 1000
  109. Short_t mBTofHitPosX; // projected hit position X * 100
  110. Short_t mBTofHitPosY; // projected hit position Y * 100
  111. Short_t mBTofHitPosZ; // projected hit position Z * 100
  112. #if EMCON == 1
  113. // these variables are extracted from the standard BEMC cluster algorithm
  114. Short_t mBEMCId; // index in bemcPoint array
  115. Short_t mBTOWADC0; // adc0 higest adc in the cluster
  116. Short_t mBTOWE0; // E0*1000 highest tower in the cluster
  117. Short_t mBTOWE; // EMC point E*1000
  118. Short_t mBEMCDistZ; // z*100
  119. Short_t mBEMCDistPhi; // phi*10000
  120. UChar_t mBSMDNEta; // # of hits in eta
  121. UChar_t mBSMDNPhi; // # of hits in phi
  122. // these variables are purely from single tower or nearby towers
  123. Short_t mBTOWId; // projected tower Id 1-4800
  124. Char_t mBTOWId23; // emc 2nd and 3rd closest tower local id ( 2nd X 10 + 3rd), each id 0-8
  125. Short_t mBTOWE1; // E1*1000 matched (closest) tower E
  126. Short_t mBTOWE2; // E2*1000 2nd closest tower E
  127. Short_t mBTOWE3; // E3*1000 3rd closest tower E
  128. Short_t mBTOWDistEta; // eta*10000 distance between track and matched tower center
  129. Short_t mBTOWDistPhi; // phi*10000 distance between track and matched tower center
  130. #endif
  131. friend class StPicoDst;
  132. ClassDef(StPicoTrack, 1)
  133. };
  134. #endif