MpdCellTrack.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef MPD_CELLTRACK_H
  2. #define MPD_CELLTRACK_H
  3. /// \class MpdCellTrack
  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 MpdCellTrack :public TObject
  21. {
  22. public:
  23. enum HitType {kFixedP, kFixedR, kFixedZ};
  24. public:
  25. /** Constructor **/
  26. MpdCellTrack();
  27. MpdCellTrack (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);
  28. MpdCellTrack (const MpdCellTrack& hit); ///< copy constructor
  29. /** Destructor **/
  30. virtual ~MpdCellTrack();
  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. Int_t GetDetectorID() const { return fDetectorID; } ///< get detector ID
  48. Int_t GetLayer() const { return Int_t(fDetectorID/1000000); } ///< get layer No.
  49. HitType GetType() const { return fHitType; } ///< Get hit type
  50. Int_t GetNofDim() const { return fNofDim; } ///< get number of measur. per point
  51. Int_t GetIndex(Int_t indx = 0) const { return fIndex[indx]; } ///< Get index of detector hit
  52. TArrayI* Index() { return &fIndex; } ///< Get index array of detector hit
  53. Int_t GetFlag() const { return fFlag; } ///< Get flag
  54. Bool_t IsMirror() const { return fFlag / 1000; } ///< Get mirror flag
  55. Double_t GetLength() const { return fLength; } ///< Get track length
  56. Double_t GetErr(Int_t indx) const { return fErr[indx]; } ///< Get measurement error
  57. Double_t GetCosSin(Int_t indx) const { return fCosSin[indx]; } ///< Cos (Sin)
  58. Double_t GetPhi() const { return TMath::ATan2(fCosSin[1],fCosSin[0]); } ///< angle
  59. Double_t GetSignal() const { return fSignal; } ///< Signal value
  60. Double_t GetDist() const { return fDist; } ///< Distance to interaction point
  61. Double_t GetPos() const; ///< Distance to interaction point
  62. TString GetCode() const { return fCode; } ///< track code
  63. //Double_t GetXY(Int_t indx) const { return fXY[indx]; } ///< get wire X or Y
  64. Bool_t IsSortable() const { return kTRUE; }
  65. Int_t Compare(const TObject* hit) const; ///< sort in descending order in detector ID, "Compare" function for sorting
  66. void Print(Option_t *opt); ///< print hit info
  67. TVector3 GetMeas() const { return fMeas; } ///< Get measurement
  68. Int_t GetPrevTrack() const { return fTrackNo; } ///< Get track number from previous Layer
  69. private:
  70. Int_t fDetectorID; ///< detector ID
  71. Int_t fFlag; ///< flag
  72. TArrayI fIndex; ///< MC point indices
  73. HitType fHitType; ///< hit type
  74. Int_t fNofDim; ///< number of measurements per point
  75. Double32_t fLength; ///< track length (temporary entry)
  76. Double32_t fErr[2]; ///< measurement errors
  77. Double32_t fCosSin[4]; ///< rotation factors (for stereo measurements)
  78. Double32_t fSignal; ///< signal
  79. Double32_t fDist; ///< distance to interaction point
  80. TVector3 fMeas;///< measurements
  81. Int_t fTrackNo; ///< track number from previous layer
  82. TString fCode; ///< track code (sequence of 2D-hit indices)
  83. ClassDef(MpdCellTrack, 1);
  84. };
  85. #endif