//====================================================================== // File and Version Information: // $Id:$ // // Class TwoCoordIndex // // Software developed for the BaBar Detector at the SLAC B-Factory. // Adapted for the PANDA experiment at GSI // // Class to hold coordinate and index information // for system in which two co-ordinates specifies a channel uniquely. // (Simplified version of class taken from BABAR framework) // It is convenient to use 2-coordinate index to describe barel part of EMC // to search for neigbour crystals in clustering algorithms // // // Author List: // // Phil Strother Imperial College // Stephen J. Gowdy University of Edinburgh // Dima Melnichuk - adaption for PANDA // //====================================================================== #ifndef TWOCOORDINDEX_HH #define TWOCOORDINDEX_HH //--------------- // C++ Headers -- //--------------- #include "stdlib.h" //#include #include "TObject.h" #include "NeighbourStore.h" class TwoCoordIndex: public TObject { public: // Constructors TwoCoordIndex(); TwoCoordIndex( long theXcoord, long theYcoord, long theIndex ); // Destructors // destructor in base class virtual ~TwoCoordIndex(); // Operators bool operator==( const TwoCoordIndex& c ) const { return index==c.index; } bool operator!=( const TwoCoordIndex& c ) const { return index!=c.index; } virtual const NeighbourStore itsNeighbours() const; long itsXCoord() const {return itsCoords[0];} long itsYCoord() const {return itsCoords[1];} long itsIndex() const {return index;} virtual void addToNeighbourList(TwoCoordIndex *); //check if 2 tci are neigbour or not bool isNeighbour(TwoCoordIndex* _tci); protected: long itsCoords[2]; long index; NeighbourStore theNeighbours; private: ClassDef(TwoCoordIndex,1) }; #endif // TWOCOORDINDEX_HH