MpdStrawendcapHit.h 2.3 KB

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