00001
00002
00003 #ifndef STETGRIDKEY_H
00004 #define STETGRIDKEY_H
00005
00006 #include <ostream>
00007
00008 class StEtGridKey {
00009
00010 public:
00011 StEtGridKey() : iEta(0), iPhi(0) {};
00012 StEtGridKey(int ie, int ip) : iEta(ie), iPhi(ip) {};
00013
00014 friend std::ostream& operator<<(std::ostream& os, const StEtGridKey& key)
00015 {
00016 return os << "iEta:\t" << key.iEta << "\tiPhi:\t" << key.iPhi;
00017 }
00018
00019 friend bool operator<(const StEtGridKey& lhs, const StEtGridKey& rhs){
00020 if (lhs.iEta < rhs.iEta) return true;
00021 else if (lhs.iEta > rhs.iEta) return false;
00022 else return lhs.iPhi < rhs.iPhi;
00023 }
00024
00025 friend bool operator==(const StEtGridKey& lhs, const StEtGridKey& rhs){
00026 return !( lhs < rhs ) && !( rhs < lhs);
00027 }
00028
00029 friend struct StEtGridKeyLessThan;
00030
00031 int eta() const { return iEta; }
00032 int phi() const { return iPhi; }
00033
00034 private:
00035 int iEta;
00036 int iPhi;
00037 };
00038
00039
00040 #endif // STETGRIDKEY_H