MpdKalmanHit.h 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef MPDKALMANHIT_H
  2. #define MPDKALMANHIT_H
  3. /// \ingroup rec
  4. /// \class MpdKalmanHit
  5. /// \brief MPD hit for Kalman tracking
  6. ///
  7. /// \author Alexander Zinchenko, LHEP JINR Dubna
  8. #include <TArrayI.h>
  9. #include <TMath.h>
  10. #include <TObject.h>
  11. class MpdKalmanHit : public TObject
  12. {
  13. public:
  14. enum HitType {kFixedP, kFixedR, kFixedZ};
  15. enum HitFlag {kUsed = 1, kMirror = 2, kMlem = 4, kOverflow = 8, kEdge = 16,
  16. kVirtual = 32};
  17. public:
  18. MpdKalmanHit(); ///< Default ctor
  19. MpdKalmanHit(Int_t detID, Int_t nDim, HitType hitType, Double_t *meas, Double_t *err, Double_t *cosSin, Double_t signal, Double_t dist, Int_t index, Double_t edge = 99.); ///< Ctor
  20. MpdKalmanHit (const MpdKalmanHit& hit); ///< copy constructor
  21. virtual ~MpdKalmanHit(); ///< Destructor
  22. Int_t GetDetectorID() const { return fDetectorID; } ///< get detector ID
  23. Int_t GetLayer() const { return Int_t(fDetectorID/1000000); } ///< get layer No.
  24. HitType GetType() const { return fHitType; } ///< Get hit type
  25. Int_t GetNofDim() const { return fNofDim; } ///< get number of measur. per point
  26. Int_t GetIndex(Int_t indx = 0) const { return fIndex[indx]; } ///< Get index of detector hit
  27. TArrayI* Index() { return &fIndex; } ///< Get index array of detector hit
  28. Int_t GetFlag() const { return fFlag; } ///< Get flag
  29. //Bool_t IsMirror() const { return fFlag / 1000; } ///< Get mirror flag
  30. Bool_t IsMirror() const { return fFlag & kMirror; } ///< Get mirror flag
  31. Double_t GetLength() const { return fLength; } ///< Get track length
  32. Double_t GetMeas(Int_t indx) const { return fMeas[indx]; } ///< Get measurement
  33. Double_t GetErr(Int_t indx) const { return fErr[indx]; } ///< Get measurement error
  34. Double_t GetCosSin(Int_t indx) const { return fCosSin[indx]; } ///< Cos (Sin)
  35. Double_t GetPhi() const { return TMath::ATan2(fCosSin[1],fCosSin[0]); } ///< angle
  36. Double_t GetSignal() const { return fSignal; } ///< Signal value
  37. Double_t GetDist() const { return fDist; } ///< Distance to interaction point
  38. Double_t GetPos() const; ///< Distance to interaction point
  39. Double_t GetEdge() const { return fEdge; } ///< Distance to sector boundary
  40. //Double_t GetXY(Int_t indx) const { return fXY[indx]; } ///< get wire X or Y
  41. void SetDetectorID(Int_t detID) { fDetectorID = detID; } ///< set detector ID
  42. void SetNofDim(Int_t nDim) { fNofDim = nDim; } ///< set number of measur. / point
  43. void SetType(HitType type) { fHitType = type; } ///< Set hit type
  44. void SetFlag(Int_t flag) { fFlag = flag; } ///< Set flag
  45. //void SetMirror() { fFlag += 1000*TMath::Sign(1,fFlag); } ///< set mirror flag
  46. void SetMirror() { fFlag |= kMirror; } ///< set mirror flag
  47. void SetLength(Double_t leng) { fLength = leng; } ///< set track length
  48. void SetMeas(Int_t indx, Double_t meas) { fMeas[indx] = meas; } ///< set measurement
  49. void SetErr(Int_t indx, Double_t err) { fErr[indx] = err; } ///< set measurement error
  50. void SetCosSin(Int_t indx, Double_t cos) { fCosSin[indx] = cos; } ///< set cos(angle) or sin(angle)
  51. void SetSignal(Double_t signal) { fSignal = signal; } ///< set signal value
  52. void SetDist(Double_t dist) { fDist = dist; } ///< set distance
  53. void SetPos(Double_t pos) { fDist = pos; } ///< set distance
  54. void SetIndex(Int_t indx); ///< Add index of detector hit
  55. void SetEdge(Double_t edge) { fEdge = edge; } ///< set distance to sector boundary
  56. Bool_t IsSortable() const { return kTRUE; }
  57. Int_t Compare(const TObject* hit) const; ///< sort in descending order in detector ID
  58. void Print(Option_t *opt); ///< print hit info
  59. private:
  60. Int_t fDetectorID; ///< detector ID
  61. Int_t fFlag; ///< flag
  62. //Int_t fIndex; ///< MC point index
  63. TArrayI fIndex; ///< MC point indices
  64. HitType fHitType; ///< hit type
  65. Int_t fNofDim; ///< number of measurements per point
  66. //Bool_t fMirror; ///< flag for mirror hit (left-right ambiguity)
  67. Double32_t fLength; ///< track length (temporary entry)
  68. Double32_t fMeas[2]; ///< measurements
  69. Double32_t fErr[2]; ///< measurement errors
  70. Double32_t fCosSin[2]; ///< rotation factors (for stereo measurements)
  71. Double32_t fSignal; ///< signal
  72. Double32_t fDist; ///< distance to interaction point
  73. Double32_t fEdge; ///< distance to sector boundary
  74. //Double_t fXY[2]; ///< X and Y of some point on the wire (for stereo measurements)
  75. ClassDef(MpdKalmanHit,4);
  76. };
  77. #endif