MpdVector.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef MPD_VECTOR_H
  2. #define MPD_VECTOR_H
  3. /// \class MpdVector
  4. ///
  5. /// Cellular automaton track object for the MPD inner tracking system
  6. /// \author Alexander Zinchenko, Maxim Strelchenko (LHEP, JINR, Dubna)
  7. #include "MpdItsKalmanTrack.h"
  8. #include "MpdKalmanHit.h"
  9. #include "MpdKalmanTrack.h"
  10. //#include "MpdStsHit.h"
  11. #include "FairTask.h"
  12. #include <TArrayI.h>
  13. #include "TClonesArray.h"
  14. #include "TMath.h"
  15. #include "TString.h"
  16. #include "TVector3.h"
  17. class MpdKalmanHit;
  18. class MpdKalmanTrack;
  19. class MpdItsKalmanTrack;
  20. class MpdVector :public TObject
  21. {
  22. public:
  23. enum HitType {kFixedP, kFixedR, kFixedZ};
  24. public:
  25. /** Constructor **/
  26. MpdVector();
  27. MpdVector (Int_t detID, Int_t nDim, HitType hitType, TVector3 &meas, Double_t *err, Double_t *cossin, Double_t signal, Double_t dist, Int_t index, Int_t index1, Int_t trackNo, MpdVector* pointer, MpdKalmanHit* hit);
  28. MpdVector (const MpdVector& hit); ///< copy constructor
  29. /** Destructor **/
  30. virtual ~MpdVector();
  31. void SetDetectorID(Int_t detID) { fDetectorID = detID; } ///< set detector ID
  32. void SetNofDim(Int_t nDim) { fNofDim = nDim; } ///< set number of measur. / point
  33. void SetType(HitType type) { fHitType = type; } ///< Set hit type
  34. void SetFlag(Int_t flag) { fFlag = flag; } ///< Set flag
  35. void SetMirror() { fFlag += 1000*TMath::Sign(1,fFlag); } ///< set mirror flag
  36. void SetLength(Double_t leng) { fLength = leng; } ///< set track length
  37. void SetMeas(Int_t indx, Double_t meas) { fMeas[indx] = meas; } ///< set measurement
  38. void SetErr(Int_t indx, Double_t err) { fErr[indx] = err; } ///< set measurement error
  39. void SetCosSin(Int_t indx, Double_t cos) { fCosSin[indx] = cos; } ///< set cos(angle) or sin(angle)
  40. void SetSignal(Double_t signal) { fSignal = signal; } ///< set signal value
  41. void SetDist(Double_t dist) { fDist = dist; } ///< set distance
  42. void SetPos(Double_t pos) { fDist = pos; } ///< set distance
  43. void SetIndex(Int_t indx); ///< Add index of detector hit
  44. void SetPrevTrack(Int_t indx) { fTrackNo = indx; } ///< Set track number from previous Layer
  45. void SetCode(TString code) { fCode = code; } ///< set track code
  46. void SetCode(Int_t icode) { fCode += icode; fCode += "-"; } ///< set track code
  47. ///
  48. void SetPrevTrackPointer(MpdVector* pointer) { fTrackPointer = pointer; } ///< Set track pointer from previous layer
  49. /// added 21.2.20
  50. void SetDeltaZ(Double_t dz) { deltaz = dz; } ///< set deltaz value
  51. ///
  52. void SetKalmanHit(MpdKalmanHit* hit) {fKalmanHit = hit; } ///< Set Kalman hit pointer for current layer
  53. Int_t GetDetectorID() const { return fDetectorID; } ///< get detector ID
  54. Int_t GetLayer() const { return Int_t(fDetectorID/1000000); } ///< get layer No.
  55. HitType GetType() const { return fHitType; } ///< Get hit type
  56. Int_t GetNofDim() const { return fNofDim; } ///< get number of measur. per point
  57. Int_t GetIndex(Int_t indx = 0) const { return fIndex[indx]; } ///< Get index of detector hit
  58. TArrayI* Index() { return &fIndex; } ///< Get index array of detector hit
  59. Int_t GetFlag() const { return fFlag; } ///< Get flag
  60. Bool_t IsMirror() const { return fFlag / 1000; } ///< Get mirror flag
  61. Double_t GetLength() const { return fLength; } ///< Get track length
  62. Double_t GetErr(Int_t indx) const { return fErr[indx]; } ///< Get measurement error
  63. Double_t GetCosSin(Int_t indx) const { return fCosSin[indx]; } ///< Cos (Sin)
  64. Double_t GetPhi() const { return TMath::ATan2(fCosSin[1],fCosSin[0]); } ///< angle
  65. Double_t GetSignal() const { return fSignal; } ///< Signal value
  66. Double_t GetDist() const { return fDist; } ///< Distance to interaction point
  67. Double_t GetPos() const; ///< Distance to interaction point
  68. TString GetCode() const { return fCode; } ///< track code
  69. //Double_t GetXY(Int_t indx) const { return fXY[indx]; } ///< get wire X or Y
  70. Bool_t IsSortable() const { return kTRUE; }
  71. Int_t Compare(const TObject* hit) const; ///< sort in descending order in detector ID, "Compare" function for sorting
  72. void Print(Option_t *opt); ///< print hit info
  73. TVector3 GetMeas() const { return fMeas; } ///< Get measurement
  74. Int_t GetPrevTrack() const { return fTrackNo; } ///< Get track number from previous Layer
  75. ///
  76. MpdVector* GetPrevTrackPointer() const { return fTrackPointer; } ///< Get track pointer from previous layer
  77. /// added 21.2.20
  78. Double32_t GetDeltaZ() const { return deltaz; } ///< Get deltaz for current candidate
  79. ///
  80. MpdKalmanHit* GetKalmanHit() const { return fKalmanHit; } ///< Get Kalman hit pointer for current layer
  81. private:
  82. Int_t fDetectorID; ///< detector ID
  83. Int_t fFlag; ///< flag
  84. TArrayI fIndex; ///< MC point indices
  85. HitType fHitType; ///< hit type
  86. Int_t fNofDim; ///< number of measurements per point
  87. Double32_t fLength; ///< track length (temporary entry)
  88. Double32_t fErr[2]; ///< measurement errors
  89. Double32_t fCosSin[4]; ///< rotation factors (for stereo measurements)
  90. Double32_t fSignal; ///< signal
  91. Double32_t fDist; ///< distance to interaction point
  92. TVector3 fMeas;///< measurements
  93. Int_t fTrackNo; ///< track number from previous layer
  94. TString fCode; ///< track code (sequence of 2D-hit indices)
  95. ///
  96. MpdVector* fTrackPointer; //! track pointer from previous layer
  97. /// added 21.2.20
  98. Double32_t deltaz; ///< delta z
  99. ///
  100. MpdKalmanHit* fKalmanHit; //! Kalman Hit of Vector on current layer
  101. ClassDef(MpdVector, 1);
  102. };
  103. #endif