// MuoCellIndex.hpp // // Purpose: Container for ID information // relevant to a specific cell // within a section of the muon detector // // Created: May 1998 Michael R. Fortner // Modified: Aug 2000 M. Fortner - use unsigned char to hold data // May 2001 M. Fortner - add isValid method // DH 5/01 modify isValid method #ifndef MUON_MUOCELL #define MUON_MUOCELL #include #include "muon_index/MuoSectionIndex.hpp" namespace Muon { class MuoCellIndex { private: unsigned char _plane; // Scint: 0 // Wire A-Layer : 0,1,2,3 // Central A, Octant 5,6: 0,1,2 // Wire B/C-Layer : 0,1,2 unsigned char _eta; unsigned char _phi; // Wire: 0, Scint: 0-9 unsigned char _tube; public: // Default Constructor MuoCellIndex(); // Normal Constructor MuoCellIndex(const int plane, const int eta, const int phi, const int tube); // Copy Constructor MuoCellIndex(const MuoCellIndex& id); // Assignment MuoCellIndex& operator=(const MuoCellIndex& id); // Destructor ~MuoCellIndex(); // Accessors int plane() const; int eta() const; int phi() const; int tube() const; // Verification // bool isValid(const MuoSectionIndex& isect) const; bool isValid(const MuoSectionIndex& isect, const int chanID) const; // Print friend std::ostream& operator<<(std::ostream& os, const MuoCellIndex& id); void print (std::ostream &os) const; }; inline int MuoCellIndex::plane() const { return _plane; } inline int MuoCellIndex::eta() const { return _eta; } inline int MuoCellIndex::phi() const { return _phi; } inline int MuoCellIndex::tube() const { return _tube; } // External functions; values from most significant to least significant: // plane, eta, phi, tube. // Equality bool operator==(const MuoCellIndex& id1, const MuoCellIndex& id2); // Inequality bool operator!=(const MuoCellIndex& id1, const MuoCellIndex& id2); // Greater-Than bool operator>(const MuoCellIndex& id1, const MuoCellIndex& id2); // Greater-or-Equal bool operator>=(const MuoCellIndex& id1, const MuoCellIndex& id2); // Less-Than bool operator<(const MuoCellIndex& id1, const MuoCellIndex& id2); // Less-or-Equal bool operator<=(const MuoCellIndex& id1, const MuoCellIndex& id2); } #endif