MpdDchHit.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //------------------------------------------------------------------------------------------------------------------------
  2. #ifndef __MPD_DCH_HIT_H
  3. #define __MPD_DCH_HIT_H 1
  4. #include "FairHit.h"
  5. #include "TArrayI.h"
  6. //------------------------------------------------------------------------------------------------------------------------
  7. class MpdDchHit : public FairHit
  8. {
  9. public:
  10. MpdDchHit();
  11. MpdDchHit(Int_t detectorID, TVector3 pos, TVector3 dpos, Int_t refIndex, Int_t flag);
  12. MpdDchHit(Int_t detectorID, TVector3 pos, TVector3 dpos, Int_t refIndex);
  13. virtual ~MpdDchHit();
  14. void Print(const Option_t* opt = 0) const;
  15. /** Accessors **/
  16. Int_t GetFlag() const { return fFlag; } // get flag
  17. Int_t GetNofDim() const { return fNofDim; } // get number of measurements per point
  18. Int_t Overlap() const { return fIndex.GetSize()-1; } // get number of measurements per point
  19. Int_t GetIndex(Int_t indx = 0) const { return fIndex[indx]; } // get number of measurements per point
  20. Int_t GetLayer() const { return fDetectorID; } // get number of measurements per point
  21. Double_t GetPhi() const { return fPhi; } // get rotation angle
  22. Double_t GetMeas(Int_t indx = 0) const { return fMeas[indx]; } // get measurement
  23. Double_t GetError(Int_t indx = 0) const { return fError[indx]; } // get measurement
  24. const TArrayI* Index() const { return &fIndex; } ///< Get index array of the hit
  25. Double_t GetDrift(void) const {return fDriftLength; };
  26. void SetDrift(Double_t v) { fDriftLength = v; };
  27. Double_t GetWirePosition(void) const {return fWirePos; };
  28. void SetWirePosition(Double_t v) { fWirePos = v; };
  29. Double_t GetWireDelay(void) const {return fWireDelayLength; };
  30. void SetWireDelay(Double_t v) { fWireDelayLength = v; };
  31. Double_t GetTShift(void) const {return fTS; };
  32. void SetTShift(Double_t v) { fTS = v; };
  33. /** Modifiers **/
  34. void SetFlag(Int_t flag) { fFlag = flag; }
  35. void SetNofDim(Int_t dim) { fNofDim = dim; } // set number of measurements per point
  36. void SetPhi(Double_t phi) { fPhi = phi; } // set rotation angle
  37. void SetMeas(Double_t meas, Int_t indx = 0) { fMeas[indx] = meas; } // set measurement
  38. void SetError(Double_t err, Int_t indx = 0) { fError[indx] = err; } // set measurement
  39. void SetIndex(Int_t indx); ///< Add index of detector hit
  40. Bool_t IsSortable() const { return kTRUE; }
  41. Int_t Compare(const TObject* hit) const; ///< sort in ascending order in abs(Z)
  42. protected:
  43. Int_t fTrackID;
  44. Int_t fFlag; // Flag for general purposes [TDC, event tagging...]
  45. Int_t fNofDim; // number of measurements per point
  46. Double32_t fPhi; // tube rotation angle
  47. Double32_t fMeas[2]; // measurements (coordinates)
  48. Double32_t fError[2]; // measurement errors
  49. TArrayI fIndex; // array of indices of overlapped MC points
  50. Double32_t fDriftLength, fWirePos, fWireDelayLength, fTS;
  51. ClassDef(MpdDchHit,1)
  52. };
  53. //------------------------------------------------------------------------------------------------------------------------
  54. #endif