TpcTimeBin.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _TPCTIMEBIN_H_
  2. #define _TPCTIMEBIN_H_
  3. #include <TObject.h>
  4. class TpcTimeBin : public TObject
  5. {
  6. private:
  7. Int_t fQ;
  8. public:
  9. TpcTimeBin(void) : fQ(0)
  10. {}
  11. TpcTimeBin(Long_t anQ) : fQ(anQ)
  12. {}
  13. virtual ~TpcTimeBin(void) {}
  14. // *** Accessors ***
  15. Int_t GetQ() const { return fQ; }
  16. void SetQ(Int_t q) { fQ = q; }
  17. // *** Operators ***
  18. bool operator<(const TpcTimeBin &rhs) const {
  19. return fQ < rhs.fQ;
  20. }
  21. bool operator>(const TpcTimeBin &rhs) const {
  22. return rhs < *this;
  23. }
  24. bool operator==(const TpcTimeBin &rhs) const {
  25. return !(*this < rhs) && !(*this > rhs);
  26. }
  27. bool operator!=(const TpcTimeBin &rhs) const {
  28. return (*this < rhs) || (*this > rhs);
  29. }
  30. static Int_t CompareQ(const TObject *obj1, const TObject *obj2) {
  31. TpcTimeBin *tb1 = (TpcTimeBin *)obj1;
  32. TpcTimeBin *tb2 = (TpcTimeBin *)obj2;
  33. return tb1->GetQ() - tb2->GetQ();
  34. }
  35. ClassDef(TpcTimeBin, 1)
  36. };
  37. #endif // _TPCTIMEBIN_H_