// MuoIndex.hpp // // Purpose: Container for ID information // relevant to a single element in // the muon system // // Created: May 1998 Michael R. Fortner // DH 5/01 add/change isValid methods #ifndef MUO_MUOINDEX #define MUO_MUOINDEX #include "muon_index/MuoSectionIndex.hpp" #include "muon_index/MuoCellIndex.hpp" #include #include namespace Muon { class MuoIndex { public: // Default Constructor MuoIndex(); // Normal Constructor MuoIndex(const MuoSectionIndex& section, const MuoCellIndex& cell); // Detailed Constructor MuoIndex(int region, int type, int layer, int octant, int barrel, int plane, int eta, int phi, int tube); // Constructor from vector with detailed attributes MuoIndex(std::vector vatt); // Copy Constructor MuoIndex(const MuoIndex& id); // Assignment MuoIndex& operator=(const MuoIndex& id); // Destructor ~MuoIndex(); // Accessors const MuoSectionIndex& section() const; const MuoCellIndex& cell() const; int region() const; int type() const; int layer() const; int octant() const; int barrel() const; int plane() const; int eta() const; int phi() const; int tube() const; bool isValid() const; bool isValid(const int modID,const int chanID) const; // Print friend std::ostream& operator<<(std::ostream& os, const MuoIndex& id); void print (std::ostream &os) const; private: MuoSectionIndex _section; // identify the section MuoCellIndex _cell; // identify the cell in the section }; inline const MuoSectionIndex& MuoIndex::section() const { return _section; } inline const MuoCellIndex& MuoIndex::cell() const { return _cell; } inline int MuoIndex::region() const { return _section.region(); } inline int MuoIndex::type() const { return _section.type(); } inline int MuoIndex::layer() const { return _section.layer(); } inline int MuoIndex::octant() const { return _section.octant(); } inline int MuoIndex::barrel() const { return _section.barrel(); } inline int MuoIndex::plane() const { return _cell.plane(); } inline int MuoIndex::eta() const { return _cell.eta(); } inline int MuoIndex::phi() const { return _cell.phi(); } inline int MuoIndex::tube() const { return _cell.tube(); } // External functions; values from most significant to least significant: // section, cell. // Equality bool operator==(const MuoIndex& id1, const MuoIndex& id2); // Inequality bool operator!=(const MuoIndex& id1, const MuoIndex& id2); // Greater-Than bool operator>(const MuoIndex& id1, const MuoIndex& id2); // Greater-or-Equal bool operator>=(const MuoIndex& id1, const MuoIndex& id2); // Less-Than bool operator<(const MuoIndex& id1, const MuoIndex& id2); // Less-or-Equal bool operator<=(const MuoIndex& id1, const MuoIndex& id2); } #endif